From 2527a643d7ac70c7a4742b297972d46c8b1495a4 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期二, 12 十一月 2024 10:50:09 +0800 Subject: [PATCH] 问题审核bug修改 --- src/views/fysp/check/components/ArbitraryPhoto.vue | 98 +++--- src/views/fysp/check/ProCheck.vue | 67 ++-- src/components.d.ts | 21 - src/views/fysp/check/components/CompLedgerPic.vue | 2 src/views/fysp/check/components/CompProblemAddOrUpd.vue | 226 ++++++++++------- src/views/fysp/check/components/CompProRecent.vue | 4 src/views/fysp/check/components/ComChangeEdit.vue | 54 ++- src/views/fysp/check/components/CompDeviceShowTest.vue | 272 ++++---------------- 8 files changed, 304 insertions(+), 440 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index 7d97466..560e134 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -12,32 +12,23 @@ BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default'] CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default'] Content: typeof import('./components/core/Content.vue')['default'] - ElAffix: typeof import('element-plus/es')['ElAffix'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] - ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] - ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCard: typeof import('element-plus/es')['ElCard'] - ElCascader: typeof import('element-plus/es')['ElCascader'] - ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElContainer: typeof import('element-plus/es')['ElContainer'] - ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] @@ -45,37 +36,25 @@ ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElLink: typeof import('element-plus/es')['ElLink'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] - ElPagination: typeof import('element-plus/es')['ElPagination'] - ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElPopover: typeof import('element-plus/es')['ElPopover'] - ElRadio: typeof import('element-plus/es')['ElRadio'] - ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] - ElSegmented: typeof import('element-plus/es')['ElSegmented'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSpace: typeof import('element-plus/es')['ElSpace'] ElStep: typeof import('element-plus/es')['ElStep'] ElSteps: typeof import('element-plus/es')['ElSteps'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] - ElTooltip: typeof import('element-plus/es')['ElTooltip'] - ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] Footer: typeof import('./components/core/Footer.vue')['default'] diff --git a/src/views/fysp/check/ProCheck.vue b/src/views/fysp/check/ProCheck.vue index d5e6803..8ca7913 100644 --- a/src/views/fysp/check/ProCheck.vue +++ b/src/views/fysp/check/ProCheck.vue @@ -8,7 +8,11 @@ </SearchBar> </template> <template #aside> - <SideList :items="subtasks" :loading="sideLoading" @item-click="chooseSubtask"></SideList> + <SideList + :items="subtasks" + :loading="sideLoading" + @item-click="chooseSubtask" + ></SideList> </template> <template #main> <ToolBar @@ -17,7 +21,11 @@ :buttons="buttons" :loading="mainLoading" ></ToolBar> - <el-scrollbar v-if="curProList.length > 0" class="el-scrollbar" v-loading="mainLoading"> + <el-scrollbar + v-if="curProList.length > 0" + class="el-scrollbar" + v-loading="mainLoading" + > <CompProblemCard v-if="compProblemCardVisible" :key="i" @@ -47,21 +55,14 @@ @submited="newProSubmit" /> </el-dialog> - <el-dialog - v-model="anyPhotoDialog" - :before-close="beforeAnyPhotoDialogclose" - width="80%" - title="浠绘剰鍥剧墖" - > - <ArbitraryPhoto - v-if="anyPhotoDialog" - :readonly="true" - :subtask="curSubtask.data" - ref="arbitraryPhotoRef" - @selectByAnyPhonoEvent="handleCloseCheckAnyPhono" - > - </ArbitraryPhoto> - </el-dialog> + <ArbitraryPhoto + v-if="anyPhotoDialog" + v-model:dialog-visible="anyPhotoDialog" + title="鍦烘櫙鍥剧墖" + :readonly="true" + :subtask="curSubtask.data" + ref="arbitraryPhotoRef" + ></ArbitraryPhoto> <el-drawer direction="ltr" v-model="deviceShowDialog" @@ -69,7 +70,8 @@ title="璁炬柦璁惧" size="45%" > - <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef"> </CompDeviceShowTest> + <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef"> + </CompDeviceShowTest> </el-drawer> </template> @@ -77,14 +79,9 @@ import ArbitraryPhoto from './components/ArbitraryPhoto.vue'; import taskApi from '@/api/fysp/taskApi'; import ProCheckProxy from './ProCheckProxy'; - -import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; import CompProblemAddOrUpd from './components/CompProblemAddOrUpd.vue'; -import CompDeviceShow from './components/CompDeviceShow.vue'; - import CompProblemCard from './components/CompProblemCard.vue'; import CompSubTaskStatistic from './components/CompSubTaskStatistic.vue'; -import CompProRecent from './components/CompProRecent.vue'; import CompDeviceShowTest from './components/CompDeviceShowTest.vue'; export default { components: { @@ -92,8 +89,7 @@ CompSubTaskStatistic, CompProblemAddOrUpd, ArbitraryPhoto, - CompDeviceShowTest, - CompProRecent + CompDeviceShowTest }, data() { return { @@ -126,7 +122,7 @@ } }, { - name: '浠绘剰鍥剧墖', + name: '鍦烘櫙鍥剧墖', color: 'warning', click: () => { this.anyPhotoDialog = true; @@ -139,11 +135,11 @@ this.openDeviceShowDialog(); } }, - { - name: '鎵归噺瀹℃牳', - color: 'primary', - click: () => {} - } + // { + // name: '鎵归噺瀹℃牳', + // color: 'primary', + // click: () => {} + // } ] }; }, @@ -239,7 +235,7 @@ // 鍏抽棴璁惧鍥惧脊绐� beforeDeviceShowDialogclose(done) { // this.deviceShowDialog = false; - done() + done(); }, // 鍏抽棴浠绘剰鍥剧墖寮圭獥 beforeAnyPhotoDialogclose() { @@ -259,9 +255,9 @@ this.curProList = []; this.curSubtask = {}; const param = { - topTaskId: formSearch.topTask.tguid, - sceneTypeId :formSearch.sceneTypeId - } + topTaskId: formSearch.topTask.tguid, + sceneTypeId: formSearch.sceneTypeId + }; taskApi.getSubtaskSummary(param).then((res) => { const list = []; res.forEach((s) => { @@ -312,7 +308,6 @@ }, // 闂鍗$墖缁勪欢涓诲姩鍙戣捣鍒锋柊鐖剁粍浠舵暟鎹� updateSubtask() { - this.curSubtask.data.proCheckedNum++; this.curSubtask.type = this.getSubtaskType(this.curSubtask.data); this.refreshCurrSubtask(); diff --git a/src/views/fysp/check/components/ArbitraryPhoto.vue b/src/views/fysp/check/components/ArbitraryPhoto.vue index f880324..ee39f50 100644 --- a/src/views/fysp/check/components/ArbitraryPhoto.vue +++ b/src/views/fysp/check/components/ArbitraryPhoto.vue @@ -1,52 +1,10 @@ <template> - <div class="main"> - <el-row justify="end" class="btns" v-if="!readonly"> - <el-text size="small" type="info" class="m-r-8" - >鏈�澶氶�夋嫨{{ maxSelect }}寮犲浘鐗�</el-text - > - <el-button - size="small" - type="primary" - @click="sendSelectedImg(true)" - :disabled="selectedImgUrlList.length == 0" - >纭畾</el-button - > - <el-button size="small" type="primary" @click="sendSelectedImg(false)" - >鍙栨秷</el-button - > - </el-row> - - <div class="center"> - <!-- <el-descriptions> - <el-descriptions-item label="鎬绘暟"> - <span>{{ this.imgUrlList.length }}</span> - </el-descriptions-item> - </el-descriptions> --> - <el-tabs v-model="activeId" type="card"> - <el-tab-pane - v-for="item in typeList" - :key="item.businesstypeid" - :label=" - item.businesstype + ' (' + typeImgMap.get(item.businesstypeid).length + ')' - " - :name="item.businesstypeid" - > - </el-tab-pane> - </el-tabs> - <el-empty v-if="isEmpty" description="鏆傛棤璁板綍" /> - <el-scrollbar v-else class="imgs"> - <el-image - v-for="(img, i) in typeImgMap.get(activeId)" - :key="i" - :class="[Boolean(img.isSelect) ? 'selected' : 'noActive', 'image']" - fit="cover" - :src="img.url" - lazy - @click="onSelect(img, i)" - /> - </el-scrollbar> - </div> - </div> + <FYImageSelectDialog + :typeList="typesList" + :typeImgMap="typesMap" + :readonly="readonly" + :maxSelect="3" + ></FYImageSelectDialog> </template> <script> import problemApi from '@/api/fysp/problemApi.js'; @@ -81,6 +39,8 @@ data() { return { // 鏃犳暟鎹� + typesList: [], + typesMap: new Map(), isEmpty: false, isClose: false, isAll: false, @@ -138,15 +98,55 @@ } }); }); - }, + } } }, mounted() { // if (this.subtask) { // this.getAllImgList(); // } + this.getGroupImgs(); }, methods: { + onImageSelectSubmit(value) { + this.$emit('selectByAnyPhonoEvent', value); + }, + // 鍥剧墖鍒嗙被 + getGroupImgs() { + mediafileApi.getRoutineByStGuid(this.subtask.stGuid).then((res) => { + let typeList = []; + let typeMap = new Map(); + function hasThisTypeName(typeName) { + return typeList.map((item) => item.typeName).indexOf(typeName) != -1; + } + function addNewType(typeId, typeName, img) { + typeList.push({ + typeId: typeId, + typeName: typeName + }); + typeMap.set(typeId, [img]); + } + function addToThisType(typeId, img) { + typeMap.get(typeId).push(img); + } + const data = res.data; + for (const e of data) { + let img = { + url: $fysp.imgUrl + e.extension1 + e.guid + '.jpg' + }; + const businesstype = e.businesstype; + const businesstypeid = e.businesstypeid; + if (hasThisTypeName(businesstype)) { + addToThisType(businesstypeid, img); + } else { + addNewType(businesstypeid, businesstype, img); + } + } + + this.typesList = typeList; + this.typesMap = typeMap; + }); + }, // 鍒濆鍖栧垰寮�濮嬮�変腑鐨勬爣绛� initSelectedTab() { if (this.typeList.length > 0) { diff --git a/src/views/fysp/check/components/ComChangeEdit.vue b/src/views/fysp/check/components/ComChangeEdit.vue index af5562b..c297afb 100644 --- a/src/views/fysp/check/components/ComChangeEdit.vue +++ b/src/views/fysp/check/components/ComChangeEdit.vue @@ -21,7 +21,11 @@ :disabled="readonly" accept="image/*" > - <el-button type="primary" id="uploadBtnId" style="display: none"></el-button> + <el-button + type="primary" + id="uploadBtnId" + style="display: none" + ></el-button> <el-icon> <Plus /> </el-icon> @@ -30,21 +34,16 @@ <el-button type="primary" @click="onSubmit">淇濆瓨</el-button> <el-button @click="this.$emit('submited', false)">鍙栨秷</el-button> </div> - <el-dialog - title="浠绘剰鍥剧墖" - width="80%" - v-model="anyPhotoDialog" - :before-close="beforeAnyPhotoDialogclose" + <ArbitraryPhoto + :max-select="3" + v-if="anyPhotoDialog" + v-model:dialog-visible="anyPhotoDialog" + @selectByAnyPhonoEvent="handleSelectedAnyPhono" + :subtask="subtask" + :defaultFile="fileList" + ref="arbitraryPhotoRef" > - <ArbitraryPhoto - v-if="anyPhotoDialog" - @selectByAnyPhonoEvent="handleSelectedAnyPhono" - :subtask="subtask" - :defaultFile="fileList" - ref="arbitraryPhotoRef" - > - </ArbitraryPhoto> - </el-dialog> + </ArbitraryPhoto> <el-dialog title="鍙拌处鍥剧墖" width="80%" @@ -145,14 +144,19 @@ return; } let beforeEditImgList = []; - useCloned(this.oldChangeFileList).cloned.value.forEach((oldChangeFileitem) => { - if (oldChangeFileitem.ischanged == 1) { - oldChangeFileitem.url = - $fysp.imgUrl + oldChangeFileitem.extension1 + oldChangeFileitem.guid + '.jpg'; - oldChangeFileitem.name = '1'; - beforeEditImgList.push(oldChangeFileitem); + useCloned(this.oldChangeFileList).cloned.value.forEach( + (oldChangeFileitem) => { + if (oldChangeFileitem.ischanged == 1) { + oldChangeFileitem.url = + $fysp.imgUrl + + oldChangeFileitem.extension1 + + oldChangeFileitem.guid + + '.jpg'; + oldChangeFileitem.name = '1'; + beforeEditImgList.push(oldChangeFileitem); + } } - }); + ); this.fileList = useCloned(beforeEditImgList).cloned.value; this.oldFileList = useCloned(beforeEditImgList).cloned.value; }, @@ -184,7 +188,7 @@ const that = this; let deleteImgCopy = this.deleteImg; - + if (this.changeType == 1) { fileUtil.getImageFiles(picUrls, function (files) { data.append('deleteImg', deleteImgCopy); @@ -192,11 +196,11 @@ files.forEach((image) => { data.append('images', image); }); - + problemApi.updateChange(data).then((res) => {}); }); that.$emit('submited', true); - }else { + } else { fileUtil.getImageFiles(picUrls, function (files) { data.append('problemId', that.problemId); files.forEach((image) => { diff --git a/src/views/fysp/check/components/CompDeviceShowTest.vue b/src/views/fysp/check/components/CompDeviceShowTest.vue index fa6b910..a45c39b 100644 --- a/src/views/fysp/check/components/CompDeviceShowTest.vue +++ b/src/views/fysp/check/components/CompDeviceShowTest.vue @@ -3,14 +3,22 @@ <!-- 閫夐」 --> <!-- 璁惧绫诲瀷 --> <el-row> - <!-- <el-col> - <span>璁惧绫诲瀷锛�</span> - </el-col> --> <el-col> - <el-tabs class="child_select" placeholder="璁惧绫诲瀷" v-model="currSelect.topDeviceTypeId"> - <el-tab-pane v-for="item in deviceTopTypes" :name="item.id"> + <el-tabs + class="child_select" + placeholder="璁惧绫诲瀷" + v-model="currSelect.topDeviceTypeId" + > + <el-tab-pane + v-for="item in deviceTopTypes" + :key="item.id" + :name="item.id" + > <template #label> - <el-badge :value="item.count" :type="item.count == 0 ? 'danger' : 'primary'"> + <el-badge + :value="item.count" + :type="item.count == 0 ? 'danger' : 'primary'" + > <span class="custom-tabs-label"> <span>{{ item.label }}</span> </span> @@ -21,12 +29,16 @@ </el-col> </el-row> <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> --> + <el-collapse-item + v-for="item in formInfo" + :key="item.id" + :name="item.id" + class="collapse-item-class" + > <template #title> - <div style="display: flex; width: 100%; justify-content: space-between"> + <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">{{ @@ -75,11 +87,10 @@ ></el-option> </el-select> </el-descriptions-item> + <el-descriptions-item label="绫诲瀷"> + {{ item._typename || '鏃�' }} + </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"> @@ -90,6 +101,7 @@ class="block-div" @click="onClickPic($event)" v-for="(status, index) in item._statusList" + :key="index" > <el-image v-if="index == 0" @@ -105,19 +117,6 @@ </div> </div> </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> <!-- 璇︾粏鍐呭寮�濮� --> <el-form :model="item" class="form_class"> @@ -126,41 +125,23 @@ <el-tab-pane v-for="(status, i) in item._statusList" :label="status.dlCreateTime.slice(0, 10)" + :key="i" > <el-form :model="status" class="form-class"> <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> --> {{ status.dlLocation }} </el-form-item> - <!-- <el-form-item label="缁忓害"> - <el-input - v-model="status.dlLongitude" - :disabled="isDisabled" - class="form-item-class" - ></el-input> - </el-form-item> - <el-form-item label="绾害"> - <el-input - v-model="status.dlLatitude" - :disabled="isDisabled" - class="form-item-class" - ></el-input> - </el-form-item> --> <el-form-item label="鍥剧墖"> <!-- 鍥剧墖 --> <el-space> <div v-if="status._paths && status._paths.length > 0"> <el-image - v-for="path in status._paths" + v-for="(path, i) in status._paths" fit="cover" class="pic-style" :src="path" :preview-src-list="Array.of(path)" + :key="i" /> </div> <el-empty v-else></el-empty> @@ -171,7 +152,6 @@ </el-tabs> </el-form-item> </el-form> - <el-divider /> <!-- 璇︾粏鍐呭缁撴潫 --> </el-collapse-item> </el-collapse> @@ -181,11 +161,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'; +import { toLabel } from '@/enum/device/device'; export default { components: {}, watch: { @@ -238,79 +216,6 @@ { key: 0, value: '璐拱' }, { key: 1, value: '绉熻祦' } ], - // i-璁惧绫诲瀷 - // 涓ゅ眰map锛� { key: topType, value: { key: sceneTypeId, value: [label, value, children] } } - iDeviceTypesMap: new Map( - [ - { - topTypeId: 0, - value: new Map( - [ - { - sceneTypeId: 1, - value: [ - { - label: '鎵皹鐩戞祴', - value: 1, - children: [ - { - label: '鎵皹鐩戞祴', - value: 1 - } - ] - } - ] - }, - { - sceneTypeId: 2, - value: [ - { - label: '鎵皹鐩戞祴', - value: 1, - children: [ - { - label: '鎵皹鐩戞祴', - value: 1 - } - ] - } - ] - }, - { - sceneTypeId: 3, - value: [ - { - label: '鎵皹鐩戞祴', - value: 1, - children: [ - { - label: '鎵皹鐩戞祴', - value: 1 - } - ] - } - ] - }, - { - sceneTypeId: 14, - value: [ - { - label: '鎵皹鐩戞祴', - value: 1, - children: [ - { - label: '鎵皹鐩戞祴', - value: 1 - } - ] - } - ] - } - ].map((item) => [item.sceneTypeId, item.value]) - ) - } - ].map((item) => [item.topTypeId, item.value]) - ), scene: {} }; }, @@ -374,25 +279,25 @@ data._isDetail = false; }, getList() { - deviceApi.fetchDevices(this.scene.guid, this.currSelect.topDeviceTypeId).then((result) => { - this.initList(); - if (result.data == null || result.data.length <= 0) { - this.isEmpty = true; - return; - } - // 鏍囧噯鍖栧睘鎬у悕 - for (let index = 0; index < result.data.length; index++) { - var element = this.convertKeys(result.data[index]); - this.initFormData(element); - // 鑾峰彇璁惧鐘舵�佷俊鎭� - let data = { - deviceId: element.id, - sceneId: element.sceneGuid, - deviceTypeId: this.currSelect.topDeviceTypeId - }; - deviceApi - .fetchDeviceStatus(data) - .then((status) => { + deviceApi + .fetchDevices(this.scene.guid, this.currSelect.topDeviceTypeId) + .then((result) => { + this.initList(); + if (result.data == null || result.data.length <= 0) { + this.isEmpty = true; + return; + } + // 鏍囧噯鍖栧睘鎬у悕 + for (let index = 0; index < result.data.length; index++) { + var element = this.convertKeys(result.data[index]); + this.initFormData(element); + // 鑾峰彇璁惧鐘舵�佷俊鎭� + let data = { + deviceId: element.id, + sceneId: element.sceneGuid, + deviceTypeId: this.currSelect.topDeviceTypeId + }; + deviceApi.fetchDeviceStatus(data).then((status) => { var statusData = status.data; var imgPaths = []; if (statusData) { @@ -411,33 +316,17 @@ this.formInfo.push(element); } } - }) - .catch((err) => {}); - } - }); + }); + } + }); }, 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]; - } + type = toLabel(element.sceneTypeId, this.currSelect.topDeviceTypeId, [ + element.typeId, + element.subtypeId + ]); + element._typename = type.join('-'); return element; }, // 淇濆瓨鐘舵�佷俊鎭� @@ -495,51 +384,6 @@ // 闇�瑕佹牴鎹満鏅被鍨嬬‘瀹氭帴鍙e弬鏁扮殑灞炴�у悕 var query = this.modifyObjectKeys(obj); return query; - }, - // 鏍规嵁鎺ュ彛杩斿洖鐢熸垚 iDeviceTypesMap - generateIDeviceTypesMap() {}, - // 鑾峰彇褰撳墠topType锛屽綋鍓峴ceneTypeId涓嬫墍鏈夌埗绫诲瀷 - getAlliDeviceParentTypeArray() { - var sceneTypeAndIDeviceTypesMap = this.iDeviceTypesMap.get(this.currSelect.topDeviceTypeId); - if (!sceneTypeAndIDeviceTypesMap) { - return ''; - } - - var iDeviceTypesArray = sceneTypeAndIDeviceTypesMap.get(this.scene.typeid); - if (!iDeviceTypesArray) { - return ''; - } - return iDeviceTypesArray; - }, - // 鑾峰彇璁惧绫诲瀷 topDeviceTypeId, sceneTypeId 鍜� 鑷韩鐨勪竴浜涘弬鏁� - getIDeviceParentTypeObj(device) { - var iDeviceTypesArray = this.getAlliDeviceParentTypeArray(); - var result; - iDeviceTypesArray.forEach((e) => { - if (e.value == device.typeId) { - result = e; - } - }); - return result; - }, - // 鑾峰彇璁惧瀛愮被鍨� topDeviceTypeId, sceneTypeId 鍜� 鑷韩鐨勪竴浜涘弬鏁� - getIDeviceChildrenTypeObj(device) { - var parentType = this.getIDeviceParentTypeObj(device); - - if (parentType == null || parentType == '' || !('children' in parentType)) { - return ''; - } - var children = parentType.children; - if (children == null || children.length <= 0) { - return ''; - } - let result; - // iDeviceTypesArray.forEach((e) => { - // if (e.value == device.typeId) { - // result = e; - // } - // }); - return result; }, onClickPic(e, item) { e.stopPropagation(); diff --git a/src/views/fysp/check/components/CompLedgerPic.vue b/src/views/fysp/check/components/CompLedgerPic.vue index ce3275f..27bb0ea 100644 --- a/src/views/fysp/check/components/CompLedgerPic.vue +++ b/src/views/fysp/check/components/CompLedgerPic.vue @@ -120,7 +120,7 @@ </script> <style scoped> .imgs { - height: 650px; + /* height: 650px; */ width: 90%; min-height: 100px !important; /* border-style:solid; diff --git a/src/views/fysp/check/components/CompProRecent.vue b/src/views/fysp/check/components/CompProRecent.vue index 915b27b..54d51ff 100644 --- a/src/views/fysp/check/components/CompProRecent.vue +++ b/src/views/fysp/check/components/CompProRecent.vue @@ -1,7 +1,7 @@ <template> <div> <el-tabs v-model="activeName" type="card"> - <el-tab-pane v-for="item in ranges" :label="item" :name="item"> </el-tab-pane> + <el-tab-pane v-for="(item, i) in ranges" :key="i" :label="item" :name="item"> </el-tab-pane> </el-tabs> <div class="proList"> <el-card class="card-style" shadow="hover"> @@ -175,7 +175,7 @@ pros.forEach((pro) => { if (pro.ptguid == this.deepCopyPro.ptguid) { pro._stName = subtask.stName; - pro._time = this.$fm.formatYM(subtask.stPlanTime) + pro._time = this.$fm.formatYMD(subtask.stPlanTime) this.curProList.push(pro); } }); diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue index eaad334..30db7f7 100644 --- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue +++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue @@ -2,7 +2,12 @@ <div class="main-container"> <el-form :model="problem" label-width="auto" style="max-width: 95%"> <el-form-item label="闂绫诲瀷" prop="proType"> - <el-select v-model="proType" @change="onProTypeChange" class="row" :disabled="readonly"> + <el-select + v-model="proType" + @change="onProTypeChange" + class="row" + :disabled="readonly" + > <el-option v-for="item in problemTypeOptions" :key="item.typeid" @@ -42,7 +47,11 @@ </el-select> </el-form-item> <el-form-item label="闂寤鸿" prop="advise"> - <el-select v-model="deepCopyProblem.advise" class="row" :disabled="readonly"> + <el-select + v-model="deepCopyProblem.advise" + class="row" + :disabled="readonly" + > <el-option v-for="item in adviseOptions" :key="item.adGuid" @@ -63,10 +72,18 @@ <div class="t-card_item"> 闂鍥剧墖 <div> - <el-button @click="chosePicFromAnyPic" v-show="!readonly">浠庝换鎰忓浘鐗囬�夊彇</el-button> - <el-button @click="chosePicFromDevicePic" v-show="!readonly">浠庤澶囧浘鐗囬�夊彇</el-button> - <el-button @click="chosePicFromLedgerPic" v-show="!readonly">浠庡彴璐﹂�夊彇</el-button> - <el-button @click="choseChangePic" v-show="!readonly">浠庢枃浠跺す閫夊彇</el-button> + <el-button @click="chosePicFromAnyPic" v-show="!readonly" + >浠庡満鏅浘鐗囬�夊彇</el-button + > + <el-button @click="chosePicFromDevicePic" v-show="!readonly" + >浠庤澶囧浘鐗囬�夊彇</el-button + > + <el-button @click="chosePicFromLedgerPic" v-show="!readonly" + >浠庡彴璐﹂�夊彇</el-button + > + <el-button @click="choseChangePic" v-show="!readonly" + >浠庢枃浠跺す閫夊彇</el-button + > </div> </div> <el-upload @@ -82,32 +99,35 @@ :disabled="readonly" accept="image/*" > - <el-button type="primary" id="uploadBtnId" style="display: none"></el-button> + <el-button + type="primary" + id="uploadBtnId" + style="display: none" + ></el-button> <el-icon v-show="fileList.length != 3"> <Plus /> </el-icon> </el-upload> <el-form-item> - <el-button type="primary" @click="onSubmit" v-show="!readonly">淇濆瓨</el-button> - <el-button @click="this.$emit('submited', false)" v-show="!readonly">鍙栨秷</el-button> + <el-button type="primary" @click="onSubmit" v-show="!readonly" + >淇濆瓨</el-button + > + <el-button @click="this.$emit('submited', false)" v-show="!readonly" + >鍙栨秷</el-button + > </el-form-item> </el-form> - <el-dialog - title="浠绘剰鍥剧墖" - width="80%" - v-model="anyPhotoDialog" - :before-close="beforeAnyPhotoDialogclose" - class="dialog_style" + + <ArbitraryPhoto + :max-select="3" + v-if="anyPhotoDialog" + v-model:dialog-visible="anyPhotoDialog" + @selectByAnyPhonoEvent="handleSelectedAnyPhono" + :subtask="subtask" + :defaultFile="fileList" + ref="arbitraryPhotoRef" > - <ArbitraryPhoto - v-if="anyPhotoDialog" - @selectByAnyPhonoEvent="handleSelectedAnyPhono" - :subtask="subtask" - :defaultFile="fileList" - ref="arbitraryPhotoRef" - > - </ArbitraryPhoto> - </el-dialog> + </ArbitraryPhoto> <el-dialog title="鍙拌处鍥剧墖" width="80%" @@ -216,11 +236,31 @@ month: -1, ledgerPicDialog: false, rules: { - proType: { required: true, message: '闂绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }, - description: { required: true, message: '闂鎻忚堪涓嶈兘涓虹┖', trigger: 'change' }, - locationid: { required: true, message: '闂浣嶇疆涓嶈兘涓虹┖', trigger: 'change' }, - advise: { required: true, message: '闂寤鸿涓嶈兘涓虹┖', trigger: 'change' }, - proRemark: { required: true, message: '琛ュ厖璇存槑涓嶈兘涓虹┖', trigger: 'change' } + proType: { + required: true, + message: '闂绫诲瀷涓嶈兘涓虹┖', + trigger: 'change' + }, + description: { + required: true, + message: '闂鎻忚堪涓嶈兘涓虹┖', + trigger: 'change' + }, + locationid: { + required: true, + message: '闂浣嶇疆涓嶈兘涓虹┖', + trigger: 'change' + }, + advise: { + required: true, + message: '闂寤鸿涓嶈兘涓虹┖', + trigger: 'change' + }, + proRemark: { + required: true, + message: '琛ュ厖璇存槑涓嶈兘涓虹┖', + trigger: 'change' + } }, deviceTopTypes: [ { id: 0, label: '鐩戞帶璁惧' }, @@ -241,13 +281,13 @@ computed: { descriptionOptions() { const descriptions = []; - + this.problemTypeList.forEach((item) => { if (item.typename == this.proType) { descriptions.push(item); } }); - + return descriptions; }, problemTypeOptions() { @@ -261,7 +301,9 @@ }, adviseOptions() { var problemGuid = this.currProTypeGuid || this.problem.guid; - var array = this.suggestions.filter((item) => item.adProblemtypeguid == problemGuid); + var array = this.suggestions.filter( + (item) => item.adProblemtypeguid == problemGuid + ); return array; } }, @@ -283,15 +325,15 @@ const newObj = {}; for (const key in obj) { 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]; + 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; }, @@ -314,44 +356,46 @@ this.deviceImgObjList = []; 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]); - // 鑾峰彇璁惧鐘舵�佷俊鎭� - let data = { - deviceId: element.id, - sceneId: element.sceneGuid, - deviceTypeId: topTypeId - }; - deviceApi - .fetchDeviceStatus(data) - .then((status) => { - var statusData = status.data; - var imgPaths = []; + 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]); + // 鑾峰彇璁惧鐘舵�佷俊鎭� + let data = { + deviceId: element.id, + sceneId: element.sceneGuid, + deviceTypeId: topTypeId + }; + deviceApi + .fetchDeviceStatus(data) + .then((status) => { + var statusData = status.data; + var imgPaths = []; - if (statusData) { - if (statusData.length == 0) { - this.deviceImgObjList.push(element); - return; - } - element = this.convertKeys(result.data[i]); - for (let j = 0; j < statusData.length; j++) { - // 澶嶅埗鍑轰竴涓澶囧璞� - var newDevice = useCloned(element).cloned.value; - const statusItem = statusData[j]; - // 璁惧瀵硅薄娣诲姞涓�涓睘鎬у垪琛ㄥ睘鎬х敤鏉ヤ繚瀛樿澶囩姸鎬� - this.saveStatus(newDevice, statusItem); - newDevice.dlLocation = statusItem.dlLocation; - newDevice.topTypeId = topTypeId; + if (statusData) { + if (statusData.length == 0) { + this.deviceImgObjList.push(element); + return; + } + element = this.convertKeys(result.data[i]); + for (let j = 0; j < statusData.length; j++) { + // 澶嶅埗鍑轰竴涓澶囧璞� + var newDevice = useCloned(element).cloned.value; + const statusItem = statusData[j]; + // 璁惧瀵硅薄娣诲姞涓�涓睘鎬у垪琛ㄥ睘鎬х敤鏉ヤ繚瀛樿澶囩姸鎬� + this.saveStatus(newDevice, statusItem); + newDevice.dlLocation = statusItem.dlLocation; + newDevice.topTypeId = topTypeId; - this.deviceImgObjList.push(newDevice); + this.deviceImgObjList.push(newDevice); + } } - } - }) - .catch((err) => {}); - } - }); + }) + .catch((err) => {}); + } + }); } }, initOptions() { @@ -385,7 +429,10 @@ this.deepCopyProblem.description = currDescription; this.proRemark = ''; } else { - currDescription = currProName.substring(0, currProName.lastIndexOf('(')); + currDescription = currProName.substring( + 0, + currProName.lastIndexOf('(') + ); this.problemTypeList.forEach((item) => { if (item.description === currDescription) { @@ -478,23 +525,24 @@ this.deepCopyProblem.advise = ''; }, findProByProDesName(name) { - let result - this.problemTypeList.forEach(item=>{ + let result; + this.problemTypeList.forEach((item) => { if (item.description == name) { result = item; } - }) - return result + }); + return result; }, onProDesChange(value) { - let currPro = this.findProByProDesName(value) + let currPro = this.findProByProDesName(value); this.deepCopyProblem.advise = ''; this.currProTypeGuid = currPro.guid; // this.deepCopyProblem.description = currPro.description; this.changeProblemname(); this.deepCopyProblem.advise = ''; - var adName = this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName; + var adName = + this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName; this.deepCopyProblem.advise = adName; }, onProLocationChange(value) { @@ -572,7 +620,9 @@ delete deepCopyPro['description']; deepCopyPro.proName = deepCopyPro.problemname; delete deepCopyPro['problemname']; - deepCopyPro.ptGuid = that.findProTypeByGuid(that.currProTypeGuid).guid; + deepCopyPro.ptGuid = that.findProTypeByGuid( + that.currProTypeGuid + ).guid; deepCopyPro.locationId = deepCopyPro.locationid; delete deepCopyPro['locationid']; data.append('problemVo', JSON.stringify(deepCopyPro)); @@ -682,14 +732,6 @@ } .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; -- Gitblit v1.9.3