|
|
@@ -10,7 +10,6 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
placeholder="筛选项目阶段"
|
|
|
- :remote-method="remoteMethod"
|
|
|
style="width: 100%"
|
|
|
@change="folderResult"
|
|
|
>
|
|
|
@@ -27,15 +26,30 @@
|
|
|
</tips-custom>
|
|
|
<!-- content-->
|
|
|
<el-card shadow="hover" class="content">
|
|
|
- <div v-if="top">
|
|
|
+ <div>
|
|
|
<div class="full-width flex flex-center flex-justify-between">
|
|
|
- <div class="full-width flex flex-justify-start flex-align-center">
|
|
|
- <base-button
|
|
|
- title="新建文件夹"
|
|
|
- icon="Plus"
|
|
|
+ <div class="full-width flex flex-justify-start flex-center">
|
|
|
+ <upload-file
|
|
|
+ v-if="!top"
|
|
|
+ @on-success="uploadSuccess"
|
|
|
+ :project-id="folderInfo.projectId"
|
|
|
+ :stage-id="folderInfo.stageId"
|
|
|
+ :parent-id="currentFolder !== null ? currentFolder.id : ''"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ class="ml-10"
|
|
|
+ type="primary"
|
|
|
+ icon="Folder"
|
|
|
+ :plain="!top"
|
|
|
@click="showDialog(1)"
|
|
|
+ >新建文件夹
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" plain icon="User">批量授权</el-button>
|
|
|
+ <filepicker
|
|
|
+ class="ml-10"
|
|
|
+ :project-id="folderInfo.projectId"
|
|
|
+ :stage-id="folderInfo.stageId"
|
|
|
/>
|
|
|
- <base-button title="批量授权" icon="User" />
|
|
|
</div>
|
|
|
<div class="flex flex-center">
|
|
|
<span class="nowrap mr-10">文件搜索</span>
|
|
|
@@ -46,50 +60,19 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-breadcrumb
|
|
|
- separator-icon="ArrowRight"
|
|
|
- class="mt-20 main-color pointer"
|
|
|
- >
|
|
|
- <el-breadcrumb-item>提示说明</el-breadcrumb-item>
|
|
|
- </el-breadcrumb>
|
|
|
- <xtable :data="data" :option="option" @row-click="folderOpen">
|
|
|
- <template #row="{ row, ele }">
|
|
|
- <div class="flex">
|
|
|
- {{ row[ele.prop] }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </xtable>
|
|
|
- </div>
|
|
|
- <!-- 下级目录-->
|
|
|
- <div v-else>
|
|
|
- <div class="full-width flex flex-center flex-justify-between">
|
|
|
- <div class="full-width flex flex-justify-start flex-align-center">
|
|
|
- <el-button type="primary">上传</el-button>
|
|
|
- <el-button type="primary" plain>新建文件夹</el-button>
|
|
|
- <el-button type="primary" plain>批量授权</el-button>
|
|
|
- </div>
|
|
|
- <el-button round icon="el-icon-search" />
|
|
|
- </div>
|
|
|
- <el-breadcrumb
|
|
|
- separator-icon="ArrowRight"
|
|
|
- class="mt-20 main-color pointer"
|
|
|
- >
|
|
|
- <el-breadcrumb-item @click="top = true"
|
|
|
- >返回上一层
|
|
|
+ <el-breadcrumb separator-icon="ArrowRight" class="mt-20 main-color">
|
|
|
+ <el-breadcrumb-item>
|
|
|
+ <div class="pointer" @click="getFolderList">全部文件</div>
|
|
|
</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item>全部文件</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item>{{ data.title }}</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
- <xtable :data="data" :option="option">
|
|
|
- <template #row="{ index, row, ele }">
|
|
|
- <div v-if="index === 0" class="light-purple-bg flex flex-center">
|
|
|
- <img src="@/assets/svg/folder/edit.svg" style="width: 40px" />
|
|
|
- <div>
|
|
|
- {{ row[ele.prop] }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-empty v-else />
|
|
|
- </template>
|
|
|
+ <xtable
|
|
|
+ :data="data"
|
|
|
+ :option="top ? option : option2"
|
|
|
+ :loading="loading"
|
|
|
+ :total="page.total"
|
|
|
+ @row-click="getFileList"
|
|
|
+ @current-change="currentChange"
|
|
|
+ >
|
|
|
</xtable>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -98,7 +81,7 @@
|
|
|
<floder
|
|
|
v-if="showType === 1"
|
|
|
:info="folderInfo"
|
|
|
- @close="colseDialog"
|
|
|
+ @close="closeDialog"
|
|
|
></floder>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -115,14 +98,16 @@ meta: { 'show': false }
|
|
|
import tipsCustom from '@/components/tips-custom/index.vue'
|
|
|
import xtable from '@/views/resource/component/xtable.vue'
|
|
|
import floder from '@/views/resource/component/floder.vue'
|
|
|
-import baseButton from '@/components/base-button.vue'
|
|
|
+import uploadFile from '@/components/upload-file/index.vue'
|
|
|
+import filepicker from '@/components/filepicker/index.vue'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
tipsCustom,
|
|
|
xtable,
|
|
|
floder,
|
|
|
- baseButton
|
|
|
+ uploadFile,
|
|
|
+ filepicker
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
@@ -132,7 +117,9 @@ export default {
|
|
|
width: 380,
|
|
|
title: '新建文件夹',
|
|
|
top: true,
|
|
|
- data: [{ title: '@2' }, { title: '@3333', status: '555' }],
|
|
|
+ loading: false,
|
|
|
+ currentFolder: null,
|
|
|
+ data: [],
|
|
|
option: {
|
|
|
column: [
|
|
|
{
|
|
|
@@ -155,7 +142,20 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '创建人',
|
|
|
- prop: 'createUser'
|
|
|
+ prop: 'createUserName'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ option2: {
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '名称2',
|
|
|
+ prop: 'title',
|
|
|
+ display: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '创建人',
|
|
|
+ prop: 'createUserName'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -166,14 +166,14 @@ export default {
|
|
|
},
|
|
|
page: {
|
|
|
current: 1,
|
|
|
- size: 10
|
|
|
+ size: 10,
|
|
|
+ total: 0
|
|
|
},
|
|
|
total: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.folderInfo.projectId = this.$route.query.id
|
|
|
- this.getFolderList()
|
|
|
this.getStage()
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -181,28 +181,52 @@ export default {
|
|
|
this.showType = type
|
|
|
this.show = true
|
|
|
},
|
|
|
- colseDialog() {
|
|
|
+ folderAdd() {
|
|
|
+ this.$api.resource.folderAddUpdate().then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeDialog() {
|
|
|
this.show = false
|
|
|
+ if (this.top) {
|
|
|
+ this.getFolderList()
|
|
|
+ } else {
|
|
|
+ this.getFileList()
|
|
|
+ }
|
|
|
},
|
|
|
getFolderList() {
|
|
|
const data = {
|
|
|
stageId: this.folderInfo.stageId,
|
|
|
- dictKey: 1
|
|
|
+ dictKey: 1,
|
|
|
+ current: this.page.current,
|
|
|
+ size: this.page.size
|
|
|
}
|
|
|
- this.$api.project.folderList(Object.assign(data, this.page)).then(res => {
|
|
|
+ this.loading = true
|
|
|
+ this.top = true
|
|
|
+ this.$api.resource.folderList(data).then(res => {
|
|
|
+ this.loading = false
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
|
+ this.page.total = res.data.total
|
|
|
this.total = res.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- folderOpen(row) {
|
|
|
- console.log(row)
|
|
|
+ getFileList(row) {
|
|
|
+ this.folderInfo = Object.assign(this.folderInfo, row)
|
|
|
this.top = !this.top
|
|
|
- const data = { id: row.id, isHistory: 0 }
|
|
|
- this.$api.project.fileList(Object.assign(data, this.page)).then(res => {
|
|
|
+ const data = {
|
|
|
+ id: row.id,
|
|
|
+ current: this.page.current,
|
|
|
+ size: this.page.size
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ this.$api.resource.fileList(data).then(res => {
|
|
|
+ this.loading = false
|
|
|
if (res.code === 200) {
|
|
|
- this.data = res.data
|
|
|
+ this.data = res.data.records
|
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
@@ -217,12 +241,35 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.stage = res.data
|
|
|
+
|
|
|
+ const tmp = this.stage.find(ele => ele.isLastSelect === 1)
|
|
|
+ if (tmp) {
|
|
|
+ this.folderInfo.stageId = tmp.id
|
|
|
+ } else {
|
|
|
+ this.folderInfo.stageId = this.stage[0].id
|
|
|
+ }
|
|
|
+ this.getFolderList()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
folderResult(res) {
|
|
|
+ this.loading = true
|
|
|
this.stageId = res
|
|
|
this.getFolderList()
|
|
|
+ },
|
|
|
+ uploadSuccess(files) {
|
|
|
+ console.log('refresh')
|
|
|
+ },
|
|
|
+ refreshData() {
|
|
|
+ if (this.top) {
|
|
|
+ this.getFolderList()
|
|
|
+ } else {
|
|
|
+ this.getFileList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ currentChange(current) {
|
|
|
+ this.page.current = current
|
|
|
+ this.refreshData()
|
|
|
}
|
|
|
}
|
|
|
}
|