feat: 参数树鼠标右击

master
李小林 7 months ago
parent 8dffb3fe8f
commit be5dd88986
  1. 10
      src/api/device-type/index.ts
  2. 8
      src/api/device-type/types.ts
  3. 3
      src/api/order/types.ts
  4. 1
      src/assets/icons/add.svg
  5. 1
      src/assets/icons/delete.svg
  6. 1
      src/assets/icons/reboot.svg
  7. 1
      src/assets/icons/reset.svg
  8. 1
      src/assets/icons/unfold.svg
  9. 13
      src/router/index.ts
  10. 8
      src/views/craft-order/broadband/delete-broadband-internet/index.vue
  11. 8
      src/views/craft-order/broadband/enable-broadband-internet/index.vue
  12. 8
      src/views/craft-order/broadband/update-broadband-internet-mode/index.vue
  13. 8
      src/views/craft-order/broadband/update-broadband-internet-password/index.vue
  14. 8
      src/views/craft-order/broadband/update-broadband-internet/index.vue
  15. 8
      src/views/craft-order/broadband/update-broadband-max-number/index.vue
  16. 8
      src/views/craft-order/cloud-box/delete-cloud/index.vue
  17. 8
      src/views/craft-order/cloud-box/enable-cloud/index.vue
  18. 8
      src/views/craft-order/iptv/delete-iptv/index.vue
  19. 8
      src/views/craft-order/iptv/enable-iptv/index.vue
  20. 8
      src/views/craft-order/tyslzw/delete-tyslzw/index.vue
  21. 8
      src/views/craft-order/tyslzw/enable-tyslzw/index.vue
  22. 8
      src/views/craft-order/voip/delete-voip/index.vue
  23. 8
      src/views/craft-order/voip/enable-voip/index.vue
  24. 8
      src/views/craft-order/voip/tree-diagram/index.vue
  25. 8
      src/views/craft-order/voip/update-voip-password/index.vue
  26. 24
      src/views/family/operate/order/components/OrderInfoEdit.vue
  27. 19
      src/views/family/operate/order/index.vue
  28. 19
      src/views/family/operate/remote-operation/components/DeviceOrder.vue
  29. 130
      src/views/family/operate/remote-operation/components/DeviceParamTree.vue
  30. 2
      src/views/family/operate/remote-operation/components/TreeParamAttribute.vue
  31. 312
      src/views/resources/device-type/components/AddDeviceType.vue
  32. 7
      src/views/resources/device-type/index.vue

@ -1,7 +1,8 @@
import {
DeviceTypeForm,
DeviceTypePageResult,
DeviceTypeQuery,
DeviceTypeVO,
DeviceTypeVO
} from "@/api/device-type/types";
import request from "@/utils/request";
import { AxiosPromise } from "axios";
@ -93,3 +94,10 @@ export function serviceBindingDevTypePage(
data,
});
}
export function addDeviceType(data: DeviceTypeForm) {
return request({
url: `/api/dev-type/v1/add-device-type`,
method: "POST",
data,
});
}

@ -29,3 +29,11 @@ export interface DeviceTypeVO {
devHardVer?: string;
devTypeDesc?: string;
}
export interface DeviceTypeForm {
devTypeId?: number;
devVendorName?: string;
devVendorOui?: string;
devTypeName?: string;
devHardVer?: string;
devTypeDesc?: string;
}

