yangbifan 2 lat temu
rodzic
commit
32b274d9d1

+ 2 - 2
config/dev.env.js

@@ -6,8 +6,8 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
   ctx:'"http://127.0.0.1:8080"',
-  ctxForm: '"http://10.149.85.91:8000"',//dev
-  // ctxForm: '"http://43.138.50.94:8880"',//test
+  // ctxForm: '"http://10.149.85.91:8000"',//dev
+  ctxForm: '"http://43.138.50.94:8880"',//test
   // ctxForm: '"http://192.168.2.124:8880"',//test
   // ctxForm: '"http://10.230.26.15:8000"',//生产
 

+ 196 - 139
src/components/workDeptThree.vue

@@ -1,149 +1,206 @@
 <template>
-    <div class="treebox" v-loading="loading">
-        <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText"></el-input> -->
-        <el-tree :highlight-current="true" :check-strictly="true" ref="tree" @check-change="handleCheckChange"
-            :data="treeList" node-key="id" :default-checked-keys="defaultListc" :default-expanded-keys="defaultListc"
-            @node-click="handleNodeClick" @node-expand="handleNodeClick" >
-            <span class="custom-tree-node" slot-scope="{ node, data }" @click="cs(node)">
-                <em style="display: inline-block;width: 20px;" v-if="node.data.haveUserFlag == 'N'&& node.data.children.length == 0"></em>
-                <i class="el-icon-caret-right" v-if="node.data.haveUserFlag == 'Y' && node.data.children.length == 0"></i>
-                <el-checkbox style="margin-right: 10px" v-model="node.checked" v-if="node.data.type == 1"></el-checkbox>
-                <span>{{ node.label }}</span>
-            </span>
-        </el-tree>
-    </div>
+  <div class="treebox" v-loading="loading">
+    <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText"></el-input> -->
+    <el-tree
+      :default-expand-all="expandAll"
+      :highlight-current="true"
+      :check-strictly="true"
+      ref="tree"
+      @check-change="handleCheckChange"
+      :data="treeList"
+      node-key="id"
+      :default-checked-keys="defaultListc"
+      :default-expanded-keys="defaultListc"
+      @node-click="handleNodeClick"
+      @node-expand="handleNodeClick"
+    >
+      <span
+        class="custom-tree-node"
+        slot-scope="{ node, data }"
+        @click="cs(node)"
+      >
+        <em
+          style="display: inline-block; width: 20px"
+          v-if="node.data.haveUserFlag == 'N' && node.data.children.length == 0"
+        ></em>
+        <i
+          class="el-icon-caret-right"
+          v-if="node.data.haveUserFlag == 'Y' && node.data.children.length == 0"
+        ></i>
+        <el-checkbox
+          style="margin-right: 10px"
+          v-model="node.checked"
+          v-if="node.data.type == 1"
+        ></el-checkbox>
+        <span>{{ node.label }}</span>
+      </span>
+    </el-tree>
+  </div>
 </template>
 
 <script>
