diff --git a/public/favicon.ico b/public/favicon.ico index 37a3d39..774214b 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon2.ico b/public/favicon2.ico new file mode 100644 index 0000000..37a3d39 Binary files /dev/null and b/public/favicon2.ico differ diff --git a/public/google.exe b/public/google.exe new file mode 100644 index 0000000..5809801 Binary files /dev/null and b/public/google.exe differ diff --git a/public/i18n.js b/public/i18n.js index 592ea4f..d51f751 100644 --- a/public/i18n.js +++ b/public/i18n.js @@ -1,12 +1,28 @@ +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2022-11-25 09:51:46 + * @LastEditors: fzq + * @LastEditTime: 2023-01-30 14:26:02 + */ /** * Created by Jacky.Gao on 2017-10-01. */ import defaultI18nJsonData from './designer.json'; import en18nJsonData from './designer_en.json'; - export default function buildLocal () { - let language = getCookie('language') || 'zh-CN'; +// export default function buildLocal () { +// let language = getCookie('language') || 'zh-CN'; +// window.i18n = defaultI18nJsonData; +// if (language !== 'zh-CN') { +// window.i18n = en18nJsonData; +// } +// } + +export default function buildLocal () { + let language = getCookie('language') || 'en'; window.i18n = defaultI18nJsonData; - if (language !== 'zh-CN') { + if (language !== 'en') { window.i18n = en18nJsonData; } } diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue index d061f46..605d855 100644 --- a/src/components/base-dialog/addOrUpdate/index.vue +++ b/src/components/base-dialog/addOrUpdate/index.vue @@ -32,7 +32,8 @@ :placeholder="getPlaceholder(n, c)" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" clearable - :disabled="isDetail" + :disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled" + @change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)"> @@ -49,6 +50,7 @@ v-if="getType(n, c) === 'date'" v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props" :placeholder="getPlaceholder(n, c)" + value-format='yyyy-MM-ddTHH:mm:ss' v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" /> @@ -97,6 +99,7 @@ color: btnColor[operate.name] }" @click="handleClick(operate)" + :disabled='isDisabled' >{{ btnName[operate.name] }} @@ -120,7 +123,7 @@ const title = { // 或者也可以改造成自定义颜色: const btnType = { - add :'#0b58ff', + add: '#0b58ff', save: '#000', update: '#0b58ff', reset: '' @@ -179,6 +182,8 @@ export default { // }, data() { return { + // 按钮防重复点击 + isDisabled: false, COLUMN_PER_ROW, title, /** 按钮相关属性 */ @@ -456,6 +461,7 @@ export default { }, emitSelectChange(name, id) { + // console.log(id) const currentField = this.configs.fields.find((item) => item.name === name) if (currentField.relatedField) { this.dataForm[currentField.relatedField] = null @@ -476,7 +482,16 @@ export default { /** 操作 */ switch (btn.name) { case 'save': + this.isDisabled = true + setTimeout(() => { + this.isDisabled = false + }, 3000) case 'update': + this.isDisabled = true + setTimeout(() => { + this.isDisabled = false + }, 3000) + /** 需要验证表单的操作 */ this.$refs['dataForm'].validate((valid) => { if (valid) { diff --git a/src/components/base-table/components/table-head.vue b/src/components/base-table/components/table-head.vue index 042d1c4..c51360d 100644 --- a/src/components/base-table/components/table-head.vue +++ b/src/components/base-table/components/table-head.vue @@ -1,8 +1,18 @@ + @@ -131,6 +131,7 @@ export default { this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend')) await this.getList() this.setLegend() + // console.log('this.dataType',this.dataType); }, init(data) { @@ -181,14 +182,14 @@ export default { getList() { const params = this.makeQuerys() // 发起请求 - return this.getOEE(params).then(datalist => { + return this.getOEE(params).then((datalist) => { console.log('getOEE res:', datalist) this.timeList.splice(0) this.rateList.splice(0) this.xAxis.splice(0) if (datalist.length) { // 分流 - datalist.map(item => { + datalist.map((item) => { const time = moment(item.time) if (this.searchType === i18n.t('eq.monthgap')) { this.xAxis.push(`${time.year()}${i18n.t('eq.year')}${time.month() + 1}${i18n.t('eq.month')}`) @@ -241,7 +242,7 @@ export default { const workTimeList = [] const stopTimeList = [] const downTimeList = [] - this.timeList.map(item => { + this.timeList.map((item) => { workTimeList.push(item.workTime) stopTimeList.push(item.stopTime) downTimeList.push(item.downTime) @@ -260,7 +261,7 @@ export default { const timeEfficiencyList = [] const oeeList = [] const teepList = [] - this.rateList.map(item => { + this.rateList.map((item) => { workRateList.push(item.workRate) stopRateList.push(item.stopRate) downRateList.push(item.downRate) @@ -283,6 +284,18 @@ export default { // 重新绘制图形 renderGraph() { + if (this.dataType === i18n.t('eq.time')) { + this.config.yAxis = { + type: 'value', + name: i18n.t('yAxisTime') + } + } else { + this.config.yAxis = { + type: 'value', + name: i18n.t('yAxisRate') + } + } + console.log('this.dataType', this.dataType) console.log('latest config: ', JSON.stringify(this.config)) this.$nextTick(() => { // this.chart.setOption(this.config) diff --git a/src/views/modules/monitoring/equipmentGroup.vue b/src/views/modules/monitoring/equipmentGroup.vue index 16f92a3..8d8e496 100644 --- a/src/views/modules/monitoring/equipmentGroup.vue +++ b/src/views/modules/monitoring/equipmentGroup.vue @@ -70,7 +70,7 @@ const tableConfigs = [ const addOrUpdateConfigs = { type: 'dialog', infoUrl: '/monitoring/equipmentGroup', - fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode') }, 'remark'], + fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode'),api: '/monitoring/equipmentGroupAlarm/getCode' }, 'remark'], operations: [ { name: 'cancel', showAlways: true }, { name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false }, diff --git a/src/views/modules/monitoring/equipmentHistoricalParameters.vue b/src/views/modules/monitoring/equipmentHistoricalParameters.vue index 5ed69fe..dce0dab 100644 --- a/src/views/modules/monitoring/equipmentHistoricalParameters.vue +++ b/src/views/modules/monitoring/equipmentHistoricalParameters.vue @@ -1,16 +1,27 @@ @@ -21,11 +32,14 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate' import i18n from '@/i18n' import BaseTable from '@/components/base-table' import { pick } from 'lodash/object' +import equipmentVue from './equipment.vue' export default { data() { return { calcMaxHeight, + equipmentName: null, + equipmentCode: null, tableConfigs: [], dataList: [], dataListLoading: false, @@ -42,12 +56,15 @@ export default { mouted() { this.getDataList() }, + created(){ + // console.log('params',this.$route.params) + }, methods: { // destroy dialog handleDestroyDialog() { setTimeout(() => { - this.addOrUpdateVisible= false - }, /** after dialog animated */ 200); + this.addOrUpdateVisible = false + }, /** after dialog animated */ 200) }, // 获取数据列表 getDataList() { @@ -56,6 +73,7 @@ export default { url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`), method: 'get' }).then(({ data: res }) => { + console.log('res',res) if ( res && res.code === 0 && @@ -66,6 +84,9 @@ export default { res.data[0].data && res.data[0].data.length > 0 ) { + this.equipmentName = res.data[0].data[0].equName + this.equipmentCode = res.data[0].data[0].equCode + console.log(this.equipmentName) this.setTableProps(res.data[0].nameData) this.setTableData(res.data[0].data) } else { @@ -82,19 +103,19 @@ export default { }, { prop: 'time', name: this.$t('ti'), filter: timeFilter }, { prop: 'plcCode', name: this.$t('plcCode') }, - { prop: 'equName', name: this.$t('equName') }, - { prop: 'equCode', name: this.$t('equCode') }, + // { prop: 'equName', name: this.$t('equName') }, + // { prop: 'equCode', name: this.$t('equCode') }, // ...['数值1', '数值2', '数值3'].map(name => { // return { prop: name, name } // }) - ...Array.from(new Set(nameData.map(item => item.name))).map(name => ({ prop: name, name })) + ...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name })) ] }, setTableData(data) { - this.dataList = data.map(item => { + this.dataList = data.map((item) => { const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode']) if (item.data && item.data.length > 0) { - item.data.forEach(param => { + item.data.forEach((param) => { rowItem[param.dynamicName] = param.dynamicValue }) } diff --git a/src/views/modules/monitoring/equipmentTimesequence.vue b/src/views/modules/monitoring/equipmentTimesequence.vue index f258597..ed44d5b 100644 --- a/src/views/modules/monitoring/equipmentTimesequence.vue +++ b/src/views/modules/monitoring/equipmentTimesequence.vue @@ -35,7 +35,7 @@ - {{ $t('pl.add') }} + {{ $t('pl.add2') }} @@ -489,8 +489,8 @@ export default { const condition = { startTime, endTime, - productlines: [this.dataForm.productlines], - wsId: this.dataForm.wsId, + // productlines: [this.dataForm.productlines], + // wsId: this.dataForm.wsId, eqId: this.eqId } diff --git a/src/views/modules/monitoring/equipmentType.vue b/src/views/modules/monitoring/equipmentType.vue index a18220b..88569b9 100644 --- a/src/views/modules/monitoring/equipmentType.vue +++ b/src/views/modules/monitoring/equipmentType.vue @@ -72,7 +72,7 @@ const addOrUpdateConfigs = { fields: [ { name: 'name', required: true, label: i18n.t('eq.type') }, { name: 'code', required: true, label: i18n.t('eq.typecode'), api: '/monitoring/equipmentType/getCode' }, - { name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] }, + // { name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] }, 'remark' ], operations: [ @@ -133,16 +133,16 @@ export default { }, // 获取设备类型树形数据 getTreeEquipmentType() { - this.$http({ - url: this.$http.adornUrl('/monitoring/equipmentType/getTree'), - method: 'post' - }).then(({ data: res }) => { - if (res && res.code === 0 && res.data.length) { - this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data - } else { - this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0) - } - }) + // this.$http({ + // url: this.$http.adornUrl('/monitoring/equipmentType/getTree'), + // method: 'post' + // }).then(({ data: res }) => { + // if (res && res.code === 0 && res.data.length) { + // this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data + // } else { + // this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0) + // } + // }) }, // 获取数据列表 getDataList() { diff --git a/src/views/modules/monitoring/product.vue b/src/views/modules/monitoring/product.vue index 4f47198..2e27476 100644 --- a/src/views/modules/monitoring/product.vue +++ b/src/views/modules/monitoring/product.vue @@ -143,7 +143,9 @@ const addOrUpdateConfigs = { relatedField: 'productId', tableConfigs: [ { type: 'index', width: 100, name: i18n.t('index') }, - { prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') }, + // 12小时制的时间 + // { prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') }, + { prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter }, { prop: 'name', name: i18n.t('attrName'), formField: true, rules: [{ required: true, message: i18n.t('required'), trigger: 'blur' }] }, { prop: 'code', name: i18n.t('attrValue'), formField: true }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } diff --git a/src/views/modules/monitoring/qualityInspectionBoxBtn.vue b/src/views/modules/monitoring/qualityInspectionBoxBtn.vue index 0f9b60b..8af5a87 100644 --- a/src/views/modules/monitoring/qualityInspectionBoxBtn.vue +++ b/src/views/modules/monitoring/qualityInspectionBoxBtn.vue @@ -38,7 +38,7 @@ v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" - @refreshDataList="getDataList" + @refreshDataList="addSuccess" @select-change="handleDialogSelectChange" @destory-dialog="handleDestroyDialog" /> @@ -92,7 +92,7 @@ const addOrUpdateConfigs = { fields: [ // { name: 'productionId', label: i18n.t('eq.name'), required: true }, { name: 'productionId', label: i18n.t('pl.title'), required: true, type: 'select', options: [], relatedField: 'sectionId' }, - { name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [] }, + { name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [], isDisabled: true }, { name: 'model', label: i18n.t('andeng.btnBoxModel') }, { // name: 'keyValue', @@ -215,6 +215,7 @@ export default { methods: { // destroy dialog handleDestroyDialog() { + this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true) setTimeout(() => { this.addOrUpdateVisible = false }, /** after dialog animated */ 200) @@ -332,8 +333,7 @@ export default { this.addOrUpdateConfigs.fields.forEach((item) => { // console.log('item',item) // console.log('res',res) - if (item.name === 'inspectionDetContent') - item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code })) + if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code })) // console.log('item',item) }) } else { @@ -359,10 +359,19 @@ export default { this.dataListSelections = val }, // 对话框里的某个选择改变了 - handleDialogSelectChange({ name, id }) { + async handleDialogSelectChange({ name, id }) { switch (name) { case 'productionId': - this.getWsList(id) + // this.getWsList(id) + if (name === 'productionId') { + // 如果选择了产线,就依据此更新工单的选项 + if (id) { + this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', false) + } else { + this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true) + } + await this.getWsList(id) + } case 'inspectionDetContent': // this.dataForm.inspectionDetId = id // console.log(id) @@ -377,6 +386,11 @@ export default { console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields) } }, + addSuccess() { + this.getDataList() + this.$set(this.addOrUpdateConfigs.fields[1], 'options', []) + this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true) + }, handleOperations({ type, data: id }) { switch (type) { case 'view-detail': diff --git a/src/views/modules/monitoring/qualityInspectionRecord.vue b/src/views/modules/monitoring/qualityInspectionRecord.vue index 789094b..bfbf83a 100644 --- a/src/views/modules/monitoring/qualityInspectionRecord.vue +++ b/src/views/modules/monitoring/qualityInspectionRecord.vue @@ -3,7 +3,7 @@ {{ $t('pl.title') }} - + @@ -11,7 +11,7 @@ {{ $t('inspect.det') }} - + @@ -22,7 +22,7 @@ + @clickTopBtn="clickTopBtn" /> + layout="total, sizes, prev, pager, next, jumper"> @@ -49,10 +47,9 @@ v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" - @refreshDataList="getDataList" + @refreshDataList="addSuccess" @destory-dialog="handleDestroyDialog" - @select-change="handleSelectChange" - /> + @select-change="handleSelectChange" /> @@ -87,7 +84,7 @@ const tableConfigs = [ // { prop: 'productionId', name: i18n.t('pl.id') }, // { prop: 'sectionId', name: i18n.t('ws.id') }, { prop: 'checkPerson', name: i18n.t('inspect.people') }, - { prop: 'source', name: i18n.t('source'), filter: val => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) }, + { prop: 'source', name: i18n.t('source'), filter: (val) => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) }, { prop: 'explainText', name: i18n.t('desc') }, { prop: 'remark', name: i18n.t('remark') }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } @@ -98,8 +95,23 @@ const addOrUpdateConfigs = { infoUrl: '/monitoring/qualityInspectionRecord', fields: [ { name: 'checkTime', required: true, label: i18n.t('inspect.time'), type: 'date', props: { style: 'width: 100%', type: 'datetime' }, placeholder: i18n.t('hints.checktime') }, + // { + // name: 'checkTime', + // required: true, + // label: i18n.t('inspect.time'), + // type: 'date', + // props: { + // 'type': 'date', // element-ui 的配置 + // 'placeholder': i18n.t('hints.date'), + // 'value-format': 'yyyy-MM-ddTHH:mm:ss', + // 'style': { + // width: '100%' + // } + // }, + // placeholder: i18n.t('hints.checktime') + // }, { name: 'productionId', required: true, label: i18n.t('pl.title'), type: 'select', options: [] }, - { name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] }, + { name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] , isDisabled: true }, { name: 'source', label: i18n.t('source'), @@ -155,15 +167,29 @@ export default { methods: { // destroy dialog handleDestroyDialog() { + this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true) setTimeout(() => { this.addOrUpdateVisible = false }, /** after dialog animated */ 200) }, // handle async handleSelectChange({ name, id }) { + // console.log('this',this) if (name === 'productionId') { // 如果选择了产线,就依据此更新工单的选项 + if (id) { + this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', false) + } else { + this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true) + } await this.getWorkSections(id) + + } + if (name === 'sectionId') { + // 如果选择了产线,就依据此更新工单的选项 + // console.log('nihao',id); + // console.log('nihao2',this.addOrUpdateConfigs.fields[1].options == []); + // console.log('nihao2',this.addOrUpdateConfigs.fields[1].options ); } }, // 获取检测内容 @@ -178,9 +204,9 @@ export default { }) }).then(({ data: res }) => { console.log('insdet:', res) - const insDetOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'inspectionDetId') + const insDetOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'inspectionDetId') if (insDetOpt) { - insDetOpt.options = res.data.list.map(item => ({ value: item.id, label: item.content })) || [] + insDetOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.content })) || [] } }) }, @@ -190,11 +216,11 @@ export default { url: this.$http.adornUrl('/monitoring/productionLine/list'), method: 'get' }).then(({ data: res }) => { - const plOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'productionId') + const plOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId') if (plOpt) { - plOpt.options = res.data.map(item => ({ value: item.id, label: item.name })) || [] + plOpt.options = res.data.map((item) => ({ value: item.id, label: item.name })) || [] } - this.plList = res.data.map(item => ({ value: item.id, label: item.name })) || [] + this.plList = res.data.map((item) => ({ value: item.id, label: item.name })) || [] }) }, // 获取工段 @@ -215,15 +241,23 @@ export default { if (res.data.total === 0) { this.$message.error(i18n.t('errors.nosection')) } else { + // console.log('da',this.dataForm); this.$message.success(i18n.t('errors.numsection', { num: res.data.total })) } } - const wsOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'sectionId') + const wsOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'sectionId') + // const wsOpt2 = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId') + // console.log('wsOpt',wsOpt); if (wsOpt) { - wsOpt.options = res.data.list.map(item => ({ value: item.id, label: item.name })) || [] + wsOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.name })) || [] } }) }, + addSuccess() { + this.getDataList() + this.$set(this.addOrUpdateConfigs.fields[2], 'options', []) + this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true) + }, // 获取数据列表 getDataList() { this.addOrUpdateVisible = false @@ -245,6 +279,7 @@ export default { method: 'get', params: this.$http.adornParams(queryParams) }).then(({ data }) => { + // console.log('data', data) if (data && data.code === 0) { this.dataList = data.data.list this.totalPage = data.data.total @@ -295,7 +330,7 @@ export default { deleteHandle(id) { var ids = id ? [id] - : this.dataListSelections.map(item => { + : this.dataListSelections.map((item) => { return item.id }) this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), { diff --git a/src/views/modules/monitoring/realtimeEquipment.vue b/src/views/modules/monitoring/realtimeEquipment.vue index 848f6fe..3093122 100644 --- a/src/views/modules/monitoring/realtimeEquipment.vue +++ b/src/views/modules/monitoring/realtimeEquipment.vue @@ -2,7 +2,7 @@ * @Author: lb * @Date: 2022-06-22 14:00:17 * @LastEditors: fzq - * @LastEditTime: 2023-01-03 10:18:14 + * @LastEditTime: 2023-02-02 17:19:10 * @Description: 设备生产实时数据 -->