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

View File

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

View File

@ -90,7 +90,7 @@
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button icon="Search" type="primary" @click="handleQuery" <el-button icon="Search" type="primary" @click="handleQuery"
>搜索 >搜索
</el-button> </el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
@ -104,7 +104,7 @@
plain plain
type="primary" type="primary"
@click="handleAdd" @click="handleAdd"
>新增 >新增
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -115,7 +115,7 @@
plain plain
type="success" type="success"
@click="handleUpdate" @click="handleUpdate"
>修改 >修改
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -126,7 +126,7 @@
plain plain
type="danger" type="danger"
@click="handleDelete" @click="handleDelete"
>删除 >删除
</el-button> </el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
@ -221,28 +221,28 @@
link link
type="success" type="success"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>发布 >发布
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['product:product:edit']" v-hasPermi="['product:product:edit']"
link link
type="primary" type="primary"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>详情 >详情
<!-- {{ scope.row.status === 2 ? "查看" : "" }}--> <!-- {{ scope.row.status === 2 ? "查看" : "" }}-->
</el-button> </el-button>
<el-button <el-button
link link
type="primary" type="primary"
@click="viewEditTab(scope.row, 'model')" @click="viewEditTab(scope.row, 'model')"
>物模型 >物模型
<!-- {{ scope.row.status === 2 ? "查看" : "" }}--> <!-- {{ scope.row.status === 2 ? "查看" : "" }}-->
</el-button> </el-button>
<el-button <el-button
link link
type="primary" type="primary"
@click="viewEditTab(scope.row, 'device')" @click="viewEditTab(scope.row, 'device')"
>设备列表 >设备列表
<!-- {{ scope.row.status === 2 ? "查看" : "" }}--> <!-- {{ scope.row.status === 2 ? "查看" : "" }}-->
</el-button> </el-button>
<el-button <el-button
@ -250,7 +250,7 @@
link link
type="danger" type="danger"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除 >删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -282,9 +282,9 @@
<el-form-item label="mqtt账号" prop="mqttAccount"> <el-form-item label="mqtt账号" prop="mqttAccount">
<el-input v-model="form.mqttAccount" placeholder="请输入mqtt账号" /> <el-input v-model="form.mqttAccount" placeholder="请输入mqtt账号" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="mqtt密码" prop="mqttPassword">--> <!-- <el-form-item label="mqtt密码" prop="mqttPassword">-->
<!-- <el-input v-model="form.mqttPassword" placeholder="请输入mqtt密码" />--> <!-- <el-input v-model="form.mqttPassword" placeholder="请输入mqtt密码" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="产品秘钥" prop="mqttSecret"> <el-form-item label="产品秘钥" prop="mqttSecret">
<el-input v-model="form.mqttSecret" placeholder="请输入产品秘钥" /> <el-input v-model="form.mqttSecret" placeholder="请输入产品秘钥" />
</el-form-item> </el-form-item>
@ -320,7 +320,7 @@ import {
addProduct, addProduct,
delProduct, delProduct,
listProduct, listProduct,
updateProduct, updateProduct
} from "@/api/product/product"; } from "@/api/product/product";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { deviceTypeDict, productStatusMap } from "@/constant/dict"; import { deviceTypeDict, productStatusMap } from "@/constant/dict";
@ -341,7 +341,6 @@ const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const tenantOptions = ref([]);
const categoryOptions = ref([]); // 产品分类树形选择 const categoryOptions = ref([]); // 产品分类树形选择
const data = reactive({ const data = reactive({
form: {}, form: {},
@ -359,17 +358,17 @@ const data = reactive({
thingsModelsJson: null, thingsModelsJson: null,
deviceType: null, deviceType: null,
vertificateMethod: null, vertificateMethod: null,
imgUrl: null, imgUrl: null
}, },
rules: { rules: {
productName: [ productName: [
{ required: true, message: "产品名称不能为空", trigger: "blur" }, { required: true, message: "产品名称不能为空", trigger: "blur" }
], ],
categoryId: [ 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); const { queryParams, form, rules } = toRefs(data);
@ -423,7 +422,7 @@ function reset() {
imgUrl: null, imgUrl: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
remark: null, remark: null
}; };
proxy.resetForm("productRef"); proxy.resetForm("productRef");
} }
@ -453,7 +452,7 @@ function handleAdd() {
// open.value = true; // open.value = true;
// title.value = "添加产品"; // title.value = "添加产品";
router.push({ router.push({
path: "/produc/product/edit", path: "/produc/product/edit"
}); });
} }
@ -463,8 +462,8 @@ function handleUpdate(row) {
router.push({ router.push({
path: "/produc/product/edit", path: "/produc/product/edit",
query: { query: {
productId: _productId, productId: _productId
}, }
}); });
// getProduct(_productId).then(response => { // getProduct(_productId).then(response => {
// form.value = response.data; // form.value = response.data;
@ -480,8 +479,8 @@ const viewEditTab = (row, tab) => {
query: { query: {
productId: _productId, productId: _productId,
// pageNum: queryParams.value.pageNum, // pageNum: queryParams.value.pageNum,
initTab: tab, initTab: tab
}, }
}); });
}; };
@ -510,15 +509,16 @@ function submitForm() {
function handleDelete(row) { function handleDelete(row) {
const _productIds = row.productId || ids.value; const _productIds = row.productId || ids.value;
proxy.$modal proxy.$modal
.confirm('是否确认删除产品编号为"' + _productIds + '"的数据项?') .confirm("是否确认删除产品编号为\"" + _productIds + "\"的数据项?")
.then(function () { .then(function() {
return delProduct(_productIds); return delProduct(_productIds);
}) })
.then(() => { .then(() => {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}) })
.catch(() => {}); .catch(() => {
});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -526,20 +526,11 @@ function handleExport() {
proxy.download( proxy.download(
"product/product/export", "product/product/export",
{ {
...queryParams.value, ...queryParams.value
}, },
`product_${new Date().getTime()}.xlsx` `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 getCategoryList = async () => {
const response = await listCategory(); const response = await listCategory();
categoryOptions.value = response.data; categoryOptions.value = response.data;
@ -547,7 +538,6 @@ const getCategoryList = async () => {
getList(); getList();
getCategoryList(); getCategoryList();
getTenantOptions();
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-item { .card-item {