fix: 修复文档问题
This commit is contained in:
parent
b5452e3764
commit
745a01cc58
@ -9,7 +9,7 @@
|
|||||||
:placeholder="`请输入${quickCreateName}`"
|
:placeholder="`请输入${quickCreateName}`"
|
||||||
class="w-500 mr-12"
|
class="w-500 mr-12"
|
||||||
autofocus
|
autofocus
|
||||||
:maxlength="quickCreateMaxlength"
|
:maxlength="quickCreateMaxlength || '-'"
|
||||||
:show-word-limit="quickCreateMaxlength ? true : false"
|
:show-word-limit="quickCreateMaxlength ? true : false"
|
||||||
@keydown.enter="submitHandle"
|
@keydown.enter="submitHandle"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -19,8 +19,9 @@
|
|||||||
v-model="writeValue"
|
v-model="writeValue"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
autofocus
|
autofocus
|
||||||
:maxlength="maxlength"
|
:maxlength="maxlength || '-'"
|
||||||
:show-word-limit="maxlength ? true : false"
|
:show-word-limit="maxlength ? true : false"
|
||||||
|
@keydown.enter="submit"
|
||||||
></el-input>
|
></el-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,29 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
import type { pageRequest } from '@/api/type/common'
|
||||||
|
|
||||||
|
export interface commonTypes {
|
||||||
|
breadcrumb: any
|
||||||
|
paginationConfig: any | null
|
||||||
|
search: any
|
||||||
|
}
|
||||||
|
|
||||||
const useCommonStore = defineStore({
|
const useCommonStore = defineStore({
|
||||||
id: 'common',
|
id: 'common',
|
||||||
state: () => ({
|
state: (): commonTypes => ({
|
||||||
breadcrumb: null
|
breadcrumb: null,
|
||||||
|
// 搜索和分页缓存
|
||||||
|
paginationConfig: null,
|
||||||
|
search: null
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
saveBreadcrumb(data: any) {
|
saveBreadcrumb(data: any) {
|
||||||
this.breadcrumb = data
|
this.breadcrumb = data
|
||||||
|
},
|
||||||
|
savePage(val: string, data: pageRequest) {
|
||||||
|
this.paginationConfig[val] = data
|
||||||
|
},
|
||||||
|
saveCondition(val: string, data: any) {
|
||||||
|
this.search[val] = data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -113,18 +113,18 @@ function clearStore() {
|
|||||||
}
|
}
|
||||||
function submit() {
|
function submit() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const data = [] as any
|
const documents = [] as any
|
||||||
StepSecondRef.value?.paragraphList.map((item: any) => {
|
StepSecondRef.value?.paragraphList.map((item: any) => {
|
||||||
data.push({
|
documents.push({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
paragraphs: item.content
|
paragraphs: item.content
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const obj = { ...baseInfo.value, data } as datasetData
|
const obj = { ...baseInfo.value, documents } as datasetData
|
||||||
if (id) {
|
if (id) {
|
||||||
// 上传文档
|
// 上传文档
|
||||||
document
|
document
|
||||||
.asyncPostDocument(id as string, data)
|
.asyncPostDocument(id as string, documents)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MsgSuccess('提交成功')
|
MsgSuccess('提交成功')
|
||||||
clearStore()
|
clearStore()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user