diff --git a/package-lock.json b/package-lock.json index b33fc61d..02ea57cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,14 +31,15 @@ "unplugin-vue-components": "^0.22.12", "vue": "^3.2.45", "vue-router": "^4.1.6", - "vue3-markdown-it": "^1.0.10" + "vue3-markdown-it": "^1.0.10", + "vue3-ts-jsoneditor": "^2.7.1" }, "devDependencies": { "@commitlint/cli": "^17.4.1", "@commitlint/config-conventional": "^17.4.0", "@types/lodash-es": "^4.17.6", "@types/moment": "^2.13.0", - "@types/node": "^18.11.17", + "@types/node": "^18.14.0", "@vitejs/plugin-vue": "^4.0.0", "@vuemap/unplugin-resolver": "^1.0.4", "autoprefixer": "^10.4.13", @@ -1572,9 +1573,9 @@ } }, "node_modules/@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + "version": "18.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.0.tgz", + "integrity": "sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -8883,6 +8884,11 @@ "builtins": "^1.0.3" } }, + "node_modules/vanilla-jsoneditor": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/vanilla-jsoneditor/-/vanilla-jsoneditor-0.7.11.tgz", + "integrity": "sha512-DFm6Fg6gzP4FlOaydDCRWpqEsmI5umpb9fOV3hKbbNDO1ZHTUpuMwi1SmMyoEsSgdDGGzRLFNCrW0URQ9Skx4w==" + }, "node_modules/vite": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.3.tgz", @@ -9146,6 +9152,27 @@ "markdown-it-toc-done-right": "^4.2.0" } }, + "node_modules/vue3-ts-jsoneditor": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/vue3-ts-jsoneditor/-/vue3-ts-jsoneditor-2.7.1.tgz", + "integrity": "sha512-u8dWSG21dK0+iwbY6yhpcyRstQEKbO53+4Ma4Qhf9ED/wbGURjLvX/GTMbVsU7xB4gJKEs1a01AxBIgIab+4uA==", + "funding": [ + "https://uahelp.monobank.ua/", + "https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi", + "https://www.comebackalive.in.ua/", + "https://armysos.com.ua/donate/", + "http://wings-phoenix.org.ua/en/about-fund/", + "https://novaposhta.ua/eng/", + "https://voices.org.ua/en/donat/", + "https://www.unicef.org.uk/donate/donate-now-to-protect-children-in-ukraine/", + "https://www.paypal.com/donate/?cmd=_s-xclick&hosted_button_id=FYFZPVQN8J7YC&source=url", + "https://novaukraine.org/" + ], + "dependencies": { + "vanilla-jsoneditor": "^0.7.9", + "vue": "^3.2.37" + } + }, "node_modules/warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", @@ -10594,9 +10621,9 @@ } }, "@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + "version": "18.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.0.tgz", + "integrity": "sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -16470,6 +16497,11 @@ "builtins": "^1.0.3" } }, + "vanilla-jsoneditor": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/vanilla-jsoneditor/-/vanilla-jsoneditor-0.7.11.tgz", + "integrity": "sha512-DFm6Fg6gzP4FlOaydDCRWpqEsmI5umpb9fOV3hKbbNDO1ZHTUpuMwi1SmMyoEsSgdDGGzRLFNCrW0URQ9Skx4w==" + }, "vite": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.3.tgz", @@ -16657,6 +16689,15 @@ "markdown-it-toc-done-right": "^4.2.0" } }, + "vue3-ts-jsoneditor": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/vue3-ts-jsoneditor/-/vue3-ts-jsoneditor-2.7.1.tgz", + "integrity": "sha512-u8dWSG21dK0+iwbY6yhpcyRstQEKbO53+4Ma4Qhf9ED/wbGURjLvX/GTMbVsU7xB4gJKEs1a01AxBIgIab+4uA==", + "requires": { + "vanilla-jsoneditor": "^0.7.9", + "vue": "^3.2.37" + } + }, "warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", diff --git a/package.json b/package.json index e24c96c2..7174015a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "vite-plugin-monaco-editor": "^1.1.0", "vue": "^3.2.45", "vue-router": "^4.1.6", - "vue3-markdown-it": "^1.0.10" + "vue3-markdown-it": "^1.0.10", + "vue3-ts-jsoneditor": "^2.7.1" }, "devDependencies": { "@commitlint/cli": "^17.4.1", diff --git a/src/router/menu.ts b/src/router/menu.ts index 2a043f4f..e43a5ee0 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -27,6 +27,10 @@ export default [ path: '/search', component: () => import('@/views/demo/Search.vue') }, + { + path: '/system/Api', + component: () => import('@/views/system/Apply/Api/index.vue') + }, // end: 测试用, 可删除 diff --git a/src/views/notice/Config/Detail/index.vue b/src/views/notice/Config/Detail/index.vue index 4cd1d3d5..b8ae5bb9 100644 --- a/src/views/notice/Config/Detail/index.vue +++ b/src/views/notice/Config/Detail/index.vue @@ -12,6 +12,7 @@ (false); const handleSubmit = () => { - validate() + const form = useForm(formData.value, formRules.value); + form.validate() .then(async () => { // console.log('formData.value: ', formData.value); btnLoading.value = true; diff --git a/src/views/notice/Config/Log/index.vue b/src/views/notice/Config/Log/index.vue index 2be0156c..54cd8e7a 100644 --- a/src/views/notice/Config/Log/index.vue +++ b/src/views/notice/Config/Log/index.vue @@ -94,7 +94,7 @@ const columns = [ search: { type: 'date', handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -110,7 +110,7 @@ const columns = [ { label: '失败', value: 'error' }, ], handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -139,7 +139,16 @@ const handleSearch = (e: any) => { const handleError = (e: any) => { Modal.info({ title: '错误信息', - content: JSON.stringify(e), + content: h( + 'p', + { + style: { + maxHeight: '300px', + overflowY: 'auto', + }, + }, + JSON.stringify(e), + ), }); }; /** @@ -148,7 +157,16 @@ const handleError = (e: any) => { const handleDetail = (e: any) => { Modal.info({ title: '详情信息', - content: JSON.stringify(e), + content: h( + 'p', + { + style: { + maxHeight: '300px', + overflowY: 'auto', + }, + }, + JSON.stringify(e), + ), }); }; diff --git a/src/views/notice/Config/index.vue b/src/views/notice/Config/index.vue index ded3f3c1..235c1ec3 100644 --- a/src/views/notice/Config/index.vue +++ b/src/views/notice/Config/index.vue @@ -209,7 +209,7 @@ const columns = [ type: 'select', options: NOTICE_METHOD, handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -222,7 +222,7 @@ const columns = [ type: 'select', options: providerList, handleValue: (v: any) => { - return '123'; + return v; }, }, }, diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue index db0506ac..b1ac70eb 100644 --- a/src/views/notice/Template/Detail/index.vue +++ b/src/views/notice/Template/Detail/index.vue @@ -12,6 +12,7 @@ { if (formData.value.template.messageType === 'markdown') delete formData.value.template.link if (formData.value.template.messageType === 'link') delete formData.value.template.markdown // console.log('formData.value: ', formData.value); - validate() + const form = useForm(formData.value, formRules.value); + form.validate() .then(async () => { formData.value.template.ttsCode = formData.value.template.templateCode; diff --git a/src/views/notice/Template/Log/index.vue b/src/views/notice/Template/Log/index.vue index 4718e6a7..0933690c 100644 --- a/src/views/notice/Template/Log/index.vue +++ b/src/views/notice/Template/Log/index.vue @@ -94,7 +94,7 @@ const columns = [ search: { type: 'date', handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -110,7 +110,7 @@ const columns = [ { label: '失败', value: 'error' }, ], handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -139,7 +139,16 @@ const handleSearch = (e: any) => { const handleError = (e: any) => { Modal.info({ title: '错误信息', - content: JSON.stringify(e), + content: h( + 'p', + { + style: { + maxHeight: '300px', + overflowY: 'auto', + }, + }, + JSON.stringify(e), + ), }); }; /** @@ -148,7 +157,16 @@ const handleError = (e: any) => { const handleDetail = (e: any) => { Modal.info({ title: '详情信息', - content: JSON.stringify(e), + content: h( + 'p', + { + style: { + maxHeight: '300px', + overflowY: 'auto', + }, + }, + JSON.stringify(e), + ), }); }; diff --git a/src/views/notice/Template/index.vue b/src/views/notice/Template/index.vue index 70d3738c..0726a3c2 100644 --- a/src/views/notice/Template/index.vue +++ b/src/views/notice/Template/index.vue @@ -196,7 +196,7 @@ const columns = [ type: 'select', options: NOTICE_METHOD, handleValue: (v: any) => { - return '123'; + return v; }, }, }, @@ -209,7 +209,7 @@ const columns = [ type: 'select', options: providerList, handleValue: (v: any) => { - return '123'; + return v; }, }, }, diff --git a/src/views/system/Api/components/ApiDoes.vue b/src/views/system/Api/components/ApiDoes.vue deleted file mode 100644 index df806b0c..00000000 --- a/src/views/system/Api/components/ApiDoes.vue +++ /dev/null @@ -1,316 +0,0 @@ - - - - - diff --git a/src/views/system/Api/components/ApiTest.vue b/src/views/system/Api/components/ApiTest.vue deleted file mode 100644 index 46c87dbe..00000000 --- a/src/views/system/Api/components/ApiTest.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/src/views/system/Api/components/ChooseApi.vue b/src/views/system/Api/components/ChooseApi.vue deleted file mode 100644 index bb6e5548..00000000 --- a/src/views/system/Api/components/ChooseApi.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/src/views/system/Api/components/InputCard.vue b/src/views/system/Api/components/InputCard.vue deleted file mode 100644 index c1742737..00000000 --- a/src/views/system/Api/components/InputCard.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/src/views/system/Api/components/LeftTree.vue b/src/views/system/Api/components/LeftTree.vue deleted file mode 100644 index 598887f3..00000000 --- a/src/views/system/Api/components/LeftTree.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - diff --git a/src/views/system/Api/index.vue b/src/views/system/Api/index.vue deleted file mode 100644 index 1d4fce58..00000000 --- a/src/views/system/Api/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/src/views/system/Api/typing.d.ts b/src/views/system/Api/typing.d.ts deleted file mode 100644 index 7937398b..00000000 --- a/src/views/system/Api/typing.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type treeNodeTpye = { - name: string; - key: string; - schemas?:object; - link?: string; - apiList?: object[]; - children?: treeNodeTpye[]; - -}; -export type methodType = { - [key: string]: object -} -export type apiObjType = { - url: string, - method: methodType -} - -export type apiDetailsType = { - url: string; - method: string; - summary: string; - parameters: any[]; - requestBody?: any; - responses:object; -} \ No newline at end of file diff --git a/src/views/system/Apply/Api/components/ApiDoes.vue b/src/views/system/Apply/Api/components/ApiDoes.vue index df806b0c..b7f8f8f3 100644 --- a/src/views/system/Apply/Api/components/ApiDoes.vue +++ b/src/views/system/Apply/Api/components/ApiDoes.vue @@ -28,10 +28,10 @@ model="TABLE" > @@ -68,11 +68,18 @@ > + + diff --git a/src/views/system/Apply/Api/components/ChooseApi.vue b/src/views/system/Apply/Api/components/ChooseApi.vue index bb6e5548..dbf13a39 100644 --- a/src/views/system/Apply/Api/components/ChooseApi.vue +++ b/src/views/system/Apply/Api/components/ChooseApi.vue @@ -10,8 +10,8 @@ @@ -48,8 +48,9 @@ const rowSelection: TableProps['rowSelection'] = { }, }; -const jump = (row:object) => { +const jump = (row:any) => { emits('update:clickApi',row) + }; diff --git a/src/views/system/Apply/Api/components/LeftTree.vue b/src/views/system/Apply/Api/components/LeftTree.vue index 598887f3..b4b6e4f3 100644 --- a/src/views/system/Apply/Api/components/LeftTree.vue +++ b/src/views/system/Apply/Api/components/LeftTree.vue @@ -39,6 +39,7 @@ const getTreeData = () => { }); }; const clickSelectItem: TreeProps['onSelect'] = (key, node: any) => { + if(!node.node.parent) return emits('select', node.node.dataRef, node.node?.parent.node.schemas); }; diff --git a/src/views/system/Apply/Api/index.vue b/src/views/system/Apply/Api/index.vue index 990c0d77..30171694 100644 --- a/src/views/system/Apply/Api/index.vue +++ b/src/views/system/Apply/Api/index.vue @@ -1,6 +1,5 @@