'固件列表修改'

This commit is contained in:
刘召雪
2020-11-10 16:51:34 +08:00
parent 119ac9b1e8
commit 440ecaf0ac

View File

@ -82,14 +82,18 @@ export default {
return {
// 选中数组
ids: [],
// 非单个禁用
// single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 查询参数
queryParams: {
pageNum: 1,
@ -97,6 +101,14 @@ export default {
},
// 表格数据
tableData: null,
rules: {
version: [
{ required: true, message: "固件版本号不能为空", trigger: "blur" },
],
fileName: [
{ required: true, message: "固件名称不能为空", trigger: "blur" },
]
},
};
},
created () {
@ -114,6 +126,18 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
// 取消按钮
cancel () {
this.open = false;
},
// 表单重置
reset () {
this.form = {
version: "",
fileName: ""
};
this.resetForm("form");
},
// 获取产品数据列表
getList () {
list(this.queryParams).then((response) => {
@ -123,9 +147,16 @@ export default {
},
/** 新增按钮操作 */
handleAdd () {
this.reset();
this.open = true;
this.title = "添加固件";
},
/** 修改按钮操作 */
handleUpdate (row) {
this.reset();
this.form = row;
this.open = true;
this.title = "修改固件";
},
/** 提交按钮 */
submitForm: function () {
@ -181,7 +212,6 @@ export default {
// 多选框选中数据
handleSelectionChange (selection) {
this.ids = selection.map((item) => item.id);
// this.single = selection.length != 1;
this.multiple = !selection.length;
},
},