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/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 @@ + @@ -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: 设备生产实时数据 -->