刘恒 2 лет назад
Родитель
Сommit
56fa72da6f

+ 114 - 0
src/components/tree/allTree.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="tree">
+    <a-tree
+      v-if="treeData && treeData.length > 0"
+      :tree-data="treeData"
+      :title="'11'"
+      :replaceFields="replaceFields"
+      @select="onSelect"
+      :checkable="checkable"
+      @check="onCheck"
+      v-model="checkList"
+      :auto-expand-parent="autoExpandParent"
+      :expanded-keys="expandedKeys"
+      @expand="onExpand"
+      ref="tree"
+    >
+      <template slot="custom" slot-scope="item">
+        <span>{{ item }}</span>
+        <!-- <span style="color: #f50">({{ item.num }})</span> -->
+      </template>
+    </a-tree>
+  </div>
+</template>
+    
+    <script>
+// import mixin from "../../minins/mixin";
+import { mapState } from "vuex";
+export default {
+  name: "FormRow",
+  //   mixins: [mixin],
+  props: {
+    checkable: {
+      default: false,
+    },
+    // defaultCheckList: {
+    //   default: [],
+    // },
+  },
+  data() {
+    return {
+      treeData: [],
+      replaceFields: {
+        children: "children",
+        title: "name",
+        key: "id",
+      },
+      checkList: [],
+      autoExpandParent: true,
+      expandedKeys: [],
+    };
+  },
+  computed: {
+    ...mapState("setting", ["userInfo"]),
+  },
+  watch: {},
+  created() {},
+  mounted() {
+    this.getMechanismTree();
+  },
+  methods: {
+    onExpand(expandedKeys) {
+      this.expandedKeys = expandedKeys;
+      //expandedKeys
+      this.autoExpandParent = false;
+    },
+    setExpandKys(item) {
+      this.$nextTick(() => {
+        // this.$refs.tree.expandedKeys = ["99D17"];
+        // this.$refs.tree.defaultExpandedKeys = ["99D17"];
+        // console.log(this.$refs.tree);
+        // this.expandedKeys = ["99D17"];
+        // this.checkList = ["99D17"];
+        this.$API.sysManage
+          .getUserItem({
+            userId: item.userId,
+          })
+          .then((res) => {
+            if (res.data.code === 200) {
+              this.expandedKeys = res.data.data.deptIds;
+              this.checkList = res.data.data.deptIds;
+            }
+          });
+      });
+    },
+    getMechanismTree() {
+      // console.log(this.userInfo);
+      this.$API.mechanism
+        .getMechanismTree({ deptId: this.userInfo.deptId })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.treeData = res.data.data;
+          }
+        });
+    },
+
+    onSelect(keys) {
+      this.$emit("getList", keys[0]);
+    },
+    onCheck(checkedKeys) {
+      this.$emit("checkTree", checkedKeys);
+
+      // this.checkedKeys = checkedKeys;
+    },
+  },
+};
+</script>
+    
+  <style lang="less" scoped>
+.tree {
+  height: 900px;
+  overflow-y: auto;
+}
+</style>
+    

+ 5 - 7
src/components/tree/tree.vue

