Compare commits

..

No commits in common. "087af452def47123e82efa8a93b7451b5c8e8416" and "63a753d7d6780c9d815df4395a95a78f7f77e049" have entirely different histories.

74 changed files with 2064 additions and 2755 deletions

View File

@ -1,8 +1,8 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-04-10 16:58:06 # @LastEditTime: 2024-04-08 16:46:49
# @LastEditors: zhp # @LastEditors: DY
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
@ -20,16 +20,13 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:9001' # VUE_APP_BASE_API = 'http://192.168.4.173:9001'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082' # VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082' # VUE_APP_BASE_API = 'http://192.168.1.47:48082'
VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# socket地址 # socket地址
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080' VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081' VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
VUE_APP_Socket_Dcs_API = 'ws://192.168.0.33:8080'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://10.70.2.22:8080' VUE_APP_JIMU_API = 'http://10.70.2.22:8080'

View File

@ -2,7 +2,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:38:12 * @Date: 2023-11-06 15:38:12
* @LastEditTime: 2024-04-11 14:57:02 * @LastEditTime: 2023-12-15 15:29:16
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -94,7 +94,7 @@ export function getWorkerList(query) {
export function getMaterialCheckList(query) { export function getMaterialCheckList(query) {
return request({ return request({
url: 'base/quality-hot-material-det/filterList', url: '/base/core-hot-material-check/listByMaterial',
method: 'get', method: 'get',
params: query params: query
}) })
@ -102,7 +102,7 @@ export function getMaterialCheckList(query) {
export function createQualityHotMaterialDet(query){ export function createQualityHotMaterialDet(query){
return request({ return request({
url: 'base/quality-hot-material-det/createBatch', url: '/base/quality-hot-material-det/create',
method: 'post', method: 'post',
data: query data: query
}) })
@ -110,7 +110,7 @@ export function createQualityHotMaterialDet(query){
export function updateQualityHotMaterialDet(query){ export function updateQualityHotMaterialDet(query){
return request({ return request({
url: 'base/quality-hot-material-det/updateBatch', url: '/base/quality-hot-material-det/listbyfilter',
method: 'put', method: 'put',
data: query data: query
}) })
@ -118,7 +118,7 @@ export function updateQualityHotMaterialDet(query){
export function getQualityHotMaterialDetList(query){ export function getQualityHotMaterialDetList(query){
return request({ return request({
url: '/base/quality-hot-material-det/filterList', url: '/base/quality-hot-material-det/listbyfilter',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-07 15:02:37 * @Date: 2023-11-07 15:02:37
* @LastEditTime: 2024-04-09 15:14:42 * @LastEditTime: 2023-11-07 18:32:07
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-07 14:10:18 * @Date: 2023-11-07 14:10:18
* @LastEditTime: 2024-04-09 09:17:02 * @LastEditTime: 2023-11-16 17:49:52
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -18,14 +18,14 @@ export function getStatisticalDataPage(query) {
export function getWorkOrderList(query) { export function getWorkOrderList(query) {
return request({ return request({
url: 'base/quality-inspection-record/listbyfilter', url: '/base/core-work-order/listbyfilter',
method: 'get', method: 'get',
params: query, params: query,
}) })
} }
export function getProductList(query) { export function getProductList(query) {
return request({ return request({
url: 'base/statistical-data/listAll', url: '/base/core-product/listAll',
method: 'get', method: 'get',
params: query, params: query,
}) })

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-29 16:50:26 * @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-04-11 09:55:04 * @LastEditTime: 2024-04-07 16:05:59
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-29 13:45:56 * @Date: 2024-01-29 13:45:56
* @LastEditTime: 2024-04-11 11:02:53 * @LastEditTime: 2024-03-13 08:58:01
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -26,7 +26,7 @@ export default {
return { return {
chart: null, chart: null,
// notMsg:true, // notMsg:true,
colors: ['#2760ff', '#518eec', '#49FBD6', '#ddb523'], colors:['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
chartData: [] chartData: []
}; };
}, },
@ -45,31 +45,6 @@ export default {
this.$emit('emitFun') this.$emit('emitFun')
} }
} }
},
mounted() {
this.chartData = [
{
name: '细长泡',
num: 1112,
yield: 0.97,
},
{
name: '长泡',
num: 1112,
yield: 0.97,
},
{
name: '开口泡',
num: 1112,
yield: 0.97,
},
{
name: '结石',
num: 1112,
yield: 0.97,
}
]
this.updateChart()
}, },
methods: { methods: {
updateChart() { updateChart() {
@ -96,7 +71,7 @@ export default {
color:this.colors, color:this.colors,
title:{ title:{
text: num, text: num,
subtext: '总数/片', subtext: '总数',
top: '32%', top: '32%',
left: '49%', left: '49%',
textAlign: 'center', textAlign: 'center',
@ -114,7 +89,7 @@ export default {
left: 'center', left: 'center',
itemWidth: 12, itemWidth: 12,
itemHeight:12, itemHeight:12,
icon: 'roundRect', icon: 'rect',
textStyle: { textStyle: {
color: '#fff' color: '#fff'
}, },
@ -132,19 +107,7 @@ export default {
radius: ['45%', '70%'], radius: ['45%', '70%'],
avoidLabelOverlap: true, avoidLabelOverlap: true,
label: { label: {
show: true, show: false
normal: {
//
// params: data,
formatter: function (params) {
console.log(params);
return params.value + " | " + params.percent.toFixed(0) + "%" + "\n\n" + params.name;
},
textStyle: { //
// color: '#595959',
fontSize: 24.48
}
}
}, },
labelLine: { labelLine: {
show: true, show: true,
@ -152,16 +115,13 @@ export default {
data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({ data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({
name:item.name, name:item.name,
value: item.num, value: item.num,
label: {
color: this.colors[index % 4]
},
itemStyle:{ itemStyle:{
color:{ color:{
type: 'linear', type: 'linear',
x: 0, x: 1,
y: 0, y: 1,
x2: 0, x2: 0,
y2: 1, y2: 0,
global: false, global: false,
colorStops:[ colorStops:[
{offset: 0,color: this.colors[index%4]}, {offset: 0,color: this.colors[index%4]},

View File

@ -2,7 +2,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-09 15:24:39 * @LastEditTime: 2024-04-03 16:28:40
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -225,9 +225,6 @@ export default {
scale: true, scale: true,
type: 'value', type: 'value',
name: '良品率/%', name: '良品率/%',
max: 100,//
min: 0,//
interval: 20,//
nameTextStyle: {// y nameTextStyle: {// y
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
align: "left", align: "left",

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-09 15:24:28 * @LastEditTime: 2024-04-03 17:09:12
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -224,9 +224,6 @@ export default {
scale: true, scale: true,
type: 'value', type: 'value',
name: '良品率/%', name: '良品率/%',
max: 100,//
min: 0,//
interval: 20,//
nameTextStyle: {// y nameTextStyle: {// y
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
align: "left", align: "left",

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-10 16:10:11 * @LastEditTime: 2024-04-03 17:14:03
* @Description: * @Description:
--> -->
<template> <template>
@ -39,23 +39,10 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
<base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'"> <base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
<div class="order" style="width: 100%; overflow: hidden scroll; height: 350px"> <div class="order" style="width: 100%; overflow: hidden scroll; height: 350px">
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;"> <el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em">
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<!-- <div style="height: 34px;"> -->
<span class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</span> <p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p>
<el-divider class="split" v-if="op.specifications" direction="vertical"></el-divider>
<!-- <span v-if="op.size" class="split"></span> -->
<span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
op.specifications }}</span>
<el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
op.planQuantity }}</span>
<span v-if="op.actualQuantity" class="orderFinish"
style="font-size: 14px;opacity: calc(.6);margin-left: 130px;">{{
op.actualQuantity
}}</span>
<el-divider class="split" v-if="op.actualQuantity" direction="vertical"></el-divider>
<!-- </div> -->
<el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10" <el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" /> define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
</el-row> </el-row>
@ -378,65 +365,41 @@ export default {
id: '1', id: '1',
name: '测试工单', name: '测试工单',
progressRate: 0.933333, progressRate: 0.933333,
specifications: '1100*5554*22',
plan: 11111,
finish:111,
}, },
{ {
id: '2', id: '2',
name: '测试工单2', name: '测试工单2',
progressRate: 0.932323, progressRate: 0.932323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
}, },
{ {
id: '3', id: '3',
name: '测试工单3', name: '测试工单3',
progressRate: 0.23232, progressRate: 0.23232,
size: '1100*5554*22',
plan: 11111,
finish: 111,
}, },
{ {
id: '4', id: '4',
name: '测试工单4', name: '测试工单4',
progressRate: 0.32323, progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
}, },
{ {
id: '5', id: '4',
name: '测试工单4', name: '测试工单4',
progressRate: 0.32323, progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
}, },
{ {
id: '6', id: '4',
name: '测试工单4', name: '测试工单4',
size: '1100*5554*22',
progressRate: 0.32323, progressRate: 0.32323,
plan: 11111,
finish: 111,
}, },
{ {
id: '7', id: '4',
name: '测试工单4', name: '测试工单4',
size: '1100*5554*22',
progressRate: 0.32323, progressRate: 0.32323,
plan: 11111,
finish: 111,
}, },
{ {
id: '8', id: '4',
name: '测试工单4', name: '测试工单4',
progressRate: 0.32323, progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
}, },
// { // {
// id: '5', // id: '5',
@ -454,9 +417,6 @@ export default {
id: ele.id, id: ele.id,
name: ele.name, name: ele.name,
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :null,
planQuantity: ele.plan ? '计划' + ele.plan + '片' : null,
finish: ele.finish + '片',
}; };
} }
}); });
@ -480,8 +440,8 @@ export default {
<span style="color:rgba(255,255,255,0.5)" >${item.name || ''} <span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div> ${item.status || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${item.status || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == '是' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div> ${item.error || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${item.error || ''}</span>`,
]); ]);
this.eqConfig.data = eqArr; this.eqConfig.data = eqArr;
let data = [ let data = [
@ -731,9 +691,6 @@ export default {
id: ele.id, id: ele.id,
name: ele.name, name: ele.name,
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :null,
planQuantity: ele.planQuantity ? '计划' + ele.planQuantity + '片' : null,
actualQuantity: ele.actualQuantity ? ele.actualQuantity + '片' : null,
}; };
} }
}); });
@ -747,8 +704,12 @@ export default {
`<span style="color:rgba(255,255,255,0.5)">${ `<span style="color:rgba(255,255,255,0.5)">${
item.code || '' item.code || ''
}</span>`, }</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${item.status || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)"><span style="color:rgba(255,255,255,0.5)"></span> ${
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == '是' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${item.error || ''}</span>`, item.status || ''
}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${
item.error || ''
}</span>`,
]); ]);
this.eqConfig.data = eqArr; this.eqConfig.data = eqArr;
// this.$nextTick(() => { // this.$nextTick(() => {
@ -841,18 +802,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.split{
width: 1px;
// display: inline-block;
height: 14px;
// margin-top: 2px;
// line-height: 0;
margin-left: 8px;
opacity:calc(.6);
margin-right: 8px;
background-color: #C8CDD7;
// border: 1px solid #C8CDD7;
}
.myLegend { .myLegend {
position: absolute; position: absolute;
top: -28px; top: -28px;
@ -953,39 +902,12 @@ export default {
} }
.now-secondary-title { .now-secondary-title {
display: inline-block;
width: 70px;
margin: 0; margin: 0;
font-size: 14px; font-size: 1em;
line-height: 2em; line-height: 2em;
color: #fff; color: #fff;
} }
.orderSize {
display: inline-block;
width: 120px;
margin: 0;
font-size: 14px;
line-height: 2em;
color: #fff;
}
.orderFinish {
display: inline-block;
width: 60px;
margin: 0;
font-size: 14px;
line-height: 2em;
text-align: right;
color: #fff;
}
.orderPlan {
display: inline-block;
width: 100px;
margin: 0;
font-size: 14px;
line-height: 2em;
color: #fff;
text-align: left;
}
.now-team-content { .now-team-content {
font-size: 3em; font-size: 3em;
line-height: 1em; line-height: 1em;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-10 16:34:40 * @LastEditTime: 2024-04-08 11:49:33
* @Description: * @Description:
--> -->
<template> <template>
@ -142,7 +142,7 @@ export default {
// name: 'reset', // name: 'reset',
// }, // },
{ {
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'separate' : '', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',

View File

@ -2,30 +2,19 @@
<div class="choicepart-container"> <div class="choicepart-container">
<navbar /> <navbar />
<div class="choicepart-wrapper"> <div class="choicepart-wrapper">
<div <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1710px;height:538px;'" v-show="showItem">
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="{ :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
opacity: item.visible ? 1 : 0.4, >
pointerEvents: item.visible ? 'auto' : 'none',
}">
<div> <div>
<img <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
: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">
@ -34,18 +23,12 @@
:key="index" :key="index"
class="choicepart-item" class="choicepart-item"
@click="handelClick(item, item.choicepart)" @click="handelClick(item, item.choicepart)"
:style="{ :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
opacity: item.visible ? 1 : 0.4, >
pointerEvents: item.visible ? 'auto' : 'none',
}">
<div> <div>
<img <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
: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>
@ -54,13 +37,14 @@
</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: [
{ {
@ -68,65 +52,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: [
{ {
@ -134,16 +118,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',
@ -158,94 +142,91 @@ 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(); this.boxReset = debounce(() => {
window.addEventListener('resize', this.boxReset); this.resetSize()
}, }, 300)
destroyed() { this.boxReset()
window.removeEventListener('resize', this.boxReset); window.addEventListener('resize', () => {
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 {
@ -253,36 +234,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 {
@ -315,8 +296,7 @@ export default {
.choicepart-item { .choicepart-item {
width: 184px; width: 184px;
height: 224px; height: 224px;
background: url('../../assets/images/choicepart/choice-item-back.png') background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
@ -354,7 +334,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;

View File

@ -32,7 +32,6 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -62,7 +61,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage,tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -71,6 +70,7 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@ -92,7 +92,7 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-energy-search:query') type: this.$auth.hasPermi('cost:energyCost:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -100,7 +100,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-energy-search:export') type: this.$auth.hasPermi('cost:energyCost:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@ -113,6 +113,9 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getEnergyTypeListAll().then((response) => { getEnergyTypeListAll().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@ -32,7 +32,6 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -72,7 +71,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage,tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -81,6 +80,7 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@ -116,7 +116,7 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: this.$auth.hasPermi('extend:cost-enery-auto-report:query') type: this.$auth.hasPermi('cost:energyCostHis:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -124,7 +124,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-enery-auto-report:export') type: this.$auth.hasPermi('cost:energyCostHis:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@ -137,6 +137,9 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@ -53,7 +53,6 @@ import {
} from '@/api/cost/costMaterialSet'; } from '@/api/cost/costMaterialSet';
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -92,7 +91,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage,tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -100,14 +99,15 @@ export default {
deleteURL: deleteCostMaterialSet, deleteURL: deleteCostMaterialSet,
}, },
tableProps, tableProps,
tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`extend:cost-material-set:update`) this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`extend:cost-material-set:delete`) this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -124,7 +124,7 @@ export default {
filterable: true, filterable: true,
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-set:query') type: this.$auth.hasPermi('cost:rawMaterialConfig:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -132,14 +132,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: type: 'separate',
this.$auth.hasPermi('extend:cost-material-set:create') &&
this.$auth.hasPermi('extend:cost-material-set:query')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-set:create') type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@ -154,6 +150,9 @@ export default {
AddOrUpdate, AddOrUpdate,
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => { getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@ -32,7 +32,6 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -67,7 +66,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage,tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -76,6 +75,7 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@ -97,7 +97,7 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-search:query') type: this.$auth.hasPermi('cost:rawMaterialCost:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -105,7 +105,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-search:export') type: this.$auth.hasPermi('cost:rawMaterialCost:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@ -118,6 +118,9 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => { getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data; this.formConfig[0].selectOptions = response.data;
}); });

View File

@ -32,7 +32,6 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial'; import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
@ -71,7 +70,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage,tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -80,6 +79,7 @@ export default {
}, },
tableData: [], tableData: [],
tableProps, tableProps,
tableH: this.tableHeight(260),
drawerVisible: false, drawerVisible: false,
formConfig: [ formConfig: [
{ {
@ -115,7 +115,7 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-auto-report:query') type: this.$auth.hasPermi('cost:rawMaterialCostHis:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -123,7 +123,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('extend:cost-material-auto-report:export') type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
? 'button' ? 'button'
: '', : '',
btnName: '导出', btnName: '导出',
@ -136,6 +136,9 @@ export default {
}, },
components: {}, components: {},
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@ -1,11 +1,8 @@
<template> <template>
<div id='deepProcessingContainerB' ref='deepProcessingContainerB' style="width: 100%;height: 100%;">
<div <div
id="deepProcessingContainerB" id='deepProcessingContainer'
ref="deepProcessingContainerB" ref='deepProcessingContainer'
style="width: 100%; height: 100%">
<div
id="deepProcessingContainer"
ref="deepProcessingContainer"
class="deepProcessingBoard" class="deepProcessingBoard"
style=" style="
position: absolute; position: absolute;
@ -19,14 +16,15 @@
flex-direction: column; flex-direction: column;
gap: 24px; gap: 24px;
" "
:style="{ transform: 'scale(' + scaleNum + ')' }"> :style="{transform:'scale('+scaleNum+')'}">
<KHeader <KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='深加工生产运行驾驶舱'/>
:isFullScreen="isFullScreen"
@screenfullChange="screenfullChange"
topTitle="深加工生产运行驾驶舱" />
<div <div
class="main-body" class="main-body"
style="display: grid; gap: 16px; grid-template-rows: 462px 462px"> style="
display: grid;
gap: 16px;
grid-template-rows: 462px 462px;
">
<TopThree /> <TopThree />
<BottomTwo /> <BottomTwo />
</div> </div>
@ -49,16 +47,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 {
@ -68,52 +66,43 @@ 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() {
window.removeEventListener('resize', this.boxReset); console.log('destroyed...........')
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)
} }
}, },
// //
@ -121,37 +110,39 @@ 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( let deepProcessingContainer = document.getElementById('deepProcessingContainer')
'deepProcessingContainer' let rw = parseFloat(window.innerWidth)
); let rh = parseFloat(window.innerHeight)
let rw = parseFloat(window.innerWidth); let bw = parseFloat(deepProcessingContainer.style.width)
let rh = parseFloat(window.innerHeight); let bh = parseFloat(deepProcessingContainer.style.height)
let bw = parseFloat(deepProcessingContainer.style.width); let wx = 0
let bh = parseFloat(deepProcessingContainer.style.height); let hx = 0
let wx = 0;
let hx = 0;
if (screenfull.isFullscreen) { if (screenfull.isFullscreen) {
wx = rw / bw; console.log('全屏')
hx = rh / bh; wx = rw / bw
} else { hx = rh / bh
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>

View File

@ -1,23 +1,24 @@
<!--
filename: MaterialCost.vue
author: liubin
date: 2023-12-06 09:09:27
description:
-->
<template> <template>
<Container <Container name="原料用量统计" size="middle" style="">
name="原料用量统计" <div style="flex: 1; display: flex; gap: 8px;flex-direction: column;">
size="middle"
style="">
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
<div <div
class="absolute" class="absolute"
style=" style="
flex: 2; flex:3;
padding: 12px 12px 0 12px; padding: 12px 12px 0 12px;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(3, 1fr);
grid-auto-rows: repeat(4, 1fr); grid-auto-rows: repeat(4, 1fr);
gap: 8px; gap: 8px;
"> ">
<ShadowRect <ShadowRect v-for="(item, index) in materialMsg1" :key="index" :rounded="false">
v-for="(item, index) in materialMsg"
:key="index"
:rounded="false">
<div <div
class="material" class="material"
style=" style="
@ -29,24 +30,43 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
"> ">
<span <span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
style=" {{item.materialUsed}}
color: #0ee8e4;
font-weight: 500;
font-size: 32px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
">
{{ item.materialUsed }}
</span> </span>
<span style="color: #fff; font-size: 16px; letter-spacing: 1px"> <span style="color: #fff; font-size: 16px; letter-spacing: 1px">
- {{ item.materialName }}/kg- - {{item.materialName}}/kg-
</span>
</div>
</ShadowRect>
</div>
<div style="flex:1;
padding: 0 12px 12px 12px;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;">
<ShadowRect v-for="(item, index) in materialMsg2" :key="index" :rounded="false">
<div
class="material"
style="
flex: 1;
padding-bottom: 3px;
display: flex;
flex-direction: column;
gap: 4px;
align-items: center;
justify-content: center;
">
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
{{item.materialUsed}}
</span>
<span style="color: #fff; font-size: 16px; letter-spacing: 1px">
- {{item.materialName}}/kg-
</span> </span>
</div> </div>
</ShadowRect> </ShadowRect>
</div> </div>
</div> </div>
</Container> </Container>
</template> </template>
@ -61,9 +81,12 @@ export default {
return {}; return {};
}, },
computed: { computed: {
materialMsg() { materialMsg1() {
return this.$store.state.websocket.material; return this.$store.state.websocket.material.slice(0,9)
}, },
materialMsg2() {
return this.$store.state.websocket.material.slice(9)
}
}, },
methods: {}, methods: {},
}; };

View File

@ -1,11 +1,8 @@
<template> <template>
<div id='kilnContainerB' ref='kilnContainerB' style="width: 100%;height: 100%;">
<div <div
id="kilnContainerB" id='kilnContainer'
ref="kilnContainerB" ref='kilnContainer'
style="width: 100%; height: 100%">
<div
id="kilnContainer"
ref="kilnContainer"
class="KilnDataBoard" class="KilnDataBoard"
style=" style="
position: absolute; position: absolute;
@ -19,22 +16,15 @@
flex-direction: column; flex-direction: column;
gap: 24px; gap: 24px;
" "
:style="{ transform: 'scale(' + scaleNum + ')' }"> :style="{transform:'scale('+scaleNum+')'}">
<KHeader <KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='窑炉生产运行驾驶舱'/>
: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 <div class="left-side" style="flex: 2">
class="left-side"
style="flex: 2">
<LeftFour /> <LeftFour />
</div> </div>
<div <div class="right-side" style="flex: 1">
class="right-side"
style="flex: 1">
<RightTwo /> <RightTwo />
</div> </div>
</div> </div>
@ -46,8 +36,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',
@ -56,10 +46,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 {
@ -69,44 +59,43 @@ 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(); this.boxReset = debounce(() => {
window.addEventListener('resize', this.boxReset); this.resetSize()
}, }, 300)
destroyed() { this.boxReset()
window.removeEventListener('resize', this.boxReset); window.addEventListener('resize', () => {
this.destroy(); 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)
} }
}, },
// //
@ -114,35 +103,40 @@ 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')
let rw = parseFloat(window.innerWidth); console.log(kilnContainerBox)
let rh = parseFloat(window.innerHeight); let rw = parseFloat(window.innerWidth)
let bw = parseFloat(kilnContainerBox.style.width); let rh = parseFloat(window.innerHeight)
let bh = parseFloat(kilnContainerBox.style.height); let bw = parseFloat(kilnContainerBox.style.width)
let wx = 0; let bh = parseFloat(kilnContainerBox.style.height)
let hx = 0; let wx = 0
let hx = 0
if (screenfull.isFullscreen) { if (screenfull.isFullscreen) {
wx = rw / bw; console.log('全屏')
hx = rh / bh; wx = rw / bw
} else { hx = rh / bh
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>

View File

@ -1,11 +1,8 @@
<template> <template>
<div id='wholePlantContainerB' ref='wholePlantContainerB' style="width: 100%;height: 100%;">
<div <div
id="wholePlantContainerB" id='wholePlantContainer'
ref="wholePlantContainerB" ref='wholePlantContainer'
style="width: 100%; height: 100%">
<div
id="wholePlantContainer"
ref="wholePlantContainer"
class="wholePlantBoard" class="wholePlantBoard"
style=" style="
position: absolute; position: absolute;
@ -19,27 +16,18 @@
flex-direction: column; flex-direction: column;
gap: 24px; gap: 24px;
" "
:style="{ transform: 'scale(' + scaleNum + ')' }"> :style="{transform:'scale('+scaleNum+')'}">
<KHeader <KHeader :isFullScreen='isFullScreen' @screenfullChange='screenfullChange' topTitle='全厂总览驾驶舱'/>
: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 <div class="left-side" style="flex: 1">
class="left-side"
style="flex: 1">
<LeftTwo /> <LeftTwo />
</div> </div>
<div <div class="middle-side" style="flex: 1">
class="middle-side"
style="flex: 1">
<MiddleTwo /> <MiddleTwo />
</div> </div>
<div <div class="right-side" style="flex: 1">
class="right-side"
style="flex: 1">
<RightTwo /> <RightTwo />
</div> </div>
</div> </div>
@ -52,8 +40,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',
@ -61,7 +49,7 @@ export default {
KHeader, KHeader,
LeftTwo, LeftTwo,
MiddleTwo, MiddleTwo,
RightTwo, RightTwo
}, },
// provide() { // provide() {
// return { // return {
@ -71,39 +59,40 @@ 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(); this.boxReset = debounce(() => {
window.addEventListener('resize', this.boxReset); this.resetSize()
}, 300)
this.boxReset()
window.addEventListener('resize', () => {
this.boxReset()
})
console.log('mounted...........')
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.boxReset); console.log('destroyed...........')
}, },
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)
} }
}, },
// //
@ -111,37 +100,39 @@ 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( let wholePlantContainerBox = document.getElementById('wholePlantContainer')
'wholePlantContainer' let rw = parseFloat(window.innerWidth)
); let rh = parseFloat(window.innerHeight)
let rw = parseFloat(window.innerWidth); let bw = parseFloat(wholePlantContainerBox.style.width)
let rh = parseFloat(window.innerHeight); let bh = parseFloat(wholePlantContainerBox.style.height)
let bw = parseFloat(wholePlantContainerBox.style.width); let wx = 0
let bh = parseFloat(wholePlantContainerBox.style.height); let hx = 0
let wx = 0;
let hx = 0;
if (screenfull.isFullscreen) { if (screenfull.isFullscreen) {
wx = rw / bw; console.log('全屏')
hx = rh / bh; wx = rw / bw
} else { hx = rh / bh
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>

View File

@ -76,6 +76,10 @@ export default {
name: this.chartData[i].objName + this.chartData[i].objCode, name: this.chartData[i].objName + this.chartData[i].objCode,
type: 'bar', type: 'bar',
barMaxWidth: 20, barMaxWidth: 20,
label: {
show: true,
position: 'top',
},
data: [], data: [],
}; };
legendData.push(this.chartData[i].objName + this.chartData[i].objCode); legendData.push(this.chartData[i].objName + this.chartData[i].objCode);

View File

@ -1,7 +1,8 @@
<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">
@ -199,6 +200,13 @@
</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>
@ -209,8 +217,16 @@ 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,
@ -509,6 +525,16 @@ 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>
@ -547,6 +573,21 @@ 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;

View File

@ -4,6 +4,7 @@
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">
@ -37,6 +38,7 @@ export default {
mixins: [tableHeightMixin], mixins: [tableHeightMixin],
data() { data() {
return { return {
isFold: false,
chartData: [], chartData: [],
timeDim: '', timeDim: '',
tableProps: [], tableProps: [],
@ -44,6 +46,13 @@ 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;

View File

@ -68,9 +68,9 @@ export default {
var option = { var option = {
color: ['#288AFF'], color: ['#288AFF'],
tooltip: { // tooltip: {
trigger: 'axis', // trigger: 'axis'
}, // },
grid: { grid: {
left: '4%', left: '4%',
right: '1%', right: '1%',

View File

@ -1,7 +1,8 @@
<template> <template>
<div <div
class="searchBarBox" 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">
@ -171,9 +172,9 @@
</el-button> </el-button>
<span <span
class="separateStyle" class="separateStyle"
v-hasPermi="['analysis:energy-analysis:query']"></span> v-hasPermi="['analysis:trend-analysis:export']"></span>
<el-button <el-button
v-hasPermi="['analysis:energy-analysis:query']" v-hasPermi="['analysis:trend-analysis:export']"
type="primary" type="primary"
size="small" size="small"
plain plain
@ -182,6 +183,13 @@
</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>
@ -190,8 +198,16 @@ 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,
@ -493,6 +509,16 @@ 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>
@ -531,6 +557,21 @@ 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;

View File

@ -4,6 +4,7 @@
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">
@ -32,12 +33,20 @@ 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;
@ -57,10 +66,8 @@ export default {
let listObj = { useNum: '消耗量' }; // let listObj = { useNum: '消耗量' }; //
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
let obj = {}; let obj = {};
let fName = arr[i].time.slice(0, 4);
let lName = arr[i].time.slice(4, 6);
obj.prop = arr[i].time; obj.prop = arr[i].time;
obj.label = fName + ' 第 ' + lName + ' 周'; obj.label = arr[i].time;
obj.minWidth = 100; obj.minWidth = 100;
tempX.push(obj); tempX.push(obj);
listObj[arr[i].time] = arr[i].useNum || null; listObj[arr[i].time] = arr[i].useNum || null;

View File

@ -89,13 +89,13 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc:create') ? 'separate' : '', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',

View File

@ -22,9 +22,7 @@
readonly readonly
style="width: 250px"></el-input> style="width: 250px"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="showBtn">
v-if="showBtn"
v-hasPermi="['base:energy-plc-param:create']">
<el-button <el-button
type="success" type="success"
size="small" size="small"
@ -162,19 +160,15 @@ 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() {

View File

@ -107,17 +107,13 @@ export default {
param: 'cnName', param: 'cnName',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc-connect:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc-connect:create') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc-connect:create') type: this.$auth.hasPermi('base:energy-plc-connect:create')
@ -131,25 +127,17 @@ export default {
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:energy-plc-connect:bind')
'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: '详情',
} },
: undefined, this.$auth.hasPermi('base:energy-plc-connect:update')
this.$auth.hasPermiAnd([
'base:energy-plc-connect:update',
'base:energy-plc-connect:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -45,7 +45,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button <el-button
v-show="!isEdit"
class="addButton" class="addButton"
icon="el-icon-plus" icon="el-icon-plus"
@click="emitButtonClick"> @click="emitButtonClick">
@ -71,13 +70,6 @@ export default {
return []; return [];
}, },
}, },
isEdit: {
type: Boolean,
required: true,
default: () => {
return false;
},
},
}, },
data() { data() {
return {}; return {};

View File

@ -42,7 +42,6 @@
<add-table <add-table
:table-data="tableData" :table-data="tableData"
:table-name-list="tableNameList" :table-name-list="tableNameList"
:isEdit="isEdit"
@emitFun="inputChange" @emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> @emitButtonClick="emitButtonClick" />
</el-col> </el-col>

View File

@ -114,20 +114,13 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: this.$auth.hasPermi('base:energy-quantity-manual:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermiOr([ type: 'separate',
'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')
@ -154,19 +147,13 @@ export default {
// //
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:energy-quantity-manual:create')
'base:energy-quantity-manual:query',
'base:energy-quantity-manual:create',
])
? { ? {
type: 'meterReading', type: 'meterReading',
btnName: '抄表', btnName: '抄表',
} }
: undefined, : undefined,
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:energy-quantity-manual:update')
'base:energy-quantity-manual:update',
'base:energy-quantity-manual:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -90,9 +90,7 @@ export default {
width: 350, width: 350,
}, },
{ {
type: this.$auth.hasPermi('base:energy-quantity-realtime:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -52,10 +52,7 @@ export default {
return { return {
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:table-name-config:edit')
'base:energy-table:query',
'base:energy-table:update',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -66,7 +66,7 @@
placeholder="请选择" placeholder="请选择"
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="item in tableNameList" v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
@ -154,7 +154,6 @@ import {
createEnergyLimit, createEnergyLimit,
getEnergyParamList, getEnergyParamList,
} from '@/api/monitoring/energyLimit'; } from '@/api/monitoring/energyLimit';
import { energyTableGet } from '@/api/base/energyQuantityManual';
export default { export default {
name: 'energyLimitAdd', name: 'energyLimitAdd',
props: { props: {
@ -204,7 +203,6 @@ export default {
{ required: true, message: '指标类型不能为空', trigger: 'change' }, { required: true, message: '指标类型不能为空', trigger: 'change' },
], ],
}, },
tableNameList: [],
detailList: [], detailList: [],
}; };
}, },
@ -269,22 +267,11 @@ export default {
} }
}, },
toggleType() { toggleType() {
if (this.form.energyTypeId && this.form.method == 2) { if (this.form.energyTypeId && this.form.type) {
this.form.tableName = ''; this.getDetailList();
this.getTableNameList(this.form.energyTypeId); this.form.plcParamId = '';
} }
}, },
// list
getTableNameList(id) {
energyTableGet({ energyTypeId: id }).then((res) => {
this.tableNameList = res.data.tableObjs || [];
if (this.tableNameList.length === 0) {
this.$modal.msgWarning(
'当前能源类型暂无配置表名,请先到《表名配置》页面配置'
);
}
});
},
// //
changeDetSelect(key, treeData) { changeDetSelect(key, treeData) {
let arr = []; // let arr = []; //

View File

@ -125,17 +125,13 @@ export default {
param: 'limitType', param: 'limitType',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-limit:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-limit:create') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-limit:create') type: this.$auth.hasPermi('monitoring:energy-limit:create')

View File

@ -113,9 +113,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-report:export') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-report:export') type: this.$auth.hasPermi('monitoring:energy-report:export')

View File

@ -22,7 +22,6 @@
</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"
@ -31,7 +30,6 @@
新增 新增
</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"
@ -163,13 +161,11 @@ 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() {

View File

@ -88,9 +88,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-statistics-det:create') type: 'button',
? 'button'
: '',
btnName: '关联', btnName: '关联',
name: 'add', name: 'add',
color: 'primary', color: 'primary',

View File

@ -104,9 +104,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-statistics:create') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-statistics:create') type: this.$auth.hasPermi('monitoring:energy-statistics:create')
@ -120,22 +118,17 @@ export default {
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('monitoring:energy-statistics-det:query') this.$auth.hasPermi('monitoring:energy-statistics:bind')
? { ? {
type: 'connect', type: 'connect',
btnName: '绑定', btnName: '绑定',
} }
: undefined, : undefined,
this.$auth.hasPermi('monitoring:energy-statistics:query') {
? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
} },
: undefined, this.$auth.hasPermi('monitoring:energy-statistics:update')
this.$auth.hasPermiAnd([
'monitoring:energy-statistics:update',
'monitoring:energy-statistics:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-11 13:35:46 * @LastEditTime: 2024-03-22 17:11:55
* @Description: * @Description:
--> -->
<template> <template>
@ -62,8 +62,7 @@
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;">
<el-button v-if="this.$auth.hasPermi('extend:process-equ-material-bom-det:add')" type="text" <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
@click="addNew()" icon="el-icon-plus">新增</el-button>
</span> </span>
</template> </template>
</div> </div>
@ -102,15 +101,11 @@ import attrAdd from './attr-add';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
const tableBtn = [ const tableBtn = [
{ {
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:update') type: 'edit',
? 'edit'
: '',
btnName: '编辑', btnName: '编辑',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:delete') type: 'delete',
? 'delete'
: '',
btnName: '删除', btnName: '删除',
}, },
]; ];
@ -242,6 +237,9 @@ export default {
// console.log(response); // console.log(response);
this.equipmentList = res.data this.equipmentList = res.data
}) })
getMaterialCode().then(res => {
this.dataForm.code = res.data
})
}, },
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
@ -295,9 +293,6 @@ export default {
this.idAttrShow = true this.idAttrShow = true
} else { } else {
this.idAttrShow = false this.idAttrShow = false
getMaterialCode().then(res => {
this.dataForm.code = res.data
})
} }
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -118,8 +118,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
// type: 'separate', type: 'separate',
type: this.$auth.hasPermi('extend:process-equ-material-bom:create') ? 'separate' : '',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-material-bom:create') ? 'button' : '', type: this.$auth.hasPermi('extend:process-equ-material-bom:create') ? 'button' : '',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-11 13:35:42 * @LastEditTime: 2024-03-25 14:07:31
* @Description: * @Description:
--> -->
<template> <template>
@ -72,8 +72,7 @@
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;">
<el-button v-if="this.$auth.hasPermi('extend:process-equ-value-bom-det:add')" type="text" <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
@click="addNew()" icon="el-icon-plus">新增</el-button>
</span> </span>
</template> </template>
</div> </div>
@ -112,15 +111,11 @@ import attrAdd from './attr-add';
const tableBtn = [ const tableBtn = [
{ {
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:update') type: 'edit',
? 'edit'
: '',
btnName: '编辑', btnName: '编辑',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:delete') type: 'delete',
? 'delete'
: '',
btnName: '删除', btnName: '删除',
}, },
]; ];
@ -161,9 +156,7 @@ const tableProps = [
const topBtnConfig = [ const topBtnConfig = [
{ {
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:add') type: 'add',
? 'add'
: '',
btnName: 'btn.add' btnName: 'btn.add'
} }
] ]
@ -253,7 +246,9 @@ export default {
// console.log(response); // console.log(response);
this.equipmentList = res.data this.equipmentList = res.data
}) })
getValueCode().then(res => {
this.dataForm.code = res.data
})
}, },
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
@ -331,9 +326,6 @@ export default {
this.idAttrShow = true this.idAttrShow = true
} else { } else {
this.idAttrShow = false this.idAttrShow = false
getValueCode().then(res => {
this.dataForm.code = res.data
})
} }
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -119,8 +119,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
// type: 'separate', type: 'separate',
type: this.$auth.hasPermi('extend:process-equ-value-bom:create') ? 'separate' : '',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-value-bom:create') ? 'button' : '', type: this.$auth.hasPermi('extend:process-equ-value-bom:create') ? 'button' : '',

View File

@ -1,11 +1,5 @@
<template> <template>
<el-switch <el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
v-hasPermi="['base:group-team:edit-worker']"
v-model="state"
type="text"
size="small"
:disabled="readonly"
@change="changeHandler" />
</template> </template>
<script> <script>
@ -13,40 +7,40 @@ export default {
props: { props: {
injectData: { injectData: {
type: Object, type: Object,
default: () => ({}), default: () => ({})
}, }
}, },
data() { data() {
return { return {
state: false, state: false
}; }
}, },
computed: { computed: {
readonly() { readonly() {
return !!this.injectData.readonly; return !!this.injectData.readonly
}, }
}, },
mounted() { mounted() {
this.mapToState(); this.mapToState()
}, },
methods: { methods: {
mapToState() { mapToState() {
if (this.injectData.prop === 'enabled') { if (this.injectData.prop === 'enabled') {
this.state = this.injectData.enabled === 1 ? true : false; this.state = this.injectData.enabled === 1 ? true : false
} }
}, },
changeHandler() { changeHandler() {
let params = {}; let params = {}
let payload = {}; let payload = {}
params.name = 'state'; params.name = 'state'
payload.id = this.injectData.id; payload.id = this.injectData.id
payload.enabled = this.state ? '1' : '0'; payload.enabled = this.state ? '1' : '0'
payload.code = this.injectData.code; payload.code = this.injectData.code
payload.name = this.injectData.name; payload.name = this.injectData.name
payload.leaderId = this.injectData.leaderId; payload.leaderId = this.injectData.leaderId
params.payload = payload; params.payload = payload
this.$emit('emitData', params); this.$emit('emitData', params)
}, }
}, }
}; }
</script> </script>

View File

@ -1,18 +1,8 @@
<template> <template>
<div class="workerOperate"> <div class="workerOperate">
<div class="operateBtn"> <div class="operateBtn">
<span <span class="view" v-if="this.$auth.hasPermi('base:group-team:view-worker')" @click="emitParams('view')">查看</span>
class="view" <span class="edit" v-if="this.$auth.hasPermi('base:group-team:edit-worker')" @click="emitParams('edit')">编辑</span>
v-hasPermi="['base:group-team:view-worker']"
@click="emitParams('view')">
查看
</span>
<span
class="edit"
v-hasPermi="['base:group-team:edit-worker']"
@click="emitParams('edit')">
编辑
</span>
</div> </div>
</div> </div>
</template> </template>
@ -22,23 +12,23 @@ export default {
props: { props: {
injectData: { injectData: {
type: Object, type: Object,
default: () => ({}), default: () => ({})
}, }
}, },
methods: { methods: {
emitParams(data) { emitParams(data) {
let params = {}; let params = {}
params.name = data; params.name = data
params.payload = this.injectData; params.payload = this.injectData
this.$emit('emitData', params); this.$emit('emitData', params)
}, }
}, }
}; }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.workerOperate { .workerOperate {
.operateBtn { .operateBtn{
color: #0b58ff; color: #0B58FF;
.view { .view {
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;

View File

@ -125,7 +125,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:group-team:create') ? 'separate' : '', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '', type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',

View File

@ -1,12 +1,8 @@
<template> <template>
<div class="groupTeamScheduling"> <div class="groupTeamScheduling">
<TopTab <TopTab :roomNameDict='roomNameDict' @emitFun='toggleName'/>
:roomNameDict="roomNameDict"
@emitFun="toggleName" />
<div class="operationArea"> <div class="operationArea">
<el-form <el-form :inline="true" class="demo-form-inline">
:inline="true"
class="demo-form-inline">
<span class="blue-block"></span> <span class="blue-block"></span>
<el-form-item label="月份选择"> <el-form-item label="月份选择">
<el-date-picker <el-date-picker
@ -17,86 +13,42 @@
:disabled="showSetting" :disabled="showSetting"
@change="selectMonth" @change="selectMonth"
:clearable="false" :clearable="false"
style="width: 120px"></el-date-picker> style="width: 120px">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span <span class="separateStyle" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
class="separateStyle"
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="small" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')" :disabled="showSetting || settingBtnDis" @click="settingMsg">设置</el-button>
type="primary"
size="small"
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"
:disabled="showSetting || settingBtnDis"
@click="settingMsg">
设置
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="small" v-show="showSetting && autoScheduling" @click="schedulingBtn">自动排班</el-button>
type="primary"
size="small"
v-show="showSetting && autoScheduling"
@click="schedulingBtn">
自动排班
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span <span class="separateStyle" v-show="showSetting"></span>
class="separateStyle"
v-show="showSetting"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="small" v-show="showSetting" @click="confirmSetting">确认</el-button>
type="primary"
size="small"
v-show="showSetting"
@click="confirmSetting">
确认
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="small" plain v-show="showSetting" @click="cancelSetting">取消</el-button>
type="primary"
size="small"
plain
v-show="showSetting"
@click="cancelSetting">
取消
</el-button>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="请先选择查询的班组" class="rightItem">
v-hasPermi="[
'base:quality-inspection-record:query',
'base:core-work-order:query',
'base:core-product:query',
]"
label="请先选择查询的班组"
class="rightItem">
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> --> <!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> -->
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button> --> <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
<el-button <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
type="primary"
size="small"
:disabled="jumpDisabled"
@click="toOtherPage('3')">
班组检测查询
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- 日历区域 --> <!-- 日历区域 -->
<div class="calenderArea"> <div class="calenderArea">
<div style="font-size: 24px; font-weight: 500"> <div style="font-size: 24px;font-weight: 500">{{ this.month }} {{ this.year }}</div>
{{ this.month }} {{ this.year }}
</div>
<el-calendar v-model="startDay"> <el-calendar v-model="startDay">
<!-- 这里使用的是 2.5 slot 语法对于新项目请使用 2.6 slot 语法--> <!-- 这里使用的是 2.5 slot 语法对于新项目请使用 2.6 slot 语法-->
<template <template
slot="dateCell" slot="dateCell"
slot-scope="{ date, data }"> slot-scope="{date, data}">
<div v-if="data.type === 'current-month'"> <div v-if="data.type === 'current-month'">
<!-- 日期 --> <!-- 日期 -->
<div class="dateStyle"> <div class="dateStyle">
@ -104,64 +56,27 @@
</div> </div>
<!-- 班次班组 --> <!-- 班次班组 -->
<!-- class有两个样式一个是类似class1还有个是选中红框显示 --> <!-- class有两个样式一个是类似class1还有个是选中红框显示 -->
<el-row <el-row :gutter="2" :class="'class' + (index+1) + (chooseTip === (item.startDay+item.classesId) ? ' team-active' : '')" v-for="(item, index) in list[Number(data.day.split('-')[2])]" :key='index'>
:gutter="2"
:class="
'class' +
(index + 1) +
(chooseTip === item.startDay + item.classesId
? ' team-active'
: '')
"
v-for="(item, index) in list[Number(data.day.split('-')[2])]"
:key="index">
<el-col :span="12"> <el-col :span="12">
<div class="selectDiv"> <div class="selectDiv">
<!-- 选择班组图标 --> <!-- 选择班组图标 -->
<div <div class="toggle-icon" v-show="showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true)">
class="toggle-icon" <svg-icon icon-class="toggle"/>
v-show="
showSetting &&
(new Date(data.day).valueOf() < new Date().valueOf()
? false
: true)
">
<svg-icon icon-class="toggle" />
</div> </div>
<!-- 不能选择班组 --> <!-- 不能选择班组 -->
<div <div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div>
class="toggle-icon-hide" <el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)">
v-show="
!(
showSetting &&
(new Date(data.day).valueOf() < new Date().valueOf()
? false
: true)
)
"></div>
<el-select
v-model="item.teamId"
size="small"
:disabled="
!showSetting ||
(new Date(data.day).valueOf() > new Date().valueOf()
? false
: true)
">
<el-option <el-option
v-for="i in teamList" v-for="i in teamList"
:key="i.id" :key="i.id"
:label="i.name" :label="i.name"
:value="i.id"></el-option> :value="i.id">
</el-option>
</el-select> </el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-button <el-button class="labelClass" @click="chooseTeam(item)">{{ item.classesName }}</el-button>
class="labelClass"
@click="chooseTeam(item)">
{{ item.classesName }}
</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -172,299 +87,263 @@
</template> </template>
<script> <script>
import { import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
getPreset, import { listEnabledByRoom } from "@/api/base/groupTeam";
createOrUpdateList,
autoSet,
} from '@/api/base/groupTeamScheduling';
import { listEnabledByRoom } from '@/api/base/groupTeam';
import moment from 'moment'; import moment from 'moment';
import TopTab from './components/topTab'; import TopTab from './components/topTab'
export default { export default {
name: 'GroupTeamScheduling', name: "GroupTeamScheduling",
data() { data() {
return { return {
roomNameDict: null, roomNameDict:null,
startDay: '', // startDay: '',//
year: '', // 2023 year: '',// 2023
month: '', // month: '',//
monthList: [ monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
'一月',
'二月',
'三月',
'四月',
'五月',
'六月',
'七月',
'八月',
'九月',
'十月',
'十一月',
'十二月',
],
list: {}, list: {},
teamList: [], // teamList: [],//
showSetting: false, // showSetting: false,//
settingBtnDis: false, settingBtnDis: false,
jumpDisabled: true, // jumpDisabled: true,//
chooseObj: {}, // chooseObj: {}, //
chooseTip: '', // chooseTip: '',//
autoScheduling: false, // autoScheduling: false //
}; };
}, },
components: { TopTab }, components:{ TopTab },
created() { created() {
this.roomNameDict = this.getDictDatas('workshop')[0].value; this.roomNameDict = this.getDictDatas('workshop')[0].value
this.startDay = new Date(); this.startDay = new Date()
// //
this.settingBtn(); this.settingBtn()
this.getTeamList(); this.getTeamList()
this.toggleMonth(); this.toggleMonth()
this.getList(); this.getList()
}, },
methods: { methods: {
// //
toggleName(val) { toggleName(val) {
this.roomNameDict = val; this.roomNameDict = val
// //
if (this.showSetting) { if (this.showSetting) {
this.showSetting = !this.showSetting; this.showSetting = !this.showSetting
} }
// //
if (!this.jumpDisabled) { if (!this.jumpDisabled) {
this.clearChoose(); this.clearChoose()
} }
// //
this.getTeamList(); this.getTeamList()
// //
this.getList(); this.getList()
}, },
// //
selectMonth() { selectMonth() {
if (this.startDay) { if (this.startDay) {
this.settingBtn(); // ,getlist this.settingBtn() // ,getlist
this.toggleMonth(); this.toggleMonth()
this.getList(); this.getList()
this.clearChoose(); this.clearChoose()
if ( if ( moment(this.startDay).valueOf() > moment().endOf('month').valueOf()) {
moment(this.startDay).valueOf() > moment().endOf('month').valueOf() this.autoScheduling = true
) {
this.autoScheduling = true;
} else { } else {
this.autoScheduling = false; this.autoScheduling = false
} }
} }
}, },
// //
getTeamList() { getTeamList() {
console.log(this.roomNameDict); console.log(this.roomNameDict)
listEnabledByRoom({ listEnabledByRoom({
room: this.roomNameDict, room: this.roomNameDict
}).then((res) => { }).then(res => {
this.teamList = res.data || []; this.teamList = res.data || []
}); })
}, },
// //
getList() { getList() {
let year = moment(this.startDay).format('YYYY'); let year = moment(this.startDay).format('YYYY')
let month = moment(this.startDay).format('M'); let month = moment(this.startDay).format('M')
getPreset({ getPreset({
year: year, year: year,
month: month, month: month,
roomNameDict: this.roomNameDict, roomNameDict: this.roomNameDict
}) }).then(res => {
.then((res) => { let obj = res.data || {}
let obj = res.data || {};
if (obj) { if (obj) {
for (let item in obj) { for (let item in obj) {
for (let i = 0; i < obj[item].length; i++) { for (let i = 0; i < obj[item].length; i++) {
if (!obj[item][i].teamId) { if (!obj[item][i].teamId) {
obj[item][i].teamId = ''; obj[item][i].teamId = ''
} }
} }
} }
} }
this.list = obj; this.list = obj
this.settingBtnDis = false; this.settingBtnDis = false
}).catch(() => {
this.list = {}
this.settingBtnDis = true //
}) })
.catch(() => {
this.list = {};
this.settingBtnDis = true; //
});
}, },
// //
settingMsg() { settingMsg() {
this.showSetting = !this.showSetting; this.showSetting = !this.showSetting
this.clearChoose(); this.clearChoose()
}, },
// //
cancelSetting() { cancelSetting() {
this.showSetting = !this.showSetting; this.showSetting = !this.showSetting
this.getList(); // this.getList() //
}, },
// //
confirmSetting() { confirmSetting() {
let num = 0; let num = 0
// //
if ( if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) {
moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM') num = Number(moment().format('DD'))
) {
num = Number(moment().format('DD'));
} else { } else {
num = 0; num = 0
} }
// //
// //
let tempArr = Object.values(this.list); let tempArr = Object.values(this.list)
let arr = []; let arr = []
for (let i = num; i < tempArr.length; i++) { for (let i = num; i < tempArr.length; i++) {
for (let j = 0; j < tempArr[i].length; j++) { for (let j = 0; j < tempArr[i].length; j++) {
arr.push(tempArr[i][j]); arr.push(tempArr[i][j])
} }
} }
createOrUpdateList(arr).then((res) => { createOrUpdateList(arr).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.showSetting = !this.showSetting; this.showSetting = !this.showSetting
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功")
this.getList(); // this.getList() //
} }
}); })
}, },
// //
chooseTeam(value) { chooseTeam(value) {
if (this.showSetting) { if (this.showSetting) {
this.$modal.msgWarning('当前处于设置模式'); this.$modal.msgWarning("当前处于设置模式")
return false; return false
} }
this.chooseObj = value; this.chooseObj = value
this.chooseTip = value.startDay + value.classesId; // this.chooseTip = value.startDay + value.classesId //
this.jumpDisabled = false; // this.jumpDisabled = false //
}, },
// //
schedulingBtn() { schedulingBtn() {
let tempData = this.list; let tempData = this.list
// 1 // 1
if (this.list[1][0].teamId) { if (this.list[1][0].teamId) {
let tempArr = Object.values(this.list); let tempArr = Object.values(this.list)
let arr = []; let arr = []
let n = 0; let n = 0
for (let i = 0; i < tempArr.length; i++) { for (let i = 0; i < tempArr.length; i++) {
if (n > 0) { if (n > 0) {
break; break;
} }
for (let j = 0; j < tempArr[i].length; j++) { for (let j = 0; j < tempArr[i].length; j++) {
if (tempArr[i][j].teamId) { if (tempArr[i][j].teamId) {
arr.push(tempArr[i][j].teamId); arr.push(tempArr[i][j].teamId)
} else { } else {
n++; n++
} }
} }
} }
let tempNum = 0; let tempNum = 0
for (let k = 0; k < tempArr.length; k++) { for (let k = 0; k < tempArr.length; k++) {
for (let v = 0; v < tempArr[k].length; v++) { for (let v = 0; v < tempArr[k].length; v++) {
let t = tempNum % arr.length; let t = tempNum % arr.length
if (arr.length === 1) { if (arr.length === 1) {
tempData[k + 1][v].teamId = arr[0]; tempData[k+1][v].teamId = arr[0]
} else { } else {
tempData[k + 1][v].teamId = arr[t]; tempData[k+1][v].teamId = arr[t]
} }
tempNum++; tempNum++
} }
} }
this.list = []; this.list = []
this.list = tempData; this.list = tempData
} else { } else {
// 1, // 1,
// console.log(moment(this.startDay).format("YYYY-MM-DD")) // console.log(moment(this.startDay).format("YYYY-MM-DD"))
autoSet({ autoSet({
year: this.year, year: this.year,
month: moment(this.startDay).month() + 1, month: moment(this.startDay).month() + 1,
roomNameDict: this.roomNameDict, roomNameDict: this.roomNameDict
}).then((res) => { }).then(res => {
this.list = res.data || {}; this.list = res.data || {}
}); })
} }
}, },
// //
settingBtn() { settingBtn() {
let nowMonth = moment().startOf('month').valueOf(); let nowMonth = moment().startOf('month').valueOf()
let startMonth = moment(this.startDay).valueOf(); let startMonth = moment(this.startDay).valueOf()
let nowDate = moment(new Date()).date(); let nowDate = moment(new Date()).date()
let sumDate = moment().daysInMonth(); let sumDate = moment().daysInMonth()
if (nowMonth > startMonth) { if (nowMonth > startMonth) { //
// this.settingBtnDis = true
this.settingBtnDis = true;
} else { } else {
if (nowDate < sumDate) { if (nowDate < sumDate) {
this.settingBtnDis = false; this.settingBtnDis = false
} else { } else {
this.settingBtnDis = true; this.settingBtnDis = true
} }
} }
}, },
// //
clearChoose() { clearChoose() {
this.chooseObj = {}; this.chooseObj = {}
this.chooseTip = ''; this.chooseTip = ""
this.jumpDisabled = true; this.jumpDisabled = true
}, },
// //
toggleMonth() { toggleMonth() {
this.year = moment(this.startDay).format('YYYY'); this.year = moment(this.startDay).format("YYYY")
let month = Number(moment(this.startDay).format('MM')); let month = Number(moment(this.startDay).format("MM"))
this.month = this.monthList[month - 1]; this.month = this.monthList[month - 1]
}, },
// 3 // 3
toOtherPage(val) { toOtherPage(val) {
switch (val) { switch (val) {
case '1': case '1':
this.$router.push({ this.$router.push({
path: path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
'/core/enhance/product-line-24h?startTime=' + })
this.chooseObj.startTime +
'&endTime=' +
this.chooseObj.endTime,
});
break; break;
case '2': // case '2': //
this.$router.push({ this.$router.push({
path: path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
'/energy/base/energy-quantity-realtime?startTime=' + })
this.chooseObj.startTime +
'&endTime=' +
this.chooseObj.endTime,
});
break; break;
default: default:
this.$router.push({ this.$router.push({
path: path: '/quality/base/quality-inspection-data/detection-information/statistical-data?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
'/quality/base/quality-inspection-data/detection-information/statistical-data?startTime=' +
this.chooseObj.startTime +
'&endTime=' +
this.chooseObj.endTime,
// name: 'QualityStatistics', // name: 'QualityStatistics',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } // params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
}); })
}
}
}
} }
},
},
};
</script> </script>
<style lang='scss'> <style lang='scss'>
.demo-form-inline { .demo-form-inline {
.el-date-editor .el-range__icon { .el-date-editor .el-range__icon {
font-size: 16px; font-size: 16px;
color: #0b58ff; color: #0B58FF;
} }
.el-input__prefix .el-icon-date { .el-input__prefix .el-icon-date {
font-size: 16px; font-size: 16px;
color: #0b58ff; color: #0B58FF;
} }
} }
.groupTeamScheduling { .groupTeamScheduling {
background-color: #f2f4f9; background-color: #F2F4F9;
.operationArea { .operationArea {
padding: 14px 10px 0 16px; padding: 14px 10px 0 16px;
margin-bottom: 8px; margin-bottom: 8px;
@ -474,7 +353,7 @@ export default {
display: inline-block; display: inline-block;
width: 4px; width: 4px;
height: 16px; height: 16px;
background-color: #0b58ff; background-color: #0B58FF;
border-radius: 1px; border-radius: 1px;
margin-right: 8px; margin-right: 8px;
margin-top: 10px; margin-top: 10px;
@ -483,7 +362,7 @@ export default {
display: inline-block; display: inline-block;
width: 1px; width: 1px;
height: 24px; height: 24px;
background: #e8e8e8; background: #E8E8E8;
vertical-align: middle; vertical-align: middle;
} }
.el-form-item { .el-form-item {
@ -515,8 +394,7 @@ export default {
} }
.el-calendar-table__row { .el-calendar-table__row {
height: 133px; height: 133px;
.prev, .prev, .next {
.next {
pointer-events: none; pointer-events: none;
} }
.el-calendar-day { .el-calendar-day {
@ -533,13 +411,10 @@ export default {
} }
} }
} }
.team-active { .team-active {//
// border:2px solid red
border: 2px solid red;
} }
.class1, .class1, .class2, .class3 {
.class2,
.class3 {
padding: 0; padding: 0;
font-weight: 600; font-weight: 600;
margin-bottom: 2px; margin-bottom: 2px;
@ -583,50 +458,47 @@ export default {
} }
.class1 { .class1 {
.selectDiv { .selectDiv {
.toggle-icon, .toggle-icon, .toggle-icon-hide {
.toggle-icon-hide { background-color: #FACE00;
background-color: #face00;
} }
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
color: #e7a200; color: #E7A200;
background-color: #ffefc0; background-color: #FFEFC0;
} }
} }
.labelClass { .labelClass {
color: #e7a200; color: #E7A200;
background-color: #ffefc0; background-color: #FFEFC0;
} }
} }
.class2 { .class2 {
.selectDiv { .selectDiv {
.toggle-icon, .toggle-icon, .toggle-icon-hide {
.toggle-icon-hide { background-color: #3984FF;
background-color: #3984ff;
} }
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
color: #2d7bff; color: #2D7BFF;
background-color: #beeaff; background-color: #BEEAFF;
} }
} }
.labelClass { .labelClass {
color: #2d7bff; color: #2D7BFF;
background-color: #beeaff; background-color: #BEEAFF;
} }
} }
.class3 { .class3 {
.selectDiv { .selectDiv {
.toggle-icon, .toggle-icon, .toggle-icon-hide {
.toggle-icon-hide { background-color: #37D97F;
background-color: #37d97f;
} }
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
color: #129f51; color: #129F51;
background-color: #e0ffee; background-color: #E0FFEE;
} }
} }
.labelClass { .labelClass {
color: #129f51; color: #129F51;
background-color: #e0ffee; background-color: #E0FFEE;
} }
} }
} }

View File

@ -88,7 +88,7 @@ export default {
workOrderList: [], workOrderList: [],
workOrderName: '', workOrderName: '',
tableBtn: [ tableBtn: [
this.$auth.hasPermi('monitoring:group-team-scheduling:query') this.$auth.hasPermi('base:group-team-view:detail')
? { ? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',

View File

@ -97,7 +97,7 @@ export default {
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('monitoring:group-team-scheduling:query') this.$auth.hasPermi('base:team-production:detail')
? { ? {
type: 'productionDetail', type: 'productionDetail',
btnName: '查看', btnName: '查看',

View File

@ -173,24 +173,12 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermiAnd([ type: this.$auth.hasPermi('base:order-group:create')
'base:order-group:create',
'base:core-product:query',
'base:core-customer:query',
'base:order:query',
])
? 'separate' ? 'separate'
: '', : '',
}, },
{ {
type: this.$auth.hasPermiAnd([ type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
'base:order-group:create',
'base:core-product:query',
'base:core-customer:query',
'base:order:query',
])
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -209,10 +197,7 @@ export default {
tableProps, tableProps,
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-group:bind')
'base:order:query',
'base:order-con-group-order:create',
])
? { ? {
type: 'bind', type: 'bind',
btnName: '绑定', btnName: '绑定',
@ -229,7 +214,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:update') this.$auth.hasPermi('base:order-group:complete')
? { ? {
type: 'complete', type: 'complete',
btnName: '完成', btnName: '完成',
@ -246,7 +231,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:update') this.$auth.hasPermi('base:order-group:termination')
? { ? {
type: 'termination', type: 'termination',
btnName: '终止', btnName: '终止',
@ -263,7 +248,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:update') this.$auth.hasPermi('base:order-group:cancel')
? { ? {
type: 'cancel', type: 'cancel',
btnName: '作废', btnName: '作废',
@ -280,17 +265,11 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-group:update') {
? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
} },
: undefined, this.$auth.hasPermi('base:order-group:edit')
this.$auth.hasPermiAnd([
'base:order-group:update',
'base:core-product:query',
'base:core-customer:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -15,7 +15,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="250" :width="290"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -169,22 +169,12 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermiAnd([ type: this.$auth.hasPermi('base:order-manage:create')
'base:order:query',
'base:core-product:query',
'base:order:create',
])
? 'separate' ? 'separate'
: '', : '',
}, },
{ {
type: this.$auth.hasPermiAnd([ type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
'base:order:query',
'base:core-product:query',
'base:order:create',
])
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -220,14 +210,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-manage:bindWorkOrder')
'base:order:update',
'base:core-product:query',
'base:production-line:query',
'extend:process-flow:query',
'base:core-work-order:query',
'base:order:query',
])
? { ? {
type: 'bind', type: 'bind',
btnName: '绑定', btnName: '绑定',
@ -244,7 +227,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order:update') this.$auth.hasPermi('base:order-manage:complete')
? { ? {
type: 'complete', type: 'complete',
btnName: '完成', btnName: '完成',
@ -261,7 +244,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order:update') this.$auth.hasPermi('base:order-manage:termination')
? { ? {
type: 'termination', type: 'termination',
btnName: '终止', btnName: '终止',
@ -278,7 +261,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order:update') this.$auth.hasPermi('base:order-manage:cancel')
? { ? {
type: 'cancel', type: 'cancel',
btnName: '作废', btnName: '作废',
@ -295,20 +278,13 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-manage:detail')
'base:order:query',
'extend:process-flow:query',
])
? { ? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
} }
: undefined, : undefined,
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-manage:edit')
'base:order:query',
'base:core-product:query',
'base:order:update',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -4,72 +4,24 @@
<span class="blueTitle"></span> <span class="blueTitle"></span>
<span>各集团订单环形图</span> <span>各集团订单环形图</span>
</div> </div>
<div <div class="chartBox" id='orderChartBox' v-show='chartList.length'>
class="chartBox" <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'}">
id="orderChartBox" <div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
v-show="chartList.length"> <svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
<div <span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderGroupName}}</span>
class="chartItem" <span>订单计划数量{{item.num}}</span>
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="{ :style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
width: 166 * beilv + 'px', ></div>
height: 166 * beilv + 'px', <div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
margin: 'auto', <div class="legendItem" v-for="(subItem, i) in item.order" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
}"></div> <span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
<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 <span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
class="itemName" <span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span>
:style="{ fontSize: 14 * beilv + 'px' }"> {{subItem.name}}
<span
class="smallBlock"
:style="{
backgroundColor: subItem.color,
width: 8 * beilv + 'px',
height: 8 * beilv + 'px',
}"></span>
{{ subItem.name }}
</span> </span>
</div> </div>
</div> </div>
@ -77,66 +29,59 @@
</div> </div>
</div> </div>
<!-- 空图 --> <!-- 空图 -->
<div <div class="no-data-bg" v-show='!chartList.length'></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.canvasReset(); this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
window.addEventListener('resize', this.canvasReset); this.canvasReset = debounce(() => {
}, this.initChart()
destroyed() { }, 500)
window.removeEventListener('resize', this.canvasReset); window.addEventListener('resize', () => {
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 = ( let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
(this.chartList[i].sunNum / this.chartList[i].num) *
100
).toFixed(0);
var option = { var option = {
color: colorList, color: colorList,
series: [ series: [
@ -148,40 +93,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: {
disabled: true,
},
labelLine: {
show: false,
},
data: this.chartList[i].order,
},
],
};
option && this.myChart[i].setOption(option);
} }
}, },
emphasis: {
disabled: true
}, },
}; labelLine: {
show: false
},
data: this.chartList[i].order
}
]
};
option && this.myChart[i].setOption(option)
}
}
}
}
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.chartBox { .chartBox {
@ -194,11 +139,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 {
@ -207,7 +152,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;

View File

@ -181,10 +181,7 @@ export default {
list: [], list: [],
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
'base:order:query',
'extend:process-flow:query',
])
? { ? {
type: 'orderDetail', type: 'orderDetail',
btnName: '详情', btnName: '详情',
@ -201,11 +198,7 @@ export default {
}, },
} }
: undefined, : undefined,
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
'base:quality-inspection-record:query',
'base:core-product:query',
'base:core-work-order:query',
])
? { ? {
type: 'qualityDetail', type: 'qualityDetail',
btnName: '质量', btnName: '质量',

View File

@ -62,9 +62,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn:create') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn:create') type: this.$auth.hasPermi('base:quality-inspection-box-btn:create')

View File

@ -66,7 +66,7 @@ export default {
param: 'nickName', param: 'nickName',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn-auth:query') type: this.$auth.hasPermi('base:quality-inspection-box-permissions:query')
? 'button' ? 'button'
: '', : '',
btnName: '查询', btnName: '查询',
@ -74,12 +74,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn-auth:create') type: 'separate',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn-auth:create') type: this.$auth.hasPermi('base:quality-inspection-box-permissions:create')
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@ -89,13 +87,13 @@ export default {
}, },
], ],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:quality-inspection-box-btn-auth:update') this.$auth.hasPermi('base:quality-inspection-box-permissions:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:quality-inspection-box-btn-auth:delete') this.$auth.hasPermi('base:quality-inspection-box-permissions:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-08 13:46:17 * @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-04-11 15:25:51 * @LastEditTime: 2024-03-25 08:50:25
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -73,45 +73,31 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row :gutter="24" v-for="(item,index) in ingredientList" :key="item.id"> <el-row :gutter="24" v-for="(item,index) in ingredientList" :key="item.id">
<el-col :span="4"> <el-col :span="6">
<el-form-item label="成分"> <el-form-item label="成分">
{{ item.checkName }} {{ item.name }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :prop="'checkValueList.' + index + '.minCheckValue'" label="最小检测值" <el-form-item :prop="'checkValueList.' + index + '.checkValue'" label="成分含量"
:rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]">
<el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail" <el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail"
style="width: 90%;margin-right: 10px;" :max="item.maxValue" :min='item.minValue' style="width: 90%;margin-right: 10px;" :max="item.maxValue" :min='item.minValue'
v-model.number="dataForm.checkValueList[index].minCheckValue" v-model.number="dataForm.checkValueList[index].checkValue"
@change="judgeMinValue(arguments[0],item.minValue,item.maxValue,index)"></el-input> @change="judgeValue(arguments[0],item.minValue,item.maxValue,index)"></el-input>
<span v-if="dataForm.checkValueList[index].showIcon"> <span v-if="dataForm.checkValueList[index].showIcon">
<!-- <i class="el-icon-success"></i> --> <!-- <i class="el-icon-success"></i> -->
<svg-icon v-if="dataForm.checkValueList[index].isMinStandard" icon-class="standards" /> <svg-icon v-if="dataForm.checkValueList[index].isStandard" icon-class="standards" />
<svg-icon v-else icon-class="noStandards" /> <svg-icon v-else icon-class="noStandards" />
</span> </span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :prop="'checkValueList.' + index + '.maxCheckValue'" label="最大检测值"
:rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]">
<el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail"
style="width: 90%;margin-right: 10px;" :max="item.maxValue" :min='item.minValue'
v-model.number="dataForm.checkValueList[index].maxCheckValue"
@change="judgeMaxValue(arguments[0],item.minValue,item.maxValue,index)"></el-input>
<span v-if="dataForm.checkValueList[index].showIcon">
<!-- <i class="el-icon-success"></i> -->
<svg-icon v-if="dataForm.checkValueList[index].isMaxStandard" icon-class="standards" />
<svg-icon v-else icon-class="noStandards" />
</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最小值"> <el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最小值">
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.minValue"></el-input> <el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.minValue"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="6">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最大值"> <el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最大值">
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.maxValue"></el-input> <el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.maxValue"></el-input>
</el-form-item> </el-form-item>
@ -274,25 +260,14 @@ export default {
onInput() { onInput() {
this.$forceUpdate(); this.$forceUpdate();
}, },
judgeMinValue(val, minValue, maxValue, index) { judgeValue(val, minValue, maxValue, index) {
// console.log(cal);
if (val >= minValue && val <= maxValue) { if (val >= minValue && val <= maxValue) {
console.log(val) console.log(val)
this.dataForm.checkValueList[index].showIcon = true this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isMinStandard = true this.dataForm.checkValueList[index].isStandard = true
} else { } else {
this.dataForm.checkValueList[index].showIcon = true this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isMinStandard = false this.dataForm.checkValueList[index].isStandard = false
}
},
judgeMaxValue(val, minValue, maxValue, index) {
if (val >= minValue && val <= maxValue) {
console.log(val)
this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isMaxStandard = true
} else {
this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isMaxStandard = false
} }
}, },
handleClose() { handleClose() {
@ -315,7 +290,7 @@ export default {
checkerId: this.dataForm.checkerId, checkerId: this.dataForm.checkerId,
checkTime: this.dataForm.checkTime, checkTime: this.dataForm.checkTime,
appearance: this.dataForm.appearance, appearance: this.dataForm.appearance,
// checkResult: this.dataForm.checkResult, checkResult: this.dataForm.checkResult,
materialGrade: this.dataForm.materialGrade, materialGrade: this.dataForm.materialGrade,
// checkValueList: [], // checkValueList: [],
checkResult: this.dataForm.checkResult, checkResult: this.dataForm.checkResult,
@ -329,9 +304,7 @@ export default {
mainId: this.dataForm.id, mainId: this.dataForm.id,
id:ele.id, id:ele.id,
checkDetId: ele.checkDetId, checkDetId: ele.checkDetId,
minCheckValue: ele.minCheckValue, checkValue: ele.checkValue
maxCheckValue: ele.maxCheckValue
})) }))
}) })
Promise.all(array).then(res => { Promise.all(array).then(res => {
@ -360,7 +333,7 @@ export default {
checkResult: this.dataForm.checkResult, checkResult: this.dataForm.checkResult,
materialGrade: this.dataForm.materialGrade, materialGrade: this.dataForm.materialGrade,
// checkValueList: [], // checkValueList: [],
// checkResult: this.dataForm.checkResult, checkResult: this.dataForm.checkResult,
materialGrade: this.dataForm.materialGrade, materialGrade: this.dataForm.materialGrade,
remark:this.dataForm.remark remark:this.dataForm.remark
} }
@ -368,15 +341,11 @@ export default {
// this.idAttrShow = true; // this.idAttrShow = true;
let array = [] let array = []
this.dataForm.checkValueList.forEach(ele => { this.dataForm.checkValueList.forEach(ele => {
array.push(this.createDet([ array.push(this.createDet({
{
mainId: response.data, mainId: response.data,
checkDetId: ele.checkDetId, checkDetId: ele.checkDetId,
minCheckValue: ele.minCheckValue, checkValue: ele.checkValue
maxCheckValue: ele.maxCheckValue }))
}
]))
}) })
Promise.all(array).then(res => { Promise.all(array).then(res => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
@ -407,17 +376,14 @@ export default {
getMaterialCheckList({ getMaterialCheckList({
materialId:val materialId:val
}).then((res) => { }).then((res) => {
console.log('aaaaaaaa', res.data);
this.ingredientList = res.data this.ingredientList = res.data
this.ingredientFlag = true this.ingredientFlag = true
this.dataForm.checkValueList = res.data.map((ele) => { this.dataForm.checkValueList = res.data.map((ele) => {
return { return {
mainId: null, mainId: null,
checkDetId: ele.checkDetId, checkDetId: ele.id,
minCheckValue:undefined, checkValue: null,
maxCheckValue: undefined, isStandard: true,
isMinStandard: true,
isMaxStandard: true,
showIcon:false, showIcon:false,
} }
}) })
@ -511,31 +477,28 @@ export default {
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data this.dataForm = response.data
getMaterialCheckList({ getMaterialCheckList({
materialId: response.data.materialId, materialId: response.data.materialId
mainId:id,
}).then((res) => { }).then((res) => {
console.log(res.data); console.log(res.data);
let arr = res.data let arr = res.data
valueList = arr.map((ele) => { valueList = arr.map((ele) => {
// console.log(ele) // console.log(ele)
return { return {
checkDetId: ele.checkDetId, checkDetId:ele.id,
maxValue: ele.maxValue, maxValue: ele.maxValue,
minValue: ele.minValue minValue: ele.minValue
} }
}) })
console.log(valueList); console.log(valueList);
getQualityHotMaterialDetList({ getQualityHotMaterialDetList({
mainId: response.data.id, mainId: response.data.id
materialId: response.data.materialId,
}).then((result) => { }).then((result) => {
this.ingredientList = result.data.map((ele) => { this.ingredientList = result.data.map((ele) => {
return { return {
checkName: ele.checkName, name: ele.checkName,
id: ele.id, id: ele.id,
checkDetId: ele.checkDetId, checkDetId: ele.checkDetId,
minCheckValue: ele.minCheckValue, checkValue: ele.checkValue,
maxCheckValue: ele.maxCheckValue,
maxValue:null, maxValue:null,
minValue: null minValue: null
} }
@ -546,10 +509,8 @@ export default {
mainId: ele.mainId, mainId: ele.mainId,
id: ele.id, id: ele.id,
checkDetId: ele.checkDetId, checkDetId: ele.checkDetId,
minCheckValue: ele.minCheckValue, checkValue: ele.checkValue,
maxCheckValue: ele.maxCheckValue, isStandard: true,
isMinStandard: true,
isMaxStandard: true,
showIcon: false, showIcon: false,
} }
}) })
@ -563,21 +524,13 @@ export default {
}) })
valueList.forEach((ele, index) => { valueList.forEach((ele, index) => {
this.dataForm.checkValueList.forEach((item, i) => { this.dataForm.checkValueList.forEach((item, i) => {
if (ele.checkDetId == item.checkDetId && item.minCheckValue >= ele.minValue && item.minCheckValue <= ele.maxValue) { if (ele.checkDetId == item.checkDetId && item.checkValue >= ele.minValue && item.checkValue <= ele.maxValue) {
console.log(1111) console.log(1111)
item.showIcon = true item.showIcon = true
item.isMinStandard = true item.isStandard = true
} else { } else {
item.showIcon = true item.showIcon = true
item.isMinStandard = false item.isStandard = false
}
if (ele.checkDetId == item.checkDetId && item.maxCheckValue >= ele.minValue && item.maxCheckValue <= ele.maxValue) {
console.log(1111)
item.showIcon = true
item.isMaxStandard = true
} else {
item.showIcon = true
item.isMaxStandard = false
} }
}) })
}) })

View File

@ -141,8 +141,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '', type: 'separate',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '', type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',

View File

@ -105,10 +105,7 @@ export default {
// name: 'reset', // name: 'reset',
// }, // },
{ {
// type: 'separate', type: 'separate',
type: this.$auth.hasPermi('base:quality-inspection-det:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-det:create') type: this.$auth.hasPermi('base:quality-inspection-det:create')

View File

@ -147,10 +147,7 @@ export default {
// name: 'reset', // name: 'reset',
// }, // },
{ {
type: this.$auth.hasPermi('base:quality-inspection-type:create') type: 'separate',
? 'separate'
: '',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-type:create') type: this.$auth.hasPermi('base:quality-inspection-type:create')

View File

@ -98,8 +98,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'separate' : '', type: 'separate',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '', type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-04-09 15:14:08 * @LastEditTime: 2024-03-22 17:13:16
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -26,7 +26,7 @@ import {
getQualityScrapLogPage, getQualityScrapLogPage,
deleteQualityScrapLog, deleteQualityScrapLog,
getWorkOrderList, getWorkOrderList,
// getTeamList getTeamList
} from '@/api/base/qualityScrapLog'; } from '@/api/base/qualityScrapLog';
const tableProps = [ const tableProps = [
@ -125,8 +125,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'separate' : '', type: 'separate',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '', type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
@ -190,18 +189,18 @@ export default {
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}) })
// getTeamList().then((res) => { getTeamList().then((res) => {
// console.log(res); console.log(res);
// // console.log(response); // console.log(response);
// this.formConfig[1].selectOptions = res.data.map((item) => { this.formConfig[1].selectOptions = res.data.map((item) => {
// return { return {
// name: item.name, name: item.name,
// id: item.id id: item.id
// } }
// }) })
// // console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
// }) })
}, },
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;

View File

@ -88,8 +88,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'separate' : '', type: 'separate',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '', type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '',

View File

@ -269,13 +269,6 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{
type: this.$auth.hasPermi(
'monitoring:equipment-traceability:export'
)
? 'separate'
: '',
},
{ {
type: this.$auth.hasPermi( type: this.$auth.hasPermi(
'monitoring:equipment-traceability:export' 'monitoring:equipment-traceability:export'

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-10 16:31:48 * @LastEditTime: 2024-04-07 16:19:18
* @Description: * @Description:
--> -->
<template> <template>
@ -161,13 +161,6 @@ export default {
// type: 'separate', // type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// }, // },
{
type: this.$auth.hasPermi(
'monitoring:materiel-date-from:export'
)
? 'separate'
: '',
},
{ {
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '', type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
btnName: '导出', btnName: '导出',

View File

@ -169,12 +169,7 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi( type: 'separate',
'base:quality-inspection-record:create'
)
? 'separate'
: '',
// type: 'separate',
}, },
{ {
type: this.$auth.hasPermi( type: this.$auth.hasPermi(

View File

@ -99,14 +99,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',

View File

@ -103,14 +103,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -128,16 +124,13 @@ export default {
tableProps, tableProps,
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:voc:update')
'base:environmental-check:update',
'base:environmental-check:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:environmental-check:delete') this.$auth.hasPermi('base:voc:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',

View File

@ -99,14 +99,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',

View File

@ -103,14 +103,10 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -128,16 +124,13 @@ export default {
tableProps, tableProps,
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermiAnd([ this.$auth.hasPermi('base:waste-gas:update')
'base:environmental-check:update',
'base:environmental-check:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:environmental-check:delete') this.$auth.hasPermi('base:waste-gas:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',

View File

@ -99,14 +99,12 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:waste-water:export')
? 'separate' ? 'separate'
: '', : '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check-record:export') type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',

View File

@ -103,14 +103,12 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:waste-water:create')
? 'separate' ? 'separate'
: '', : '',
}, },
{ {
type: this.$auth.hasPermi('base:environmental-check:create') type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -128,13 +126,13 @@ export default {
tableProps, tableProps,
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:environmental-check:update') this.$auth.hasPermi('base:waste-water:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:environmental-check:delete') this.$auth.hasPermi('base:waste-water:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',

View File

@ -3,188 +3,76 @@
<!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" /> <!-- <doc-alert title="功能权限" url="https://doc.iocoder.cn/resource-permission" />
<doc-alert title="菜单路由" url="https://doc.iocoder.cn/vue2/route/" /> --> <doc-alert title="菜单路由" url="https://doc.iocoder.cn/vue2/route/" /> -->
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
:model="queryParams" <el-form-item label="菜单名称" prop="name">
ref="queryForm" <el-input v-model="queryParams.name" placeholder="请输入菜单名称" clearable @keyup.enter.native="handleQuery"/>
size="small"
:inline="true"
v-show="showSearch">
<el-form-item
label="菜单名称"
prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入菜单名称"
clearable
@keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="状态" prop="status">
label="状态" <el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
prop="status"> <el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
<el-select
v-model="queryParams.status"
placeholder="菜单状态"
clearable>
<el-option
v-for="dict in statusDictDatas"
:key="parseInt(dict.value)"
:label="dict.label"
:value="parseInt(dict.value)" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
icon="el-icon-search"
@click="handleQuery">
搜索
</el-button>
<el-button
icon="el-icon-refresh"
@click="resetQuery">
重置
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row <el-row :gutter="10" class="mb8">
:gutter="10"
class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
type="primary" v-hasPermi="['system:menu:create']">新增</el-button>
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:menu:create']">
新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll">
展开/折叠
</el-button>
</el-col> </el-col>
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table <el-table v-if="refreshTable" v-loading="loading" :data="menuList" row-key="id" :default-expand-all="isExpandAll"
v-if="refreshTable" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
v-loading="loading" <el-table-column prop="name" label="菜单名称" :show-overflow-tooltip="true" width="250"></el-table-column>
:data="menuList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column
prop="name"
label="菜单名称"
:show-overflow-tooltip="true"
width="250"></el-table-column>
<!-- <el-table-column prop="icon" label="图标" align="center" width="100"> <!-- <el-table-column prop="icon" label="图标" align="center" width="100">
<template v-slot="scope"> <template v-slot="scope">
<svg-icon :icon-class="scope.row.icon" /> <svg-icon :icon-class="scope.row.icon" />
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column <el-table-column prop="sort" label="排序" width="60"></el-table-column>
prop="sort" <el-table-column prop="permission" label="权限标识" :show-overflow-tooltip="true" />
label="排序" <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true" />
width="60"></el-table-column> <el-table-column prop="componentName" label="组件名称" :show-overflow-tooltip="true" />
<el-table-column <el-table-column prop="status" label="状态" width="80">
prop="permission"
label="权限标识"
:show-overflow-tooltip="true" />
<el-table-column
prop="component"
label="组件路径"
:show-overflow-tooltip="true" />
<el-table-column
prop="componentName"
label="组件名称"
:show-overflow-tooltip="true" />
<el-table-column
prop="status"
label="状态"
width="80">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
:type="DICT_TYPE.COMMON_STATUS"
:value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
label="操作"
align="center"
class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
size="mini" v-hasPermi="['system:menu:update']">修改</el-button>
type="text" <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
icon="el-icon-edit" v-hasPermi="['system:menu:create']">新增</el-button>
@click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:menu:update']"> v-hasPermi="['system:menu:delete']">删除</el-button>
修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:create']">
新增
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:menu:delete']">
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 添加或修改菜单对话框 --> <!-- 添加或修改菜单对话框 -->
<el-dialog <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
:title="title" <el-form ref="form" :model="form" :rules="rules" label-width="100px">
:visible.sync="open"
width="800px"
append-to-body>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="100px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="上级菜单"> <el-form-item label="上级菜单">
<treeselect <treeselect v-model="form.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true"
v-model="form.parentId" placeholder="选择上级菜单"/>
:options="menuOptions"
:normalizer="normalizer"
:show-count="true"
placeholder="选择上级菜单" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item <el-form-item label="菜单类型" prop="type">
label="菜单类型"
prop="type">
<el-radio-group v-model="form.type"> <el-radio-group v-model="form.type">
<el-radio <el-radio v-for="dict in menuTypeDictDatas" :key="parseInt(dict.value)" :label="parseInt(dict.value)">
v-for="dict in menuTypeDictDatas" {{dict.label}}</el-radio>
:key="parseInt(dict.value)"
:label="parseInt(dict.value)">
{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -201,192 +89,107 @@
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="菜单名称" prop="name">
label="菜单名称" <el-input v-model="form.name" placeholder="请输入菜单名称" />
prop="name">
<el-input
v-model="form.name"
placeholder="请输入菜单名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="显示排序" prop="sort">
label="显示排序" <el-input-number v-model="form.sort" controls-position="right" :min="0" />
prop="sort">
<el-input-number
v-model="form.sort"
controls-position="right"
:min="0" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-if="form.type !== 3" label="路由地址" prop="path">
v-if="form.type !== 3"
label="路由地址"
prop="path">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头" placement="top">
content="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
路由地址 路由地址
</span> </span>
<el-input <el-input v-model="form.path" placeholder="请输入路由地址" />
v-model="form.path"
placeholder="请输入路由地址" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-if="form.type !== 1" label="权限标识">
v-if="form.type !== 1"
label="权限标识">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)" placement="top">
content="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
权限字符 权限字符
</span> </span>
<el-input <el-input v-model="form.permission" placeholder="请权限标识" maxlength="50" />
v-model="form.permission"
placeholder="请权限标识"
maxlength="200" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12" v-if="form.type === 2">
:span="12" <el-form-item label="组件路径" prop="component">
v-if="form.type === 2"> <el-input v-model="form.component" placeholder="例如说system/user/index" />
<el-form-item
label="组件路径"
prop="component">
<el-input
v-model="form.component"
placeholder="例如说system/user/index" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12" v-if="form.type === 2">
:span="12" <el-form-item label="组件名称" prop="componentName">
v-if="form.type === 2"> <el-input v-model="form.componentName" placeholder="例如说SystemUser" />
<el-form-item
label="组件名称"
prop="componentName">
<el-input
v-model="form.componentName"
placeholder="例如说SystemUser" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="菜单状态" prop="status">
label="菜单状态"
prop="status">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="选择停用时,路由将不会出现在侧边栏,也不能被访问" placement="top">
content="选择停用时,路由将不会出现在侧边栏,也不能被访问"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
菜单状态 菜单状态
</span> </span>
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio <el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" :key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio>
:key="dict.value"
:label="parseInt(dict.value)">
{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-if="form.type !== 3" label="显示状态">
v-if="form.type !== 3"
label="显示状态">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问" placement="top">
content="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
是否显示 是否显示
</span> </span>
<el-radio-group v-model="form.visible"> <el-radio-group v-model="form.visible">
<el-radio <el-radio :key="true" :label="true">显示</el-radio>
:key="true" <el-radio :key="false" :label="false">隐藏</el-radio>
:label="true">
显示
</el-radio>
<el-radio
:key="false"
:label="false">
隐藏
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-if="form.type !== 3" label="总是显示">
v-if="form.type !== 3"
label="总是显示">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="选择不是时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单" placement="top">
content="选择不是时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
总是显示 总是显示
</span> </span>
<el-radio-group v-model="form.alwaysShow"> <el-radio-group v-model="form.alwaysShow">
<el-radio <el-radio :key="true" :label="true">总是</el-radio>
:key="true" <el-radio :key="false" :label="false">不是</el-radio>
:label="true">
总是
</el-radio>
<el-radio
:key="false"
:label="false">
不是
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-if="form.type === 2" label="是否缓存">
v-if="form.type === 2"
label="是否缓存">
<span slot="label"> <span slot="label">
<el-tooltip <el-tooltip content="选择缓存时,则会被 `keep-alive` 缓存,必须填写「组件名称」字段" placement="top">
content="选择缓存时,则会被 `keep-alive` 缓存,必须填写「组件名称」字段"
placement="top">
<i class="el-icon-question" /> <i class="el-icon-question" />
</el-tooltip> </el-tooltip>
是否缓存 是否缓存
</span> </span>
<el-radio-group v-model="form.keepAlive"> <el-radio-group v-model="form.keepAlive">
<el-radio <el-radio :key="true" :label="true">缓存</el-radio>
:key="true" <el-radio :key="false" :label="false">不缓存</el-radio>
:label="true">
缓存
</el-radio>
<el-radio
:key="false"
:label="false">
不缓存
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div <div slot="footer" class="dialog-footer">
slot="footer" <el-button type="primary" @click="submitForm"> </el-button>
class="dialog-footer">
<el-button
type="primary"
@click="submitForm">
</el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -394,23 +197,17 @@
</template> </template>
<script> <script>
import { import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
listMenu, import Treeselect from "@riophae/vue-treeselect";
getMenu, import "@riophae/vue-treeselect/dist/vue-treeselect.css";
delMenu, import IconSelect from "@/components/IconSelect";
addMenu,
updateMenu,
} from '@/api/system/menu';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import IconSelect from '@/components/IconSelect';
import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'; import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { isExternal } from '@/utils/validate'; import {isExternal} from "@/utils/validate";
export default { export default {
name: 'SystemMenu', name: "SystemMenu",
components: { Treeselect, IconSelect }, components: { Treeselect, IconSelect },
data() { data() {
return { return {
@ -423,7 +220,7 @@ export default {
// //
menuOptions: [], menuOptions: [],
// //
title: '', title: "",
// //
open: false, open: false,
// //
@ -433,22 +230,24 @@ export default {
// //
queryParams: { queryParams: {
name: undefined, name: undefined,
visible: undefined, visible: undefined
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
name: [ name: [
{ required: true, message: '菜单名称不能为空', trigger: 'blur' }, { required: true, message: "菜单名称不能为空", trigger: "blur" }
], ],
sort: [ sort: [
{ required: true, message: '菜单顺序不能为空', trigger: 'blur' }, { required: true, message: "菜单顺序不能为空", trigger: "blur" }
], ],
path: [ path: [
{ required: true, message: '路由地址不能为空', trigger: 'blur' }, { required: true, message: "路由地址不能为空", trigger: "blur" }
], ],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }], status: [
{ required: true, message: "状态不能为空", trigger: "blur" }
]
}, },
// //
@ -456,7 +255,7 @@ export default {
CommonStatusEnum: CommonStatusEnum, CommonStatusEnum: CommonStatusEnum,
// //
menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE), menuTypeDictDatas: getDictDatas(DICT_TYPE.SYSTEM_MENU_TYPE),
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS), statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS)
}; };
}, },
created() { created() {
@ -470,8 +269,8 @@ export default {
/** 查询菜单列表 */ /** 查询菜单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listMenu(this.queryParams).then((response) => { listMenu(this.queryParams).then(response => {
this.menuList = this.handleTree(response.data, 'id'); this.menuList = this.handleTree(response.data, "id");
this.loading = false; this.loading = false;
}); });
}, },
@ -483,15 +282,15 @@ export default {
return { return {
id: node.id, id: node.id,
label: node.name, label: node.name,
children: node.children, children: node.children
}; };
}, },
/** 查询菜单下拉树结构 */ /** 查询菜单下拉树结构 */
getTreeselect() { getTreeselect() {
listMenu().then((response) => { listMenu().then(response => {
this.menuOptions = []; this.menuOptions = [];
const menu = { id: 0, name: '主类目', children: [] }; const menu = { id: 0, name: '主类目', children: [] };
menu.children = this.handleTree(response.data, 'id'); menu.children = this.handleTree(response.data, "id");
this.menuOptions.push(menu); this.menuOptions.push(menu);
}); });
}, },
@ -514,7 +313,7 @@ export default {
keepAlive: true, keepAlive: true,
alwaysShow: true, alwaysShow: true,
}; };
this.resetForm('form'); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -522,7 +321,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */
@ -543,51 +342,49 @@ export default {
this.form.parentId = 0; this.form.parentId = 0;
} }
this.open = true; this.open = true;
this.title = '添加菜单'; this.title = "添加菜单";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
getMenu(row.id).then((response) => { getMenu(row.id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = '修改菜单'; this.title = "修改菜单";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate((valid) => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
// path // path
if ( if (this.form.type === SystemMenuTypeEnum.DIR
this.form.type === SystemMenuTypeEnum.DIR || || this.form.type === SystemMenuTypeEnum.MENU) {
this.form.type === SystemMenuTypeEnum.MENU
) {
// //
const path = this.form.path; const path = this.form.path
if (!isExternal(path)) { if (!isExternal(path)) {
// path / // path /
if (this.form.parentId === 0 && path.charAt(0) !== '/') { if (this.form.parentId === 0 && path.charAt(0) !== '/') {
this.$modal.msgSuccess('前端必须以 / 开头'); this.$modal.msgSuccess('前端必须以 / 开头')
return; return
} else if (this.form.parentId !== 0 && path.charAt(0) === '/') { } else if (this.form.parentId !== 0 && path.charAt(0) === '/') {
this.$modal.msgSuccess('前端不能以 / 开头'); this.$modal.msgSuccess('前端不能以 / 开头')
return; return
} }
} }
} }
// //
if (this.form.id !== undefined) { if (this.form.id !== undefined) {
updateMenu(this.form).then((response) => { updateMenu(this.form).then(response => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addMenu(this.form).then((response) => { addMenu(this.form).then(response => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
@ -597,17 +394,13 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项?').then(function() {
.confirm('是否确认删除名称为"' + row.name + '"的数据项?')
.then(function () {
return delMenu(row.id); return delMenu(row.id);
}) }).then(() => {
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess('删除成功'); this.$modal.msgSuccess("删除成功");
}) }).catch(() => {});
.catch(() => {}); }
}, }
},
}; };
</script> </script>