From 575a75a0519e53ceec6bb5d31f682124596c3bae Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期二, 24 十月 2023 10:57:34 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop --- src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue | 6 src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue | 7 src/views/system/WorkshopSignageManagement.vue | 501 ++++++++ src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue | 6 src/views/system/modules/UserModal.vue | 6 src/api/mdc.js | 33 src/views/dashboard/Analysis.vue | 64 src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue | 4 src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue | 6 src/views/mdc/base/modules/equipmentAvailCompare/equipmentAvailCompareMain.vue | 4 src/config/router.config.js | 5 src/views/mdc/base/modules/deviceLog/LogInfo.vue | 115 +- src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue | 411 +++--- src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue | 4 src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue | 4 src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue | 5 src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue | 1 src/views/mdc/base/modules/deviceCalendar/DeviceCalendarList.vue | 4 src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 6 src/views/mdc/base/modules/shift/ShiftInfoModel.vue | 123 +- src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue | 4 src/views/mdc/base/modules/deviceLog/LogList.vue | 21 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue | 5 src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue | 4 src/views/system/modules/SelectDeviceModal.vue | 256 ++++ /dev/null | 180 --- src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue | 4 src/views/WorkshopSignage.vue | 369 ++++++ src/main.js | 3 src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue | 4 package.json | 1 src/views/mdc/base/modules/deviceLog/WorkChartModel.vue | 796 +++++++------ src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue | 233 ++- src/views/system/modules/WorkshopModal.vue | 134 ++ 34 files changed, 2,310 insertions(+), 1,019 deletions(-) diff --git a/package.json b/package.json index b84ea07..de242b3 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "vue-area-linkage": "^5.1.0", "vue-calendar-component": "^2.8.2", "vue-cropper": "^0.5.4", + "vue-drag-resize": "^1.5.4", "vue-i18n": "^8.7.0", "vue-loader": "^15.7.0", "vue-ls": "^3.2.0", diff --git a/src/api/mdc.js b/src/api/mdc.js index 716a1d1..2e30100 100644 --- a/src/api/mdc.js +++ b/src/api/mdc.js @@ -1,7 +1,34 @@ import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' export default { -// -------------------------------------椹卞姩鍙傛暟绠$悊椤甸潰---------------------------------------- -// 鑾峰彇鎺у埗绯荤粺绫诲瀷 - getDriveTypeApi:()=>getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions') + // -------------------------------------椹卞姩鍙傛暟绠$悊椤甸潰---------------------------------------- + // 鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeApi: () => getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions'), + // -------------------------------------杞﹂棿鐪嬫澘椤甸潰---------------------------------------- + // 棣栭〉鑾峰彇澶у睆鍏ュ彛杞﹂棿鍒楄〃 + getWorkshopListInHomePageApi: () => getAction('/mdc/mdcWorkshopInfo/getWorkshopList'), + // 鏍规嵁杞﹂棿id鏌ヨ璁惧鍒楄〃 + getDeviceListByWorkshopIdApi: params => getAction('/mdc/mdcWorkshopInfo/workshopEquipmentList', params), + // 鏍规嵁杞﹂棿id鏌ヨ杞﹂棿璇︾粏淇℃伅 + getWorkshopDetailByWorkshopIdApi: id => getAction('/mdc/mdcWorkshopInfo/queryById', { id }), + // 鏍规嵁杞﹂棿id鏌ヨ澶у睆淇℃伅 + getDeviceListInWorkshopSignagePageApi: workshopId => getAction('/mdc/mdcWorkshopInfo/getBigScreenInfo', { workshopId }), + // 淇濆瓨澶у睆杞﹂棿璁惧鍧愭爣澶у皬淇℃伅 + saveDevicePositionAndSizeApi: params => putAction('/mdc/mdcWorkshopInfo/saveEquipmentCoordinate', params), + // 鏌ヨ杞﹂棿鍒楄〃 + getWorkshopListApi: params => getAction('/mdc/mdcWorkshopInfo/list', params), + // 鏂板杞﹂棿淇℃伅 + addWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/add', params), + // 缂栬緫杞﹂棿淇℃伅 + editWorkshopApi: params => putAction('/mdc/mdcWorkshopInfo/edit', params), + // 鍒犻櫎鍗曚釜杞﹂棿淇℃伅 + deleteSingleWorkshopApi: id => deleteAction('/mdc/mdcWorkshopInfo/delete', { id }), + // 鎵归噺鍒犻櫎杞﹂棿淇℃伅 + deleteBatchWorkshopApi: ids => deleteAction('/mdc/mdcWorkshopInfo/deleteBatch', { ids }), + // 鏂板澶у睆杞﹂棿鍜岃澶囧叧绯� + addDeviceInWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/addWorkshopEquipment', params), + // 鍒犻櫎鍗曚釜澶у睆杞﹂棿鍜岃澶囧叧绯� + deleteSingleDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', params), + // 鎵归噺鍒犻櫎澶у睆杞﹂棿鍜岃澶囧叧绯� + deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params) } \ No newline at end of file diff --git a/src/config/router.config.js b/src/config/router.config.js index e41fc6e..f35fe1f 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -12,7 +12,6 @@ meta: { title: '棣栭〉' }, redirect: '/dashboard/analysis', children: [ - // // dashboard // { // path: '/dashboard', @@ -373,8 +372,8 @@ ] }, { - path:'/testWorkshop', - component:()=>import('@/views/TestWorkshop.vue') + path:'/workshopSignage/:id', + component:()=>import('@/views/WorkshopSignage.vue') }, { path: '/404', diff --git a/src/main.js b/src/main.js index 1d7d559..d6820f1 100644 --- a/src/main.js +++ b/src/main.js @@ -72,6 +72,9 @@ import dataV from '@jiaminghi/data-view' Vue.use(dataV) +import VueDragResize from "vue-drag-resize" +Vue.component('vue-drag-resize', VueDragResize) + // import 'echarts-liquidfill' Vue.prototype.$echarts = echarts Vue.prototype.$qs = qs diff --git a/src/views/TestWorkshop.vue b/src/views/TestWorkshop.vue deleted file mode 100644 index 717ae32..0000000 --- a/src/views/TestWorkshop.vue +++ /dev/null @@ -1,180 +0,0 @@ -<template> - <dv-full-screen-container class="full-screen-container"> - <header class="page-header"> - 娴嬭瘯杞﹂棿 - <div class="header-right"> - <a-button type="primary" icon="save" size="large" @click="saveDevicePositionByApi">淇濆瓨浣嶇疆</a-button> - </div> - </header> - <dv-border-box-8 class="content-container"> - <div v-for="item in deviceList" :key="item.equipmentId" class="single-device" - :style="{top:item.top+'px',left:item.left+'px'}" @mousedown="handleMouseDown" :id="item.equipmentId"> - <img :src="item.equipmentImageUrl" draggable="false"> - <div draggable="false" class="device-info"> - <div v-if="item.status==0" class="status-square" style="background-color: gray"></div> - <div v-if="item.status==1" class="status-square" style="background-color: red"></div> - <div v-if="item.status==2" class="status-square" style="background-color: green"></div> - <div v-if="item.status==3" class="status-square" style="background-color: yellow"></div> - <div class="device-id">{{item.equipmentId}}</div> - </div> - </div> - </dv-border-box-8> - </dv-full-screen-container> -</template> - -<script> - export default { - data() { - return { - mouseX: 0, // 榧犳爣鍦ㄥ厓绱犲唴鐨刋鍧愭爣 - mouseY: 0, // 榧犳爣鍦ㄥ厓绱犲唴鐨刌鍧愭爣, - dragging: false, //鏄惁鍦ㄦ嫋鎷戒腑 - left: 0, // 鍏冪礌宸︿笂瑙掕窛绂荤埗瀹瑰櫒宸︿晶鐨勮窛绂� - top: 0, // 鍏冪礌宸︿笂瑙掕窛绂荤埗瀹瑰櫒椤堕儴鐨勮窛绂�, - elementId: '',// 琚嫋鎷藉厓绱犵殑id灞炴�у�� - deviceList: [ - { - equipmentId: '123213213123232', - equipmentStatus: 0, - equipmentImageUrl: require('../assets/8.png'), - top: 200, - left: 100, - status: 1 - }, - { - equipmentId: '512346789561232', - equipmentStatus: 0, - equipmentImageUrl: require('../assets/8.png'), - top: 500, - left: 753, - status: 0 - }, - { - equipmentId: '64746965647653', - equipmentStatus: 0, - equipmentImageUrl: require('../assets/8.png'), - top: 300, - left: 860, - status: 2 - }, - { - equipmentId: '33548976965462', - equipmentStatus: 0, - equipmentImageUrl: require('../assets/8.png'), - top: 100, - left: 380, - status: 3 - }, - { - equipmentId: '85484913549253', - equipmentStatus: 0, - equipmentImageUrl: require('../assets/8.png'), - top: 200, - left: 1500, - status: 2 - } - ] - } - }, - methods: { - /** - * 鎷栨嫿瀵硅薄榧犳爣鎸夐敭鎸変笅浜嬩欢 - * @param event - */ - handleMouseDown(event) { - this.dragging = true - this.mouseX = event.clientX - this.mouseY = event.clientY - this.elementId = event.currentTarget.id - this.top = event.currentTarget.offsetTop - this.left = event.currentTarget.offsetLeft - document.addEventListener('mousemove', this.handleMouseMove) - document.addEventListener('mouseup', this.handleMouseUp) - }, - /** - * 鏂囨。瀵硅薄榧犳爣绉诲姩浜嬩欢 - * @param event - */ - handleMouseMove(event) { - if (this.dragging) { - const deltaX = event.clientX - this.mouseX - const deltaY = event.clientY - this.mouseY - this.left += deltaX - this.top += deltaY - this.deviceList.forEach(item => { - if (item.equipmentId === this.elementId) { - item.top = this.top - item.left = this.left - } - }) - this.mouseX = event.clientX - this.mouseY = event.clientY - } - }, - /** - * 鏂囨。瀵硅薄榧犳爣鎸夐敭寮硅捣浜嬩欢 - * @param event - */ - handleMouseUp(event) { - this.dragging = false - document.removeEventListener('mousemove', this.handleMouseMove) - document.removeEventListener('mouseup', this.handleMouseUp) - }, - /** - * 璋冪敤鎺ュ彛淇濆瓨鎷栨嫿鍚庣殑浣嶇疆 - */ - saveDevicePositionByApi(){ - - } - }, - mounted() { - // 绂佹鐢ㄦ埛閫変腑鍐呭 - document.onselectstart = () => false - } - } -</script> - -<style scoped lang="less"> - .full-screen-container { - background-image: url('../assets/Bj.jpg'); - color: #fff; - width: 100vw; - height: 100vh; - position: relative; - .page-header { - font-size: 50px; - text-align: center; - position: relative; - .header-right{ - position: absolute; - right: 200px; - top: 0; - } - } - .content-container { - .single-device { - position: absolute; - border: 1px solid transparent; - padding: 5px; - display: flex; - flex-direction: column; - align-items: center; - &:active { - border: 1px solid #00b3ff; - } - .device-info { - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - .status-square { - width: 14px; - height: 14px; - border: 1px solid #fff; - border-radius: 2px; - } - } - } - } - } -</style> \ No newline at end of file diff --git a/src/views/WorkshopSignage.vue b/src/views/WorkshopSignage.vue new file mode 100644 index 0000000..c566a50 --- /dev/null +++ b/src/views/WorkshopSignage.vue @@ -0,0 +1,369 @@ +<template> + <dv-full-screen-container class="full-screen-container"> + <header class="page-header"> + {{ workshopDetails.workshopName }} + <div class="header-right" v-has="'home:saveDevicePositionAndSize'"> + <a-space> + <span v-if="!isSwitchChecked">寮�鍚姛鑳�</span> + <span v-else>鍏抽棴鍔熻兘</span> + <a-switch + checked-children="寮�" + un-checked-children="鍏�" + @change="handleSwitchChange" + v-model="isSwitchChecked" + :disabled="isSwitchChecked" + /> + </a-space> + <a-button type="primary" icon="save" size="large" @click="saveDevicePositionAndSizeByApi">淇濆瓨浣嶇疆 </a-button> + </div> + </header> + + <dv-border-box-8> + <div class="content-container" ref="deviceContainerRef"> + <VueDragResize + v-for="(item, index) in deviceList" + :key="item.equipmentId" + :w="item.vw" + :h="item.vh" + :x="item.coordinateLeft" + :y="item.coordinateTop" + v-on:resizing="resize($event, index)" + v-on:dragging="resize($event, index)" + :parentLimitation="true" + :minw="100" + :minh="100" + :isDraggable="isDraggable" + :isResizable="isResizable" + :stickSize="6" + > + <div class="single-device" :style="{ width: item.vw + 'px', height: item.vh + 'px' }"> + <div class="device-status"> + <div + v-if="item.equipmentStatus == 2 || item.equipmentStatus == 1" + :style="{ backgroundImage: `url(${require('@/assets/yellow.png')})` }" + class="status-image" + ></div> + <div + v-if="item.equipmentStatus == 22" + :style="{ backgroundImage: `url(${require('@/assets/red.png')})` }" + class="status-image" + ></div> + <div + v-if="item.equipmentStatus == 0" + :style="{ backgroundImage: `url(${require('@/assets/gray.png')})` }" + class="status-image" + ></div> + <div + v-if="item.equipmentStatus == 3" + :style="{ backgroundImage: `url(${require('@/assets/green.png')})` }" + class="status-image" + ></div> + <div + :style="{ backgroundImage: `url(${getImgView(item.equipmentImage) || require('@/assets/8.png')})` }" + class="device-image" + ></div> + </div> + <div class="device-id" :style="{ fontSize: item.fontSize + 'px' }"> + {{ item.equipmentId }} + </div> + </div> + </VueDragResize> + <div class="device-status-info"> + <div v-for="item in deviceStatusList" :key="item.value" class="single-status-info"> + <div>{{ item.label }}</div> + <div class="status-square" :style="{ backgroundColor: item.color }"></div> + <div>{{ getDeviceNumberByStatus(item.value) }}</div> + </div> + </div> + </div> + </dv-border-box-8> + </dv-full-screen-container> +</template> + +<script> +import VueDragResize from 'vue-drag-resize' +import api from '@/api/mdc' +import { getFileAccessHttpUrl } from '@/api/manage' + +export default { + components: { + VueDragResize, + }, + data() { + return { + workshopDetails: {}, // 杞﹂棿璇︾粏淇℃伅, + isDraggable: false, // 鏄惁寮�鍚嫋鎷� + isResizable: false, // 鏄惁寮�鍚缉鏀� + isSwitchChecked: false, // 鏄惁寮�鍚姛鑳� + timingAcquisition: null, // 瀹氭椂鍒锋柊鏄惁寮�鍚� + deviceList: [ + // { + // equipmentId: '123213213123232',// 璁惧ID + // equipmentImage: require('@/assets/8.png'), // 璁惧鍥剧墖 + // coordinateTop: 200, // 鎷栨嫿鍏冪礌璺濈洅瀛愰《璺濈 + // coordinateLeft: 100, // 鎷栨嫿鍏冪礌璺濈洅瀛愬乏渚ц窛绂� + // vw: 100, // 缂╂斁鍏冪礌瀹藉害 + // vh: 100, // 缂╂斁鍏冪礌楂樺害 + // fontSize: 12, // 缂╂斁鍏冪礌瀛椾綋澶у皬 + // equipmentStatus: 1 // 璁惧鐘舵�� 0:鍏虫満 22:鎶ヨ 2:寰呮満 3:杩愯 寮�鏈�:1锛堟病鏈夊洓鑹茬伅鏍囪瘑褰掍负寰呮満锛� + // } + ], // 璁惧淇℃伅鍒楄〃 + deviceStatusList: [ + { + label: '鍏虫満', + value: 0, + color: '#A8A8A8', + }, + { + label: '寰呮満', + value: 2, + color: '#FFFF00', + }, + { + label: '杩愯', + value: 3, + color: '#00EE00', + }, + { + label: '鎶ヨ', + value: 22, + color: '#FF0000', + }, + ], // 璁惧鐘舵�佹寚绀虹伅鍒楄〃 + } + }, + watch: { + isSwitchChecked: { + handler(newVal) { + if (!newVal) { + console.log('瀹氭椂鍣ㄥ紑鍚腑') + this.timingAcquisition = setInterval(() => { + this.getDeviceListByApi(this.$route.params.id) + }, 2000) + } else { + console.log('鍏抽棴瀹氭椂鍣�') + clearInterval(this.timingAcquisition) + this.timingAcquisition = null + } + }, + immediate: true, + }, + }, + methods: { + /** + * 閫氳繃杞﹂棿Id璋冪敤鎺ュ彛鑾峰彇璁惧淇℃伅鍒楄〃 + * @param id 杞﹂棿Id + */ + getDeviceListByApi(id) { + console.log('閲嶆柊鍒锋柊') + api.getDeviceListInWorkshopSignagePageApi(id).then((res) => { + if (res.result && res.result.length > 0) { + this.deviceList = res.result + } + }) + }, + + /** + * 閫氳繃杞﹂棿Id璋冪敤鎺ュ彛鑾峰彇杞﹂棿璇︾粏淇℃伅 + * @param id 杞﹂棿Id + */ + getWorkshopDetailsByApi(id) { + api.getWorkshopDetailByWorkshopIdApi(id).then((res) => { + this.workshopDetails = res.result + this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView( + this.workshopDetails.backgroundImage + )})` + }) + }, + + /** + * 鍥剧墖棰勮 + * @param text 鍥剧墖鍦板潃 + */ + getImgView(text) { + if (text && text.indexOf(',') > 0) { + text = text.substring(0, text.indexOf(',')) + } + return getFileAccessHttpUrl(text) + }, + + /** + * 鐐瑰嚮淇濆瓨鎸夐挳璋冪敤鎺ュ彛淇濆瓨鎷栨嫿鍚庣殑浣嶇疆涓庤澶囧浘鏍囧昂瀵� + */ + saveDevicePositionAndSizeByApi() { + console.log('瑙﹀彂淇濆瓨') + if (this.isOperatingDevice) { + api.saveDevicePositionAndSizeApi(this.deviceList).then((res) => { + if (res.code === 200) { + this.$notification.success({ + message: '娑堟伅', + description: res.message, + }) + this.isOperatingDevice = false + if (this.isSwitchChecked) { + this.isSwitchChecked = false + this.isResizable = !this.isResizable + this.isDraggable = !this.isDraggable + } + this.getDeviceListByApi(this.$route.params.id) + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: '璇峰紑鍚姛鑳藉悗鍐嶈繘琛屼繚瀛�', + }) + } + }, + + /** + * 璁惧鎷栨嫿鎴栫缉鏀炬椂瑙﹀彂浜嬩欢 + * @param newRect 鎷栨嫿鎴栫缉鏀惧悗鐨勫昂瀵稿強璺濈 + * @param index 鎷栨嫿璁惧鍦ㄦ暟缁勪腑鐨勪笅鏍� + */ + resize(newRect, index) { + // if (newRect.width > 100) { + // if (newRect.width / newRect.height < 2) { + // this.deviceList[index].fontSize = newRect.width / 10 + // } else { + // this.deviceList[index].fontSize = newRect.height / 5 + // } + // } else { + // this.deviceList[index].fontSize = 12 + // } + this.deviceList[index].vw = newRect.width + this.deviceList[index].vh = newRect.height + this.deviceList[index].coordinateTop = newRect.top + this.deviceList[index].coordinateLeft = newRect.left + }, + + /** + * 鏍规嵁璁惧鐘舵�佸�艰幏鍙栧搴旇澶囨暟閲� + * @param value 璁惧鐘舵�佸�� + * @returns {number} 璁惧鏁伴噺 + */ + getDeviceNumberByStatus(value) { + return this.deviceList.filter((item) => item.equipmentStatus === value).length + }, + + /** + * 寮�鍚姛鑳借Е鍙戜簨浠� + * @param checked 褰撳墠switch鐘舵�侊紝鏄惁寮�鍚紝鍒濆涓篺alse + */ + handleSwitchChange(checked) { + this.isOperatingDevice = true + this.isResizable = !this.isResizable + this.isDraggable = !this.isDraggable + }, + }, + created() { + if (this.$route.params.id) { + this.getDeviceListByApi(this.$route.params.id) + this.getWorkshopDetailsByApi(this.$route.params.id) + } + }, + mounted() { + // 绂佹鐢ㄦ埛閫変腑鍐呭 + document.onselectstart = () => false + }, + beforeDestroy() { + // 纭繚閿�姣佸畾鏃跺櫒鍙婂洖鏀惰祫婧� + clearInterval(this.timingAcquisition) + this.timingAcquisition = null + }, +} +</script> + +<style scoped lang="less"> +.full-screen-container { + background-image: url('../assets/Bj.jpg'); + background-size: 100% 100%; + color: #fff; + + .page-header { + height: 80px; + font-size: 50px; + text-align: center; + position: relative; + + .header-right { + width: 450px; + position: absolute; + right: 0px; + top: 35px; + display: flex; + justify-content: space-evenly; + align-items: center; + font-size: 16px; + } + } + + .content-container { + position: relative; + width: 100%; + height: 100%; + background-repeat: no-repeat; + background-size: 100% 100%; + + .device-status-info { + width: 400px; + position: absolute; + top: 5px; + right: 5px; + display: flex; + align-items: center; + justify-content: space-between; + + .single-status-info { + width: 60px; + display: flex; + align-items: center; + justify-content: space-between; + + .status-square { + width: 14px; + height: 14px; + border: 1px solid #fff; + border-radius: 2px; + } + } + } + + .single-device { + position: absolute; + border: 1px solid transparent; + padding: 10px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + cursor: default; + + &:active { + border: 1px solid #1890ff; + } + + .device-status { + width: 100%; + height: 100%; + display: flex; + justify-content: space-between; + + .status-image { + background-size: 100% 100%; + background-repeat: no-repeat; + width: 45px; + margin-right: 10px; + } + + .device-image { + background-size: 100% 100%; + background-repeat: no-repeat; + width: 100%; + height: 100%; + } + } + } + } +} +</style> \ No newline at end of file diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index 949a625..505d8a7 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -4,24 +4,27 @@ <!--<index-bdc v-if="indexStyle==2"></index-bdc>--> <!--<index-task v-if="indexStyle==3"></index-task>--> <!--<div style="width: 100%;text-align: right;margin-top: 20px">--> - <!--璇烽�夋嫨棣栭〉鏍峰紡锛�--> - <!--<!–<a-radio-group v-model="indexStyle">–>--> - <!--<!–<a-radio :value="1">缁熻鍥捐〃</a-radio>–>--> - <!--<!–<a-radio :value="2">缁熻鍥捐〃2</a-radio>–>--> - <!--<!–<a-radio :value="3">浠诲姟琛ㄦ牸</a-radio>–>--> - <!--<!–</a-radio-group>–>--> + <!--璇烽�夋嫨棣栭〉鏍峰紡锛�--> + <!--<!–<a-radio-group v-model="indexStyle">–>--> + <!--<!–<a-radio :value="1">缁熻鍥捐〃</a-radio>–>--> + <!--<!–<a-radio :value="2">缁熻鍥捐〃2</a-radio>–>--> + <!--<!–<a-radio :value="3">浠诲姟琛ㄦ牸</a-radio>–>--> + <!--<!–</a-radio-group>–>--> <!--</div>--> - <a-button type="primary" @click="navigateToTestWorkshop">璺宠浆鑷虫祴璇曡溅闂�</a-button> + <a-button type="primary" size="large" v-for="item in workshopList" :key="item.workshopId" + @click="navigateToWorkshopSignage(item.id)">{{item.workshopName}} + </a-button> </div> </template> <script> import IndexChart from './IndexChart' - import IndexTask from "./IndexTask" + import IndexTask from './IndexTask' import IndexBdc from './IndexBdc' + import api from '@/api/mdc' export default { - name: "Analysis", + name: 'Analysis', components: { IndexChart, IndexTask, @@ -29,16 +32,49 @@ }, data() { return { - indexStyle:1 + indexStyle: 1, + workshopList: [ + { + workshopName: '闀挎矙杞﹂棿', + id: '5321' + }, + { + workshopName: '澶╂触杞﹂棿', + id: '6312' + }, + { + workshopName: '姝︽眽杞﹂棿', + id: '3463' + }, + { + workshopName: '鍖椾含杞﹂棿', + id: '8421' + } + ] } }, created() { - + this.getWorkshopListByApi() }, methods: { - navigateToTestWorkshop(){ - const url=this.$router.resolve('/testWorkshop').href - window.open(url,'_blank') + /** + * 閫氳繃杞﹂棿Id璺宠浆鑷崇浉搴旇溅闂村ぇ灞忕湅鏉� + * @param id 杞﹂棿Id + */ + navigateToWorkshopSignage(id) { + const url = this.$router.resolve(`/workshopSignage/${id}`).href + window.open(url, '_blank') + }, + /** + * 鑾峰彇杞﹂棿鍒楄〃 + */ + getWorkshopListByApi() { + api.getWorkshopListInHomePageApi().then(res => { + console.log('res', res) + if (res.result && res.result.length > 0) { + this.workshopList = res.result + } + }) } } } diff --git a/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue b/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue index 45c49f0..0884a23 100644 --- a/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue +++ b/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -79,7 +79,7 @@ <holiday-management-modal ref="modalForm" @ok="modalFormOk"></holiday-management-modal> <holiday-management-modal-edit ref="modalFormedit" @ok="modalFormOk"></holiday-management-modal-edit> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue index df8712a..e7b5e18 100644 --- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue +++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -83,8 +83,7 @@ <!--<device-repair-model-add ref="modalFormadd" @ok="modalFormOk"></device-repair-model-add>--> <!--<device-repair-model-edit ref="modalFormedit" @ok="modalFormOk"></device-repair-model-edit>--> <!--<repair-model ref="repairModelFrom" @ok="modalFormOk"></repair-model>--> - - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue index 64d02ca..973e4df 100644 --- a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue +++ b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue @@ -384,7 +384,6 @@ name: '杩愯鏁堢巼', type: 'pie', radius: '70%', - center: ['55%', '55%'], itemStyle: { normal: { color: function (params) { diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue index aff3728..1d0f25a 100644 --- a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -83,7 +83,7 @@ <!--<device-repair-model-edit ref="modalFormedit" @ok="modalFormOk"></device-repair-model-edit>--> <!--<repair-model ref="repairModelFrom" @ok="modalFormOk"></repair-model>--> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue b/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue index a7ca61e..8a41d3a 100644 --- a/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue +++ b/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -81,7 +81,7 @@ <plan-downtime-maintenance-modal ref="modalForm" @ok="modalFormOk"></plan-downtime-maintenance-modal> <plan-downtime-maintenance-modal-edit ref="modalFormedit" @ok="modalFormOk"></plan-downtime-maintenance-modal-edit> - </a-card> + </div> </template> <script> @@ -572,7 +572,7 @@ //閲嶆柊璁$畻鍒嗛〉闂 that.reCalculatePage(that.selectedRowKeys.length) // that.$message.success(res.message); - that.$notification.warning({ + that.$notification.success({ message:'娑堟伅', description:res.message }); diff --git a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue index ec4ca0b..e923eb5 100644 --- a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue +++ b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue @@ -1,13 +1,14 @@ <template> <div class="efficiency_list" style="width: 100%;height: 100%;"> - <a-card :bordered="false"> + <div :bordered="false" style="height: 100%"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :md="6" :sm="6"> <a-form-item label="鏃堕棿"> - <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates"/> + <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" + v-model="dates"/> </a-form-item> </a-col> <a-col :lg="2" :md="3" :sm="3" :xs="3"> @@ -20,26 +21,34 @@ <div class="openRateTrendDg"> <div id="Efficiency" class="container" style="margin-top: 20px;"> <div class="table2"> - <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" style="white-space: nowrap;text-align: left;"> + <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" + style="white-space: nowrap;text-align: left;"> <thead> <tr class="thead fixed equipname"> - <th class="thgu dong1 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;">鎶ヨ鍙�</th> - <th class="thgu dong2 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;">鍑虹幇娆℃暟</th> - <th class="thgu dong3 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;">鍚堣鎸佺画鏃堕棿锛堢锛�</th> - <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">鎶ヨ淇℃伅</th> + <th class="thgu dong1 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;">鎶ヨ鍙� + </th> + <th class="thgu dong2 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;"> + 鍑虹幇娆℃暟 + </th> + <th class="thgu dong3 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;"> + 鍚堣鎸佺画鏃堕棿锛堢锛� + </th> + <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;"> + 鎶ヨ淇℃伅 + </th> <!--<template v-for="(tableHead, index) in tableHeads">--> - <!--<th class="timeth" :colspan="checkedList.length">{{tableHead}}</th>--> + <!--<th class="timeth" :colspan="checkedList.length">{{tableHead}}</th>--> <!--</template>--> </tr> </thead> <tbody> <tr class="mathData" v-for="(item, index) in dataList" @click="TableDraw(index,item)"> - <td class="tdgu kaitou">{{item.alarmCode}}</td> - <td class="tdgu1 kaitou">{{item.count}}</td> - <td class="tdgu2 kaitou">{{item.timeCount}}</td> - <td class="tdgu3 kaitou">{{item.alarmContent}}</td> + <td class="tdgu kaitou">{{item.alarmCode}}</td> + <td class="tdgu1 kaitou">{{item.count}}</td> + <td class="tdgu2 kaitou">{{item.timeCount}}</td> + <td class="tdgu3 kaitou">{{item.alarmContent}}</td> <!--<template v-for="(tableHead, index) in item.dataList">--> - <!--<td :style="{background:tableHead.color }">{{tableHead.utilizationRate | numFilter}}</td>--> + <!--<td :style="{background:tableHead.color }">{{tableHead.utilizationRate | numFilter}}</td>--> <!--</template>--> </tr> </tbody> @@ -52,7 +61,7 @@ <div id="MdcEquipmentWarningLine" style="height: 100%;width: 65%;"></div> </div> </div> - </a-card> + </div> </div> </template> @@ -65,6 +74,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' + export default { // mixins: [JeecgListMixin], name: 'alarmAnalysisMain', @@ -74,7 +84,7 @@ dataSource: [], /* table鍔犺浇鐘舵�� */ loading: false, - typeTree: "", + typeTree: '', typeParent: 1, typeEquipment: 1, TreeIDOne: 1, @@ -102,9 +112,9 @@ alarmTrend: '/mdc/alarmAnalyze/alarmTrend' }, tableHeads: [], - pieDate:[0], - XData:[0], - YData:[0], + pieDate: [0], + XData: [0], + YData: [0] } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -115,16 +125,16 @@ this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - this.queryParam.typeTree = "1" + this.queryParam.typeTree = '1' this.loadData1() }, - mounted(){ + mounted() { this.drawWrin() }, watch: { Type(valmath) { - this.dataList = []; + this.dataList = [] this.queryParam.typeTree = valmath }, nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 @@ -163,14 +173,14 @@ } }, methods: { - numBerTwo(value){ + numBerTwo(value) { if (value) { return parseFloat((value * 100).toFixed(2)) } else { return '0' } }, - TableDraw(key,val) { + TableDraw(key, val) { let that = this that.queryParam.alarmCode = val.alarmCode console.log(this.queryParam) @@ -179,10 +189,13 @@ that.YData = [] getAction(that.url.alarmTrend, that.queryParam).then(res => { if (res.success) { - for (var i = 0;i<res.result.equipmentCountList.length;i++){ - that.pieDate.push({name:res.result.equipmentCountList[i].key,value:res.result.equipmentCountList[i].count}) + for (var i = 0; i < res.result.equipmentCountList.length; i++) { + that.pieDate.push({ + name: res.result.equipmentCountList[i].key, + value: res.result.equipmentCountList[i].count + }) } - for (var j = 0;j<res.result.dateCountList.length;j++){ + for (var j = 0; j < res.result.dateCountList.length; j++) { that.XData.push(res.result.dateCountList[j].key) that.YData.push(res.result.dateCountList[j].count) } @@ -202,7 +215,7 @@ }, disabledDate(current) { //Can not slect days before today and today - return current && current > moment().subtract('days', 1); + return current && current > moment().subtract('days', 1) }, initDeviceType(deviceList) { let dictCode = 'mdc_equipmentType' @@ -236,19 +249,19 @@ this.queryParam.endDate = v2[1] }, searchQuery() { - if (this.dates&&this.dates.length>0){ - if (this.queryParam.typeTree == "1") { + if (this.dates && this.dates.length > 0) { + if (this.queryParam.typeTree == '1') { this.queryParam.parentId = this.queryParamEquip.parentId this.queryParam.equipmentId = this.queryParamEquip.equipmentId } else { this.queryParam.parentId = this.queryParamPeople.parentId - this.queryParam.equipmentId = "" + this.queryParam.equipmentId = '' } this.loadData1() - } else{ + } else { this.$notification.warning({ - message:'鎻愮ず', - description:'璇烽�夋嫨鏃堕棿' + message: '鎻愮ず', + description: '璇烽�夋嫨鏃堕棿' }) } @@ -340,8 +353,8 @@ } }) }, - drawWrin(){ - let equipmentWarningPie = this.$echarts.init(document.getElementById('MdcEquipmentWarningPie'), 'macarons'); + drawWrin() { + let equipmentWarningPie = this.$echarts.init(document.getElementById('MdcEquipmentWarningPie'), 'macarons') let equipmentWarningPieOption = { title: { text: '鍚勮澶囧嚭鐜版鎶ヨ鐨勬瘮渚�', @@ -350,13 +363,12 @@ }, tooltip: { trigger: 'item', - formatter: "<br/>{b} : {c} ({d}%)" + formatter: '<br/>{b} : {c} ({d}%)' }, calculable: true, series: [{ type: 'pie', radius: '60%', - center: ['55%', '55%'], itemStyle: { normal: { /*color: function (params) { @@ -370,27 +382,27 @@ } } }, - data:this.pieDate + data: this.pieDate // data:[{name:'jjjjjjj',value:'2'}] }] - }; - equipmentWarningPie.setOption(equipmentWarningPieOption,true); - let equipmentWarningLine = this.$echarts.init(document.getElementById('MdcEquipmentWarningLine'), 'macarons'); + } + equipmentWarningPie.setOption(equipmentWarningPieOption, true) + let equipmentWarningLine = this.$echarts.init(document.getElementById('MdcEquipmentWarningLine'), 'macarons') let equipmentWarningLineOption = { - title : { + title: { text: '姣忓ぉ鍑虹幇姝ゆ姤璀︾殑鏁伴噺璧板娍', x: 'center', y: 'bottom' }, - tooltip:{ - trigger: 'item' + tooltip: { + trigger: 'axis' }, calculable: true, xAxis: [ { type: 'category', show: true, - data:this.XData + data: this.XData /*axisLabel :{ interval:0 }*/ @@ -407,16 +419,16 @@ name: '鎶ヨ鏁伴噺', type: 'line', data: this.YData, - markPoint : { - data : [ - {type : 'max', name: '鏈�澶у��'}, - {type : 'min', name: '鏈�灏忓��'} + markPoint: { + data: [ + { type: 'max', name: '鏈�澶у��' }, + { type: 'min', name: '鏈�灏忓��' } ] } } ] - }; - equipmentWarningLine.setOption(equipmentWarningLineOption,true); + } + equipmentWarningLine.setOption(equipmentWarningLineOption, true) } } } @@ -456,28 +468,31 @@ .dataContent tr td { height: 35px; } - .dataContent .mathData:hover td{ + + .dataContent .mathData:hover td { background-color: #e6f7ff; } + .dataContent .mathData td { padding: 10px; /*display: none;*/ } - .dataContent .mathData .td { + .dataContent .mathData td { /*background-color: #ff9bd2;*/ - display: inline-block; - padding: 10px; + cursor: pointer; } .dataContent .mathData .tdd { /*display: none;*/ } - .table2{ + + .table2 { width: 100%; height: 100%; overflow: auto; } + /*tr th {*/ /*height: 50px!important;*/ /*}*/ @@ -485,126 +500,150 @@ /*height: 50px!important;*/ /*}*/ .table2 thead tr th:first-child, - .table tbody tr .tdgu{ + .table tbody tr .tdgu { position: sticky; left: 0; z-index: 1; } - .table tbody tr .kaitou{ + + .table tbody tr .kaitou { z-index: 1; background-color: white; } - .table tbody tr .tdgu1{ + + .table tbody tr .tdgu1 { position: sticky; left: 150px; z-index: 2; } - .table tbody tr .tdgu2{ + + .table tbody tr .tdgu2 { position: sticky; left: 300px; z-index: 2; } - .table tbody tr .tdgu3{ + + .table tbody tr .tdgu3 { position: sticky; left: 450px; z-index: 2; } - .table tbody tr .tdgu4{ + + .table tbody tr .tdgu4 { position: sticky; left: 550px; z-index: 2; } - .table tbody tr .tdgu5{ + + .table tbody tr .tdgu5 { position: sticky; left: 700px; z-index: 2; } + .table2 thead tr .timeth, - .table2 thead tr .thgu { + .table2 thead tr .thgu { position: sticky; - top:0; + top: 0; z-index: 3; } - .table2 thead .gudingth th{ + + .table2 thead .gudingth th { position: sticky; top: 32px; - z-index: 6!important; + z-index: 6 !important; } - .table2 thead .equipname .name{ + + .table2 thead .equipname .name { z-index: 3; } - .table2 thead .equipname .dong1{ + + .table2 thead .equipname .dong1 { z-index: 4; left: 0; /*border: 1px solid #000;*/ } - .table2 thead .equipname .dong2{ + + .table2 thead .equipname .dong2 { z-index: 5; left: 150px; } - .table2 thead .equipname .dong3{ + + .table2 thead .equipname .dong3 { z-index: 5; left: 300px; } - .table2 thead .equipname .dong4{ + + .table2 thead .equipname .dong4 { z-index: 5; left: 450px; } - .table2 thead .equipname .dong5{ + + .table2 thead .equipname .dong5 { z-index: 5; left: 550px; } - .table2 thead .equipname .dong6{ + + .table2 thead .equipname .dong6 { z-index: 5; left: 700px; } - @media screen and (min-width: 1920px){ - #Efficiency{ - height: 337px!important; + @media screen and (min-width: 1920px) { + #Efficiency { + height: 337px !important; overflow: scroll; } } - @media screen and (min-width: 1680px) and (max-width: 1920px){ - #Efficiency{ - height: 337px!important; + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + #Efficiency { + height: 337px !important; overflow: scroll; } } - @media screen and (min-width: 1400px) and (max-width: 1680px){ - #Efficiency{ - height: 190px!important; + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + #Efficiency { + height: 190px !important; overflow: scroll; } } - @media screen and (min-width: 1280px) and (max-width: 1400px){ - #Efficiency{ - height: 90px!important; + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + #Efficiency { + height: 90px !important; overflow: scroll; } } - @media screen and (max-width: 1280px){ - #Efficiency{ - height: 90px!important; + + @media screen and (max-width: 1280px) { + #Efficiency { + height: 90px !important; overflow: scroll; } } - #Efficiency .table_guding1{ + + #Efficiency .table_guding1 { position: absolute; overflow: hidden; width: 500px; } - #Efficiency .table_guding2{ + + #Efficiency .table_guding2 { overflow-x: scroll; width: 500px; } - /deep/ .ant-card{ - height: 100%!important; + + /deep/ .ant-card { + height: 100% !important; } - /deep/ .ant-card .ant-card-body{ - height: 100%!important; + + /deep/ .ant-card .ant-card-body { + height: 100% !important; } - .efficiency_list #DeviceList{ - height: 90%!important; + + .efficiency_list #DeviceList { + height: 90% !important; } </style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue index 8142dcc..9f19ba1 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <div class="com_box"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> @@ -53,7 +53,7 @@ </div> <!-- table鍖哄煙-end --> </div> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarList.vue b/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarList.vue index 47997ea..b653554 100644 --- a/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarList.vue +++ b/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarList.vue @@ -1,6 +1,6 @@ <template> <div class="deviceCalendar_list"> - <a-card :bordered="false"> + <div :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <div> @@ -47,7 +47,7 @@ </a-table> </div> <device-calendar-model ref="modalForm" @ok="modalFormOk"></device-calendar-model> - </a-card> + </div> </div> </template> diff --git a/src/views/mdc/base/modules/deviceLog/LogInfo.vue b/src/views/mdc/base/modules/deviceLog/LogInfo.vue index 3bdc973..b3140ad 100644 --- a/src/views/mdc/base/modules/deviceLog/LogInfo.vue +++ b/src/views/mdc/base/modules/deviceLog/LogInfo.vue @@ -16,7 +16,8 @@ </a-col> <a-col :md="6" :sm="6"> <a-form-item label="鏃ユ湡"> - <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange" format='YYYY-MM-DD'/> + <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange" + format='YYYY-MM-DD'/> </a-form-item> </a-col> <a-col :md="3" :sm="3"> @@ -60,9 +61,9 @@ <span v-if="item.status == 23" :style='{display: "inline-block",width:item.dateProportion, height: "100%", background: "#19FE01",position:"absolute",bottom:"0"}'></span> </div> - <div v-if="item.status == 22" style="z-index: 999;" - :style='{display: "inline-block",left:item.left,width:item.dateProportion, height: "100%",position:"absolute"}' - v-for="item in waring"> + <div v-if="item.status == 22" style="z-index: 999;" + :style='{display: "inline-block",left:item.left,width:item.dateProportion, height: "100%",position:"absolute"}' + v-for="item in waring"> <span :style='{display: "inline-block",width:"100%", left:0, height: "68%", background: "#FD0008",position:"absolute",bottom:"0"}'></span> </div> @@ -150,7 +151,8 @@ </a-tabs> </div> </div> - <work-chart-model ref="workChartModel"></work-chart-model> + <work-chart-model ref="workChartModel" :collectTime="this.queryParams.collectTime" + :equipment="this.equipment"></work-chart-model> <work-history-model ref="workHistoryModel"></work-history-model> </div> </template> @@ -176,17 +178,17 @@ props: { equement: {} }, data() { return { - readOnly:true, + readOnly: true, defaultId: '', defaultName: '', middleTime: '', - queryParam:{}, + queryParam: {}, queryParams: { - collectTime:undefined, + collectTime: undefined }, - loadingstayus:false, - loadingrunStatus:false, - loadingwarnStatus:false, + loadingstayus: false, + loadingrunStatus: false, + loadingwarnStatus: false, normal: [], waring: [], normalList: [], @@ -200,7 +202,7 @@ getEquipmentByPid: '/mdc/mdcEquipment/getEquipmentByPid', list: '/mdc/mdcEquipmentRunningSection/logList' }, - ProStartId:'' + ProStartId: '' } }, methods: { @@ -223,27 +225,27 @@ tabChange(val) { this.activeKey = val }, - disabledDate(current){ + disabledDate(current) { //Can not slect days before today and today - return current && current > moment().subtract('days', 0); + return current && current > moment().subtract('days', 0) }, queryChart() { // this.normal = [] // this.waring = [] - this.loadingstayus = true; - this.loadingrunStatus = true; + this.loadingstayus = true + this.loadingrunStatus = true this.loadingwarnStatus = true getAction(this.url.list, this.queryParams).then((res) => { this.normalList = [] this.waringList = [] this.runList = [] - this.loadingstayus = false; - this.loadingrunStatus = false; + this.loadingstayus = false + this.loadingrunStatus = false this.loadingwarnStatus = false this.normal = [] this.waring = [] if (res.success) { - if(res.result != null){ + if (res.result != null) { for (let i = 0; i < res.result.length; i++) { this.normalList.push(res.result[i]) if ('22' == res.result[i].status) { @@ -253,11 +255,11 @@ res.result[i].left = leftTmp / 86400 * 100 + '%' this.waring.push(res.result[i]) - }else if('3' == res.result[i].status){ + } else if ('3' == res.result[i].status) { this.runList.push(res.result[i]) res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%' this.normal.push(res.result[i]) - }else{ + } else { res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%' this.normal.push(res.result[i]) // console.log(this.normal) @@ -324,23 +326,23 @@ }, searchQuery() { // console.log(this.queryParams.collectTime) - if(this.queryParams.collectTime != undefined){ + if (this.queryParams.collectTime != undefined) { this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD') - if(!this.queryParams.equipmentId||!this.queryParams.equipmentName){ + if (!this.queryParams.equipmentId || !this.queryParams.equipmentName) { this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨璁惧" - }); + message: '娑堟伅', + description: '璇烽�夋嫨璁惧' + }) return false } this.queryChart() - }else{ + } else { // this.$message.warning("璇烽�夋嫨鏃堕棿") console.log('瑙﹀彂鎻愮ず') this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨鏃堕棿" - }); + message: '娑堟伅', + description: '璇烽�夋嫨鏃堕棿' + }) } // this.queryList() }, @@ -354,28 +356,29 @@ // this.onClearSelected() }, openWorkChart() { - if(!this.equipment.equipmentId){ + if (!this.equipment.equipmentId) { // this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ") this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨璁惧杩涜鏌ヨ" - }); - }else{ + message: '娑堟伅', + description: '璇烽�夋嫨璁惧杩涜鏌ヨ' + }) + } else { + // 鍒ゆ柇鏄惁鐐瑰嚮璁惧鏃ュ織琛ㄦ牸琛岀殑鏁版嵁锛屾鏃朵负鐐瑰嚮琛ㄦ牸鏁版嵁涓篺alse + this.$refs.workChartModel.isClicklogListRow = false this.$refs.workChartModel.add(this.equipment) this.$refs.workChartModel.title = '宸ヤ綔鏇茬嚎' } - }, openHistoryChart() { // console.log(this.equipment); - if(!this.equipment.equipmentId){ + if (!this.equipment.equipmentId) { // this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ") this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨璁惧杩涜鏌ヨ" - }); + message: '娑堟伅', + description: '璇烽�夋嫨璁惧杩涜鏌ヨ' + }) // console.log(1111) - } else{ + } else { this.$refs.workHistoryModel.add(this.equipment) this.$refs.workHistoryModel.title = '鍘嗗彶鏃ュ織' } @@ -386,13 +389,13 @@ this.searchQuery() }, dataAfter() { - if((this.queryParams.collectTime).format('YYYY-MM-DD') == moment().format('YYYY-MM-DD')){ + if ((this.queryParams.collectTime).format('YYYY-MM-DD') == moment().format('YYYY-MM-DD')) { // this.$message.warning("璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�") this.$notification.warning({ - message:'娑堟伅', - description:'璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�' - }); - }else{ + message: '娑堟伅', + description: '璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�' + }) + } else { this.queryParams.collectTime = moment(this.queryParams.collectTime.add(1, 'd'), 'YYYY-MM-DD') this.searchQuery() } @@ -413,16 +416,16 @@ this.equipment = {} // _this.$message.warning('璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒') _this.$notification.warning({ - message:'娑堟伅', - description:'璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' - }); + message: '娑堟伅', + description: '璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' + }) } - }else{ + } else { // this.$message.warning(res.message) _this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }) @@ -431,13 +434,12 @@ created() { this.queryParams.collectTime = moment() this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD') - this.initEquipment(); + this.initEquipment() // this.queryTreeData(); }, watch: { equement(val) { console.log('閫氳繃watch瑙﹀彂') - if (val && val.equipmentId) { this.$set(this.queryParams, 'equipmentName', val.equipmentName) this.$set(this.queryParams, 'equipmentId', val.equipmentId) @@ -492,7 +494,8 @@ #mdcLogShow > div { flex: 1; } + /*.mdcLogShowOne{*/ - /*position: absolute;*/ + /*position: absolute;*/ /*}*/ </style> diff --git a/src/views/mdc/base/modules/deviceLog/LogList.vue b/src/views/mdc/base/modules/deviceLog/LogList.vue index a1a33bf..440c9af 100644 --- a/src/views/mdc/base/modules/deviceLog/LogList.vue +++ b/src/views/mdc/base/modules/deviceLog/LogList.vue @@ -3,7 +3,7 @@ <!-- table鍖哄煙-begin --> <div class="table_logList"> <a-table ref="table" bordered size="middle" :rowKey="(record,index)=>{return index}" :columns="columns" - :dataSource="dataList" :pagination="ipagination" :loading="loadingequip" @change="handleTableChange"> + :dataSource="dataList" :pagination="ipagination" :loading="loadingequip" @change="handleTableChange" :customRow="rowClick"> <template slot="status" slot-scope="status"> <div v-if="status == '3' || status == '23'" style="color: #00ee00;width: 100%; height: 100%;">杩愯</div> <div v-else-if="status == '1' || status == '2'" style="color: #ffea91;width: 100%; height: 100%;">寰呮満</div> @@ -28,6 +28,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import moment from 'moment' export default { name: 'LogList', mixins: [JeecgListMixin], @@ -154,6 +155,24 @@ this.ipagination = pagination; // this.loadData(); }, + /** + * 缁欒澶囨棩蹇楄〃鏍间腑鐨勮娣诲姞鐐瑰嚮浜嬩欢 + * @param record 鐐瑰嚮鐨勫綋鍓嶈鏁版嵁 + * @returns {{on: {click: on.click}}} 娣诲姞浜嬩欢瀵硅薄 + */ + rowClick(record){ + return { + on:{ + click:()=>{ + const timeObj={ + start:moment(record.startTime), + end:moment(record.endTime) + } + this.$bus.$emit('tableRowRecord',timeObj) + } + } + } + } }, created() { } diff --git a/src/views/mdc/base/modules/deviceLog/WorkChartModel.vue b/src/views/mdc/base/modules/deviceLog/WorkChartModel.vue index 686e4f6..aefcf42 100644 --- a/src/views/mdc/base/modules/deviceLog/WorkChartModel.vue +++ b/src/views/mdc/base/modules/deviceLog/WorkChartModel.vue @@ -1,6 +1,7 @@ <template> <div ref="workChart"> - <a-modal :title="title" :getContainer="() => this.$refs.workChart" width="80%" wrap-class-name="full-modal" :footer="null" :visible="visible" + <a-modal :title="title" :getContainer="() => this.$refs.workChart" width="80%" wrap-class-name="full-modal" + :footer="null" :visible="visible" @cancel="handleCancel" cancelText="鍏抽棴"> <div> <div> @@ -12,7 +13,7 @@ </a-col> <a-col :span="6"> <a-form-item label="鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-date-picker v-model="queryParams.paramDate" :disabledDate="disabledDate" format='YYYY-MM-DD'/> + <a-date-picker v-model="queryParams.paramDate" :disabledDate="disabledDate" format='YYYY-MM-DD'/> </a-form-item> </a-col> <a-col :span="6"> @@ -69,166 +70,206 @@ </template> <script> -import moment from 'moment' -import * as echarts from 'echarts' -import { - getAction, - postAction -} from '@/api/manage' -import { - duplicateCheck -} from '@/api/api' + import moment from 'moment' + import * as echarts from 'echarts' + import { + getAction, + postAction + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' -export default { - name: 'WorkChartModel', - components: {}, - props: {}, - data() { - return { - spinning:false, - labelCol: { - xs: { - span: 24 - }, - sm: { - span: 6 - } + export default { + name: 'WorkChartModel', + components: {}, + props: { + collectTime: { + type: Object }, - wrapperCol: { - xs: { - span: 24 + equipment: { + type: Object + } + }, + watch: { + // 鐩戞帶鐖剁粍浠剁偣鍑诲乏鍙崇澶村垏鎹㈢殑鏃堕棿鍊煎皢鍏惰祴缁欑偣鍑诲伐浣滄洸绾垮悗鐨勬椂闂撮�夋嫨鍣ㄧ殑鍊� + collectTime: { + handler(newVal) { + this.currentToggledTime = newVal + } + } + }, + data() { + return { + spinning: false, + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } }, - sm: { - span: 18 - } + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + readOnly: true, + title: '', + plainOptions: [], + option: [], + workChart: '', + node: {}, + stratOpen: false, + endOpen: false, + visible: false, + show: false, + queryParams: {}, + panduanResult: [], + url: { + initPlainOptions: '/mdc/mdcDriveTypeParamConfig/findWorkCurveParamList', + workChart: '/mdc/mdcEquipmentRunningSection/workChart' + }, + currentToggledTime: '', + isClicklogListRow: false + } + }, + created() { + this.$bus.$on('tableRowRecord', this.getLogListRowRecord) + }, + mounted() { + + }, + methods: { + disabledDate(current) { + //Can not slect days before today and today + return current && current > moment().endOf('day') }, - readOnly:true, - title: '', - plainOptions: [], - option: [], - workChart: '', - node: {}, - stratOpen: false, - endOpen: false, - visible: false, - show: false, - queryParams: {}, - panduanResult:[], - url: { - initPlainOptions: '/mdc/mdcDriveTypeParamConfig/findWorkCurveParamList', - workChart: '/mdc/mdcEquipmentRunningSection/workChart' - } - } - }, - mounted() { - }, - methods: { - disabledDate(current){ - //Can not slect days before today and today - return current && current > moment().endOf("day"); - }, - initPlainOptions(param) { - let that = this - let equipment = param.equipmentId - getAction(this.url.initPlainOptions,{equipmentId:equipment}).then((res) => { - if (res.success) { - let temp = [] - // debugger - for (var item of res.result) { - temp.push({ label: item.chineseName, value: item.id, englishName: item.englishName }) + initPlainOptions(param) { + let that = this + let equipment = param.equipmentId + getAction(this.url.initPlainOptions, { equipmentId: equipment }).then((res) => { + if (res.success) { + let temp = [] + // debugger + for (var item of res.result) { + temp.push({ label: item.chineseName, value: item.id, englishName: item.englishName }) + } + that.plainOptions = temp + + if (temp.length > 0) { + that.option = [temp[0].value] + let param = { + driveType: that.node.driveType, + equipmentId: that.node.equipmentId, + date: that.queryParams.paramDateStr, + start: that.queryParams.startStr, + end: that.queryParams.endStr, + interval: that.queryParams.period, + codeTypeId: that.option.join(',') + } + that.initChart(param) + } } - that.plainOptions = temp - if(temp.length>0){ - that.option = [temp[0].value] - } - } - }) - }, - searchQuery() { - this.queryParams.paramDateStr = this.queryParams.paramDate.format('yyyy-MM-DD') - this.queryParams.startStr = this.queryParams.start.format('HH:mm') - this.queryParams.endStr = this.queryParams.end.format('HH:mm') - let param = { - driveType: this.node.driveType, equipmentId: this.node.equipmentId, - date: this.queryParams.paramDateStr, start: this.queryParams.startStr, - end: this.queryParams.endStr, interval: this.queryParams.period, - codeTypeId: this.option.join(',') - } - this.initChart(param); - this.spinning = true; - }, - timeHandleChange(val) { - if (val == 'start') { - this.stratOpen = true - } else { - this.endOpen = true - } - }, - timeHandleClose(val) { - if (val == 'start') { - this.stratOpen = false - this.endOpen = true - } else { - this.endOpen = false - } - }, - add(node) { - let _this = this - this.visible = true - this.node = node - let paramDate = moment() - let start = moment('0:0', 'HH:mm') - let end = moment(moment().format('HH:mm'), 'HH:mm') - this.queryParams = { - equipmentId: node.equipmentId, - equipmentName: node.equipmentName, - period: 1000, - paramDate: paramDate, - paramDateStr: paramDate.format('yyyy-MM-DD'), - start: start, - startStr: start.format('HH:mm'), - end: end, - endStr: end.format('HH:mm') - } - this.$nextTick(() => { - _this.initPlainOptions(node) + }) + }, + searchQuery() { + this.queryParams.paramDateStr = this.queryParams.paramDate.format('yyyy-MM-DD') + this.queryParams.startStr = this.queryParams.start.format('HH:mm') + this.queryParams.endStr = this.queryParams.end.format('HH:mm') let param = { - driveType: node.driveType, equipmentId: node.equipmentId, - date: _this.queryParams.paramDateStr, start: _this.queryParams.startStr, - end: _this.queryParams.endStr, interval: _this.queryParams.period, - codeTypeId: _this.option.join(',') + driveType: this.node.driveType, equipmentId: this.node.equipmentId, + date: this.queryParams.paramDateStr, start: this.queryParams.startStr, + end: this.queryParams.endStr, interval: this.queryParams.period, + codeTypeId: this.option.join(',') } - _this.initChart(param) - }) - }, - handleCancel() { - this.visible = false; - this.stratOpen = false; - this.endOpen = false; - }, - checkboxOnChange(e) { - if (e.length <= 3) { - this.option = e - } else { - // this.$message.warn('鏈�澶氬彧鑳介�夋嫨3涓�') - this.$notification.warning({ - message:'娑堟伅', - description:'鏈�澶氬彧鑳介�夋嫨涓変釜' - }); - return false - } - }, - close() { - this.visible = false - this.show = false - }, - getYAxisOffset(index) { - return index * 50 + 10; - }, - initChart(param) { - if (!this.workChart) { - this.workChart = echarts.init(document.getElementById('workChart')) - } + this.initChart(param) + this.spinning = true + }, + timeHandleChange(val) { + if (val == 'start') { + this.stratOpen = true + } else { + this.endOpen = true + } + }, + timeHandleClose(val) { + if (val == 'start') { + this.stratOpen = false + this.endOpen = true + } else { + this.endOpen = false + } + }, + add(node) { + let _this = this + this.visible = true + this.node = node + this.spinning = true + let paramDate + let start + let end + // 褰撴病鏈夊垏鎹㈣繃鏃堕棿currentToggledTime鐨勫�间负绌哄�硷紝濡傛灉鐢变簬鐐瑰嚮宸﹀彸绠ご鍒囨崲杩囨椂闂达紝鍒檆urrentToggledTime涓哄垏鎹㈠悗鐨勬椂闂� + if (!this.currentToggledTime) { + paramDate = moment() + } else { + paramDate = this.currentToggledTime + } + // 鍒ゆ柇鏄惁鐐瑰嚮璁惧鏃ュ織琛ㄦ牸琛岀殑鏁版嵁锛岃嫢鐐瑰嚮琛ㄦ牸鏁版嵁鍒欐樉绀鸿〃鏍兼暟鎹腑鐨勬椂闂达紝鑻ョ偣鍑诲伐浣滄洸绾垮浘鐗囧垯鏄剧ず0鐐硅嚦褰撳墠鏃堕棿鏁版嵁 + if (this.isClicklogListRow) { + start = node.start + end = node.end + } else { + start = moment('0:0', 'HH:mm') + end = moment(moment().format('HH:mm'), 'HH:mm') + } + this.queryParams = { + equipmentId: node.equipmentId, + equipmentName: node.equipmentName, + period: 1000, + paramDate: paramDate, + paramDateStr: paramDate.format('yyyy-MM-DD'), + start: start, + startStr: start.format('HH:mm'), + end: end, + endStr: end.format('HH:mm') + } + this.$nextTick(() => { + _this.initPlainOptions(node) + }) + }, + handleCancel() { + this.visible = false + this.stratOpen = false + this.endOpen = false + }, + checkboxOnChange(e) { + if (e.length <= 3) { + this.option = e + } else { + // this.$message.warn('鏈�澶氬彧鑳介�夋嫨3涓�') + this.$notification.warning({ + message: '娑堟伅', + description: '鏈�澶氬彧鑳介�夋嫨涓変釜' + }) + return false + } + }, + close() { + this.visible = false + this.show = false + }, + getYAxisOffset(index) { + return index * 50 + 10 + }, + initChart(param) { + if (!this.workChart) { + this.workChart = echarts.init(document.getElementById('workChart')) + } let option = { tooltip: { trigger: 'axis', @@ -237,7 +278,7 @@ } }, legend: { - data:[], + data: [] }, title: { left: 'center', @@ -252,12 +293,12 @@ saveAsImage: {} } }, - grid:{ - left:'8%', - top:'10%', - right:'2%', - bottom:'14%', - containLabel:true + grid: { + left: '8%', + top: '10%', + right: '2%', + bottom: '14%', + containLabel: true }, xAxis: { type: 'time', @@ -265,44 +306,44 @@ }, yAxis: [ { - yAxisIndex:0, - type: 'value', - offset:0, - position:'left', - boundaryGap: [0, '15%'], - axisLine:{ - show:true, - // lineStyle:{ - // color:'#000000' - // } - } - }, - { - yAxisIndex:1, + yAxisIndex: 0, type: 'value', - offset:60, - position:'left', + offset: 0, + position: 'left', boundaryGap: [0, '15%'], - axisLine:{ - show:true, + axisLine: { + show: true // lineStyle:{ // color:'#000000' // } } }, { - yAxisIndex:2, + yAxisIndex: 1, type: 'value', - offset:120, - position:'left', + offset: 60, + position: 'left', boundaryGap: [0, '15%'], - axisLine:{ - show:true, + axisLine: { + show: true // lineStyle:{ // color:'#000000' // } } }, + { + yAxisIndex: 2, + type: 'value', + offset: 120, + position: 'left', + boundaryGap: [0, '15%'], + axisLine: { + show: true + // lineStyle:{ + // color:'#000000' + // } + } + } ], dataZoom: [ { @@ -315,211 +356,236 @@ end: 20 } ], - series:[ + series: [ { - showSymbol:true, - symbolSize:20, - label:'show', - name:'', - type:'line', - data:[], - smooth:true, - symbol:'none', + showSymbol: true, + symbolSize: 20, + label: 'show', + name: '', + type: 'line', + data: [], + smooth: true, + symbol: 'none' } ] } - let _this = this - let temp = [] - for (let i = 0; i < this.plainOptions.length; i++) { - let item = this.plainOptions[i] - if (this.option.indexOf(item.value) > -1) { - temp.push(item) - } - } - getAction(this.url.workChart, param).then((res) => { - if(JSON.stringify(res.result) == '[]' || res.result == null){ - // this.$message.warning('鏃犳暟鎹紒') - this.$notification.warning({ - message:'娑堟伅', - description:'鏃犳暟鎹�!' - }); - this.spinning = false; - _this.workChart.setOption(option,true) - }else{ - this.spinning = false; - // debugger - let result = [] - let itemLine = [] - //y杞存暟缁� - var Yarr = [] - var lengenddata = []; - for (let i = 0; i < temp.length; i++) { - let item = temp[i] - itemLine = [] - for (let m = 0; m < res.result.length; m++) { - let d = [] - d.push(res.result[m].collectTime) - // debugger - d.push(res.result[m][item.englishName]) - itemLine.push(d) - } - var lll = { - name:item.label - } - lengenddata.push(lll) - var Yline ={ - name:item.label, - type:'value', - yAxisIndex:i, - boundaryGap: [0,'100%'] - } - Yarr.push(Yline); - var line ={ - name:item.label, - type:'line', - // areaStyle:{}, - smooth:true, - symbol:'circle', - symbolSize:10, - yAxisIndex:i, - - data:itemLine - } - result.push(line); - + let _this = this + let temp = [] + for (let i = 0; i < this.plainOptions.length; i++) { + let item = this.plainOptions[i] + if (this.option.indexOf(item.value) > -1) { + temp.push(item) } - // option.yAxis = Yarr; - option.series = result; - option.legend = lengenddata; - // console.log(option); - _this.workChart.setOption(option,true) - window.addEventListener('resize', function() { - _this.workChart.resize() - }) } + getAction(this.url.workChart, param).then((res) => { + if (JSON.stringify(res.result) == '[]' || res.result == null) { + // this.$message.warning('鏃犳暟鎹紒') + this.$notification.warning({ + message: '娑堟伅', + description: '鏃犳暟鎹�!' + }) + this.spinning = false + _this.workChart.setOption(option, true) + } else { + this.spinning = false + // debugger + let result = [] + let itemLine = [] + //y杞存暟缁� + var Yarr = [] + var lengenddata = [] + for (let i = 0; i < temp.length; i++) { + let item = temp[i] + itemLine = [] + for (let m = 0; m < res.result.length; m++) { + let d = [] + d.push(res.result[m].collectTime) + // debugger + d.push(res.result[m][item.englishName]) + itemLine.push(d) + } + var lll = { + name: item.label + } + lengenddata.push(lll) + var Yline = { + name: item.label, + type: 'value', + yAxisIndex: i, + boundaryGap: [0, '100%'] + } + Yarr.push(Yline) + var line = { + name: item.label, + type: 'line', + // areaStyle:{}, + smooth: true, + symbol: 'circle', + symbolSize: 10, + yAxisIndex: i, - }) + data: itemLine + } + result.push(line) + + } + // option.yAxis = Yarr; + option.series = result + option.legend = lengenddata + // console.log(option); + _this.workChart.setOption(option, true) + window.addEventListener('resize', function() { + _this.workChart.resize() + }) + } + + }) + }, + /** + * 鑾峰彇鐐瑰嚮璁惧鏃ュ織琛ㄦ牸琛屽悗浠庡厔寮熺粍浠朵紶鏉ョ殑鏃堕棿瀵硅薄 + * @param timeObj 褰撳墠琛岀殑寮�濮嬫椂闂翠笌缁撴潫鏃堕棿缁勬垚鐨勫璞� + */ + getLogListRowRecord(timeObj) { + // 鍒ゆ柇鏄惁鐐瑰嚮璁惧鏃ュ織琛ㄦ牸琛岀殑鏁版嵁锛屾鏃朵负鐐瑰嚮琛ㄦ牸鏁版嵁涓簍rue + this.isClicklogListRow = true + // 鍚堝苟鐖剁粍浠朵紶鏉ョ殑褰撳墠璁惧淇℃伅瀵硅薄涓庡厔寮熺粍浠朵紶鏉ョ殑褰撳墠琛岀殑鏃堕棿瀵硅薄 + const newQueryParams = Object.assign(this.equipment, timeObj) + this.add(newQueryParams) + this.title = '宸ヤ綔鏇茬嚎' + } } } -} </script> <style scoped lang="less"> -.full-modal { - .ant-modal { - max-width: 100%; - top: 0; - padding-bottom: 0; - margin: 0; + .full-modal { + .ant-modal { + max-width: 100%; + top: 0; + padding-bottom: 0; + margin: 0; + } + .ant-modal-content { + display: flex; + flex-direction: column; + height: calc(100vh); + } + .ant-modal-body { + flex: 1; + } } - .ant-modal-content { + + /deep/ .ant-modal { + /*background-color: #000;*/ + /*color: #fff;*/ + } + + /deep/ .ant-modal-header { + /*background-color: #000;*/ + } + + /deep/ .ant-modal-title { + /*color: #fff;*/ + } + + /deep/ .ant-modal-close { + color: #1191b0; + font-size: 24px; + } + + /deep/ .ant-modal-content { + /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ + /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ + /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background-color: #000;*/ + /*color: #fff;*/ + position: relative; + } + + /deep/ .ant-modal-header { + /*border-bottom: none!important;*/ + } + + /deep/ .ant-checkbox-wrapper { + /*color: #fff;*/ + } + + /deep/ .ant-form-item-label label { + /*color: #fff;*/ + } + + /deep/ .ant-btn { + /*position: absolute;*/ + + } + + .checkboxgroup { + position: absolute; + right: 5%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + } + + /deep/ .ant-checkbox-group { display: flex; flex-direction: column; - height: calc(100vh); } - .ant-modal-body { - flex: 1; + + /deep/ .ant-checkbox-group .ant-checkbox-wrapper { + padding: 10px; } -} -/deep/ .ant-modal{ - /*background-color: #000;*/ - /*color: #fff;*/ -} -/deep/ .ant-modal-header{ - /*background-color: #000;*/ -} -/deep/ .ant-modal-title{ - /*color: #fff;*/ -} -/deep/ .ant-modal-close{ - color: #1191b0; - font-size: 24px; -} -/deep/ .ant-modal-content{ - /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ - /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ - /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background-color: #000;*/ - /*color: #fff;*/ - position: relative; -} -/deep/ .ant-modal-header{ - /*border-bottom: none!important;*/ -} -/deep/ .ant-checkbox-wrapper{ - /*color: #fff;*/ -} -/deep/ .ant-form-item-label label{ - /*color: #fff;*/ -} -/deep/ .ant-btn{ - /*position: absolute;*/ -} -.checkboxgroup{ - position: absolute; - right: 5%; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} -/deep/ .ant-checkbox-group{ - display: flex; - flex-direction: column; -} -/deep/ .ant-checkbox-group .ant-checkbox-wrapper{ - padding: 10px; -} + .con_btn { + display: flex; + align-items: center; + } -.con_btn{ - display: flex; - align-items: center; -} -.workChart_params{ - display: flex; - /*align-items: center;*/ - flex-direction: column; - float: left; -} -.workChart_params .params_one{ - display: flex; - justify-content: space-between; -} -.workChart_params .params_two{ - display: flex; - justify-content: space-between; -} -/deep/ .workChart_params .ant-form-item{ - display: flex; -} -/deep/ .workChart_params .ant-form-item .ant-form-item-control-wrapper{ - margin: 0 10px; -} + .workChart_params { + display: flex; + /*align-items: center;*/ + flex-direction: column; + float: left; + } + .workChart_params .params_one { + display: flex; + justify-content: space-between; + } + .workChart_params .params_two { + display: flex; + justify-content: space-between; + } + /deep/ .workChart_params .ant-form-item { + display: flex; + } + /deep/ .workChart_params .ant-form-item .ant-form-item-control-wrapper { + margin: 0 10px; + } -.ant-btn { - padding: 0 10px; - margin-left: 3px; -} + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } -.ant-form-item-control { - line-height: 0px; -} + .ant-form-item-control { + line-height: 0px; + } -/** 涓昏〃鍗曡闂磋窛 */ -.ant-form .ant-form-item { - margin-bottom: 10px; -} + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } -/** Tab椤甸潰琛岄棿璺� */ -.ant-tabs-content .ant-form-item { - margin-bottom: 0px; -} + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } </style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue index c993065..5346318 100644 --- a/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -68,7 +68,7 @@ <!--<device-repair-model-add ref="modalFormadd" @ok="modalFormOk"></device-repair-model-add>--> <device-repair-model-edit ref="modalFormedit" @ok="modalFormOk"></device-repair-model-edit> <!--<repair-model ref="repairModelFrom" @ok="modalFormOk">0</repair-model>--> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue index ceb9705..d5c0b4a 100644 --- a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -1,6 +1,6 @@ <template> <div style="width: 100%;"> - <a-card :bordered="false"> + <div :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -28,7 +28,7 @@ </a-row> </a-form> </div> - <div style="width: 530px;position: absolute;top: 20px; right:1.5%;"> + <div style="width: 530px;position: absolute;top: 0; right:1.5%;"> <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;"> <tr> <td v-for="(item, index) in identifying">{{item.title}}</td> @@ -101,7 +101,7 @@ </table> </div> </div> - </a-card> + </div> </div> </template> diff --git a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue index e679650..eeda3d2 100644 --- a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue +++ b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue @@ -1,6 +1,6 @@ <template> <div class="efficiency_list" style="width: 100%"> - <a-card :bordered="false"> + <div :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <div> <div class="table-page-search-wrapper"> @@ -29,7 +29,7 @@ </a-row> </a-form> </div> - <div style="width: 530px;position: absolute;top: 20px; right: 1.5%;"> + <div style="width: 530px;position: absolute;top: 0; right: 1.5%;"> <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;"> <tr> <td v-for="(item, index) in identifying">{{item.title}}</td> @@ -103,7 +103,7 @@ </table> </div> </div> - </a-card> + </div> </div> </template> diff --git a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue index a5a6391..b3e08fb 100644 --- a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue +++ b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue @@ -1,6 +1,6 @@ <template> <div style="width: 100%;"> - <a-card :bordered="false"> + <div :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <div class="seach-content"> <div class="table-page-search-wrapper"> @@ -49,7 +49,7 @@ </a-row> </a-form> </div> - <div style="width: 530px;top: 20px; right: 0px;"> + <div style="width: 530px;top: 0; right: 0px;"> <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;"> <tr> <td v-for="(item, index) in identifying">{{item.title}}</td> @@ -143,7 +143,7 @@ </table> </div> </div> - </a-card> + </div> </div> </template> diff --git a/src/views/mdc/base/modules/equipmentAvailCompare/equipmentAvailCompareMain.vue b/src/views/mdc/base/modules/equipmentAvailCompare/equipmentAvailCompareMain.vue index faba4d8..9f83208 100644 --- a/src/views/mdc/base/modules/equipmentAvailCompare/equipmentAvailCompareMain.vue +++ b/src/views/mdc/base/modules/equipmentAvailCompare/equipmentAvailCompareMain.vue @@ -1,6 +1,6 @@ <template> <a-spin :spinning="loading"> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <div class="com_box"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> @@ -46,7 +46,7 @@ </div> <!-- table鍖哄煙-end --> </div> - </a-card> + </div> </a-spin> </template> diff --git a/src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue b/src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue index fa95c5d..223771c 100644 --- a/src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue +++ b/src/views/mdc/base/modules/equipmentDayAvail/equipmentDayAvailMain.vue @@ -1,63 +1,67 @@ <template> - <a-card :bordered="false" class="device_list"> - <div class="com_box"> - <!-- 鏌ヨ鍖哄煙 --> - <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> - <a-form layout="inline" @keyup.enter.native="searchQuery"> - <a-row :gutter="24"> - <a-col :md="4" :sm="4"> - <a-form-item label="璁惧缂栧彿"> - <a-input placeholder="杈撳叆璁惧缂栧彿鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentId"></a-input> - </a-form-item> - </a-col> - <a-col :md="4" :sm="4"> - <a-form-item label="璁惧鍚嶇О"> - <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentName"></a-input> - </a-form-item> - </a-col> - <a-col :md="4" :sm="4" :xs="4"> - <a-form-item label="鏃ユ湡"> - <a-date-picker v-model="queryParam.dateTime" :disabledDate="disabledDate" format='YYYYMMDD' @change="dataChange"/> - </a-form-item> - </a-col> - <a-col :md="4" :sm="4" :xs="4"> - <a-form-item label="闂撮殧"> - <a-select default-value="2" style="width: 80px" v-model="queryParam.timeType"> - <a-select-option :value="2"> - 2 - </a-select-option> - <a-select-option :value="3"> - 3 - </a-select-option> - <a-select-option :value="4"> - 4 - </a-select-option> - <a-select-option :value="6"> - 6 - </a-select-option> - </a-select>灏忔椂 - </a-form-item> - </a-col> - <a-col :md="3" :sm="3" :xs="3"> - <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> - </a-col> - <!--<a-col :md="2" :sm="2" :xs="2">--> + <a-spin :spinning="loading"> + <div :bordered="false" class="device_list"> + <div class="com_box"> + <!-- 鏌ヨ鍖哄煙 --> + <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="4" :sm="4"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="杈撳叆璁惧缂栧彿鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentId"></a-input> + </a-form-item> + </a-col> + <a-col :md="4" :sm="4"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentName"></a-input> + </a-form-item> + </a-col> + <a-col :md="4" :sm="4" :xs="4"> + <a-form-item label="鏃ユ湡"> + <a-date-picker v-model="queryParam.dateTime" :disabledDate="disabledDate" format='YYYYMMDD' + @change="dataChange"/> + </a-form-item> + </a-col> + <a-col :md="4" :sm="4" :xs="4"> + <a-form-item label="闂撮殧"> + <a-select default-value="2" style="width: 80px" v-model="queryParam.timeType"> + <a-select-option :value="2"> + 2 + </a-select-option> + <a-select-option :value="3"> + 3 + </a-select-option> + <a-select-option :value="4"> + 4 + </a-select-option> + <a-select-option :value="6"> + 6 + </a-select-option> + </a-select> + 灏忔椂 + </a-form-item> + </a-col> + <a-col :md="3" :sm="3" :xs="3"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + </a-col> + <!--<a-col :md="2" :sm="2" :xs="2">--> <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>--> - <!--</a-col>--> - </a-row> - </a-form> - </div> - <!-- table鍖哄煙-begin --> - <div id="DeviceList"> - - <div style="padding: 5px;width: 100%;height: 100%"> - <div style="width: 100%;height: 100%" id="dayAvailBar"></div> - <!--<div id="dayAvailLine"></div>--> + <!--</a-col>--> + </a-row> + </a-form> </div> + <!-- table鍖哄煙-begin --> + <div id="DeviceList"> + + <div style="padding: 5px;width: 100%;height: 100%"> + <div style="width: 100%;height: 100%" id="dayAvailBar"></div> + <!--<div id="dayAvailLine"></div>--> + </div> + </div> + <!-- table鍖哄煙-end --> </div> - <!-- table鍖哄煙-end --> </div> - </a-card> + </a-spin> </template> <script> @@ -78,6 +82,7 @@ import JEllipsis from '@/components/jeecg/JEllipsis' import Tooltip from 'ant-design-vue/es/tooltip' import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' + export default { name: 'equipmentDayAvailMain', // mixins: [JeecgListMixin], @@ -91,38 +96,39 @@ JDate, JEllipsis }, - props: { nodeTree: '', Type:'',nodePeople: '' }, + props: { nodeTree: '', Type: '', nodePeople: '' }, data() { return { activeKey: '1', - typeTree:"", - typeParent:1, - typeEquipment:1, - spaceTime:[], - useingRates:[], + typeTree: '', + typeParent: 1, + typeEquipment: 1, + spaceTime: [], + useingRates: [], dates: [], - xianshi:"", - readOnly:true, + xianshi: '', + readOnly: true, queryParam: { - dateTime:undefined, - timeType:'2' + dateTime: undefined, + timeType: '2' }, - queryParams:{}, - queryParamEquip:{}, - queryParamPeople:{}, - dataStartsoucre:[], + queryParams: {}, + queryParamEquip: {}, + queryParamPeople: {}, + dataStartsoucre: [], url: { - comparativeAnalysis:'/mdc/efficiencyReport/comparativeAnalysis', - dayUtilizationRate:'/mdc/efficiencyReport/dayUtilizationRate', + comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis', + dayUtilizationRate: '/mdc/efficiencyReport/dayUtilizationRate', getEquipmentByPid: '/mdc/mdcEquipment/getEquipmentByPid', - getEquipmentByDepPid:'/mdc/mdcEquipment/getEquipmentByDepPid' + getEquipmentByDepPid: '/mdc/mdcEquipment/getEquipmentByDepPid' }, - AnalysisList:{} + AnalysisList: {}, + loading: false } }, - watch:{ - Type(valmath){ - this.dataList = []; + watch: { + Type(valmath) { + this.dataList = [] this.queryParams.typeTree = valmath // console.log(this.queryParams.typeTree) }, @@ -130,7 +136,7 @@ if (JSON.stringify(val) != '{}') { if (val.equipmentId) { // this.$set(this.queryParam, 'tierName', val.title) - this.queryParamEquip.parentId = "" + this.queryParamEquip.parentId = '' this.queryParams.equipmentId = val.equipmentId this.queryParamEquip.equipmentId = val.equipmentId this.searchQuery() @@ -141,14 +147,13 @@ this.initEquipment(val.key) } - } }, - nodePeople(val){ + nodePeople(val) { if (JSON.stringify(val) != '{}') { if (val.equipmentId) { // this.$set(this.queryParam, 'tierName', val.title) - this.queryParamEquip.parentId = "" + this.queryParamEquip.parentId = '' this.queryParams.equipmentId = val.equipmentId this.queryParamEquip.equipmentId = val.equipmentId this.searchQuery() @@ -164,8 +169,8 @@ }, methods: { moment, - drawTu(){ - let dayAvailBar = this.$echarts.init(document.getElementById('dayAvailBar'), 'macarons'); + drawTu() { + let dayAvailBar = this.$echarts.init(document.getElementById('dayAvailBar'), 'macarons') //dayAvailLine = echarts.init(document.getElementById('dayAvailLine')); let dayAvailBarOption = { title: { @@ -174,21 +179,21 @@ textStyle: { fontSize: 18, fontWeight: 'bolder', - color: "#151414" + color: '#151414' } }, tooltip: { trigger: 'axis', - formatter: "{a} <br/>{b} :({c}%)" + formatter: '{a} <br/>{b} :({c}%)' }, toolbox: { show: true, feature: { - mark: {show: true}, - dataView: {show: true, readOnly: false}, - magicType: {show: true, type: ['line', 'bar']}, - restore: {show: true}, - saveAsImage: {show: true} + mark: { show: true }, + dataView: { show: true, readOnly: false }, + magicType: { show: true, type: ['line', 'bar'] }, + restore: { show: true }, + saveAsImage: { show: true } } }, calculable: true, //鏄惁鍚敤鎷栨嫿閲嶈绠楃壒鎬� @@ -219,18 +224,18 @@ data: this.useingRates, markPoint: { data: [ - {type: 'max', name: '鏈�澶у��', symbolSize: 70}, - {type: 'min', name: '鏈�灏忓��', symbolSize: 70} + { type: 'max', name: '鏈�澶у��', symbolSize: 70 }, + { type: 'min', name: '鏈�灏忓��', symbolSize: 70 } ] } } ] - }; - dayAvailBar.setOption(dayAvailBarOption); + } + dayAvailBar.setOption(dayAvailBarOption) }, - disabledDate(current){ + disabledDate(current) { //Can not slect days before today and today - return current && current > moment().subtract('days', 1); + return current && current > moment().subtract('days', 1) }, dataChange(val) { this.queryParam.dateTime = val.format('YYYYMMDD') @@ -248,11 +253,12 @@ this.queryParam.endTime = v2[1] // console.log(v2[0],v2[1]) }, - loadAnalysis(){ - getAction(this.url.dayUtilizationRate,this.queryParam).then(res => { + loadAnalysis() { + this.loading = true + getAction(this.url.dayUtilizationRate, this.queryParam).then(res => { if (res.success) { this.spaceTime.push(res.result.dataList) - for(var i = 0;i<res.result.dayRateDto.length;i++){ + for (var i = 0; i < res.result.dayRateDto.length; i++) { this.useingRates.push(res.result.dayRateDto[i].utilizationRate) } // console.log(this,spaceTime) @@ -260,9 +266,9 @@ } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -275,119 +281,117 @@ return '0' } }, - searchQuery(){ - if(this.queryParam.dateTime){ + searchQuery() { + if (this.queryParam.dateTime) { + this.loading = true this.spaceTime = [] this.useingRates = [] - if(this.queryParams.typeTree == "1"){ - this.queryParams.parentId = this.queryParamEquip.parentId - // this.queryParams.equipmentId = this.queryParamEquip.equipmentId - - }else{ + if (this.queryParams.typeTree == '1') { this.queryParams.parentId = this.queryParamEquip.parentId - + // this.queryParams.equipmentId = this.queryParamEquip.equipmentId + } else { + this.queryParams.parentId = this.queryParamEquip.parentId // this.queryParams.equipmentId = "" } - this.AnalysisList = []; + this.AnalysisList = [] //鑾峰彇鏌ヨ鏉′欢 - this.queryParam.parentId = this.queryParams.parentId; - this.queryParam.equipmentId = this.queryParams.equipmentId; + this.queryParam.parentId = this.queryParams.parentId + this.queryParam.equipmentId = this.queryParams.equipmentId this.queryParam.typeTree = this.queryParams.typeTree - getAction(this.url.dayUtilizationRate,this.queryParam).then((res) => { - if(res.success){ - this.spaceTime=res.result.dateList - for(var i = 0;i<res.result.dayRateDto.length;i++){ + getAction(this.url.dayUtilizationRate, this.queryParam).then((res) => { + if (res.success) { + this.spaceTime = res.result.dateList + for (var i = 0; i < res.result.dayRateDto.length; i++) { this.useingRates.push(this.numFilter(res.result.dayRateDto[i].utilizationRate)) } this.drawTu() - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false }) - }else{ + } else { this.$notification.warning({ - message:'娑堟伅', - description:'璇烽�夋嫨鏃堕棿' - }); + message: '娑堟伅', + description: '璇烽�夋嫨鏃堕棿' + }) } - }, searchReset() { this.spaceTime = [] this.useingRates = [] - if(this.queryParams.typeTree == "1"){ + if (this.queryParams.typeTree == '1') { this.typeTree = this.queryParams.typeTree - this.typeParent = this.queryParams.parentId + this.typeParent = this.queryParams.parentId this.typeEquipment = this.queryParams.equipmentId this.queryParams = {} this.queryParam = {} this.queryParams.typeTree = this.typeTree this.queryParams.parentId = this.typeParent - if(this.queryParams.parentId != ""){ - this.queryParams.equipmentId = "" + if (this.queryParams.parentId != '') { + this.queryParams.equipmentId = '' this.initEquipment() - }else{ - if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ - this.queryParams.equipmentId = this.typeEquipment - }else{ + } else { + if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { + this.queryParams.equipmentId = this.typeEquipment + } else { this.queryParams.equipmentId = this.queryParamEquip.equipmentId } } - getAction(this.url.dayUtilizationRate,this.queryParams).then((res) => { - if(res.success){ - this.spaceTime=res.result.dateList - for(var i = 0;i<res.result.dayRateDto.length;i++){ + getAction(this.url.dayUtilizationRate, this.queryParams).then((res) => { + if (res.success) { + this.spaceTime = res.result.dateList + for (var i = 0; i < res.result.dayRateDto.length; i++) { this.useingRates.push(this.numFilter(res.result.dayRateDto[i].utilizationRate)) } this.drawTu() - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false }) - }else{ + } else { this.typeTree = this.queryParams.typeTree - this.typeParent = this.queryParams.parentId + this.typeParent = this.queryParams.parentId this.typeEquipment = this.queryParams.equipmentId this.queryParams = {} this.queryParam = {} this.dates = [] this.queryParams.typeTree = this.typeTree this.queryParams.parentId = this.typeParent - if(this.queryParams.parentId != ""){ - this.queryParams.equipmentId = "" + if (this.queryParams.parentId != '') { + this.queryParams.equipmentId = '' this.initEquipment() - }else{ - if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ - this.queryParams.equipmentId = this.typeEquipment - }else{ + } else { + if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { + this.queryParams.equipmentId = this.typeEquipment + } else { this.queryParams.equipmentId = this.queryParamEquip.equipmentId } } - getAction(this.url.dayUtilizationRate,this.queryParams).then((res) => { - if(res.success){ - this.spaceTime=res.result.dateList - for(var i = 0;i<res.result.dayRateDto.length;i++){ + getAction(this.url.dayUtilizationRate, this.queryParams).then((res) => { + if (res.success) { + this.spaceTime = res.result.dateList + for (var i = 0; i < res.result.dayRateDto.length; i++) { this.useingRates.push(this.numFilter(res.result.dayRateDto[i].utilizationRate)) } this.drawTu() - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -411,16 +415,16 @@ this.equipment = {} // _this.$message.warning('璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒') _this.$notification.warning({ - message:'娑堟伅', - description:'璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' - }); + message: '娑堟伅', + description: '璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' + }) } - }else{ + } else { // this.$message.warning(res.message) _this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }) @@ -441,85 +445,92 @@ this.equipment = {} // _this.$message.warning('璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒') _this.$notification.warning({ - message:'娑堟伅', - description:'璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' - }); + message: '娑堟伅', + description: '璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' + }) } - }else{ + } else { // this.$message.warning(res.message) _this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }) } }, created() { - let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD'); + let collectTime = moment(moment().add(-1, 'd'), 'YYYY-MM-DD') - - this.queryParams.collectTime = collectTime; + this.queryParams.collectTime = collectTime this.queryParam.dateTime = this.queryParams.collectTime.format('YYYYMMDD') this.queryParams.typeTree = '1' this.initEquipment() - }, + } } </script> <style lang="less" scoped> /*@import '~@assets/less/common.less';*/ - @media screen and (min-width: 1920px){ - .device_list{ - height: 811px!important; + @media screen and (min-width: 1920px) { + .device_list { + height: 811px !important; overflow: scroll; } } - @media screen and (min-width: 1680px) and (max-width: 1920px){ - .device_list{ - height: 811px!important; + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .device_list { + height: 811px !important; overflow: scroll; } } - @media screen and (min-width: 1400px) and (max-width: 1680px){ - .device_list{ - height: 663px!important; + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .device_list { + height: 663px !important; overflow: scroll; } } - @media screen and (min-width: 1280px) and (max-width: 1400px){ - .device_list{ - height: 564px!important; + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .device_list { + height: 564px !important; overflow: scroll; } } - @media screen and (max-width: 1280px){ - .device_list{ - height: 564px!important; + + @media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; overflow: scroll; } } + /*.device_list{*/ /*display: flex;*/ /*}*/ /*.device_list .table-page-search-wrapper{*/ /**/ /*}*/ - /deep/ .ant-card-body{ - height: 100%!important; + /deep/ .ant-card-body { + height: 100% !important; } - .device_list .com_box{ - display: flex!important; - height: 100%!important; - flex-direction: column!important; + + .device_list .com_box { + display: flex !important; + height: 100% !important; + flex-direction: column !important; } - .device_list .table-page-search-wrapper{ - height: 6%!important; + + .device_list .table-page-search-wrapper { + height: 6% !important; } - .device_list #DeviceList{ - height: 90%!important; + + .device_list #DeviceList { + height: 90% !important; } </style> diff --git a/src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue b/src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue index 3b6c3a4..30e763b 100644 --- a/src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue +++ b/src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -85,7 +85,7 @@ <!--<device-repair-model></device-repair-model>--> <mdc-pass-rate-modal ref="modalForm" @ok="modalFormOk"></mdc-pass-rate-modal> <mdc-pass-rate-edit ref="modalFormedit" @ok="modalFormOk"></mdc-pass-rate-edit> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue b/src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue index c5f34cc..35fa3d3 100644 --- a/src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue +++ b/src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -81,7 +81,7 @@ <mdc-process-quantity-modal ref="modalForm" @ok="modalFormOk"></mdc-process-quantity-modal> <mdc-process-quantity-edit ref="modalFormedit" @ok="modalFormOk"></mdc-process-quantity-edit> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue b/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue index 5cb2f9a..f0ed5b0 100644 --- a/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue +++ b/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :bordered="false" class="device_list"> <!-- 鏌ヨ鍖哄煙 --> <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -81,7 +81,7 @@ <mdc-standard-process-duration-modal ref="modalForm" @ok="modalFormOk"></mdc-standard-process-duration-modal> <mdc-standard-process-duration-edit ref="modalFormedit" @ok="modalFormOk"></mdc-standard-process-duration-edit> - </a-card> + </div> </template> <script> diff --git a/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue b/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue index 42a5bb9..c8900d9 100644 --- a/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue +++ b/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue @@ -1,6 +1,6 @@ <template> <div class="efficiency_list" style="width: 100%;height: 100%;"> - <a-card :bordered="false"> + <div :bordered="false" style="height: 100%"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -64,7 +64,7 @@ </div> <div id="openRateTrendChart" style="width: 100%;height: 60%"></div> </div> - </a-card> + </div> </div> </template> @@ -326,7 +326,7 @@ let openRateTrendAnalysisChart = this.$echarts.init(document.getElementById('openRateTrendChart'), 'macarons') let openRateTrendChartOptions = { title: { - text: '鍒╃敤鐜囪蛋鍔垮垎鏋�', + text: '鍒╃敤鐜囧垎娈靛垎鏋�', x: 'center', textStyle: { fontSize: 18, @@ -422,6 +422,7 @@ .dataContent .mathData td { padding: 10px; /*display: none;*/ + cursor: pointer; } .dataContent .mathData:hover td { diff --git a/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue b/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue index 952a59b..6056ac3 100644 --- a/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue +++ b/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue @@ -1,6 +1,6 @@ <template> <div class="efficiency_list" style="width: 100%;height: 100%;"> - <a-card :bordered="false"> + <div :bordered="false" style="height: 100%"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> @@ -57,7 +57,7 @@ </div> <div id="openRateTrendChart" style="width: 100%;height: 60%"></div> </div> - </a-card> + </div> </div> </template> @@ -428,6 +428,7 @@ .dataContent .mathData td { padding: 10px; /*display: none;*/ + cursor: pointer; } .dataContent .mathData:hover td { diff --git a/src/views/mdc/base/modules/shift/ShiftInfoModel.vue b/src/views/mdc/base/modules/shift/ShiftInfoModel.vue index 1ed89ef..a6b2897 100644 --- a/src/views/mdc/base/modules/shift/ShiftInfoModel.vue +++ b/src/views/mdc/base/modules/shift/ShiftInfoModel.vue @@ -1,6 +1,6 @@ <template> <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" - @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-row :gutter="24"> @@ -12,7 +12,7 @@ </a-col> <a-col :span="12"> <a-form-item label="鐝鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input allow-clear placeholder="璇疯緭鍏ョ彮鍒跺悕绉�" v-decorator="['shiftSubName',validatorRules.shiftSubName]"/> + <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆″悕绉�" v-decorator="['shiftSubName',validatorRules.shiftSubName]"/> </a-form-item> </a-col> </a-row> @@ -72,7 +72,6 @@ JeecgListMixin } from '@/mixins/JeecgListMixin' - export default { name: 'ShiftInfoModel', mixins: [JeecgListMixin], @@ -105,20 +104,35 @@ confirmLoading: false, form: this.$form.createForm(this), validatorRules: { - shiftSubName:[ - { - required:true, - message:'璇疯緭鍏ュ瓧娈甸暱搴�', - },{ - validator:this.checkshiftSuName, - trigger:'blur' - } - ] + shiftSubName: { + rules: [ + { + required: true, + message: '璇疯緭鍏ョ彮娆″悕绉�' + } + ] + }, + startDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨寮�濮嬫椂闂�' + } + ] + }, + endDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨缁撴潫鏃堕棿' + } + ] + } }, url: { add: '/mdc/mdcShiftSub/addShiftSub', edit: '/mdc/mdcShiftSub/editMdcShiftSub', - list: '/mdc/mdcMdcShift/queryPageList', + list: '/mdc/mdcMdcShift/queryPageList' }, disableSubmit: true } @@ -129,27 +143,27 @@ methods: { //鑷畾涔夋牎楠屽嚱鏁帮紝瑕佹眰鍚嶅瓧涓嶈兘閲嶅 value鏄〃鍗曠殑鍊硷紝callback鏄洖璋冨嚱鏁� 蹇呴』璋冪敤鎵嶅彲楠岃瘉 - checkshiftSuName(rule,value,callback){ - if(!value){ - alert("涓嶈兘涓虹┖锛�") + checkshiftSuName(rule, value, callback) { + if (!value) { + alert('涓嶈兘涓虹┖锛�') return } // debugger // let NameSelf = value; - this.loadData() + this.loadData() // console.log(dataSource); - callback(); + callback() }, loadData() { - if(!this.url.list){ - this.$message.error("璇疯缃畊rl.list灞炴��!") + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') return } //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 // if (arg === 1) { // this.ipagination.current = 1; // } - var params = this.getQueryParams();//鏌ヨ鏉′欢 + var params = this.getQueryParams()//鏌ヨ鏉′欢 // // if(!params){ // return false; @@ -160,7 +174,7 @@ if (res.success) { // console.log(res) //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - this.dataSource = res.result.records||res.result; + this.dataSource = res.result.records || res.result // if(res.result.total) // { // this.ipagination.total = res.result.total; @@ -168,12 +182,12 @@ // this.ipagination.total = 0; // } //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -230,28 +244,23 @@ that.confirmLoading = true let formData = Object.assign(this.model, values) formData.isDaySpan = that.isDaySpan - console.log(formData.isDaySpan); - if(formData.isDaySpan == false){ - formData.startDate = moment(formData.startDate).format('HH:mm:ss'); - formData.endDate = moment(formData.endDate).format('HH:mm:ss'); - formData.sleepStartDate = moment(formData.sleepStartDate).format('HH:mm:ss'); - formData.sleepEndDate = moment(formData.sleepEndDate).format('HH:mm:ss'); - let startTimeOne = formData.startDate.replace(/:/g,''); - let endTimeOne = formData.endDate.replace(/:/g,''); - if(startTimeOne > endTimeOne){ + console.log(formData.isDaySpan) + formData.startDate = moment(formData.startDate).format('HH:mm:ss') + formData.endDate = moment(formData.endDate).format('HH:mm:ss') + if (formData.sleepStartDate) formData.sleepStartDate = moment(formData.sleepStartDate).format('HH:mm:ss') + if (formData.sleepEndDate) formData.sleepEndDate = moment(formData.sleepEndDate).format('HH:mm:ss') + if (formData.isDaySpan == false) { + let startTimeOne = formData.startDate.replace(/:/g, '') + let endTimeOne = formData.endDate.replace(/:/g, '') + if (startTimeOne > endTimeOne) { // that.$message.warning("闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒") that.$notification.warning({ - message:'娑堟伅', - description:"闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒" - }); - // that.$message.success("淇濆瓨澶辫触") - that.$notification.error({ - message:'娑堟伅', - description:"淇濆瓨澶辫触锛�" - }); + message: '娑堟伅', + description: '闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒' + }) that.confirmLoading = false that.close() - }else{ + } else { formData.shiftSubStatus = 1 let obj if (!this.model.id) { @@ -265,23 +274,23 @@ if (res.success) { // that.$message.success("淇濆瓨鎴愬姛") that.$notification.success({ - message:'娑堟伅', - description:"淇濆瓨鎴愬姛" - }); + message: '娑堟伅', + description: '淇濆瓨鎴愬姛' + }) that.$emit('ok', res.result) } else { // that.$message.warning(res.message) that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { that.confirmLoading = false that.close() }) } - }else{ + } else { formData.shiftSubStatus = 1 let obj if (!this.model.id) { @@ -295,16 +304,16 @@ if (res.success) { // that.$message.success that.$notification.success({ - message:'娑堟伅', - description:"淇濆瓨鎴愬姛" - }); + message: '娑堟伅', + description: '淇濆瓨鎴愬姛' + }) that.$emit('ok', res.result) } else { // that.$message.warning(res.message) that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { that.confirmLoading = false diff --git a/src/views/system/WorkshopSignageManagement.vue b/src/views/system/WorkshopSignageManagement.vue new file mode 100644 index 0000000..1572098 --- /dev/null +++ b/src/views/system/WorkshopSignageManagement.vue @@ -0,0 +1,501 @@ +<template> + <a-row :gutter="10"> + <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px"> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <!-- 鎼滅储鍖哄煙 --> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="12" :sm="8"> + <a-form-item label="杞﹂棿鍚嶇О" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }"> + <a-input placeholder="" v-model="queryParam.workshopName"></a-input> + </a-form-item> + </a-col> + <span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> + <a-col :md="12" :sm="24"> + <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </a-col> + </span> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" style="margin: 5px 0 10px 2px"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板缓杞﹂棿</a-button> + </div> + + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> + <i class="anticon anticon-info-circle ant-alert-icon"> </i> 宸查�夋嫨 + <a + ><b>{{ selectedRowKeys1.length }}</b></a + >椤� + <a style="margin-left: 24px" @click="onClearSelected1">娓呯┖</a> + </div> + + <div style="margin-top: 15px"> + <a-table + style="height: 500px" + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{ selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type: 'radio' }" + @change="handleTableChange" + > + <template slot="backgroundImage" slot-scope="text, record"> + <img :src="getImgView(record.backgroundImage)" width="50" height="50" /> + </template> + <span slot="action" slot-scope="text, record"> + <a @click="handleOpen(record)">璁惧</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link"> 鏇村 <a-icon type="down" /> </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete1(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </a-table> + </div> + </a-card> + </a-col> + <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1"> + <a-card :bordered="false"> + <div style="text-align: right"> + <a-icon type="close-circle" @click="hideUserList" /> + </div> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline"> + <a-row :gutter="24"> + <a-col :md="12" :sm="12"> + <a-form-item label="璁惧缂栫爜"> + <a-input placeholder="" v-model="queryParam2.equipmentId"></a-input> + </a-form-item> + </a-col> + <span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> + <a-col :md="9" :sm="24"> + <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </a-col> + </span> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" :md="24" :sm="24"> + <a-button @click="handleAddDeviceInWorkshop" type="primary" icon="plus" style="margin-top: 16px" + >宸叉湁璁惧 + </a-button> + + <a-dropdown v-if="selectedRowKeys2.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel2"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> + 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 + <a style="font-weight: 600">{{ selectedRowKeys2.length }}</a + >椤� + <a style="margin-left: 24px" @click="onClearSelected2">娓呯┖</a> + </div> + <a-table + style="height: 500px" + ref="table2" + bordered + size="middle" + rowKey="equipmentId" + :columns="columns2" + :dataSource="dataSource2" + :pagination="ipagination2" + :loading="loading2" + :rowSelection="{ selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 }" + @change="handleTableChange2" + > + <span slot="action" slot-scope="text, record"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete2(record.equipmentId)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + </div> + </a-card> + </a-col> + <!-- 琛ㄥ崟鍖哄煙 --> + <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal> + <!--鏂板杞﹂棿--> + <select-device-modal ref="selectUserModal" @selectFinished="selectOK"></select-device-modal> + <!--宸叉湁璁惧--> + </a-row> +</template> +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { deleteAction, postAction, getAction } from '@/api/manage' +import SelectDeviceModal from './modules/SelectDeviceModal' +import WorkshopModal from './modules/WorkshopModal' +import { filterObj } from '@/utils/util' +import moment from 'moment' + +export default { + name: 'WorkshopSignageManagement', + mixins: [JeecgListMixin], + components: { + SelectDeviceModal, + WorkshopModal, + moment, + }, + data() { + return { + model1: {}, + model2: {}, + currentRoleId: '', + currentWorkshopId: '', + queryParam1: {}, + queryParam2: {}, + dataSource1: [], + dataSource2: [], + ipagination1: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + ipagination2: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + isorter1: { + column: 'createTime', + order: 'desc', + }, + isorter2: { + column: 'createTime', + order: 'desc', + }, + filters1: {}, + filters2: {}, + loading1: false, + loading2: false, + selectedRowKeys1: [], + selectedRowKeys2: [], + selectionRows1: [], + selectionRows2: [], + test: {}, + rightcolval: 0, + columns: [ + { + title: '杞﹂棿鍚嶇О', + align: 'center', + dataIndex: 'workshopName', + }, + { + title: '杞﹂棿鑳屾櫙鍥�', + dataIndex: 'backgroundImage', + align: 'center', + scopedSlots: { customRender: 'backgroundImage' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + columns2: [ + { + title: '璁惧缂栫爜', + align: 'center', + dataIndex: 'equipmentId', + width: 120, + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 100, + dataIndex: 'equipmentName', + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 80, + dataIndex: 'equipmentType', + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 120, + }, + ], + // 楂樼骇鏌ヨ鍙傛暟 + superQueryParams2: '', + // 楂樼骇鏌ヨ鎷兼帴鏉′欢 + superQueryMatchType2: 'and', + url: { + list: '/mdc/mdcWorkshopInfo/list', + delete: '/mdc/mdcWorkshopInfo/delete', + list2: '/mdc/mdcWorkshopInfo/workshopEquipmentList', + addDeviceInWorkshop: '/mdc/mdcWorkshopInfo/addWorkshopEquipment', + delete2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', + deleteBatch2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', + }, + } + }, + computed: { + leftColMd() { + return this.selectedRowKeys1.length === 0 ? 24 : 12 + }, + rightColMd() { + return this.selectedRowKeys1.length === 0 ? 0 : 12 + }, + }, + methods: { + onSelectChange2(selectedRowKeys, selectionRows) { + this.selectedRowKeys2 = selectedRowKeys + this.selectionRows2 = selectionRows + }, + onClearSelected2() { + this.selectedRowKeys2 = [] + this.selectionRows2 = [] + }, + onClearSelected1() { + this.selectedRowKeys1 = [] + this.selectionRows1 = [] + }, + onSelectChange1(selectedRowKeys, selectionRows) { + this.rightcolval = 1 + this.selectedRowKeys1 = selectedRowKeys + this.selectionRows1 = selectionRows + this.model1 = Object.assign({}, selectionRows[0]) + this.currentWorkshopId = selectedRowKeys[0] + this.loadData2() + }, + getQueryParams2() { + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if (this.superQueryParams2) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams2) + sqp['superQueryMatchType'] = this.superQueryMatchType2 + } + var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2) + param.field = this.getQueryField2() + param.pageNo = this.ipagination2.current + param.pageSize = this.ipagination2.pageSize + return filterObj(param) + }, + getQueryField2() { + //TODO 瀛楁鏉冮檺鎺у埗 + var str = 'id,' + this.columns2.forEach(function (value) { + str += ',' + value.dataIndex + }) + return str + }, + modalFormOk2() { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData2() + }, + loadData2(arg) { + if (!this.url.list2) { + this.$message.error('璇疯缃畊rl.list2灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination2.current = 1 + } + if (this.currentWorkshopId === '') return + let params = this.getQueryParams2() //鏌ヨ鏉′欢 + params.workshopId = this.currentWorkshopId + this.loading2 = true + getAction(this.url.list2, params).then((res) => { + if (res.success) { + this.dataSource2 = res.result.records + this.ipagination2.total = res.result.total + } + this.loading2 = false + }) + }, + handleDelete1: function (id) { + this.handleDelete(id) + this.dataSource2 = [] + this.currentRoleId = '' + }, + + /** + * 鐐瑰嚮璁惧琛ㄦ牸涓殑鍒犻櫎鎸夐挳鍚庤Е鍙戝垹闄ゅ崟涓溅闂翠笌璁惧鐨勫叧绯� + * @param equipmentId 褰撳墠琛岀殑璁惧缂栧彿 + */ + handleDelete2: function (equipmentId) { + if (!this.url.delete2) { + this.$message.error('璇疯缃畊rl.delete2灞炴��!') + return + } + var that = this + deleteAction(that.url.delete2, { workshopId: this.currentWorkshopId, equipmentId }).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData2() + } else { + that.$message.warning(res.message) + } + }) + }, + + /** + * 鎵归噺鍒犻櫎杞﹂棿涓庤澶囩殑鍏崇郴 + */ + batchDel2: function () { + if (!this.url.deleteBatch2) { + this.$message.error('璇疯缃畊rl.deleteBatch2灞炴��!') + return + } + if (this.selectedRowKeys2.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�', + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys2.length; a++) { + ids += this.selectedRowKeys2[a] + ',' + } + var that = this + this.$confirm({ + title: '纭鍒犻櫎', + content: '鏄惁鍒犻櫎閫変腑鏁版嵁?', + onOk: function () { + deleteAction(that.url.deleteBatch2, { + workshopId: that.currentWorkshopId, + equipmentIds: ids, + }).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData2() + that.onClearSelected() + } else { + that.$message.warning(res.message) + } + }) + }, + }) + } + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + let params = {} + params.workshopId = this.currentWorkshopId + params.equipmentIdList = [] + for (var a = 0; a < data.length; a++) { + params.equipmentIdList.push(data[a]) + } + console.log(params) + postAction(this.url.addDeviceInWorkshop, params).then((res) => { + if (res.success) { + this.loadData2() + this.$message.success(res.message) + } else { + this.$message.warning(res.message) + } + }) + }, + + /** + * 鐐瑰嚮宸叉湁璁惧鎸夐挳瑙﹀彂 + */ + handleAddDeviceInWorkshop() { + if (this.currentWorkshopId == '') { + this.$message.error('璇烽�夋嫨涓�涓溅闂�!') + } else { + this.$refs.selectUserModal.visible = true + this.$refs.selectUserModal.selectedRowKeys = [] + this.$refs.selectUserModal.selectedRows = [] + } + }, + + /** + * 鐐瑰嚮褰撳墠琛岃溅闂撮�夐」鍚庤Е鍙戜簨浠� + * @param record 褰撳墠琛屾暟鎹� + */ + handleOpen(record) { + this.rightcolval = 1 + this.selectedRowKeys1 = [record.id] + this.model1 = Object.assign({}, record) + this.currentWorkshopId = record.id + this.onClearSelected2() + this.loadData2() + }, + + searchQuery2() { + this.loadData2(1) + }, + searchReset2() { + this.queryParam2 = {} + this.loadData2(1) + }, + handleTableChange2(pagination, filters, sorter) { + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //TODO 绛涢�� + if (Object.keys(sorter).length > 0) { + this.isorter2.column = sorter.field + this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc' + } + this.ipagination2 = pagination + this.loadData2() + }, + hideUserList() { + //this.rightcolval = 0 + this.selectedRowKeys1 = [] + }, + }, +} +</script> +<style scoped> +/** Button鎸夐挳闂磋窛 */ +.ant-btn { + margin-left: 8px; +} +</style> \ No newline at end of file diff --git a/src/views/system/modules/SelectDeviceModal.vue b/src/views/system/modules/SelectDeviceModal.vue new file mode 100644 index 0000000..6d8ace1 --- /dev/null +++ b/src/views/system/modules/SelectDeviceModal.vue @@ -0,0 +1,256 @@ +<template> + <div> + <a-modal + centered + :title="title" + :width="1000" + :visible="visible" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + + <a-col :span="10"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> + </a-form-item> + </a-col> + <a-col :span="8"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + <!-- table鍖哄煙-begin --> + <div> + <a-table + size="small" + bordered + rowKey="equipmentId" + :columns="columns1" + :dataSource="dataSource1" + :pagination="ipagination" + :loading="loading" + :scroll="{ y: 240 }" + :rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + </a-modal> + </div> +</template> + +<script> + import { filterObj } from '@/utils/util' + import { getAction } from '@/api/manage' + + export default { + name: 'SelectDeviceModal', + data() { + return { + title: '娣诲姞宸叉湁璁惧', + names: [], + visible: false, + placement: 'right', + description: '', + // 鏌ヨ鏉′欢 + queryParam: {}, + // 琛ㄥご + columns1: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + width: 100, + dataIndex: 'equipmentId' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 100, + dataIndex: 'equipmentName' + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 100, + dataIndex: 'equipmentType' + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 100, + dataIndex: 'driveType' + } + ], + //鏁版嵁闆� + dataSource1: [], + dataSource2: [], + // 鍒嗛〉鍙傛暟 + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + loading: false, + selectedRowKeys: [], + selectedRows: [], + url: { + list: '/mdc/mdcEquipment/list' + } + } + }, + created() { + this.loadData() + }, + methods: { + searchQuery() { + this.loadData(1) + }, + searchReset() { + this.queryParam = {} + this.loadData(1) + }, + handleCancel() { + this.visible = false + }, + handleOk() { + this.dataSource2 = this.selectedRowKeys + console.log('data---------' + this.dataSource2) + if (this.dataSource2.length > 0) { + this.$emit('selectFinished', this.dataSource2) + } + this.visible = false + }, + add() { + this.visible = true + }, + loadData(arg) { + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + var params = this.getQueryParams()//鏌ヨ鏉′欢 + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource1 = res.result.records + this.ipagination.total = res.result.total + } + }) + }, + getQueryParams() { + var param = Object.assign({}, this.queryParam, this.isorter) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, + getQueryField() { + //TODO 瀛楁鏉冮檺鎺у埗 + }, + onSelectAll(selected, selectedRows, changeRows) { + if (selected === true) { + for (var a = 0; a < changeRows.length; a++) { + this.dataSource2.push(changeRows[a]) + } + } else { + for (var b = 0; b < changeRows.length; b++) { + this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1) + } + } + // console.log(selected, selectedRows, changeRows); + }, + onSelect(record, selected) { + console.log(this.selectedRowKeys) + if (selected === true) { + this.dataSource2.push(record) + } else { + var index = this.dataSource2.indexOf(record) + //console.log(); + if (index >= 0) { + this.dataSource2.splice(this.dataSource2.indexOf(record), 1) + } + } + }, + onSelectChange(selectedRowKeys, selectedRows) { + console.log('selectedRowKeys', selectedRowKeys) + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectedRows + }, + onClearSelected() { + this.selectedRowKeys = [] + this.selectionRows = [] + }, + handleDelete: function(record) { + this.dataSource2.splice(this.dataSource2.indexOf(record), 1) + }, + handleTableChange(pagination, filters, sorter) { + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + console.log(sorter) + //TODO 绛涢�� + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field + this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc' + } + this.ipagination = pagination + this.loadData() + } + } + } +</script> +<style lang="less" scoped> + .ant-card-body .table-operator { + margin-bottom: 18px; + } + + .ant-table-tbody .ant-table-row td { + padding-top: 15px; + padding-bottom: 15px; + } + + .anty-row-operator button { + margin: 0 5px + } + + .ant-btn-danger { + background-color: #ffffff + } + + .ant-modal-cust-warp { + height: 100% + } + + .ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto + } + + .ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden + } +</style> \ No newline at end of file diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index ce46390..d46bccf 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -238,9 +238,9 @@ //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害 this.resetScreenSize(); that.userId = record.id; + that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record); that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record); - //韬唤涓轰笂绾ф樉绀鸿礋璐i儴闂紝鍚﹀垯涓嶆樉绀� if(this.model.userIdentity==2){ this.departIdShow=true; @@ -252,7 +252,7 @@ that.getUserRoles(record.id); that.getUserDeparts(record.id); } - console.log('that.model=',that.model) + console.log('that.model',that.model) }, isDisabledAuth(code){ return disabledAuthFilter(code); @@ -366,8 +366,6 @@ return c; }) }, - - refresh () { this.userId="" diff --git a/src/views/system/modules/WorkshopModal.vue b/src/views/system/modules/WorkshopModal.vue new file mode 100644 index 0000000..5c74232 --- /dev/null +++ b/src/views/system/modules/WorkshopModal.vue @@ -0,0 +1,134 @@ +<template> + <a-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + wrapClassName="ant-modal-cust-warp" + style="top:5%;height: 85%;overflow-y: hidden"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> + <a-form-model-item label="杞﹂棿缂栧彿" required prop="id"> + <a-input v-model="model.id" :disabled="isEdit" placeholder="璇疯緭鍏ヨ溅闂寸紪鍙�"/> + </a-form-model-item> + <a-form-model-item label="杞﹂棿鍚嶇О" required prop="workshopName"> + <a-input v-model="model.workshopName" placeholder="璇疯緭鍏ヨ溅闂村悕绉�"/> + </a-form-model-item> + <a-form-model-item label="杞﹂棿鑳屾櫙鍥�" required prop="backgroundImage"> + <j-image-upload class="avatar-uploader" text="涓婁紶" v-model="model.backgroundImage"></j-image-upload> + </a-form-model-item> + </a-form-model> + </a-spin> + </a-modal> +</template> + +<script> + import api from '@/api/mdc' + + export default { + name: 'WorkshopModal', + data() { + return { + title: '鎿嶄綔', + visible: false, + isEdit: false, + model: {}, + layout: { + labelCol: { span: 3 }, + wrapperCol: { span: 14 } + }, + confirmLoading: false, + validatorRules: { + workshopName: [ + { required: true, message: '璇疯緭鍏ヨ溅闂村悕绉�!' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' } + ], + id: [ + { required: true, message: '璇疯緭鍏ヨ溅闂寸紪鍙�!' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateRoleCode } + ], + backgroundImage:[ + { required: true, message: '璇蜂笂浼犺溅闂磋儗鏅浘!' } + ] + } + } + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)) + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + //缂栬緫椤甸潰绂佹淇敼瑙掕壊缂栫爜 + if (this.model.id) { + this.isEdit = true + } else { + this.isEdit = false + } + }, + close() { + this.$refs.form.clearValidate() + this.$emit('close') + this.visible = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + console.log('瑙﹀彂') + that.confirmLoading = true + let obj + if (!this.isEdit) { + console.log('瑙﹀彂鏂板') + obj = api.addWorkshopApi(this.model) + } else { + console.log('瑙﹀彂淇敼') + obj = api.editWorkshopApi(this.model) + } + obj.then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + validateRoleCode(rule, value, callback) { + if (/[\u4E00-\u9FA5]/g.test(value)) { + callback('杞﹂棿缂栧彿涓嶅彲杈撳叆姹夊瓧!') + } else { + callback() + } + } + } + } +</script> + +<style scoped> + .avatar-uploader > .ant-upload { + width: 104px; + height: 104px; + } +</style> \ No newline at end of file -- Gitblit v1.9.3