remove device shadow

This commit is contained in:
2023-06-29 16:31:52 +08:00
parent ac6ec65bcc
commit 3d5d0a8e60
3 changed files with 46 additions and 56 deletions

View File

@ -120,13 +120,13 @@
@selected="handleMapSelected"
/>
</el-form-item>
<el-form-item label="设备影子" prop="isShadow">
<el-switch
v-model="form.isShadow"
:active-value="1"
:inactive-value="0"
/>
</el-form-item>
<!-- <el-form-item label="设备影子" prop="isShadow">-->
<!-- <el-switch-->
<!-- v-model="form.isShadow"-->
<!-- :active-value="1"-->
<!-- :inactive-value="0"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="启用状态" prop="status">
<el-switch
v-model="form.status"
@ -214,7 +214,7 @@ function reset() {
firmwareVersion: null,
status: null,
rssi: null,
isShadow: null,
// isShadow: null,
locationWay: null,
thingsModelValue: null,
networkAddress: null,

View File

@ -441,13 +441,13 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-form-item label="设备影子" prop="isShadow">
<el-switch
v-model="form.isShadow"
:active-value="1"
:inactive-value="0"
/>
</el-form-item>
<!-- <el-form-item label="设备影子" prop="isShadow">-->
<!-- <el-switch-->
<!-- v-model="form.isShadow"-->
<!-- :active-value="1"-->
<!-- :inactive-value="0"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="启用状态" prop="status">
<el-switch
v-model="form.status"
@ -530,7 +530,7 @@ const data = reactive({
firmwareVersion: null,
status: null,
rssi: null,
isShadow: null,
// isShadow: null,
locationWay: null,
thingsModelValue: null,
networkAddress: null,
@ -588,7 +588,7 @@ function reset() {
firmwareVersion: null,
status: null,
rssi: null,
isShadow: null,
// isShadow: null,
locationWay: null,
thingsModelValue: null,
networkAddress: null,

View File

@ -282,9 +282,9 @@
<el-form-item label="mqtt账号" prop="mqttAccount">
<el-input v-model="form.mqttAccount" placeholder="请输入mqtt账号" />
</el-form-item>
<!-- <el-form-item label="mqtt密码" prop="mqttPassword">-->
<!-- <el-input v-model="form.mqttPassword" placeholder="请输入mqtt密码" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="mqtt密码" prop="mqttPassword">-->
<!-- <el-input v-model="form.mqttPassword" placeholder="请输入mqtt密码" />-->
<!-- </el-form-item>-->
<el-form-item label="产品秘钥" prop="mqttSecret">
<el-input v-model="form.mqttSecret" placeholder="请输入产品秘钥" />
</el-form-item>
@ -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();
</script>
<style lang="scss" scoped>
.card-item {