改进
This commit is contained in:
parent
bf01c8680e
commit
b4ae8d70c0
7
api/openapitools.json
Normal file
7
api/openapitools.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||||
|
"spaces": 2,
|
||||||
|
"generator-cli": {
|
||||||
|
"version": "7.1.0"
|
||||||
|
}
|
||||||
|
}
|
@ -306,6 +306,20 @@
|
|||||||
"name": "DocumentId",
|
"name": "DocumentId",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "标题",
|
||||||
|
"name": "Title",
|
||||||
|
"in": "query",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "内容",
|
||||||
|
"name": "Content",
|
||||||
|
"in": "query",
|
||||||
|
"required": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-main>
|
<v-main>
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-responsive class="pa-2">
|
|
||||||
<router-view />
|
<router-view />
|
||||||
</v-responsive>
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-main>
|
</v-main>
|
||||||
</template>
|
</template>
|
||||||
|
@ -296,14 +296,20 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
* @summary 更新文档
|
* @summary 更新文档
|
||||||
* @param {string} libraryId 资料库 ID
|
* @param {string} libraryId 资料库 ID
|
||||||
* @param {string} documentId 文档 ID
|
* @param {string} documentId 文档 ID
|
||||||
|
* @param {string} title 标题
|
||||||
|
* @param {string} content 内容
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
libraryLibraryIdDocumentDocumentIdPut: async (libraryId: string, documentId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
libraryLibraryIdDocumentDocumentIdPut: async (libraryId: string, documentId: string, title: string, content: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
// verify required parameter 'libraryId' is not null or undefined
|
// verify required parameter 'libraryId' is not null or undefined
|
||||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'libraryId', libraryId)
|
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'libraryId', libraryId)
|
||||||
// verify required parameter 'documentId' is not null or undefined
|
// verify required parameter 'documentId' is not null or undefined
|
||||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'documentId', documentId)
|
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'documentId', documentId)
|
||||||
|
// verify required parameter 'title' is not null or undefined
|
||||||
|
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'title', title)
|
||||||
|
// verify required parameter 'content' is not null or undefined
|
||||||
|
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'content', content)
|
||||||
const localVarPath = `/library/{LibraryId}/document/{DocumentId}`
|
const localVarPath = `/library/{LibraryId}/document/{DocumentId}`
|
||||||
.replace(`{${"LibraryId"}}`, encodeURIComponent(String(libraryId)))
|
.replace(`{${"LibraryId"}}`, encodeURIComponent(String(libraryId)))
|
||||||
.replace(`{${"DocumentId"}}`, encodeURIComponent(String(documentId)));
|
.replace(`{${"DocumentId"}}`, encodeURIComponent(String(documentId)));
|
||||||
@ -321,6 +327,14 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
// authentication BearerToken required
|
// authentication BearerToken required
|
||||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||||
|
|
||||||
|
if (title !== undefined) {
|
||||||
|
localVarQueryParameter['Title'] = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content !== undefined) {
|
||||||
|
localVarQueryParameter['Content'] = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
@ -517,11 +531,13 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|||||||
* @summary 更新文档
|
* @summary 更新文档
|
||||||
* @param {string} libraryId 资料库 ID
|
* @param {string} libraryId 资料库 ID
|
||||||
* @param {string} documentId 文档 ID
|
* @param {string} documentId 文档 ID
|
||||||
|
* @param {string} title 标题
|
||||||
|
* @param {string} content 内容
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelDocument>> {
|
async libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelDocument>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options);
|
||||||
const index = configuration?.serverIndex ?? 0;
|
const index = configuration?.serverIndex ?? 0;
|
||||||
const operationBasePath = operationServerMap['DocumentsApi.libraryLibraryIdDocumentDocumentIdPut']?.[index]?.url;
|
const operationBasePath = operationServerMap['DocumentsApi.libraryLibraryIdDocumentDocumentIdPut']?.[index]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
||||||
@ -607,11 +623,13 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|||||||
* @summary 更新文档
|
* @summary 更新文档
|
||||||
* @param {string} libraryId 资料库 ID
|
* @param {string} libraryId 资料库 ID
|
||||||
* @param {string} documentId 文档 ID
|
* @param {string} documentId 文档 ID
|
||||||
|
* @param {string} title 标题
|
||||||
|
* @param {string} content 内容
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: any): AxiosPromise<ModelDocument> {
|
libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: any): AxiosPromise<ModelDocument> {
|
||||||
return localVarFp.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options).then((request) => request(axios, basePath));
|
return localVarFp.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取当前账号的文档列表
|
* 获取当前账号的文档列表
|
||||||
@ -689,12 +707,14 @@ export class DocumentsApi extends BaseAPI {
|
|||||||
* @summary 更新文档
|
* @summary 更新文档
|
||||||
* @param {string} libraryId 资料库 ID
|
* @param {string} libraryId 资料库 ID
|
||||||
* @param {string} documentId 文档 ID
|
* @param {string} documentId 文档 ID
|
||||||
|
* @param {string} title 标题
|
||||||
|
* @param {string} content 内容
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof DocumentsApi
|
* @memberof DocumentsApi
|
||||||
*/
|
*/
|
||||||
public libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: AxiosRequestConfig) {
|
public libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: AxiosRequestConfig) {
|
||||||
return DocumentsApiFp(this.configuration).libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options).then((request) => request(this.axios, this.basePath));
|
return DocumentsApiFp(this.configuration).libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +57,7 @@ import { document } from "@/plugins/api";
|
|||||||
import getTheme from "@/plugins/getTheme";
|
import getTheme from "@/plugins/getTheme";
|
||||||
import LoadingComponent from "@/components/Loading.vue";
|
import LoadingComponent from "@/components/Loading.vue";
|
||||||
|
|
||||||
const loading = ref(true)
|
const loading = ref(true);
|
||||||
const libraryIdInt = parseInt(router.currentRoute.value.params.LibraryId);
|
const libraryIdInt = parseInt(router.currentRoute.value.params.LibraryId);
|
||||||
const documentIdInt = parseInt(router.currentRoute.value.params.DocumentId);
|
const documentIdInt = parseInt(router.currentRoute.value.params.DocumentId);
|
||||||
|
|
||||||
@ -80,6 +80,15 @@ document
|
|||||||
const show_created_failed = ref(false);
|
const show_created_failed = ref(false);
|
||||||
const show_title_is_not_filled = ref(false);
|
const show_title_is_not_filled = ref(false);
|
||||||
|
|
||||||
|
function goto_document() {
|
||||||
|
router.push({
|
||||||
|
name: "library.documents.view",
|
||||||
|
params: {
|
||||||
|
DocumentId: documentIdInt,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function updateDocument() {
|
function updateDocument() {
|
||||||
if (docu.value.Title == "") {
|
if (docu.value.Title == "") {
|
||||||
show_title_is_not_filled.value = true;
|
show_title_is_not_filled.value = true;
|
||||||
@ -90,13 +99,11 @@ function updateDocument() {
|
|||||||
.libraryLibraryIdDocumentDocumentIdPut(
|
.libraryLibraryIdDocumentDocumentIdPut(
|
||||||
libraryIdInt,
|
libraryIdInt,
|
||||||
documentIdInt,
|
documentIdInt,
|
||||||
{
|
docu.value.Title,
|
||||||
Title: "a",
|
docu.value.Content
|
||||||
Content: "a",
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
console.log(r);
|
goto_document()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
show_created_failed.value = true;
|
show_created_failed.value = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user