diff --git a/src/views/hardware/productList/index.vue b/src/views/hardware/productList/index.vue index 55f0208..16c0108 100644 --- a/src/views/hardware/productList/index.vue +++ b/src/views/hardware/productList/index.vue @@ -3,57 +3,23 @@ todo 地区 - + - + - 搜索 - 重置 + 搜索 + 重置 - 增加 + 增加 - 批量删除 + 批量删除 - + - + @@ -86,47 +45,21 @@ - + - + @@ -154,22 +87,17 @@ - + + + + - - - @@ -190,7 +118,7 @@ import { list, get, add, update, del } from "@/api/hardware/product"; import { addNode } from "@/api/hardware/node"; export default { name: "ProductList", - data() { + data () { return { // 选中数组 ids: [], @@ -223,10 +151,12 @@ export default { value: "", // 表格数据 tableData: null, + productId: undefined, // 查询参数 queryParams: { pageNum: 1, pageSize: 10, + // productId:productId }, rules: { productId: [ @@ -247,23 +177,23 @@ export default { }, }; }, - created() { + created () { this.getList(); }, methods: { /** 搜索按钮操作 */ - handleQuery() { + handleQuery () { this.queryParams.pageNum = 1; this.getList(); }, /** 重置按钮操作 */ - resetQuery() { + resetQuery () { this.dateRange = []; this.resetForm("queryForm"); this.handleQuery(); }, // 获取产品数据列表 - getList() { + getList () { list(this.queryParams).then((response) => { this.tableData = response.rows; this.total = response.total; @@ -271,14 +201,14 @@ export default { }, // 取消按钮 - cancel() { + cancel () { this.open = false; this.open1 = false; // this.reset(); }, // 表单重置 - reset() { + reset () { this.form = { productId: "", productType: "", @@ -289,26 +219,27 @@ export default { }, // 多选框选中数据 - handleSelectionChange(selection) { + handleSelectionChange (selection) { this.ids = selection.map((item) => item.id); this.single = selection.length != 1; this.multiple = !selection.length; }, /** 新增按钮操作 */ - handleAdd() { + handleAdd () { this.reset(); this.open = true; this.title = "添加产品"; }, - handleAddnode() { + handleAddnode (row) { this.reset(); this.open1 = true; this.title = "添加产品节点"; + this.form.productId = row.productId; }, /** 修改按钮操作 */ - handleUpdate(row) { + handleUpdate (row) { this.reset(); this.form = row; this.open = true; @@ -357,7 +288,7 @@ export default { }, /** 删除按钮操作 */ - handleDelete(row) { + handleDelete (row) { const ids = row.id || this.ids; this.$confirm("是否确认删除?", "警告", { confirmButtonText: "确定", @@ -367,7 +298,7 @@ export default { .then(() => { return del(ids); }) - .catch(() => {}) + .catch(() => { }) .then((res) => { if (200 == res.code) { this.getList(); @@ -376,35 +307,35 @@ export default { this.msgSuccess(res.msg); } }) - .catch((res) => {}); + .catch((res) => { }); }, // 页码尺寸改变 - handleSizeChange(val) { + handleSizeChange (val) { this.queryForm.pagesize = val; this.getList(); }, // 页码改变 - handleCurrentChange(val) { + handleCurrentChange (val) { this.queryForm.page = val; this.getList(); }, // handleSelectionChange(val) { // this.multipleSelection = val; // }, - handleSizeChange(val) { + handleSizeChange (val) { console.log(`每页 ${val} 条`); }, - handleCurrentChange(val) { + handleCurrentChange (val) { console.log(`当前页: ${val}`); }, // 对话框的关闭 - handleClose(done) { + handleClose (done) { this.$confirm("确认关闭?") .then((_) => { done(); }) - .catch((_) => {}); + .catch((_) => { }); }, }, };