@@ -84,13 +84,11 @@ export default {
     },
     getMechanismTree() {
       // console.log(this.userInfo);
-      this.$API.mechanism
-        .getMechanismTree({ deptId: this.userInfo.deptId })
-        .then((res) => {
-          if (res.data.code === 200) {
-            this.treeData = res.data.data;
-          }
-        });
+      this.$API.mechanism.getDataDeptTree().then((res) => {
+        if (res.data.code === 200) {
+          this.treeData = res.data.data;
+        }
+      });
     },
 
     onSelect(keys) {

+ 1 - 0
src/pages/financial/carInsurance.vue

@@ -134,6 +134,7 @@ export default {
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
       wholeList: [],

+ 1 - 0
src/pages/financial/receivables.vue

@@ -134,6 +134,7 @@ export default {
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
       wholeList: [],

+ 1 - 0
src/pages/financial/receivablesMessage.vue

@@ -167,6 +167,7 @@ export default {
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
       wholeList: [],

+ 1 - 0
src/pages/financial/verification.vue

@@ -152,6 +152,7 @@ export default {
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
       wholeList: [],

+ 2 - 1
src/pages/profit/profit.vue

@@ -35,7 +35,7 @@
           bordered
           :columns="columns"
           :dataSource="tableList"
-          :pagination="false"
+          :pagination="pagination"
           @clear="onClear"
           @change="onChange"
           :loading="loading"
@@ -155,6 +155,7 @@ export default {
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
 

+ 11 - 0
src/pages/sys/auth.vue

@@ -18,6 +18,7 @@
       :pagination="pagination"
       :loading="loading"
       style="background: #fff"
+      @change="onChange"
       :customRow="customRow"
     >
       <div
@@ -208,6 +209,16 @@ export default {
       this.pagination.defaultPageSize = 10;
       this.getList();
     },
+    onChange(pagination) {
+      // this.$message.info('表格状态改变了')
+      // console.log(pagination, filters, sorter, { currentDataSource });
+      this.pagination = {
+        current: pagination.current,
+        defaultPageSize: pagination.pageSize,
+        total: pagination.total,
+      };
+      this.getList();
+    },
     customRow(record, index) {
       console.log(record, index);
       return {

+ 1 - 1
src/pages/sys/permissionsAuth.vue

@@ -38,7 +38,7 @@
     
     <script>
 import StandardTable from "@/components/table/StandardTable";
-import tree from "@/components/tree/tree";
+import tree from "@/components/tree/allTree.vue";
 const columns = [
   {
     title: "员工工号",

+ 1 - 1
src/pages/wallet/agency.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="quote">
     <div class="quote-tree">
-      <div>
+      <div style="overflow-y: auto">
         <!-- <a-tree  :tree-data="treeData" /> -->
         <!-- <tree @getList="treeChoose"></tree> -->
         <a-tree

+ 1 - 1
src/pages/wallet/agent.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="quote">
     <div class="quote-tree">
-      <div>
+      <div style="overflow-y: auto">
         <!-- <a-tree  :tree-data="treeData" /> -->
         <!-- <tree @getList="treeChoose"></tree> -->
         <a-tree

+ 1 - 1
src/pages/wallet/channel.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="quote">
     <div class="quote-tree">
-      <div>
+      <div style="overflow-y: auto">
         <!-- <a-tree  :tree-data="treeData" /> -->
         <!-- <tree @getList="treeChoose"></tree> -->
         <a-tree

+ 1 - 1
src/pages/wallet/partner.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="quote">
     <div class="quote-tree">
-      <div>
+      <div style="overflow-y: auto">
         <a-tree
           :tree-data="treeData"
           :replaceFields="replaceFields"

+ 1 - 1
src/services/business.js

@@ -23,7 +23,7 @@ export async function getBusinessAgentTotalDetails(data) {
 
 //获取人员树
 export async function getUserTree(data) {
-    return request("/user/findTree", METHOD.GET, data)
+    return request("/user/findNextTree", METHOD.GET, data)
 }
 
 

+ 6 - 1
src/services/mechanism.js

@@ -11,6 +11,10 @@ export async function getMechanism(data) {
 export async function getMechanismTree(data) {
     return request(`/dept/findAllTree`, METHOD.GET, data)
 }
+//获取数据权限树形
+export async function getDataDeptTree() {
+    return request(`/dept/getDataDeptTree`, METHOD.GET)
+}
 
 //获取保险公司列表
 
@@ -21,5 +25,6 @@ export async function getMechanismTree(data) {
 
 export default {
     getMechanism,
-    getMechanismTree
+    getMechanismTree,
+    getDataDeptTree
 }