@ -28,6 +28,7 @@ export interface OrderTableVO {
remark3?: string;
receivedDate?: string;
orderDealDate?: string;
devOnLineStatus?: string;
}
@ -40,7 +41,7 @@ export interface OrderInfoVO {
orderRemark?: string;
orderServiceType?: string;
orderDate?: string;
receiveDate?: string;
receivedDate?: string;
orderDealDate?: string;
orderDeadline?: string;
adNo?: string;

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723108812726" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12159" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M512 938.666667C276.362667 938.666667 85.333333 747.637333 85.333333 512S276.362667 85.333333 512 85.333333s426.666667 191.029333 426.666667 426.666667-191.029333 426.666667-426.666667 426.666667z m0-64c200.298667 0 362.666667-162.368 362.666667-362.666667S712.298667 149.333333 512 149.333333 149.333333 311.701333 149.333333 512s162.368 362.666667 362.666667 362.666667z m32-394.666667h128a32 32 0 0 1 0 64H544v128a32 32 0 0 1-64 0V544H352a32 32 0 0 1 0-64h128V352a32 32 0 0 1 64 0v128z" fill="#8a8a8a" p-id="12160"></path></svg>

After

Width:  |  Height:  |  Size: 863 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723108963201" class="icon" viewBox="0 0 1029 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13296" xmlns:xlink="http://www.w3.org/1999/xlink" width="48.234375" height="48"><path d="M768 186h217c24.3 0 44 19.7 44 44s-19.7 44-44 44h-91v644c0 57.99-47.01 105-105 105H235c-57.99 0-105-47.01-105-105V274H60c-24.3 0-44-19.7-44-44s19.7-44 44-44h196V99c0-34.242 27.758-62 62-62h388c34.242 0 62 27.758 62 62v87z m-88 0v-61H344v61h336z m-462 89v643c0 9.389 7.611 17 17 17h554c9.389 0 17-7.611 17-17V275H218z m164 503c0 24.3-19.7 44-44 44s-44-19.7-44-44V410c0-24.3 19.7-44 44-44s44 19.7 44 44v368z m184.5 0c0 24.3-19.7 44-44 44s-44-19.7-44-44V410c0-24.3 19.7-44 44-44s44 19.7 44 44v368z m185 0c0 24.3-19.7 44-44 44s-44-19.7-44-44V410c0-24.3 19.7-44 44-44s44 19.7 44 44v368z" fill="#8a8a8a" p-id="13297"></path></svg>

After

Width:  |  Height:  |  Size: 963 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723105860000" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4261" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M594.047266 9.801013v51.584277a459.615909 459.615909 0 1 1-164.295922 0v-51.584277a510.426422 510.426422 0 1 0 164.295922 0z" fill="#8a8a8a" p-id="4262"></path><path d="M478.756407 0h64.480346v459.87383h-64.480346z" fill="#8a8a8a" p-id="4263"></path></svg>

After

Width:  |  Height:  |  Size: 587 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723106292409" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8193" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M512 0a512 512 0 1 0 512 512A512 512 0 0 0 512 0z m0 972.8a460.8 460.8 0 1 1 460.8-460.8 460.8 460.8 0 0 1-460.8 460.8z" fill="#555555" p-id="8194"></path><path d="M512 230.4A281.6 281.6 0 0 0 230.4 498.432l-14.336-21.248a25.6 25.6 0 0 0-35.328-7.168 25.6 25.6 0 0 0-7.168 35.584L230.4 588.8a20.992 20.992 0 0 0 4.352 5.12 23.552 23.552 0 0 0 6.912 4.096h1.792a27.136 27.136 0 0 0 7.936 1.28 29.44 29.44 0 0 0 9.216-1.792l2.304-1.28h2.56a8.192 8.192 0 0 0 2.56-2.56l2.56-1.792 65.792-74.496a25.6 25.6 0 0 0-3.584-37.12 25.6 25.6 0 0 0-36.096 2.304l-15.104 17.152A230.4 230.4 0 1 1 512 742.4a225.536 225.536 0 0 1-45.568-4.608 25.6 25.6 0 0 0-30.208 20.224 25.6 25.6 0 0 0 20.224 30.208A287.744 287.744 0 0 0 512 793.6a281.6 281.6 0 0 0 0-563.2z" fill="#555555" p-id="8195"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723106415061" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9196" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M516.096 84.65c236.773 0 428.715 191.943 428.715 428.715 0 236.773-191.942 428.715-428.715 428.715-236.773 0-428.715-191.942-428.715-428.715 0-236.772 191.942-428.714 428.715-428.714z m0 81.92c-191.53 0-346.795 155.266-346.795 346.795 0 191.53 155.266 346.795 346.795 346.795 191.53 0 346.795-155.265 346.795-346.795 0-191.53-155.266-346.794-346.795-346.794z m-153.7 260.783l0.678 0.708 153.628 164.467 152.332-164.07c15.168-16.338 40.559-17.509 57.16-2.807l0.726 0.659c16.338 15.168 17.508 40.559 2.807 57.16l-0.66 0.726-182.256 196.303c-15.95 17.18-42.972 17.455-59.276 0.795l-0.674-0.704L303.21 483.982c-15.442-16.532-14.559-42.451 1.972-57.893 16.292-15.218 41.702-14.581 57.215 1.264z" fill="#2B313D" p-id="9197"></path></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -410,6 +410,19 @@ export const constantRoutes: RouteRecordRaw[] = [
title: "设备参数树",
},
},
{
path: "/resources/device-type/add",
name: "AddDeviceType",
component: () =>
import(
"@/views/resources/device-type/components/AddDeviceType.vue"
),
meta: {
hidden: true,
keepAlive: true,
title: "新增设备类型",
},
},
],
},
];

