'固件列表修改'

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