Browse Source

根据登录用户获取区县树

maxiaoxiao 1 tháng trước cách đây
mục cha
commit
63b458b4bb
2 tập tin đã thay đổi với 13 bổ sung7 xóa
  1. 7 0
      src/api/system/dept.js
  2. 6 7
      src/views/pageCode/checkLand/index.vue

+ 7 - 0
src/api/system/dept.js

@@ -8,6 +8,13 @@ export function listDept(query) {
     params: query
   })
 }
+export function userDept(params) {
+  return request({
+      url: '/system/dept/tree',
+      method: 'get',
+      params
+  })
+}
 
 // 查询部门列表(排除节点)
 export function listDeptExcludeChild(deptId) {

+ 6 - 7
src/views/pageCode/checkLand/index.vue

@@ -6,11 +6,11 @@
           v-model="queryParams.decideType"
           :data="deptList"
           :props="{
-            value: 'deptId',
-            label: 'deptName',
+            value: 'id',
+            label: 'label',
             children: 'children',
           }"
-          value-key="deptId"
+          value-key="id"
           default-expanded-keys
           check-strictly
           style="width: 200px"
@@ -141,7 +141,7 @@
 </template>
   
   <script setup name="Dkjbxx">
-import { listDept } from "@/api/system/dept";
+import { userDept } from "@/api/system/dept";
 import {
   getDkcount,
   listDkjbxx,
@@ -265,7 +265,6 @@ function getList() {
 function getcount() {
   countData.value = {};
   let prams = countparm[route.query.type || "normal"];
-  console.log(prams,'pramspramsprams')
   Object.keys(prams).forEach((key) => {
     getDkcount({
       startTime: "",
@@ -394,8 +393,8 @@ function handleDownload(row) {
   window.open(`${zipfile}`);
 }
 function getDrpt() {
-  listDept({}).then((response) => {
-    deptList.value = proxy.handleTree(response.data, "deptId");
+  userDept({}).then((response) => {
+    deptList.value = response.data;
   });
 }
 getDrpt();