Merge remote-tracking branch 'supervisionVue/hc-procheck-1014'
已修改13个文件
已删除1个文件
已添加10个文件
| | |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | // è·åè®¾å¤ |
| | | async fetchDevices(sceneId, deviceTypeId) { |
| | | const params = `?sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`; |
| | | return await $fysp.get(`device${params}`).then((res) => res).then((res) => res.data); |
| | | }, |
| | | // è·å设å¤ç¶æä»¥å设å¤è¯¦æ
|
| | | async fetchDeviceStatus({deviceId, sceneId, deviceTypeId}) { |
| | | const params = `?deviceId=${deviceId}&sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`; |
| | | return await $fysp.get(`device/status${params}`).then((res) => res).then((res) => res.data); |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $fysp } from '../index'; |
| | | |
| | | export default { |
| | | /** |
| | | * è·åå·¡æ¥ä¸çä»»æå¾ç |
| | | */ |
| | | getRoutineByStGuid(stGuid) { |
| | | const params = `?stGuid=${stGuid}`; |
| | | return $fysp.get(`mediafile/routine${params}`).then((res) => res.data); |
| | | }, |
| | | getRoutineByiGuid(iGuid) { |
| | | const params = `?iGuid=${iGuid}`; |
| | | return $fysp.get(`mediafile/routine${params}`).then((res) => res.data); |
| | | } |
| | | } |
| | |
| | | |
| | | fetchProblemType({ cityCode, districtCode, sceneTypeId }) { |
| | | const params = `?taskTypeId=1&cityCode=${cityCode}&districtCode=${districtCode}&sceneTypeId=${sceneTypeId}`; |
| | | return $fysp.get(`problemtype/search${params}`).then((res) => res.data); |
| | | return $fysp.get(`problemtype/search${params}`).then((res) => res); |
| | | }, |
| | | |
| | | /** |
| | | * è·åå·¡æ¥ä¸çä»»æå¾ç |
| | | */ |
| | | getAnyPic(inspectionGuid) { |
| | | const params = `${inspectionGuid}`; |
| | | return $fysp.get(`mediafile/${params}/5`).then((res) => res); |
| | | }, |
| | | // è·åé®é¢ä½ç½® |
| | | getLocation({ sceneTypeId }) { |
| | | const params = `?sceneType=${sceneTypeId}`; |
| | | return $fysp.get(`domainitem/location${params}`).then((res) => res); |
| | | }, |
| | | // è·åé®é¢å»ºè®® |
| | | getSuggestion() { |
| | | return $fysp.get(`changeadvice`).then((res) => res); |
| | | }, |
| | | // ä¿®æ¹é®é¢ |
| | | updateProblem(data) { |
| | | return $fysp.post(`problemlist/updateProblem`, data).then((res) => res); |
| | | }, |
| | | // æ°å¢é®é¢ |
| | | newProblem(data) { |
| | | return $fysp.post(`problemlist/newProblem`, data).then((res) => res) |
| | | }, |
| | | // ä¿®æ¹æ´æ¹ |
| | | updateChange(data) { |
| | | return $fysp.post(`problemlist/updateChange`, data).then((res) => res) |
| | | } |
| | | }; |
| | |
| | | */ |
| | | updateScene(scene) { |
| | | return $fysp.post('scense', scene).then((res) => res.data); |
| | | }, |
| | | /** |
| | | * è·åææåºæ¯ç±»å |
| | | */ |
| | | getAllScene() { |
| | | return $fysp.get('scense/alltype').then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | /** |
| | | * è·ååä»»å¡é®é¢è¯¦æ
|
| | | */ |
| | | getProBySubtask(id) { |
| | | return $fysp |
| | | async getProBySubtask(id) { |
| | | return await $fysp |
| | | .get('problemlist/subtask', { |
| | | params: { |
| | | stGuid: id |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | /** |
| | | * éè¿æ»ä»»å¡idåæ¶é´åºé´è·ååä»»å¡å表 |
| | | */ |
| | | async getByTopTaskAndDate({startTime, endTime, sceneTypeId, topTaskId}) { |
| | | const params = `?startTime=${startTime}&endTime=${endTime}&sceneTypeId=${sceneTypeId}&topTaskId=${topTaskId}`; |
| | | return await $fysp.get(`subtask/getSubTask${params}`).then((res) => res.data); |
| | | }, |
| | | /** |
| | | * è·åæä¸ªåºæ¯çå·¡æ¥ä»»å¡ |
| | | */ |
| | | async getSubtaskByScene({startTime, endTime, sceneId}) { |
| | | const params = `?startTime=${startTime}&endTime=${endTime}&sceneId=${sceneId}`; |
| | | return await $fysp.get(`subtask/byScene${params}`).then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | autoCreateAccount(sId) { |
| | | return $fysp.post(`userinfo/create?sceneId=${sId}`).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * ç¨æ·æ¨¡ç³æç´¢ |
| | | * @param {object} area åºåèå´æ¡ä»¶ |
| | | * @param {String} keyword æç´¢å
³é®å |
| | | * @param {Number} userType ç¨æ·ç±»åï¼é»è®¤3ï¼ä¼ä¸ |
| | | * @returns |
| | | */ |
| | | searchUser(area, keyword, page = 1, perPage = 20, userType = 3) { |
| | | const param = `?keyword=${keyword}&userType=${userType}&page=${page}&per_page=${perPage}` |
| | | return $fysp |
| | | .post(`userinfo/search${param}`, area) |
| | | .then((res) => res.data); |
| | | /** |
| | | * è·ååºæ¯å¯¹åºçé£ç¾½ç¯å¢ç³»ç»ç¨æ·id |
| | | */ |
| | | getTzId(sceneId) { |
| | | return $fysp.get(`usermap?sceneId=${sceneId}`).then((res) => res.data); |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $fytz } from '../index'; |
| | | |
| | | export default { |
| | | |
| | | /** |
| | | * è·ååºæ¯å¯¹åºç彿å°è´¦å¾ç |
| | | */ |
| | | getLedgerPic({tzUserId,sceneType,time}) { |
| | | return $fytz.get(`ledger/${tzUserId}/detail2?sceneType=${sceneType}&time=${time}`).then((res) => res.data); |
| | | } |
| | | |
| | | } |
| | |
| | | * éç½®ç¨æ·å¯ç |
| | | */ |
| | | resetPassword(id) { |
| | | return $fytz.post(`userInfo/resetPw?userId=${id}`).then((res) => res.data); |
| | | } |
| | | return $fytz.post(`userInfo/resetPw?userId=${id}`).then((res) => res); |
| | | }, |
| | | |
| | | |
| | | }; |
| | |
| | | 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'] |
| | |
| | | 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'] |
| | | 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'] |
| | | ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | |
| | | 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'] |
| | |
| | | <el-form :inline="true" :model="formSearch"> |
| | | <el-form-item label="æ»ä»»å¡"> |
| | | <!-- <el-input v-model="formSearch.topTaskId" placeholder="æ»ä»»å¡" /> --> |
| | | <el-select v-model="formSearch.topTaskId" placeholder="æ»ä»»å¡" style="width: 260px"> |
| | | <el-option v-for="s in topTasks" :key="s.value" :label="s.label" :value="s.value" /> |
| | | <el-select v-model="formSearch.topTaskId" placeholder="æ»ä»»å¡"> |
| | | <el-option |
| | | v-for="s in topTasks" |
| | | :key="s.value" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <FYOptionScene |
| | | :allOption="false" |
| | | :type="2" |
| | | v-model:value="formSearch.scenetype" |
| | | ></FYOptionScene> --> |
| | | <el-form-item label="åºæ¯ç±»å"> |
| | | <el-select v-model="formSearch.sceneTypeId" placeholder="åºæ¯ç±»å" style="width: 150px"> |
| | | <el-option v-for="s in sceneTypes" :key="s.value" :label="s.label" :value="s.value" /> |
| | | <el-select v-model="formSearch.sceneTypeId" placeholder="åºæ¯ç±»å"> |
| | | <el-option |
| | | v-for="s in sceneTypes" |
| | | :key="s.value" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | |
| | | <script> |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import { enumScene } from '@/enum/scene'; |
| | | import { enumScene } from "@/enum/scene"; |
| | | |
| | | export default { |
| | | emits: ['onSubmit'], |
| | |
| | | sceneTypes: enumScene(2, false), |
| | | formSearch: { |
| | | topTaskId: '', |
| | | sceneTypeId: '' |
| | | } |
| | | sceneTypeId: '', |
| | | obj: '', |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | list.push({ |
| | | value: r.tguid, |
| | | label: r.name, |
| | | obj: r, |
| | | towncode: r.towncode, |
| | | districtCode: r.districtcode, |
| | | month: r.starttime.slice(0, 7) |
| | | month: r.starttime.slice(0, 7), |
| | | }); |
| | | }); |
| | | this.topTasks = list; |
| | | this.formSearch.topTaskId = list[0].value; |
| | | this.formSearch.obj = list[0].obj; |
| | | this.$emit('onSubmit', this.formSearch); |
| | | }); |
| | | }, |
| | |
| | | onSubmit() { |
| | | // console.log(this.formSearch.sceneTypeId) |
| | | this.$emit('onSubmit', this.formSearch); |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.formSearch.sceneTypeId = this.sceneTypes[0].value; |
| | | this.getOptions(); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | <div class="layout" > |
| | | <div class="layout"> |
| | | <el-row v-if="title"> |
| | | <el-col :span=" 16 " class="title">{{ title }}</el-col> |
| | | <el-col :span=" 8 "> |
| | | <el-col :span="16" class="title">{{ title }}</el-col> |
| | | <el-col :span="8"> |
| | | <el-row justify="end" class="btn-group"> |
| | | <el-button v-for="(b, i) in buttons" :key=" i " :type=" b.color ? b.color : 'primary' " size="small">{{ b.name |
| | | }}</el-button> |
| | | <el-button |
| | | v-for="(b, i) in buttons" |
| | | :key="i" |
| | | :type="b.color ? b.color : 'primary'" |
| | | size="small" |
| | | @click="b.click" |
| | | >{{ b.name }}</el-button |
| | | > |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="tag-group" v-if="title"> |
| | | <el-space> |
| | | <el-tag v-for="(d, i) in descriptions" :key=" i " type="info" size="small">{{ d.name + ": " + d.value }}</el-tag> |
| | | <el-tag v-for="(d, i) in descriptions" :key="i" type="info" size="small">{{ |
| | | d.name + ': ' + d.value |
| | | }}</el-tag> |
| | | </el-space> |
| | | </el-row> |
| | | </div> |
| | |
| | | type: Array, |
| | | default: () => [ |
| | | { |
| | | name: "", |
| | | value: "", |
| | | }, |
| | | ], |
| | | name: '', |
| | | value: '' |
| | | } |
| | | ] |
| | | }, |
| | | buttons: { |
| | | type: Array, |
| | | default: () => [ |
| | | { |
| | | name: "", |
| | | color: "primary", |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | name: '', |
| | | color: 'primary', |
| | | click: () => {} |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | |
| | | import { router } from './router'; |
| | | import App from './App.vue'; |
| | | import timeUtil from './utils/time-util'; |
| | | import DeepCopy from './utils/DeepCopy'; |
| | | |
| | | // import 'element-plus/dist/index.css'; |
| | | import './assets/main.css'; |
| | |
| | | const app = createApp(App); |
| | | |
| | | app.config.globalProperties.$fm = timeUtil; |
| | | app.config.globalProperties.$deepCopy = DeepCopy.deepCopy; |
| | | |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component); |
| | |
| | | Img.src = url; |
| | | }else { |
| | | Img.src = url + '?v=' + Math.random(); // å¤çç¼å,fixç¼åbug,æç¼åï¼æµè§å¨ä¼æ¥é; |
| | | // Img.src = url; |
| | | } |
| | | // Img.src = /^data:image/.test(url) ? url : url + '?' + new Date().getTime() + '&v=' + Math.random(); // å¤çç¼å,fixç¼åbug,æç¼åï¼æµè§å¨ä¼æ¥é; |
| | | |
| | |
| | | <template #header> |
| | | <SearchBar @on-submit="search"> |
| | | <template #summary> |
| | | <CompSubTaskStatistic :subtasks="subtasks"/> |
| | | <CompSubTaskStatistic :subtasks="subtasks" /> |
| | | </template> |
| | | </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 |
| | |
| | | :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-for="(p, i) in curProList" |
| | | v-if="compProblemCardVisible" |
| | | :key="i" |
| | | :index="i+1" |
| | | v-for="(p, i) in curProList" |
| | | :index="i + 1" |
| | | :problem="p" |
| | | :subtask="curSubtask.data" |
| | | :topTask="topTask" |
| | | @updated="onProSubmited" |
| | | @submit="updateSubtask" |
| | | ></CompProblemCard> |
| | | </el-scrollbar> |
| | | <el-empty v-else description="ææ è®°å½" v-loading="mainLoading" /> |
| | | </template> |
| | | </BaseContentLayout> |
| | | <el-dialog |
| | | v-model="proAddOrUpdDialogVisible" |
| | | :before-close="proAddOrUpdDialogClose" |
| | | width="80%" |
| | | title="æ°å¢é®é¢" |
| | | > |
| | | <CompProblemAddOrUpd |
| | | v-if="proAddOrUpdDialogVisible" |
| | | :subtask="curSubtask.data" |
| | | :topTask="topTask" |
| | | ref="compProblemAddOrUpdRef" |
| | | @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> |
| | | <el-drawer |
| | | :direction="rtl" |
| | | v-model="deviceShowDialog" |
| | | :before-close="beforeDeviceShowDialogclose" |
| | | title="设æ½è®¾å¤" |
| | | size="65%" |
| | | > |
| | | <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef"> </CompDeviceShowTest> |
| | | </el-drawer> |
| | | </template> |
| | | |
| | | <script> |
| | | 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: { CompProblemCard, CompSubTaskStatistic }, |
| | | components: { |
| | | CompProblemCard, |
| | | CompSubTaskStatistic, |
| | | CompProblemAddOrUpd, |
| | | ArbitraryPhoto, |
| | | CompDeviceShowTest, |
| | | CompProRecent |
| | | }, |
| | | data() { |
| | | return { |
| | | compProblemCardVisible: true, |
| | | // 设å¤å¾ |
| | | deviceShowDialog: false, |
| | | // ä»»æå¾ |
| | | anyPhotoDialog: false, |
| | | // æ°å¢é®é¢ |
| | | proAddOrUpdDialogVisible: false, |
| | | //左侧èåæ å è½½ç¶æ |
| | | sideLoading: false, |
| | | //å³ä¾§å
容æ å è½½ç¶æ |
| | | mainLoading: false, |
| | | // æ»ä»»å¡ |
| | | topTask: {}, |
| | | //åä»»å¡å表 |
| | | subtasks: [], |
| | | //å½åéä¸çä»»å¡ |
| | |
| | | { |
| | | name: 'æ°å¢é®é¢', |
| | | color: 'success', |
| | | click: () => { |
| | | this.proAddOrUpdDialogVisible = true; |
| | | } |
| | | }, |
| | | { |
| | | name: 'ä»»æå¾ç', |
| | | color: 'warning', |
| | | click: () => { |
| | | this.anyPhotoDialog = true; |
| | | } |
| | | }, |
| | | { |
| | | name: '设æ½è®¾å¤', |
| | | color: 'info', |
| | | click: () => { |
| | | this.openDeviceShowDialog(); |
| | | } |
| | | }, |
| | | { |
| | | name: 'æ¹éå®¡æ ¸', |
| | | color: 'primary', |
| | | }, |
| | | ], |
| | | click: () => {} |
| | | } |
| | | ] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | { |
| | | name: '任塿»è®¡', |
| | | value: 0, |
| | | type: 'info', |
| | | type: 'info' |
| | | }, |
| | | { |
| | | name: 'é®é¢æªå®¡æ ¸', |
| | | value: 0, |
| | | type: 'success', |
| | | icon: 'SuccessFilled', |
| | | icon: 'SuccessFilled' |
| | | }, |
| | | { |
| | | name: 'é®é¢é¨åå®¡æ ¸', |
| | | value: 0, |
| | | type: 'success', |
| | | icon: 'SuccessFilled', |
| | | icon: 'SuccessFilled' |
| | | }, |
| | | { |
| | | name: 'é®é¢å
¨é¨å®¡æ ¸', |
| | | value: 0, |
| | | type: 'success', |
| | | icon: 'SuccessFilled', |
| | | icon: 'SuccessFilled' |
| | | }, |
| | | { |
| | | name: 'æªæ´æ¹', |
| | | value: 0, |
| | | type: 'info', |
| | | icon: 'WarningFilled', |
| | | icon: 'WarningFilled' |
| | | }, |
| | | { |
| | | name: 'æ´æ¹æªå®¡æ ¸', |
| | | value: 0, |
| | | type: 'info', |
| | | icon: 'WarningFilled', |
| | | icon: 'WarningFilled' |
| | | }, |
| | | { |
| | | name: 'æ´æ¹é¨åå®¡æ ¸', |
| | | value: 0, |
| | | type: 'warning', |
| | | icon: 'WarningFilled', |
| | | icon: 'WarningFilled' |
| | | }, |
| | | { |
| | | name: 'æ´æ¹å
¨é¨å®¡æ ¸', |
| | | value: 0, |
| | | type: 'warning', |
| | | icon: 'WarningFilled', |
| | | }, |
| | | icon: 'WarningFilled' |
| | | } |
| | | ]; |
| | | |
| | | this.subtasks.forEach((s) => { |
| | |
| | | }); |
| | | |
| | | return _summary; |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | // æå¼è®¾å¤å¾ |
| | | openDeviceShowDialog() { |
| | | this.deviceShowDialog = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.deviceShowRef.init(this.curSubtask.data.scene); |
| | | }); |
| | | }, |
| | | // å
³é设å¤å¾å¼¹çª |
| | | beforeDeviceShowDialogclose() { |
| | | this.deviceShowDialog = false; |
| | | }, |
| | | // å
³éä»»æå¾çå¼¹çª |
| | | beforeAnyPhotoDialogclose() { |
| | | this.anyPhotoDialog = false; |
| | | }, |
| | | handleCloseCheckAnyPhono() { |
| | | this.beforeAnyPhotoDialogclose(); |
| | | }, |
| | | proAddOrUpdDialogClose() { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | }, |
| | | //æ¥è¯¢åä»»å¡ç»è®¡ä¿¡æ¯ |
| | | search(formSearch) { |
| | | this.topTask = formSearch.obj; |
| | | this.sideLoading = true; |
| | | this.mainLoading = true; |
| | | this.curProList = []; |
| | |
| | | type: t, |
| | | title: s.stName, |
| | | categoly: s.stPlanTime.split('T')[0], |
| | | data: s, |
| | | data: s |
| | | }); |
| | | }); |
| | | this.subtasks = list; |
| | |
| | | }, |
| | | //ç¹å»å·¦ä¾§èåä»»å¡äºä»¶ |
| | | chooseSubtask(s) { |
| | | // this.currInsGuid = s.data.insGuid |
| | | this.sideLoading = false; |
| | | this.mainLoading = true; |
| | | // const controller = new AbortController(); |
| | |
| | | this.mainLoading = false; |
| | | }); |
| | | }, |
| | | updateSubtask() { |
| | | // é®é¢å¡çç»ä»¶ä¸»å¨åèµ·å·æ°ç¶ç»ä»¶æ°æ® |
| | | updateSubtask(isOk) { |
| | | this.curSubtask.data.proCheckedNum++; |
| | | this.curSubtask.type = this.getSubtaskType(this.curSubtask.data); |
| | | if (!isOk) { |
| | | return; |
| | | } |
| | | this.refreshCurrSubtask(); |
| | | }, |
| | | onProSubmited(isOk) { |
| | | this.proAddOrUpdDialogClose(); |
| | | if (!isOk) { |
| | | return; |
| | | } |
| | | this.updateSubtask(isOk); |
| | | }, |
| | | newProSubmit(isOk) { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | if (!isOk) { |
| | | return; |
| | | } |
| | | this.refreshCurrSubtask(); |
| | | }, |
| | | // å·æ°å½åéä¸åä»»å¡ |
| | | refreshCurrSubtask() { |
| | | this.compProblemCardVisible = false; |
| | | this.sideLoading = false; |
| | | this.mainLoading = true; |
| | | setTimeout(() => { |
| | | taskApi |
| | | .getProBySubtask(this.curSubtask.data.stGuid) |
| | | .then((res) => { |
| | | this.curProList = res; |
| | | // this.curSubtask = s; |
| | | }) |
| | | .finally(() => { |
| | | this.mainLoading = false; |
| | | this.compProblemCardVisible = true; |
| | | }); |
| | | }, 150); |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | mounted() {} |
| | | }; |
| | | </script> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main"> |
| | | <div class="filters" v-if="false"> |
| | | <el-select |
| | | v-for="(key_select, index_select) of filters.keys()" |
| | | :placeholder="key_select.text" |
| | | > |
| | | <el-option |
| | | v-for="(key_option, index_option) in filters.get(key_select.key)" |
| | | :key="key_option.key" |
| | | :value="key_option.value" |
| | | :label="key_option.label" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="btns" v-if="!readonly"> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(true)">ç¡®å®</el-button> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(false)">åæ¶</el-button> |
| | | </div> |
| | | |
| | | <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" |
| | | :label="item.businesstype" |
| | | :name="item.businesstypeid" |
| | | > |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <el-empty v-if="isEmpty" description="ææ è®°å½" /> |
| | | <div class="imgs"> |
| | | <el-image |
| | | v-for="(img, i) in typeImgMap.get(activeId)" |
| | | :class="[Boolean(img.isSelect) ? 'selected' : 'noActive', 'image']" |
| | | fit="cover" |
| | | :src="img.url" |
| | | lazy |
| | | @click="onSelect(img, i)" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import problemApi from '@/api/fysp/problemApi.js'; |
| | | import mediafileApi from '@/api/fysp/mediafileApi.js'; |
| | | import { $fysp } from '@/api/index.js'; |
| | | export default { |
| | | props: { |
| | | filters: Map, |
| | | // æ¯å¦ä»¥åªè¯»ç形弿¥çå½åé¡µé¢ |
| | | readonly: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | subtask: { |
| | | type: Object, |
| | | efault: {} |
| | | }, |
| | | inspectionGuid: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | defaultFile: { |
| | | type: Array, |
| | | default: () => [] |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // æ æ°æ® |
| | | isEmpty: false, |
| | | isClose: false, |
| | | isAll: false, |
| | | activeId: '', |
| | | typeList: [ |
| | | // { businesstypeid: 5, businesstype: '常è§è®°å½' }, |
| | | // { businesstypeid: 3, businesstype: 'çæµè®¾å¤' }, |
| | | // { businesstypeid: 7, businesstype: 'éç' }, |
| | | // { businesstypeid: 51, businesstype: 'æ©å±ç±»ä¸' }, |
| | | // { businesstypeid: 52, businesstype: 'æ©å±ç±»äº' }, |
| | | // { businesstypeid: 53, businesstype: 'æ©å±ç±»ä¸' }, |
| | | // { businesstypeid: 54, businesstype: 'æ©å±ç±»å' }, |
| | | // { businesstypeid: 55, businesstype: 'æ©å±ç±»äº' }, |
| | | // { businesstypeid: 56, businesstype: 'æ©å±ç±»å
' }, |
| | | // { businesstypeid: 57, businesstype: 'æ©å±ç±»ä¸' }, |
| | | // { businesstypeid: 58, businesstype: 'æ©å±ç±»å
«' }, |
| | | // { businesstypeid: 59, businesstype: 'æ©å±ç±»ä¹' }, |
| | | // { businesstypeid: 60, businesstype: 'æ©å±ç±»å' } |
| | | ], |
| | | typeImgMap: new Map(), |
| | | imgUrlList: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | defaultFile: { |
| | | handler(newFileList, oldFileList) { |
| | | if (this.isClose) { |
| | | return; |
| | | } |
| | | }, |
| | | deep: true |
| | | }, |
| | | typeImgMap: { |
| | | handler(newMap, oldMap) { |
| | | if (this.isClose || newMap.get(this.activeId) == undefined) { |
| | | return; |
| | | } |
| | | newMap.get(this.activeId).forEach((i) => { |
| | | if (i.isSelect == true) { |
| | | return; |
| | | } |
| | | this.defaultFile.forEach((imgItem) => { |
| | | if (imgItem.url == i.url) { |
| | | i.isSelect = true; |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | deep: true |
| | | } |
| | | }, |
| | | mounted() { |
| | | if (this.defaultFile == undefined || this.defaultFile == null) { |
| | | this.defaultFile = []; |
| | | } |
| | | if (this.subtask) { |
| | | this.getAllImgList(); |
| | | } |
| | | }, |
| | | methods: { |
| | | // åå§ååå¼å§éä¸çæ ç¾ |
| | | initSelectedTab() { |
| | | if (this.typeList.length > 0) { |
| | | this.activeId = this.typeList[0].businesstypeid; |
| | | } |
| | | }, |
| | | async getAllImgList() { |
| | | // for(var k of this.typeImgMap.keys()) { |
| | | // this.typeImgMap.set(k, []) |
| | | // } |
| | | await mediafileApi.getRoutineByStGuid(this.subtask.stGuid).then((res) => { |
| | | this.isEmpty = false; |
| | | let data = res.data; |
| | | if (data.length == 0) { |
| | | this.isEmpty = true; |
| | | } |
| | | for (const e of data) { |
| | | let list; |
| | | let businesstypeid = e.businesstypeid; |
| | | let businesstype = e.businesstype; |
| | | let hasThisType = false; |
| | | this.typeImgMap.forEach((v, k, m) => { |
| | | if (k == businesstypeid) { |
| | | hasThisType = true; |
| | | var isAlreadyHas = false; |
| | | if (v != undefined && v != null) { |
| | | for (let index = 0; index < v.length; index++) { |
| | | const element = v[index]; |
| | | if (element.guid == e.guid) { |
| | | isAlreadyHas = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (!isAlreadyHas) { |
| | | v.push(e); |
| | | } |
| | | } |
| | | }); |
| | | if (!hasThisType) { |
| | | this.typeImgMap.set(businesstypeid, Array.of(e)); |
| | | this.typeList.push(e); |
| | | } |
| | | this.imgUrlList.push(e); |
| | | // TODO imgUrlå
¨å±é
ç½® |
| | | e.url = $fysp.imgUrl + e.extension1 + e.guid + '.jpg'; |
| | | // e.url = "http://47.100.191.150:9005/images/" + e.extension1 + e.guid + '.jpg' |
| | | e.isSelect = false; |
| | | } |
| | | this.initSelectedTab(); |
| | | }); |
| | | }, |
| | | getInitImgList() { |
| | | mediafileApi.getRoutineByStGuid(this.subtask.stGuid).then((res) => { |
| | | let data = res.data; |
| | | for (const e of data) { |
| | | let list; |
| | | let businesstypeid = e.businesstypeid; |
| | | let businesstype = e.businesstype; |
| | | let hasThisType = false; |
| | | this.typeImgMap.forEach((v, k, m) => { |
| | | if (k == businesstypeid) { |
| | | hasThisType = true; |
| | | if (v.length < 3) { |
| | | v.push(e); |
| | | } |
| | | } |
| | | }); |
| | | if (!hasThisType) { |
| | | this.typeImgMap.set(businesstypeid, Array.of(e)); |
| | | this.typeList.push(e); |
| | | } |
| | | this.imgUrlList.push(e); |
| | | // TODO imgUrlå
¨å±é
ç½® |
| | | e.url = $fysp.imgUrl + e.extension1 + e.guid + '.jpg'; |
| | | // e.url = "http://47.100.191.150:9005/images/" + e.extension1 + e.guid + '.jpg' |
| | | e.isSelect = false; |
| | | } |
| | | if (this.typeList.length > 0) { |
| | | this.activeId = this.typeList[0].businesstypeid; |
| | | } |
| | | }); |
| | | }, |
| | | onSelect(img, i) { |
| | | // if (i == 2 && !this.isAll) { |
| | | // this.getAllImgList(); |
| | | // this.isAll = true; |
| | | // } else { |
| | | // if (this.readonly) { |
| | | // return; |
| | | // } |
| | | // img.isSelect = !Boolean(img.isSelect); |
| | | // } |
| | | |
| | | if (this.readonly) { |
| | | return; |
| | | } |
| | | img.isSelect = !Boolean(img.isSelect); |
| | | }, |
| | | sendSelectedImg(isOk) { |
| | | let result = []; |
| | | if (!Boolean(isOk)) { |
| | | this.$emit('selectByAnyPhonoEvent', result); |
| | | } |
| | | for (const item of this.imgUrlList) { |
| | | if (item.isSelect == true) { |
| | | result.push(item); |
| | | } |
| | | } |
| | | this.isClose = true; |
| | | this.$emit('selectByAnyPhonoEvent', result); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .center { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | .text { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .main { |
| | | margin: 0 auto; /* 使ç¶å
ç´ å±
ä¸ */ |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .btns { |
| | | height: 10%; |
| | | } |
| | | /* |
| | | .img_types { |
| | | margin: 0 auto; |
| | | height: 440px; |
| | | width: 900px; |
| | | flex-grow: 1; |
| | | overflow-y: hidden ; |
| | | padding: 3%; |
| | | flex-wrap: wrap; |
| | | overflow: hidden; |
| | | } */ |
| | | |
| | | .imgs { |
| | | height: 370px; |
| | | width: 90%; |
| | | min-height: 100px !important; |
| | | /* border-style:solid; |
| | | border-radius: 1px; */ |
| | | /* height: 100%; */ |
| | | flex-grow: 1 !important; |
| | | overflow-y: auto !important; |
| | | /* å
容çå
è¾¹è· */ |
| | | display: flex !important; |
| | | flex-wrap: wrap !important; |
| | | /* overflow: hidden; */ |
| | | } |
| | | |
| | | .image { |
| | | height: 210px; |
| | | width: 200px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .active { |
| | | padding: 5px; |
| | | width: 20%; |
| | | height: 200px; |
| | | border: 0.5rem outset rgb(52, 155, 4); |
| | | } |
| | | |
| | | .selected { |
| | | padding: 5px; |
| | | color: #4abe84; |
| | | box-shadow: 0 2px 7px 0 rgba(85, 110, 97, 0.35); |
| | | border: 1px solid rgba(74, 190, 132, 1); |
| | | } |
| | | |
| | | .selected:before { |
| | | content: ''; |
| | | position: absolute; |
| | | right: 0; |
| | | bottom: 0; |
| | | border: 17px solid #4abe84; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | } |
| | | |
| | | .selected:after { |
| | | content: ''; |
| | | width: 5px; |
| | | height: 12px; |
| | | position: absolute; |
| | | right: 6px; |
| | | bottom: 6px; |
| | | border: 2px solid #fff; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | transform: rotate(45deg); |
| | | } |
| | | |
| | | .noActive { |
| | | padding: 5px; |
| | | } |
| | | |
| | | .blurry { |
| | | filter: blur(3px); |
| | | } |
| | | .filters { |
| | | display: flex; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .el-dialog__body { |
| | | height: 60vh; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="t-card_item"> |
| | | æ´æ¹å¾ç |
| | | <div> |
| | | <el-button @click="chosePicFromAnyPic">ä»ä»»æå¾çéå</el-button> |
| | | <!-- <el-button type="primary" @click="chosePicFromLedgerPic">ä»å°è´¦éå</el-button> --> |
| | | <el-button @click="choseChangePic">仿件夹éå</el-button> |
| | | </div> |
| | | </div> |
| | | <el-upload |
| | | class="img-upload" |
| | | ref="uploadRef" |
| | | v-model:file-list="fileList" |
| | | list-type="picture-card" |
| | | multiple |
| | | :auto-upload="false" |
| | | crossorigin="Anonymous" |
| | | :before-remove="beforeRemoveFile" |
| | | :on-preview="handlePictureCardPreview" |
| | | :disabled="readonly" |
| | | accept="image/*" |
| | | > |
| | | <el-button type="primary" id="uploadBtnId" style="display: none"></el-button> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon> |
| | | </el-upload> |
| | | <div class="flex-div"> |
| | | <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 |
| | | v-if="anyPhotoDialog" |
| | | @selectByAnyPhonoEvent="handleSelectedAnyPhono" |
| | | :subtask="subtask" |
| | | :defaultFile="fileList" |
| | | ref="arbitraryPhotoRef" |
| | | > |
| | | </ArbitraryPhoto> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="å°è´¦å¾ç" |
| | | width="80%" |
| | | v-model="ledgerPicDialog" |
| | | :before-close="beforeLedgerPicDialogclose" |
| | | > |
| | | <LedgerPic |
| | | v-if="ledgerPicDialog" |
| | | @selectByLedgerPicEvent="handleLedgerPicPhono" |
| | | :month="month" |
| | | :subtask="subtask" |
| | | ref="ledgerPicRef" |
| | | > |
| | | </LedgerPic> |
| | | </el-dialog> |
| | | </div> |
| | | <el-dialog v-model="previewDialogVisible"> |
| | | <img w-full :src="previewDialogImageUrl" alt="é¢è§" class="preview-pic" /> |
| | | </el-dialog> |
| | | </template> |
| | | <script> |
| | | import ArbitraryPhoto from './ArbitraryPhoto.vue'; |
| | | import LedgerPic from './CompLedgerPic.vue'; |
| | | import problemApi from '@/api/fysp/problemApi.js'; |
| | | |
| | | import { $fysp } from '@/api/index.js'; |
| | | import fileUtil from '@/utils/fileUtils.js'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | import { ElMessage } from 'element-plus'; |
| | | export default { |
| | | components: { |
| | | ArbitraryPhoto, |
| | | LedgerPic |
| | | }, |
| | | watch: { |
| | | fileList: { |
| | | handler(newFileList, oldFileList) { |
| | | this.pictureValidate(); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | props: { |
| | | problemId: { |
| | | type: String |
| | | }, |
| | | oldChangeFileList: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | subtask: { |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | month: { |
| | | type: Number, |
| | | default: -1 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | previewDialogImageUrl: '', |
| | | previewDialogVisible: false, |
| | | fileList: [], |
| | | oldFileList: [], |
| | | deleteImg: [], |
| | | |
| | | ledgerPicDialog: false, |
| | | anyPhotoDialog: false |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.initParams(); |
| | | }, |
| | | methods: { |
| | | pictureValidate() { |
| | | if (this.fileList.length < 1) { |
| | | ElMessage({ |
| | | message: 'è³å°ä¸ä¼ ä¸å¼ å¾ç', |
| | | type: 'error' |
| | | }); |
| | | return false; |
| | | } else if (this.fileList.length > 3) { |
| | | ElMessage({ |
| | | message: 'è¶
è¿ä¸å¼ , å·²å é¤å¤åºçå¾ç', |
| | | type: 'error' |
| | | }); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | initParams() { |
| | | 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); |
| | | } |
| | | }); |
| | | this.fileList = useCloned(beforeEditImgList).cloned.value; |
| | | this.oldFileList = useCloned(beforeEditImgList).cloned.value; |
| | | }, |
| | | onSubmit() { |
| | | if (!this.pictureValidate()) { |
| | | return; |
| | | } |
| | | // æ°æ®åå¤ |
| | | let data = new FormData(); |
| | | var picUrls = []; |
| | | this.fileList.forEach((item) => { |
| | | if (!('guid' in item)) { |
| | | // æ°ç |
| | | let exclude = false; |
| | | for (let index = 0; index < this.oldFileList.length; index++) { |
| | | const element = this.oldFileList[index]; |
| | | if (item.url == element.url) { |
| | | exclude = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!exclude) { |
| | | picUrls.push(item.url); |
| | | } |
| | | exclude = false; |
| | | // picUrls.push(item) |
| | | } else { |
| | | } |
| | | }); |
| | | |
| | | 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); |
| | | }); |
| | | problemApi.updateChange(data).then((res) => {}); |
| | | }); |
| | | this.$emit('submited', true); |
| | | }, |
| | | beforeRemoveFile(file, fileList) { |
| | | if (file.remark == 'å·²ä¸ä¼ ') { |
| | | this.deleteImg.push(file.guid); |
| | | this.oldFileList.filter((item) => item.url != file.url); |
| | | } |
| | | }, |
| | | handlePictureCardPreview(uploadFile) { |
| | | this.previewDialogVisible = true; |
| | | this.previewDialogImageUrl = uploadFile.url; |
| | | }, |
| | | handleSelectedAnyPhono(data) { |
| | | this.beforeAnyPhotoDialogclose(); |
| | | 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; |
| | | } |
| | | }, |
| | | 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; |
| | | }, |
| | | // ä»æä»¶å¤¹ä¸ |
| | | choseChangePic() { |
| | | // è·åæå®IDçå
ç´ |
| | | var btnElement = document.getElementById('uploadBtnId'); |
| | | // æ£æ¥å
ç´ æ¯å¦åå¨ |
| | | if (btnElement) { |
| | | // 触åç¹å»äºä»¶ |
| | | btnElement.click(); |
| | | } |
| | | }, |
| | | chosePicFromLedgerPic() { |
| | | // 使ç¨Dateå¯¹è±¡è§£ææ¥æå符串 |
| | | var date = new Date(this.subtask.subtask.planstarttime.splice(0, 7)); |
| | | // è·åæä»½ä¿¡æ¯ï¼æä»½æ¯ä»0å¼å§çï¼æä»¥éè¦å 1 |
| | | this.month = date.getMonth() + 1; |
| | | if (String(this.month).length == 1) { |
| | | this.month = `0${this.month}`; |
| | | } |
| | | var year = date.getFullYear(); |
| | | this.month = `${year}-${this.month}`; |
| | | this.ledgerPicDialog = true; |
| | | }, |
| | | beforeAnyPhotoDialogclose() { |
| | | this.anyPhotoDialog = false; |
| | | }, |
| | | beforeLedgerPicDialogclose() { |
| | | this.ledgerPicDialog = false; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .flex-div { |
| | | display: flex; |
| | | } |
| | | .t-card_item { |
| | | display: flex; |
| | | padding: 5px; |
| | | } |
| | | .img-upload { |
| | | margin-top: 30px; |
| | | margin-bottom: 30px; |
| | | margin-left: 63px; |
| | | } |
| | | ::v-deep .el-dialog__body { |
| | | width: 95%; |
| | | } |
| | | ::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail { |
| | | object-fit: cover !important; |
| | | } |
| | | .preview-pic { |
| | | object-fit: cover; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main"> |
| | | <div class="filters" v-if="false"> |
| | | <el-select |
| | | v-for="(key_select, index_select) of filters.keys()" |
| | | :placeholder="key_select.text" |
| | | > |
| | | <el-option |
| | | v-for="(key_option, index_option) in filters.get(key_select.key)" |
| | | :key="key_option.key" |
| | | :value="key_option.value" |
| | | :label="key_option.label" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="btns" v-if="!readonly"> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(true)">ç¡®å®</el-button> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(false)">åæ¶</el-button> |
| | | </div> |
| | | |
| | | <div class="center"> |
| | | <el-descriptions> |
| | | <el-descriptions-item label="æ»æ°"> |
| | | <span>{{ this.imgPathsDataSourceCopy.length }}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-tabs v-model="activeId" type="card"> |
| | | <el-tab-pane v-for="item in typeList" :label="item.label" :name="item.id"> </el-tab-pane> |
| | | </el-tabs> |
| | | <el-empty v-if="imgObjList.length == 0" description="ææ è®°å½" /> |
| | | <div class="imgs"> |
| | | <el-image |
| | | v-for="(img, i) in imgObjList" |
| | | :class="[Boolean(img.isSelect) ? 'selected' : 'noActive', 'image']" |
| | | fit="cover" |
| | | :src="img._picUrl" |
| | | lazy |
| | | @click="onSelect(img, i)" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import problemApi from '@/api/fysp/problemApi.js'; |
| | | import mediafileApi from '@/api/fysp/mediafileApi.js'; |
| | | import { $fysp } from '@/api/index.js'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | export default { |
| | | props: { |
| | | filters: Map, |
| | | // æ¯å¦ä»¥åªè¯»ç形弿¥çå½åé¡µé¢ |
| | | readonly: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | imgPathsDataSource: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | defaultFile: { |
| | | type: Array, |
| | | default: () => [] |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // æ æ°æ® |
| | | isEmpty: false, |
| | | isClose: false, |
| | | isAll: false, |
| | | activeId: 0, |
| | | typeList: [ |
| | | { id: 0, label: 'çæ§è®¾å¤' }, |
| | | { id: 1, label: 'æ²»ç设å¤' }, |
| | | { id: 2, label: 'ç产设å¤' } |
| | | ], |
| | | typeImgMap: new Map(), |
| | | imgPathsDataSourceCopy: [], |
| | | imgObjList: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | activeId: { |
| | | handler(newId, oldId) { |
| | | this.filterImgList() |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | mounted() { |
| | | if (this.defaultFile == undefined || this.defaultFile == null) { |
| | | this.defaultFile = []; |
| | | } |
| | | this.initImgUrlList(); |
| | | }, |
| | | methods: { |
| | | filterImgList() { |
| | | this.imgObjList = this.imgPathsDataSourceCopy.filter((item) => { |
| | | return item.topTypeId == this.activeId; |
| | | }); |
| | | }, |
| | | initDefaultFile() { |
| | | for (let item of this.imgPathsDataSourceCopy) { |
| | | for (let defaultItem of this.defaultFile) { |
| | | if (item._picUrl == defaultItem.url) { |
| | | item.isSelect = true; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // è·åå¾çèµæº |
| | | initImgUrlList() { |
| | | this.imgPathsDataSourceCopy = useCloned(this.imgPathsDataSource).cloned.value; |
| | | this.imgObjList = this.imgPathsDataSourceCopy; |
| | | this.initDefaultFile(); |
| | | |
| | | this.initSelectedTab(); |
| | | }, |
| | | // åå§ååå¼å§éä¸çæ ç¾ |
| | | initSelectedTab() { |
| | | if (this.typeList.length > 0) { |
| | | this.activeId = this.typeList[0].id; |
| | | } |
| | | this.filterImgList() |
| | | }, |
| | | onSelect(img, i) { |
| | | // if (i == 2 && !this.isAll) { |
| | | // this.getAllImgList(); |
| | | // this.isAll = true; |
| | | // } else { |
| | | // if (this.readonly) { |
| | | // return; |
| | | // } |
| | | // img.isSelect = !Boolean(img.isSelect); |
| | | // } |
| | | |
| | | if (this.readonly) { |
| | | return; |
| | | } |
| | | img.isSelect = !Boolean(img.isSelect); |
| | | }, |
| | | sendSelectedImg(isOk) { |
| | | let result = []; |
| | | if (!Boolean(isOk)) { |
| | | this.$emit('selectPhonoEvent', result); |
| | | } |
| | | for (const item of this.imgPathsDataSourceCopy) { |
| | | if (item.isSelect == true) { |
| | | result.push(item); |
| | | } |
| | | } |
| | | this.isClose = true; |
| | | this.$emit('selectPhonoEvent', result); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .center { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | .text { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .main { |
| | | margin: 0 auto; /* 使ç¶å
ç´ å±
ä¸ */ |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .btns { |
| | | height: 10%; |
| | | } |
| | | /* |
| | | .img_types { |
| | | margin: 0 auto; |
| | | height: 440px; |
| | | width: 900px; |
| | | flex-grow: 1; |
| | | overflow-y: hidden ; |
| | | padding: 3%; |
| | | flex-wrap: wrap; |
| | | overflow: hidden; |
| | | } */ |
| | | |
| | | .imgs { |
| | | height: 370px; |
| | | width: 90%; |
| | | min-height: 100px !important; |
| | | /* border-style:solid; |
| | | border-radius: 1px; */ |
| | | /* height: 100%; */ |
| | | flex-grow: 1 !important; |
| | | overflow-y: auto !important; |
| | | /* å
容çå
è¾¹è· */ |
| | | display: flex !important; |
| | | flex-wrap: wrap !important; |
| | | /* overflow: hidden; */ |
| | | } |
| | | |
| | | .image { |
| | | height: 210px; |
| | | width: 200px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .active { |
| | | padding: 5px; |
| | | width: 20%; |
| | | height: 200px; |
| | | border: 0.5rem outset rgb(52, 155, 4); |
| | | } |
| | | |
| | | .selected { |
| | | padding: 5px; |
| | | color: #4abe84; |
| | | box-shadow: 0 2px 7px 0 rgba(85, 110, 97, 0.35); |
| | | border: 1px solid rgba(74, 190, 132, 1); |
| | | } |
| | | |
| | | .selected:before { |
| | | content: ''; |
| | | position: absolute; |
| | | right: 0; |
| | | bottom: 0; |
| | | border: 17px solid #4abe84; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | } |
| | | |
| | | .selected:after { |
| | | content: ''; |
| | | width: 5px; |
| | | height: 12px; |
| | | position: absolute; |
| | | right: 6px; |
| | | bottom: 6px; |
| | | border: 2px solid #fff; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | transform: rotate(45deg); |
| | | } |
| | | |
| | | .noActive { |
| | | padding: 5px; |
| | | } |
| | | |
| | | .blurry { |
| | | filter: blur(3px); |
| | | } |
| | | .filters { |
| | | display: flex; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .el-dialog__body { |
| | | height: 60vh; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main"> |
| | | <!-- é项 --> |
| | | <!-- 设å¤ç±»å --> |
| | | <el-row> |
| | | <el-col> |
| | | <span>设å¤ç±»åï¼</span> |
| | | </el-col> |
| | | <el-col> |
| | | <el-tabs class="child_select" placeholder="设å¤ç±»å" v-model="currSelect.deviceTypeId"> |
| | | <el-tab-pane v-for="item in deviceTypes" :name="item.id" :label="item.label" /> |
| | | </el-tabs> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 设å¤å±ç¤º --> |
| | | <div class="devices"> |
| | | <el-card class="layout" shadow="hover" v-for="item of cardData"> |
| | | <div class="table-row"> |
| | | <span class="table-cell">ç«ç¹: {{ item.diName || item.piName || item.wiName }}</span> |
| | | <span class="table-cell" |
| | | >ä¾åºå: {{ item.diSupplier || item.piSupplier || item.wiSupplier }}</span |
| | | > |
| | | </div> |
| | | <div class="table-row"> |
| | | <span class="table-cell" |
| | | >è¿ç»´å: {{ item.diMaintainer || item.piMaintainer || item.wiMaintainer }}</span |
| | | > |
| | | <span class="table-cell" |
| | | >è¿ç»´é¢æ¬¡: |
| | | {{ |
| | | maintainFrequencysMap.get( |
| | | item.diMaintainFrequency || item.piMaintainFrequency || item.wiMaintainFrequency |
| | | ) |
| | | }}</span |
| | | > |
| | | </div> |
| | | <div class="table-row"> |
| | | <span class="table-cell" |
| | | >è¿ç»´äººå: |
| | | {{ item.diMaintainStaff || item.piMaintainStaff || item.wiMaintainStaff }}</span |
| | | > |
| | | <span class="table-cell" |
| | | >è¿ç»´èç³»æ¹å¼: |
| | | {{ item.diMaintainTel || item.piMaintainTel || item.wiMaintainTel }}</span |
| | | > |
| | | </div> |
| | | <div class="table-row"> |
| | | <span class="table-cell" |
| | | >åçåå·: {{ item.diBrandModel || item.piBrandModel || item.wiBrandModel }}</span |
| | | > |
| | | <span class="table-cell" |
| | | >è¿è¡ç¶æ: |
| | | {{ |
| | | runStatusMap.get(item.diRunningStatus || item.piRunningStatus || item.wiRunningStatus) |
| | | }} |
| | | </span> |
| | | </div> |
| | | <div class="table-row"> |
| | | <span class="table-cell" |
| | | >ä½ç½®: {{ item.dlLocation || item.piLocation || item.wiLocation }}</span |
| | | > |
| | | <!-- The second cell is empty to maintain the two-field per row layout --> |
| | | <span class="table-cell"></span> |
| | | </div> |
| | | <el-image |
| | | class="pic-style" |
| | | :src="item.picUrl" |
| | | fit="cover" |
| | | :preview-src-list="Array.of(item.picUrl)" |
| | | /> |
| | | </el-card> |
| | | <!-- æ°æ®ä¸ºç©ºæ¶ --> |
| | | <div class="empty" v-if="isEmpty"> |
| | | <h3>ææ æ°æ®</h3> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import deviceApi from '@/api/fysp/deviceApi'; |
| | | import { $fysp } from '@/api/index'; |
| | | export default { |
| | | props: {}, |
| | | mounted() {}, |
| | | watch: { |
| | | // éæ©æ¹åçå¬ |
| | | currSelect: { |
| | | handler(newObj, oldObj) { |
| | | this.getList(); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // æ æ°æ® |
| | | isEmpty: false, |
| | | // ååç»å® |
| | | currSelect: { |
| | | deviceTypeId: 0 |
| | | }, |
| | | // åºæ¯ç±»å |
| | | sceneType: '', |
| | | // åºæ¯id |
| | | sceneId: null, |
| | | // é项 |
| | | scenes: [], |
| | | // æ ¹æ®åºæ¯ç±»åå³å®ç设å¤ç±»å |
| | | iDevTypes: [ |
| | | |
| | | ], |
| | | deviceTypes: [ |
| | | { id: 0, label: 'çæ§' }, |
| | | { id: 1, label: 'æ²»ç' }, |
| | | { id: 2, label: 'ç产' } |
| | | ], |
| | | // æ°æ® |
| | | cardData: [], |
| | | // è¿è¡ç¶æ |
| | | runStatusMap: new Map( |
| | | [ |
| | | { key: 0, value: 'æªèç½' }, |
| | | { key: 1, value: 'ä¸çº¿ä¸' }, |
| | | { key: 2, value: 'ä¸çº¿' }, |
| | | { key: 3, value: 'æé¤' } |
| | | ].map((item) => [item.key, item.value]) |
| | | ), |
| | | |
| | | // ç»´æ¤é¢çç¶æ |
| | | maintainFrequencysMap: new Map( |
| | | [ |
| | | { key: '1', value: 'æ¯æä¸æ¬¡' }, |
| | | { key: '2', value: 'æ¯å£åº¦ä¸æ¬¡' }, |
| | | { key: '3', value: 'æ¯å年䏿¬¡' }, |
| | | { key: '4', value: 'æ¯å¹´ä¸æ¬¡' } |
| | | ].map((item) => [item.key, item.value]) |
| | | ) |
| | | }; |
| | | }, |
| | | methods: { |
| | | // ç¶ç»ä»¶ä¸»å¨ä¼ å¼ |
| | | init(scene) { |
| | | this.sceneId = scene.guid; |
| | | this.sceneType = scene.type; |
| | | this.iDevTypes = dataMonitorDeviceTypeJs.monitorDevices(this.sceneType) |
| | | this.getList(); |
| | | }, |
| | | isShowEmpty(data) { |
| | | if (data.length == 0) { |
| | | this.isEmpty = true; |
| | | return true; |
| | | } else { |
| | | this.isEmpty = false; |
| | | return false; |
| | | } |
| | | }, |
| | | // éç½®å±ç¤ºçæ°æ® |
| | | initList() { |
| | | this.tableData = []; |
| | | }, |
| | | // åæ®µåæ¦æªå¨ |
| | | propNameConvert(obj, name) { |
| | | name = String(name).substring(1) |
| | | return obj['d'+name] || obj['p'+name] || obj['w'+name] |
| | | }, |
| | | getList() { |
| | | this.initList(); |
| | | var devicesInfoList = []; |
| | | deviceApi.fetchDevices(this.sceneId, this.currSelect.deviceTypeId).then((result) => { |
| | | devicesInfoList = result.data; |
| | | this.cardData = []; |
| | | if (this.isShowEmpty(devicesInfoList)) { |
| | | return; |
| | | } |
| | | if (devicesInfoList) { |
| | | devicesInfoList.forEach((e) => { |
| | | let data = { |
| | | deviceId: this.propNameConvert(e, 'diId'), |
| | | sceneId: this.propNameConvert(e, 'diSceneGuid'), |
| | | deviceTypeId: this.currSelect.deviceTypeId |
| | | }; |
| | | deviceApi |
| | | .fetchDeviceStatus(data) |
| | | .then((status) => { |
| | | var statusData = status.data; |
| | | if (statusData && statusData instanceof Array) { |
| | | if (statusData.length == 0) { |
| | | this.cardData.push(e); |
| | | return; |
| | | } |
| | | statusData.forEach((imgItem) => { |
| | | e.picUrl = $fysp.imgUrl + imgItem.dlPicUrl; |
| | | e.dlLocation = imgItem.dlLocation; |
| | | this.cardData.push(e); |
| | | }); |
| | | } |
| | | }) |
| | | .catch((err) => {}); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .selects { |
| | | display: flex; |
| | | } |
| | | .child_select { |
| | | margin-right: 10px; |
| | | } |
| | | .table-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .table-cell { |
| | | flex-basis: calc(50% - 10px); /* Adjust the width and margin as needed */ |
| | | border: 1px solid #ddd; /* Add border to mimic table cell */ |
| | | padding: 8px; |
| | | text-align: center; |
| | | } |
| | | .pic-style { |
| | | margin-top: 10px; |
| | | width: 100%; |
| | | height: 400px; |
| | | } |
| | | .empty { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- é项 --> |
| | | <!-- 设å¤ç±»å --> |
| | | <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"> |
| | | <template #label> |
| | | <el-badge :value="item.count" :type="item.count == 0 ? 'danger' : 'primary'"> |
| | | <span class="custom-tabs-label"> |
| | | <span>{{ item.label }}</span> |
| | | </span> |
| | | </el-badge> |
| | | </template> |
| | | </el-tab-pane> |
| | | </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%"> |
| | | <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 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> |
| | | </div> |
| | | </div> |
| | | <div v-else class="centerDiv"> |
| | | <el-button link type="primary" size="large">[ç¹å»ç¼©æ¾]</el-button> |
| | | </div> |
| | | <!-- æè¦å
å®¹ç»æ --> |
| | | </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-form :model="status" class="form-class"> |
| | | <el-form-item label="ä½ç½®"> |
| | | <el-input |
| | | v-model="status.dlLocation" |
| | | :disabled="isDisabled" |
| | | class="form-item-class" |
| | | ></el-input> |
| | | </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> |
| | | <!-- å¾ç --> |
| | | <el-image |
| | | fit="cover" |
| | | class="pic-style" |
| | | :src="status._picUrl" |
| | | :preview-src-list="Array.of(status._picUrl)" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-divider /> |
| | | <!-- 详ç»å
å®¹ç»æ --> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | <!-- ç©ºç¶æ --> |
| | | <el-empty v-if="isEmpty" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import deviceApi from '@/api/fysp/deviceApi'; |
| | | import { $fysp } from '@/api/index'; |
| | | export default { |
| | | components: {}, |
| | | watch: { |
| | | // éæ©æ¹åçå¬ |
| | | currSelect: { |
| | | handler(newObj, oldObj) { |
| | | this.getList(); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | activeNames: [], |
| | | // æ§å¶æ¯å¦å±ç¤ºç©ºç¶æ |
| | | isEmpty: false, |
| | | // 详æ
æé®å¤§å° |
| | | detailSize: '22px', |
| | | // 表å详æ
ç¹å»æé®ç徿 |
| | | isDetail: false, |
| | | currSelect: { |
| | | topDeviceTypeId: 0 |
| | | }, |
| | | // æ§å¶è¡¨åæ¯å¦å¯ä»¥ç¼è¾ |
| | | isDisabled: true, |
| | | formInfo: {}, |
| | | rules: [], |
| | | // 设å¤ç±»å |
| | | deviceTopTypes: [ |
| | | { id: 0, label: 'çæ§è®¾å¤' }, |
| | | { id: 1, label: 'æ²»ç设å¤' }, |
| | | { id: 2, label: 'ç产设å¤' } |
| | | ], |
| | | // è¿è¡ç¶æ |
| | | runStatusArray: [ |
| | | { key: 0, value: 'æªèç½' }, |
| | | { key: 1, value: 'ä¸çº¿ä¸' }, |
| | | { key: 2, value: 'ä¸çº¿' }, |
| | | { key: 3, value: 'æé¤' } |
| | | ], |
| | | // ç»´æ¤é¢çç¶æ |
| | | maintainFrequencysArray: [ |
| | | { key: 1, value: 'æ¯æä¸æ¬¡' }, |
| | | { key: 2, value: 'æ¯å£åº¦ä¸æ¬¡' }, |
| | | { key: 3, value: 'æ¯å年䏿¬¡' }, |
| | | { key: 4, value: 'æ¯å¹´ä¸æ¬¡' } |
| | | ], |
| | | // ç§èµæ¹å¼ |
| | | ownershipArray: [ |
| | | { 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: {} |
| | | }; |
| | | }, |
| | | props: {}, |
| | | |
| | | mounted() {}, |
| | | methods: { |
| | | // è·åå½åç±»åè®¾å¤æ°é |
| | | getTabsCount() { |
| | | this.deviceTopTypes.forEach((item) => { |
| | | deviceApi.fetchDevices(this.scene.guid, item.id).then((result) => { |
| | | item.count = result.data.length; |
| | | }); |
| | | }); |
| | | }, |
| | | // è·åè¿è¡ç¶æå¯¹åºçvalue |
| | | getRunStatusValueByRunStatusKey(status) { |
| | | var runningStatusValueArray = this.runStatusArray.filter((runStatus) => { |
| | | return runStatus.key == status; |
| | | }); |
| | | if (runningStatusValueArray.length > 0) { |
| | | return runningStatusValueArray[0].value; |
| | | } |
| | | }, |
| | | // å±ç¤ºè¡¨åç详æ
çç¹å»äºä»¶ |
| | | showDetail(item) { |
| | | item._isDetail = !item._isDetail; |
| | | if (item._isDetail) { |
| | | } else { |
| | | } |
| | | }, |
| | | init(scene) { |
| | | // ç¶ç»ä»¶ä¸»å¨è°ç¨åå§ååç»ä»¶çæ¹æ³ |
| | | this.scene = scene; |
| | | |
| | | this.getList(); |
| | | this.getTabsCount(); |
| | | }, |
| | | // éç½®å±ç¤ºçæ°æ® |
| | | initList() { |
| | | this.formInfo = []; |
| | | this.isEmpty = false; |
| | | }, |
| | | // æ åå屿§å |
| | | convertKeys(obj) { |
| | | // å°ä¸ä¸ªjså¯¹è±¡ä¸æædiï¼wiï¼piå¼å¤´ç屿§å
¨é¨æ¹æå»æè¿äºåç¼å¹¶ä¸éæ°å为驼峰å¼å½å |
| | | 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]; |
| | | } |
| | | } |
| | | return newObj; |
| | | }, |
| | | // æ°å¢å段 |
| | | initFormData(data) { |
| | | 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) => { |
| | | var statusData = status.data; |
| | | var imgPaths = []; |
| | | if (statusData) { |
| | | if (statusData.length == 0) { |
| | | this.formInfo.push(element); |
| | | return; |
| | | } |
| | | element = this.convertKeys(result.data[index]); |
| | | element._picUrls = imgPaths; |
| | | for (let index = 0; index < statusData.length; index++) { |
| | | const statusItem = statusData[index]; |
| | | // 设å¤å¯¹è±¡æ·»å ä¸ä¸ªå±æ§åè¡¨å±æ§ç¨æ¥ä¿å设å¤ç¶æ |
| | | this.saveStatus(element, statusItem); |
| | | element.dlLocation = statusItem.dlLocation; |
| | | this.formInfo.push(element); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => {}); |
| | | } |
| | | }); |
| | | }, |
| | | // ä¿åç¶æä¿¡æ¯ |
| | | saveStatus(device, status) { |
| | | var _picUrl = $fysp.imgUrl + status.dlPicUrl; |
| | | status._picUrl = _picUrl; |
| | | if ('_statusList' in device) { |
| | | device._statusList.push(status); |
| | | } else { |
| | | device._statusList = Array.of(status); |
| | | } |
| | | // æåº |
| | | device._statusList.sort(function (x, y) { |
| | | return new Date(x.dlCreateTime) - new Date(y.dlCreateTime); // éåºï¼ååºååä¹ |
| | | }); |
| | | }, |
| | | submit() {}, |
| | | cancel() {}, |
| | | modifyObjectKeys(obj) { |
| | | const newObj = {}; |
| | | for (const key in obj) { |
| | | if (obj.hasOwnProperty(key)) { |
| | | // è·³è¿ä»¥ '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; |
| | | } |
| | | |
| | | // æ·»å åç¼å¹¶è½¬æ¢ä¸ºé©¼å³°å¼å½å |
| | | const newKey = `${prefix}${key.charAt(0).toUpperCase() + key.slice(1)}`; |
| | | newObj[newKey] = obj[key]; |
| | | } |
| | | } |
| | | return newObj; |
| | | }, |
| | | // çææ¥å£åæ° |
| | | generateQuery(obj) { |
| | | // éè¦æ ¹æ®åºæ¯ç±»åç¡®å®æ¥å£åæ°ç屿§å |
| | | var query = this.modifyObjectKeys(obj); |
| | | return query; |
| | | }, |
| | | // æ ¹æ®æ¥å£è¿åçæ iDeviceTypesMap |
| | | generateIDeviceTypesMap() {}, |
| | | // è·åå½åtopTypeï¼å½åsceneTypeId䏿æç¶ç±»å |
| | | 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) { |
| | | return ''; |
| | | } |
| | | return iDeviceTypesArray; |
| | | }, |
| | | // è·å设å¤ç±»å topDeviceTypeId, sceneTypeId å èªèº«çä¸äºåæ° |
| | | getIDeviceParentTypeObj(device) { |
| | | var iDeviceTypesArray = this.getAlliDeviceParentTypeArray(); |
| | | console.log('iDeviceTypesArray', this.getAlliDeviceParentTypeArray()); |
| | | var result; |
| | | iDeviceTypesArray.forEach((e) => { |
| | | if (e.value == device.typeId) { |
| | | result = e; |
| | | } |
| | | }); |
| | | return result; |
| | | }, |
| | | // è·å设å¤åç±»å 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 ''; |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .image-container { |
| | | display: flex; |
| | | flex-direction: row-reverse; |
| | | width: 100%; |
| | | height: 200px; |
| | | overflow: hidden; /* ç¡®ä¿å¾çä¸ä¼è¶
åºå®¹å¨ */ |
| | | } |
| | | .pic-style { |
| | | width: 180px; |
| | | height: 180px; |
| | | margin-right: 5%; |
| | | } |
| | | .card-style { |
| | | height: 400px; |
| | | margin-bottom: 10px; |
| | | border-color: rgba(0, 0, 0, 0.308); |
| | | } |
| | | .centerDiv { |
| | | text-align: center; /* æ°´å¹³å±
ä¸ */ |
| | | } |
| | | .dot { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | width: 10px; |
| | | height: 10px; |
| | | background-color: #f56c6c; |
| | | border-radius: 50%; |
| | | } |
| | | .abstract_main { |
| | | width: 100%; |
| | | } |
| | | .abstract_other_item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-right: 50px; |
| | | margin-top: 10px; |
| | | width: 20%; |
| | | } |
| | | .abstract_other_item_inner { |
| | | margin-left: 10px; |
| | | display: flex; |
| | | } |
| | | .abstract_main_title { |
| | | margin-left: -400px; |
| | | color: #303133; |
| | | font-size: 16px; |
| | | } |
| | | .abstract_other_title { |
| | | color: #606266; |
| | | font-size: 13px; |
| | | } |
| | | .abstract_main_text { |
| | | color: #303133; |
| | | font-size: 17px; |
| | | margin-top: 5px; |
| | | } |
| | | .form_class { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .el-collapse { |
| | | /* æå 颿¿æå æ¶çé«åº¦ */ |
| | | --el-collapse-header-height: auto; |
| | | } |
| | | .el-collapse-item__header { |
| | | width: 100%; |
| | | } |
| | | .form-class { |
| | | width: 50vw; |
| | | } |
| | | .form-item-class { |
| | | margin-bottom: 10px; |
| | | } |
| | | .sub-title { |
| | | font-size: var(--el-font-size-large); |
| | | margin-bottom: 30px; |
| | | margin-left: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="btns" v-if="!readonly"> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(true)">ç¡®å®</el-button> |
| | | <el-button size="small" type="primary" @click="sendSelectedImg(false)">åæ¶</el-button> |
| | | </div> |
| | | <div class="center"> |
| | | <el-descriptions> |
| | | <el-descriptions-item label="æ»æ°"> |
| | | <span>{{ this.imgListAll.length }}</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <el-tab-pane v-for="item in typeList" :label="item" :name="item"> </el-tab-pane> |
| | | </el-tabs> |
| | | <el-empty v-if="imgList.length == 0" description="ææ è®°å½" /> |
| | | <div class="imgs"> |
| | | <el-image |
| | | v-for="(img, i) in imgList" |
| | | :class="[Boolean(img.isSelect) ? 'selected' : 'noActive', 'image']" |
| | | fit="cover" |
| | | :src="img._picPath" |
| | | lazy |
| | | @click="onSelect(img)" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import problemApiFytz from '@/api/fytz/problemApi.js'; |
| | | import userApi from '@/api/fysp/userApi.js'; |
| | | import mediafileApi from '@/api/fysp/mediafileApi.js'; |
| | | import { svToTz } from '@/enum/scene'; |
| | | import { $fytz } from '@/api/index'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | export default { |
| | | watch: { |
| | | activeName: { |
| | | handler(newObj, oldObj) { |
| | | this.imgList = this.imgListAll.filter(item=>{ |
| | | return item.ledgerType == newObj |
| | | }) |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | props: { |
| | | month: Number, |
| | | subtask: Object |
| | | }, |
| | | computed: { |
| | | currImgList() { |
| | | return this.imgList.filter((item) => item.ledgerType == this.activeName); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | userApi.getTzId(this.subtask.sceneId).then((res) => { |
| | | this.isEmpty = false; |
| | | this.tzUserId = res.tzUserId; |
| | | |
| | | problemApiFytz |
| | | .getLedgerPic({ |
| | | tzUserId: this.tzUserId, |
| | | sceneType: svToTz(this.subtask.sceneTypeId).value, |
| | | time: this.month |
| | | }) |
| | | .then((res) => { |
| | | let data = res; |
| | | this.imgListAll = data; |
| | | if (this.imgListAll.length === 0) { |
| | | this.isEmpty = true; |
| | | } |
| | | if (this.imgListAll && this.imgListAll.length > 0) { |
| | | this.imgListAll.forEach((item) => { |
| | | item._picPath = $fytz.imgUrl + item.path1; |
| | | if (this.typeList.indexOf(item.ledgerType) == -1) { |
| | | this.typeList.push(item.ledgerType); |
| | | } |
| | | }); |
| | | this.activeName = this.typeList[0]; |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | handleClick(tab, event) { |
| | | this.activeName = tab.label; |
| | | }, |
| | | onSelect(img) { |
| | | img.isSelect = !Boolean(img.isSelect); |
| | | }, |
| | | sendSelectedImg(isOk) { |
| | | let result = []; |
| | | if (!Boolean(isOk)) { |
| | | this.$emit('selectByLedgerPicEvent', result); |
| | | } |
| | | for (const item in this.imgList) { |
| | | if (item.isSelect == true) { |
| | | result.push(item); |
| | | } |
| | | } |
| | | this.$emit('selectByLedgerPicEvent', result); |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | tzUserId: null, |
| | | imgList: [], |
| | | imgListAll: [], |
| | | typeList: [], |
| | | isEmpty: false, |
| | | activeName: '' |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .imgs { |
| | | height: 370px; |
| | | width: 90%; |
| | | min-height: 100px !important; |
| | | /* border-style:solid; |
| | | border-radius: 1px; */ |
| | | /* height: 100%; */ |
| | | flex-grow: 1 !important; |
| | | overflow-y: auto !important; |
| | | /* å
容çå
è¾¹è· */ |
| | | display: flex !important; |
| | | flex-wrap: wrap !important; |
| | | /* overflow: hidden; */ |
| | | } |
| | | |
| | | .image { |
| | | height: 210px; |
| | | width: 200px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .active { |
| | | padding: 5px; |
| | | width: 20%; |
| | | height: 200px; |
| | | border: 0.5rem outset rgb(52, 155, 4); |
| | | } |
| | | |
| | | .selected { |
| | | padding: 5px; |
| | | color: #4abe84; |
| | | box-shadow: 0 2px 7px 0 rgba(85, 110, 97, 0.35); |
| | | border: 1px solid rgba(74, 190, 132, 1); |
| | | } |
| | | |
| | | .selected:before { |
| | | content: ''; |
| | | position: absolute; |
| | | right: 0; |
| | | bottom: 0; |
| | | border: 17px solid #4abe84; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | } |
| | | |
| | | .selected:after { |
| | | content: ''; |
| | | width: 5px; |
| | | height: 12px; |
| | | position: absolute; |
| | | right: 6px; |
| | | bottom: 6px; |
| | | border: 2px solid #fff; |
| | | border-top-color: transparent; |
| | | border-left-color: transparent; |
| | | transform: rotate(45deg); |
| | | } |
| | | |
| | | .noActive { |
| | | padding: 5px; |
| | | } |
| | | .btns { |
| | | height: 10%; |
| | | } |
| | | .center { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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-tabs> |
| | | <div class="proList"> |
| | | <el-card class="card-style" shadow="hover"> |
| | | <el-descriptions v-loading="loading"> |
| | | <el-descriptions-item label="æ»åºç°æ¬¡æ°">{{ curProList.length }}</el-descriptions-item> |
| | | <!-- <el-descriptions-item label="å¤ç°ç">{{ repeteRate }}%</el-descriptions-item> --> |
| | | </el-descriptions> |
| | | <!-- <el-descriptions v-loading="loading" column="3"> |
| | | <div v-for="pro in curProList"> |
| | | <el-descriptions-item>{{ pro.problemname }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä»»å¡åç§°">{{ pro._stName }}</el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <el-button link type="primary" @click="info(pro)">详æ
</el-button> |
| | | </el-descriptions-item> |
| | | </div> |
| | | </el-descriptions> --> |
| | | <el-table :data="curProList" style="width: 100%"> |
| | | <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"> |
| | | <template v-slot="scope"> |
| | | <el-button link type="primary" @click="info(scope.row)">详æ
</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | <el-dialog |
| | | title="é¢è§" |
| | | v-model="proAddOrUpdDialogVisible" |
| | | :before-close="proAddOrUpdDialogClose" |
| | | width="80%" |
| | | > |
| | | <CompProblemAddOrUpd |
| | | v-if="proAddOrUpdDialogVisible" |
| | | :subtask="subtask" |
| | | :topTask="topTask" |
| | | :problem="previewPro" |
| | | :readonly="true" |
| | | ref="compProblemAddOrUpdRef" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import CompProblemAddOrUpd from './CompProblemAddOrUpd.vue'; |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | export default { |
| | | computed: { |
| | | // repeteRate() { |
| | | // return this.curProList.length !== 0 ? (this.curProList.length - 1) / this.subtaskCount * 1.0 : 0 |
| | | // }, |
| | | }, |
| | | props: { |
| | | problem: { |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | topTask: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | subtask: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | activeName: { |
| | | handler(newObj, oldObj) { |
| | | this.handleClick(); |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | CompProblemAddOrUpd |
| | | }, |
| | | mounted() { |
| | | console.log('subtask', this.subtask); |
| | | |
| | | this.deepCopyPro = useCloned(this.problem).cloned.value; |
| | | this.getRecentPros(); |
| | | }, |
| | | data() { |
| | | return { |
| | | proAddOrUpdDialogVisible: false, |
| | | previewPro: {}, |
| | | // å è½½ç»è®¡ä¿¡æ¯ |
| | | loading: false, |
| | | // æ¶é´åé®é¢å¯¹è±¡å表 |
| | | timeProMap: new Map(), |
| | | curProList: [], |
| | | activeName: 'è¿ä¸ä¸ªæ', |
| | | ranges: ['è¿ä¸ä¸ªæ', 'è¿åå¹´', 'è¿ä¸å¹´'], |
| | | deepCopyPro: {} |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 转æ¢ä¸ºå京æ¶é´ |
| | | convertTime(time) { |
| | | time.setHours(time.getHours); |
| | | return time; |
| | | }, |
| | | // æå¼è¯¦æ
é¡µé¢ |
| | | info(pro) { |
| | | this.previewPro = pro; |
| | | this.proAddOrUpdDialogVisible = true; |
| | | }, |
| | | // å
³é详æ
å¼¹çª |
| | | proAddOrUpdDialogClose() { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | }, |
| | | // 忢æ¶é´èå´ |
| | | handleClick() { |
| | | this.getRecentPros(); |
| | | }, |
| | | updateSubtask() {}, |
| | | generateQueryParam() { |
| | | // ä»å¤©çæ¥æ |
| | | const today = new Date(); |
| | | // ä¸ä¸ªæå |
| | | const threeMonthsAgo = new Date(today); |
| | | threeMonthsAgo.setMonth(today.getMonth() - 3); |
| | | // 计ç®åå¹´åçæ¥æ |
| | | const sixMonthsAgo = new Date(today); |
| | | sixMonthsAgo.setMonth(today.getMonth() - 6); |
| | | // 计ç®ä¸å¹´åçæ¥æ |
| | | 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 === 'è¿ä¸ä¸ªæ' |
| | | ? this.$fm.formatYMDH(threeMonthsAgo) |
| | | : this.activeName === 'è¿åå¹´' |
| | | ? this.$fm.formatYMDH(sixMonthsAgo) |
| | | : this.$fm.formatYMDH(oneYearAgo), |
| | | endTime: this.$fm.formatYMDH(today), |
| | | sceneId: this.deepCopyPro.sguid |
| | | }; |
| | | }, |
| | | /** |
| | | * è·åè¿ææ
åµ |
| | | * */ |
| | | async getRecentPros() { |
| | | this.loading = true; |
| | | this.subtaskCount = 0 |
| | | // è·ååä»»å¡å表 |
| | | await taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => { |
| | | this.curProList = []; |
| | | if (subtasks) { |
| | | subtasks.forEach((subtask) => { |
| | | // è·åé®é¢å表 |
| | | this.getProBySubtask(subtask); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | // é¢å¤å¤ç |
| | | console.log('curr', this.curProList); |
| | | this.curProList.sort((o1, o2) => o2.getTime() - o1.getTime()); |
| | | this.loading = false; |
| | | }, |
| | | // æ ¹æ®åä»»å¡è·åéé¢çé®é¢å表 |
| | | async getProBySubtask(subtask) { |
| | | taskApi.getProBySubtask(subtask.stGuid).then((pros) => { |
| | | if (pros) { |
| | | pros.forEach((pro) => { |
| | | if (pro.ptguid == this.deepCopyPro.ptguid) { |
| | | pro._stName = subtask.stName; |
| | | pro._time = this.$fm.formatYM(subtask.stPlanTime) |
| | | this.curProList.push(pro); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .problem-style { |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <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-option |
| | | v-for="item in problemTypeOptions" |
| | | :key="item.typeid" |
| | | :label="item.typename" |
| | | :value="item.typename" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é®é¢æè¿°" prop="description"> |
| | | <el-select |
| | | v-model="deepCopyProblem.description" |
| | | @change="onProDesChange" |
| | | class="row" |
| | | :disabled="readonly" |
| | | > |
| | | <el-option |
| | | v-for="item in descriptionOptions" |
| | | :key="item.guid" |
| | | :label="item.description" |
| | | :value="item.guid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é®é¢ä½ç½®" prop="locationid"> |
| | | <el-select |
| | | v-model="deepCopyProblem.locationid" |
| | | @change="onProLocationChange" |
| | | class="row" |
| | | :disabled="readonly" |
| | | > |
| | | <el-option |
| | | v-for="item in posList" |
| | | :key="item.index" |
| | | :label="item.text" |
| | | :value="item.index" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é®é¢å»ºè®®" prop="advise"> |
| | | <el-select v-model="deepCopyProblem.advise" class="row" :disabled="readonly"> |
| | | <el-option |
| | | v-for="item in adviseOptions" |
| | | :key="item.adGuid" |
| | | :label="item.adName" |
| | | :value="item.adName" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¡¥å
说æ" :disabled="readonly" prop="proRemark"> |
| | | <el-input |
| | | v-model="proRemark" |
| | | type="textarea" |
| | | @change="onProRemarkChange" |
| | | class="row" |
| | | placeholder="请è¾å
¥" |
| | | /> |
| | | </el-form-item> |
| | | <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> |
| | | </div> |
| | | </div> |
| | | <el-upload |
| | | class="img-upload" |
| | | ref="uploadRef" |
| | | v-model:file-list="fileList" |
| | | list-type="picture-card" |
| | | multiple |
| | | :auto-upload="false" |
| | | crossorigin="Anonymous" |
| | | :before-remove="beforeRemoveFile" |
| | | :on-preview="handlePictureCardPreview" |
| | | :disabled="readonly" |
| | | accept="image/*" |
| | | > |
| | | <el-button type="primary" id="uploadBtnId" style="display: none"></el-button> |
| | | <el-icon> |
| | | <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-form-item> |
| | | </el-form> |
| | | <el-dialog |
| | | title="ä»»æå¾ç" |
| | | width="80%" |
| | | v-model="anyPhotoDialog" |
| | | :before-close="beforeAnyPhotoDialogclose" |
| | | class="dialog_style" |
| | | > |
| | | <ArbitraryPhoto |
| | | v-if="anyPhotoDialog" |
| | | @selectByAnyPhonoEvent="handleSelectedAnyPhono" |
| | | :subtask="subtask" |
| | | :defaultFile="fileList" |
| | | ref="arbitraryPhotoRef" |
| | | > |
| | | </ArbitraryPhoto> |
| | | </el-dialog> |
| | | <el-dialog |
| | | width="80%" |
| | | v-model="ledgerPicDialog" |
| | | :before-close="beforeLedgerPicDialogclose" |
| | | class="dialog_style" |
| | | > |
| | | <LedgerPic |
| | | v-if="ledgerPicDialog" |
| | | @selectByLedgerPicEvent="handleLedgerPicPhono" |
| | | :month="month" |
| | | :subtask="subtask" |
| | | :defaultFile="fileList" |
| | | ref="ledgerPicRef" |
| | | > |
| | | </LedgerPic> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="设å¤å¾ç" |
| | | width="80%" |
| | | v-model="deiveceImgDialog" |
| | | :before-close="beforeDeiveceImgDialogclose" |
| | | class="dialog_style" |
| | | > |
| | | <CompDevicePhono |
| | | v-if="deiveceImgDialog" |
| | | @selectPhonoEvent="handleSelectedDevicePhono" |
| | | :imgPathsDataSource="deviceImgObjList" |
| | | :defaultFile="fileList" |
| | | ref="deiveceImgDialogRef" |
| | | > |
| | | </CompDevicePhono> |
| | | </el-dialog> |
| | | <el-dialog v-model="previewDialogVisible"> |
| | | <img w-full :src="previewDialogImageUrl" alt="é¢è§" class="preview-pic"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import ArbitraryPhoto from './ArbitraryPhoto.vue'; |
| | | import LedgerPic from './CompLedgerPic.vue'; |
| | | import CompDevicePhono from './CompDevicePhono.vue'; |
| | | import problemApi from '@/api/fysp/problemApi.js'; |
| | | |
| | | import { $fysp } from '@/api/index.js'; |
| | | import fileUtil from '@/utils/fileUtils.js'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import deviceApi from '@/api/fysp/deviceApi'; |
| | | export default { |
| | | components: { |
| | | ArbitraryPhoto, |
| | | LedgerPic, |
| | | CompDevicePhono |
| | | }, |
| | | props: { |
| | | readonly: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | topTask: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | subtask: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | insGuid: { |
| | | type: String |
| | | }, |
| | | problem: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | previewDialogVisible: false, |
| | | previewDialogImageUrl: '', |
| | | // 设å¤å¾çå表 |
| | | deviceImgObjList: [], |
| | | // 0代表æ°å¢ 1ä¿®æ¹ |
| | | type: -1, |
| | | deepCopyProblem: {}, |
| | | currProTypeGuid: '', |
| | | proType: '', |
| | | proRemark: null, |
| | | |
| | | suggestions: [], |
| | | problemTypeList: [], |
| | | posList: [], |
| | | |
| | | fileList: [], |
| | | oldFileList: [], |
| | | deleteImg: [], |
| | | deiveceImgDialog: false, |
| | | anyPhotoDialog: false, |
| | | // å°è´¦ |
| | | 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' } |
| | | }, |
| | | deviceTopTypes: [ |
| | | { id: 0, label: 'çæ§è®¾å¤' }, |
| | | { id: 1, label: 'æ²»ç设å¤' }, |
| | | { id: 2, label: 'ç产设å¤' } |
| | | ] |
| | | }; |
| | | }, |
| | | watch: { |
| | | fileList: { |
| | | handler(newFileList, oldFileList) { |
| | | console.log('newFileList', newFileList); |
| | | // å¾çæ ¡éª |
| | | this.pictureValidate(); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | computed: { |
| | | descriptionOptions() { |
| | | const descriptions = []; |
| | | this.problemTypeList.forEach((item) => { |
| | | if (item.typename == this.proType) { |
| | | descriptions.push(item); |
| | | } |
| | | }); |
| | | return descriptions; |
| | | }, |
| | | problemTypeOptions() { |
| | | return this.problemTypeList.reduce((acc, current) => { |
| | | const x = acc.find((item) => item.typeid === current.typeid); |
| | | if (!x) { |
| | | acc.push(current); |
| | | } |
| | | return acc; |
| | | }, []); |
| | | }, |
| | | adviseOptions() { |
| | | var array = this.suggestions.filter((item) => item.adProblemtypeguid == this.currProTypeGuid); |
| | | console.log('adName', array); |
| | | |
| | | return array; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initOptions(); |
| | | this.getDeviceImgList(); |
| | | }, |
| | | methods: { |
| | | handlePictureCardPreview(uploadFile) { |
| | | this.previewDialogVisible = true; |
| | | this.previewDialogImageUrl = uploadFile.url; |
| | | }, |
| | | beforeDeiveceImgDialogclose() { |
| | | this.deiveceImgDialog = false; |
| | | }, |
| | | // æ åå屿§å |
| | | convertKeys(obj) { |
| | | // å°ä¸ä¸ªjså¯¹è±¡ä¸æædiï¼wiï¼piå¼å¤´ç屿§å
¨é¨æ¹æå»æè¿äºåç¼å¹¶ä¸éæ°å为驼峰å¼å½å |
| | | 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]; |
| | | } |
| | | } |
| | | return newObj; |
| | | }, |
| | | // ä¿åç¶æä¿¡æ¯ |
| | | saveStatus(device, status) { |
| | | var _picUrl = $fysp.imgUrl + status.dlPicUrl; |
| | | device._picUrl = _picUrl; |
| | | status._picUrl = _picUrl; |
| | | if ('_statusList' in device) { |
| | | device._statusList.push(status); |
| | | } else { |
| | | device._statusList = Array.of(status); |
| | | } |
| | | // æåº |
| | | device._statusList.sort(function (x, y) { |
| | | return new Date(x.dlCreateTime) - new Date(y.dlCreateTime); // éåºï¼ååºååä¹ |
| | | }); |
| | | }, |
| | | async getDeviceImgList() { |
| | | 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 = []; |
| | | |
| | | 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; |
| | | console.log('newDevice.topTypeId', newDevice.topTypeId); |
| | | console.log('newDevice', newDevice); |
| | | |
| | | this.deviceImgObjList.push(newDevice); |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => {}); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | initOptions() { |
| | | if (this.problem == undefined || this.problem == null) { |
| | | this.problem = {}; |
| | | this.deepCopyProblem = {}; |
| | | } else { |
| | | this.deepCopyProblem = useCloned(this.problem).cloned.value; |
| | | } |
| | | |
| | | this.type = 'guid' in this.deepCopyProblem ? 1 : 0; |
| | | // è·åé®é¢ç±»å |
| | | let data = { |
| | | sceneTypeId: this.subtask.sceneTypeId, |
| | | cityCode: this.topTask.citycode, |
| | | districtCode: this.topTask.districtcode |
| | | }; |
| | | problemApi.fetchProblemType(data).then((res) => { |
| | | this.problemTypeList = res.data; |
| | | |
| | | if (this.type == 1) { |
| | | let currProName = String(this.problem.problemname); |
| | | |
| | | let currDescription; |
| | | if (currProName.lastIndexOf('(') == -1) { |
| | | currDescription = currProName; |
| | | this.problemTypeList.forEach((item) => { |
| | | if (item.description == currDescription) { |
| | | this.proType = item.typename; |
| | | } |
| | | }); |
| | | this.deepCopyProblem.description = currDescription; |
| | | this.proRemark = ''; |
| | | } else { |
| | | currDescription = currProName.substring(0, currProName.lastIndexOf('(')); |
| | | |
| | | this.problemTypeList.forEach((item) => { |
| | | if (item.description === currDescription) { |
| | | this.proType = item.typename; |
| | | } |
| | | }); |
| | | this.deepCopyProblem.description = currDescription; |
| | | this.proRemark = currProName.substring( |
| | | currProName.lastIndexOf('(') + 1, |
| | | currProName.length - 1 |
| | | ); |
| | | } |
| | | |
| | | let beforeEditImgList = []; |
| | | let oldFiles = this.problem.mediafileList; |
| | | if (oldFiles && oldFiles.length > 0) { |
| | | this.problem.mediafileList.forEach((item) => { |
| | | if (item.ischanged == 0) { |
| | | item.url = $fysp.imgUrl + item.extension1 + item.guid + '.jpg'; |
| | | item.name = '1'; |
| | | beforeEditImgList.push(item); |
| | | } |
| | | }); |
| | | this.fileList = useCloned(beforeEditImgList).cloned.value; |
| | | this.oldFileList = useCloned(beforeEditImgList).cloned.value; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // é®é¢å»ºè®® |
| | | problemApi.getSuggestion().then((res) => { |
| | | this.suggestions = res.data; |
| | | // å¡«å
å½åé®é¢å»ºè®® |
| | | this.deepCopyProblem.advise = this.suggestions.filter( |
| | | (item) => item.adProblemtypeguid == this.deepCopyProblem.guid |
| | | )[0].adName; |
| | | }); |
| | | |
| | | // é®é¢ä½ç½® |
| | | problemApi |
| | | .getLocation({ |
| | | sceneTypeId: this.subtask.sceneTypeId |
| | | }) |
| | | .then((res) => { |
| | | this.posList = res.data; |
| | | }); |
| | | }, |
| | | beforeRemoveFile(file, fileList) { |
| | | if (file.remark == 'å·²ä¸ä¼ ') { |
| | | this.deleteImg.push(file.guid); |
| | | this.oldFileList.filter((item) => item.url != file.url); |
| | | } |
| | | }, |
| | | handleLedgerPicPhono() { |
| | | this.beforeLedgerPicDialogclose(); |
| | | 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; |
| | | } |
| | | }, |
| | | beforeLedgerPicDialogclose() { |
| | | this.ledgerPicDialog = false; |
| | | }, |
| | | findProTypeByGuid(guid) { |
| | | let result; |
| | | this.problemTypeList.forEach((item) => { |
| | | if (item.guid == guid) { |
| | | result = item; |
| | | } |
| | | }); |
| | | return result; |
| | | }, |
| | | changeProblemname() { |
| | | if (this.proRemark == null || this.proRemark == '') { |
| | | this.deepCopyProblem.problemname = this.deepCopyProblem.description; |
| | | } else { |
| | | this.deepCopyProblem.problemname = |
| | | this.deepCopyProblem.description + '(' + this.proRemark + ')'; |
| | | } |
| | | }, |
| | | onProRemarkChange(value) { |
| | | this.changeProblemname(); |
| | | }, |
| | | onProTypeChange(value) { |
| | | this.deepCopyProblem.description = ''; |
| | | this.deepCopyProblem.advise = ''; |
| | | }, |
| | | onProDesChange(value) { |
| | | let currPro = this.findProTypeByGuid(value); |
| | | this.deepCopyProblem.advise = ''; |
| | | this.currProTypeGuid = value; |
| | | this.deepCopyProblem.description = currPro.description; |
| | | this.changeProblemname(); |
| | | this.deepCopyProblem.advise = ''; |
| | | |
| | | this.deepCopyProblem.advise = this.adviseOptions[0].adName; |
| | | }, |
| | | onProLocationChange(value) { |
| | | this.posList.forEach((item) => { |
| | | if (item.index == value) { |
| | | this.deepCopyProblem.location = item.text; |
| | | } |
| | | }); |
| | | }, |
| | | pictureValidate() { |
| | | if (this.fileList.length < 1) { |
| | | ElMessage({ |
| | | message: 'è³å°ä¸ä¼ ä¸å¼ å¾ç', |
| | | type: 'error' |
| | | }); |
| | | return false; |
| | | } else if (this.fileList.length > 3) { |
| | | ElMessage({ |
| | | message: 'è¶
è¿ä¸å¼ , å·²å é¤å¤åºçå¾ç', |
| | | type: 'error' |
| | | }); |
| | | this.fileList = this.fileList.slice(0, 3); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | // TODO |
| | | validateForm() {}, |
| | | onSubmit() { |
| | | this.validateForm(); |
| | | // å¾çæ ¡éª |
| | | if (!this.pictureValidate()) { |
| | | return; |
| | | } |
| | | // æ°æ®åå¤ |
| | | let deepCopyPro = useCloned(this.deepCopyProblem).cloned.value; |
| | | let data = new FormData(); |
| | | var picUrls = []; |
| | | this.fileList.forEach((item) => { |
| | | if (!('guid' in item)) { |
| | | // æ°ç |
| | | let exclude = false; |
| | | for (let index = 0; index < this.oldFileList.length; index++) { |
| | | const element = this.oldFileList[index]; |
| | | if (item.url == element.url) { |
| | | exclude = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!exclude) { |
| | | picUrls.push(item.url); |
| | | } |
| | | exclude = false; |
| | | // picUrls.push(item) |
| | | } else { |
| | | } |
| | | }); |
| | | if (this.type == 1) { |
| | | let deleteImgCopy = this.deleteImg; |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | data.append('deleteImg', deleteImgCopy); |
| | | delete deepCopyPro['mediafileList']; |
| | | delete deepCopyPro['description']; |
| | | data.append('problem', JSON.stringify(deepCopyPro)); |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | problemApi.updateProblem(data).then((res) => {}); |
| | | }); |
| | | } else { |
| | | const deepCopySubTask = useCloned(this.subtask).cloned.value; |
| | | const that = this; |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | console.log('deepCopySubTask', deepCopySubTask); |
| | | deepCopyPro.insGuid = deepCopySubTask.insGuid; |
| | | delete deepCopyPro['advise']; |
| | | delete deepCopyPro['description']; |
| | | deepCopyPro.proName = deepCopyPro.problemname; |
| | | delete deepCopyPro['problemname']; |
| | | deepCopyPro.ptGuid = that.findProTypeByGuid(that.currProTypeGuid).guid; |
| | | deepCopyPro.locationId = deepCopyPro.locationid; |
| | | delete deepCopyPro['locationid']; |
| | | data.append('problemVo', JSON.stringify(deepCopyPro)); |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | problemApi.newProblem(data).then((res) => {}); |
| | | }); |
| | | } |
| | | this.$emit('submited', true); |
| | | }, |
| | | handleSelectedAnyPhono(data) { |
| | | this.beforeAnyPhotoDialogclose(); |
| | | 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; |
| | | } |
| | | }, |
| | | handleSelectedDevicePhono(data) { |
| | | this.beforeDeiveceImgDialogclose(); |
| | | let isExist = false; |
| | | for (const item of data) { |
| | | for (const already of this.fileList) { |
| | | if (item._picUrl == already.url) { |
| | | isExist = true; |
| | | } |
| | | } |
| | | if (!isExist) { |
| | | this.fileList.push({ |
| | | url: item._picUrl, |
| | | name: '1' |
| | | }); |
| | | } |
| | | 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; |
| | | }, |
| | | chosePicFromDevicePic() { |
| | | this.deiveceImgDialog = true; |
| | | }, |
| | | chosePicFromLedgerPic() { |
| | | // 使ç¨Dateå¯¹è±¡è§£ææ¥æå符串 |
| | | var date = new Date(this.subtask.subtask.planstarttime); |
| | | // è·åæä»½ä¿¡æ¯ï¼æä»½æ¯ä»0å¼å§çï¼æä»¥éè¦å 1 |
| | | this.month = date.getMonth() + 1; |
| | | if (String(this.month).length == 1) { |
| | | this.month = `0${this.month}`; |
| | | } |
| | | var year = date.getFullYear(); |
| | | this.month = `${year}-${this.month}`; |
| | | this.ledgerPicDialog = true; |
| | | }, |
| | | // ä»æä»¶å¤¹ä¸ |
| | | choseChangePic() { |
| | | // è·åæå®IDçå
ç´ |
| | | var btnElement = document.getElementById('uploadBtnId'); |
| | | // æ£æ¥å
ç´ æ¯å¦åå¨ |
| | | if (btnElement) { |
| | | // 触åç¹å»äºä»¶ |
| | | btnElement.click(); |
| | | } |
| | | }, |
| | | beforeAnyPhotoDialogclose() { |
| | | this.anyPhotoDialog = false; |
| | | }, |
| | | beforeLedgerPicDialogclose() { |
| | | this.ledgerPicDialog = false; |
| | | }, |
| | | |
| | | destoryMyself() { |
| | | this.$destroy(); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .main-container { |
| | | padding: 3px; |
| | | } |
| | | .t-card_item { |
| | | display: flex; |
| | | } |
| | | |
| | | .w-msg-img { |
| | | position: absolute; |
| | | width: 25rem; |
| | | height: 27rem; |
| | | } |
| | | |
| | | .img-upload { |
| | | margin-top: 30px; |
| | | margin-bottom: 30px; |
| | | margin-left: 63px; |
| | | } |
| | | .row { |
| | | width: 100%; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | width: 95%; |
| | | } |
| | | ::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail { |
| | | object-fit: cover !important; |
| | | } |
| | | .preview-pic { |
| | | object-fit: cover; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
| | |
| | | <el-row v-if="true" style="margin-top: 16px"> |
| | | <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="success" size="small" @click="updatePro" plain>é®é¢æ´æ£</el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | @click="updateChange" |
| | | plain |
| | | :disabled="!proStatus.changeable" |
| | | >ä¿®æ¹æ´æ¹</el-button |
| | | >æ´æ¹æ£éª</el-button |
| | | > |
| | | <el-button type="info" size="small" @click="currProRecent" plain>é®é¢å¤ç°</el-button> |
| | | </el-row> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </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" |
| | | /> |
| | | </el-dialog> |
| | | <el-dialog |
| | | width="80%" |
| | | title="æ´æ¹æ£éª" |
| | | v-model="changeEditDialogVisible" |
| | | :before-close="changeEditDialogClose" |
| | | > |
| | | <ComChangeEdit |
| | | v-if="changeEditDialogVisible" |
| | | :problemId="problem.guid" |
| | | :oldChangeFileList="problem.mediafileList" |
| | | :subtask="subtask" |
| | | :month="month" |
| | | @submited="onChangeSubmited" |
| | | /> |
| | | </el-dialog> |
| | | <!-- é®é¢å¤ç° --> |
| | | <el-dialog |
| | | width="80%" |
| | | title="é®é¢å¤ç°" |
| | | v-model="proRecentDialogVisible" |
| | | :before-close="proRecentDialogClose" |
| | | > |
| | | <CompProRecent |
| | | v-if="proRecentDialogVisible" |
| | | :subtask="subtask" |
| | | :topTask="topTask" |
| | | :problem="problem"/> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProCheckProxy from '../ProCheckProxy' |
| | | import problemApi from '@/api/fysp/problemApi' |
| | | import { useMessageBoxTip } from '@/composables/messageBox' |
| | | |
| | | import ProCheckProxy from '../ProCheckProxy'; |
| | | import problemApi from '@/api/fysp/problemApi'; |
| | | import { useMessageBoxTip } from '@/composables/messageBox'; |
| | | import CompProblemAddOrUpd from './CompProblemAddOrUpd.vue'; |
| | | import ComChangeEdit from './ComChangeEdit.vue'; |
| | | import CompProRecent from './CompProRecent.vue'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | export default { |
| | | components: { |
| | | CompProblemAddOrUpd, |
| | | ComChangeEdit, |
| | | CompProRecent |
| | | }, |
| | | props: { |
| | | // åªè¯»é项 |
| | | readonly: { |
| | | type: Boolean, |
| | | default: () => { |
| | | return false; |
| | | } |
| | | }, |
| | | topTask: { |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | subtask: { |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | insGuid: { |
| | | type: String, |
| | | default: () => '' |
| | | }, |
| | | problem: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | return {}; |
| | | } |
| | | }, |
| | | index: { |
| | |
| | | default: 1 |
| | | } |
| | | }, |
| | | emits:['submit'], |
| | | emits: ['submit'], |
| | | data() { |
| | | return { |
| | | // è¿ææ
åµ |
| | | proRecentDialogVisible: false, |
| | | month: -1, |
| | | deepCopyPro: {}, |
| | | deepCopySubtask: {}, |
| | | deepCopyTopTask: {}, |
| | | proAddOrUpdDialogVisible: false, |
| | | changeEditDialogVisible: false, |
| | | // å®¡æ ¸æ¥éª¤ |
| | | steps: [ |
| | | { |
| | |
| | | aft: 'æ´æ¹å·²å®¡æ ¸' |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | mounted() { |
| | | console.log(this.topTask); |
| | | |
| | | }, |
| | | computed: { |
| | | // é®é¢åç§° |
| | | title() { |
| | | return this.problem.problemname |
| | | return this.problem.problemname; |
| | | }, |
| | | // é®é¢æè¿° |
| | | descriptions() { |
| | |
| | | name: 'æäº¤æ¶é´', |
| | | value: this.problem.time.replace('T', ' ').split('.')[0] |
| | | } |
| | | ] |
| | | ]; |
| | | }, |
| | | // é®é¢å¾ç |
| | | pics() { |
| | | return ProCheckProxy.proPics(this.problem) |
| | | return ProCheckProxy.proPics(this.problem); |
| | | }, |
| | | /** |
| | | * è·åå½åé®é¢å®¡æ ¸æ¥éª¤ |
| | |
| | | getSteps() { |
| | | return this.steps.map((v, i) => { |
| | | if (i >= this.proStatus.index) { |
| | | return v.bef |
| | | return v.bef; |
| | | } else { |
| | | return v.aft |
| | | return v.aft; |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | // é®é¢ç¶æ |
| | | proStatus() { |
| | | return ProCheckProxy.proStatusMap(this.problem.extension3) |
| | | return ProCheckProxy.proStatusMap(this.problem.extension3); |
| | | } |
| | | }, |
| | | methods: { |
| | | // è¿ææ
åµå¼¹çªå
³é |
| | | proRecentDialogClose() { |
| | | this.proRecentDialogVisible = false; |
| | | }, |
| | | newProblem() { |
| | | this.proAddOrUpdDialogVisible = true; |
| | | }, |
| | | onProSubmited(isOk) { |
| | | this.$emit('updated', isOk); |
| | | this.proAddOrUpdDialogVisible = false; |
| | | }, |
| | | onChangeSubmited(isOk) { |
| | | console.log("zhenggaisubmit"); |
| | | |
| | | this.$emit('updated', isOk); |
| | | this.changeEditDialogVisible = false; |
| | | }, |
| | | proAddOrUpdDialogClose() { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | }, |
| | | changeEditDialogClose() { |
| | | this.changeEditDialogVisible = false; |
| | | }, |
| | | deletePro() {}, |
| | | rejectPro() { |
| | | this.checkPro(false) |
| | | this.checkPro(false); |
| | | }, |
| | | passPro() { |
| | | this.checkPro(true) |
| | | this.checkPro(true); |
| | | }, |
| | | checkPro(pass) { |
| | | const pro = this.problem |
| | | let doneMsg = pass ? 'éè¿' : '驳å' |
| | | const pro = this.problem; |
| | | let doneMsg = pass ? 'éè¿' : '驳å'; |
| | | useMessageBoxTip({ |
| | | confirmMsg: `确认æ¯å¦${doneMsg}该é®é¢ï¼`, |
| | | confirmTitle: 'é®é¢å®¡æ ¸', |
| | | onConfirm: () => { |
| | | const { status, action } = ProCheckProxy.proNextStatus(pro.extension3, pass) |
| | | const { status, action } = ProCheckProxy.proNextStatus(pro.extension3, pass); |
| | | return problemApi.checkProblem({ pId: pro.guid, action: action }).then((res) => { |
| | | if (res.success) { |
| | | pro.extension3 = status |
| | | this.$emit('submit') |
| | | pro.extension3 = status; |
| | | this.$emit('submit'); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | updatePro() {}, |
| | | updateChange() {} |
| | | 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; |
| | | this.$nextTick(() => { |
| | | this.proAddOrUpdDialogVisible = true; |
| | | }); |
| | | }, |
| | | updateChange() { |
| | | // 使ç¨Dateå¯¹è±¡è§£ææ¥æå符串 |
| | | var date = new Date(this.subtask.subtask.planstarttime); |
| | | // è·åæä»½ä¿¡æ¯ï¼æä»½æ¯ä»0å¼å§çï¼æä»¥éè¦å 1 |
| | | this.month = date.getMonth() + 1; |
| | | if (String(this.month).length == 1) { |
| | | this.month = `0${this.month}`; |
| | | } |
| | | // è·å年份 |
| | | var year = date.getFullYear(); |
| | | this.month = `${year}-${this.month}`; |
| | | this.changeEditDialogVisible = true; |
| | | }, |
| | | currProRecent() { |
| | | this.proRecentDialogVisible = true; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .layout { |