|
|
@@ -12,6 +12,15 @@
|
|
|
:maxable="true"
|
|
|
:resizable="true"
|
|
|
>
|
|
|
+ <el-tabs
|
|
|
+ v-model="activeName"
|
|
|
+ type="card"
|
|
|
+ @tab-click="handleClick"
|
|
|
+ style="margin-bottom: 10px"
|
|
|
+ >
|
|
|
+ <el-tab-pane label="文档工作区" name="1"></el-tab-pane>
|
|
|
+ <el-tab-pane label="个人文档" name="2"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="82px">
|
|
|
<el-row :gutter="15">
|
|
|
<el-col :span="24">
|
|
|
@@ -139,6 +148,7 @@
|
|
|
fileType: 0
|
|
|
};
|
|
|
return {
|
|
|
+ activeName: '1',
|
|
|
rules: {
|
|
|
businessCodeId: [
|
|
|
{ required: true, message: '请选择', trigger: 'blur' }
|
|
|
@@ -149,6 +159,8 @@
|
|
|
},
|
|
|
templateVisible: false,
|
|
|
folderList: [],
|
|
|
+ allFolderList: [],
|
|
|
+ myFolderList: [],
|
|
|
list: [],
|
|
|
options: [],
|
|
|
defaultForm,
|
|
|
@@ -172,19 +184,34 @@
|
|
|
...mapGetters(['user'])
|
|
|
},
|
|
|
async created() {
|
|
|
- let query = {
|
|
|
+ this.allFolderList = await getDocTreeListAPI({
|
|
|
type: 0,
|
|
|
currentUserId: this.user.info.userId
|
|
|
- };
|
|
|
- this.folderList = await getDocTreeListAPI(query);
|
|
|
+ });
|
|
|
+ this.myFolderList = await getDocTreeListAPI({
|
|
|
+ type: 1,
|
|
|
+ currentUserId: this.user.info.userId
|
|
|
+ });
|
|
|
+ this.folderList = this.allFolderList;
|
|
|
setFolderList(this.folderList); //权限过滤
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleClick() {
|
|
|
+ this.form.directoryId = '';
|
|
|
+ this.form.businessCodeId = '';
|
|
|
+ this.form.codeType = '';
|
|
|
+ if (this.activeName == 2) {
|
|
|
+ this.folderList = this.myFolderList;
|
|
|
+ } else {
|
|
|
+ this.folderList = this.allFolderList;
|
|
|
+ }
|
|
|
+ },
|
|
|
async getTreeCode() {
|
|
|
let nodeData = {};
|
|
|
await this.$nextTick(() => {
|
|
|
// console.log(this.$refs,'this.$refs')
|
|
|
- nodeData = this.$refs.cascaderRef&&this.$refs.cascaderRef.getCheckedNodes();
|
|
|
+ nodeData =
|
|
|
+ this.$refs.cascaderRef && this.$refs.cascaderRef.getCheckedNodes();
|
|
|
});
|
|
|
this.nodeData = {
|
|
|
id: nodeData[0]?.data?.id,
|
|
|
@@ -222,13 +249,16 @@
|
|
|
});
|
|
|
},
|
|
|
async typeChange(val) {
|
|
|
- let data = await listParentId({
|
|
|
+ let obj = {
|
|
|
pageNum: 1,
|
|
|
size: 100,
|
|
|
- parentId: val,
|
|
|
- objId: this.nodeData?.id,
|
|
|
- objParentId: this.nodeData?.parentId
|
|
|
- });
|
|
|
+ parentId: val
|
|
|
+ };
|
|
|
+ if (this.activeName == 1) {
|
|
|
+ obj['objId'] = this.nodeData?.id;
|
|
|
+ obj['objParentId'] = this.nodeData?.parentId;
|
|
|
+ }
|
|
|
+ let data = await listParentId(obj);
|
|
|
this.options = data.list.filter((item) => item.type == 2);
|
|
|
this.form.businessCodeId = '';
|
|
|
},
|
|
|
@@ -244,10 +274,12 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- const data = {
|
|
|
+ let data = {
|
|
|
...this.form
|
|
|
};
|
|
|
-
|
|
|
+ if (this.activeName == 2) {
|
|
|
+ data.fileType = 1;
|
|
|
+ }
|
|
|
this.loading = true;
|
|
|
fileSaveAPI(data)
|
|
|
.then((msg) => {
|