update 改为抽屉展示

This commit is contained in:
lb
2023-10-10 14:22:00 +08:00
parent 723d83cc02
commit b2ee61b8cb
11 changed files with 852 additions and 59 deletions

View File

@@ -70,13 +70,11 @@
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">
取消
</el-button>
<el-button style="" @click="handleCancel">取消</el-button>
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</el-button>
<el-button v-else type="primary" @click="handleSave">保存</el-button>
<el-button v-else type="primary" @click="handleCancel">确定</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
@@ -227,7 +225,8 @@ export default {
...col,
bind: {
// 详情 模式下,禁用各种输入
disabled: this.mode == 'detail',
// disabled: this.mode == 'detail',
disabled: true
},
};
});
@@ -254,7 +253,6 @@ export default {
this.form = data;
this.showForm = true;
this.infoQuery = query;
console.log('setting form: ', this.form, data);
} else if (section.key == 'attrs') {
this.attrQuery = query;
this.list = data.list;
@@ -385,7 +383,6 @@ export default {
return;
}
});
console.log('this.attrform', this.attrForm);
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({

View File

@@ -50,7 +50,7 @@
:disabled="disabled"
v-model="dataForm.type"
placeholder="请选择报警类型"
@change="$emit('update', dataForm)">
@change="handleTypeChange">
<el-option
v-for="opt in [
{ label: '布尔型', value: 2 },
@@ -166,9 +166,9 @@ export default {
resetFields(args) {
return this.$refs.form.resetFields(args);
},
async handleProductlineChange(id) {
await this.getWorksectionList(id);
this.dataForm.workshopSectionId = null;
async handleTypeChange(id) {
// debugger;
this.dataForm.alarmCode = '';
this.$emit('update', this.dataForm);
},
async getCode(url) {

View File

@@ -46,7 +46,7 @@
v-if="editVisible"
ref="drawer"
:default-mode="editMode"
:data-id="form.id"
:data-id="alarmForm.id"
:sections="[
{
name: '基本信息',
@@ -55,7 +55,7 @@
url: '/base/equipment-group/get',
urlUpdate: '/base/equipment-group/update',
urlCreate: '/base/equipment-group/create',
queryParams: { id: form.id },
queryParams: { id: alarmForm.id },
},
{
name: '属性列表',
@@ -67,7 +67,7 @@
urlDelete: '/base/equipment-group-alarm/delete',
urlDetail: '/base/equipment-group-alarm/get',
queryParams: {
id: form.id,
equipmentGroupId: alarmForm.id,
pageNo: 1,
pageSize: 10,
},
@@ -222,6 +222,11 @@ export default {
{ width: 128, prop: 'plcParamName', label: '参数列名' },
{ width: 128, prop: 'alarmContent', label: '报警内容' },
],
alarmForm: {
id: undefined,
equipmentGroupCode: undefined,
equipmentGroupName: undefined,
},
searchBarFormConfig: [
{
type: 'input',
@@ -405,12 +410,15 @@ export default {
});
});
},
// 查看报警
handleDetail(row) {
// debugger;
const { id, code, name, createTime } = row;
// 打开抽屉
this.editMode = 'detail';
this.form.id = id;
this.alarmForm.id = id;
this.alarmForm.equipmentGroupCode = code;
this.alarmForm.equipmentGroupName = name;
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();