@ -479,7 +479,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交删除宽带上网工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -761,7 +761,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交开通宽带上网工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -448,7 +448,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交修改宽带上网模式的工单吗", () => {
loading.value = true;
updateBroadbandMode(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -447,7 +447,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交修改宽带上网账号工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -447,7 +447,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交修改宽带上网账号工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -488,7 +488,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交修改最大连接数工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -411,7 +411,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交删除TYSLZW工单吗", () => {
loading.value = true;
addTYSLZW(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -447,7 +447,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交开通TYSLZW工单吗", () => {
loading.value = true;
addTYSLZW(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -477,7 +477,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交删除IPTV工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -671,7 +671,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交开通IPTV工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -411,7 +411,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交删除TYSLZW工单吗", () => {
loading.value = true;
addTYSLZW(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -480,7 +480,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交开通TYSLZW工单吗", () => {
loading.value = true;
addTYSLZW(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -479,7 +479,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交删除VOIP工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -1202,7 +1202,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交开通VOIP工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -450,7 +450,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交数图修改工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -574,7 +574,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
confirm("确认手动提交修改VOIP密码工单吗", () => {
loading.value = true;
addCraftOrder(formData.value)
.then(() => {})
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});

@ -102,18 +102,18 @@
class-name="my-content"
width="150px"
>
{{ orderInfo.receiveDate }}
</el-descriptions-item>
<el-descriptions-item
label="工单要求完工日期"
label-align="center"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
{{ orderInfo.orderDealDate }}
{{ orderInfo.receivedDate }}
</el-descriptions-item>
<!-- <el-descriptions-item-->
<!-- label="工单要求完工日期"-->
<!-- label-align="center"-->
<!-- align="center"-->
<!-- label-class-name="my-label"-->
<!-- class-name="my-content"-->
<!-- width="150px"-->
<!-- >-->
<!-- {{ orderInfo.orderDealDate }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item
label="工单处理日期"
label-align="center"
@ -122,7 +122,7 @@
class-name="my-content"
width="150px"
>
{{ orderInfo.orderDeadline }}
{{ orderInfo.orderDealDate }}
</el-descriptions-item>
<el-descriptions-item
label="AD编号"

@ -73,7 +73,8 @@
<el-table-column
label="受理号"
align="center"
width="180"
width="250"
show-overflow-tooltip
prop="receivedOrderLhs"
v-if="columns[1].show"
/>
@ -163,12 +164,19 @@
width="180"
v-if="columns[13].show"
/>
<el-table-column
label="工单处理日期"
align="center"
prop="orderDealDate"
width="180"
v-if="columns[14].show"
/>
<el-table-column
label="设备上线状态"
align="center"
width="180"
prop="devOnLineStatus"
v-if="columns[14].show"
v-if="columns[15].show"
/>
</el-table>
</div>
@ -215,18 +223,19 @@ const buttonColSpan = computed(() => {
const columns = ref<TableColumns[]>([
{ name: "工单序号", show: true },
{ name: "受理号", show: true },
{ name: "开工单日期", show: true },
{ name: "开工单日期", show: false },
{ name: "AD编号", show: true },
{ name: "工单状态", show: true },
{ name: "操作类型", show: false },
{ name: "工单业务类型", show: false },
{ name: "业务类型", show: true },
{ name: "端口", show: true },
{ name: "端口", show: false },
{ name: "PPPoe账号", show: true },
{ name: "电话号码", show: true },
{ name: "电话号码", show: false },
{ name: "系统管理域", show: true },
{ name: "是否定制终端", show: false },
{ name: "工单接收日期", show: false },
{ name: "工单处理日期", show: false },
{ name: "设备上线状态", show: false },
]);
const changeColumns = (newColumns: TableColumns[]) => {

@ -34,7 +34,8 @@
<el-table-column
label="受理号"
align="center"
width="180"
width="250"
show-overflow-tooltip
prop="receivedOrderLhs"
v-if="columns[1].show"
/>
@ -124,12 +125,19 @@
width="180"
v-if="columns[13].show"
/>
<el-table-column
label="工单处理日期"
align="center"
prop="orderDealDate"
width="180"
v-if="columns[14].show"
/>
<el-table-column
label="设备上线状态"
align="center"
width="180"
prop="devOnLineStatus"
v-if="columns[14].show"
v-if="columns[15].show"
/>
</el-table>
</div>
@ -163,18 +171,19 @@ const tableData = ref<OrderTableVO[]>([]);
const columns = ref<TableColumns[]>([
{ name: "工单序号", show: true },
{ name: "受理号", show: true },
{ name: "开工单日期", show: true },
{ name: "开工单日期", show: false },
{ name: "AD编号", show: true },
{ name: "工单状态", show: true },
{ name: "操作类型", show: false },
{ name: "工单业务类型", show: false },
{ name: "业务类型", show: true },
{ name: "端口", show: true },
{ name: "端口", show: false },
{ name: "PPPoe账号", show: true },
{ name: "电话号码", show: true },
{ name: "电话号码", show: false },
{ name: "系统管理域", show: true },
{ name: "是否定制终端", show: false },
{ name: "工单接收日期", show: false },
{ name: "工单处理日期", show: false },
{ name: "设备上线状态", show: false },
]);
const changeColumns = (newColumns: TableColumns[]) => {

@ -30,12 +30,16 @@
}"
:expand-on-click-node="false"
default-expand-all
accordion
>
<template #default="{ node, data }">
<div class="custom-tree-node">
<div style="display: flex; justify-content: flex-start">
<div
style="display: flex; justify-content: flex-start"
@contextmenu.prevent="openView(data, $event)"
>
<div v-if="data.childNode === true">
<div style="margin-top: 1px" @click="handleNodeClick(data)">
<div style="margin-top: 1px">
<svg-icon class="mr-5px" size="15" icon-class="folder" />
</div>
</div>
@ -44,7 +48,9 @@
<svg-icon class="mr-5px" size="15" icon-class="file" />
</div>
</div>
<div @click="changeCurrentTree(data)">{{ node.label }}</div>
<div @click="changeCurrentTree(data)">
{{ node.label }}
</div>
</div>
</div>
</template>
@ -114,7 +120,7 @@
<div v-else>
<div v-if="currentTree.label != 'InternetGatewayDevice'">
<el-button type="primary" @click="addInstanceNode"
>新增实例</el-button
>新增实例</el-button
>
<el-button type="primary" @click="deleteInstanceNode"
>删除实例</el-button
@ -130,6 +136,52 @@
</div>
</template>
</el-card>
<ul
v-show="contentTreeVisible"
class="contextmenu"
:style="{ left: left + 'px', top: top + 'px' }"
>
<li v-if="currentTree.childNode === false" @click="getParameterValue">
<svg-icon icon-class="unfold" />
参数值
</li>
<li v-if="currentTree.childNode === true" @click="handleNodeClick">
<svg-icon icon-class="unfold" />
展开节点
</li>
<li v-if="currentTree.childNode === true" @click="handleNodeClick">
<svg-icon icon-class="refresh" />
刷新节点
</li>
<li
v-if="
currentTree.childNode === true &&
currentTree.label != 'InternetGatewayDevice'
"
@click="addInstanceNode"
>
<svg-icon icon-class="add" />
新增实例
</li>
<li
v-if="
currentTree.childNode === true &&
currentTree.label != 'InternetGatewayDevice'
"
@click="deleteInstanceNode"
>
<svg-icon icon-class="delete" />
删除实例
</li>
<li>
<svg-icon icon-class="reboot" @click="reboot" />
重启设备
</li>
<li>
<svg-icon icon-class="reset" @click="factoryReset" />
恢复出厂
</li>
</ul>
<tree-param-attribute ref="treeParamAttributeRef" />
</div>
</template>
@ -153,6 +205,11 @@ const route = useRoute();
let devId: number = parseInt(<string>route.params.devId);
const treeParamAttributeRef = ref();
const deviceTreeRef = ref();
const contentTreeVisible = ref<boolean>(false);
const { proxy } = getCurrentInstance()!;
const left = ref(0);
const top = ref(0);
const loading = ref<boolean>(false);
const treeList = ref<OptionTree[]>([
{
@ -168,28 +225,27 @@ const currentTree = ref<OptionTree>({
childNode: true,
children: [],
});
const handleNodeClick = (data_: OptionTree) => {
const handleNodeClick = () => {
loading.value = true;
let nodePath = data_.nodePath;
let nodePath = currentTree.value.nodePath;
remoteTreeNode(devId, nodePath)
.then(({ data }) => {
if (!data_.children) {
data_.children = [];
}
data_.children = data;
treeList.value = [...treeList.value];
childNode.value = data;
addInstanceNode_(treeList.value[0], currentTree.value.nodePath);
})
.finally(() => {
loading.value = false;
});
};
const changeCurrentTree = (data: OptionTree) => {
currentTree.value = data;
if (data.childNode) {
return;
}
let nodePath = data.nodePath;
};
const getParameterValue = () => {
// currentTree.value = data;
// if (data.childNode) {
// return;
// }
let nodePath = currentTree.value.nodePath;
loading.value = true;
remoteGetParameterValues(devId, nodePath)
.then(({ data }) => {
@ -222,13 +278,13 @@ const saveParam = () => {
const openParamAttribute = () => {
treeParamAttributeRef.value.open(devId, currentTree.value.nodePath);
};
const childNode = ref<OptionTree>({});
const childNode = ref<OptionTree[]>([]);
const addInstanceNode = () => {
confirm("确定添加实例吗", () => {
loading.value = true;
remoteAddInstanceNode(devId, currentTree.value.nodePath)
.then(({ data }) => {
childNode.value = data;
childNode.value = [data];
addInstanceNode_(treeList.value[0], currentTree.value.nodePath);
})
.finally(() => {
@ -255,8 +311,7 @@ const addInstanceNode_ = (tree: OptionTree, nodePath?: string) => {
if (!tree.children) {
tree.children = [];
}
tree.children?.push(childNode.value);
console.log(treeList.value[0]);
tree.children?.push(...childNode.value);
return;
}
//
@ -321,6 +376,22 @@ const factoryReset = () => {
});
});
};
function closeContent() {
contentTreeVisible.value = false;
}
watch(contentTreeVisible, (value) => {
if (value) {
document.body.addEventListener("click", closeContent);
} else {
document.body.removeEventListener("click", closeContent);
}
});
const openView = (data: OptionTree, e: MouseEvent) => {
currentTree.value = data;
left.value = e.pageX - 190;
top.value = e.pageY;
contentTreeVisible.value = true;
};
</script>
<style scoped>
@ -382,4 +453,23 @@ const factoryReset = () => {
:deep(.el-form-item--default) {
margin-bottom: 0;
}
.contextmenu {
position: absolute;
z-index: 99;
font-size: 12px;
color: #68758e;
background: var(--el-bg-color-overlay);
border-radius: 4px;
box-shadow: var(--el-box-shadow-light);
li {
padding: 8px 16px;
cursor: pointer;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
&:hover {
background: var(--el-fill-color-light);
}
}
}
</style>

@ -10,7 +10,7 @@
class-name="my-content"
width="15px"
>
InternetGatewayDevice.DeviceSummary
{{ nodePath }}
</el-descriptions-item>
<el-descriptions-item
label="NotificationChange"

@ -0,0 +1,312 @@
<template>
<div class="app-container">
<el-card shadow="never">
<template #header>
<div style="display: flex; align-items: center">
<el-icon size="15"><Grid /></el-icon>&nbsp;<span
style="font-weight: 700; font-size: 14px; line-height: 16px"
>新增设备类型信息</span
>
</div>
</template>
<el-form
v-loading="loading"
:model="formData"
ref="addDeviceTypeRef"
:rules="rules"
>
<el-descriptions :column="2" border>
<el-descriptions-item
label="设备供应商"
label-align="left"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
<el-form-item prop="devVendorName">
<el-input
v-model="formData.devVendorName"
style="width: 200px; margin-right: 10px"
/>
<el-select
v-model="formData.devVendorName"
clearable
filterable
placeholder="请选择设备供应商"
style="width: 180px"
>
<el-option
v-for="item in vendorNameOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label="设备OUI"
label-align="left"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
<el-form-item prop="devVendorOui">
<el-input
v-model="formData.devVendorOui"
style="width: 200px; margin-right: 10px"
/>
<el-select
v-model="formData.devVendorOui"
clearable
filterable
placeholder="请选择设备OUI"
style="width: 180px"
>
<el-option
v-for="item in vendorOuiOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label="设备型号"
label-align="left"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
<el-form-item prop="devTypeName">
<el-input
v-model="formData.devTypeName"
style="width: 200px; margin-right: 10px"
/>
<el-select
v-model="formData.devTypeName"
clearable
filterable
placeholder="请选择设备型号"
style="width: 180px"
>
<el-option
v-for="item in typeNameOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label="设备硬件版本"
label-align="left"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
<el-form-item prop="devHardVer">
<el-input
v-model="formData.devHardVer"
style="width: 200px; margin-right: 10px"
/>
<el-select
v-model="formData.devHardVer"
clearable
filterable
placeholder="设备硬件版本"
style="width: 180px"
>
<el-option
v-for="item in hardVerOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label="设备类型描述"
label-align="left"
align="center"
label-class-name="my-label"
class-name="my-content"
width="150px"
>
<el-form-item prop="devTypeDesc">
<el-input v-model="formData.devTypeDesc" type="textarea" />
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-form>
<template #footer>
<div class="flex justify-end">
<el-button type="primary" @click="submitForm(addDeviceTypeRef)"
>保存</el-button
>
</div>
</template>
</el-card>
</div>
</template>
<script setup lang="ts">
import { Grid } from "@element-plus/icons-vue";
import { DeviceTypeForm } from "@/api/device-type/types";
import {
addDeviceType,
getHardVerOption,
getTypeNameOption,
getVendorNameOption,
getVendorOuiOption,
} from "@/api/device-type";
import { FormInstance, FormRules } from "element-plus";
import { confirm } from "@/utils/confirm";
const formData = ref<DeviceTypeForm>({
devTypeName: "",
devVendorOui: "",
devHardVer: "",
devVendorName: "",
});
const loading = ref<boolean>(false);
const addDeviceTypeRef = ref<FormInstance>();
const vendorNameOption = ref<OptionType[]>([]);
const vendorOuiOption = ref<OptionType[]>([]);
const typeNameOption = ref<OptionType[]>([]);
const hardVerOption = ref<OptionType[]>([]);
const rules = reactive<FormRules<DeviceTypeForm>>({
devVendorName: [
{ required: true, message: "请选择或输入设备供应商", trigger: "blur" },
{
min: 3,
max: 64,
message: "设备供应商长度大于最小64字符长度",
trigger: "blur",
},
],
devTypeName: [
{ required: true, message: "请选择或输入设备型号", trigger: "blur" },
{
min: 3,
max: 64,
message: "设备型号长度大于最小64字符长度",
trigger: "blur",
},
],
devHardVer: [
{ required: true, message: "请选择或输入设备硬件版本", trigger: "blur" },
{
min: 3,
max: 64,
message: "设备硬件版本长度大于最小64字符长度",
trigger: "blur",
},
],
devVendorOui: [
{ required: true, message: "请选择或输入设备OUI", trigger: "blur" },
{
min: 3,
max: 64,
message: "设备OUI本长度大于最小64字符长度",
trigger: "blur",
},
],
});
watch(
() => formData.value.devVendorName,
() => {
if (formData.value.devVendorName === undefined) {
return;
}
loadVendorOuiOption();
}
);
watch(
() => formData.value.devVendorOui,
() => {
if (formData.value.devVendorOui === undefined) {
return;
}
loadTypeNameOption();
}
);
watch(
() => formData.value.devTypeName,
() => {
if (formData.value.devTypeName === undefined) {
return;
}
loadHardVerOption();
}
);
const loadVendorNameOption = async () => {
await getVendorNameOption().then(({ data }) => {
vendorNameOption.value = data;
});
};
const loadVendorOuiOption = async () => {
await getVendorOuiOption(formData.value.devVendorName).then(({ data }) => {
vendorOuiOption.value = data;
});
};
const loadTypeNameOption = async () => {
await getTypeNameOption(formData.value.devVendorOui).then(({ data }) => {
typeNameOption.value = data;
});
};
const loadHardVerOption = async () => {
await getHardVerOption(formData.value.devTypeName).then(({ data }) => {
hardVerOption.value = data;
});
};
const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
await formEl.validate((valid, fields) => {
if (valid) {
confirm("确定新增设备类型吗", () => {
loading.value = true;
addDeviceType(formData.value)
.then(() => {
ElMessage({
message: "操作成功",
duration: 1000,
type: "success",
});
})
.finally(() => {
loading.value = false;
});
});
} else {
console.log("error submit!", fields);
}
});
};
onMounted(() => {
loadVendorNameOption();
loadVendorOuiOption();
loadTypeNameOption();
loadHardVerOption();
});
</script>
<style scoped>
:deep(.my-label) {
width: 100px !important;
background: var(--el-color-white) !important;
}
:deep(.el-card__body) {
padding: 10px 5px;
}
:deep(.el-form-item--default) {
margin-bottom: 0;
}
</style>

@ -73,7 +73,7 @@
<template #header>
<div class="table-head-parent">
<div>
<el-button type="primary" plain><i-ep-plus />新增</el-button>
<el-button type="primary" @click="skipAdd" plain><i-ep-plus />新增</el-button>
<el-button type="danger" plain @click="handleDeletes"
><i-ep-delete />删除</el-button
>
@ -302,6 +302,11 @@ const redirect = (devTypeId: number) => {
path: `/resources/device_type_to_ver/${devTypeId}`,
});
};
const skipAdd = () => {
router.push({
path: `/resources/device-type/add`,
});
}
onMounted(() => {
loadVendorNameOption();
loadVendorOuiOption();

Loading…
Cancel
Save