diff --git a/src/views/iot/device/detail.vue b/src/views/iot/device/detail.vue index 131ce15..87e0ca5 100644 --- a/src/views/iot/device/detail.vue +++ b/src/views/iot/device/detail.vue @@ -120,13 +120,13 @@ @selected="handleMapSelected" /> - - - + + + + + + + --> - - - + + + + + + + --> 搜索 + >搜索 重置 @@ -104,7 +104,7 @@ plain type="primary" @click="handleAdd" - >新增 + >新增 @@ -115,7 +115,7 @@ plain type="success" @click="handleUpdate" - >修改 + >修改 @@ -126,7 +126,7 @@ plain type="danger" @click="handleDelete" - >删除 + >删除 @@ -221,28 +221,28 @@ link type="success" @click="handleDelete(scope.row)" - >发布 + >发布 详情 + >详情 物模型 + >物模型 设备列表 + >设备列表 删除 + >删除 @@ -282,9 +282,9 @@ - - - + + + @@ -320,7 +320,7 @@ import { addProduct, delProduct, listProduct, - updateProduct, + updateProduct } from "@/api/product/product"; import { useRouter } from "vue-router"; import { deviceTypeDict, productStatusMap } from "@/constant/dict"; @@ -341,7 +341,6 @@ const single = ref(true); const multiple = ref(true); const total = ref(0); const title = ref(""); -const tenantOptions = ref([]); const categoryOptions = ref([]); // 产品分类树形选择 const data = reactive({ form: {}, @@ -359,17 +358,17 @@ const data = reactive({ thingsModelsJson: null, deviceType: null, vertificateMethod: null, - imgUrl: null, + imgUrl: null }, rules: { productName: [ - { required: true, message: "产品名称不能为空", trigger: "blur" }, + { required: true, message: "产品名称不能为空", trigger: "blur" } ], categoryId: [ - { required: true, message: "产品分类ID不能为空", trigger: "blur" }, + { required: true, message: "产品分类ID不能为空", trigger: "blur" } ], - tenantId: [{ required: true, message: "租户ID不能为空", trigger: "blur" }], - }, + tenantId: [{ required: true, message: "租户ID不能为空", trigger: "blur" }] + } }); const { queryParams, form, rules } = toRefs(data); @@ -423,7 +422,7 @@ function reset() { imgUrl: null, createBy: null, createTime: null, - remark: null, + remark: null }; proxy.resetForm("productRef"); } @@ -453,7 +452,7 @@ function handleAdd() { // open.value = true; // title.value = "添加产品"; router.push({ - path: "/produc/product/edit", + path: "/produc/product/edit" }); } @@ -463,8 +462,8 @@ function handleUpdate(row) { router.push({ path: "/produc/product/edit", query: { - productId: _productId, - }, + productId: _productId + } }); // getProduct(_productId).then(response => { // form.value = response.data; @@ -480,8 +479,8 @@ const viewEditTab = (row, tab) => { query: { productId: _productId, // pageNum: queryParams.value.pageNum, - initTab: tab, - }, + initTab: tab + } }); }; @@ -510,15 +509,16 @@ function submitForm() { function handleDelete(row) { const _productIds = row.productId || ids.value; proxy.$modal - .confirm('是否确认删除产品编号为"' + _productIds + '"的数据项?') - .then(function () { + .confirm("是否确认删除产品编号为\"" + _productIds + "\"的数据项?") + .then(function() { return delProduct(_productIds); }) .then(() => { getList(); proxy.$modal.msgSuccess("删除成功"); }) - .catch(() => {}); + .catch(() => { + }); } /** 导出按钮操作 */ @@ -526,20 +526,11 @@ function handleExport() { proxy.download( "product/product/export", { - ...queryParams.value, + ...queryParams.value }, `product_${new Date().getTime()}.xlsx` ); } - -const getTenantOptions = async (keyword) => { - const response = await listTenant({ - pageNum: 1, - pageSize: 20, - tenantName: keyword, - }); - tenantOptions.value = response.rows; -}; const getCategoryList = async () => { const response = await listCategory(); categoryOptions.value = response.data; @@ -547,7 +538,6 @@ const getCategoryList = async () => { getList(); getCategoryList(); -getTenantOptions();