Merge pull request 'projects/mesxc-zjl' (#324) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #324
This commit is contained in:
		| @@ -2,19 +2,30 @@ | |||||||
| 	<div class="choicepart-container"> | 	<div class="choicepart-container"> | ||||||
| 		<navbar /> | 		<navbar /> | ||||||
| 		<div class="choicepart-wrapper"> | 		<div class="choicepart-wrapper"> | ||||||
|       <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1710px;height:538px;'" v-show="showItem"> | 			<div | ||||||
|  | 				class="choicepart-box" | ||||||
|  | 				id="choicepartBox" | ||||||
|  | 				:style="'transform:scale(' + scale + ')'" | ||||||
|  | 				style="width: 1710px; height: 538px" | ||||||
|  | 				v-show="showItem"> | ||||||
| 				<div class="choicepart-line1"> | 				<div class="choicepart-line1"> | ||||||
| 					<div | 					<div | ||||||
| 						v-for="(item, index) in menuArr1" | 						v-for="(item, index) in menuArr1" | ||||||
| 						:key="index" | 						:key="index" | ||||||
| 						class="choicepart-item" | 						class="choicepart-item" | ||||||
| 						@click="handelClick(item, item.choicepart)" | 						@click="handelClick(item, item.choicepart)" | ||||||
|           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | 						:style="{ | ||||||
|         > | 							opacity: item.visible ? 1 : 0.4, | ||||||
|  | 							pointerEvents: item.visible ? 'auto' : 'none', | ||||||
|  | 						}"> | ||||||
| 						<div> | 						<div> | ||||||
|             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | 							<img | ||||||
|  | 								:src=" | ||||||
|  | 									require(`../../assets/images/choicepart/${item.name}.png`) | ||||||
|  | 								" | ||||||
|  | 								alt="" /> | ||||||
| 						</div> | 						</div> | ||||||
|           <div class="choicepart-item-title">{{item.meta.title}}</div> | 						<div class="choicepart-item-title">{{ item.meta.title }}</div> | ||||||
| 					</div> | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 				<div class="choicepart-line2"> | 				<div class="choicepart-line2"> | ||||||
| @@ -23,12 +34,18 @@ | |||||||
| 						:key="index" | 						:key="index" | ||||||
| 						class="choicepart-item" | 						class="choicepart-item" | ||||||
| 						@click="handelClick(item, item.choicepart)" | 						@click="handelClick(item, item.choicepart)" | ||||||
|           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | 						:style="{ | ||||||
|         > | 							opacity: item.visible ? 1 : 0.4, | ||||||
|  | 							pointerEvents: item.visible ? 'auto' : 'none', | ||||||
|  | 						}"> | ||||||
| 						<div> | 						<div> | ||||||
|             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | 							<img | ||||||
|  | 								:src=" | ||||||
|  | 									require(`../../assets/images/choicepart/${item.name}.png`) | ||||||
|  | 								" | ||||||
|  | 								alt="" /> | ||||||
| 						</div> | 						</div> | ||||||
|           <div class="choicepart-item-title">{{item.meta.title}}</div> | 						<div class="choicepart-item-title">{{ item.meta.title }}</div> | ||||||
| 					</div> | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| @@ -37,14 +54,13 @@ | |||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| import Navbar from './components/Navbar' | import Navbar from './components/Navbar'; | ||||||
| import { debounce } from '@/utils/debounce' | import { debounce } from '@/utils/debounce'; | ||||||
| export default { | export default { | ||||||
| 	components: { Navbar }, | 	components: { Navbar }, | ||||||
| 	name: 'choicePart', | 	name: 'choicePart', | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
|       boxReset: '', |  | ||||||
| 			scale: 1, | 			scale: 1, | ||||||
| 			menuArr1: [ | 			menuArr1: [ | ||||||
| 				{ | 				{ | ||||||
| @@ -52,65 +68,65 @@ export default { | |||||||
| 					title: '基础核心', | 					title: '基础核心', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Order', | 					name: 'Order', | ||||||
| 					title: '订单管理', | 					title: '订单管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Equipment', | 					name: 'Equipment', | ||||||
| 					title: '设备管理', | 					title: '设备管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Group', | 					name: 'Group', | ||||||
| 					title: '班组管理', | 					title: '班组管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Quality', | 					name: 'Quality', | ||||||
| 					title: '质量管理', | 					title: '质量管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Warehouse', | 					name: 'Warehouse', | ||||||
| 					title: '仓库管理', | 					title: '仓库管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Energy', | 					name: 'Energy', | ||||||
| 					title: '能源管理', | 					title: '能源管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Packaging', | 					name: 'Packaging', | ||||||
| 					title: '包装管理', | 					title: '包装管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
|         } | 				}, | ||||||
| 			], | 			], | ||||||
| 			menuArr2: [ | 			menuArr2: [ | ||||||
| 				{ | 				{ | ||||||
| @@ -118,16 +134,16 @@ export default { | |||||||
| 					title: '物料管理', | 					title: '物料管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Extend', | 					name: 'Extend', | ||||||
| 					title: '工艺管理', | 					title: '工艺管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				// { | 				// { | ||||||
| 				//   name: 'Delivery', | 				//   name: 'Delivery', | ||||||
| @@ -142,91 +158,94 @@ export default { | |||||||
| 					title: '报表管理', | 					title: '报表管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Cost', | 					name: 'Cost', | ||||||
| 					title: '成本管理', | 					title: '成本管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'SafetyEnvironmental', | 					name: 'SafetyEnvironmental', | ||||||
| 					title: '安环管理', | 					title: '安环管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'Databoard', | 					name: 'Databoard', | ||||||
| 					title: '数据驾驶舱', | 					title: '数据驾驶舱', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: 'System', | 					name: 'System', | ||||||
| 					title: '系统管理', | 					title: '系统管理', | ||||||
| 					visible: false, | 					visible: false, | ||||||
| 					meta: { | 					meta: { | ||||||
|             title: '' | 						title: '', | ||||||
|           } | 					}, | ||||||
|         } | 				}, | ||||||
| 			], | 			], | ||||||
|       showItem: false | 			showItem: false, | ||||||
|     } | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	// computed:{ | 	// computed:{ | ||||||
| 	//   ...mapGetters(['sidebarRouters']) | 	//   ...mapGetters(['sidebarRouters']) | ||||||
| 	// }, | 	// }, | ||||||
| 	mounted() { | 	mounted() { | ||||||
|     this.getMsg() | 		this.getMsg(); | ||||||
|     this.boxReset = debounce(() => { | 		this.boxReset(); | ||||||
|       this.resetSize() | 		window.addEventListener('resize', this.boxReset); | ||||||
|     }, 300) | 	}, | ||||||
|     this.boxReset() | 	destroyed() { | ||||||
|     window.addEventListener('resize', () => { | 		window.removeEventListener('resize', this.boxReset); | ||||||
|       this.boxReset() |  | ||||||
|     }) |  | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		boxReset() { | ||||||
|  | 			debounce(() => { | ||||||
|  | 				this.resetSize(); | ||||||
|  | 			}, 300)(); | ||||||
|  | 		}, | ||||||
| 		getMsg() { | 		getMsg() { | ||||||
|       let menuList = this.$store.state.permission.sidebarRouters | 			let menuList = this.$store.state.permission.sidebarRouters; | ||||||
|       console.log(menuList) | 			console.log(menuList); | ||||||
| 			if (menuList.length > 0) { | 			if (menuList.length > 0) { | ||||||
|         for (let i = 0; i < menuList.length; i ++) { | 				for (let i = 0; i < menuList.length; i++) { | ||||||
| 					for (let k = 0; k < 8; k++) { | 					for (let k = 0; k < 8; k++) { | ||||||
| 						if (menuList[i].name === this.menuArr1[k].name) { | 						if (menuList[i].name === this.menuArr1[k].name) { | ||||||
|               this.menuArr1[k].visible = true | 							this.menuArr1[k].visible = true; | ||||||
|               this.menuArr1[k].id = menuList[i].id | 							this.menuArr1[k].id = menuList[i].id; | ||||||
|               this.menuArr1[k].choicepart = i | 							this.menuArr1[k].choicepart = i; | ||||||
|               this.menuArr1[k].children = menuList[i].children | 							this.menuArr1[k].children = menuList[i].children; | ||||||
|               this.menuArr1[k].meta = menuList[i].meta | 							this.menuArr1[k].meta = menuList[i].meta; | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 					for (let j = 0; j < 7; j++) { | 					for (let j = 0; j < 7; j++) { | ||||||
| 						if (menuList[i].name === this.menuArr2[j].name) { | 						if (menuList[i].name === this.menuArr2[j].name) { | ||||||
|               this.menuArr2[j].visible = true | 							this.menuArr2[j].visible = true; | ||||||
|               this.menuArr2[j].id = menuList[i].id | 							this.menuArr2[j].id = menuList[i].id; | ||||||
|               this.menuArr2[j].choicepart = i | 							this.menuArr2[j].choicepart = i; | ||||||
|               this.menuArr2[j].children = menuList[i].children | 							this.menuArr2[j].children = menuList[i].children; | ||||||
|               this.menuArr2[j].meta = menuList[i].meta | 							this.menuArr2[j].meta = menuList[i].meta; | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|       console.log(this.menuArr1) | 			console.log(this.menuArr1); | ||||||
|       console.log(this.menuArr2) | 			console.log(this.menuArr2); | ||||||
| 		}, | 		}, | ||||||
| 		handelClick(item, index) { | 		handelClick(item, index) { | ||||||
| 			// this.$router.push({name: 'SystemUser'}) | 			// this.$router.push({name: 'SystemUser'}) | ||||||
|       this.$store.dispatch('app/setChoicepart', index) | 			this.$store.dispatch('app/setChoicepart', index); | ||||||
|       this.toRouter(item) | 			this.toRouter(item); | ||||||
| 			// if (item.meta.unuse) { | 			// if (item.meta.unuse) { | ||||||
| 			//   this.$message.warning(this.$t('暂无数据')) | 			//   this.$message.warning(this.$t('暂无数据')) | ||||||
| 			// } else { | 			// } else { | ||||||
| @@ -234,36 +253,36 @@ export default { | |||||||
| 			// } | 			// } | ||||||
| 		}, | 		}, | ||||||
| 		toRouter(item) { | 		toRouter(item) { | ||||||
|       console.log(item) | 			console.log(item); | ||||||
| 			if (item.children) { | 			if (item.children) { | ||||||
|         this.toRouter(item.children[0]) | 				this.toRouter(item.children[0]); | ||||||
| 			} else { | 			} else { | ||||||
|         this.$router.push({ name: item.name }) | 				this.$router.push({ name: item.name }); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		resetSize() { | 		resetSize() { | ||||||
|       let _this = this | 			let _this = this; | ||||||
|       _this.showItem = false | 			_this.showItem = false; | ||||||
|       _this.loading = true | 			_this.loading = true; | ||||||
|       let choicepartBox = document.querySelector('#choicepartBox') | 			let choicepartBox = document.querySelector('#choicepartBox'); | ||||||
|       let rw = parseFloat(window.innerWidth) | 			let rw = parseFloat(window.innerWidth); | ||||||
|       let rh = parseFloat(window.innerHeight) | 			let rh = parseFloat(window.innerHeight); | ||||||
|       let bw = parseFloat(choicepartBox.style.width) | 			let bw = parseFloat(choicepartBox.style.width); | ||||||
|       let bh = parseFloat(choicepartBox.style.height) | 			let bh = parseFloat(choicepartBox.style.height); | ||||||
|       let wx = 0.82/(bw / rw) | 			let wx = 0.82 / (bw / rw); | ||||||
|       let hx = 0.56/(bh / rh) | 			let hx = 0.56 / (bh / rh); | ||||||
|       _this.scale = wx > hx ? hx : wx | 			_this.scale = wx > hx ? hx : wx; | ||||||
|       setTimeout(_this.showItemFun, 700) | 			setTimeout(_this.showItemFun, 700); | ||||||
| 		}, | 		}, | ||||||
| 		showItemFun() { | 		showItemFun() { | ||||||
|       this.loading = false | 			this.loading = false; | ||||||
|       this.showItem = true | 			this.showItem = true; | ||||||
|     } | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	beforeDestroy() { | 	beforeDestroy() { | ||||||
|     this.showItem = false | 		this.showItem = false; | ||||||
|   } | 	}, | ||||||
| } | }; | ||||||
| </script> | </script> | ||||||
| <style lang='scss' scoped> | <style lang='scss' scoped> | ||||||
| .choicepart-container { | .choicepart-container { | ||||||
| @@ -296,7 +315,8 @@ export default { | |||||||
| 		.choicepart-item { | 		.choicepart-item { | ||||||
| 			width: 184px; | 			width: 184px; | ||||||
| 			height: 224px; | 			height: 224px; | ||||||
|       background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat; | 			background: url('../../assets/images/choicepart/choice-item-back.png') | ||||||
|  | 				no-repeat; | ||||||
| 			background-size: 100% 100%; | 			background-size: 100% 100%; | ||||||
| 			border-radius: 5px; | 			border-radius: 5px; | ||||||
| 			overflow: hidden; | 			overflow: hidden; | ||||||
| @@ -334,7 +354,7 @@ export default { | |||||||
| 	.choicepart-footer { | 	.choicepart-footer { | ||||||
| 		position: absolute; | 		position: absolute; | ||||||
| 		width: 100%; | 		width: 100%; | ||||||
|     color: #C7C7C7; | 		color: #c7c7c7; | ||||||
| 		user-select: none; | 		user-select: none; | ||||||
| 		font-size: 12px; | 		font-size: 12px; | ||||||
| 		letter-spacing: 1px; | 		letter-spacing: 1px; | ||||||
|   | |||||||
| @@ -1,8 +1,11 @@ | |||||||
| <template> | <template> | ||||||
| 	<div id='deepProcessingContainerB' ref='deepProcessingContainerB' style="width: 100%;height: 100%;"> |  | ||||||
| 	<div | 	<div | ||||||
| 			id='deepProcessingContainer' | 		id="deepProcessingContainerB" | ||||||
| 			ref='deepProcessingContainer' | 		ref="deepProcessingContainerB" | ||||||
|  | 		style="width: 100%; height: 100%"> | ||||||
|  | 		<div | ||||||
|  | 			id="deepProcessingContainer" | ||||||
|  | 			ref="deepProcessingContainer" | ||||||
| 			class="deepProcessingBoard" | 			class="deepProcessingBoard" | ||||||
| 			style=" | 			style=" | ||||||
| 				position: absolute; | 				position: absolute; | ||||||
| @@ -16,15 +19,14 @@ | |||||||
| 				flex-direction: column; | 				flex-direction: column; | ||||||
| 				gap: 24px; | 				gap: 24px; | ||||||
| 			" | 			" | ||||||
| 			:style="{transform:'scale('+scaleNum+')'}"> | 			:style="{ transform: 'scale(' + scaleNum + ')' }"> | ||||||
| 			<KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='深加工生产运行驾驶舱'/> | 			<KHeader | ||||||
|  | 				:isFullScreen="isFullScreen" | ||||||
|  | 				@screenfullChange="screenfullChange" | ||||||
|  | 				topTitle="深加工生产运行驾驶舱" /> | ||||||
| 			<div | 			<div | ||||||
| 				class="main-body" | 				class="main-body" | ||||||
| 				style=" | 				style="display: grid; gap: 16px; grid-template-rows: 462px 462px"> | ||||||
| 					display: grid; |  | ||||||
| 					gap: 16px; |  | ||||||
| 					grid-template-rows: 462px 462px; |  | ||||||
| 				"> |  | ||||||
| 				<TopThree /> | 				<TopThree /> | ||||||
| 				<BottomTwo /> | 				<BottomTwo /> | ||||||
| 			</div> | 			</div> | ||||||
| @@ -47,16 +49,16 @@ | |||||||
| import KHeader from '../components/Header'; | import KHeader from '../components/Header'; | ||||||
| import TopThree from './TopThree'; | import TopThree from './TopThree'; | ||||||
| import BottomTwo from './BottomTwo'; | import BottomTwo from './BottomTwo'; | ||||||
| import screenfull from 'screenfull' | import screenfull from 'screenfull'; | ||||||
| import { debounce } from '@/utils/debounce' | import { debounce } from '@/utils/debounce'; | ||||||
| import { getDcsMsg, getMesMsg } from './../utils/wsInterface' | import { getDcsMsg, getMesMsg } from './../utils/wsInterface'; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	name: 'deepProcessingBoard', | 	name: 'deepProcessingBoard', | ||||||
| 	components: { | 	components: { | ||||||
| 		KHeader, | 		KHeader, | ||||||
| 		TopThree, | 		TopThree, | ||||||
| 		BottomTwo | 		BottomTwo, | ||||||
| 	}, | 	}, | ||||||
| 	// provide() { | 	// provide() { | ||||||
| 	// 	return { | 	// 	return { | ||||||
| @@ -66,43 +68,52 @@ export default { | |||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isFullScreen: false, | 			isFullScreen: false, | ||||||
| 			scaleNum: 0.8 | 			scaleNum: 0.8, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	created() { | 	created() { | ||||||
| 		this.init() | 		this.init(); | ||||||
| 	}, | 	}, | ||||||
| 	destroy() { | 	destroy() { | ||||||
| 		this.destroy() | 		this.destroy(); | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.boxReset = debounce(() => { | 		this.boxReset = debounce(() => { | ||||||
|       this.resetSize() | 			this.resetSize(); | ||||||
|     }, 300) | 		}, 300); | ||||||
|     this.boxReset() | 		this.boxReset(); | ||||||
| 		window.addEventListener('resize', () => { | 		window.addEventListener('resize', () => { | ||||||
|       this.boxReset() | 			this.boxReset(); | ||||||
|     }) | 		}); | ||||||
| 		// closeWebsocket() | 		// closeWebsocket() | ||||||
| 		// getDcsMsg() | 		// getDcsMsg() | ||||||
| 		// getMesMsg() | 		// getMesMsg() | ||||||
| 		console.log('mounted...........') | 	}, | ||||||
|  | 	mounted() { | ||||||
|  | 		this.boxReset(); | ||||||
|  | 		window.addEventListener('resize', this.boxReset); | ||||||
| 	}, | 	}, | ||||||
| 	destroyed() { | 	destroyed() { | ||||||
| 		console.log('destroyed...........') | 		window.removeEventListener('resize', this.boxReset); | ||||||
|  | 		this.destroy(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		boxReset() { | ||||||
|  | 			debounce(() => { | ||||||
|  | 				this.resetSize(); | ||||||
|  | 			}, 300)(); | ||||||
|  | 		}, | ||||||
| 		change() { | 		change() { | ||||||
|       this.isFullScreen = screenfull.isFullscreen | 			this.isFullScreen = screenfull.isFullscreen; | ||||||
| 		}, | 		}, | ||||||
| 		init() { | 		init() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.on('change', this.change) | 				screenfull.on('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		destroy() { | 		destroy() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.off('change', this.change) | 				screenfull.off('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		// 全屏 | 		// 全屏 | ||||||
| @@ -110,39 +121,37 @@ export default { | |||||||
| 			if (!screenfull.isEnabled) { | 			if (!screenfull.isEnabled) { | ||||||
| 				this.$message({ | 				this.$message({ | ||||||
| 					message: 'you browser can not work', | 					message: 'you browser can not work', | ||||||
|           type: 'warning' | 					type: 'warning', | ||||||
|         }) | 				}); | ||||||
|         return false | 				return false; | ||||||
| 			} | 			} | ||||||
|       screenfull.toggle(this.$refs.deepProcessingContainerB) | 			screenfull.toggle(this.$refs.deepProcessingContainerB); | ||||||
| 		}, | 		}, | ||||||
| 		resetSize() { | 		resetSize() { | ||||||
|       let deepProcessingContainer = document.getElementById('deepProcessingContainer') | 			let deepProcessingContainer = document.getElementById( | ||||||
|       let rw = parseFloat(window.innerWidth) | 				'deepProcessingContainer' | ||||||
|       let rh = parseFloat(window.innerHeight) | 			); | ||||||
|       let bw = parseFloat(deepProcessingContainer.style.width) | 			let rw = parseFloat(window.innerWidth); | ||||||
|       let bh = parseFloat(deepProcessingContainer.style.height) | 			let rh = parseFloat(window.innerHeight); | ||||||
| 			let wx = 0 | 			let bw = parseFloat(deepProcessingContainer.style.width); | ||||||
| 			let hx = 0 | 			let bh = parseFloat(deepProcessingContainer.style.height); | ||||||
|  | 			let wx = 0; | ||||||
|  | 			let hx = 0; | ||||||
| 			if (screenfull.isFullscreen) { | 			if (screenfull.isFullscreen) { | ||||||
| 				console.log('全屏') | 				wx = rw / bw; | ||||||
| 				wx = rw / bw | 				hx = rh / bh; | ||||||
| 				hx = rh / bh | 			} else { | ||||||
| 				console.log(this.scaleNum) |  | ||||||
| 			}else{ |  | ||||||
| 				console.log('非全屏') |  | ||||||
| 				console.log(this.$store.state.app.sidebar.opened) |  | ||||||
| 				if (this.$store.state.app.sidebar.opened) { | 				if (this.$store.state.app.sidebar.opened) { | ||||||
| 					wx = (rw-280) / bw | 					wx = (rw - 280) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				}else{ | 				} else { | ||||||
| 					wx = (rw-85) / bw | 					wx = (rw - 85) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 			this.scaleNum = wx |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  | 			this.scaleNum = wx; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,8 +1,11 @@ | |||||||
| <template> | <template> | ||||||
| 	<div id='kilnContainerB' ref='kilnContainerB' style="width: 100%;height: 100%;"> |  | ||||||
| 	<div | 	<div | ||||||
| 			id='kilnContainer' | 		id="kilnContainerB" | ||||||
| 			ref='kilnContainer' | 		ref="kilnContainerB" | ||||||
|  | 		style="width: 100%; height: 100%"> | ||||||
|  | 		<div | ||||||
|  | 			id="kilnContainer" | ||||||
|  | 			ref="kilnContainer" | ||||||
| 			class="KilnDataBoard" | 			class="KilnDataBoard" | ||||||
| 			style=" | 			style=" | ||||||
| 				position: absolute; | 				position: absolute; | ||||||
| @@ -16,15 +19,22 @@ | |||||||
| 				flex-direction: column; | 				flex-direction: column; | ||||||
| 				gap: 24px; | 				gap: 24px; | ||||||
| 			" | 			" | ||||||
| 			:style="{transform:'scale('+scaleNum+')'}"> | 			:style="{ transform: 'scale(' + scaleNum + ')' }"> | ||||||
| 			<KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='窑炉生产运行驾驶舱'/> | 			<KHeader | ||||||
|  | 				:isFullScreen="isFullScreen" | ||||||
|  | 				@screenfullChange="screenfullChange" | ||||||
|  | 				topTitle="窑炉生产运行驾驶舱" /> | ||||||
| 			<div | 			<div | ||||||
| 				class="main-body" | 				class="main-body" | ||||||
| 				style="flex: 1; display: flex; gap: 20px; padding: 0px 16px"> | 				style="flex: 1; display: flex; gap: 20px; padding: 0px 16px"> | ||||||
| 				<div class="left-side" style="flex: 2"> | 				<div | ||||||
|  | 					class="left-side" | ||||||
|  | 					style="flex: 2"> | ||||||
| 					<LeftFour /> | 					<LeftFour /> | ||||||
| 				</div> | 				</div> | ||||||
| 				<div class="right-side" style="flex: 1"> | 				<div | ||||||
|  | 					class="right-side" | ||||||
|  | 					style="flex: 1"> | ||||||
| 					<RightTwo /> | 					<RightTwo /> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| @@ -36,8 +46,8 @@ | |||||||
| import KHeader from '../components/Header'; | import KHeader from '../components/Header'; | ||||||
| import LeftFour from './LeftFour'; | import LeftFour from './LeftFour'; | ||||||
| import RightTwo from './RightTwo.vue'; | import RightTwo from './RightTwo.vue'; | ||||||
| import screenfull from 'screenfull' | import screenfull from 'screenfull'; | ||||||
| import { debounce } from '@/utils/debounce' | import { debounce } from '@/utils/debounce'; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	name: 'Kiln', | 	name: 'Kiln', | ||||||
| @@ -46,10 +56,10 @@ export default { | |||||||
| 		LeftFour, | 		LeftFour, | ||||||
| 		RightTwo, | 		RightTwo, | ||||||
| 	}, | 	}, | ||||||
| 	computed:{ | 	computed: { | ||||||
| 		sidebarStatus() { | 		sidebarStatus() { | ||||||
| 			return this.$store.state.app.sidebar.opened; | 			return this.$store.state.app.sidebar.opened; | ||||||
| 		} | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	// provide() { | 	// provide() { | ||||||
| 	// 	return { | 	// 	return { | ||||||
| @@ -59,43 +69,44 @@ export default { | |||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isFullScreen: false, | 			isFullScreen: false, | ||||||
| 			scaleNum: 0.8 | 			scaleNum: 0.8, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	watch: { | 	watch: { | ||||||
| 		sidebarStatus() { | 		sidebarStatus() { | ||||||
| 			this.boxReset() | 			this.boxReset(); | ||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	created() { | 	created() { | ||||||
| 		this.init() | 		this.init(); | ||||||
| 	}, |  | ||||||
| 	destroy() { |  | ||||||
| 		this.destroy() |  | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.boxReset = debounce(() => { | 		this.boxReset(); | ||||||
|       this.resetSize() | 		window.addEventListener('resize', this.boxReset); | ||||||
|     }, 300) | 	}, | ||||||
|     this.boxReset() | 	destroyed() { | ||||||
|     window.addEventListener('resize', () => { | 		window.removeEventListener('resize', this.boxReset); | ||||||
|       this.boxReset() | 		this.destroy(); | ||||||
|     }) |  | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		boxReset() { | ||||||
|  | 			debounce(() => { | ||||||
|  | 				this.resetSize(); | ||||||
|  | 			}, 300)(); | ||||||
|  | 		}, | ||||||
| 		change() { | 		change() { | ||||||
|       this.isFullScreen = screenfull.isFullscreen | 			this.isFullScreen = screenfull.isFullscreen; | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		init() { | 		init() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.on('change', this.change) | 				screenfull.on('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		destroy() { | 		destroy() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.off('change', this.change) | 				screenfull.off('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		// 全屏 | 		// 全屏 | ||||||
| @@ -103,40 +114,35 @@ export default { | |||||||
| 			if (!screenfull.isEnabled) { | 			if (!screenfull.isEnabled) { | ||||||
| 				this.$message({ | 				this.$message({ | ||||||
| 					message: 'you browser can not work', | 					message: 'you browser can not work', | ||||||
|           type: 'warning' | 					type: 'warning', | ||||||
|         }) | 				}); | ||||||
|         return false | 				return false; | ||||||
| 			} | 			} | ||||||
|       screenfull.toggle(this.$refs.kilnContainerB) | 			screenfull.toggle(this.$refs.kilnContainerB); | ||||||
| 		}, | 		}, | ||||||
| 		resetSize() { | 		resetSize() { | ||||||
|       let kilnContainerBox = document.getElementById('kilnContainer') | 			let kilnContainerBox = document.getElementById('kilnContainer'); | ||||||
| 			console.log(kilnContainerBox) | 			let rw = parseFloat(window.innerWidth); | ||||||
|       let rw = parseFloat(window.innerWidth) | 			let rh = parseFloat(window.innerHeight); | ||||||
|       let rh = parseFloat(window.innerHeight) | 			let bw = parseFloat(kilnContainerBox.style.width); | ||||||
|       let bw = parseFloat(kilnContainerBox.style.width) | 			let bh = parseFloat(kilnContainerBox.style.height); | ||||||
|       let bh = parseFloat(kilnContainerBox.style.height) | 			let wx = 0; | ||||||
| 			let wx = 0 | 			let hx = 0; | ||||||
| 			let hx = 0 |  | ||||||
| 			if (screenfull.isFullscreen) { | 			if (screenfull.isFullscreen) { | ||||||
| 				console.log('全屏') | 				wx = rw / bw; | ||||||
| 				wx = rw / bw | 				hx = rh / bh; | ||||||
| 				hx = rh / bh | 			} else { | ||||||
| 				console.log(this.scaleNum) |  | ||||||
| 			}else{ |  | ||||||
| 				console.log('非全屏') |  | ||||||
| 				console.log(this.$store.state.app.sidebar.opened) |  | ||||||
| 				if (this.$store.state.app.sidebar.opened) { | 				if (this.$store.state.app.sidebar.opened) { | ||||||
| 					wx = (rw-280) / bw | 					wx = (rw - 280) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				}else{ | 				} else { | ||||||
| 					wx = (rw-85) / bw | 					wx = (rw - 85) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 			this.scaleNum = wx |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  | 			this.scaleNum = wx; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,8 +1,11 @@ | |||||||
| <template> | <template> | ||||||
| 	<div id='wholePlantContainerB' ref='wholePlantContainerB' style="width: 100%;height: 100%;"> |  | ||||||
| 	<div | 	<div | ||||||
| 			id='wholePlantContainer' | 		id="wholePlantContainerB" | ||||||
| 			ref='wholePlantContainer' | 		ref="wholePlantContainerB" | ||||||
|  | 		style="width: 100%; height: 100%"> | ||||||
|  | 		<div | ||||||
|  | 			id="wholePlantContainer" | ||||||
|  | 			ref="wholePlantContainer" | ||||||
| 			class="wholePlantBoard" | 			class="wholePlantBoard" | ||||||
| 			style=" | 			style=" | ||||||
| 				position: absolute; | 				position: absolute; | ||||||
| @@ -16,18 +19,27 @@ | |||||||
| 				flex-direction: column; | 				flex-direction: column; | ||||||
| 				gap: 24px; | 				gap: 24px; | ||||||
| 			" | 			" | ||||||
| 			:style="{transform:'scale('+scaleNum+')'}"> | 			:style="{ transform: 'scale(' + scaleNum + ')' }"> | ||||||
| 			<KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='全厂总览驾驶舱'/> | 			<KHeader | ||||||
|  | 				:isFullScreen="isFullScreen" | ||||||
|  | 				@screenfullChange="screenfullChange" | ||||||
|  | 				topTitle="全厂总览驾驶舱" /> | ||||||
| 			<div | 			<div | ||||||
| 				class="main-body" | 				class="main-body" | ||||||
| 				style="flex: 1; display: flex; gap: 20px; padding: 0px 16px"> | 				style="flex: 1; display: flex; gap: 20px; padding: 0px 16px"> | ||||||
| 				<div class="left-side" style="flex: 1"> | 				<div | ||||||
|  | 					class="left-side" | ||||||
|  | 					style="flex: 1"> | ||||||
| 					<LeftTwo /> | 					<LeftTwo /> | ||||||
| 				</div> | 				</div> | ||||||
| 				<div class="middle-side" style="flex: 1"> | 				<div | ||||||
|  | 					class="middle-side" | ||||||
|  | 					style="flex: 1"> | ||||||
| 					<MiddleTwo /> | 					<MiddleTwo /> | ||||||
| 				</div> | 				</div> | ||||||
| 				<div class="right-side" style="flex: 1"> | 				<div | ||||||
|  | 					class="right-side" | ||||||
|  | 					style="flex: 1"> | ||||||
| 					<RightTwo /> | 					<RightTwo /> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| @@ -40,8 +52,8 @@ import KHeader from '../components/Header'; | |||||||
| import LeftTwo from './LeftTwo'; | import LeftTwo from './LeftTwo'; | ||||||
| import MiddleTwo from './MiddleTwo'; | import MiddleTwo from './MiddleTwo'; | ||||||
| import RightTwo from './RightTwo'; | import RightTwo from './RightTwo'; | ||||||
| import screenfull from 'screenfull' | import screenfull from 'screenfull'; | ||||||
| import { debounce } from '@/utils/debounce' | import { debounce } from '@/utils/debounce'; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	name: 'wholePlantBoard', | 	name: 'wholePlantBoard', | ||||||
| @@ -49,7 +61,7 @@ export default { | |||||||
| 		KHeader, | 		KHeader, | ||||||
| 		LeftTwo, | 		LeftTwo, | ||||||
| 		MiddleTwo, | 		MiddleTwo, | ||||||
| 		RightTwo | 		RightTwo, | ||||||
| 	}, | 	}, | ||||||
| 	// provide() { | 	// provide() { | ||||||
| 	// 	return { | 	// 	return { | ||||||
| @@ -59,40 +71,39 @@ export default { | |||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isFullScreen: false, | 			isFullScreen: false, | ||||||
| 			scaleNum: 0.8 | 			scaleNum: 0.8, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	created() { | 	created() { | ||||||
| 		this.init() | 		this.init(); | ||||||
| 	}, | 	}, | ||||||
| 	destroy() { | 	destroy() { | ||||||
| 		this.destroy() | 		this.destroy(); | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.boxReset = debounce(() => { | 		this.boxReset(); | ||||||
|       this.resetSize() | 		window.addEventListener('resize', this.boxReset); | ||||||
|     }, 300) |  | ||||||
|     this.boxReset() |  | ||||||
|     window.addEventListener('resize', () => { |  | ||||||
|       this.boxReset() |  | ||||||
|     }) |  | ||||||
| 		console.log('mounted...........') |  | ||||||
| 	}, | 	}, | ||||||
| 	destroyed() { | 	destroyed() { | ||||||
| 		console.log('destroyed...........') | 		window.removeEventListener('resize', this.boxReset); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		boxReset() { | ||||||
|  | 			debounce(() => { | ||||||
|  | 				this.resetSize(); | ||||||
|  | 			}, 300)(); | ||||||
|  | 		}, | ||||||
| 		change() { | 		change() { | ||||||
|       this.isFullScreen = screenfull.isFullscreen | 			this.isFullScreen = screenfull.isFullscreen; | ||||||
| 		}, | 		}, | ||||||
| 		init() { | 		init() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.on('change', this.change) | 				screenfull.on('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		destroy() { | 		destroy() { | ||||||
| 			if (screenfull.isEnabled) { | 			if (screenfull.isEnabled) { | ||||||
|         screenfull.off('change', this.change) | 				screenfull.off('change', this.change); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		// 全屏 | 		// 全屏 | ||||||
| @@ -100,39 +111,37 @@ export default { | |||||||
| 			if (!screenfull.isEnabled) { | 			if (!screenfull.isEnabled) { | ||||||
| 				this.$message({ | 				this.$message({ | ||||||
| 					message: 'you browser can not work', | 					message: 'you browser can not work', | ||||||
|           type: 'warning' | 					type: 'warning', | ||||||
|         }) | 				}); | ||||||
|         return false | 				return false; | ||||||
| 			} | 			} | ||||||
|       screenfull.toggle(this.$refs.wholePlantContainerB) | 			screenfull.toggle(this.$refs.wholePlantContainerB); | ||||||
| 		}, | 		}, | ||||||
| 		resetSize() { | 		resetSize() { | ||||||
|       let wholePlantContainerBox = document.getElementById('wholePlantContainer') | 			let wholePlantContainerBox = document.getElementById( | ||||||
|       let rw = parseFloat(window.innerWidth) | 				'wholePlantContainer' | ||||||
|       let rh = parseFloat(window.innerHeight) | 			); | ||||||
|       let bw = parseFloat(wholePlantContainerBox.style.width) | 			let rw = parseFloat(window.innerWidth); | ||||||
|       let bh = parseFloat(wholePlantContainerBox.style.height) | 			let rh = parseFloat(window.innerHeight); | ||||||
| 			let wx = 0 | 			let bw = parseFloat(wholePlantContainerBox.style.width); | ||||||
| 			let hx = 0 | 			let bh = parseFloat(wholePlantContainerBox.style.height); | ||||||
|  | 			let wx = 0; | ||||||
|  | 			let hx = 0; | ||||||
| 			if (screenfull.isFullscreen) { | 			if (screenfull.isFullscreen) { | ||||||
| 				console.log('全屏') | 				wx = rw / bw; | ||||||
| 				wx = rw / bw | 				hx = rh / bh; | ||||||
| 				hx = rh / bh | 			} else { | ||||||
| 				console.log(this.scaleNum) |  | ||||||
| 			}else{ |  | ||||||
| 				console.log('非全屏') |  | ||||||
| 				console.log(this.$store.state.app.sidebar.opened) |  | ||||||
| 				if (this.$store.state.app.sidebar.opened) { | 				if (this.$store.state.app.sidebar.opened) { | ||||||
| 					wx = (rw-280) / bw | 					wx = (rw - 280) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				}else{ | 				} else { | ||||||
| 					wx = (rw-85) / bw | 					wx = (rw - 85) / bw; | ||||||
| 					hx = (rh-116) / bh | 					hx = (rh - 116) / bh; | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 			this.scaleNum = wx |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  | 			this.scaleNum = wx; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,8 +1,7 @@ | |||||||
| <template> | <template> | ||||||
| 	<div | 	<div | ||||||
| 		class="searchBarBox divHeight" | 		class="searchBarBox divHeight" | ||||||
| 		ref="searchBarRef" | 		ref="searchBarRef"> | ||||||
| 		:style="{ paddingRight: isFold ? '55px' : '0px' }"> |  | ||||||
| 		<el-form | 		<el-form | ||||||
| 			:inline="true" | 			:inline="true" | ||||||
| 			class="demo-form-inline"> | 			class="demo-form-inline"> | ||||||
| @@ -200,13 +199,6 @@ | |||||||
| 				</el-button> | 				</el-button> | ||||||
| 			</el-form-item> | 			</el-form-item> | ||||||
| 		</el-form> | 		</el-form> | ||||||
| 		<span |  | ||||||
| 			v-if="isFold" |  | ||||||
| 			class="foldClass" |  | ||||||
| 			@click="switchMode"> |  | ||||||
| 			{{ isExpand ? '收起' : '展开' }} |  | ||||||
| 			<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" /> |  | ||||||
| 		</span> |  | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| @@ -217,16 +209,8 @@ import { getFactoryList } from '@/api/core/base/factory'; | |||||||
| import moment from 'moment'; | import moment from 'moment'; | ||||||
| export default { | export default { | ||||||
| 	name: 'searchArea', | 	name: 'searchArea', | ||||||
| 	props: { |  | ||||||
| 		isFold: { |  | ||||||
| 			// 多行模式(默认否) |  | ||||||
| 			type: Boolean, |  | ||||||
| 			default: false, |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isExpand: false, // 展开收起 |  | ||||||
| 			// 查询参数 | 			// 查询参数 | ||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				energyTypeId: null, | 				energyTypeId: null, | ||||||
| @@ -525,16 +509,6 @@ export default { | |||||||
| 			let value = new Date(newData).getTime(); | 			let value = new Date(newData).getTime(); | ||||||
| 			return value; | 			return value; | ||||||
| 		}, | 		}, | ||||||
| 		switchMode() { |  | ||||||
| 			// 展开和收起切换 |  | ||||||
| 			this.isExpand = !this.isExpand; |  | ||||||
| 			const element = this.$refs.searchBarRef; |  | ||||||
| 			if (this.isExpand) { |  | ||||||
| 				element.classList.remove('divHeight'); |  | ||||||
| 			} else { |  | ||||||
| 				element.classList.add('divHeight'); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| @@ -573,21 +547,6 @@ export default { | |||||||
| 		margin-bottom: 4px; | 		margin-bottom: 4px; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| .searchBarBox .foldClass { |  | ||||||
| 	position: absolute; |  | ||||||
| 	top: 14px; |  | ||||||
| 	right: 0; |  | ||||||
| 	cursor: pointer; |  | ||||||
| 	font-size: 12px; |  | ||||||
| 	color: #0b58ff; |  | ||||||
| } |  | ||||||
| .searchBarBox .foldClass .iconfont { |  | ||||||
| 	font-size: 14px; |  | ||||||
| } |  | ||||||
| .divHeight { |  | ||||||
| 	height: 45px; |  | ||||||
| 	overflow: hidden; |  | ||||||
| } |  | ||||||
| .separateStyle { | .separateStyle { | ||||||
| 	display: inline-block; | 	display: inline-block; | ||||||
| 	width: 1px; | 	width: 1px; | ||||||
|   | |||||||
| @@ -4,7 +4,6 @@ | |||||||
| 		id="contrastAnalysisBox"> | 		id="contrastAnalysisBox"> | ||||||
| 		<!-- 搜索工作栏 --> | 		<!-- 搜索工作栏 --> | ||||||
| 		<search-area | 		<search-area | ||||||
| 			:isFold="isFold" |  | ||||||
| 			@submit="getList" | 			@submit="getList" | ||||||
| 			@export="exportExl" /> | 			@export="exportExl" /> | ||||||
| 		<div v-show="chartData.length"> | 		<div v-show="chartData.length"> | ||||||
| @@ -38,7 +37,6 @@ export default { | |||||||
| 	mixins: [tableHeightMixin], | 	mixins: [tableHeightMixin], | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isFold: false, |  | ||||||
| 			chartData: [], | 			chartData: [], | ||||||
| 			timeDim: '', | 			timeDim: '', | ||||||
| 			tableProps: [], | 			tableProps: [], | ||||||
| @@ -46,13 +44,6 @@ export default { | |||||||
| 			tableH: this.tableHeight(250) / 2, | 			tableH: this.tableHeight(250) / 2, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { |  | ||||||
| 		window.addEventListener('resize', () => { |  | ||||||
| 			this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437); |  | ||||||
| 			// console.log(document.getElementById("contrastAnalysisBox").offsetWidth) |  | ||||||
| 		}); |  | ||||||
| 		this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437); |  | ||||||
| 	}, |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		_setTableHeight() { | 		_setTableHeight() { | ||||||
| 			this.tableH = this.tableHeight(250) / 2; | 			this.tableH = this.tableHeight(250) / 2; | ||||||
|   | |||||||
| @@ -1,8 +1,7 @@ | |||||||
| <template> | <template> | ||||||
| 	<div | 	<div | ||||||
| 		class="searchBarBox divHeight" | 		class="searchBarBox" | ||||||
| 		ref="searchBarRef" | 		ref="searchBarRef"> | ||||||
| 		:style="{ paddingRight: isFold ? '55px' : '0px' }"> |  | ||||||
| 		<el-form | 		<el-form | ||||||
| 			:inline="true" | 			:inline="true" | ||||||
| 			class="demo-form-inline"> | 			class="demo-form-inline"> | ||||||
| @@ -172,9 +171,9 @@ | |||||||
| 				</el-button> | 				</el-button> | ||||||
| 				<span | 				<span | ||||||
| 					class="separateStyle" | 					class="separateStyle" | ||||||
| 					v-hasPermi="['analysis:trend-analysis:export']"></span> | 					v-hasPermi="['analysis:energy-analysis:query']"></span> | ||||||
| 				<el-button | 				<el-button | ||||||
| 					v-hasPermi="['analysis:trend-analysis:export']" | 					v-hasPermi="['analysis:energy-analysis:query']" | ||||||
| 					type="primary" | 					type="primary" | ||||||
| 					size="small" | 					size="small" | ||||||
| 					plain | 					plain | ||||||
| @@ -183,13 +182,6 @@ | |||||||
| 				</el-button> | 				</el-button> | ||||||
| 			</el-form-item> | 			</el-form-item> | ||||||
| 		</el-form> | 		</el-form> | ||||||
| 		<span |  | ||||||
| 			v-if="isFold" |  | ||||||
| 			class="foldClass" |  | ||||||
| 			@click="switchMode"> |  | ||||||
| 			{{ isExpand ? '收起' : '展开' }} |  | ||||||
| 			<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" /> |  | ||||||
| 		</span> |  | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| @@ -198,16 +190,8 @@ import { getEnergyTypeListAll } from '@/api/base/energyType'; | |||||||
| import moment from 'moment'; | import moment from 'moment'; | ||||||
| export default { | export default { | ||||||
| 	name: 'searchArea', | 	name: 'searchArea', | ||||||
| 	props: { |  | ||||||
| 		isFold: { |  | ||||||
| 			// 多行模式(默认否) |  | ||||||
| 			type: Boolean, |  | ||||||
| 			default: false, |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isExpand: false, // 展开收起 |  | ||||||
| 			// 查询参数 | 			// 查询参数 | ||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				energyTypeId: null, | 				energyTypeId: null, | ||||||
| @@ -509,16 +493,6 @@ export default { | |||||||
| 			let value = new Date(newData).getTime(); | 			let value = new Date(newData).getTime(); | ||||||
| 			return value; | 			return value; | ||||||
| 		}, | 		}, | ||||||
| 		switchMode() { |  | ||||||
| 			// 展开和收起切换 |  | ||||||
| 			this.isExpand = !this.isExpand; |  | ||||||
| 			const element = this.$refs.searchBarRef; |  | ||||||
| 			if (this.isExpand) { |  | ||||||
| 				element.classList.remove('divHeight'); |  | ||||||
| 			} else { |  | ||||||
| 				element.classList.add('divHeight'); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| @@ -557,21 +531,6 @@ export default { | |||||||
| 		margin-bottom: 4px; | 		margin-bottom: 4px; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| .searchBarBox .foldClass { |  | ||||||
| 	position: absolute; |  | ||||||
| 	top: 14px; |  | ||||||
| 	right: 0; |  | ||||||
| 	cursor: pointer; |  | ||||||
| 	font-size: 12px; |  | ||||||
| 	color: #0b58ff; |  | ||||||
| } |  | ||||||
| .searchBarBox .foldClass .iconfont { |  | ||||||
| 	font-size: 14px; |  | ||||||
| } |  | ||||||
| .divHeight { |  | ||||||
| 	height: 45px; |  | ||||||
| 	overflow: hidden; |  | ||||||
| } |  | ||||||
| .separateStyle { | .separateStyle { | ||||||
| 	display: inline-block; | 	display: inline-block; | ||||||
| 	width: 1px; | 	width: 1px; | ||||||
|   | |||||||
| @@ -4,7 +4,6 @@ | |||||||
| 		id="trendAnalysisBox"> | 		id="trendAnalysisBox"> | ||||||
| 		<!-- 搜索工作栏 --> | 		<!-- 搜索工作栏 --> | ||||||
| 		<search-area | 		<search-area | ||||||
| 			:isFold="isFold" |  | ||||||
| 			@submit="getList" | 			@submit="getList" | ||||||
| 			@export="exportExl" /> | 			@export="exportExl" /> | ||||||
| 		<div v-show="chartData.length"> | 		<div v-show="chartData.length"> | ||||||
| @@ -33,20 +32,12 @@ export default { | |||||||
| 	components: { SearchArea, LineChart }, | 	components: { SearchArea, LineChart }, | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			isFold: false, |  | ||||||
| 			chartData: [], | 			chartData: [], | ||||||
| 			timeDim: '', | 			timeDim: '', | ||||||
| 			tableProps: [], | 			tableProps: [], | ||||||
| 			list: [], | 			list: [], | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { |  | ||||||
| 		window.addEventListener('resize', () => { |  | ||||||
| 			this.tableH = this.tableHeight(260); |  | ||||||
| 			this.isFold = this.searchBarWidth('trendAnalysisBox', 1480); |  | ||||||
| 		}); |  | ||||||
| 		this.isFold = this.searchBarWidth('trendAnalysisBox', 1480); |  | ||||||
| 	}, |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		getList(params) { | 		getList(params) { | ||||||
| 			this.timeDim = params.timeDim; | 			this.timeDim = params.timeDim; | ||||||
|   | |||||||
| @@ -89,13 +89,13 @@ export default { | |||||||
| 					param: 'name', | 					param: 'name', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('base:energy-plc:query') ? 'button' : '', | ||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermi('base:energy-plc:create') ? 'separate' : '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', | 					type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', | ||||||
|   | |||||||
| @@ -22,7 +22,9 @@ | |||||||
| 							readonly | 							readonly | ||||||
| 							style="width: 250px"></el-input> | 							style="width: 250px"></el-input> | ||||||
| 					</el-form-item> | 					</el-form-item> | ||||||
| 					<el-form-item v-if="showBtn"> | 					<el-form-item | ||||||
|  | 						v-if="showBtn" | ||||||
|  | 						v-hasPermi="['base:energy-plc-param:create']"> | ||||||
| 						<el-button | 						<el-button | ||||||
| 							type="success" | 							type="success" | ||||||
| 							size="small" | 							size="small" | ||||||
| @@ -160,15 +162,19 @@ export default { | |||||||
| 				this.drawerTitle = '参数绑定'; | 				this.drawerTitle = '参数绑定'; | ||||||
| 				this.showBtn = true; | 				this.showBtn = true; | ||||||
| 				this.tableBtn = [ | 				this.tableBtn = [ | ||||||
| 					{ | 					this.$auth.hasPermi('base:energy-plc-param:update') | ||||||
|  | 						? { | ||||||
| 								type: 'edit', | 								type: 'edit', | ||||||
| 								btnName: '编辑', | 								btnName: '编辑', | ||||||
| 					}, | 						  } | ||||||
| 					{ | 						: undefined, | ||||||
|  | 					this.$auth.hasPermi('base:energy-plc-param:delete') | ||||||
|  | 						? { | ||||||
| 								type: 'delete', | 								type: 'delete', | ||||||
| 								btnName: '删除', | 								btnName: '删除', | ||||||
| 					}, | 						  } | ||||||
| 				]; | 						: undefined, | ||||||
|  | 				].filter((v) => v); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		getList() { | 		getList() { | ||||||
|   | |||||||
| @@ -107,13 +107,17 @@ export default { | |||||||
| 					param: 'cnName', | 					param: 'cnName', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('base:energy-plc-connect:query') | ||||||
|  | 						? 'button' | ||||||
|  | 						: '', | ||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermi('base:energy-plc-connect:create') | ||||||
|  | 						? 'separate' | ||||||
|  | 						: '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:energy-plc-connect:create') | 					type: this.$auth.hasPermi('base:energy-plc-connect:create') | ||||||
| @@ -127,17 +131,25 @@ export default { | |||||||
| 			], | 			], | ||||||
| 			tableProps, | 			tableProps, | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('base:energy-plc-connect:bind') | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'base:energy-plc-param:query', | ||||||
|  | 					'base:energy-type:query', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'connect', | 							type: 'connect', | ||||||
| 							btnName: '绑定', | 							btnName: '绑定', | ||||||
| 					  } | 					  } | ||||||
| 					: undefined, | 					: undefined, | ||||||
| 				{ | 				this.$auth.hasPermi('base:energy-plc-param:query') | ||||||
|  | 					? { | ||||||
| 							type: 'detail', | 							type: 'detail', | ||||||
| 							btnName: '详情', | 							btnName: '详情', | ||||||
| 				}, | 					  } | ||||||
| 				this.$auth.hasPermi('base:energy-plc-connect:update') | 					: undefined, | ||||||
|  | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'base:energy-plc-connect:update', | ||||||
|  | 					'base:energy-plc-connect:query', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'edit', | 							type: 'edit', | ||||||
| 							btnName: '编辑', | 							btnName: '编辑', | ||||||
|   | |||||||
| @@ -114,13 +114,20 @@ export default { | |||||||
| 					defaultSelect: [], | 					defaultSelect: [], | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('base:energy-quantity-manual:query') | ||||||
|  | 						? 'button' | ||||||
|  | 						: '', | ||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermiOr([ | ||||||
|  | 						'base:energy-quantity-manual:export', | ||||||
|  | 						'base:energy-quantity-manual:create', | ||||||
|  | 					]) | ||||||
|  | 						? 'separate' | ||||||
|  | 						: '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:energy-quantity-manual:export') | 					type: this.$auth.hasPermi('base:energy-quantity-manual:export') | ||||||
| @@ -147,13 +154,19 @@ export default { | |||||||
| 			// 班次基础信息列表 | 			// 班次基础信息列表 | ||||||
| 			list: [], | 			list: [], | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('base:energy-quantity-manual:create') | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'base:energy-quantity-manual:query', | ||||||
|  | 					'base:energy-quantity-manual:create', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'meterReading', | 							type: 'meterReading', | ||||||
| 							btnName: '抄表', | 							btnName: '抄表', | ||||||
| 					  } | 					  } | ||||||
| 					: undefined, | 					: undefined, | ||||||
| 				this.$auth.hasPermi('base:energy-quantity-manual:update') | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'base:energy-quantity-manual:update', | ||||||
|  | 					'base:energy-quantity-manual:query', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'edit', | 							type: 'edit', | ||||||
| 							btnName: '编辑', | 							btnName: '编辑', | ||||||
|   | |||||||
| @@ -90,7 +90,9 @@ export default { | |||||||
| 					width: 350, | 					width: 350, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('base:energy-quantity-realtime:query') | ||||||
|  | 						? 'button' | ||||||
|  | 						: '', | ||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
|   | |||||||
| @@ -52,7 +52,10 @@ export default { | |||||||
| 		return { | 		return { | ||||||
| 			tableProps, | 			tableProps, | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('base:table-name-config:edit') | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'base:energy-table:query', | ||||||
|  | 					'base:energy-table:update', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'edit', | 							type: 'edit', | ||||||
| 							btnName: '编辑', | 							btnName: '编辑', | ||||||
|   | |||||||
| @@ -125,13 +125,17 @@ export default { | |||||||
| 					param: 'limitType', | 					param: 'limitType', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('monitoring:energy-limit:query') | ||||||
|  | 						? 'button' | ||||||
|  | 						: '', | ||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermi('monitoring:energy-limit:create') | ||||||
|  | 						? 'separate' | ||||||
|  | 						: '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('monitoring:energy-limit:create') | 					type: this.$auth.hasPermi('monitoring:energy-limit:create') | ||||||
|   | |||||||
| @@ -113,7 +113,9 @@ export default { | |||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermi('monitoring:energy-report:export') | ||||||
|  | 						? 'separate' | ||||||
|  | 						: '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('monitoring:energy-report:export') | 					type: this.$auth.hasPermi('monitoring:energy-report:export') | ||||||
|   | |||||||
| @@ -22,6 +22,7 @@ | |||||||
| 					</el-form-item> | 					</el-form-item> | ||||||
| 					<el-form-item> | 					<el-form-item> | ||||||
| 						<el-button | 						<el-button | ||||||
|  | 							v-hasPermi="['monitoring:energy-statistics-det:query']" | ||||||
| 							type="success" | 							type="success" | ||||||
| 							size="small" | 							size="small" | ||||||
| 							v-if="showBtn" | 							v-if="showBtn" | ||||||
| @@ -30,6 +31,7 @@ | |||||||
| 							新增 | 							新增 | ||||||
| 						</el-button> | 						</el-button> | ||||||
| 						<el-button | 						<el-button | ||||||
|  | 							v-hasPermi="['monitoring:energy-statistics-det:delete']" | ||||||
| 							type="danger" | 							type="danger" | ||||||
| 							size="small" | 							size="small" | ||||||
| 							v-if="showBtn" | 							v-if="showBtn" | ||||||
| @@ -161,11 +163,13 @@ export default { | |||||||
| 				this.drawerTitle = '参数绑定'; | 				this.drawerTitle = '参数绑定'; | ||||||
| 				this.showBtn = true; | 				this.showBtn = true; | ||||||
| 				this.tableBtn = [ | 				this.tableBtn = [ | ||||||
| 					{ | 					this.$auth.hasPermi('monitoring:energy-statistics-det:delete') | ||||||
|  | 						? { | ||||||
| 								type: 'delete', | 								type: 'delete', | ||||||
| 								btnName: '删除', | 								btnName: '删除', | ||||||
| 					}, | 						  } | ||||||
| 				]; | 						: undefined, | ||||||
|  | 				].filter((v) => v); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		getList() { | 		getList() { | ||||||
|   | |||||||
| @@ -88,7 +88,9 @@ export default { | |||||||
| 					type: 'separate', | 					type: 'separate', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: this.$auth.hasPermi('monitoring:energy-statistics-det:create') | ||||||
|  | 						? 'button' | ||||||
|  | 						: '', | ||||||
| 					btnName: '关联', | 					btnName: '关联', | ||||||
| 					name: 'add', | 					name: 'add', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
|   | |||||||
| @@ -104,7 +104,9 @@ export default { | |||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: this.$auth.hasPermi('monitoring:energy-statistics:create') | ||||||
|  | 						? 'separate' | ||||||
|  | 						: '', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('monitoring:energy-statistics:create') | 					type: this.$auth.hasPermi('monitoring:energy-statistics:create') | ||||||
| @@ -118,17 +120,22 @@ export default { | |||||||
| 			], | 			], | ||||||
| 			tableProps, | 			tableProps, | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('monitoring:energy-statistics:bind') | 				this.$auth.hasPermi('monitoring:energy-statistics-det:query') | ||||||
| 					? { | 					? { | ||||||
| 							type: 'connect', | 							type: 'connect', | ||||||
| 							btnName: '绑定', | 							btnName: '绑定', | ||||||
| 					  } | 					  } | ||||||
| 					: undefined, | 					: undefined, | ||||||
| 				{ | 				this.$auth.hasPermi('monitoring:energy-statistics:query') | ||||||
|  | 					? { | ||||||
| 							type: 'detail', | 							type: 'detail', | ||||||
| 							btnName: '详情', | 							btnName: '详情', | ||||||
| 				}, | 					  } | ||||||
| 				this.$auth.hasPermi('monitoring:energy-statistics:update') | 					: undefined, | ||||||
|  | 				this.$auth.hasPermiAnd([ | ||||||
|  | 					'monitoring:energy-statistics:update', | ||||||
|  | 					'monitoring:energy-statistics:query', | ||||||
|  | 				]) | ||||||
| 					? { | 					? { | ||||||
| 							type: 'edit', | 							type: 'edit', | ||||||
| 							btnName: '编辑', | 							btnName: '编辑', | ||||||
|   | |||||||
| @@ -4,24 +4,72 @@ | |||||||
| 			<span class="blueTitle"></span> | 			<span class="blueTitle"></span> | ||||||
| 			<span>各集团订单环形图</span> | 			<span>各集团订单环形图</span> | ||||||
| 		</div> | 		</div> | ||||||
|     <div class="chartBox" id='orderChartBox' v-show='chartList.length'> | 		<div | ||||||
|       <div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}"> | 			class="chartBox" | ||||||
|         <div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}"> | 			id="orderChartBox" | ||||||
|           <svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/> | 			v-show="chartList.length"> | ||||||
|           <span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderGroupName}}</span> | 			<div | ||||||
|           <span>订单计划数量{{item.num}}</span> | 				class="chartItem" | ||||||
|  | 				v-for="(item, index) in chartList" | ||||||
|  | 				:key="index" | ||||||
|  | 				:style="{ | ||||||
|  | 					width: 388 * beilv + 'px', | ||||||
|  | 					height: 286 * beilv + 'px', | ||||||
|  | 					padding: 14 * beilv + 'px', | ||||||
|  | 					marginRight: 9 * beilv + 'px', | ||||||
|  | 					marginBottom: 9 * beilv + 'px', | ||||||
|  | 				}"> | ||||||
|  | 				<div | ||||||
|  | 					class="topTitle" | ||||||
|  | 					:style="{ fontSize: 14 * beilv + 'px' }"> | ||||||
|  | 					<svg-icon | ||||||
|  | 						icon-class="order-monitoring" | ||||||
|  | 						:style="{ fontSize: 16 * beilv + 'px' }" /> | ||||||
|  | 					<span | ||||||
|  | 						class="orderName" | ||||||
|  | 						:style="{ | ||||||
|  | 							paddingRight: 8 * beilv + 'px', | ||||||
|  | 							marginRight: 8 * beilv + 'px', | ||||||
|  | 						}"> | ||||||
|  | 						{{ item.orderGroupName }} | ||||||
|  | 					</span> | ||||||
|  | 					<span>订单计划数量{{ item.num }}</span> | ||||||
| 				</div> | 				</div> | ||||||
| 				<div | 				<div | ||||||
| 					:id="item.id" | 					:id="item.id" | ||||||
|           :style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}" | 					:style="{ | ||||||
|         ></div> | 						width: 166 * beilv + 'px', | ||||||
|         <div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}"> | 						height: 166 * beilv + 'px', | ||||||
|           <div class="legendItem" v-for="(subItem, i) in item.order" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}"> | 						margin: 'auto', | ||||||
|             <span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span> | 					}"></div> | ||||||
|  | 				<div | ||||||
|  | 					class="legend" | ||||||
|  | 					:style="{ height: 54 * beilv + 'px', marginTop: 10 * beilv + 'px' }"> | ||||||
|  | 					<div | ||||||
|  | 						class="legendItem" | ||||||
|  | 						v-for="(subItem, i) in item.order" | ||||||
|  | 						:key="i" | ||||||
|  | 						:style="{ | ||||||
|  | 							paddingRight: 9 * beilv + 'px', | ||||||
|  | 							marginRight: 9 * beilv + 'px', | ||||||
|  | 						}"> | ||||||
|  | 						<span | ||||||
|  | 							class="itemNum" | ||||||
|  | 							:style="{ fontSize: 18 * beilv + 'px' }"> | ||||||
|  | 							{{ subItem.value }} | ||||||
|  | 						</span> | ||||||
| 						<div> | 						<div> | ||||||
|               <span class="itemName" :style="{fontSize: 14 * beilv + 'px'}"> | 							<span | ||||||
|                 <span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span> | 								class="itemName" | ||||||
|                 {{subItem.name}} | 								:style="{ fontSize: 14 * beilv + 'px' }"> | ||||||
|  | 								<span | ||||||
|  | 									class="smallBlock" | ||||||
|  | 									:style="{ | ||||||
|  | 										backgroundColor: subItem.color, | ||||||
|  | 										width: 8 * beilv + 'px', | ||||||
|  | 										height: 8 * beilv + 'px', | ||||||
|  | 									}"></span> | ||||||
|  | 								{{ subItem.name }} | ||||||
| 							</span> | 							</span> | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
| @@ -29,59 +77,66 @@ | |||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
| 		<!-- 空图 --> | 		<!-- 空图 --> | ||||||
|     <div class="no-data-bg" v-show='!chartList.length'></div> | 		<div | ||||||
|  | 			class="no-data-bg" | ||||||
|  | 			v-show="!chartList.length"></div> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| import * as echarts from 'echarts' | import * as echarts from 'echarts'; | ||||||
| import { debounce } from '@/utils/debounce' | import { debounce } from '@/utils/debounce'; | ||||||
| export default { | export default { | ||||||
| 	name: 'MonitoringRingCharts', | 	name: 'MonitoringRingCharts', | ||||||
| 	props: { | 	props: { | ||||||
| 		chartList: { | 		chartList: { | ||||||
| 			type: Array, | 			type: Array, | ||||||
| 			default: () => { | 			default: () => { | ||||||
|         return [] | 				return []; | ||||||
|       } | 			}, | ||||||
|     } | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			myChart: [], | 			myChart: [], | ||||||
| 			beilv: 1, | 			beilv: 1, | ||||||
|       canvasReset: '' | 		}; | ||||||
|     } |  | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
|     this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610 | 		this.canvasReset(); | ||||||
|     this.canvasReset = debounce(() => { | 		window.addEventListener('resize', this.canvasReset); | ||||||
|       this.initChart() | 	}, | ||||||
|     }, 500) | 	destroyed() { | ||||||
|     window.addEventListener('resize', () => { | 		window.removeEventListener('resize', this.canvasReset); | ||||||
|       this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610 |  | ||||||
|       this.canvasReset() |  | ||||||
|     }) |  | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		canvasReset() { | ||||||
|  | 			debounce(() => { | ||||||
|  | 				this.initChart(); | ||||||
|  | 			}, 500)(); | ||||||
|  | 			this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610; | ||||||
|  | 		}, | ||||||
| 		// 饼图 | 		// 饼图 | ||||||
| 		initChart() { | 		initChart() { | ||||||
| 			if (this.chartList.length <= 0) { | 			if (this.chartList.length <= 0) { | ||||||
|         return false | 				return false; | ||||||
| 			} | 			} | ||||||
| 			// 销毁实例 | 			// 销毁实例 | ||||||
|       for (let j = 0;j < this.chartList.length; j++) { | 			for (let j = 0; j < this.chartList.length; j++) { | ||||||
| 				if (this.myChart[j]) { | 				if (this.myChart[j]) { | ||||||
|           this.myChart[j].dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例 | 					this.myChart[j].dispose(); // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例 | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			for (let i = 0; i < this.chartList.length; i++) { | 			for (let i = 0; i < this.chartList.length; i++) { | ||||||
| 				var chartDom = document.getElementById(this.chartList[i].id); | 				var chartDom = document.getElementById(this.chartList[i].id); | ||||||
| 				this.myChart[i] = echarts.init(chartDom); | 				this.myChart[i] = echarts.init(chartDom); | ||||||
|         let colorList = [] | 				let colorList = []; | ||||||
|         this.chartList[i].order.map(item => { | 				this.chartList[i].order.map((item) => { | ||||||
|           colorList.push(item.color) | 					colorList.push(item.color); | ||||||
|         }) | 				}); | ||||||
|         let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0) | 				let percentage = ( | ||||||
|  | 					(this.chartList[i].sunNum / this.chartList[i].num) * | ||||||
|  | 					100 | ||||||
|  | 				).toFixed(0); | ||||||
| 				var option = { | 				var option = { | ||||||
| 					color: colorList, | 					color: colorList, | ||||||
| 					series: [ | 					series: [ | ||||||
| @@ -93,40 +148,40 @@ export default { | |||||||
| 							itemStyle: { | 							itemStyle: { | ||||||
| 								borderRadius: 5, | 								borderRadius: 5, | ||||||
| 								borderColor: '#fff', | 								borderColor: '#fff', | ||||||
|                 borderWidth: 2 | 								borderWidth: 2, | ||||||
| 							}, | 							}, | ||||||
| 							label: { | 							label: { | ||||||
| 								show: true, | 								show: true, | ||||||
| 								position: 'center', | 								position: 'center', | ||||||
| 								color: '#000', | 								color: '#000', | ||||||
| 								formatter: [ | 								formatter: [ | ||||||
|                     '{a|'+percentage+'%}', | 									'{a|' + percentage + '%}', | ||||||
|                     '{b|生产'+this.chartList[i].sunNum+'}' | 									'{b|生产' + this.chartList[i].sunNum + '}', | ||||||
| 								].join('\n\n'), | 								].join('\n\n'), | ||||||
| 								rich: { | 								rich: { | ||||||
| 									a: { | 									a: { | ||||||
|                       fontSize: this.beilv*24 +'px' | 										fontSize: this.beilv * 24 + 'px', | ||||||
| 									}, | 									}, | ||||||
| 									b: { | 									b: { | ||||||
|                       fontSize: this.beilv*12 +'px' | 										fontSize: this.beilv * 12 + 'px', | ||||||
|                   } | 									}, | ||||||
|                 } | 								}, | ||||||
| 							}, | 							}, | ||||||
| 							emphasis: { | 							emphasis: { | ||||||
|                 disabled: true | 								disabled: true, | ||||||
| 							}, | 							}, | ||||||
| 							labelLine: { | 							labelLine: { | ||||||
|                 show: false | 								show: false, | ||||||
| 							}, | 							}, | ||||||
|               data: this.chartList[i].order | 							data: this.chartList[i].order, | ||||||
|             } | 						}, | ||||||
|           ] | 					], | ||||||
| 				}; | 				}; | ||||||
|         option && this.myChart[i].setOption(option) | 				option && this.myChart[i].setOption(option); | ||||||
| 			} | 			} | ||||||
|     } | 		}, | ||||||
|   } | 	}, | ||||||
| } | }; | ||||||
| </script> | </script> | ||||||
| <style lang='scss' scoped> | <style lang='scss' scoped> | ||||||
| .chartBox { | .chartBox { | ||||||
| @@ -139,11 +194,11 @@ export default { | |||||||
| 	align-content: flex-start; | 	align-content: flex-start; | ||||||
| 	.chartItem { | 	.chartItem { | ||||||
| 		border-radius: 8px; | 		border-radius: 8px; | ||||||
|     border: 1px solid #CACACA; | 		border: 1px solid #cacaca; | ||||||
| 		.topTitle { | 		.topTitle { | ||||||
| 			margin-bottom: 10px; | 			margin-bottom: 10px; | ||||||
| 			.orderName { | 			.orderName { | ||||||
|         border-right: 1px solid #CACACA; | 				border-right: 1px solid #cacaca; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		.legend { | 		.legend { | ||||||
| @@ -152,7 +207,7 @@ export default { | |||||||
| 			overflow: auto; | 			overflow: auto; | ||||||
| 			.legendItem { | 			.legendItem { | ||||||
| 				display: inline-block; | 				display: inline-block; | ||||||
|         border-right: 1px solid #E8E8E8; | 				border-right: 1px solid #e8e8e8; | ||||||
| 				.itemName { | 				.itemName { | ||||||
| 					.smallBlock { | 					.smallBlock { | ||||||
| 						display: inline-block; | 						display: inline-block; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user