This commit is contained in:
BianLzhaoMin 2025-11-19 15:55:21 +08:00
parent b4ec0b6805
commit e6db3ca659
3 changed files with 117 additions and 1 deletions

View File

@ -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 = {}) {
return request({

View File

@ -185,6 +185,9 @@
ref="componentRef"
:selectedNode="selectedNode"
v-bind="dialogConfig.outerComponentProps"
:type="type"
:id="id"
:name="name"
:is="dialogConfig.outerComponent"
/>
@ -225,6 +228,7 @@ import Upload from './tableCom/upload.vue'
import Move from './tableCom/move.vue'
import AddCopy from './tableCom/addCopy.vue'
import TagFilter from './tableCom/tagFilter.vue'
import EditWord from './tableCom/editWord.vue'
import {
getDocCenterRightListAPI,
@ -252,6 +256,7 @@ export default {
Move,
AddCopy,
TagFilter,
EditWord,
},
data() {
return {
@ -341,7 +346,7 @@ export default {
},
{
label: '重命名',
click: this.handleMove_1,
click: this.handleEdit_1,
},
{
label: '添加副本',
@ -361,6 +366,10 @@ export default {
//
selectedFilesForShare: [],
type: '',
id: '',
name: '',
}
},
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() {
if (this.selectedRows.length === 0) {

View File

@ -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>