This commit is contained in:
parent
b4ec0b6805
commit
e6db3ca659
|
|
@ -27,6 +27,14 @@ export function addDocCenterAPI(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改文档
|
||||||
|
export function updateDocCenterAPI(data) {
|
||||||
|
return request({
|
||||||
|
url: '/screen/document/updateName',
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
// 获取标签列表
|
// 获取标签列表
|
||||||
export function getDocsTagsListAPI(data = {}) {
|
export function getDocsTagsListAPI(data = {}) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,9 @@
|
||||||
ref="componentRef"
|
ref="componentRef"
|
||||||
:selectedNode="selectedNode"
|
:selectedNode="selectedNode"
|
||||||
v-bind="dialogConfig.outerComponentProps"
|
v-bind="dialogConfig.outerComponentProps"
|
||||||
|
:type="type"
|
||||||
|
:id="id"
|
||||||
|
:name="name"
|
||||||
:is="dialogConfig.outerComponent"
|
:is="dialogConfig.outerComponent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -225,6 +228,7 @@ import Upload from './tableCom/upload.vue'
|
||||||
import Move from './tableCom/move.vue'
|
import Move from './tableCom/move.vue'
|
||||||
import AddCopy from './tableCom/addCopy.vue'
|
import AddCopy from './tableCom/addCopy.vue'
|
||||||
import TagFilter from './tableCom/tagFilter.vue'
|
import TagFilter from './tableCom/tagFilter.vue'
|
||||||
|
import EditWord from './tableCom/editWord.vue'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getDocCenterRightListAPI,
|
getDocCenterRightListAPI,
|
||||||
|
|
@ -252,6 +256,7 @@ export default {
|
||||||
Move,
|
Move,
|
||||||
AddCopy,
|
AddCopy,
|
||||||
TagFilter,
|
TagFilter,
|
||||||
|
EditWord,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -341,7 +346,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '重命名',
|
label: '重命名',
|
||||||
click: this.handleMove_1,
|
click: this.handleEdit_1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '添加副本',
|
label: '添加副本',
|
||||||
|
|
@ -361,6 +366,10 @@ export default {
|
||||||
|
|
||||||
// 用于共享的文件列表
|
// 用于共享的文件列表
|
||||||
selectedFilesForShare: [],
|
selectedFilesForShare: [],
|
||||||
|
|
||||||
|
type: '',
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -609,6 +618,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 重命名
|
||||||
|
handleEdit_1(row) {
|
||||||
|
this.dialogConfig.outerTitle = '重命名'
|
||||||
|
this.dialogConfig.outerVisible = true
|
||||||
|
this.dialogConfig.outerComponent = 'EditWord'
|
||||||
|
this.type = row.type
|
||||||
|
this.id = row.id
|
||||||
|
this.name = row.name
|
||||||
|
},
|
||||||
|
|
||||||
// 添加副本
|
// 添加副本
|
||||||
handleAddCopy() {
|
handleAddCopy() {
|
||||||
if (this.selectedRows.length === 0) {
|
if (this.selectedRows.length === 0) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form
|
||||||
|
:model="addWordForm"
|
||||||
|
label-width="100px"
|
||||||
|
ref="addWordFormRef"
|
||||||
|
:rules="addWordFormRules"
|
||||||
|
>
|
||||||
|
<el-form-item label="文档夹名称" prop="folderName">
|
||||||
|
<el-input v-model="addWordForm.folderName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { updateDocCenterAPI } from '@/api/publicService/docCenter'
|
||||||
|
export default {
|
||||||
|
name: 'AddWord',
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
addWordForm: {
|
||||||
|
folderName: '',
|
||||||
|
},
|
||||||
|
addWordFormRules: {
|
||||||
|
folderName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入文档夹名称',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 统一接口方法(供父组件调用)
|
||||||
|
async submit() {
|
||||||
|
return await this.addDocCenter()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增文档夹
|
||||||
|
async submit() {
|
||||||
|
// 表单验证
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
this.$refs.addWordFormRef.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
resolve()
|
||||||
|
} else {
|
||||||
|
reject(new Error('表单验证失败'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证通过后调用 API
|
||||||
|
const res = await updateDocCenterAPI({
|
||||||
|
...this.addWordForm,
|
||||||
|
type: this.type,
|
||||||
|
id: this.id,
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
name: {
|
||||||
|
handler(newVal) {
|
||||||
|
this.addWordForm.folderName = newVal
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue