forked from zhurui/management
1 line
7.1 KiB
JSON
1 line
7.1 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\ren-dept-tree\\src\\ren-dept-tree.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\ren-dept-tree\\src\\ren-dept-tree.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\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//\n//\n//\n//\n\nexport default {\n name: 'RenDeptTree',\n data () {\n return {\n filterText: '',\n visibleDept: false,\n deptList: [],\n showDeptName: '',\n expandedKeys: null,\n defaultProps: {\n children: 'children',\n label: 'label'\n }\n }\n },\n props: {\n value: [Number, String],\n deptName: String,\n query: Boolean,\n placeholder: String\n },\n watch: {\n filterText (val) {\n this.$refs.tree.filter(val)\n },\n deptName (val) {\n this.showDeptName = val\n }\n },\n methods: {\n deptDialog () {\n this.expandedKeys = null\n if (this.$refs.tree) {\n this.$refs.tree.setCurrentKey(null)\n }\n this.visibleDept = true\n this.getDeptList(this.value)\n },\n filterNode (value, data) {\n if (!value) return true\n return data.name.indexOf(value) !== -1\n },\n getDeptList (id) {\n return this.$http.get('/sys/dept/list').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.deptList = res.data\n this.$nextTick(() => {\n this.$refs.tree.setCurrentKey(id)\n this.expandedKeys = [id]\n })\n }).catch(() => {})\n },\n cancelHandle () {\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n },\n clearHandle () {\n this.$emit('input', '')\n this.$emit('update:deptName', '')\n this.showDeptName = ''\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n },\n commitHandle () {\n const node = this.$refs.tree.getCurrentNode()\n if (!node) {\n this.$message.error(this.$t('dept.chooseerror'))\n return\n }\n this.$emit('input', node.id)\n this.$emit('update:deptName', node.name)\n this.showDeptName = node.name\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n }\n }\n}\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>\n <div>\n <el-input v-model=\"showDeptName\" :placeholder=\"placeholder\" @focus=\"deptDialog\">\n <el-button slot=\"append\" icon=\"el-icon-search\" @click=\"deptDialog\"></el-button>\n </el-input>\n <el-input :value=\"value\" style=\"display: none\"></el-input>\n <el-dialog :visible.sync=\"visibleDept\" width=\"30%\" :modal=\"false\" :title=\"placeholder\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\n <el-form size=\"mini\" :inline=\"true\">\n <el-form-item :label=\"$t('keyword')\">\n <el-input v-model=\"filterText\"></el-input>\n </el-form-item>\n <el-form-item>\n <el-button type=\"default\">{{ $t('query') }}</el-button>\n </el-form-item>\n </el-form>\n <el-tree\n class=\"filter-tree\"\n :data=\"deptList\"\n :default-expanded-keys=\"expandedKeys\"\n :props=\"{ label: 'name', children: 'children' }\"\n :expand-on-click-node=\"false\"\n :filter-node-method=\"filterNode\"\n :highlight-current=\"true\"\n node-key=\"id\"\n ref=\"tree\">\n </el-tree>\n <template slot=\"footer\">\n <el-button type=\"default\" @click=\"cancelHandle()\" size=\"mini\">{{ $t('cancel') }}</el-button>\n <el-button v-if=\"query\" type=\"info\" @click=\"clearHandle()\" size=\"mini\">{{ $t('clear') }}</el-button>\n <el-button type=\"primary\" @click=\"commitHandle()\" size=\"mini\">{{ $t('confirm') }}</el-button>\n </template>\n </el-dialog>\n </div>\n</template>\n<script>\nexport default {\n name: 'RenDeptTree',\n data () {\n return {\n filterText: '',\n visibleDept: false,\n deptList: [],\n showDeptName: '',\n expandedKeys: null,\n defaultProps: {\n children: 'children',\n label: 'label'\n }\n }\n },\n props: {\n value: [Number, String],\n deptName: String,\n query: Boolean,\n placeholder: String\n },\n watch: {\n filterText (val) {\n this.$refs.tree.filter(val)\n },\n deptName (val) {\n this.showDeptName = val\n }\n },\n methods: {\n deptDialog () {\n this.expandedKeys = null\n if (this.$refs.tree) {\n this.$refs.tree.setCurrentKey(null)\n }\n this.visibleDept = true\n this.getDeptList(this.value)\n },\n filterNode (value, data) {\n if (!value) return true\n return data.name.indexOf(value) !== -1\n },\n getDeptList (id) {\n return this.$http.get('/sys/dept/list').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.deptList = res.data\n this.$nextTick(() => {\n this.$refs.tree.setCurrentKey(id)\n this.expandedKeys = [id]\n })\n }).catch(() => {})\n },\n cancelHandle () {\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n },\n clearHandle () {\n this.$emit('input', '')\n this.$emit('update:deptName', '')\n this.showDeptName = ''\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n },\n commitHandle () {\n const node = this.$refs.tree.getCurrentNode()\n if (!node) {\n this.$message.error(this.$t('dept.chooseerror'))\n return\n }\n this.$emit('input', node.id)\n this.$emit('update:deptName', node.name)\n this.showDeptName = node.name\n this.visibleDept = false\n this.deptList = []\n this.filterText = ''\n }\n }\n}\n</script>\n"]}]} |