| 1 |
- {"remainingRequest":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\components\\ren-dept-tree\\src\\ren-dept-tree.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\components\\ren-dept-tree\\src\\ren-dept-tree.vue","mtime":1581948664000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["\r\nexport default {\r\n name: 'RenDeptTree',\r\n data () {\r\n return {\r\n filterText: '',\r\n visibleDept: false,\r\n deptList: [],\r\n showDeptName: '',\r\n expandedKeys: null,\r\n defaultProps: {\r\n children: 'children',\r\n label: 'label'\r\n }\r\n }\r\n },\r\n props: {\r\n value: [Number, String],\r\n deptName: String,\r\n query: Boolean,\r\n placeholder: String\r\n },\r\n watch: {\r\n filterText (val) {\r\n this.$refs.tree.filter(val)\r\n },\r\n deptName (val) {\r\n this.showDeptName = val\r\n }\r\n },\r\n methods: {\r\n deptDialog () {\r\n this.expandedKeys = null\r\n if (this.$refs.tree) {\r\n this.$refs.tree.setCurrentKey(null)\r\n }\r\n this.visibleDept = true\r\n this.getDeptList(this.value)\r\n },\r\n filterNode (value, data) {\r\n if (!value) return true\r\n return data.name.indexOf(value) !== -1\r\n },\r\n getDeptList (id) {\r\n return this.$http.get('/sys/dept/list').then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.deptList = res.data\r\n this.$nextTick(() => {\r\n this.$refs.tree.setCurrentKey(id)\r\n this.expandedKeys = [id]\r\n })\r\n }).catch(() => {})\r\n },\r\n cancelHandle () {\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n },\r\n clearHandle () {\r\n this.$emit('input', '')\r\n this.$emit('update:deptName', '')\r\n this.showDeptName = ''\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n },\r\n commitHandle () {\r\n const node = this.$refs.tree.getCurrentNode()\r\n if (!node) {\r\n this.$message.error(this.$t('dept.chooseerror'))\r\n return\r\n }\r\n this.$emit('input', node.id)\r\n this.$emit('update:deptName', node.name)\r\n this.showDeptName = node.name\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n }\r\n }\r\n}\r\n",{"version":3,"sources":["ren-dept-tree.vue"],"names":[],"mappings":";AAmCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"ren-dept-tree.vue","sourceRoot":"src/components/ren-dept-tree/src","sourcesContent":["<template>\r\n <div>\r\n <el-input v-model=\"showDeptName\" :placeholder=\"placeholder\" @focus=\"deptDialog\">\r\n <el-button slot=\"append\" icon=\"el-icon-search\" @click=\"deptDialog\"></el-button>\r\n </el-input>\r\n <el-input :value=\"value\" style=\"display: none\"></el-input>\r\n <el-dialog :visible.sync=\"visibleDept\" width=\"30%\" :modal=\"false\" :title=\"placeholder\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\r\n <el-form size=\"mini\" :inline=\"true\">\r\n <el-form-item :label=\"$t('keyword')\">\r\n <el-input v-model=\"filterText\"></el-input>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button type=\"default\">{{ $t('query') }}</el-button>\r\n </el-form-item>\r\n </el-form>\r\n <el-tree\r\n class=\"filter-tree\"\r\n :data=\"deptList\"\r\n :default-expanded-keys=\"expandedKeys\"\r\n :props=\"{ label: 'name', children: 'children' }\"\r\n :expand-on-click-node=\"false\"\r\n :filter-node-method=\"filterNode\"\r\n :highlight-current=\"true\"\r\n node-key=\"id\"\r\n ref=\"tree\">\r\n </el-tree>\r\n <template slot=\"footer\">\r\n <el-button type=\"default\" @click=\"cancelHandle()\" size=\"mini\">{{ $t('cancel') }}</el-button>\r\n <el-button v-if=\"query\" type=\"info\" @click=\"clearHandle()\" size=\"mini\">{{ $t('clear') }}</el-button>\r\n <el-button type=\"primary\" @click=\"commitHandle()\" size=\"mini\">{{ $t('confirm') }}</el-button>\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n<script>\r\nexport default {\r\n name: 'RenDeptTree',\r\n data () {\r\n return {\r\n filterText: '',\r\n visibleDept: false,\r\n deptList: [],\r\n showDeptName: '',\r\n expandedKeys: null,\r\n defaultProps: {\r\n children: 'children',\r\n label: 'label'\r\n }\r\n }\r\n },\r\n props: {\r\n value: [Number, String],\r\n deptName: String,\r\n query: Boolean,\r\n placeholder: String\r\n },\r\n watch: {\r\n filterText (val) {\r\n this.$refs.tree.filter(val)\r\n },\r\n deptName (val) {\r\n this.showDeptName = val\r\n }\r\n },\r\n methods: {\r\n deptDialog () {\r\n this.expandedKeys = null\r\n if (this.$refs.tree) {\r\n this.$refs.tree.setCurrentKey(null)\r\n }\r\n this.visibleDept = true\r\n this.getDeptList(this.value)\r\n },\r\n filterNode (value, data) {\r\n if (!value) return true\r\n return data.name.indexOf(value) !== -1\r\n },\r\n getDeptList (id) {\r\n return this.$http.get('/sys/dept/list').then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.deptList = res.data\r\n this.$nextTick(() => {\r\n this.$refs.tree.setCurrentKey(id)\r\n this.expandedKeys = [id]\r\n })\r\n }).catch(() => {})\r\n },\r\n cancelHandle () {\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n },\r\n clearHandle () {\r\n this.$emit('input', '')\r\n this.$emit('update:deptName', '')\r\n this.showDeptName = ''\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n },\r\n commitHandle () {\r\n const node = this.$refs.tree.getCurrentNode()\r\n if (!node) {\r\n this.$message.error(this.$t('dept.chooseerror'))\r\n return\r\n }\r\n this.$emit('input', node.id)\r\n this.$emit('update:deptName', node.name)\r\n this.showDeptName = node.name\r\n this.visibleDept = false\r\n this.deptList = []\r\n this.filterText = ''\r\n }\r\n }\r\n}\r\n</script>\r\n"]}]}
|