|
@@ -8,9 +8,10 @@
|
|
|
v-model="folderInfo.stageId"
|
|
v-model="folderInfo.stageId"
|
|
|
remote
|
|
remote
|
|
|
filterable
|
|
filterable
|
|
|
|
|
+ style="width: 200px"
|
|
|
clearable
|
|
clearable
|
|
|
placeholder="筛选项目阶段"
|
|
placeholder="筛选项目阶段"
|
|
|
- style="width: 100%"
|
|
|
|
|
|
|
+ :disabled="!top"
|
|
|
@change="folderResult"
|
|
@change="folderResult"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
@@ -60,27 +61,44 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-breadcrumb separator-icon="ArrowRight" class="mt-20 main-color">
|
|
|
|
|
- <el-breadcrumb-item>
|
|
|
|
|
- <div class="pointer" @click="getFolderList">全部文件</div>
|
|
|
|
|
- </el-breadcrumb-item>
|
|
|
|
|
- </el-breadcrumb>
|
|
|
|
|
|
|
+ <file-way
|
|
|
|
|
+ :next="currentFolder"
|
|
|
|
|
+ @before="goBefore"
|
|
|
|
|
+ @goHome="getFolderList"
|
|
|
|
|
+ class="mt-20"
|
|
|
|
|
+ />
|
|
|
<xtable
|
|
<xtable
|
|
|
:data="data"
|
|
:data="data"
|
|
|
- :option="top ? option : option2"
|
|
|
|
|
|
|
+ :option="option"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
- :total="page.total"
|
|
|
|
|
|
|
+ :page="page"
|
|
|
@row-click="getFileList"
|
|
@row-click="getFileList"
|
|
|
@current-change="currentChange"
|
|
@current-change="currentChange"
|
|
|
|
|
+ @refresh="refreshData"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template #menu="{ row }">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="row.type === 2"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ text
|
|
|
|
|
+ @click="renameFolder(row)"
|
|
|
|
|
+ >重命名
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
</xtable>
|
|
</xtable>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
- <el-dialog v-model="show" :title="title" :width="width">
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="show"
|
|
|
|
|
+ :title="title"
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ @close="closeDialog"
|
|
|
|
|
+ >
|
|
|
<floder
|
|
<floder
|
|
|
v-if="showType === 1"
|
|
v-if="showType === 1"
|
|
|
:info="folderInfo"
|
|
:info="folderInfo"
|
|
|
|
|
+ :rename="rename"
|
|
|
@close="closeDialog"
|
|
@close="closeDialog"
|
|
|
></floder>
|
|
></floder>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -100,6 +118,7 @@ import xtable from '@/views/resource/component/xtable.vue'
|
|
|
import floder from '@/views/resource/component/floder.vue'
|
|
import floder from '@/views/resource/component/floder.vue'
|
|
|
import uploadFile from '@/components/upload-file/index.vue'
|
|
import uploadFile from '@/components/upload-file/index.vue'
|
|
|
import filepicker from '@/components/filepicker/index.vue'
|
|
import filepicker from '@/components/filepicker/index.vue'
|
|
|
|
|
+import fileWay from '@/components/file-way/index.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -107,7 +126,8 @@ export default {
|
|
|
xtable,
|
|
xtable,
|
|
|
floder,
|
|
floder,
|
|
|
uploadFile,
|
|
uploadFile,
|
|
|
- filepicker
|
|
|
|
|
|
|
+ filepicker,
|
|
|
|
|
+ fileWay
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
data() {
|
|
@@ -116,6 +136,7 @@ export default {
|
|
|
showType: 1,
|
|
showType: 1,
|
|
|
width: 380,
|
|
width: 380,
|
|
|
title: '新建文件夹',
|
|
title: '新建文件夹',
|
|
|
|
|
+ rename: false,
|
|
|
top: true,
|
|
top: true,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
currentFolder: null,
|
|
currentFolder: null,
|
|
@@ -129,20 +150,12 @@ export default {
|
|
|
width: 270
|
|
width: 270
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '所属阶段',
|
|
|
|
|
- prop: 'stageName'
|
|
|
|
|
|
|
+ label: '上传人',
|
|
|
|
|
+ prop: 'createUserName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '创建时间',
|
|
|
|
|
|
|
+ label: '上传时间',
|
|
|
prop: 'createTime'
|
|
prop: 'createTime'
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '归档位置',
|
|
|
|
|
- prop: 'roleName'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '创建人',
|
|
|
|
|
- prop: 'createUserName'
|
|
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -180,11 +193,12 @@ export default {
|
|
|
showDialog(type) {
|
|
showDialog(type) {
|
|
|
this.showType = type
|
|
this.showType = type
|
|
|
this.show = true
|
|
this.show = true
|
|
|
|
|
+ this.title = '新建文件夹'
|
|
|
},
|
|
},
|
|
|
folderAdd() {
|
|
folderAdd() {
|
|
|
this.$api.resource.folderAddUpdate().then(res => {
|
|
this.$api.resource.folderAddUpdate().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- console.log(res)
|
|
|
|
|
|
|
+ this.refreshData()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -193,9 +207,12 @@ export default {
|
|
|
if (this.top) {
|
|
if (this.top) {
|
|
|
this.getFolderList()
|
|
this.getFolderList()
|
|
|
} else {
|
|
} else {
|
|
|
- this.getFileList()
|
|
|
|
|
|
|
+ this.getFileList(this.currentFolder)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取阶段对应的一级文件夹
|
|
|
|
|
+ */
|
|
|
getFolderList() {
|
|
getFolderList() {
|
|
|
const data = {
|
|
const data = {
|
|
|
stageId: this.folderInfo.stageId,
|
|
stageId: this.folderInfo.stageId,
|
|
@@ -210,13 +227,18 @@ export default {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
this.data = res.data.records
|
|
|
this.page.total = res.data.total
|
|
this.page.total = res.data.total
|
|
|
- this.total = res.data.total
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取二级文件
|
|
|
|
|
+ * @param row
|
|
|
|
|
+ */
|
|
|
getFileList(row) {
|
|
getFileList(row) {
|
|
|
|
|
+ this.data.length = 0
|
|
|
|
|
+ this.currentFolder = row
|
|
|
this.folderInfo = Object.assign(this.folderInfo, row)
|
|
this.folderInfo = Object.assign(this.folderInfo, row)
|
|
|
- this.top = !this.top
|
|
|
|
|
|
|
+ this.top = false
|
|
|
const data = {
|
|
const data = {
|
|
|
id: row.id,
|
|
id: row.id,
|
|
|
current: this.page.current,
|
|
current: this.page.current,
|
|
@@ -227,6 +249,7 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
this.data = res.data.records
|
|
|
|
|
+ this.page.total = res.data.total
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
}
|
|
@@ -257,19 +280,34 @@ export default {
|
|
|
this.stageId = res
|
|
this.stageId = res
|
|
|
this.getFolderList()
|
|
this.getFolderList()
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 文件上传成功侯刷新文件列表,上传文件的按钮,不出现在顶级目录,所以刷新下级就行
|
|
|
|
|
+ * @param files
|
|
|
|
|
+ */
|
|
|
uploadSuccess(files) {
|
|
uploadSuccess(files) {
|
|
|
- console.log('refresh')
|
|
|
|
|
|
|
+ this.getFileList(this.currentFolder)
|
|
|
},
|
|
},
|
|
|
refreshData() {
|
|
refreshData() {
|
|
|
if (this.top) {
|
|
if (this.top) {
|
|
|
this.getFolderList()
|
|
this.getFolderList()
|
|
|
} else {
|
|
} else {
|
|
|
- this.getFileList()
|
|
|
|
|
|
|
+ this.getFileList(this.currentFolder)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
currentChange(current) {
|
|
currentChange(current) {
|
|
|
this.page.current = current
|
|
this.page.current = current
|
|
|
this.refreshData()
|
|
this.refreshData()
|
|
|
|
|
+ },
|
|
|
|
|
+ goBefore(res) {
|
|
|
|
|
+ this.currentFolder = res
|
|
|
|
|
+ this.refreshData()
|
|
|
|
|
+ },
|
|
|
|
|
+ renameFolder(res) {
|
|
|
|
|
+ this.rename = true
|
|
|
|
|
+ this.title = '重命名文件夹'
|
|
|
|
|
+ this.show = true
|
|
|
|
|
+ this.showType = 1
|
|
|
|
|
+ this.folderInfo = res
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -277,6 +315,6 @@ export default {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.content {
|
|
.content {
|
|
|
- height: calc(100vh - 180px);
|
|
|
|
|
|
|
+ height: auth;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|