Merge branch 'releaseFeature' into releaseProcess
| | |
| | | |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-select :disabled="!scope.row.status" v-model="scope.row[item.prop]" |
| | | @change="change($event, scope.row, scope.$index, item)" placeholder="" size="small" |
| | | v-if="item.type === 'option'"> |
| | | <el-select :disabled="!scope.row.status || (item.disabledFn && item.disabledFn(scope.row))" |
| | | v-model="scope.row[item.prop]" @change="change($event, scope.row, scope.$index, item)" |
| | | placeholder="" size="small" v-if="item.type === 'option'"> |
| | | <el-option v-for="item in item.options" :key="item.value || item" :label="(item?.label || item)" |
| | | :value="(item.value || item)" /> |
| | | </el-select> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import addOptions from './addOptions' |
| | | export default { |
| | | name: 'CollDialog', |
| | | emits: ['success', 'closed'], |
| | | mixins: [addOptions], |
| | | props: { |
| | | option: { |
| | | type: Object |
| | |
| | | const label = options.find(v => v.value === e).label |
| | | this.tabledata[index].dpLabel = label |
| | | this.tabledata[index].dpName = e |
| | | this.tabledata[index].paramChartType = 'distribute' |
| | | } else if (prop === 'dpCategory' && e === 'Other') { |
| | | this.tabledata[index].dpLabel = '' |
| | | this.tabledata[index].dpName = '' |
| | | } |
| | | // ç¹ä½å类为éå
¶ä»æ¶ è¿ç¨åæ°å±ç¤ºæ¹å¼ä¸ºåå¸å¾ |
| | | }, |
| | | changeType(val) { |
| | | if (this.tabledata.length > 0) { |
| | |
| | | }).then(() => { |
| | | try { |
| | | this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull) |
| | | this.addOptions() |
| | | this.addOptions(this.cols) |
| | | this.tabledata = [] |
| | | } catch (error) { |
| | | this.cols = [] |
| | |
| | | } else { |
| | | try { |
| | | this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull) |
| | | this.addOptions() |
| | | this.addOptions(this.cols) |
| | | |
| | | } catch (error) { |
| | | this.cols = [] |
| | |
| | | }) |
| | | |
| | | }, |
| | | addOptions() { |
| | | if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "è¿ç¨åæ°", |
| | | prop: "isProcessParam", |
| | | isRequired: true, |
| | | type: 'boolean', |
| | | } |
| | | ) |
| | | } |
| | | if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "æ¾ç¤ºåç§°", |
| | | prop: "dpLabel", |
| | | isRequired: true, |
| | | } |
| | | ) |
| | | } |
| | | if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "ç¹ä½åç±»", |
| | | prop: "dpCategory", |
| | | isRequired: true, |
| | | type: 'option', |
| | | options: [{ |
| | | label: 'ç¨åºå', |
| | | value: 'ProgName' |
| | | }, { |
| | | label: 'ç¨åºå
容', |
| | | value: 'ProgContent' |
| | | }, { |
| | | label: 'åå
·å·', |
| | | value: 'ToolNo' |
| | | }, { |
| | | label: 'ç¶æ', |
| | | value: 'DeviceStatus' |
| | | }, { |
| | | label: '产é', |
| | | value: 'Output' |
| | | }, { |
| | | label: 'åè¦', |
| | | value: 'Alarm' |
| | | }, { |
| | | label: 'å
¶ä»', |
| | | value: 'Other' |
| | | }] |
| | | } |
| | | ) |
| | | } |
| | | }, |
| | | // addOptions() { |
| | | // if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "è¿ç¨åæ°", |
| | | // prop: "isProcessParam", |
| | | // isRequired: true, |
| | | // type: 'boolean', |
| | | // } |
| | | // ) |
| | | // } |
| | | // if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "æ¾ç¤ºåç§°", |
| | | // prop: "dpLabel", |
| | | // isRequired: true, |
| | | // } |
| | | // ) |
| | | // } |
| | | // if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "ç¹ä½åç±»", |
| | | // prop: "dpCategory", |
| | | // isRequired: true, |
| | | // type: 'option', |
| | | // options: [{ |
| | | // label: 'ç¨åºå', |
| | | // value: 'ProgName' |
| | | // }, { |
| | | // label: 'ç¨åºå
容', |
| | | // value: 'ProgContent' |
| | | // }, { |
| | | // label: 'åå
·å·', |
| | | // value: 'ToolNo' |
| | | // }, { |
| | | // label: 'ç¶æ', |
| | | // value: 'DeviceStatus' |
| | | // }, { |
| | | // label: '产é', |
| | | // value: 'Output' |
| | | // }, { |
| | | // label: 'åè¦', |
| | | // value: 'Alarm' |
| | | // }, { |
| | | // label: 'å
¶ä»', |
| | | // value: 'Other' |
| | | // }] |
| | | // } |
| | | // ) |
| | | // } |
| | | // }, |
| | | getList(params) { |
| | | this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => { |
| | | try { |
| | | this.cols = JSON.parse(res.data.dpHead) |
| | | this.addOptions() |
| | | this.addOptions(this.cols) |
| | | } catch (error) { |
| | | this.cols = [] |
| | | } |
| | |
| | | }) |
| | | }, |
| | | table_edit(row) { |
| | | console.log('bianji', row) |
| | | row.status = '1' |
| | | }, |
| | | del(index) { |
| | |
| | | <!-- |
| | | * @Date: 2024-10-05 09:51:45 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-16 23:41:34 |
| | | * @FilePath: /avue-data/Users/mache/Documents/demo/cps-web/src/views/console/workstation/CollTable.vue |
| | | * @LastEditTime: 2024-10-27 14:03:19 |
| | | * @FilePath: /cps-web/src/views/console/workstation/CollTable.vue |
| | | --> |
| | | <template> |
| | | <div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import addOptions from './addOptions' |
| | | export default { |
| | | mixins: [addOptions], |
| | | props: { |
| | | info: { |
| | | type: Object, |
| | |
| | | this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => { |
| | | try { |
| | | this.cols = JSON.parse(res.data.dpHead) |
| | | if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "è¿ç¨åæ°", |
| | | prop: "isProcessParam", |
| | | isRequired: true, |
| | | type: 'boolean', |
| | | } |
| | | ) |
| | | } |
| | | if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "æ¾ç¤ºåç§°", |
| | | prop: "dpLabel", |
| | | isRequired: true, |
| | | } |
| | | ) |
| | | } |
| | | if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) { |
| | | this.cols.unshift( |
| | | { |
| | | label: "ç¹ä½åç±»", |
| | | prop: "dpCategory", |
| | | isRequired: true, |
| | | type: 'option', |
| | | options: [{ |
| | | label: 'ç¨åºå', |
| | | value: 'ProgName' |
| | | }, { |
| | | label: 'ç¨åºå
容', |
| | | value: 'ProgContent' |
| | | }, { |
| | | label: 'åå
·å·', |
| | | value: 'ToolNo' |
| | | }, { |
| | | label: 'ç¶æ', |
| | | value: 'DeviceStatus' |
| | | }, { |
| | | label: '产é', |
| | | value: 'Output' |
| | | }, { |
| | | label: 'åè¦', |
| | | value: 'Alarm' |
| | | }, { |
| | | label: 'å
¶ä»', |
| | | value: 'Other' |
| | | }] |
| | | } |
| | | ) |
| | | } |
| | | this.addOptions(this.cols) |
| | | // if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "è¿ç¨åæ°", |
| | | // prop: "isProcessParam", |
| | | // isRequired: true, |
| | | // type: 'boolean', |
| | | // } |
| | | // ) |
| | | // } |
| | | // if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "æ¾ç¤ºåç§°", |
| | | // prop: "dpLabel", |
| | | // isRequired: true, |
| | | // } |
| | | // ) |
| | | // } |
| | | // if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) { |
| | | // this.cols.unshift( |
| | | // { |
| | | // label: "ç¹ä½åç±»", |
| | | // prop: "dpCategory", |
| | | // isRequired: true, |
| | | // type: 'option', |
| | | // options: [{ |
| | | // label: 'ç¨åºå', |
| | | // value: 'ProgName' |
| | | // }, { |
| | | // label: 'ç¨åºå
容', |
| | | // value: 'ProgContent' |
| | | // }, { |
| | | // label: 'åå
·å·', |
| | | // value: 'ToolNo' |
| | | // }, { |
| | | // label: 'ç¶æ', |
| | | // value: 'DeviceStatus' |
| | | // }, { |
| | | // label: '产é', |
| | | // value: 'Output' |
| | | // }, { |
| | | // label: 'åè¦', |
| | | // value: 'Alarm' |
| | | // }, { |
| | | // label: 'å
¶ä»', |
| | | // value: 'Other' |
| | | // }] |
| | | // } |
| | | // ) |
| | | // } |
| | | } catch (error) { |
| | | this.cols = [] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default { |
| | | methods: { |
| | | addOptions(cols) { |
| | | if (cols.filter(v => v.prop === 'paramChartType').length === 0) { |
| | | cols.unshift( |
| | | { |
| | | label: "è¿ç¨åæ°å±ç¤ºæ¹å¼", |
| | | prop: "paramChartType", |
| | | isRequired: true, |
| | | isRequiredFn: row => { |
| | | return row.isProcessParam |
| | | }, |
| | | type: 'option', |
| | | options: [{ |
| | | label: 'æ²çº¿å¾', |
| | | value: 'line' |
| | | }, { |
| | | label: 'åå¸å¾', |
| | | value: 'distribute' |
| | | }], |
| | | disabledFn: row => { |
| | | console.log(row, '>>>>>>>') |
| | | if (row.dpCategory !== "Other") { |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | | } |
| | | } |
| | | ) |
| | | } |
| | | if (cols.filter(v => v.prop === 'isProcessParam').length === 0) { |
| | | cols.unshift( |
| | | { |
| | | label: "è¿ç¨åæ°", |
| | | prop: "isProcessParam", |
| | | isRequired: true, |
| | | type: 'boolean', |
| | | } |
| | | ) |
| | | } |
| | | if (cols.filter(v => v.prop === 'dpLabel').length === 0) { |
| | | cols.unshift( |
| | | { |
| | | label: "æ¾ç¤ºåç§°", |
| | | prop: "dpLabel", |
| | | isRequired: true, |
| | | } |
| | | ) |
| | | } |
| | | if (cols.filter(v => v.prop === 'dpCategory').length === 0) { |
| | | cols.unshift( |
| | | { |
| | | label: "ç¹ä½åç±»", |
| | | prop: "dpCategory", |
| | | isRequired: true, |
| | | type: 'option', |
| | | options: [{ |
| | | label: 'ç¨åºå', |
| | | value: 'ProgName' |
| | | }, { |
| | | label: 'ç¨åºå
容', |
| | | value: 'ProgContent' |
| | | }, { |
| | | label: 'åå
·å·', |
| | | value: 'ToolNo' |
| | | }, { |
| | | label: 'ç¶æ', |
| | | value: 'DeviceStatus' |
| | | }, { |
| | | label: '产é', |
| | | value: 'Output' |
| | | }, { |
| | | label: 'åè¦', |
| | | value: 'Alarm' |
| | | }, { |
| | | label: 'å
¶ä»', |
| | | value: 'Other' |
| | | }] |
| | | } |
| | | ) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-22 22:30:19 |
| | | * @LastEditTime: 2024-10-27 14:55:20 |
| | | * @FilePath: /cps-web/src/views/mdc/processParam/index.vue |
| | | 宿¶çæ¿ |
| | | --> |
| | |
| | | </el-row> |
| | | <TimeLine v-model="timeRange" ref="timeLine"></TimeLine> |
| | | <el-collapse v-model="activeList"> |
| | | <el-collapse-item :title="item.description" :name="index" v-for="(item, index) in list" |
| | | <el-collapse-item :title="item.deLabel" :name="index" v-for="(item, index) in list" |
| | | :key="index"> |
| | | <div |
| | | v-if="(['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 1) || (!['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 0) && activeList.indexOf(index) > -1"> |
| | |
| | | }) |
| | | }, |
| | | viewData(item) { |
| | | let data = { |
| | | FeedOverride: 'è¿ç»åç', |
| | | FeedSpeed: 'è¿ç»é度', |
| | | SpindleOverride: '主轴åç', |
| | | SpindleSpeed: '主轴转é', |
| | | Output: '产é', |
| | | ProcessProgram: 'ç¨åºå', |
| | | DeviceStatus: '设å¤ç¶æ', |
| | | } |
| | | this.drawerName = data[item.name] |
| | | this.drawerName = item.dpLabel |
| | | |
| | | this.$HTTP.post('/api/blade-mdc/process-parameter/item?current=1&size=1500', { |
| | | endTime: this.timeRange.endTime, |
| | |
| | | workstationId: this.treeChecked.toString() |
| | | }) |
| | | this.list = [] |
| | | this.$HTTP.get('/api/blade-mdc/process-parameter/param', { workstationId: this.treeChecked.toString() }).then(res => { |
| | | this.$HTTP.get('/api/blade-mdc/process-parameter/params', { workstationId: this.treeChecked.toString() }).then(res => { |
| | | if (res.code === 200) { |
| | | console.log('jkjkjkjkj', this.list) |
| | | this.list = res.data.map(v => { |
| | | let name = v.isProcessParam ? 'ProcessProgram' : v.dpName |
| | | return { |
| | | ...v, |
| | | name: name, |
| | | height: ['ProcessProgram', 'DeviceStatus'].includes(v.name) ? '100px' : '200px' |
| | | } |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | queryChart1(item) { |
| | | let index = this.list.findIndex(item => item.name === 'DeviceStatus') |
| | | let index = this.list.findIndex(item => item.dpName === 'DeviceStatus') |
| | | this.list[index] = Object.assign({ |
| | | ...this.list[index], |
| | | dayCharts: {} |
| | |
| | | processParameter: item.processParameter |
| | | } |
| | | }).then(res => { |
| | | if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { |
| | | // if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { |
| | | if (item.paramChartType === 'distribute') { |
| | | this.setDeviceStatusOptions(res.data, item.name) |
| | | } else { |
| | | this.setLineOptions(res.data.data, item.name) |