From 13272e92a6c98daad06aa166a6674bf4dac7cc4b Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期一, 21 十月 2024 11:06:55 +0800 Subject: [PATCH] 问题审核1021 --- src/assets/main.css | 1 src/views/fysp/check/components/js/dataMonitorDeviceType.js | 77 +++++ src/views/fysp/check/components/js/dataProductionDeviceType.js | 67 ++++ src/views/fysp/check/components/CompDevicePhono.vue | 4 src/components.d.ts | 1 src/api/fysp/problemApi.js | 10 src/views/fysp/check/components/CompProRecent.vue | 16 src/assets/dialog.css | 9 src/views/fysp/check/components/CompDeviceShowTest.vue | 378 +++++++++++++++---------- src/views/fysp/check/components/ArbitraryPhoto.vue | 7 src/views/fysp/check/ProCheck.vue | 12 src/views/fysp/check/components/js/dataTreatmentDeviceType.js | 81 +++++ src/views/fysp/check/components/CompLedgerPic.vue | 10 src/views/fysp/check/components/CompProblemAddOrUpd.vue | 70 +-- src/views/fysp/check/components/ComChangeEdit.vue | 40 ++ src/views/fysp/check/components/CompProblemCard.vue | 96 ++++-- 16 files changed, 617 insertions(+), 262 deletions(-) diff --git a/src/api/fysp/problemApi.js b/src/api/fysp/problemApi.js index 9fbc690..23b35f2 100644 --- a/src/api/fysp/problemApi.js +++ b/src/api/fysp/problemApi.js @@ -45,5 +45,13 @@ // 淇敼鏁存敼 updateChange(data) { return $fysp.post(`problemlist/updateChange`, data).then((res) => res) + }, + // 鏁存敼涓婁紶 + changeProblem(data) { + return $fysp.post(`problemlist/changeProblem`, data).then((res) => res) + }, + // 闂鍒犻櫎 + deleteProblem({ pid }) { + return $fysp.post(`problemlist/${pid}`).then((res) => res.data) } -}; +} diff --git a/src/assets/dialog.css b/src/assets/dialog.css new file mode 100644 index 0000000..0c5d374 --- /dev/null +++ b/src/assets/dialog.css @@ -0,0 +1,9 @@ +::v-deep .el-dialog { + --el-dialog-margin-top: 8vh; +} +::v-deep .el-dialog__body { + padding: 0 var(--el-dialog-padding-primary) var(--el-dialog-padding-primary) var(--el-dialog-padding-primary); +} +::v-deep .el-drawer__body { + padding: 0 var(--el-drawer-padding-primary); +} \ No newline at end of file diff --git a/src/assets/main.css b/src/assets/main.css index f760b68..e94fb6c 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,5 +1,6 @@ @import './base.css'; @import './button.css'; +@import './dialog.css'; #app { /* background-color: rgb(212, 41, 41); */ diff --git a/src/components.d.ts b/src/components.d.ts index 124cacb..5267454 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Content: typeof import('./components/core/Content.vue')['default'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] + ElBacktop: typeof import('element-plus/es')['ElBacktop'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] diff --git a/src/views/fysp/check/ProCheck.vue b/src/views/fysp/check/ProCheck.vue index 0554694..d5e6803 100644 --- a/src/views/fysp/check/ProCheck.vue +++ b/src/views/fysp/check/ProCheck.vue @@ -63,11 +63,11 @@ </ArbitraryPhoto> </el-dialog> <el-drawer - :direction="rtl" + direction="ltr" v-model="deviceShowDialog" :before-close="beforeDeviceShowDialogclose" title="璁炬柦璁惧" - size="65%" + size="45%" > <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef"> </CompDeviceShowTest> </el-drawer> @@ -311,12 +311,10 @@ }); }, // 闂鍗$墖缁勪欢涓诲姩鍙戣捣鍒锋柊鐖剁粍浠舵暟鎹� - updateSubtask(isOk) { + updateSubtask() { + this.curSubtask.data.proCheckedNum++; this.curSubtask.type = this.getSubtaskType(this.curSubtask.data); - if (!isOk) { - return; - } this.refreshCurrSubtask(); }, onProSubmited(isOk) { @@ -324,7 +322,7 @@ if (!isOk) { return; } - this.updateSubtask(isOk); + this.updateSubtask(); }, newProSubmit(isOk) { this.proAddOrUpdDialogVisible = false; diff --git a/src/views/fysp/check/components/ArbitraryPhoto.vue b/src/views/fysp/check/components/ArbitraryPhoto.vue index 4759c38..7170d11 100644 --- a/src/views/fysp/check/components/ArbitraryPhoto.vue +++ b/src/views/fysp/check/components/ArbitraryPhoto.vue @@ -268,7 +268,7 @@ } .btns { - height: 10%; + /* height: 10%; */ } /* .img_types { @@ -283,7 +283,7 @@ } */ .imgs { - height: 370px; + height: 650px; width: 90%; min-height: 100px !important; /* border-style:solid; @@ -352,7 +352,8 @@ padding: 5px; } -.el-dialog__body { +::v-deep .el-dialog__body { height: 60vh; + padding: 10px calc(var(--el-dialog-padding-primary) + 10px) !important; } </style> diff --git a/src/views/fysp/check/components/ComChangeEdit.vue b/src/views/fysp/check/components/ComChangeEdit.vue index 6c52b21..bfcf316 100644 --- a/src/views/fysp/check/components/ComChangeEdit.vue +++ b/src/views/fysp/check/components/ComChangeEdit.vue @@ -3,7 +3,7 @@ <div class="t-card_item"> 鏁存敼鍥剧墖 <div> - <el-button @click="chosePicFromAnyPic">浠庝换鎰忓浘鐗囬�夊彇</el-button> + <!-- <el-button @click="chosePicFromAnyPic">浠庝换鎰忓浘鐗囬�夊彇</el-button> --> <!-- <el-button type="primary" @click="chosePicFromLedgerPic">浠庡彴璐﹂�夊彇</el-button> --> <el-button @click="choseChangePic">浠庢枃浠跺す閫夊彇</el-button> </div> @@ -88,6 +88,9 @@ } }, props: { + changeType: { + type: Number + }, problemId: { type: String }, @@ -121,7 +124,7 @@ }, methods: { pictureValidate() { - if (this.fileList.length < 1) { + if (this.changeType == 1 && this.fileList.length < 1) { ElMessage({ message: '鑷冲皯涓婁紶涓�寮犲浘鐗�', type: 'error' @@ -132,11 +135,15 @@ message: '瓒呰繃涓夊紶, 宸插垹闄ゅ鍑虹殑鍥剧墖', type: 'error' }); + this.fileList = this.fileList.slice(0, 3); return false; } return true; }, initParams() { + if (this.changeType == 0) { + return; + } let beforeEditImgList = []; useCloned(this.oldChangeFileList).cloned.value.forEach((oldChangeFileitem) => { if (oldChangeFileitem.ischanged == 1) { @@ -178,15 +185,28 @@ const that = this; let deleteImgCopy = this.deleteImg; - fileUtil.getImageFiles(picUrls, function (files) { - data.append('deleteImg', deleteImgCopy); - data.append('problemId', that.problemId); - files.forEach((image) => { - data.append('images', image); + + if (this.changeType == 1) { + fileUtil.getImageFiles(picUrls, function (files) { + data.append('deleteImg', deleteImgCopy); + data.append('problemId', that.problemId); + files.forEach((image) => { + data.append('images', image); + }); + + problemApi.updateChange(data).then((res) => {}); }); - problemApi.updateChange(data).then((res) => {}); - }); - this.$emit('submited', true); + that.$emit('submited', true); + }else { + fileUtil.getImageFiles(picUrls, function (files) { + data.append('problemId', that.problemId); + files.forEach((image) => { + data.append('images', image); + }); + problemApi.changeProblem(data).then((res) => {}); + that.$emit('submited', true); + }); + } }, beforeRemoveFile(file, fileList) { if (file.remark == '宸蹭笂浼�') { diff --git a/src/views/fysp/check/components/CompDevicePhono.vue b/src/views/fysp/check/components/CompDevicePhono.vue index ee4f320..3900fa0 100644 --- a/src/views/fysp/check/components/CompDevicePhono.vue +++ b/src/views/fysp/check/components/CompDevicePhono.vue @@ -174,7 +174,7 @@ } .btns { - height: 10%; + /* height: 10%; */ } /* .img_types { @@ -189,7 +189,7 @@ } */ .imgs { - height: 370px; + height: 650px; width: 90%; min-height: 100px !important; /* border-style:solid; diff --git a/src/views/fysp/check/components/CompDeviceShowTest.vue b/src/views/fysp/check/components/CompDeviceShowTest.vue index 4c0ee18..db10cc4 100644 --- a/src/views/fysp/check/components/CompDeviceShowTest.vue +++ b/src/views/fysp/check/components/CompDeviceShowTest.vue @@ -20,110 +20,124 @@ </el-tabs> </el-col> </el-row> - <el-collapse style="height: 100%" v-model="activeNames"> - <el-collapse-item v-for="item in formInfo" :name="item" style="height: 100%"> + <el-collapse v-model="activeNames" style="border: 4px"> + <el-collapse-item v-for="item in formInfo" :name="item.id" class="collapse-item-class"> + <!-- <div v-if="activeNames.indexOf(item) !== -1" class="centerDiv"> + <el-button link type="primary" size="large">[鐐瑰嚮缂╂斁]</el-button> + </div> --> <template #title> - <!-- 鎽樿鍐呭寮�濮� --> - <div class="abstract_main" v-if="activeNames.indexOf(item) === -1"> - <span class="abstract_main_title">{{ item.name }}</span> - <div class="abstract_other_item_inner"> - <!-- 渚涘簲鍟� --> - <div class="abstract_other_item"> - <span class="abstract_other_title">{{ `渚涘簲鍟哷 }}</span> - <span class="abstract_main_text">{{ item.supplier || '鏃�' }}</span> - </div> - <!-- 杩愮淮鍟� --> - <div class="abstract_other_item"> - <span class="abstract_other_title">{{ `杩愮淮鍟哷 }}</span> - <span class="abstract_main_text">{{ item.maintainer || '鏃�' }}</span> - </div> - <!-- 杩愯鐘舵�� --> - <div class="abstract_other_item"> - <span class="abstract_other_title">{{ `杩愯鐘舵�乣 }}</span> - <span class="abstract_main_text">{{ - getRunStatusValueByRunStatusKey(item.runningStatus) || '鏃�' - }}</span> - </div> + <div style="display: flex; width: 100%; justify-content: space-between"> + <div style=""> + <el-descriptions style="" :column="3" size="small" border> + <el-descriptions-item width="64px" label="绔欑偣鍚嶇О" :span="3">{{ + item.name || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="渚涘簲鍟�">{{ + item.supplier || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="杩愮淮鍟�">{{ + item.maintainer || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="杩愮淮棰戞"> + <el-select + v-model="item.maintainFrequency" + :disabled="isDisabled" + style="width: 150px" + > + <el-option + v-for="frequency of maintainFrequencysArray" + :key="frequency.key" + :label="frequency.value" + :value="frequency.key" + ></el-option> + </el-select> + </el-descriptions-item> + <el-descriptions-item label="杩愮淮浜哄憳">{{ + item.maintainStaff || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="杩愮淮鑱旂郴鏂瑰紡">{{ + item.maintainTel || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="鍝佺墝鍨嬪彿">{{ + item.brandModel || '鏃�' + }}</el-descriptions-item> + <el-descriptions-item label="杩愯鐘舵��"> + <el-select + v-model="item.runningStatus" + :disabled="isDisabled" + style="width: 150px" + > + <el-option + v-for="status of runStatusArray" + :key="status.key" + :label="status.value" + :value="status.key" + ></el-option> + </el-select> + </el-descriptions-item> + </el-descriptions> + <!-- <div style="display: block"> + <span class="abstract_main_title">{{ `绔欑偣鍚嶇О ` }}</span> + <span class="abstract_main_text">{{ item.name || '鏃�' }}</span> + </div> --> + </div> + + <div style="display: flex"> + <!-- <div class="sub-title">{{ item.name }}</div> --> <!-- 鍥剧墖 --> <div class="image-container"> - <el-image - v-for="status in item._statusList" - fit="cover" - class="pic-style" - :src="status._picUrl" - :preview-src-list="Array.of(status._picUrl)" - /> + <div + class="block-div" + @click="onClickPic($event)" + v-for="(status, index) in item._statusList" + > + <el-image + v-if="index == 0" + fit="cover" + class="pic-style" + :src="status._picUrl" + :preview-src-list="Array.of(status._picUrl)" + /> + <span class="abstract_pic_text" v-if="index == 0">{{ + `鏈�鏂扮姸鎬佸浘鐗� ${status.dlCreateTime.slice(0, 10)}` + }}</span> + </div> </div> </div> </div> - <div v-else class="centerDiv"> - <el-button link type="primary" size="large">[鐐瑰嚮缂╂斁]</el-button> - </div> + <!-- <el-descriptions class="margin-top" :title="item.name" :column="3" :size="size" border> + <el-descriptions-item label="渚涘簲鍟�"> + {{ item.supplier || '鏃�' }} + </el-descriptions-item> + <el-descriptions-item label="杩愮淮鍟�"> + {{ item.maintainer || '鏃�' }} + </el-descriptions-item> + <el-descriptions-item label="杩愯鐘舵��"> + {{ getRunStatusValueByRunStatusKey(item.runningStatus) || '鏃�' }} + </el-descriptions-item> + </el-descriptions> --> + <!-- 鎽樿鍐呭寮�濮� --> <!-- 鎽樿鍐呭缁撴潫 --> </template> <!-- 璇︾粏鍐呭寮�濮� --> - <div class="sub-title">{{ item.name }}</div> <el-form :model="item" class="form_class"> - <!-- <el-form-item label="绔欑偣"> - <el-input v-model="item.name" :disabled="isDisabled"></el-input> - </el-form-item> --> - <el-form-item label="渚涘簲鍟�"> - <el-input v-model="item.supplier" :disabled="isDisabled"></el-input> - </el-form-item> - <el-form-item label="杩愮淮鍟�"> - <el-input v-model="item.maintainer" :disabled="isDisabled"></el-input> - </el-form-item> - <el-form-item label="杩愮淮棰戞"> - <el-select v-model="item.maintainFrequency" :disabled="isDisabled"> - <el-option - v-for="frequency of maintainFrequencysArray" - :key="frequency.key" - :label="frequency.value" - :value="frequency.key" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="杩愮淮浜哄憳"> - <el-input v-model="item.maintainStaff" :disabled="isDisabled"></el-input> - </el-form-item> - <el-form-item label="杩愮淮鑱旂郴鏂瑰紡"> - <el-input v-model="item.maintainTel" :disabled="isDisabled"></el-input> - </el-form-item> - <el-form-item label="鍝佺墝鍨嬪彿"> - <el-input v-model="item.brandModel" :disabled="isDisabled"></el-input> - </el-form-item> - <el-form-item label="杩愯鐘舵��"> - <el-select v-model="item.runningStatus" :disabled="isDisabled"> - <el-option - v-for="status of runStatusArray" - :key="status.key" - :label="status.value" - :value="status.key" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="鎵�鏈夋潈"> - <el-select v-model="item.ownership" :disabled="isDisabled"> - <el-option - v-for="ownership of ownershipArray" - :key="ownership.key" - :label="ownership.value" - :value="ownership.key" - ></el-option> - </el-select> - </el-form-item> <el-form-item label="鐘舵��"> <el-tabs tab-position="top"> - <el-tab-pane v-for="(status, i) in item._statusList" :label="status.dlCreateTime.slice(0, 10)"> + <el-tab-pane + v-for="(status, i) in item._statusList" + :label="status.dlCreateTime.slice(0, 10)" + > <el-form :model="status" class="form-class"> - <el-form-item label="浣嶇疆"> - <el-input + <el-form-item label="浣嶇疆" style="margin-bottom: 10px"> + <!-- <el-input + style="width: 250px;" v-model="status.dlLocation" :disabled="isDisabled" class="form-item-class" - ></el-input> + ></el-input> --> + {{ status.dlLocation }} </el-form-item> - <el-form-item label="缁忓害"> + <!-- <el-form-item label="缁忓害"> <el-input v-model="status.dlLongitude" :disabled="isDisabled" @@ -136,15 +150,21 @@ :disabled="isDisabled" class="form-item-class" ></el-input> - </el-form-item> - <el-form-item> + </el-form-item> --> + <el-form-item label="鍥剧墖"> <!-- 鍥剧墖 --> - <el-image - fit="cover" - class="pic-style" - :src="status._picUrl" - :preview-src-list="Array.of(status._picUrl)" - /> + <el-space> + <div v-if="status._paths && status._paths.length > 0"> + <el-image + v-for="path in status._paths" + fit="cover" + class="pic-style" + :src="path" + :preview-src-list="Array.of(path)" + /> + </div> + <el-empty v-else></el-empty> + </el-space> </el-form-item> </el-form> </el-tab-pane> @@ -161,6 +181,9 @@ </template> <script> +import dataMonitorDeviceTypeJs from './js/dataMonitorDeviceType.js'; +import dataProductionDeviceTypeJs from './js/dataProductionDeviceType.js'; +import dataTreatmentDeviceTypeJs from './js/dataTreatmentDeviceType.js'; import deviceApi from '@/api/fysp/deviceApi'; import { $fysp } from '@/api/index'; export default { @@ -336,18 +359,16 @@ // 灏嗕竴涓猨s瀵硅薄涓墍鏈塪i锛寃i锛宲i寮�澶寸殑灞炴�у叏閮ㄦ敼鎴愬幓鎺夎繖浜涘墠缂�骞朵笖閲嶆柊鍙樹负椹煎嘲寮忓懡鍚� const newObj = {}; for (const key in obj) { - if (obj.hasOwnProperty(key)) { - let newKey = key; - if (key.startsWith('di')) { - newKey = key.substring(2); - } else if (key.startsWith('wi')) { - newKey = key.substring(2); - } else if (key.startsWith('pi')) { - newKey = key.substring(2); - } - newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1); - newObj[newKey] = obj[key]; + let newKey = key; + if (key.startsWith('di')) { + newKey = key.substring(2); + } else if (key.startsWith('wi')) { + newKey = key.substring(2); + } else if (key.startsWith('pi')) { + newKey = key.substring(2); } + newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1); + newObj[newKey] = obj[key]; } return newObj; }, @@ -383,6 +404,7 @@ return; } element = this.convertKeys(result.data[index]); + element = this.setDeviceType(element); element._picUrls = imgPaths; for (let index = 0; index < statusData.length; index++) { const statusItem = statusData[index]; @@ -397,10 +419,36 @@ } }); }, + setDeviceType(element) { + var type = []; + switch (this.currSelect.topDeviceTypeId) { + case 0: + type = dataMonitorDeviceTypeJs.toLabel(element.sceneTypeId, Array.of(element.subtypeId)); + break; + case 1: + type = dataTreatmentDeviceTypeJs.toLabel( + element.sceneTypeId, + Array.of(element.subtypeId) + ); + break; + case 2: + type = dataProductionDeviceTypeJs.toLabel( + element.sceneTypeId, + Array.of(element.subtypeId) + ); + break; + } + if (type.length > 0) { + element._typename = type[0]; + } + return element; + }, // 淇濆瓨鐘舵�佷俊鎭� saveStatus(device, status) { var _picUrl = $fysp.imgUrl + status.dlPicUrl; status._picUrl = _picUrl; + status._paths = _picUrl.split(';'); + device._picUrls.push(_picUrl); if ('_statusList' in device) { device._statusList.push(status); } else { @@ -416,34 +464,32 @@ modifyObjectKeys(obj) { const newObj = {}; for (const key in obj) { - if (obj.hasOwnProperty(key)) { - // 璺宠繃浠� 'dl' 鎴� '_' 寮�澶寸殑灞炴�� - if (key.startsWith('dl') || key.startsWith('_')) { + // 璺宠繃浠� 'dl' 鎴� '_' 寮�澶寸殑灞炴�� + if (key.startsWith('dl') || key.startsWith('_')) { + newObj[key] = obj[key]; + continue; + } + // 鏍规嵁 topDeviceTypeId 娣诲姞鍓嶇紑 + let prefix = ''; + switch (this.currSelect.topDeviceTypeId) { + case 0: + prefix = 'di'; + break; + case 1: + prefix = 'pi'; + break; + case 2: + prefix = 'wi'; + break; + default: + // 濡傛灉 topDeviceTypeId 涓嶆槸 0, 1, 鎴� 2锛屼笉娣诲姞鍓嶇紑 newObj[key] = obj[key]; continue; - } - // 鏍规嵁 topDeviceTypeId 娣诲姞鍓嶇紑 - let prefix = ''; - switch (this.currSelect.topDeviceTypeId) { - case 0: - prefix = 'di'; - break; - case 1: - prefix = 'pi'; - break; - case 2: - prefix = 'wi'; - break; - default: - // 濡傛灉 topDeviceTypeId 涓嶆槸 0, 1, 鎴� 2锛屼笉娣诲姞鍓嶇紑 - newObj[key] = obj[key]; - continue; - } - - // 娣诲姞鍓嶇紑骞惰浆鎹负椹煎嘲寮忓懡鍚� - const newKey = `${prefix}${key.charAt(0).toUpperCase() + key.slice(1)}`; - newObj[newKey] = obj[key]; } + + // 娣诲姞鍓嶇紑骞惰浆鎹负椹煎嘲寮忓懡鍚� + const newKey = `${prefix}${key.charAt(0).toUpperCase() + key.slice(1)}`; + newObj[newKey] = obj[key]; } return newObj; }, @@ -457,14 +503,10 @@ generateIDeviceTypesMap() {}, // 鑾峰彇褰撳墠topType锛屽綋鍓峴ceneTypeId涓嬫墍鏈夌埗绫诲瀷 getAlliDeviceParentTypeArray() { - console.log('topDeviceTypeId', this.currSelect.topDeviceTypeId); - var sceneTypeAndIDeviceTypesMap = this.iDeviceTypesMap.get(this.currSelect.topDeviceTypeId); if (!sceneTypeAndIDeviceTypesMap) { return ''; } - console.log('sceneTypeId', this.scene.typeid); - console.log('scene', this.scene); var iDeviceTypesArray = sceneTypeAndIDeviceTypesMap.get(this.scene.typeid); if (!iDeviceTypesArray) { @@ -475,7 +517,6 @@ // 鑾峰彇璁惧绫诲瀷 topDeviceTypeId, sceneTypeId 鍜� 鑷韩鐨勪竴浜涘弬鏁� getIDeviceParentTypeObj(device) { var iDeviceTypesArray = this.getAlliDeviceParentTypeArray(); - console.log('iDeviceTypesArray', this.getAlliDeviceParentTypeArray()); var result; iDeviceTypesArray.forEach((e) => { if (e.value == device.typeId) { @@ -486,10 +527,7 @@ }, // 鑾峰彇璁惧瀛愮被鍨� topDeviceTypeId, sceneTypeId 鍜� 鑷韩鐨勪竴浜涘弬鏁� getIDeviceChildrenTypeObj(device) { - console.log('device', device); - var parentType = this.getIDeviceParentTypeObj(device); - console.log('parentType', this.getIDeviceParentTypeObj(device)); if (parentType == null || parentType == '' || !('children' in parentType)) { return ''; @@ -505,6 +543,9 @@ } }); return result; + }, + onClickPic(e, item) { + e.stopPropagation(); } } }; @@ -512,16 +553,17 @@ <style scoped> .image-container { + justify-content: flex-end; display: flex; - flex-direction: row-reverse; - width: 100%; - height: 200px; - overflow: hidden; /* 纭繚鍥剧墖涓嶄細瓒呭嚭瀹瑰櫒 */ + /* width: 300px; */ + /* flex-direction: row-reverse; */ + /* height: 225px; */ + /* overflow: hidden; 纭繚鍥剧墖涓嶄細瓒呭嚭瀹瑰櫒 */ } .pic-style { - width: 180px; - height: 180px; - margin-right: 5%; + width: 150px; + height: 150px; + border-radius: 4px; } .card-style { height: 400px; @@ -541,35 +583,61 @@ border-radius: 50%; } .abstract_main { - width: 100%; + width: 98%; } -.abstract_other_item { +.abstract_main_item { display: flex; flex-direction: column; margin-right: 50px; margin-top: 10px; - width: 20%; + /* width: 20%; */ +} +.abstract_other_item { + /* display: flex; + flex-direction: column; */ + /* margin-left: 50px; */ + /* margin-top: 10px; + width: 100vh; */ +} +.abstract_main_item_inner { + display: flex; + justify-content: center; } .abstract_other_item_inner { margin-left: 10px; display: flex; } .abstract_main_title { - margin-left: -400px; + /* margin-left: -400px; */ color: #303133; font-size: 16px; +} +.abstract_main_title { + color: #606266; + font-size: 13px; + margin-top: 10px; } .abstract_other_title { color: #606266; font-size: 13px; + margin-top: 45px; } .abstract_main_text { color: #303133; font-size: 17px; margin-top: 5px; } +.abstract_pic_text { + display: block; + color: var(--el-text-color-secondary); + font-size: 14px; + /* margin-top: 20px; */ +} +.block-div { + display: block; +} .form_class { - margin-left: 10px; + /* margin-left: 10px; */ } .el-collapse { @@ -590,4 +658,12 @@ margin-bottom: 30px; margin-left: 20px; } +.collapse-item-class { + height: 100%; + border: 5px; +} + +::-webkit-scrollbar { + height: 0; +} </style> diff --git a/src/views/fysp/check/components/CompLedgerPic.vue b/src/views/fysp/check/components/CompLedgerPic.vue index d209ac7..ce3275f 100644 --- a/src/views/fysp/check/components/CompLedgerPic.vue +++ b/src/views/fysp/check/components/CompLedgerPic.vue @@ -38,9 +38,9 @@ watch: { activeName: { handler(newObj, oldObj) { - this.imgList = this.imgListAll.filter(item=>{ - return item.ledgerType == newObj - }) + this.imgList = this.imgListAll.filter((item) => { + return item.ledgerType == newObj; + }); }, immediate: true } @@ -120,7 +120,7 @@ </script> <style scoped> .imgs { - height: 370px; + height: 650px; width: 90%; min-height: 100px !important; /* border-style:solid; @@ -181,7 +181,7 @@ padding: 5px; } .btns { - height: 10%; + /* height: 10%; */ } .center { display: flex; diff --git a/src/views/fysp/check/components/CompProRecent.vue b/src/views/fysp/check/components/CompProRecent.vue index c97fad2..915b27b 100644 --- a/src/views/fysp/check/components/CompProRecent.vue +++ b/src/views/fysp/check/components/CompProRecent.vue @@ -22,7 +22,7 @@ <el-table-column type="index" width="50" /> <el-table-column prop="problemname" label="闂"/> <el-table-column prop="_time" label="鏃堕棿" width="250" /> - <el-table-column prop="鎿嶄綔" label="鎿嶄綔" width="180"> + <el-table-column label="鎿嶄綔" width="180"> <template v-slot="scope"> <el-button link type="primary" @click="info(scope.row)">璇︽儏</el-button> </template> @@ -86,7 +86,6 @@ CompProblemAddOrUpd }, mounted() { - console.log('subtask', this.subtask); this.deepCopyPro = useCloned(this.problem).cloned.value; this.getRecentPros(); @@ -137,10 +136,7 @@ // 璁$畻涓�骞村墠鐨勬棩鏈� const oneYearAgo = new Date(today); oneYearAgo.setFullYear(today.getFullYear() - 1); - console.log('today', this.$fm.formatYMDH(today)); - console.log('threeMonthsAgo', this.$fm.formatYMDH(threeMonthsAgo)); - console.log('sixMonthsAgo', this.$fm.formatYMDH(sixMonthsAgo)); - console.log('oneYearAgo', this.$fm.formatYMDH(oneYearAgo)); + return { startTime: this.activeName === '杩戜笁涓湀' @@ -155,11 +151,11 @@ /** * 鑾峰彇杩戞湡鎯呭喌 * */ - getRecentPros() { + async getRecentPros() { this.loading = true; this.subtaskCount = 0 // 鑾峰彇瀛愪换鍔″垪琛� - taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => { + await taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => { this.curProList = []; if (subtasks) { subtasks.forEach((subtask) => { @@ -167,15 +163,13 @@ this.getProBySubtask(subtask); }); } - }); // 棰濆澶勭悊 - console.log('curr', this.curProList); this.curProList.sort((o1, o2) => o2.getTime() - o1.getTime()); this.loading = false; }, // 鏍规嵁瀛愪换鍔¤幏鍙栭噷闈㈢殑闂鍒楄〃 - getProBySubtask(subtask) { + async getProBySubtask(subtask) { taskApi.getProBySubtask(subtask.stGuid).then((pros) => { if (pros) { pros.forEach((pro) => { diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue index 19c20e3..d901b6a 100644 --- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue +++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue @@ -83,7 +83,7 @@ accept="image/*" > <el-button type="primary" id="uploadBtnId" style="display: none"></el-button> - <el-icon> + <el-icon v-show="fileList.length != 3"> <Plus /> </el-icon> </el-upload> @@ -109,6 +109,7 @@ </ArbitraryPhoto> </el-dialog> <el-dialog + title="鍙拌处鍥剧墖" width="80%" v-model="ledgerPicDialog" :before-close="beforeLedgerPicDialogclose" @@ -141,7 +142,7 @@ </CompDevicePhono> </el-dialog> <el-dialog v-model="previewDialogVisible"> - <img w-full :src="previewDialogImageUrl" alt="棰勮" class="preview-pic"/> + <img w-full :src="previewDialogImageUrl" alt="棰勮" class="preview-pic" /> </el-dialog> </div> </template> @@ -153,7 +154,7 @@ import { $fysp } from '@/api/index.js'; import fileUtil from '@/utils/fileUtils.js'; -import { useCloned } from '@vueuse/core'; +import { get, useCloned } from '@vueuse/core'; import { ElMessage } from 'element-plus'; import deviceApi from '@/api/fysp/deviceApi'; export default { @@ -241,11 +242,13 @@ computed: { descriptionOptions() { const descriptions = []; + this.problemTypeList.forEach((item) => { if (item.typename == this.proType) { descriptions.push(item); } }); + return descriptions; }, problemTypeOptions() { @@ -258,9 +261,11 @@ }, []); }, adviseOptions() { - var array = this.suggestions.filter((item) => item.adProblemtypeguid == this.currProTypeGuid); - console.log('adName', array); - + var problemGuid = this.currProTypeGuid || this.problem.guid; + console.log("problemGuid", problemGuid); + + var array = this.suggestions.filter((item) => item.adProblemtypeguid == problemGuid); + console.log("array", array); return array; } }, @@ -311,12 +316,11 @@ return new Date(x.dlCreateTime) - new Date(y.dlCreateTime); // 闄嶅簭锛屽崌搴忓垯鍙嶄箣 }); }, - getDeviceImgList() { + async getDeviceImgList() { this.deviceImgObjList = []; - this.deviceTopTypes.forEach(e => { - - const topTypeId = e.id; - deviceApi.fetchDevices(this.subtask.sceneId, topTypeId).then((result) => { + for (const deviceTopTypeElement of this.deviceTopTypes) { + const topTypeId = deviceTopTypeElement.id; + await deviceApi.fetchDevices(this.subtask.sceneId, topTypeId).then((result) => { // 鏍囧噯鍖栧睘鎬у悕 for (let i = 0; i < result.data.length; i++) { var element = this.convertKeys(result.data[i]); @@ -356,7 +360,7 @@ .catch((err) => {}); } }); - }); + } }, initOptions() { if (this.problem == undefined || this.problem == null) { @@ -423,10 +427,6 @@ // 闂寤鸿 problemApi.getSuggestion().then((res) => { this.suggestions = res.data; - // 濉厖褰撳墠闂寤鸿 - this.deepCopyProblem.advise = this.suggestions.filter( - (item) => item.adProblemtypeguid == this.deepCopyProblem.guid - )[0].adName; }); // 闂浣嶇疆 @@ -444,7 +444,7 @@ this.oldFileList.filter((item) => item.url != file.url); } }, - handleLedgerPicPhono() { + handleLedgerPicPhono(data) { this.beforeLedgerPicDialogclose(); let isExist = false; for (const item of data) { @@ -461,9 +461,6 @@ } isExist = false; } - }, - beforeLedgerPicDialogclose() { - this.ledgerPicDialog = false; }, findProTypeByGuid(guid) { let result; @@ -493,11 +490,12 @@ let currPro = this.findProTypeByGuid(value); this.deepCopyProblem.advise = ''; this.currProTypeGuid = value; - this.deepCopyProblem.description = currPro.description; + // this.deepCopyProblem.description = currPro.description; this.changeProblemname(); this.deepCopyProblem.advise = ''; - this.deepCopyProblem.advise = this.adviseOptions[0].adName; + var adName = this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName; + this.deepCopyProblem.advise = adName; }, onProLocationChange(value) { this.posList.forEach((item) => { @@ -624,25 +622,6 @@ isExist = false; } }, - handleLedgerPicPhono(data) { - let isExist = false; - for (const item of data) { - for (const already of this.fileList) { - if (item.url == already.url) { - isExist = true; - } - } - if (!isExist) { - this.fileList.push({ - url: item.url, - name: '1' - }); - } - isExist = false; - } - - this.beforeAnyPhotoDialogclose(); - }, chosePicFromAnyPic() { this.anyPhotoDialog = true; }, @@ -706,9 +685,13 @@ .row { width: 100%; } - +::v-deep .el-dialog { + --el-dialog-margin-top: 2vh; + height: 98vh; +} ::v-deep .el-dialog__body { width: 95%; + height: 100%; } ::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail { object-fit: cover !important; @@ -718,4 +701,7 @@ width: 100%; height: 100%; } +::v-deep .el-upload--picture-card { + border: 0 !important; +} </style> diff --git a/src/views/fysp/check/components/CompProblemCard.vue b/src/views/fysp/check/components/CompProblemCard.vue index 04947c6..3db8c37 100644 --- a/src/views/fysp/check/components/CompProblemCard.vue +++ b/src/views/fysp/check/components/CompProblemCard.vue @@ -60,14 +60,7 @@ <el-col :span="12"> <el-row justify="start" class="btn-group"> <el-button type="success" size="small" @click="updatePro" plain>闂鏇存</el-button> - <el-button - type="primary" - size="small" - @click="updateChange" - plain - :disabled="!proStatus.changeable" - >鏁存敼妫�楠�</el-button - > + <el-button type="primary" size="small" @click="updateChange" plain>鏁存敼妫�楠�</el-button> <el-button type="info" size="small" @click="currProRecent" plain>闂澶嶇幇</el-button> </el-row> </el-col> @@ -86,14 +79,31 @@ </el-col> </el-row> </el-card> - <el-dialog v-model="proAddOrUpdDialogVisible" :before-close="proAddOrUpdDialogClose" width="80%"> - <CompProblemAddOrUpd - v-if="proAddOrUpdDialogVisible" - :problem="deepCopyPro" - :subtask="deepCopySubtask" - :topTask="deepCopyTopTask" - ref="compProblemAddOrUpdRef" - @submited="onProSubmited" + <div class="dialog-wrapper"> + <el-dialog + title="闂鏇存" + width="80%" + v-model="proAddOrUpdDialogVisible" + :before-close="proAddOrUpdDialogClose" + > + <CompProblemAddOrUpd + v-if="proAddOrUpdDialogVisible" + :problem="deepCopyPro" + :subtask="deepCopySubtask" + :topTask="deepCopyTopTask" + ref="compProblemAddOrUpdRef" + @submited="onProSubmited" + /> + </el-dialog> + </div> + <el-dialog width="80%" title="鏁存敼鎻愪氦" v-model="addChangeDialogVisible"> + <ComChangeEdit + :changeType="0" + v-if="addChangeDialogVisible" + :problemId="problem.guid" + :subtask="subtask" + :month="month" + @submited="onAddChangeSubmited" /> </el-dialog> <el-dialog @@ -103,6 +113,7 @@ :before-close="changeEditDialogClose" > <ComChangeEdit + :changeType="1" v-if="changeEditDialogVisible" :problemId="problem.guid" :oldChangeFileList="problem.mediafileList" @@ -118,11 +129,12 @@ v-model="proRecentDialogVisible" :before-close="proRecentDialogClose" > - <CompProRecent - v-if="proRecentDialogVisible" + <CompProRecent + v-if="proRecentDialogVisible" :subtask="subtask" :topTask="topTask" - :problem="problem"/> + :problem="problem" + /> </el-dialog> </template> @@ -174,6 +186,7 @@ emits: ['submit'], data() { return { + addChangeDialogVisible: false, // 杩戞湡鎯呭喌 proRecentDialogVisible: false, month: -1, @@ -199,10 +212,7 @@ ] }; }, - mounted() { - console.log(this.topTask); - - }, + mounted() {}, computed: { // 闂鍚嶇О title() { @@ -243,6 +253,10 @@ } }, methods: { + onAddChangeSubmited() { + this.$emit('updated', true); + this.addChangeDialogVisible = false; + }, // 杩戞湡鎯呭喌寮圭獥鍏抽棴 proRecentDialogClose() { this.proRecentDialogVisible = false; @@ -255,8 +269,6 @@ this.proAddOrUpdDialogVisible = false; }, onChangeSubmited(isOk) { - console.log("zhenggaisubmit"); - this.$emit('updated', isOk); this.changeEditDialogVisible = false; }, @@ -266,7 +278,23 @@ changeEditDialogClose() { this.changeEditDialogVisible = false; }, - deletePro() {}, + deletePro() { + useMessageBoxTip({ + confirmMsg: '鏄惁鍒犻櫎闂', + confirmTitle: '纭畾', + onConfirm: () => { + return problemApi + .deleteProblem({ + pid: this.problem.guid + }) + .then((res) => { + if (res.success) { + this.$emit('submit') + } + }); + } + }); + }, rejectPro() { this.checkPro(false); }, @@ -290,9 +318,10 @@ } }); }, + addChange() { + this.addChangeDialogVisible = true; + }, updatePro() { - console.log("clone", this.topTask); - this.deepCopyPro = useCloned(this.problem).cloned.value; this.deepCopySubtask = useCloned(this.subtask).cloned.value; this.deepCopyTopTask = useCloned(this.topTask).cloned.value; @@ -300,7 +329,7 @@ this.proAddOrUpdDialogVisible = true; }); }, - updateChange() { + getCurrentMouth() { // 浣跨敤Date瀵硅薄瑙f瀽鏃ユ湡瀛楃涓� var date = new Date(this.subtask.subtask.planstarttime); // 鑾峰彇鏈堜唤淇℃伅锛屾湀浠芥槸浠�0寮�濮嬬殑锛屾墍浠ラ渶瑕佸姞1 @@ -311,7 +340,14 @@ // 鑾峰彇骞翠唤 var year = date.getFullYear(); this.month = `${year}-${this.month}`; - this.changeEditDialogVisible = true; + }, + updateChange() { + this.getCurrentMouth(); + if (!this.problem.ischanged) { + this.addChange(); + } else { + this.changeEditDialogVisible = true; + } }, currProRecent() { this.proRecentDialogVisible = true; diff --git a/src/views/fysp/check/components/js/dataMonitorDeviceType.js b/src/views/fysp/check/components/js/dataMonitorDeviceType.js new file mode 100644 index 0000000..78db0a9 --- /dev/null +++ b/src/views/fysp/check/components/js/dataMonitorDeviceType.js @@ -0,0 +1,77 @@ +const dustDeviceType = [ + { + label: '鎵皹鐩戞祴', + value: '1', + children: [ + { + label: '鎵皹鐩戞祴', + value: '1', + }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '娌圭儫鐩戞祴', + value: '1', + children: [ + { + label: '娌圭儫鐩戞祴', + value: '1', + }, + ], + }, +]; + +const vocDeviceType = [ + { + label: 'VOC鐩戞祴', + value: '1', + children: [ + { + label: 'VOC鐩戞祴', + value: '1', + }, + ], + }, +]; + +// 鐩戞祴璁惧绫诲瀷 +function monitorDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + const labelArr = []; + let options = monitorDevices(sceneType); + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + labelArr.push(op.label); + options = options[0].children; + } + }); + + return labelArr; +} + +export default { monitorDevices, toLabel }; diff --git a/src/views/fysp/check/components/js/dataProductionDeviceType.js b/src/views/fysp/check/components/js/dataProductionDeviceType.js new file mode 100644 index 0000000..633146b --- /dev/null +++ b/src/views/fysp/check/components/js/dataProductionDeviceType.js @@ -0,0 +1,67 @@ +const dustDeviceType = [ + { + label: '闈為亾', + value: '1', + children: [ + { label: '鎸栨帢鏈�', value: '1' }, + { label: '鍙夎溅', value: '2' }, + { label: '灞ュ甫鍚�', value: '3' }, + { label: '閾茶溅', value: '4' }, + { label: '鍙戝姩鏈�', value: '5' }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '鍘ㄥ叿', + value: '1', + children: [{ label: '鍘ㄥ叿', value: '1' }], + }, +]; + +const vocDeviceType = [ + { + label: 'VOC', + value: '1', + children: [{ label: 'VOC', value: '1' }], + }, +]; + +// 鐢熶骇璁惧绫诲瀷 +function productionDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + const labelArr = []; + let options = productionDevices(sceneType); + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + labelArr.push(op.label); + options = options.children; + } + }); + return labelArr; +} + +export default { productionDevices, toLabel }; diff --git a/src/views/fysp/check/components/js/dataTreatmentDeviceType.js b/src/views/fysp/check/components/js/dataTreatmentDeviceType.js new file mode 100644 index 0000000..945be3d --- /dev/null +++ b/src/views/fysp/check/components/js/dataTreatmentDeviceType.js @@ -0,0 +1,81 @@ +const dustDeviceType = [ + { + label: '鎶�闃�', + value: '1', + children: [ + { label: '鐜繚娲掓按杞︼紙澶у瀷闈炵數鍔級', value: '1' }, + { label: '鐢靛姩闆剧偖杞�', value: '2' }, + { label: '鐢靛姩娲掓按杞︼紙灏忓瀷锛�', value: '3' }, + { label: '闆剧偖杞︼紙鍥哄畾鎴栬疆寮忥級', value: '4' }, + { label: '鑷姩鍐叉礂瑁呯疆锛堝皝闂紡锛�', value: '5' }, + { label: '楂樻晥娲楄疆鏈�', value: '6' }, + { label: '楂樺帇姘存灙', value: '7' }, + { label: '鏅�氭按绠℃垨娑堥槻鏍�', value: '8' }, + { label: '濉斿悐鍠锋穻', value: '9' }, + { label: '鍥村鍠锋穻', value: '10' }, + { label: '鎵皹鐩戞祴涓庡柗娣嬭仈鍔�', value: '11' }, + { label: '鍫嗗満鍠锋穻', value: '12' }, + { label: '鐢熶骇鍖哄柗娣�', value: '13' }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '鍑�鍖�', + value: '1', + children: [{ label: '娌圭儫鍑�鍖�', value: '1' }], + }, +]; + +const vocDeviceType = [ + { + label: '鍑�鍖�', + value: '1', + children: [{ label: '鍥哄簾鍑�鍖�', value: '1' }], + }, +]; + +// 娌荤悊璁惧绫诲瀷 +function treatmentDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + console.log("valueArr", valueArr) + const labelArr = []; + let options = treatmentDevices(sceneType); + options = options[0].children + console.log("options", options) + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + console.log("op", op) + labelArr.push(op.label); + // options = options.children; + } + }); + + console.log("labelArr", labelArr) + return labelArr; +} + +export default { treatmentDevices, toLabel }; -- Gitblit v1.9.3