duy 2 лет назад
Родитель
Сommit
53cdc3c3a2

+ 8 - 1
src/views/tentative/device/approach.vue

@@ -214,7 +214,7 @@ import HcDragUpload from "./components/HcDragUpload.vue"
 import approachApi from "~api/tentative/device/approach";
 import {formValidate, getArrValue} from "vue-utils-plus"
 import {getContractUserList} from "~api/other";
-import {getClassList} from "~api/tentative";
+import {getClassList,deviceClassListInit} from "~api/tentative";
 
 //初始变量
 const useAppState = useAppStore()
@@ -231,6 +231,7 @@ watch(() => [
 
 //渲染完成
 onMounted(() => {
+    deviceClassListInitdata()
     getClassListData()
     setContextMenu()
     getTableData()
@@ -264,6 +265,12 @@ const getClassListData = async () => {
     typeData.value = arr
     menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
 }
+//初始化设备分类
+const deviceClassListInitdata= async () => {
+     const { data } = await deviceClassListInit({
+        contractId: contractId.value
+    })
+}
 
 //菜单被点击
 const menuChange = (item) => {

+ 8 - 2
src/views/tentative/device/employ.vue

@@ -148,7 +148,7 @@ import {ref, onMounted, watch} from "vue";
 import {useAppStore} from "~src/store";
 import HcDragUpload from "./components/HcDragUpload.vue"
 import HcSelectTree from "./components/HcSelectTree.vue"
-import {getClassList, queryDeviceList, querySampleList,getSampleInfo} from "~api/tentative";
+import {getClassList,deviceClassListInit, queryDeviceList, querySampleList,getSampleInfo} from "~api/tentative";
 import {getContractUserList} from "~api/other";
 import {formValidate, getArrValue,getObjValue} from "vue-utils-plus"
 import dataApi from "~api/tentative/device/employ";
@@ -170,6 +170,7 @@ watch(() => [
 
 //渲染完成
 onMounted(() => {
+    deviceClassListInitdata()
     getClassListData()
     getTableData()
     getUserListData()
@@ -203,7 +204,12 @@ const getClassListData = async () => {
     typeData.value = arr
     menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
 }
-
+//初始化设备分类
+const deviceClassListInitdata= async () => {
+     const { data } = await deviceClassListInit({
+        contractId: contractId.value
+    })
+}
 //菜单被点击
 const menuChange = (item) => {
     menuItem.value = item

+ 8 - 2
src/views/tentative/device/overhaul.vue

@@ -126,7 +126,7 @@
 import {ref, onMounted, watch} from "vue";
 import {useAppStore} from "~src/store";
 import HcDragUpload from "./components/HcDragUpload.vue"
-import {getClassList, queryDeviceList, querySampleList} from "~api/tentative";
+import {getClassList,deviceClassListInit, queryDeviceList, querySampleList} from "~api/tentative";
 import {getContractUserList} from "~api/other";
 import {formValidate, getArrValue} from "vue-utils-plus"
 import dataApi from "~api/tentative/device/overhaul";
@@ -148,6 +148,7 @@ watch(() => [
 
 //渲染完成
 onMounted(() => {
+    deviceClassListInitdata()
     getClassListData()
     getTableData()
     getUserListData()
@@ -180,7 +181,12 @@ const getClassListData = async () => {
     typeData.value = arr
     menus.value = [{id: '0', className: '全部', isNoContextMenu: true}, ...arr]
 }
-
+//初始化设备分类
+const deviceClassListInitdata= async () => {
+     const { data } = await deviceClassListInit({
+        contractId: contractId.value
+    })
+}
 //菜单被点击
 const menuChange = (item) => {
     menuItem.value = item