|
|
@@ -1,83 +1,112 @@
|
|
|
<template>
|
|
|
- <el-row :gutter="8" class='mt-10'>
|
|
|
- <el-col :span="4">
|
|
|
- <basic-container style='min-height: 720px;padding-left: 0'>
|
|
|
- <div class='full-width flex flex-center flex-justify-between'>
|
|
|
- <span class='bold'>文件柜分类</span>
|
|
|
- <el-button type='primary' @click='addFolder'>新 增</el-button>
|
|
|
+ <el-row :gutter="8" class="mt-10">
|
|
|
+ <el-col :span="6">
|
|
|
+ <basic-container style="min-height: 720px; padding-left: 0">
|
|
|
+ <div class="full-width flex flex-center flex-justify-between">
|
|
|
+ <span class="bold">文件柜分类</span>
|
|
|
+ <el-button type="primary" @click="addFolder">新 增</el-button>
|
|
|
</div>
|
|
|
- <el-divider/>
|
|
|
- <div class='flex flex-col flex-justify-start flex-align-start padding' style='min-height: 900px'>
|
|
|
- <span class=' full-width' v-for='(item,index) in folders' :key='item.id'>
|
|
|
- <div class='item full-width flex flex-col pointer' :class='active === index ? "item-selected":"" '
|
|
|
- @click='changeFolder(index)'>
|
|
|
+ <el-divider />
|
|
|
+ <div
|
|
|
+ class="flex flex-col flex-justify-start flex-align-start padding"
|
|
|
+ style="min-height: 900px"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="full-width"
|
|
|
+ v-for="(item, index) in folders"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="item full-width flex flex-col pointer"
|
|
|
+ :class="active === index ? 'item-selected' : ''"
|
|
|
+ @click="changeFolder(index)"
|
|
|
+ >
|
|
|
{{ item.title }}
|
|
|
</div>
|
|
|
</span>
|
|
|
</div>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
|
- <el-col :span="20">
|
|
|
+ <el-col :span="18">
|
|
|
<basic-container class="grid-content bg-purple">
|
|
|
- <div class='flex flex-center flex-justify-between'>
|
|
|
- <div class='flex flex-center'>
|
|
|
- <base-button class="ml-20 " icon="Plus" title="上传文件"
|
|
|
- @click="show = true"/>
|
|
|
- <base-button class="ml-20 " icon="Back" title="返回上一层"
|
|
|
- v-if='currentFolder && currentFolder.parentId !== "0"'
|
|
|
- @click="backFolder"/>
|
|
|
+ <div class="flex flex-center flex-justify-between">
|
|
|
+ <div class="flex flex-center">
|
|
|
+ <base-button
|
|
|
+ class="ml-20"
|
|
|
+ icon="Plus"
|
|
|
+ title="上传文件"
|
|
|
+ @click="show = true"
|
|
|
+ />
|
|
|
+ <base-button
|
|
|
+ class="ml-20"
|
|
|
+ icon="Back"
|
|
|
+ title="返回上一层"
|
|
|
+ v-if="currentFolder && currentFolder.parentId !== '0'"
|
|
|
+ @click="backFolder"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
- <div class='flex flex-center'>
|
|
|
- <base-button class="ml-20 " icon="Plus" title="授权"
|
|
|
- @click="authorShow = true"/>
|
|
|
- <base-button class="ml-20 " icon="Plus" title="新建文件夹"
|
|
|
- @click="addSubFolder"/>
|
|
|
+ <div class="flex flex-center">
|
|
|
+ <base-button
|
|
|
+ class="ml-20"
|
|
|
+ icon="Plus"
|
|
|
+ title="授权"
|
|
|
+ @click="authorShow = true"
|
|
|
+ />
|
|
|
+ <base-button
|
|
|
+ class="ml-20"
|
|
|
+ icon="Plus"
|
|
|
+ title="新建文件夹"
|
|
|
+ @click="addSubFolder"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<basic-curd
|
|
|
- :option="option"
|
|
|
- :data="data"
|
|
|
- @row-view='rowDetail'
|
|
|
- @row-del="rowDel"
|
|
|
+ :option="option"
|
|
|
+ :data="data"
|
|
|
+ @row-view="rowDetail"
|
|
|
+ @row-del="rowDel"
|
|
|
></basic-curd>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
|
<!-- dialog-->
|
|
|
- <el-dialog v-model='show' title='上传文件'>
|
|
|
+ <el-dialog v-model="show" title="上传文件">
|
|
|
<div>
|
|
|
<el-upload
|
|
|
- drag
|
|
|
- :action="action"
|
|
|
- multiple
|
|
|
- accept='.doc,.docx,.pdf,.xls,.xlsx,.png,.jpg,.jpeg,.ppt,pptx'
|
|
|
- show-file-list
|
|
|
- :headers="{'Authorization':`Basic ${clientId}`}"
|
|
|
- :on-success='uploadSuccess'
|
|
|
+ drag
|
|
|
+ :action="action"
|
|
|
+ multiple
|
|
|
+ accept=".doc,.docx,.pdf,.xls,.xlsx,.png,.jpg,.jpeg,.ppt,pptx"
|
|
|
+ show-file-list
|
|
|
+ :headers="{ Authorization: `Basic ${clientId}` }"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
>
|
|
|
<el-icon class="el-icon--upload">
|
|
|
- <upload-filled/>
|
|
|
+ <upload-filled />
|
|
|
</el-icon>
|
|
|
- <div class="el-upload__text">
|
|
|
- 拖拽或者 <em>点击上传文件</em>
|
|
|
- </div>
|
|
|
+ <div class="el-upload__text">拖拽或者 <em>点击上传文件</em></div>
|
|
|
</el-upload>
|
|
|
- <el-divider/>
|
|
|
- <div class='flex flex-justify-end'>
|
|
|
- <el-button @click='show = false'>取 消</el-button>
|
|
|
- <el-button type='primary' @click='saveFile'>确 定</el-button>
|
|
|
+ <el-divider />
|
|
|
+ <div class="flex flex-justify-end">
|
|
|
+ <el-button @click="show = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveFile">确 定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-image-viewer
|
|
|
- v-if='showImage'
|
|
|
- :url-list="imgList"
|
|
|
- @close='showImage = false'
|
|
|
+ v-if="showImage"
|
|
|
+ :url-list="imgList"
|
|
|
+ @close="showImage = false"
|
|
|
/>
|
|
|
- <el-dialog v-model='authorShow' title='批量授权'>
|
|
|
- <authorize :list='data' :folder-id='currentFolder.id' :extra='{type:2}' :author-type='false'
|
|
|
- @close='authorShow = false'/>
|
|
|
+ <el-dialog v-model="authorShow" title="批量授权">
|
|
|
+ <authorize
|
|
|
+ :list="data"
|
|
|
+ :folder-id="currentFolder.id"
|
|
|
+ :extra="{ type: 2 }"
|
|
|
+ :author-type="false"
|
|
|
+ @close="authorShow = false"
|
|
|
+ />
|
|
|
</el-dialog>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
@@ -94,12 +123,12 @@ import baseButton from '@/components/base-button.vue'
|
|
|
import basicCurd from '@/components/basic-curd/index.vue'
|
|
|
import api from '@/api'
|
|
|
import authorize from '@/views/home/component/authorize.vue'
|
|
|
-import {Base64} from 'js-base64'
|
|
|
+import { Base64 } from 'js-base64'
|
|
|
import website from '@/config/website.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
- components: {BasicContainer, baseButton, basicCurd, authorize},
|
|
|
+ components: { BasicContainer, baseButton, basicCurd, authorize },
|
|
|
data() {
|
|
|
return {
|
|
|
clientId: '',
|
|
|
@@ -155,24 +184,26 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
list() {
|
|
|
- this.$api.company.list({current: 1, size: 100, parentId: ''}).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.folders = res.data.records
|
|
|
- if (this.folders.length > 0) {
|
|
|
- this.currentFolder = this.folders[0]
|
|
|
+ this.$api.company
|
|
|
+ .list({ current: 1, size: 100, parentId: '' })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.folders = res.data.records
|
|
|
+ if (this.folders.length > 0) {
|
|
|
+ this.currentFolder = this.folders[0]
|
|
|
+ }
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
},
|
|
|
addFolder() {
|
|
|
this.$prompt('请输入分类名称', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消'
|
|
|
- }).then(({value}) => {
|
|
|
- this.$api.company.submint({title: value, type: 2}).then(res => {
|
|
|
+ }).then(({ value }) => {
|
|
|
+ this.$api.company.submint({ title: value, type: 2 }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message.success(res.msg)
|
|
|
this.list()
|
|
|
@@ -189,63 +220,81 @@ export default {
|
|
|
this.onLoad()
|
|
|
},
|
|
|
onLoad() {
|
|
|
- const data = {parentId: this.currentFolder.id}
|
|
|
- this.$api.company.list(Object.assign(data, this.page)).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.data = res.data.records
|
|
|
- this.page.total = res.data.total
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ const data = { parentId: this.currentFolder.id }
|
|
|
+ this.$api.company
|
|
|
+ .list(Object.assign(data, this.page))
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.data = res.data.records
|
|
|
+ this.page.total = res.data.total
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
rowSave(row, done, loading) {
|
|
|
const data = {
|
|
|
projectInfoId: this.info.id
|
|
|
}
|
|
|
- this.$api.projects.meeting.save(Object.assign(row, data)).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ this.$api.projects.meeting.save(Object.assign(row, data)).then(
|
|
|
+ res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ done(row)
|
|
|
+ this.onLoad()
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error)
|
|
|
+ loading()
|
|
|
}
|
|
|
- done(row)
|
|
|
- this.onLoad()
|
|
|
- }, error => {
|
|
|
- window.console.log(error)
|
|
|
- loading()
|
|
|
- })
|
|
|
+ )
|
|
|
},
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
const data = {
|
|
|
projectInfoId: this.info.id
|
|
|
}
|
|
|
- this.$api.projects.meeting.update(Object.assign(row, data)).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ this.$api.projects.meeting.update(Object.assign(row, data)).then(
|
|
|
+ res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ done(row)
|
|
|
+ this.onLoad()
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error)
|
|
|
+ loading()
|
|
|
}
|
|
|
- done(row)
|
|
|
- this.onLoad()
|
|
|
- }, error => {
|
|
|
- window.console.log(error)
|
|
|
- loading()
|
|
|
- })
|
|
|
+ )
|
|
|
},
|
|
|
rowDetail(row, index) {
|
|
|
if (row.type === 1) {
|
|
|
- if (['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(row.suffix)) {
|
|
|
- const routeData = this.$router.resolve({path: '/home/file_detail', query: {id: row.fileId}})
|
|
|
+ if (
|
|
|
+ ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(
|
|
|
+ row.suffix
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ const routeData = this.$router.resolve({
|
|
|
+ path: '/home/file_detail',
|
|
|
+ query: { id: row.fileId }
|
|
|
+ })
|
|
|
window.open(routeData.href, '_blank')
|
|
|
} else {
|
|
|
this.imgList = [row.url]
|
|
|
this.showImage = true
|
|
|
}
|
|
|
} else {
|
|
|
- this.lastParentFolder = this.lastParentFolder.filter(sub => sub.id !== this.currentFolder.id)
|
|
|
+ this.lastParentFolder = this.lastParentFolder.filter(
|
|
|
+ sub => sub.id !== this.currentFolder.id
|
|
|
+ )
|
|
|
this.lastParentFolder.push(this.currentFolder)
|
|
|
this.currentFolder = row
|
|
|
this.onLoad()
|
|
|
@@ -257,17 +306,19 @@ export default {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return this.$api.company.removeList({ids: row.id})
|
|
|
- }).then(() => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!'
|
|
|
- })
|
|
|
- // 数据回调进行刷新
|
|
|
- this.onLoad()
|
|
|
- }).catch(() => {
|
|
|
})
|
|
|
+ .then(() => {
|
|
|
+ return this.$api.company.removeList({ ids: row.id })
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功!'
|
|
|
+ })
|
|
|
+ // 数据回调进行刷新
|
|
|
+ this.onLoad()
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
},
|
|
|
uploadSuccess(res, file, files) {
|
|
|
this.fileList = files.map(sub => sub.response.data)
|
|
|
@@ -330,8 +381,8 @@ export default {
|
|
|
this.$prompt('请输入文件夹名称', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消'
|
|
|
- }).then(({value}) => {
|
|
|
- const data = {parentId: this.currentFolder.id, title: value, type: 2}
|
|
|
+ }).then(({ value }) => {
|
|
|
+ const data = { parentId: this.currentFolder.id, title: value, type: 2 }
|
|
|
this.$api.company.submint(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message.success(res.msg)
|
|
|
@@ -343,8 +394,11 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
backFolder() {
|
|
|
- this.currentFolder = this.lastParentFolder[this.lastParentFolder.length - 1]
|
|
|
- this.lastParentFolder = this.lastParentFolder.filter(sub => sub.id !== this.currentFolder.id)
|
|
|
+ this.currentFolder =
|
|
|
+ this.lastParentFolder[this.lastParentFolder.length - 1]
|
|
|
+ this.lastParentFolder = this.lastParentFolder.filter(
|
|
|
+ sub => sub.id !== this.currentFolder.id
|
|
|
+ )
|
|
|
this.onLoad()
|
|
|
}
|
|
|
}
|
|
|
@@ -357,16 +411,16 @@ export default {
|
|
|
margin-bottom: 10px;
|
|
|
border-radius: 8px;
|
|
|
text-align: left;
|
|
|
- background-color: #E4E4E4;
|
|
|
+ background-color: #e4e4e4;
|
|
|
}
|
|
|
|
|
|
.item:hover {
|
|
|
- background-color: #AB7630;
|
|
|
+ background-color: #ab7630;
|
|
|
color: white;
|
|
|
}
|
|
|
|
|
|
.item-selected {
|
|
|
- background-color: #AB7630;
|
|
|
+ background-color: #ab7630;
|
|
|
color: white;
|
|
|
}
|
|
|
|