|
|
@@ -49,7 +49,7 @@
|
|
|
node-key="id"
|
|
|
:props="{ label: 'name', children: 'sonDirectoryList' }"
|
|
|
:expand-on-click-node="false"
|
|
|
- :default-expanded-keys="['0','1']"
|
|
|
+ :default-expanded-keys="defaultExpandedKeys"
|
|
|
@node-click="onNodeClick"
|
|
|
>
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
@@ -88,162 +88,166 @@
|
|
|
<!-- <folder-edit @done="query" ref="editRef" :fileType="fileType" /> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
- <script>
|
|
|
-// import fileTableList from '@/views/doc/components/file-table-list.vue';
|
|
|
-import codeList from './codeList.vue';
|
|
|
-import codeSegmentList from './codeSegmentList.vue';
|
|
|
-import codeValueList from './codeValueList.vue';
|
|
|
-import { selectTreeList } from '@/api/businessCode';
|
|
|
-// import { mapGetters } from 'vuex';
|
|
|
|
|
|
-export default {
|
|
|
- components: { codeList, codeSegmentList, codeValueList },
|
|
|
+<script>
|
|
|
+ // import fileTableList from '@/views/doc/components/file-table-list.vue';
|
|
|
+ import codeList from './codeList.vue';
|
|
|
+ import codeSegmentList from './codeSegmentList.vue';
|
|
|
+ import codeValueList from './codeValueList.vue';
|
|
|
+ import { selectTreeList } from '@/api/businessCode';
|
|
|
+ // import { mapGetters } from 'vuex';
|
|
|
|
|
|
- data() {
|
|
|
- return {
|
|
|
- rightData: {},
|
|
|
- // 加载状态
|
|
|
- loading: true,
|
|
|
- // 列表数据
|
|
|
- data: [],
|
|
|
- institutionList: [],
|
|
|
- // 选中数据
|
|
|
- current: {},
|
|
|
- // 是否显示表单弹窗
|
|
|
- showFolderEditFlag: false,
|
|
|
- // 编辑回显数据
|
|
|
- editData: null,
|
|
|
- // 上级id
|
|
|
- parentId: null
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // ...mapGetters(['user'])
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.query();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 查询 */
|
|
|
- async query(row) {
|
|
|
- this.loading = true;
|
|
|
- this.data = await selectTreeList();
|
|
|
- this.setTree(this.data);
|
|
|
- this.$nextTick(() => {
|
|
|
- if (row) {
|
|
|
- this.$refs.tree.setCurrentKey(row.id);
|
|
|
- this.onNodeClick(row);
|
|
|
- } else {
|
|
|
- this.$refs.tree.setCurrentKey(this.data[0].id);
|
|
|
- this.onNodeClick(this.data[0]);
|
|
|
- }
|
|
|
- });
|
|
|
- this.loading = false;
|
|
|
+ export default {
|
|
|
+ components: { codeList, codeSegmentList, codeValueList },
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ rightData: {},
|
|
|
+ // 加载状态
|
|
|
+ loading: true,
|
|
|
+ // 列表数据
|
|
|
+ data: [],
|
|
|
+ institutionList: [],
|
|
|
+ // 选中数据
|
|
|
+ current: {},
|
|
|
+ // 是否显示表单弹窗
|
|
|
+ showFolderEditFlag: false,
|
|
|
+ // 编辑回显数据
|
|
|
+ editData: null,
|
|
|
+ // 上级id
|
|
|
+ parentId: null,
|
|
|
+ defaultExpandedKeys: ['0','1']
|
|
|
+ };
|
|
|
},
|
|
|
- setTree(data) {
|
|
|
- data.forEach((item) => {
|
|
|
- if (item.codeManageVOList && item.codeManageVOList.length > 0) {
|
|
|
- item.sonDirectoryList = item.codeManageVOList;
|
|
|
- item.codeManageVOList.forEach((val) => {
|
|
|
- val['type'] = 3;
|
|
|
- });
|
|
|
- }
|
|
|
- if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
|
|
|
- this.setTree(item.sonDirectoryList);
|
|
|
- }
|
|
|
- });
|
|
|
+ computed: {
|
|
|
+ // ...mapGetters(['user'])
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.query();
|
|
|
},
|
|
|
- /* 选择数据 */
|
|
|
- onNodeClick(row) {
|
|
|
- if (row) {
|
|
|
- this.current = row;
|
|
|
+ methods: {
|
|
|
+ /* 查询 */
|
|
|
+ async query(row) {
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ this.data = await selectTreeList();
|
|
|
+ this.setTree(this.data);
|
|
|
+ console.log(row);
|
|
|
this.$nextTick(() => {
|
|
|
- if (this.current.type == 1) {
|
|
|
- this.$refs.tableRef1.reload();
|
|
|
+ if (row) {
|
|
|
+ this.$refs.tree.setCurrentKey(row.id);
|
|
|
+ this.defaultExpandedKeys = [row.id];
|
|
|
+ this.onNodeClick(row);
|
|
|
+ } else {
|
|
|
+ this.$refs.tree.setCurrentKey(this.data[0].id);
|
|
|
+ this.onNodeClick(this.data[0]);
|
|
|
}
|
|
|
- if (this.current.type == 2 && this.$refs.tableRef2) {
|
|
|
- this.$refs.tableRef2.reload();
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ setTree(data) {
|
|
|
+ data.forEach((item) => {
|
|
|
+ if (item.codeManageVOList && item.codeManageVOList.length > 0) {
|
|
|
+ item.sonDirectoryList = item.codeManageVOList;
|
|
|
+ item.codeManageVOList.forEach((val) => {
|
|
|
+ val['type'] = 3;
|
|
|
+ });
|
|
|
}
|
|
|
- if (this.current.type == 3 && this.$refs.tableRef3) {
|
|
|
- this.$refs.tableRef3.reload();
|
|
|
+ if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
|
|
|
+ this.setTree(item.sonDirectoryList);
|
|
|
}
|
|
|
});
|
|
|
- } else {
|
|
|
- this.current = null;
|
|
|
- }
|
|
|
- },
|
|
|
- done(row) {
|
|
|
- this.query(row);
|
|
|
- },
|
|
|
- /* 显示编辑 */
|
|
|
- openEdit(type) {
|
|
|
- if (type == 'del') {
|
|
|
- this.remove();
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$refs.editRef.open(
|
|
|
- type,
|
|
|
- JSON.parse(JSON.stringify(this.current)),
|
|
|
- this.data
|
|
|
- );
|
|
|
- },
|
|
|
- /* 删除 */
|
|
|
- remove() {
|
|
|
- this.$confirm('确定要删除选中文件夹吗?', '提示', {
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
- directoryDeleteAPI([this.current.id])
|
|
|
- .then((msg) => {
|
|
|
- loading.close();
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.query();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
+ },
|
|
|
+ /* 选择数据 */
|
|
|
+ onNodeClick(row) {
|
|
|
+ if (row) {
|
|
|
+ this.current = row;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.current.type == 1) {
|
|
|
+ this.$refs.tableRef1.reload();
|
|
|
+ }
|
|
|
+ if (this.current.type == 2 && this.$refs.tableRef2) {
|
|
|
+ this.$refs.tableRef2.reload();
|
|
|
+ }
|
|
|
+ if (this.current.type == 3 && this.$refs.tableRef3) {
|
|
|
+ this.$refs.tableRef3.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.current = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ done(row) {
|
|
|
+ this.query(row);
|
|
|
+ },
|
|
|
+ /* 显示编辑 */
|
|
|
+ openEdit(type) {
|
|
|
+ if (type == 'del') {
|
|
|
+ this.remove();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.editRef.open(
|
|
|
+ type,
|
|
|
+ JSON.parse(JSON.stringify(this.current)),
|
|
|
+ this.data
|
|
|
+ );
|
|
|
+ },
|
|
|
+ /* 删除 */
|
|
|
+ remove() {
|
|
|
+ this.$confirm('确定要删除选中文件夹吗?', '提示', {
|
|
|
+ type: 'warning'
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .then(() => {
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
+ directoryDeleteAPI([this.current.id])
|
|
|
+ .then((msg) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.query();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
-
|
|
|
- <style lang="scss" scoped>
|
|
|
-.sys-organization-list {
|
|
|
- height: calc(100vh - 180px);
|
|
|
- box-sizing: border-box;
|
|
|
- border-width: 1px;
|
|
|
- border-style: solid;
|
|
|
- overflow: auto;
|
|
|
-}
|
|
|
-.sys-organization-list :deep(.el-tree-node__content) {
|
|
|
- height: 30px;
|
|
|
|
|
|
- & > .el-tree-node__expand-icon {
|
|
|
- margin-left: 10px;
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .sys-organization-list {
|
|
|
+ height: calc(100vh - 180px);
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-width: 1px;
|
|
|
+ border-style: solid;
|
|
|
+ overflow: auto;
|
|
|
}
|
|
|
-}
|
|
|
-.custom-tree-node {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- img {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- margin-right: 2px;
|
|
|
+ .sys-organization-list :deep(.el-tree-node__content) {
|
|
|
+ height: 30px;
|
|
|
+
|
|
|
+ & > .el-tree-node__expand-icon {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .custom-tree-node {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ img {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ margin-right: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ :deep(.el-popover) {
|
|
|
+ min-width: 50px;
|
|
|
+ }
|
|
|
+ :deep(.ele-split-panel-side .ele-table-tool-default) {
|
|
|
+ display: none;
|
|
|
}
|
|
|
-}
|
|
|
-:deep(.el-popover) {
|
|
|
- min-width: 50px;
|
|
|
-}
|
|
|
-:deep(.ele-split-panel-side .ele-table-tool-default) {
|
|
|
- display: none;
|
|
|
-}
|
|
|
</style>
|
|
|
<style>
|
|
|
-.el-input.is-disabled .el-input__inner {
|
|
|
- color: #606266;
|
|
|
-}
|
|
|
-</style>
|
|
|
+ .el-input.is-disabled .el-input__inner {
|
|
|
+ color: #606266;
|
|
|
+ }
|
|
|
+</style>
|