From c36032e510efb3758be8fe30bb5db8c99ee8983f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=86=E4=B9=90?= <342503599@qq.com> Date: Wed, 24 Aug 2022 19:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=AE=A1=E7=90=86(=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E7=82=B9):=E5=B7=A1=E6=A3=80=E7=82=B9=E5=A2=9E?= =?UTF-8?q?=E5=88=A0=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/deepFoundationPitManage/dataConfig.js | 8 +- src/assets/images/menu/saosao.png | Bin 0 -> 1866 bytes src/assets/js/api/deepFoundationPitManage.js | 1 + .../deepFoundationPitManage/dataConfig.vue | 2866 ++++++++++------- .../deepFoundationPitManage/monitorData.vue | 53 +- .../projectFront/inspecPoint/inspection.vue | 106 +- 6 files changed, 1805 insertions(+), 1229 deletions(-) create mode 100644 src/assets/images/menu/saosao.png diff --git a/src/assets/i18n/langs/cn/deepFoundationPitManage/dataConfig.js b/src/assets/i18n/langs/cn/deepFoundationPitManage/dataConfig.js index d52f999e..c3bfaf91 100644 --- a/src/assets/i18n/langs/cn/deepFoundationPitManage/dataConfig.js +++ b/src/assets/i18n/langs/cn/deepFoundationPitManage/dataConfig.js @@ -68,16 +68,16 @@ export default { hint: '提示', hintContent: '此操作将永久删除该文件, 是否继续?', safeLvList: [{ - label: '一级', + label: '正常', value: 1 },{ - label: '二级', + label: '超报警', value: 2 },{ - label: '三级', + label: '超控制', value: 3 },{ - label: '四级', + label: '变化速率报警', value: 4 }], allCheck: '全选', diff --git a/src/assets/images/menu/saosao.png b/src/assets/images/menu/saosao.png new file mode 100644 index 0000000000000000000000000000000000000000..27ebcce495500a40e6549c097ea2c4ce5392c5dd GIT binary patch literal 1866 zcmV-Q2etT#P)#U+2u3xepAJwD-=;nKS3(cRt=FJYg{N?9kyH7$+H6@JkEi zm;I9pjh~P`;-{2oI8%oGNQZRTk9Gh40~0=<9N-IoVC8W#(746TOs$I@ZdAyY>X4xJ>n_UfiR@`m*Ti^Tr z3saM{)Dv(kNKg29oFHZ)?lKoxiSSfkRq&?=$Ma)U!Y5u1?@mwCMWqdx;{k5^$t?PS zhQS+gGY6i4HGzmIT`bl+YtQ)keIDWH%nYqW47vf%`^RkZ2LwiTM9mx*0R(3PH#UD% zuqzmibk6n8RtgEdzh@Q`F-Spc-g;95{NB1YgP9CADr|9U%@UD@NqODhs zdlwFLlZ-PVZD=rLtc#X!wSsFEQG=|CIX7&|t05@WWJny>oT?~R6I z&Wv(!CCe%V*x)!{zStS)XpS=n^d(-DFW)~^E}PvIT~&iUUpBWJyss-NuWdtZRJq$P zIW)M=dmW0xRCZ8sls8AC^mNc_C*c|BYCNMK;@@F$l5lBVp?n7o{Cq73AwsMjGTqt$Z4FgRs;Ug?$QMgSQlCRZnu^N>tC-*03lNDVM!|Bzpv9Ys zOvzL6{D~;?ybE-!?=%~j^Yqax8nvuaxsn%!XJ=fZC8&z*Y>7KgDZgr34G7Ycs!zB75y<18ABRv&ng zxV|_8s@J+hYP0>-Hbz)0U~fHbv{h@YC&GGHC00=_ov>J-Pj7e&`cidpFYwxtbVh}S z39#$|CKD`Kg0FrC{#*lg?*hGXyrey@Wh$vEv|KUYxH=zcFGwXaul$(Ie{c_Q=CBYN zCCU{n{h{XX?4c_^0e3di;_JsvX@$Z>lfM{Dffr(=d*Nr_gRcIn2^gynP_nVHv_!J8qB7}< zG)VZNM#%IpYAz>lub2JbR!yU66pPB-PYN0S`eYjrDBX?R$2oy_ezM{h=fk>lrY;r< z<7{doMR7ZJcXgi2`6`MrJy{@OS?-zAGjYpt)nJ(D@*kQ0y2Drf^2sci{CKJl$mK>u zotvhi5SDqHsL23|(e%AGP!sg74IJURfYucZ#$e&fkh)KHo;Q_LYI{aD+w^02NQ1(1 zr(%*5<|D21pXQd=cy=(tT5BmZl|rgZ7D5|a^wUK9Bfn@^)KMkPoz}H+xE(AG7WdP- zU$~}hq+x8585avF^Q^gARX>feIysTCS{%;&_O|SWMh!{0yf~M?&F~K141mlDTHS0- zA08oyxVX*kbH21Ecsx_wr^NPLz88jUjUQntyhj0pr2doF1(**V z;y1&yy)0WZ&CPHTtI~n%+^S6lRXHyh{QATQZ;4y~S3nuRctNKpaN1Y7GoH{_UH_4j zdkm5QGA}>E9cy+%Rd@aVAF+ZlzJ9oci$@n}{c$q<2VO<@q}@c>$N&HU07*qoM6N<$ Eg5*AWiU0rr literal 0 HcmV?d00001 diff --git a/src/assets/js/api/deepFoundationPitManage.js b/src/assets/js/api/deepFoundationPitManage.js index 2e6ee467..35421554 100644 --- a/src/assets/js/api/deepFoundationPitManage.js +++ b/src/assets/js/api/deepFoundationPitManage.js @@ -14,6 +14,7 @@ export const selectMeasurePointListApi = data => post('xmgl/deepExcavationMeasur export const addDeepExcavationMeasurePointApi = data => post('xmgl/deepExcavationMeasurePoint/add', data); //添加深基坑-测点信息 export const deleteDeepExcavationMeasurePointApi = data => post('xmgl/deepExcavationMeasurePoint/delete', data); //删除深基坑-测点信息 export const getDetailDeepExcavationApi = data => get('/xmgl/deepExcavationMeasurePoint/getDetailsByMeasurePointNumber', data); //测点信息-测点管理-详情 +export const getSensorListApi = data => post('/xmgl/deepExcavationSensor/getSensorListByMeasurePointNumber', data); //通过测点编号查询传感器列表 export const selectDeepExcavationSensorTypeListApi = data => post('xmgl/deepExcavationSensorType/selectDeepExcavationSensorTypeList', data); //列表查询深基坑-传感器类型信息 diff --git a/src/views/projectFront/deepFoundationPitManage/dataConfig.vue b/src/views/projectFront/deepFoundationPitManage/dataConfig.vue index 701b34e8..21a30785 100644 --- a/src/views/projectFront/deepFoundationPitManage/dataConfig.vue +++ b/src/views/projectFront/deepFoundationPitManage/dataConfig.vue @@ -7,43 +7,67 @@
- {{$t('message.deepFoundConfig.addDeepFound2')}} + {{$t('message.deepFoundConfig.addDeepFound2')}}
-
+
{{$t('message.deepFoundConfig.monitorInfo')}} -
+
- - + --> @@ -54,31 +78,47 @@ - + class="pagerBox" + @size-change="SizeChange" + @current-change="CurrentChange" + :current-page="pagInfo.pageNo" + :page-sizes="$store.state.PAGESIZRS" + :page-size="pagInfo.pageSize" + layout="total, sizes, prev, pager, next" + :total="pagInfo.total" + background + >
- - - + + + 选择 - --> + --> - + v-model="dialogdata.startTime" + type="date" + value-format="yyyy-MM-dd" + :placeholder="$t('message.deepFoundConfig.changeTime')" + > - + - + v-model="dialogdata.endTime" + value-format="yyyy-MM-dd" + type="date" + :placeholder="$t('message.deepFoundConfig.changeTime')" + > - + - + :value="item.value" + > - + - + - + - + - + - + - + - + v-model="dialogdata.floorPourTime" + value-format="yyyy-MM-dd" + type="date" + :placeholder="$t('message.deepFoundConfig.floorBuildTime')" + >
@@ -207,10 +275,10 @@ :file-list="surveySchemeList" accept=".doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf" > - - - {{$t('message.deepFoundConfig.upload')}} - + + + {{$t('message.deepFoundConfig.upload')}} + @@ -225,55 +293,72 @@ :file-list="prospectingReportList" accept=".doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf" > - - - {{$t('message.deepFoundConfig.upload')}} - + + + {{$t('message.deepFoundConfig.upload')}} +
- -
- - - -
- - - -
- - - - {{$t('message.deepFoundConfig.allCheck')}} - - {{item.monitorTypeName}} - - + +
+ + +
+ + + +
+ + + + {{$t('message.deepFoundConfig.allCheck')}} + + {{item.monitorTypeName}} + +
-
+
- +
{{$t('message.deepFoundConfig.confirm')}} - + {{$t('message.deepFoundConfig.cancel')}}
@@ -298,116 +383,196 @@ > - --> - - + --> + + + width="80%" + :title="$t('message.deepFoundConfig.pointManage')" + class="dialog-center" + :visible.sync="showDetail" + :modal-append-to-body="false" + @close="closeDetail" + >
- + - + - + + --> - - - + + + + +
+ width="80%" + :title="$t('message.deepFoundConfig.realData')" + class="dialog-center" + :visible.sync="showActiveDetail" + :modal-append-to-body="false" + @close="closeActiveDetail" + >
+ + {{$t('message.deepFoundConfig.search')}}
- + - - + + + +
+ width="45%" + :title="isPreview ? $t('message.deepFoundConfig.details'):$t('message.deepFoundConfig.addPoint')" + class="dialog-center" + :visible.sync="showTestPoint" + :modal-append-to-body="false" + @close="closeDialog2" + >
@@ -489,30 +672,51 @@ label-width="120px" :rules="$t('message.deepFoundConfig.rules2')" > - - - + + + - - + + - - + + + --> + --> - - + + -->
-
- - - - - - - - - - - - - - - - - - - - - - - - - - +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
- 添加 - - - - + 添加 + +
- {{$t('message.deepFoundConfig.confirm')}} + {{$t('message.deepFoundConfig.confirm')}} - {{$t('message.deepFoundConfig.cancel')}} + {{$t('message.deepFoundConfig.cancel')}}
+ width="95%" + :title="$t('message.deepFoundConfig.pointDistribution')" + class="dialog-center" + :visible.sync="showPointMap" + :modal-append-to-body="false" + @close="closePointMap" + >
-
+
@@ -593,12 +848,21 @@
{{$t('message.deepFoundConfig.addLayoutImg')}}
    -
  • - +
  • +
    {{item.planeFigureName}} - {{$t('message.deepFoundConfig.remove')}} + {{$t('message.deepFoundConfig.remove')}}
@@ -607,12 +871,12 @@
- + {{$t('message.deepFoundConfig.stationing')}}
- + {{$t('message.deepFoundConfig.save')}}
@@ -628,113 +892,171 @@
- -
- -
    -
  • -
    - -
    {{item.measurePointName}}
    -
    -

    {{item2.keyName}}:{{item.currentdata[item2.key]}}

    - -

    {{$t('message.deepFoundConfig.gatherTime')}}:{{item.currentdata['receiveTime']}}

    + +
    + +
      +
    • +
      + +
      {{item.measurePointName}}
      +
      +

      {{item2.keyName}}:{{item.currentdata[item2.key]}}

      + +

      {{$t('message.deepFoundConfig.gatherTime')}}:{{item.currentdata['receiveTime']}}

      +
      -
    -
    - {{item.measurePointName}} -
    - -
  • -
-
-
- -
-
+
+ {{item.measurePointName}} +
+ + + +
+
+ +
+
+ width="35%" + :title="$t('message.deepFoundConfig.addImg')" + class="dialog-center" + :visible.sync="showAddImg" + @close="closeAddImg" + :modal-append-to-body="false" + >
- - - - - - - - - - - - - - -
- - - -
- - - -
+ + + + + + + + + + + + + +
+ + +
+ + + +
- {{$t('message.deepFoundConfig.confirm')}} - {{$t('message.deepFoundConfig.cancel')}} + {{$t('message.deepFoundConfig.confirm')}} + {{$t('message.deepFoundConfig.cancel')}}
-
- - -

- - - {{$t('message.deepFoundConfig.hintContent')}} -

- - {{$t('message.deepFoundConfig.cancel')}} - {{$t('message.deepFoundConfig.confirm')}} - -
+ + + +

+ + + {{$t('message.deepFoundConfig.hintContent')}} +

+ + {{$t('message.deepFoundConfig.cancel')}} + {{$t('message.deepFoundConfig.confirm')}} + +
@@ -761,40 +1083,55 @@ import { deleteDeepExcavationPlaneFigureApi, editDeepExcavationPlaneFigureCoordinateApi, getDetailDeepExcavationApi -} from "@/assets/js/api/deepFoundationPitManage.js" +} from "@/assets/js/api/deepFoundationPitManage.js"; export default { - data(){ - return{ - show:true, + data() { + return { + show: true, deleteInfo: false, isPreview: false, - testPointOptions:[], - rules3:{ + testPointOptions: [], + rules3: { planeFigureName: [ - { required: true, message: '请输入平面图名称', trigger: 'blur' } + { required: true, message: "请输入平面图名称", trigger: "blur" } ], pointIds: [ - { type: 'array', required: true, message: '请至少选择一个测点', trigger: 'change' } + { + type: "array", + required: true, + message: "请至少选择一个测点", + trigger: "change" + } ], fileList: [ - { type: 'array', required: true, message: '请上传示意图', trigger: 'blur' }, - { type: 'array', required: true, message: '请上传示意图', trigger: 'change' } + { + type: "array", + required: true, + message: "请上传示意图", + trigger: "blur" + }, + { + type: "array", + required: true, + message: "请上传示意图", + trigger: "change" + } ] }, - testPointImgForm:{ + testPointImgForm: { planeFigureName: "", fileList: [], pointIds: [] }, activeImgIndex: 0, - typeOptions:[], - deepImgList:[], - currentTableData:[], + typeOptions: [], + deepImgList: [], + currentTableData: [], activeDeep: 0, deepExcavationList: [], - currentPointDetail:[], - pointList:[], - pointStatus: 'none', + currentPointDetail: [], + pointList: [], + pointStatus: "none", pointTop: 0, pointLeft: 0, imgWidth: 0, @@ -805,92 +1142,107 @@ export default { pointIndex: "", showPointMap: false, showTestPoint: false, - testPointData:[], + testPointData: [], showDetail: false, - surveyPointDetail:[], - tableData:[], - pagInfo:{ + surveyPointDetail: [], + tableData: [], + pagInfo: { pageNo: 1, pageSize: 10, total: 1 }, - pagInfo2:{ + pagInfo2: { pageNo: 1, pageSize: 10, total: 1 }, - testPointForm:{ - measurePointNumber: '',// 测点编号 - measurePointName: '',// 测点名称 - measurePointAddr: '', // 测点位置 + testPointForm: { + measurePointNumber: "", // 测点编号 + measurePointName: "", // 测点名称 + measurePointAddr: "", // 测点位置 // sensorSn: '', // sensorTypeId: '', - sensorList:[ - { - sensorSn:'', // 传感器编号 - sensorTypeId:'', // 传感器类型 - earlyWarningValue:'', // 预警 - alarmValue:'', //报警 - controlValue:'',//控制 - } - ], // 传感器编号类型数组 + sensorList: [ + { + sensorSn: "", // 传感器编号 + sensorTypeId: "", // 传感器类型 + earlyWarningValue: "", // 预警 + alarmValue: "", //报警 + controlValue: "" //控制 + } + ] // 传感器编号类型数组 }, dialogVisible: false, dialogVisible2: false, formTitle: "", innerVisible: false, dialogImageUrl: "", - safeLvList:[{ - label: '一级', - value: 1 - },{ - label: '二级', - value: 2 - },{ - label: '三级', - value: 3 - },{ - label: '四级', - value: 4 - }], - rules:{ + safeLvList: [ + { + label: "一级", + value: 1 + }, + { + label: "二级", + value: 2 + }, + { + label: "三级", + value: 3 + }, + { + label: "四级", + value: 4 + } + ], + rules: { engineeringName: [ - { required: true, message: '请输入基坑名称', trigger: 'blur' } + { required: true, message: "请输入基坑名称", trigger: "blur" } ], - startTime:[ - { type: 'string', required: true, message: '请选择开工日期', trigger: 'change' } + startTime: [ + { + type: "string", + required: true, + message: "请选择开工日期", + trigger: "change" + } ], - endTime:[ - { type: 'string', required: true, message: '请选择完工日期', trigger: 'change' } + endTime: [ + { + type: "string", + required: true, + message: "请选择完工日期", + trigger: "change" + } ], foundationDitchDepth: [ - { required: true, message: '请输入基坑深度', trigger: 'blur' } + { required: true, message: "请输入基坑深度", trigger: "blur" } ], foundationDitchGirth: [ - { required: true, message: '请输入基坑周长', trigger: 'blur' } + { required: true, message: "请输入基坑周长", trigger: "blur" } ], excavationDepth: [ - { required: true, message: '请输入开挖深度', trigger: 'blur' } - ], + { required: true, message: "请输入开挖深度", trigger: "blur" } + ] }, - rules2:{ + rules2: { measurePointNumber: [ - { required: true, message: '请输入测点编号', trigger: 'blur' } + { required: true, message: "请输入测点编号", trigger: "blur" } ], measurePointName: [ - { required: true, message: '请输入测点名称', trigger: 'blur' } + { required: true, message: "请输入测点名称", trigger: "blur" } ], measurePointAddr: [ - { required: true, message: '请输入测点位置', trigger: 'blur' } + { required: true, message: "请输入测点位置", trigger: "blur" } ], sensorSn: [ - { required: true, message: '请输入采集仪编号', trigger: 'blur' } + { required: true, message: "请输入采集仪编号", trigger: "blur" } ], sensorTypeId: [ - { required: true, message: '请选择传感器类型', trigger: 'change' } - ], + { required: true, message: "请选择传感器类型", trigger: "change" } + ] }, - dialogdata:{ + dialogdata: { engineeringName: "", // projectAddress: "", startTime: "", @@ -905,188 +1257,203 @@ export default { floorPourTime: "" }, // fileList:[], - deviseDrawingList:[], - surveySchemeList:[], + deviseDrawingList: [], + surveySchemeList: [], prospectingReportList: [], - dialogTitle:"监测项管理", + dialogTitle: "监测项管理", checkAll: false, isIndeterminate: false, checkedContent: [], - contentList:[], + contentList: [], devNum: "", alarmStatus: "", - statusList: [{ - value: '0', - label: '正常' - },{ - value: '1', - label: '预警' - },{ - value: '2', - label: '报警' - },{ - value: '3', - label: '控制' - }], + statusList: [ + { + value: "0", + label: "正常" + }, + { + value: "1", + label: "预警" + }, + { + value: "2", + label: "报警" + }, + { + value: "3", + label: "控制" + } + ], showActiveDetail: false, devNum2: "", alarmStatus2: "", acquisitionTime: [], - startX: '', - startY: '', + startX: "", + startY: "", ratio: 1, - projectSn: '', - formType: '', // 1.新增基坑 2.编辑基坑 + projectSn: "", + formType: "", // 1.新增基坑 2.编辑基坑 editId: "", monitorTypeId: "", - relaId:'', + relaId: "", deepExcavationId: "", activeImgUrl: "", showAddImg: false, isEditPoint: false, - removeData: '', - removeType: '' - } + removeData: "", + removeType: "", + total: 0, + pageNo: 1, + pageSize: 10 + }; }, - created(){ + created() { this.projectSn = this.$store.state.projectSn; - this.getDefaultMonitorTypeList() - this.selectDeepExcavationList() - this.selectDeepExcavationSensorTypeList() + this.getDefaultMonitorTypeList(); + this.selectDeepExcavationList(); + this.selectDeepExcavationSensorTypeList(); }, - mounted(){ - }, - methods:{ - addRow(){ + mounted() {}, + methods: { + addRow() { let obj = { - sensorSn:'', - sensorTypeId:'', - earlyWarningValue:'', // 预警 - alarmValue:'', //报警 - controlValue:'',//控制 - } + sensorSn: "", + sensorTypeId: "", + earlyWarningValue: "", // 预警 + alarmValue: "", //报警 + controlValue: "" //控制 + }; // console.log('--------------',this.testPointForm.sensorList) - this.testPointForm.sensorList.push(obj) + this.testPointForm.sensorList.push(obj); }, - deleteRow(index){ + deleteRow(index) { this.testPointForm.sensorList.splice(index, 1); }, - checkMsg(){ + checkMsg() { // 1、布置图 2、测点 - if(this.removeType == 1){ - deleteDeepExcavationPlaneFigureApi({id: this.removeData.id}).then(res=>{ - if(res.code == 200){ + if (this.removeType == 1) { + deleteDeepExcavationPlaneFigureApi({ id: this.removeData.id }).then( + res => { + if (res.code == 200) { // 删除成功! - this.$message.success(this.$t('message.deepFoundConfig.removeSuccess')) - this.activeImgUrl = '' - this.pointList = [] - this.selectDeepExcavationPlaneFigureList() + this.$message.success( + this.$t("message.deepFoundConfig.removeSuccess") + ); + this.activeImgUrl = ""; + this.pointList = []; + this.selectDeepExcavationPlaneFigureList(); } - }) - } else if(this.removeType == 2){ - deleteDeepExcavationMeasurePointApi({id: this.removeData.id}).then(res=>{ - if(res.code == 200 && res.success){ - this.$message.success(this.$t('message.deepFoundConfig.removeSuccess')) - this.selectMeasurePointList() } - }) + ); + } else if (this.removeType == 2) { + deleteDeepExcavationMeasurePointApi({ + measurePointNumber: this.removeData.measurePointNumber + }).then(res => { + if (res.code == 200 && res.success) { + this.$message.success( + this.$t("message.deepFoundConfig.removeSuccess") + ); + this.selectMeasurePointList(); + } + }); } - this.deleteInfo = false + this.deleteInfo = false; }, - closeMsg(val){ - if(val == 1){ + closeMsg(val) { + if (val == 1) { // 已取消删除 - this.$message.info(this.$t('message.deepFoundConfig.cancelRemove')) + this.$message.info(this.$t("message.deepFoundConfig.cancelRemove")); } - this.removeType = '' - this.removeData = '' - this.deleteInfo = false + this.removeType = ""; + this.removeData = ""; + this.deleteInfo = false; }, - closeActiveDetail(){ - this.devNum2 = "" - this.alarmStatus2 = "" - this.showActiveDetail = false - this.selectDeepExcavationMonitorTypeList() + closeActiveDetail() { + this.devNum2 = ""; + this.alarmStatus2 = ""; + this.showActiveDetail = false; + this.selectDeepExcavationMonitorTypeList(); }, - closeDetail(){ - this.selectDeepExcavationMonitorTypeList() - this.devNum = "" - this.alarmStatus = "" - this.showDetail = false + closeDetail() { + this.selectDeepExcavationMonitorTypeList(); + this.devNum = ""; + this.alarmStatus = ""; + this.showDetail = false; }, - closePointMap(){ - this.activeImgUrl = '' - this.showPointMap = false + closePointMap() { + this.activeImgUrl = ""; + this.showPointMap = false; }, - filterLeave(val){ - console.log(val) - let text = '' + filterLeave(val) { + console.log(val); + let text = ""; // 一级 二级 三级 四级 五级 - switch(val){ - case '1': - text = this.$t('message.deepFoundConfig.lv1'); + switch (val) { + case "1": + text = this.$t("message.deepFoundConfig.lv1"); break; - case '2': - text = this.$t('message.deepFoundConfig.lv2'); + case "2": + text = this.$t("message.deepFoundConfig.lv2"); break; - case '3': - text = this.$t('message.deepFoundConfig.lv3'); + case "3": + text = this.$t("message.deepFoundConfig.lv3"); break; - case '4': - text = this.$t('message.deepFoundConfig.lv4'); + case "4": + text = this.$t("message.deepFoundConfig.lv4"); + break; + case "5": + text = this.$t("message.deepFoundConfig.lv5"); break; - case '5': - text = this.$t('message.deepFoundConfig.lv5'); - break; } - console.log(text) - return text + console.log(text); + return text; }, - editPoint(){ - this.isEditPoint = true + editPoint() { + this.isEditPoint = true; // 成功 请开始移动点位! this.$notify({ - title: this.$t('message.deepFoundConfig.success'), - message: this.$t('message.deepFoundConfig.notifyMsg'), - type: 'success' + title: this.$t("message.deepFoundConfig.success"), + message: this.$t("message.deepFoundConfig.notifyMsg"), + type: "success" }); }, - savePoint(){ - console.log(this.pointList) - let arr = [] - this.pointList.forEach(item=>{ + savePoint() { + console.log(this.pointList); + let arr = []; + this.pointList.forEach(item => { arr.push({ id: item.id, mapX: item.mapX, mapY: item.mapY, pointId: item.pointId, planeFigureId: item.planeFigureId - }) - }) + }); + }); // let data ={ // list: arr // } - editDeepExcavationPlaneFigureCoordinateApi(arr).then(res=>{ - console.log(res) - if(res.code && res.success){ + editDeepExcavationPlaneFigureCoordinateApi(arr).then(res => { + console.log(res); + if (res.code && res.success) { // 保存成功! - this.$message.success(this.$t('message.deepFoundConfig.saveSuccess')) + this.$message.success(this.$t("message.deepFoundConfig.saveSuccess")); } - }) - this.isEditPoint = false + }); + this.isEditPoint = false; }, // 关闭添加图片弹窗 - closeAddImg(){ - this.showAddImg = false + closeAddImg() { + this.showAddImg = false; this.testPointImgForm = { planeFigureName: "", fileList: [], pointIds: [] - } - this.$refs['testPointImgForm'].resetFields() + }; + this.$refs["testPointImgForm"].resetFields(); }, // 删除布置图 - deleteDeepImg(val){ + deleteDeepImg(val) { // deleteDeepExcavationPlaneFigureApi({id: val.id}).then(res=>{ // if(res.code == 200){ // this.$message.success('删除成功!') @@ -1095,310 +1462,325 @@ export default { // this.selectDeepExcavationPlaneFigureList() // } // }) - this.removeType = 1 - this.removeData = val - this.deleteInfo = true + this.removeType = 1; + this.removeData = val; + this.deleteInfo = true; }, - submitImgConfig(){ - this.$refs['testPointImgForm'].validate((valid) => { - if(valid){ + submitImgConfig() { + this.$refs["testPointImgForm"].validate(valid => { + if (valid) { let data = { planeFigureName: this.testPointImgForm.planeFigureName, - pointIds: this.testPointImgForm.pointIds.join(','), + pointIds: this.testPointImgForm.pointIds.join(","), imageUrl: this.testPointImgForm.fileList[0].url, projectSn: this.projectSn, deepExcavationId: this.deepExcavationId - } - console.log(data) - addDeepExcavationPlaneFigureApi(data).then(res=>{ - console.log(res) - if(res.code == 200){ - this.$message.success(this.$t('message.deepFoundConfig.addSuccess')) - this.selectDeepExcavationPlaneFigureList() - this.showAddImg = false + }; + console.log(data); + addDeepExcavationPlaneFigureApi(data).then(res => { + console.log(res); + if (res.code == 200) { + this.$message.success( + this.$t("message.deepFoundConfig.addSuccess") + ); + this.selectDeepExcavationPlaneFigureList(); + this.showAddImg = false; } - }) - + }); } - }) + }); }, // 列表查询所有测点 - selectDeepExcavationAllMeasurePointList(){ + selectDeepExcavationAllMeasurePointList() { selectDeepExcavationAllMeasurePointListApi({ deepExcavationId: this.deepExcavationId - }).then(res=>{ - console.log(res) - if(res.code == 200){ - this.testPointOptions = res.result + }).then(res => { + console.log(res); + if (res.code == 200) { + this.testPointOptions = res.result; } - }) + }); }, - openAddImgDialog(){ - this.showAddImg = true - this.selectDeepExcavationAllMeasurePointList() + openAddImgDialog() { + this.showAddImg = true; + this.selectDeepExcavationAllMeasurePointList(); }, // 获取点位位置信息 - selectDeepExcavationPlaneFigureCoordinate(val){ + selectDeepExcavationPlaneFigureCoordinate(val) { selectDeepExcavationPlaneFigureCoordinateApi({ planeFigureId: val.id, deepExcavationId: val.deepExcavationId - }).then(res=>{ - console.log(res) - if(res.code == 200){ - res.result.forEach(item=>{ - item.status = 'block' - item.transform = '', - item.showDetail = false - let arr = [] - let obj = JSON.parse(item.dataField) - for(let key in obj){ + }).then(res => { + console.log(res); + if (res.code == 200) { + res.result.forEach(item => { + item.status = "block"; + (item.transform = ""), (item.showDetail = false); + let arr = []; + let obj = JSON.parse(item.dataField); + for (let key in obj) { arr.push({ key: key, keyName: obj[key] - }) + }); } - item.detailList = arr - }) - this.pointList = res.result - console.log(this.pointList) + item.detailList = arr; + }); + this.pointList = res.result; + console.log(this.pointList); } - }) + }); }, // 切换平面图 - checkImg(val,index){ - console.log(val) - this.imgZoom = 1 - this.activeImgIndex = index - this.activeImgUrl = val.imageUrl - this.isEditPoint = false - this.selectDeepExcavationPlaneFigureCoordinate(val) - this.$nextTick(()=>{ - this.getNaturalSize() - }) + checkImg(val, index) { + console.log(val); + this.imgZoom = 1; + this.activeImgIndex = index; + this.activeImgUrl = val.imageUrl; + this.isEditPoint = false; + this.selectDeepExcavationPlaneFigureCoordinate(val); + this.$nextTick(() => { + this.getNaturalSize(); + }); }, - selectDeepExcavationPlaneFigureList(){ + selectDeepExcavationPlaneFigureList() { let data = { deepExcavationId: this.deepExcavationId, projectSn: this.projectSn - } - selectDeepExcavationPlaneFigureListApi(data).then(res=>{ - if(res.code == 200){ - console.log(res) - this.deepImgList = res.result - if(this.deepImgList.length>0){ - this.checkImg(this.deepImgList[0],0) + }; + selectDeepExcavationPlaneFigureListApi(data).then(res => { + if (res.code == 200) { + console.log(res); + this.deepImgList = res.result; + if (this.deepImgList.length > 0) { + this.checkImg(this.deepImgList[0], 0); } } - console.log(res) - }) + console.log(res); + }); }, - selectDeepExcavationCurrentData(){ + selectDeepExcavationCurrentData() { let data = { alarmState: this.alarmStatus2 ? this.alarmStatus2 : "", measurePointNumber: this.devNum2, relaId: this.relaId, projectSn: this.projectSn, - startTime: this.acquisitionTime != null ? this.acquisitionTime[0]:'', - endTime: this.acquisitionTime != null ? this.acquisitionTime[1]:'', + startTime: this.acquisitionTime != null ? this.acquisitionTime[0] : "", + endTime: this.acquisitionTime != null ? this.acquisitionTime[1] : "", pageNo: this.pagInfo2.pageNo, pageSize: this.pagInfo2.pageSize - } - // selectDeepExcavationCurrentDataApi - selectDeepExcavationCurrentDataListApi(data).then(res=>{ - console.log(res) - if(res.code == 200){ - this.currentPointDetail = res.result.records - this.pagInfo2.total = res.result.total + }; + // selectDeepExcavationCurrentDataApi + selectDeepExcavationCurrentDataListApi(data).then(res => { + console.log(res); + if (res.code == 200) { + this.currentPointDetail = res.result.data.records; + this.pagInfo2.total = res.result.total; } - }) + }); }, // 获取当前时间 返回YYYY-MM-DD HH:mm:ss - selectNowDate(){ - var date = new Date(), - year = date.getFullYear(), - month = date.getMonth() + 1, - day = date.getDate(), - hours = date.getHours(), //获取当前小时数(0-23) - minutes = date.getMinutes(),//获取当前分钟数(0-59) - seconds = date.getSeconds() - month >= 1 && month <= 9 ? (month = "0" + month) : ""; - day >= 0 && day <= 9 ? (day = "0" + day) : ""; + selectNowDate() { + var date = new Date(), + year = date.getFullYear(), + month = date.getMonth() + 1, + day = date.getDate(), + hours = date.getHours(), //获取当前小时数(0-23) + minutes = date.getMinutes(), //获取当前分钟数(0-59) + seconds = date.getSeconds(); + month >= 1 && month <= 9 ? (month = "0" + month) : ""; + day >= 0 && day <= 9 ? (day = "0" + day) : ""; hours >= 0 && hours <= 9 ? (hours = "0" + hours) : ""; minutes >= 0 && minutes <= 9 ? (minutes = "0" + minutes) : ""; seconds >= 0 && seconds <= 9 ? (seconds = "0" + seconds) : ""; - var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds; - console.log(timer) - return timer; - }, - // 提交测点数据 - addPointData(){ - if(this.isPreview){ - this.closeDialog2() - return - } - console.log(this.testPointForm,this.testPointData) - this.$refs['testPointForm'].validate((valid) => { - if (valid) { - let data = this.testPointForm - this.testPointForm.sensorList.forEach(item=>{ - if(item.alarmValue == ""){ - item.alarmValue = 0 - } - if(item.earlyWarningValue == ""){ - item.earlyWarningValue = 0 - } - if(item.controlValue == ""){ - item.controlValue = 0 - } - - }) - // data.thresholdList = this.testPointData - // data.deepExcavationId = this.deepExcavationList[this.activeDeep].id - data.relaId = this.relaId - // console.log(data) - // data.sensorList = this.testPointForm - console.log('新增参数',data) - - addDeepExcavationMeasurePointApi(data).then(res=>{ - console.log('新增成功没',res) - if(res.code == 200 && res.success){ - // 新增成功! - this.$message.success(this.$t('message.deepFoundConfig.addSuccess2')) - this.selectMeasurePointList() - this.closeDialog2() - } - }) - } - }) + var timer = + year + + "-" + + month + + "-" + + day + + " " + + hours + + ":" + + minutes + + ":" + + seconds; + console.log(timer); + return timer; }, - preViewPointData(val){ - console.log('查询详情',val) - this.show= false - this.isPreview = true - this.showTestPoint = true - let data = {} + // 提交测点数据 + addPointData() { + if (this.isPreview) { + this.closeDialog2(); + return; + } + console.log(this.testPointForm, this.testPointData); + this.$refs["testPointForm"].validate(valid => { + if (valid) { + let data = this.testPointForm; + this.testPointForm.sensorList.forEach(item => { + if (item.alarmValue == "") { + item.alarmValue = 0; + } + if (item.earlyWarningValue == "") { + item.earlyWarningValue = 0; + } + if (item.controlValue == "") { + item.controlValue = 0; + } + }); + // data.thresholdList = this.testPointData + // data.deepExcavationId = this.deepExcavationList[this.activeDeep].id + data.relaId = this.relaId; + data.deepExcavationId = this.deepExcavationId; // 深基坑id + // console.log(data) + // data.sensorList = this.testPointForm + console.log("新增参数", data); + + addDeepExcavationMeasurePointApi(data).then(res => { + console.log("新增成功没", res); + if (res.code == 200 && res.success) { + // 新增成功! + this.$message.success( + this.$t("message.deepFoundConfig.addSuccess2") + ); + this.selectMeasurePointList(); + this.closeDialog2(); + } + }); + } + }); + }, + preViewPointData(val) { + console.log("查询详情", val); + this.show = false; + this.isPreview = true; + this.showTestPoint = true; + let data = {}; // this.testPointForm = val - data.measurePointNumber = val.measurePointNumber - getDetailDeepExcavationApi(data).then((res)=>{ - console.log('--------------查询的结果',res.result) - res.result.sensorList.map((item)=>{ - console.log('item',item) - item.earlyWarningValue = String(item.earlyWarningValue) - item.alarmValue = String(item.alarmValue) - item.controlValue = String(item.controlValue) - item.sensorTypeId = String(item.sensorTypeId) - return - }) - console.log('转换类型',res.result.sensorList) - this.testPointForm = res.result - this.testPointForm.thresholdList = res.result.sensorList - }) - + data.measurePointNumber = val.measurePointNumber; + getDetailDeepExcavationApi(data).then(res => { + console.log("--------------查询的结果", res.result); + res.result.sensorList.map(item => { + console.log("item", item); + item.earlyWarningValue = String(item.earlyWarningValue); + item.alarmValue = String(item.alarmValue); + item.controlValue = String(item.controlValue); + item.sensorTypeId = String(item.sensorTypeId); + return; + }); + console.log("转换类型", res.result.sensorList); + this.testPointForm = res.result; + this.testPointForm.thresholdList = res.result.sensorList; + }); + // this.testPointData = val.thresholdList }, // 删除测点数据 - deletePointData(val){ + deletePointData(val) { + console.log("sssss", val); // deleteDeepExcavationMeasurePointApi({id: val.id}).then(res=>{ // if(res.code == 200 && res.success){ // this.$message.success('删除成功!') // this.selectMeasurePointList() // } // }) - this.removeData = val - this.removeType = 2 - this.deleteInfo = true + this.removeData = val; + this.removeType = 2; + this.deleteInfo = true; }, // 关闭新增测点弹窗 - closeDialog2(){ - this.testPointForm = { - measurePointNumber: '', - measurePointName: '', - measurePointAddr: '', - sensorList:[ - { - sensorSn:'', // 传感器编号 - sensorTypeId:'', // 传感器类型 - earlyWarningValue:'', // 预警 - alarmValue:'', //报警 - controlValue:"",//控制 - } - ], - }, - this.isPreview = false - this.$refs['testPointForm'].resetFields() - this.testPointForm.sensorList.forEach(item=>{ - item.alarmValue = '' - item.earlyWarningValue = '' - item.controlValue = '' - }) - this.selectMeasurePointList() + closeDialog2() { + (this.testPointForm = { + measurePointNumber: "", + measurePointName: "", + measurePointAddr: "", + sensorList: [ + { + sensorSn: "", // 传感器编号 + sensorTypeId: "", // 传感器类型 + earlyWarningValue: "", // 预警 + alarmValue: "", //报警 + controlValue: "" //控制 + } + ] + }), + (this.isPreview = false); + this.$refs["testPointForm"].resetFields(); + this.testPointForm.sensorList.forEach(item => { + item.alarmValue = ""; + item.earlyWarningValue = ""; + item.controlValue = ""; + }); + this.selectMeasurePointList(); // this.testPointData = this.testPointData - this.showTestPoint = false + this.showTestPoint = false; }, // 查询传感器类型 - selectDeepExcavationSensorTypeList(){ - selectDeepExcavationSensorTypeListApi().then(res=>{ - console.log(res) - if(res.code == 200 && res.result){ - this.typeOptions = res.result + selectDeepExcavationSensorTypeList() { + selectDeepExcavationSensorTypeListApi().then(res => { + console.log(res); + if (res.code == 200 && res.result) { + this.typeOptions = res.result; } - }) + }); }, // 查询基坑监测内容 - selectDeepExcavationMonitorTypeList(){ - if(this.deepExcavationList.length>0){ + selectDeepExcavationMonitorTypeList() { + if (this.deepExcavationList.length > 0) { let data = { deepExcavationId: this.deepExcavationList[this.activeDeep].id, pageNo: this.pagInfo.pageNo, pageSize: this.pagInfo.pageSize, projectSn: this.projectSn - } - selectDeepExcavationMonitorTypeListApi(data).then(res=>{ - if(res.code == 200){ - console.log(res.result.records) - console.log('监测信息',res) - this.tableData = res.result.records - this.pagInfo.total = res.result.total + }; + selectDeepExcavationMonitorTypeListApi(data).then(res => { + if (res.code == 200) { + console.log(res.result.records); + console.log("监测信息", res); + this.tableData = res.result.records; + this.pagInfo.total = res.result.total; } - }) + }); } }, // 选中基坑 - checkDeep(item,index){ - this.activeDeep = index - this.pagInfo.pageNo = 1 - this.pagInfo.pageSize = 10 - this.selectDeepExcavationMonitorTypeList() + checkDeep(item, index) { + this.activeDeep = index; + this.pagInfo.pageNo = 1; + this.pagInfo.pageSize = 10; + this.selectDeepExcavationMonitorTypeList(); }, // 查询基坑列表 - selectDeepExcavationList(){ - selectDeepExcavationListApi({projectSn: this.projectSn}).then(res=>{ - console.log(res, '----基坑列表') - if(res.code == 200 && res.result){ - this.deepExcavationList = res.result - this.activeDeep = 0 - this.selectDeepExcavationMonitorTypeList() + selectDeepExcavationList() { + selectDeepExcavationListApi({ projectSn: this.projectSn }).then(res => { + console.log(res, "----基坑列表"); + if (res.code == 200 && res.result) { + this.deepExcavationList = res.result; + this.activeDeep = 0; + this.selectDeepExcavationMonitorTypeList(); } - }) + }); }, // 获取监测内容选项列表 - getDefaultMonitorTypeList(){ - getDefaultMonitorTypeListApi().then(res=>{ + getDefaultMonitorTypeList() { + getDefaultMonitorTypeListApi().then(res => { // console.log(res, '---监测内容') - this.contentList = res.result - }) + this.contentList = res.result; + }); }, - changeImgSize(val){ - if(val == 1){ - this.imgZoom = this.imgZoom + 0.5 - console.log(this.imgZoom) + changeImgSize(val) { + if (val == 1) { + this.imgZoom = this.imgZoom + 0.5; + console.log(this.imgZoom); // this.pointList.forEach(item=>{ // item.x = Math.ceil(item.x)*1.5 // item.y = Math.ceil(item.y)*1.6 // }) - }else if(val == 2){ - this.imgZoom = (this.imgZoom - 0.5) <= 0 ? this.imgZoom:this.imgZoom - 0.5 - console.log(this.imgZoom) + } else if (val == 2) { + this.imgZoom = + this.imgZoom - 0.5 <= 0 ? this.imgZoom : this.imgZoom - 0.5; + console.log(this.imgZoom); // if((this.imgZoom - 0.5) > 0){ // this.pointList.forEach(item=>{ // item.x = Math.ceil(item.x)/1.5 @@ -1407,65 +1789,66 @@ export default { // } } }, - showMap(val){ - this.showPointMap = true - this.deepExcavationId = val.id - this.selectDeepExcavationPlaneFigureList() + showMap(val) { + this.showPointMap = true; + this.deepExcavationId = val.id; + this.selectDeepExcavationPlaneFigureList(); }, - addTestPoint(){ - this.show= true - this.showTestPoint = true + addTestPoint() { + this.show = true; + this.showTestPoint = true; }, - handleSelectionChange(val){ - console.log(val) + handleSelectionChange(val) { + console.log(val); }, - handleCheckAllChange(val){ - let arr = [] - this.contentList.forEach(item=>{ - arr.push(item.id) - }) - console.log(arr) + handleCheckAllChange(val) { + let arr = []; + this.contentList.forEach(item => { + arr.push(item.id); + }); + console.log(arr); this.checkedContent = val ? arr : []; this.isIndeterminate = false; }, - handleCheckedCitiesChange(value){ - console.log(value) + handleCheckedCitiesChange(value) { + console.log(value); let checkedCount = value.length; this.checkAll = checkedCount === this.contentList.length; - this.isIndeterminate = checkedCount > 0 && checkedCount < this.contentList.length; + this.isIndeterminate = + checkedCount > 0 && checkedCount < this.contentList.length; }, - SizeChange(val){ + SizeChange(val) { console.log(val); - this.pagInfo.pageSize = val - this.selectDeepExcavationMonitorTypeList() + this.pagInfo.pageSize = val; + this.selectDeepExcavationMonitorTypeList(); }, - CurrentChange(val){ + CurrentChange(val) { console.log(val); - this.pagInfo.pageNo = val - this.selectDeepExcavationMonitorTypeList() + this.pagInfo.pageNo = val; + this.selectDeepExcavationMonitorTypeList(); }, - changeSize(val){ + changeSize(val) { console.log(val); - this.pagInfo2.pageSize = val - this.selectDeepExcavationCurrentData() + this.pagInfo2.pageSize = val; + this.selectDeepExcavationCurrentData(); }, - changeCurrent(val){ + changeCurrent(val) { console.log(val); - this.pagInfo2.pageNo = val - this.selectDeepExcavationCurrentData() + this.pagInfo2.pageNo = val; + this.selectDeepExcavationCurrentData(); }, - addProject(){ - this.formType = 1 - this.dialogVisible = true + addProject() { + this.formType = 1; + this.dialogVisible = true; }, // 编辑获取基坑详情 - editProject(data){ - this.formType = 2 - this.dialogVisible = true - this.editId = data.id - queryByIdDeepExcavationEngineeringApi({id: data.id}).then(res=>{ - console.log(res) - if(res.code == 200){ + editProject(data) { + this.formType = 2; + this.dialogVisible = true; + this.editId = data.id; + queryByIdDeepExcavationEngineeringApi({ id: data.id }).then(res => { + console.log(res); + if (res.code == 200) { this.dialogdata = { engineeringName: res.result.engineeringName, startTime: res.result.startTime, @@ -1478,162 +1861,196 @@ export default { surveyPersonnel: res.result.surveyPersonnel, excavationDepth: res.result.excavationDepth, floorPourTime: res.result.floorPourTime - } - this.deviseDrawingList = res.result.deviseDrawing ? JSON.parse(res.result.deviseDrawing):[] - this.surveySchemeList = res.result.surveyScheme ? JSON.parse(res.result.surveyScheme):[] - this.prospectingReportList = res.result.prospectingReport ? JSON.parse(res.result.prospectingReport):[] + }; + this.deviseDrawingList = res.result.deviseDrawing + ? JSON.parse(res.result.deviseDrawing) + : []; + this.surveySchemeList = res.result.surveyScheme + ? JSON.parse(res.result.surveyScheme) + : []; + this.prospectingReportList = res.result.prospectingReport + ? JSON.parse(res.result.prospectingReport) + : []; } - }) + }); }, // 删除文件 - handleRemove(file, fileList,type){ - console.log(file,fileList,type) - if(type == 1){ - this.surveySchemeList = fileList - console.log(this.surveySchemeList) - } else if(type == 2){ - this.prospectingReportList = fileList - console.log(this.prospectingReportList) - } else if(type == 3){ - this.deviseDrawingList = fileList - console.log(this.deviseDrawingList) - } else if(type == 4){ - this.testPointImgForm.fileList = fileList - } + handleRemove(file, fileList, type) { + console.log(file, fileList, type); + if (type == 1) { + this.surveySchemeList = fileList; + console.log(this.surveySchemeList); + } else if (type == 2) { + this.prospectingReportList = fileList; + console.log(this.prospectingReportList); + } else if (type == 3) { + this.deviseDrawingList = fileList; + console.log(this.deviseDrawingList); + } else if (type == 4) { + this.testPointImgForm.fileList = fileList; + } // this.$confirm(`确定移除 ${ file.name }?`); }, - handleBeforeUpload(file){ - console.log(file) - if(file.type != 'image/png' && file.type != 'image/jpg' && file.type != 'image/jpeg' ){ + handleBeforeUpload(file) { + console.log(file); + if ( + file.type != "image/png" && + file.type != "image/jpg" && + file.type != "image/jpeg" + ) { // 请上传图片! - this.$message.error(this.$t('message.deepFoundConfig.uploadError')) - return false + this.$message.error(this.$t("message.deepFoundConfig.uploadError")); + return false; } }, // 上传文件 - handleSuccess(res,file,type){ + handleSuccess(res, file, type) { // type 1、监测方案 2、地勘报告 3、基坑设计图纸 4.示意图 - console.log(res,file,type) - if(res.status == "SUCCESS"){ + console.log(res, file, type); + if (res.status == "SUCCESS") { // 上传成功! - this.$message.success(this.$t('message.deepFoundConfig.uploadSuccess')) - if(type == 1){ + this.$message.success(this.$t("message.deepFoundConfig.uploadSuccess")); + if (type == 1) { this.surveySchemeList.push({ name: file.name, url: this.$store.state.FILEURL + file.response.data[0].imageUrl - }) - console.log(this.surveySchemeList) - } else if(type == 2){ + }); + console.log(this.surveySchemeList); + } else if (type == 2) { this.prospectingReportList.push({ name: file.name, url: this.$store.state.FILEURL + file.response.data[0].imageUrl - }) - console.log(this.prospectingReportList) - } else if(type == 3){ + }); + console.log(this.prospectingReportList); + } else if (type == 3) { this.deviseDrawingList.push({ name: file.name, url: this.$store.state.FILEURL + file.response.data[0].imageUrl - }) - console.log(this.deviseDrawingList) - } else if(type == 4){ - this.testPointImgForm.fileList = [{ - name: file.name, - url:this.$store.state.FILEURL + file.response.data[0].imageUrl - }] - this.$refs['testPointImgForm'].clearValidate() - console.log(this.testPointImgForm.fileList) + }); + console.log(this.deviseDrawingList); + } else if (type == 4) { + this.testPointImgForm.fileList = [ + { + name: file.name, + url: this.$store.state.FILEURL + file.response.data[0].imageUrl + } + ]; + this.$refs["testPointImgForm"].clearValidate(); + console.log(this.testPointImgForm.fileList); } } }, // 查看大图 - handlePictureCardPreview(file, fileList){ - console.log(21) + handlePictureCardPreview(file, fileList) { + console.log(21); this.dialogImageUrl = file.url; this.dialogVisible2 = true; }, // 添加、编辑基坑 - submitForm(){ - console.log(this.dialogdata) - this.$refs['form'].validate((valid) => { - if (valid) { - if(this.checkedContent.length == 0 && this.formType == 1){ - // 请选择监测内容 - this.$message.error(this.$t('message.deepFoundConfig.placeholderText2')+this.$t('message.deepFoundConfig.monitorContent')) - return; - } - let data = this.dialogdata - data.deviseDrawing = this.deviseDrawingList.length>0 ? JSON.stringify(this.deviseDrawingList):"" - data.surveyScheme = this.surveySchemeList.length>0 ? JSON.stringify(this.surveySchemeList):"" - data.prospectingReport = this.prospectingReportList.length>0 ? JSON.stringify(this.prospectingReportList):"" - data.projectSn = this.projectSn - // this.safeLvList.forEach(item=>{ - // if(item.value == this.dialogdata.safeLv){ - // data.safetyLevel = item.label - // } - // }) - // deviseDrawingList:[], - // surveySchemeList:[], - // prospectingReportList: [], - if(this.formType == 1){ - data.status = 1 - data.monitorTypeIds = this.checkedContent.join(',') - addDeepExcavationEngineeringApi(data).then(res=>{ - console.log(res) - if(res.code == 200){ - // 新增成功! - this.$message.success(this.$t('message.deepFoundConfig.addSuccess2')) - this.closeDialog() - this.selectDeepExcavationList() - } - }) - } else if(this.formType == 2){ - data.id = this.editId - editDeepExcavationEngineeringApi(data).then(res=>{ - console.log(res) - if(res.code == 200){ - // 编辑成功! - this.$message.success(this.$t('message.deepFoundConfig.editSuccess')) - this.closeDialog() - this.selectDeepExcavationList() - } - }) - } + submitForm() { + console.log(this.dialogdata); + this.$refs["form"].validate(valid => { + if (valid) { + if (this.checkedContent.length == 0 && this.formType == 1) { + // 请选择监测内容 + this.$message.error( + this.$t("message.deepFoundConfig.placeholderText2") + + this.$t("message.deepFoundConfig.monitorContent") + ); + return; } - }) + let data = this.dialogdata; + data.deviseDrawing = + this.deviseDrawingList.length > 0 + ? JSON.stringify(this.deviseDrawingList) + : ""; + data.surveyScheme = + this.surveySchemeList.length > 0 + ? JSON.stringify(this.surveySchemeList) + : ""; + data.prospectingReport = + this.prospectingReportList.length > 0 + ? JSON.stringify(this.prospectingReportList) + : ""; + data.projectSn = this.projectSn; + // this.safeLvList.forEach(item=>{ + // if(item.value == this.dialogdata.safeLv){ + // data.safetyLevel = item.label + // } + // }) + // deviseDrawingList:[], + // surveySchemeList:[], + // prospectingReportList: [], + if (this.formType == 1) { + data.status = 1; + data.monitorTypeIds = this.checkedContent.join(","); + addDeepExcavationEngineeringApi(data).then(res => { + console.log(res); + if (res.code == 200) { + // 新增成功! + this.$message.success( + this.$t("message.deepFoundConfig.addSuccess2") + ); + this.closeDialog(); + this.selectDeepExcavationList(); + } + }); + } else if (this.formType == 2) { + data.id = this.editId; + editDeepExcavationEngineeringApi(data).then(res => { + console.log(res); + if (res.code == 200) { + // 编辑成功! + this.$message.success( + this.$t("message.deepFoundConfig.editSuccess") + ); + this.closeDialog(); + this.selectDeepExcavationList(); + } + }); + } + } + }); // this.closeDialog() }, // 删除基坑 - deleteDeepExcavation(data){ + deleteDeepExcavation(data) { // 此操作将永久删除该基坑, 是否继续? // 提示 // 确定 // 取消 - this.$confirm(this.$t('message.deepFoundConfig.hintContent'), this.$t('message.deepFoundConfig.hint'), { - confirmButtonText: this.$t('message.deepFoundConfig.confirm'), - cancelButtonText: this.$t('message.deepFoundConfig.cancel'), - type: 'warning' - }).then(() => { - deleteDeepExcavationEngineeringApi({id: data.id}).then(res=>{ - if(res.code == 200){ - this.tableData = [] - this.selectDeepExcavationList() + this.$confirm( + this.$t("message.deepFoundConfig.hintContent"), + this.$t("message.deepFoundConfig.hint"), + { + confirmButtonText: this.$t("message.deepFoundConfig.confirm"), + cancelButtonText: this.$t("message.deepFoundConfig.cancel"), + type: "warning" + } + ) + .then(() => { + deleteDeepExcavationEngineeringApi({ id: data.id }).then(res => { + if (res.code == 200) { + this.tableData = []; + this.selectDeepExcavationList(); // '删除成功!' this.$message({ - type: 'success', - message: this.$t('message.deepFoundConfig.removeSuccess') + type: "success", + message: this.$t("message.deepFoundConfig.removeSuccess") }); } - }) - }).catch(() => { + }); + }) + .catch(() => { // '已取消删除' this.$message({ - type: 'info', - message: this.$t('message.deepFoundConfig.cancelRemove') - }); + type: "info", + message: this.$t("message.deepFoundConfig.cancelRemove") + }); }); }, // 重置基坑提交表单 - resetForm(){ + resetForm() { this.dialogdata = { engineeringName: "", // projectAddress: "", @@ -1647,31 +2064,32 @@ export default { surveyPersonnel: "", excavationDepth: "", floorPourTime: "" - } - this.editId = "" - this.checkedContent = [] - this.deviseDrawingList = [] - this.surveySchemeList = [] - this.prospectingReportList = [] - this.checkAll = false - this.isIndeterminate = false + }; + this.editId = ""; + this.checkedContent = []; + this.deviseDrawingList = []; + this.surveySchemeList = []; + this.prospectingReportList = []; + this.checkAll = false; + this.isIndeterminate = false; }, - closeDialog(){ + closeDialog() { this.dialogVisible = false; - this.$refs['form'].resetFields() - this.resetForm() + this.$refs["form"].resetFields(); + this.resetForm(); }, - previewDetail(val, type){ - this.relaId = val.id - console.log(val) - if(type == 1){ - this.selectMeasurePointList() - this.showDetail = true - this.testPointData = [] - if(val.dataField){ - console.log(JSON.parse(val.dataField)) - let obj = JSON.parse(val.dataField) - for(var key in obj){ + previewDetail(val, type) { + this.relaId = val.id; + this.deepExcavationId = val.deepExcavationId; + console.log(val); + if (type == 1) { + this.selectMeasurePointList(); + this.showDetail = true; + this.testPointData = []; + if (val.dataField) { + console.log(JSON.parse(val.dataField)); + let obj = JSON.parse(val.dataField); + for (var key in obj) { this.testPointData.push({ targetField: key, targetName: obj[key], @@ -1679,115 +2097,126 @@ export default { warningValue: 0, alarmValue: 0, controlValue: 0 - }) + }); } } - } else if(type == 2){ - if(val.dataField){ - console.log(JSON.parse(val.dataField)) - let obj = JSON.parse(val.dataField) - this.currentTableData = [] - for(var key in obj){ + } else if (type == 2) { + if (val.dataField) { + console.log(JSON.parse(val.dataField)); + let obj = JSON.parse(val.dataField); + this.currentTableData = []; + for (var key in obj) { this.currentTableData.push({ targetField: key, - targetName: obj[key], - }) + targetName: obj[key] + }); } - console.log(this.currentTableData) + console.log(this.currentTableData); } - let nowTime = this.selectNowDate() - this.acquisitionTime = [nowTime.split(' ')[0] + ' ' + '00:00:00',nowTime] - this.selectDeepExcavationCurrentData() - this.showActiveDetail = true + let nowTime = this.selectNowDate(); + // this.acquisitionTime = [nowTime.split(' ')[0] + ' ' + '00:00:00',nowTime] + this.selectDeepExcavationCurrentData(); + this.showActiveDetail = true; } }, // 列表查询深基坑-测点信息 - selectMeasurePointList(val){ - if(val == 1){ - this.alarmStatus = '' - this.devNum = '' + selectMeasurePointList(val) { + if (val == 1) { + this.alarmStatus = ""; + this.devNum = ""; } let data = { - alarmState: this.alarmStatus ? this.alarmStatus:"", + alarmState: this.alarmStatus ? this.alarmStatus : "", measurePointNumber: this.devNum, relaId: this.relaId, - pageNo: this.pagInfo.pageNo, - pageSize: this.pagInfo.pageSize, - } - - selectMeasurePointListApi(data).then(res=>{ - console.log(res) - if(res.code == 200){ - // console.log('====查询测点管理的列表',res) - this.surveyPointDetail = res.result.records + pageNo: this.pageNo, + pageSize: this.pageSize + }; + console.log('参数',data) + selectMeasurePointListApi(data).then(res => { + console.log(res); + if (res.code == 200) { + console.log("====查询测点管理的列表", res); + this.surveyPointDetail = res.result.records; + this.total = res.result.total; } - }) + }); }, + handleSizeChange(val) { + this.pageSize = val; + this.selectMeasurePointList(); + }, + handleCurrentChange(val) { + this.pageNo = val; + this.selectMeasurePointList(); + }, + // 获取基坑布置图图片大小 - getNaturalSize (callback) { - - let Domlement = this.$refs['map'] - console.dir(Domlement) - var natureSize = {}; - if(window.naturalWidth && window.naturalHeight) { - natureSize.width = Domlement.naturalWidth; - natureSize.height = Domlement.naturalHeight; - // let heightRatio = natureSize.height / 569 - // this.mapDate.width = natureSize.width*heightRatio - } else { - console.log(213) - let _this = this - var img = new Image(); - img.src = Domlement.src; - img.onload = function(){ - natureSize.width = img.width; - natureSize.height = img.height; - console.log('------', natureSize) - _this.imgWidth = natureSize.width - _this.imgHeight = natureSize.height - _this.imgStartWidth = img.width; - _this.imgStartHeight = img.width; - console.log(_this.$refs['mapbox'].clientWidth, _this.$refs['mapbox'].clientHeight) + getNaturalSize(callback) { + let Domlement = this.$refs["map"]; + console.dir(Domlement); + var natureSize = {}; + if (window.naturalWidth && window.naturalHeight) { + natureSize.width = Domlement.naturalWidth; + natureSize.height = Domlement.naturalHeight; + // let heightRatio = natureSize.height / 569 + // this.mapDate.width = natureSize.width*heightRatio + } else { + console.log(213); + let _this = this; + var img = new Image(); + img.src = Domlement.src; + img.onload = function() { + natureSize.width = img.width; + natureSize.height = img.height; + console.log("------", natureSize); + _this.imgWidth = natureSize.width; + _this.imgHeight = natureSize.height; + _this.imgStartWidth = img.width; + _this.imgStartHeight = img.width; + console.log( + _this.$refs["mapbox"].clientWidth, + _this.$refs["mapbox"].clientHeight + ); - // let heightRatio = 780 / natureSize.height - // let widthRatio = _this.$refs['mapbox'].clientWidth / natureSize.width - // if(heightRatio < widthRatio){ - // // _this.imgWidth = natureSize.width*heightRatio - // // _this.imgHeight = natureSize.height*heightRatio - // _this.imgZoom = heightRatio - // } else { - // // _this.imgWidth = natureSize.width*widthRatio - // // _this.imgHeight = natureSize.height*widthRatio - // _this.imgZoom = widthRatio - // } - // _this.mapDate.width = natureSize.width*heightRatio - if(callback){ - return callback(natureSize) - } - } - - } - console.log(natureSize) + // let heightRatio = 780 / natureSize.height + // let widthRatio = _this.$refs['mapbox'].clientWidth / natureSize.width + // if(heightRatio < widthRatio){ + // // _this.imgWidth = natureSize.width*heightRatio + // // _this.imgHeight = natureSize.height*heightRatio + // _this.imgZoom = heightRatio + // } else { + // // _this.imgWidth = natureSize.width*widthRatio + // // _this.imgHeight = natureSize.height*widthRatio + // _this.imgZoom = widthRatio + // } + // _this.mapDate.width = natureSize.width*heightRatio + if (callback) { + return callback(natureSize); + } + }; + } + console.log(natureSize); // return natureSize; }, // 添加鼠标监听事件 - move(val,e){ - console.log(val,e.pageX,e.pageY) - this.ratio = window.localStorage.getItem('zoom') - this.startX = e.pageX - this.startY = e.pageY - this.pointIndex = val + move(val, e) { + console.log(val, e.pageX, e.pageY); + this.ratio = window.localStorage.getItem("zoom"); + this.startX = e.pageX; + this.startY = e.pageY; + this.pointIndex = val; // console.dir(this.$refs['point'+val]) // this.$refs['point'+val].style.opacity = '0' - let _this = this - console.log(this.pointList[val]) - if(this.isEditPoint){ - this.pointList[val].status = 'none' + let _this = this; + console.log(this.pointList[val]); + if (this.isEditPoint) { + this.pointList[val].status = "none"; // this.$refs['point'+ val].style.display = 'none' - document.body.addEventListener('mousemove',this.movePoint,false) - document.body.addEventListener('mouseup',this.removeUp,false) + document.body.addEventListener("mousemove", this.movePoint, false); + document.body.addEventListener("mouseup", this.removeUp, false); } - + // document.body.addEventListener('mousemove',(e)=>{ // _this.movePoint(e,val,ratio,a,b) // },false) @@ -1800,64 +2229,79 @@ export default { // }) }, // 清除鼠标监听时间 - removeUp(e){ - let top = (e.pageY - this.startY)/this.imgZoom , - left = (e.pageX - this.startX)/this.imgZoom - console.log(top,left) - this.pointStatus = 'none' - let x = Math.ceil(Number(this.pointList[this.pointIndex].mapX ? this.pointList[this.pointIndex].mapX:0) + left/this.ratio), - y = Math.ceil(Number(this.pointList[this.pointIndex].mapY ? this.pointList[this.pointIndex].mapY:0) + top/this.ratio) - console.log(x,y,this.imgWidth,this.imgHeight) - if(y <= this.imgHeight && y >= 0){ - this.pointList[this.pointIndex].mapY = y + removeUp(e) { + let top = (e.pageY - this.startY) / this.imgZoom, + left = (e.pageX - this.startX) / this.imgZoom; + console.log(top, left); + this.pointStatus = "none"; + let x = Math.ceil( + Number( + this.pointList[this.pointIndex].mapX + ? this.pointList[this.pointIndex].mapX + : 0 + ) + + left / this.ratio + ), + y = Math.ceil( + Number( + this.pointList[this.pointIndex].mapY + ? this.pointList[this.pointIndex].mapY + : 0 + ) + + top / this.ratio + ); + console.log(x, y, this.imgWidth, this.imgHeight); + if (y <= this.imgHeight && y >= 0) { + this.pointList[this.pointIndex].mapY = y; } - if(x <= this.imgWidth && x >= 0){ - this.pointList[this.pointIndex].mapX = x + if (x <= this.imgWidth && x >= 0) { + this.pointList[this.pointIndex].mapX = x; } - this.pointList[this.pointIndex].status = 'block' - console.log(this.pointList) - this.$forceUpdate() + this.pointList[this.pointIndex].status = "block"; + console.log(this.pointList); + this.$forceUpdate(); // this.pointList[this.pointIndex].transform = 'translate(-150%, -150%)' // this.$refs['point'+this.pointIndex].style.transform = 'translate(-150%, -150%)' // this.$refs['point'+ this.pointIndex].style.display = 'block' - document.body.removeEventListener('mousemove',this.movePoint,false) - document.body.removeEventListener('mouseup',this.removeUp,false) + document.body.removeEventListener("mousemove", this.movePoint, false); + document.body.removeEventListener("mouseup", this.removeUp, false); }, // 移动鼠标 - movePoint(target){ + movePoint(target) { // console.log(target) // console.log(window.localStorage.getItem('zoom')) // console.dir(document.getElementById('app')) let bodyWidth = document.body.clientWidth, - bodyHeight = document.body.clientHeight, - appWidth = document.getElementById('app').clientWidth*this.ratio, - appHeight = document.getElementById('app').clientHeight*this.ratio, - a = bodyWidth - appWidth, - b = bodyHeight - appHeight + bodyHeight = document.body.clientHeight, + appWidth = document.getElementById("app").clientWidth * this.ratio, + appHeight = document.getElementById("app").clientHeight * this.ratio, + a = bodyWidth - appWidth, + b = bodyHeight - appHeight; // console.log(document.body.clientHeight,document.body.clientWidth) // this.$refs['pointFixed'].style.top = ((target.pageY)/ratio - (b*0.5)/ratio)-15/ratio + 'px' // this.$refs['pointFixed'].style.left = ((target.pageX)/ratio - (a*0.5)/ratio)-15/ratio+ 'px' - if(this.ratio != 1){ - this.$refs['pointFixed'].style.transform = 'translate(0px, -75px)' - this.pointTop = ((target.pageY)/this.ratio - (b*0.5)/this.ratio) - this.pointLeft = ((target.pageX)/this.ratio - (a*0.5)/this.ratio)-60 - } else{ - this.pointTop = target.pageY - this.pointLeft = target.pageX - 60 + if (this.ratio != 1) { + this.$refs["pointFixed"].style.transform = "translate(0px, -75px)"; + this.pointTop = target.pageY / this.ratio - (b * 0.5) / this.ratio; + this.pointLeft = + target.pageX / this.ratio - (a * 0.5) / this.ratio - 60; + } else { + this.pointTop = target.pageY; + this.pointLeft = target.pageX - 60; } - - this.pointStatus = 'block' + + this.pointStatus = "block"; // console.log(target) }, // 鼠标抬起 - up(val,e){ - let _this = this - if(this.isEditPoint){ - window.removeEventListener('mousemove',function(e){ - _this.movePoint() - }) + up(val, e) { + let _this = this; + if (this.isEditPoint) { + window.removeEventListener("mousemove", function(e) { + _this.movePoint(); + }); } // this.$refs['point'+val].style.display = '1' } @@ -1866,331 +2310,330 @@ export default { \ No newline at end of file diff --git a/src/views/projectFront/deepFoundationPitManage/monitorData.vue b/src/views/projectFront/deepFoundationPitManage/monitorData.vue index 25e62c31..2eac6f7b 100644 --- a/src/views/projectFront/deepFoundationPitManage/monitorData.vue +++ b/src/views/projectFront/deepFoundationPitManage/monitorData.vue @@ -337,6 +337,15 @@ :value="item.measurePointNumber"> + 传感器编号: +
@@ -419,7 +428,8 @@ import { selectDeepExcavationPlaneFigureCoordinateApi, selectDeepExcavationAllMeasurePointListApi, queryByIdDeepExcavationMonitorTypeApi, - selectMonitorTypeListApi + selectMonitorTypeListApi, + getSensorListApi } from "@/assets/js/api/deepFoundationPitManage.js" export default { data(){ @@ -493,6 +503,7 @@ export default { id: 5, }], options:[], + getSensorList:[], // 传感器列表 checkList:"", dateTime: [], searchDate: 1, @@ -537,8 +548,8 @@ export default { measurePointNumber: this.checkList, relaId: this.relaId, projectSn: this.projectSn, - // startTime: this.dateTime[0], - // endTime: this.dateTime[1] + startTime: this.dateTime[0], + endTime: this.dateTime[1] }).then(res=>{ console.log(res) if(res.code == 200 && res.result){ @@ -553,8 +564,9 @@ export default { this.echartData7.unit = '('+item.keyName.split('(')[1] } }) - res.result.records.forEach(item=>{ - this.echartData7.xAxis.push(item.receiveTime.split(' ')[1]) + res.result.data.records.forEach(item=>{ + // this.echartData7.xAxis.push(item.receiveTime.split(' ')[1]) + this.echartData7.xAxis.push(item.receiveTime.split(' ')[0]) this.echartData7.data.push(item.data) }) // console.log('图标的值',this.echartData7) @@ -568,7 +580,7 @@ export default { deepExcavationId: this.deepExcavation, relaId: this.relaId }).then(res=>{ - // console.log('列表查询测点',res) + console.log('列表查询测点',res) if(res.code == 200 && res.result){ this.options = res.result let arr = [] @@ -584,6 +596,14 @@ export default { } }) }, + // 查询传感器编号列表 + selectDeepExcavationAllgetSensorList(){ + let data = {} + getSensorListApi(data).then((res)=>{ + console.log('0000000',res) + }) + }, + // 根据id查询基坑内容详情 queryByIdDeepExcavationMonitorType(val){ console.log(val) @@ -1453,8 +1473,9 @@ export default { // status: val.alarmType == 1 ? this.$t('message.deepFoundConfig.no'):this.$t('message.deepFoundConfig.yes'), // tableHeader: arr // } - let nowTime = this.selectNowDate() - this.dateTime = [nowTime.split(' ')[0] + ' ' + '00:00:00',nowTime] + // 默认时间 + // let nowTime = this.selectNowDate() + // this.dateTime = [nowTime.split(' ')[0] + ' ' + '00:00:00',nowTime] // this.queryByIdDeepExcavationMonitorType(val.id) this.selectDeepExcavationAllMeasurePointList() this.$nextTick(()=>{ @@ -1530,8 +1551,22 @@ export default { // this.createdEchart7() }, checkNum(val){ - console.log(val) + console.log('当前选择',val) this.selectDeepExcavationCurrentDataList() + // measurePointNumber = val + // 查询传感器编号列表 + + getSensorListApi({measurePointNumber:val}).then((res)=>{ + console.log('0000000',res) + if(res.code == 200 && res.result){ + this.getSensorList = res.result.data.records + console.log('------------',this.getSensorList) + } + + }) + + + }, checkDateTime(val){ console.log(val) diff --git a/src/views/projectFront/inspecPoint/inspection.vue b/src/views/projectFront/inspecPoint/inspection.vue index 165ed64b..3930eb9c 100644 --- a/src/views/projectFront/inspecPoint/inspection.vue +++ b/src/views/projectFront/inspecPoint/inspection.vue @@ -11,9 +11,18 @@ - + + - + + +
@@ -74,6 +83,7 @@ :placeholder="$t('message.personnelPosition.please_enter')" > +
@@ -100,6 +110,7 @@ import { addPointApi, deletePointApi } from "@/assets/js/api/insect.js"; +import QRCode from "qrcodejs2"; export default { data() { return { @@ -107,19 +118,23 @@ export default { workerName: "" }, cardDialogTitle: "新建巡检点", - tableData: [{ beaconMinor: "111" }], + tableData: [], total: 0, pageNo: 1, pageSize: 10, cardForm: { - checkingPointName:'', - position:"", + checkingPointName: "", + position: "" }, + qrCode: "", cardDialog: false, projectSn: "", cardFormRules: { - cardNo: [ + checkingPointName: [ { required: true, message: "请输入巡检点名称", trigger: "blur" } + ], + position: [ + { required: true, message: "请输入巡检位置", trigger: "blur" } ] } }; @@ -148,11 +163,12 @@ export default { }; getPointListApi(data).then(res => { console.log("----巡检点列表", res); + this.tableData = res.result.records }); }, // 刷新 toRefresh() { - this.getPointList() + this.getPointList(); }, // 新增 toAdd() { @@ -192,11 +208,79 @@ export default { }); }); }, + // 获取当前时间 返回YYYY-MM-DD HH:mm:ss + selectNowDate() { + var date = new Date(), + year = date.getFullYear(), + month = date.getMonth() + 1, + day = date.getDate(), + hours = date.getHours(), //获取当前小时数(0-23) + minutes = date.getMinutes(), //获取当前分钟数(0-59) + seconds = date.getSeconds(); + month >= 1 && month <= 9 ? (month = "0" + month) : ""; + day >= 0 && day <= 9 ? (day = "0" + day) : ""; + hours >= 0 && hours <= 9 ? (hours = "0" + hours) : ""; + minutes >= 0 && minutes <= 9 ? (minutes = "0" + minutes) : ""; + seconds >= 0 && seconds <= 9 ? (seconds = "0" + seconds) : ""; + var timer = + year + + "-" + + month + + "-" + + day + + " " + + hours + + ":" + + minutes + + ":" + + seconds; + return timer; + }, // 生成二维码 - addCardFn() {} + addCardFn() { + // 新增 + let data = this.cardForm; + data.projectSn = this.$store.state.projectSn; + data.createUserId = this.$store.state.userInfo.userId; + data.createUserName = this.$store.state.userInfo.account; + + this.$refs["cardForm"].validate(valid => { + if (valid) { + document.getElementById("qrCode").innerHTML = ""; + console.log("QRCode", QRCode); + let QRCodeData = new QRCode(this.$refs.qrCodeDiv, { + text: JSON.stringify(data), + width: 150, + height: 150, + colorDark: "#333333", //二维码颜色 + colorLight: "#ffffff", //二维码背景色 + correctLevel: QRCode.CorrectLevel.L //容错率,L/M/H + }); + console.log("QRCodeData", QRCodeData); + setTimeout(() => { + let img = QRCodeData._el.innerHTML; + let baseurl = img + .split("=")[5].split('"')[1] + console.log("baseurl", baseurl); + data.qrCode = baseurl; + data.createDate = this.selectNowDate(); + addPointApi(data).then(res => { + console.log("新增", res); + if (res.code == 200) { + this.cardDialog = false; + this.getPointList() + } + }); + }, 500); + } + }); + } } }; - \ No newline at end of file