|
@@ -11,8 +11,6 @@
|
|
|
v-model="form"
|
|
v-model="form"
|
|
|
:before-open="beforeOpen"
|
|
:before-open="beforeOpen"
|
|
|
@row-del="rowDel"
|
|
@row-del="rowDel"
|
|
|
- @row-save="rowSave"
|
|
|
|
|
- @row-update="rowUpdate"
|
|
|
|
|
>
|
|
>
|
|
|
<template #menu-right>
|
|
<template #menu-right>
|
|
|
<div class="full-width">
|
|
<div class="full-width">
|
|
@@ -24,21 +22,22 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<template #menu="{ row }">
|
|
<template #menu="{ row }">
|
|
|
- <el-button
|
|
|
|
|
- text
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-folder-checked"
|
|
|
|
|
- @click="openFolder(row)"
|
|
|
|
|
- >打开文件夹
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button
|
|
|
|
|
- text
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-view"
|
|
|
|
|
- @click="edit(row)"
|
|
|
|
|
- v-if="detail.can_update"
|
|
|
|
|
- >文号提取
|
|
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ <div class="flex flex-center">
|
|
|
|
|
+ <filepicker
|
|
|
|
|
+ :project-id="detail.id"
|
|
|
|
|
+ :menu-btn="true"
|
|
|
|
|
+ :extra="row"
|
|
|
|
|
+ @submit="onSuccess"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ text
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
|
+ @click="edit(row)"
|
|
|
|
|
+ v-if="detail.can_update"
|
|
|
|
|
+ >文号提取
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
<template #file="{ row }">
|
|
<template #file="{ row }">
|
|
|
<div v-if="row.file">
|
|
<div v-if="row.file">
|
|
@@ -78,6 +77,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import api from '@/api/index.js'
|
|
import api from '@/api/index.js'
|
|
|
|
|
+import filepicker from '@/components/filepicker/index.vue'
|
|
|
|
|
|
|
|
const defaultData = [
|
|
const defaultData = [
|
|
|
{
|
|
{
|
|
@@ -164,6 +164,9 @@ const defaultData = [
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'params4',
|
|
name: 'params4',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ filepicker
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
info: {
|
|
info: {
|
|
|
type: Object,
|
|
type: Object,
|
|
@@ -205,9 +208,10 @@ export default {
|
|
|
menuWidth: 380,
|
|
menuWidth: 380,
|
|
|
size: 'mini',
|
|
size: 'mini',
|
|
|
addBtn: false,
|
|
addBtn: false,
|
|
|
|
|
+ editBtn: false,
|
|
|
viewBtn: true,
|
|
viewBtn: true,
|
|
|
delBtn: true,
|
|
delBtn: true,
|
|
|
- editBtnText: '上传',
|
|
|
|
|
|
|
+ detailBtn: false,
|
|
|
viewBtnText: '预览',
|
|
viewBtnText: '预览',
|
|
|
refreshBtn: false,
|
|
refreshBtn: false,
|
|
|
columnBtn: false,
|
|
columnBtn: false,
|
|
@@ -266,7 +270,6 @@ export default {
|
|
|
* @param item
|
|
* @param item
|
|
|
*/
|
|
*/
|
|
|
openFolder(item) {
|
|
openFolder(item) {
|
|
|
- console.log(item)
|
|
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: '/home/files',
|
|
path: '/home/files',
|
|
|
query: {
|
|
query: {
|
|
@@ -280,7 +283,6 @@ export default {
|
|
|
* @param item
|
|
* @param item
|
|
|
*/
|
|
*/
|
|
|
previewFile(item) {
|
|
previewFile(item) {
|
|
|
- console.log(item)
|
|
|
|
|
if (!Object.hasOwn(this.form, 'file')) {
|
|
if (!Object.hasOwn(this.form, 'file')) {
|
|
|
this.$message.error('暂无文件')
|
|
this.$message.error('暂无文件')
|
|
|
return
|
|
return
|
|
@@ -313,10 +315,9 @@ export default {
|
|
|
window.open(routeUrl.href, '_blank')
|
|
window.open(routeUrl.href, '_blank')
|
|
|
},
|
|
},
|
|
|
initFileList(list) {
|
|
initFileList(list) {
|
|
|
|
|
+ this.data.length = 0
|
|
|
this.data = defaultData
|
|
this.data = defaultData
|
|
|
- if (list && list.length === 0) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log(this.data)
|
|
|
this.data = this.data.map(sub => {
|
|
this.data = this.data.map(sub => {
|
|
|
const tmp = list.filter(ele => ele.type === sub.dispatchType)
|
|
const tmp = list.filter(ele => ele.type === sub.dispatchType)
|
|
|
if (tmp && tmp.length > 0) {
|
|
if (tmp && tmp.length > 0) {
|
|
@@ -335,7 +336,7 @@ export default {
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
if (res === 'confirm') {
|
|
if (res === 'confirm') {
|
|
|
- this.$api.project.fileRemove({ ids: row.pid, type: 3 }).then(res => {
|
|
|
|
|
|
|
+ this.$api.project.delLinkFile({ ids: row.id }).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success(res.msg)
|
|
this.$message.success(res.msg)
|
|
|
this.proInfo()
|
|
this.proInfo()
|
|
@@ -349,6 +350,23 @@ export default {
|
|
|
clear() {
|
|
clear() {
|
|
|
this.currentRow = null
|
|
this.currentRow = null
|
|
|
},
|
|
},
|
|
|
|
|
+ onSuccess(list, command, extra) {
|
|
|
|
|
+ const tmps = list.map(e => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ projectId: this.detail.id,
|
|
|
|
|
+ fileId: e.fileId,
|
|
|
|
|
+ pid: e.id,
|
|
|
|
|
+ type: extra.dispatchType
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$api.project.linkFile(tmps).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.proInfo()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 更新文号
|
|
* 更新文号
|
|
|
*/
|
|
*/
|