update zentao bugs

This commit is contained in:
lb 2023-11-22 17:04:22 +08:00
parent cd55b4c860
commit ab09a2b08c
4 changed files with 103 additions and 57 deletions

View File

@ -347,6 +347,8 @@ export default {
console.log('setting code: ', response.data); console.log('setting code: ', response.data);
// //
this.form[opt.prop] = response.data; this.form[opt.prop] = response.data;
// dataFormcodebug
this.$emit('update', this.form)
} }
}); });
} }

View File

@ -61,7 +61,7 @@
rows: drawerBaseInfoRows, rows: drawerBaseInfoRows,
}, },
{ {
name: '属性列表', name: '采集参数',
key: 'attrs', key: 'attrs',
props: drawerListProps, props: drawerListProps,
url: '/base/equipment-plc-param/page', url: '/base/equipment-plc-param/page',
@ -75,18 +75,26 @@
pageSize: 10, pageSize: 10,
}, },
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:collection-config-param:update') {
? { type: 'edit',
type: 'edit', btnName: '修改',
btnName: '修改', },
} {
: undefined, type: 'delete',
this.$auth.hasPermi('equipment:collection-config-param:delete') btnName: '删除',
? { },
type: 'delete', // this.$auth.hasPermi('equipment:collection-config-param:update')
btnName: '删除', // ? {
} // type: 'edit',
: undefined, // btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:collection-config-param:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v), ].filter((v) => v),
allowAdd: true, allowAdd: true,
}, },
@ -106,7 +114,6 @@ import {
getEquipmentPlcConnectPage, getEquipmentPlcConnectPage,
exportEquipmentPlcConnectExcel, exportEquipmentPlcConnectExcel,
} from '@/api/base/equipmentPlcConnect'; } from '@/api/base/equipmentPlcConnect';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
// import './http'; // import './http';
import BasicDrawer from './components/BasicDrawer.vue'; import BasicDrawer from './components/BasicDrawer.vue';
@ -182,13 +189,15 @@ export default {
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
selectOptions: [], selectOptions: [],
filterable: true
}, },
{ {
type: 'select', type: 'select',
label: '编码', label: '关联表编码',
placeholder: '请选择编码', placeholder: '请选择关联表编码',
param: 'plcId', param: 'plcId',
selectOptions: [], selectOptions: [],
filterable: true
}, },
{ {
type: 'button', type: 'button',
@ -224,7 +233,9 @@ export default {
prop: 'plcId', prop: 'plcId',
labelKey: `plcTableName`, labelKey: `plcTableName`,
url: '/base/equipment-plc/listAll', url: '/base/equipment-plc/listAll',
rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -236,7 +247,9 @@ export default {
label: '设备', label: '设备',
prop: 'equipmentId', prop: 'equipmentId',
url: '/base/core-equipment/page?pageNo=1&pageSize=99', url: '/base/core-equipment/page?pageNo=1&pageSize=99',
rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -262,7 +275,9 @@ export default {
input: true, input: true,
label: '设备名', label: '设备名',
prop: 'equipmentName', prop: 'equipmentName',
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备名不能为空', trigger: 'blur' },
],
// bind: { // bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode... // disabled: this.editMode == 'detail', // some condition, like detail mode...
// } // }
@ -296,7 +311,8 @@ export default {
label: '生产参数类型', label: '生产参数类型',
filter: (val) => filter: (val) =>
val != null val != null
? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val] // ? ['', '', '', '', '', ''][val]
? ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
: '-', : '-',
}, },
{ {

View File

@ -59,7 +59,6 @@ import {
getEquipmentPlcPage, getEquipmentPlcPage,
exportEquipmentPlcExcel, exportEquipmentPlcExcel,
} from '@/api/base/equipmentPlc'; } from '@/api/base/equipmentPlc';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
const switchBtn = { const switchBtn = {
@ -352,7 +351,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?') .confirm('是否确认删除该配置?')
.then(function () { .then(function () {
return deleteEquipmentPlc(id); return deleteEquipmentPlc(id);
}) })

View File

@ -194,13 +194,17 @@ export default {
input: true, input: true,
label: '参数列名', label: '参数列名',
prop: 'plcParamName', prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '参数名称', label: '参数名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -230,19 +234,35 @@ export default {
{ label: '工艺参数', value: 2 }, { label: '工艺参数', value: 2 },
{ label: '报警参数', value: 3 }, { label: '报警参数', value: 3 },
], ],
rules: [{ required: true, message: '设备参数类型不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '设备参数类型不能为空',
trigger: 'blur',
},
],
}, },
{ {
select: true, select: true,
label: '生产参数类型', label: '生产参数类型',
prop: 'production_param_type', prop: 'production_param_type',
options: [ options: [
{ label: '进片数量', value: 1 }, // { label: '', value: 1 },
{ label: '出片数量', value: 2 }, // { label: '', value: 2 },
{ label: '破损数量', value: 3 }, // { label: '', value: 3 },
// { label: '', value: 4 },
{ label: '进口计数', value: 1 },
{ label: '出口计数', value: 2 },
{ label: '损耗计数', value: 3 },
{ label: '无类型', value: 4 }, { label: '无类型', value: 4 },
], ],
rules: [{ required: true, message: '生产参数类型不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '生产参数类型不能为空',
trigger: 'blur',
},
],
}, },
], ],
[ [
@ -305,6 +325,7 @@ export default {
infoQuery: null, // infoQuery: null, //
attrFormSubmitting: false, attrFormSubmitting: false,
attrListLoading: false, attrListLoading: false,
shouldRefreshPageView: false,
}; };
}, },
computed: { computed: {
@ -323,10 +344,12 @@ export default {
}); });
}, },
tableBtn() { tableBtn() {
return this.mode == 'detail' ? [] : this.sections[1].tableBtn; return this.sections[1].tableBtn;
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
}, },
}, },
mounted() { mounted() {
this.shouldRefreshPageView = false;
this.mode = this.defaultMode || 'detail'; this.mode = this.defaultMode || 'detail';
for (const section of this.sections) { for (const section of this.sections) {
// //
@ -403,6 +426,9 @@ export default {
}, },
handleCancel() { handleCancel() {
if (this.shouldRefreshPageView) {
this.$emit('refreshDataList');
}
this.visible = false; this.visible = false;
}, },
@ -426,7 +452,7 @@ export default {
remark: '', remark: '',
alarmContent: '', alarmContent: '',
}; };
this.attrTitle = '添加设备绑定信息'; this.attrTitle = '添加参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
}, },
@ -439,14 +465,14 @@ export default {
}); });
if (res.code == 0) { if (res.code == 0) {
this.attrForm = res.data; this.attrForm = res.data;
this.attrTitle = '编辑设备绑定信息'; this.attrTitle = '编辑参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
} }
}, },
// //
handleDeleteAttr(attrId) { handleDeleteAttr(attrId) {
this.$confirm('确定删除该分组报警?', '提示', { this.$confirm('确定删除该参数?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -458,6 +484,7 @@ export default {
params: { id: attrId }, params: { id: attrId },
}); });
if (res.code == 0) { if (res.code == 0) {
this.shouldRefreshPageView = true;
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
type: 'success', type: 'success',
@ -472,35 +499,37 @@ export default {
}, },
// //
async submitAttrForm() { submitAttrForm() {
this.$refs['attrForm'].validate((valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
});
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
method: isEdit ? 'put' : 'post',
data: {
...this.attrForm,
connectId: this.infoData.id,
},
});
if (res.code == 0) { const isEdit = this.attrForm.id != null;
this.closeAttrForm(); this.attrFormSubmitting = true;
this.$message({ const res = await this.$axios({
message: `${isEdit ? '更新' : '创建'}成功`, url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
type: 'success', method: isEdit ? 'put' : 'post',
duration: 1500, data: {
onClose: () => { ...this.attrForm,
this.getAttrList(); connectId: this.infoData.id,
}, },
}); });
}
this.attrFormSubmitting = false; if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
this.shouldRefreshPageView = true;
},
});
}
this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {
@ -509,7 +538,7 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
this.$confirm(`确定删除该报警?`, '提示', { this.$confirm(`确定删除该参数?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',