{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\flow\\flowTree.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\flow\\flowTree.vue","mtime":1667327529403},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { mapState, mapActions } from 'vuex';\nimport process from '@/api/process';\nexport default {\n  name: 'flowTree',\n  props: {\n    loadCount: Function,\n    isAsideShow: {\n      type: Boolean,\n      default: false\n    }\n  },\n  components: {},\n  data: function data() {\n    return {\n      isExpand: false,\n      filterText: '',\n      expandOnClickNode: false,\n      defaultProps: {\n        children: 'children',\n        label: 'name'\n      },\n      treeData: []\n    };\n  },\n  computed: _objectSpread({}, mapState('storeProcess', ['pagination'])),\n  watch: {\n    filterText: function filterText(val) {\n      this.$refs.tree.filter(val);\n    }\n  },\n  methods: {\n    //流程分类默认展开收起事件\n    handleValChange: function handleValChange(val) {\n      this.$emit('switch-change', val);\n    },\n    treeClick: function treeClick(n, i, e) {\n      this.$emit('currentTree', n);\n    },\n    //过滤函数\n    filterNode: function filterNode(value, data) {\n      if (!value) return true;\n      return data.name.indexOf(value) !== -1;\n    },\n    cancelCheck: function cancelCheck() {\n      this.$refs.tree.setCurrentKey(null);\n    },\n    getCountMap: function getCountMap(array) {\n      var map = {};\n      array.forEach(function (item) {\n        if (item.typeId === null) {\n          map[''] = item.count;\n        } else {\n          map[item.typeId] = item.count;\n        }\n      });\n      return map;\n    },\n    fillCountIntoTree: function fillCountIntoTree(tree, map) {\n      tree.count = map[tree.id] ? map[tree.id] : 0;\n      tree.name += ' ';\n\n      if (tree.children == null) {\n        return tree.count;\n      }\n\n      for (var i = 0; i < tree.children.length; i++) {\n        var child = tree.children[i];\n        var count = this.fillCountIntoTree(child, map);\n        tree.count += count;\n\n        if (count === 0) {\n          tree.children.remove(child);\n          i--;\n        }\n      }\n\n      return tree.count;\n    },\n    getTotal: function getTotal(data) {\n      var total = 0;\n      data.forEach(function (item) {\n        total += item.count;\n      });\n      return total;\n    }\n  },\n  created: function created() {\n    var _this = this;\n\n    this.isExpand = this.isAsideShow;\n    process.getFlowTree(function (response) {\n      _this.treeData = response.data;\n\n      _this.loadCount(_this.pagination).then(function (data) {\n        var map = _this.getCountMap(data);\n\n        _this.fillCountIntoTree(_this.treeData[0], map);\n\n        _this.treeData[0].count = _this.getTotal(data);\n      });\n      /*process.getCountByUserId(this.pagination).then(data=>{\r\n          let map = this.getCountMap(data);\r\n          this.fillCountIntoTree(this.treeData[0],map);\r\n          this.treeData[0].count += map[\"\"];\r\n        });*/\n\n    });\n  }\n};",null]}