-    export default {
-        props: ["defaultList", "type", "closeList","treeList"],
-        data() {
-            return {
-                treeList: [],
-                opt: [],
-                defaultProps: {
-                    children: "children",
-                    label: "label",
-                },
-                defaultListc: [],
-                loading:false,
-                filterText: '',
-            };
-        },
-        methods: {
-            filterNode(value, data) {
-                if (!value) return true;
-                return data.label.indexOf(value) !== -1;
-            },
-            cs(v){
-                // console.log(v)
-            },
-            // getTree(v) {
-            //     this.loading = true;
-            //     this.$http({
-            //         url: "/sysmgr/csysdept/queryAllList",
-            //         method: "post",
-            //         headers: {
-            //             "Content-Type": "application/json",
-            //         },
-            //         data: {
-            //             parentorgid: v,
-            //         },
-            //     }).then((res) => {
-            //         this.treeList = res.data;
-            //         this.loading = false;
-            //     });
-            // },
-            handleCheckChange(v) {
-                let opt = [];
-                let list = this.$refs.tree.getCheckedNodes();
-                for (let i = 0; i < list.length; i++) {
-                    if (list[i].type == 1) {
-                        opt.push({
-                            receiveNo: list[i].loginNoStr,
-                            receiveName: list[i].label,
-                            deptName: list[i].displayname,
-                            deptCode: list[i].groupId,
-                            id: list[i].id,
-                            type: list[i].type,
-                            label: list[i].label,
-                        });
-                    }
-                }
-                this.$emit("treeCheck", opt);
-            },
-            handleNodeClick(v) {
-                let s = false;
-                if (v.children && v.children.length == 0) {
-                    s = true;
-                }
-                if (v.type) {
-                    return;
-                }
-                if (
-                    v.children &&
-                    v.children.length > 0 &&
-                    v.children[v.children.length - 1].type == 1
-                ) {
-                    return;
-                }
-                this.$http({
-                    url: "/sysmgr/sysuserinfo/queryList",
-                    method: "post",
-                    headers: {
-                        "Content-Type": "application/json",
-                    },
-                    data: {
-                        groupId: v.o,
-                    },
-                }).then((res) => {
-                    res.data.forEach((item) => {
-                        v.children.push({
-                            id: item.id,
-                            label: item.loginNameStr,
-                            type: 1,
-                            displayname: v.displayname,
-                            groupId: item.groupId,
-                            loginNoStr: item.loginNoStr,
-                        });
-                    });
-                });
-                for (let i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
-                    if (s && v.o == this.$refs.tree.store._getAllNodes()[i].data.o) {
-                        this.$refs.tree.store._getAllNodes()[i].expanded = true;
-                        return;
-                    }
-                }
-            },
-        },
-        created() {
-            // this.getTree();
-            this.defaultListc = this.defaultList;
+export default {
+  props: ["defaultList", "type", "closeList", "treeList"],
+  data() {
+    return {
+      expandAll: false,
+      opt: [],
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      defaultListc: [],
+      loading: false,
+      filterText: "",
+    };
+  },
+  methods: {
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    cs(v) {
+      // console.log(v)
+    },
+    // getTree(v) {
+    //     this.loading = true;
+    //     this.$http({
+    //         url: "/sysmgr/csysdept/queryAllList",
+    //         method: "post",
+    //         headers: {
+    //             "Content-Type": "application/json",
+    //         },
+    //         data: {
+    //             parentorgid: v,
+    //         },
+    //     }).then((res) => {
+    //         this.treeList = res.data;
+    //         this.loading = false;
+    //     });
+    // },
+    handleCheckChange(v) {
+      let opt = [];
+      let list = this.$refs.tree.getCheckedNodes();
+      for (let i = 0; i < list.length; i++) {
+        if (list[i].type == 1) {
+          opt.push({
+            receiveNo: list[i].loginNoStr,
+            receiveName: list[i].label,
+            deptName: list[i].displayname,
+            deptCode: list[i].groupId,
+            id: list[i].id,
+            type: list[i].type,
+            label: list[i].label,
+          });
+        }
+      }
+      this.$emit("treeCheck", opt);
+    },
+    handleNodeClick(v) {
+      let s = false;
+      if (v.children && v.children.length == 0) {
+        s = true;
+      }
+      if (v.type) {
+        return;
+      }
+      if (
+        v.children &&
+        v.children.length > 0 &&
+        v.children[v.children.length - 1].type == 1
+      ) {
+        return;
+      }
+      this.$http({
+        url: "/sysmgr/sysuserinfo/queryList",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
         },
-        watch: {
-            filterText(val) {
-                this.$refs.tree.filter(val);
-            },
-            type() {
-                this.defaultListc = this.defaultList;
-                this.$forceUpdate();
-            },
-            defaultList() {
-                this.$forceUpdate();
-            },
-            closeList() {
-                this.$refs.tree.setCheckedNodes(this.closeList);
-            },
+        data: {
+          groupId: v.o,
         },
-    };
+      }).then((res) => {
+        res.data.forEach((item) => {
+          v.children.push({
+            id: item.id,
+            label: item.loginNameStr,
+            type: 1,
+            displayname: v.displayname,
+            groupId: item.groupId,
+            loginNoStr: item.loginNoStr,
+          });
+        });
+      });
+      for (let i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
+        if (s && v.o == this.$refs.tree.store._getAllNodes()[i].data.o) {
+          this.$refs.tree.store._getAllNodes()[i].expanded = true;
+          return;
+        }
+      }
+    },
+  },
+  created() {
+    // this.getTree();
+    // console.log(this.treeList);
+    this.defaultListc = this.defaultList;
+  },
+  watch: {
+    treeList(newVal, oldVal) {
+      console.log(newVal);
+      this.$nextTick(() => {
+        if (newVal.length <= 1) {
+          this.isexpand = true;
+
+          for (
+            var i = 0;
+            i < this.$refs.tree.store._getAllNodes().length;
+            i++
+          ) {
+            console.log(this.$refs.tree.store._getAllNodes()[i]);
+            this.$refs.tree.store._getAllNodes()[i].expanded = true;
+          }
+        } else {
+          for (
+            var i = 0;
+            i < this.$refs.tree.store._getAllNodes().length;
+            i++
+          ) {
+            console.log(this.$refs.tree.store._getAllNodes()[i]);
+            this.$refs.tree.store._getAllNodes()[i].expanded =false;
+          }
+        }
+      });
+    },
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+    type() {
+      this.defaultListc = this.defaultList;
+      this.$forceUpdate();
+    },
+    defaultList() {
+      this.$forceUpdate();
+    },
+    closeList() {
+      this.$refs.tree.setCheckedNodes(this.closeList);
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
-    .el-icon-caret-right{
-        color: #ccc;
-        margin:0 5px;
-    }
-    .treebox {
-        border: 1px solid #ddd;
-    }
+// ::v-deep .el-tree--highlight-current {
+//
+// }
+::v-deep .el-tree--highlight-current {
+  height: 500px;
+}
+.el-icon-caret-right {
+  color: #ccc;
+  margin: 0 5px;
+}
+.treebox {
+  border: 1px solid #ddd;
+}
 </style>

+ 1 - 0
src/components/workflow.vue

@@ -471,6 +471,7 @@ export default {
       }).then((res) => {
         console.log(res);
         if (status === 2) {
+          console.log(777);
           this.treeCopyList = res.data; //抄送
           //  this.$refs.defTrees.treeList = res.data;
         } else {

+ 2 - 2
src/pages/main/leader/demand/demandHome.vue

@@ -196,8 +196,8 @@ export default {
         processDefinitionKey: "request_form_process",
       },
       requestForm: {
-        // fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
-        fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
+        fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
+        // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
         // fresourceId:'81455799-600d-11ed-b399-e00084564cce',//生产环境
         processDefinitionKey: "request_form_process",
       },

+ 2 - 2
vue.config.js

@@ -133,10 +133,10 @@ module.exports = {
                 // target: 'http://192.168.1.9:9600/spfm',
                 // target: 'http://127.0.0.1:9600/',
                 // target: 'http://192.168.0.156:9600/',
-                // target: 'http://192.168.2.170:9600/',
+                target: 'http://192.168.2.66:9600/',
                 // target: 'http://192.168.2.124:9600/',
                 // target: "http://124.223.66.248:9600",
-                target: "http://43.138.50.94:9600",
+                // target: "http://43.138.50.94:9600",
                 changeOrigin: true,
             },
         },