diff --git a/package-lock.json b/package-lock.json index 65b3c300..6947cff4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@vitejs/plugin-vue-jsx": "^3.0.0", "@vuemap/vue-amap": "^1.1.20", + "@vueuse/core": "^9.10.0", "ant-design-vue": "^3.2.15", "axios": "^1.2.1", "echarts": "^5.4.1", @@ -24,7 +25,8 @@ "unplugin-auto-import": "^0.12.1", "unplugin-vue-components": "^0.22.12", "vue": "^3.2.45", - "vue-router": "^4.1.6" + "vue-router": "^4.1.6", + "vue3-markdown-it": "^1.0.10" }, "devDependencies": { "@commitlint/cli": "^17.4.1", @@ -1481,6 +1483,12 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" }, + "node_modules/@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "peer": true + }, "node_modules/@types/lodash": { "version": "4.14.191", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.191.tgz", @@ -1496,6 +1504,22 @@ "@types/lodash": "*" } }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "peer": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "peer": true + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmmirror.com/@types/minimist/-/minimist-1.2.2.tgz", @@ -1532,6 +1556,11 @@ "@types/webxr": "*" } }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==" + }, "node_modules/@types/webxr": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.0.tgz", @@ -1823,6 +1852,39 @@ "vue": "^3.2.0" } }, + "node_modules/@vueuse/core": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", + "integrity": "sha512-CxMewME07qeuzuT/AOIQGv0EhhDoojniqU6pC3F8m5VC76L47UT18DcX88kWlP3I7d3qMJ4u/PD8iSRsy3bmNA==", + "dependencies": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.10.0", + "@vueuse/shared": "9.10.0", + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/metadata": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-9.10.0.tgz", + "integrity": "sha512-G5VZhgTCapzU9rv0Iq2HBrVOSGzOKb+OE668NxhXNcTjUjwYxULkEhAw70FtRLMZc+hxcFAzDZlKYA0xcwNMuw==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-9.10.0.tgz", + "integrity": "sha512-vakHJ2ZRklAzqmcVBL38RS7BxdBA4+5poG9NsSyqJxrt9kz0zX3P5CXMy0Hm6LFbZXUgvKdqAS3pUH1zX/5qTQ==", + "dependencies": { + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/3d-tiles-renderer": { "version": "0.3.16", "resolved": "https://registry.npmjs.org/3d-tiles-renderer/-/3d-tiles-renderer-0.3.16.tgz", @@ -1998,8 +2060,7 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/array-ify": { "version": "1.0.0", @@ -3883,6 +3944,14 @@ "tslib": "^2.0.3" } }, + "node_modules/highlight.js": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.7.0.tgz", + "integrity": "sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -5465,6 +5534,14 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/lint-staged": { "version": "13.1.0", "resolved": "https://registry.npmmirror.com/lint-staged/-/lint-staged-13.1.0.tgz", @@ -5741,6 +5818,11 @@ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true }, + "node_modules/lodash.flow": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", + "integrity": "sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==" + }, "node_modules/lodash.isfunction": { "version": "3.0.9", "resolved": "https://registry.npmmirror.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", @@ -5952,6 +6034,102 @@ "node": ">=8" } }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg==" + }, + "node_modules/markdown-it-anchor": { + "version": "8.6.6", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz", + "integrity": "sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA==", + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "node_modules/markdown-it-deflist": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz", + "integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg==" + }, + "node_modules/markdown-it-emoji": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz", + "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ==" + }, + "node_modules/markdown-it-footnote": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz", + "integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==" + }, + "node_modules/markdown-it-highlightjs": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/markdown-it-highlightjs/-/markdown-it-highlightjs-3.6.0.tgz", + "integrity": "sha512-ex+Lq3cVkprh0GpGwFyc53A/rqY6GGzopPCG1xMsf8Ya3XtGC8Uw9tChN1rWbpyDae7tBBhVHVcMM29h4Btamw==", + "dependencies": { + "highlight.js": "^11.3.1", + "lodash.flow": "^3.5.0" + } + }, + "node_modules/markdown-it-ins": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz", + "integrity": "sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw==" + }, + "node_modules/markdown-it-mark": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz", + "integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A==" + }, + "node_modules/markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q==" + }, + "node_modules/markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ==" + }, + "node_modules/markdown-it-task-lists": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz", + "integrity": "sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA==" + }, + "node_modules/markdown-it-toc-done-right": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-4.2.0.tgz", + "integrity": "sha512-UB/IbzjWazwTlNAX0pvWNlJS8NKsOQ4syrXZQ/C72j+jirrsjVRT627lCaylrKJFBQWfRsPmIVQie8x38DEhAQ==" + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "node_modules/meow": { "version": "8.1.2", "resolved": "https://registry.npmmirror.com/meow/-/meow-8.1.2.tgz", @@ -7943,6 +8121,11 @@ "node": ">=4.2.0" } }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "node_modules/ufo": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz", @@ -8499,6 +8682,26 @@ "vue": "^3.0.0" } }, + "node_modules/vue3-markdown-it": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/vue3-markdown-it/-/vue3-markdown-it-1.0.10.tgz", + "integrity": "sha512-mTvHu0zl7jrh7ojgaZ+tTpCLiS4CVg4bTgTu4KGhw/cRRY5YgIG8QgFAPu6kCzSW6Znc9a52Beb6hFvF4hSMkQ==", + "dependencies": { + "markdown-it": "^12.3.2", + "markdown-it-abbr": "^1.0.4", + "markdown-it-anchor": "^8.4.1", + "markdown-it-deflist": "^2.1.0", + "markdown-it-emoji": "^2.0.0", + "markdown-it-footnote": "^3.0.3", + "markdown-it-highlightjs": "^3.6.0", + "markdown-it-ins": "^3.0.1", + "markdown-it-mark": "^3.0.1", + "markdown-it-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "markdown-it-task-lists": "^2.1.1", + "markdown-it-toc-done-right": "^4.2.0" + } + }, "node_modules/warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", @@ -9766,6 +9969,12 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" }, + "@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "peer": true + }, "@types/lodash": { "version": "4.14.191", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.191.tgz", @@ -9781,6 +9990,22 @@ "@types/lodash": "*" } }, + "@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "peer": true, + "requires": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "peer": true + }, "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmmirror.com/@types/minimist/-/minimist-1.2.2.tgz", @@ -9816,6 +10041,11 @@ "@types/webxr": "*" } }, + "@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==" + }, "@types/webxr": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.0.tgz", @@ -10077,6 +10307,30 @@ "uppercamelcase": "^1.1.0" } }, + "@vueuse/core": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", + "integrity": "sha512-CxMewME07qeuzuT/AOIQGv0EhhDoojniqU6pC3F8m5VC76L47UT18DcX88kWlP3I7d3qMJ4u/PD8iSRsy3bmNA==", + "requires": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.10.0", + "@vueuse/shared": "9.10.0", + "vue-demi": "*" + } + }, + "@vueuse/metadata": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-9.10.0.tgz", + "integrity": "sha512-G5VZhgTCapzU9rv0Iq2HBrVOSGzOKb+OE668NxhXNcTjUjwYxULkEhAw70FtRLMZc+hxcFAzDZlKYA0xcwNMuw==" + }, + "@vueuse/shared": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-9.10.0.tgz", + "integrity": "sha512-vakHJ2ZRklAzqmcVBL38RS7BxdBA4+5poG9NsSyqJxrt9kz0zX3P5CXMy0Hm6LFbZXUgvKdqAS3pUH1zX/5qTQ==", + "requires": { + "vue-demi": "*" + } + }, "3d-tiles-renderer": { "version": "0.3.16", "resolved": "https://registry.npmjs.org/3d-tiles-renderer/-/3d-tiles-renderer-0.3.16.tgz", @@ -10216,8 +10470,7 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "array-ify": { "version": "1.0.0", @@ -11742,6 +11995,11 @@ "tslib": "^2.0.3" } }, + "highlight.js": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.7.0.tgz", + "integrity": "sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==" + }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -12976,6 +13234,14 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "lint-staged": { "version": "13.1.0", "resolved": "https://registry.npmmirror.com/lint-staged/-/lint-staged-13.1.0.tgz", @@ -13183,6 +13449,11 @@ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true }, + "lodash.flow": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", + "integrity": "sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==" + }, "lodash.isfunction": { "version": "3.0.9", "resolved": "https://registry.npmmirror.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", @@ -13363,6 +13634,95 @@ "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true }, + "markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "requires": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" + } + } + }, + "markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg==" + }, + "markdown-it-anchor": { + "version": "8.6.6", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz", + "integrity": "sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA==", + "requires": {} + }, + "markdown-it-deflist": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz", + "integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg==" + }, + "markdown-it-emoji": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz", + "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ==" + }, + "markdown-it-footnote": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz", + "integrity": "sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==" + }, + "markdown-it-highlightjs": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/markdown-it-highlightjs/-/markdown-it-highlightjs-3.6.0.tgz", + "integrity": "sha512-ex+Lq3cVkprh0GpGwFyc53A/rqY6GGzopPCG1xMsf8Ya3XtGC8Uw9tChN1rWbpyDae7tBBhVHVcMM29h4Btamw==", + "requires": { + "highlight.js": "^11.3.1", + "lodash.flow": "^3.5.0" + } + }, + "markdown-it-ins": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz", + "integrity": "sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw==" + }, + "markdown-it-mark": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz", + "integrity": "sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A==" + }, + "markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q==" + }, + "markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ==" + }, + "markdown-it-task-lists": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz", + "integrity": "sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA==" + }, + "markdown-it-toc-done-right": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-4.2.0.tgz", + "integrity": "sha512-UB/IbzjWazwTlNAX0pvWNlJS8NKsOQ4syrXZQ/C72j+jirrsjVRT627lCaylrKJFBQWfRsPmIVQie8x38DEhAQ==" + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "meow": { "version": "8.1.2", "resolved": "https://registry.npmmirror.com/meow/-/meow-8.1.2.tgz", @@ -14934,6 +15294,11 @@ "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "devOptional": true }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "ufo": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz", @@ -15351,6 +15716,26 @@ "is-plain-object": "3.0.1" } }, + "vue3-markdown-it": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/vue3-markdown-it/-/vue3-markdown-it-1.0.10.tgz", + "integrity": "sha512-mTvHu0zl7jrh7ojgaZ+tTpCLiS4CVg4bTgTu4KGhw/cRRY5YgIG8QgFAPu6kCzSW6Znc9a52Beb6hFvF4hSMkQ==", + "requires": { + "markdown-it": "^12.3.2", + "markdown-it-abbr": "^1.0.4", + "markdown-it-anchor": "^8.4.1", + "markdown-it-deflist": "^2.1.0", + "markdown-it-emoji": "^2.0.0", + "markdown-it-footnote": "^3.0.3", + "markdown-it-highlightjs": "^3.6.0", + "markdown-it-ins": "^3.0.1", + "markdown-it-mark": "^3.0.1", + "markdown-it-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "markdown-it-task-lists": "^2.1.1", + "markdown-it-toc-done-right": "^4.2.0" + } + }, "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 978c1d3c..942a5662 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "ant-design-vue": "^3.2.15", "axios": "^1.2.1", "echarts": "^5.4.1", + "event-source-polyfill": "^1.0.31", "jetlinks-store": "^0.0.3", "js-cookie": "^3.0.1", "less": "^4.1.3", diff --git a/public/images/device-type-3.png b/public/images/device-type-3.png deleted file mode 100644 index 3561237e..00000000 Binary files a/public/images/device-type-3.png and /dev/null differ diff --git a/public/images/device-type-3-big.png b/public/images/device/instance/device-card.png similarity index 100% rename from public/images/device-type-3-big.png rename to public/images/device/instance/device-card.png diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 8c3c964f..fb34ebd1 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -21,4 +21,55 @@ export const saveMetadata = (id: string, data: string) => server.put(`/device/in * @param id 设备ID * @returns 设备详情 */ -export const detail = (id: string) => server.get(`/device-instance/${id}/detail`) \ No newline at end of file +export const detail = (id: string) => server.get(`/device-instance/${id}/detail`) + +/** + * 查询数据 + * @param data 分页搜索数据 + * @returns + */ +export const query = (data?: Record) => server.post('/device-instance/_query', data) + +/** + * 删除设备 + * @param id 设备ID + * @returns + */ +export const _delete = (id: string) => server.remove(`/device-instance/${id}`) + +/** + * 启用设备 + * @param id 设备ID + * @param data + * @returns + */ +export const _deploy = (id: string) => server.post(`/device-instance/${id}/deploy`) + +/** + * 禁用设备 + * @param id 设备ID + * @param data + * @returns + */ +export const _undeploy = (id: string) => server.post(`/device-instance/${id}/undeploy`) + +/** + * 批量激活设备 + * @param data 设备id数组 + * @returns + */ +export const batchDeployDevice = (data: string[]) => server.put(`/device-instance/batch/_deploy`, data) + +/** + * 批量注销设备 + * @param data 设备id数组 + * @returns + */ +export const batchUndeployDevice = (data: string[]) => server.put(`/device-instance/batch/_unDeploy`, data) + +/** + * 批量删除 + * @param data 设备id数组 + * @returns + */ +export const batchDeleteDevice = (data: string[]) => server.put(`/device-instance/batch/_delete`, data) diff --git a/src/api/link/accessConfig.js b/src/api/link/accessConfig.js deleted file mode 100644 index 0b972bb5..00000000 --- a/src/api/link/accessConfig.js +++ /dev/null @@ -1,33 +0,0 @@ -import server from '@/utils/request'; - -export const getProviders = () => server.get(`/gateway/device/providers`); - -export const detail = (id) => server.get(`/gateway/device/${id}`); - -export const getNetworkList = (networkType, data, params) => - server.get( - `/network/config/${networkType}/_alive?include=${params.include}`, - data, - ); - -export const getProtocolList = (transport, params) => - server.get(`/protocol/supports/${transport ? transport : ''}`, params); - -export const getConfigView = (id, transport) => - server.get(`/protocol/${id}/transport/${transport}`); - -export const getChildConfigView = (id) => - server.get(`/protocol/${id}/transports`); - -export const save = (data) => server.post(`/gateway/device`, data); - -export const update = (data) => server.patch(`/gateway/device`, data); - -export const list = (data) => - server.post(`/gateway/device/detail/_query`, data); - -export const undeploy = (id) => server.post(`/gateway/device/${id}/_shutdown`); - -export const deploy = (id) => server.post(`/gateway/device/${id}/_startup`); - -export const del = (id) => server.remove(`/gateway/device/${id}`); diff --git a/src/api/link/accessConfig.ts b/src/api/link/accessConfig.ts new file mode 100644 index 00000000..7ebb0ebd --- /dev/null +++ b/src/api/link/accessConfig.ts @@ -0,0 +1,45 @@ +import server from '@/utils/request'; + +export const getProviders = () => server.get(`/gateway/device/providers`); + +export const detail = (id: string) => server.get(`/gateway/device/${id}`); + +export const getNetworkList = ( + networkType: string, + data: Object, + params: Object, +) => + server.get( + `/network/config/${networkType}/_alive?include=${params.include}`, + data, + ); + +export const getProtocolList = (transport: string, params: Object) => + server.get(`/protocol/supports/${transport ? transport : ''}`, params); + +export const getConfigView = (id: string, transport: string) => + server.get(`/protocol/${id}/transport/${transport}`); + +export const getChildConfigView = (id: string) => + server.get(`/protocol/${id}/transports`); + +export const save = (data: Object) => server.post(`/gateway/device`, data); + +export const update = (data: Object) => server.patch(`/gateway/device`, data); + +export const list = (data: Object) => + server.post(`/gateway/device/detail/_query`, data); + +export const undeploy = (id: string) => + server.post(`/gateway/device/${id}/_shutdown`); + +export const deploy = (id: string) => + server.post(`/gateway/device/${id}/_startup`); + +export const del = (id: string) => server.remove(`/gateway/device/${id}`); + +export const getResourcesCurrent = () => + server.get(`/network/resources/alive/_current`); + +export const getClusters = () => + server.get(`network/resources/clusters`); diff --git a/src/api/link/certificate.js b/src/api/link/certificate.ts similarity index 68% rename from src/api/link/certificate.js rename to src/api/link/certificate.ts index d4fe08a0..9ed5f5e1 100644 --- a/src/api/link/certificate.js +++ b/src/api/link/certificate.ts @@ -3,4 +3,5 @@ import { BASE_API_PATH } from '@/utils/variable'; export const NETWORK_CERTIFICATE_UPLOAD = `${BASE_API_PATH}/network/certificate/upload`; -export const save = (data) => server.post(`/network/certificate`, data); + +export const save = (data: object) => server.post(`/network/certificate`, data); diff --git a/src/api/northbound/alicloud.ts b/src/api/northbound/alicloud.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/api/northbound/dueros.ts b/src/api/northbound/dueros.ts new file mode 100644 index 00000000..e3cb60cc --- /dev/null +++ b/src/api/northbound/dueros.ts @@ -0,0 +1,8 @@ +import server from '@/utils/request' + +/** + * 查询数据 + * @param data 分页搜索数据 + * @returns + */ +export const query = (data: Record) => server.post('/dueros/product/_query', data) \ No newline at end of file diff --git a/src/api/notice/template.ts b/src/api/notice/template.ts new file mode 100644 index 00000000..b49dbd8b --- /dev/null +++ b/src/api/notice/template.ts @@ -0,0 +1,12 @@ +import { patch, post, get } from '@/utils/request' + +export default { + // 列表 + list: (data: any) => post(`/notifier/template/_query`, data), + // 详情 + detail: (id: string): any => get(`/notifier/template/${id}`), + // 新增 + save: (data: any) => post(`/notifier/template`, data), + // 修改 + update: (data: any) => patch(`/notifier/template`, data) +} \ No newline at end of file diff --git a/src/api/system/basis.ts b/src/api/system/basis.ts new file mode 100644 index 00000000..c8734c43 --- /dev/null +++ b/src/api/system/basis.ts @@ -0,0 +1,6 @@ +import server from '@/utils/request'; + +// 保存 +export const save_api = (data: any) => server.post(`/system/config/scope/_save`, data) +// 获取详情 +export const getDetails_api = (data: any) => server.post(`/system/config/scopes`, data) \ No newline at end of file diff --git a/src/components/AIcon/index.ts b/src/components/AIcon/index.ts deleted file mode 100644 index 39b2aee7..00000000 --- a/src/components/AIcon/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createFromIconfontCN } from '@ant-design/icons-vue'; - -const AliIcon = createFromIconfontCN({ - scriptUrl: '/icons/iconfont.js', // 在 iconfont.cn 上生成 -}); - -export default AliIcon \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx new file mode 100644 index 00000000..bcc04f86 --- /dev/null +++ b/src/components/AIcon/index.tsx @@ -0,0 +1,36 @@ +import { createFromIconfontCN } from '@ant-design/icons-vue'; +import * as $Icon from '@ant-design/icons-vue'; +import { createVNode } from 'vue'; + +const AliIcon = createFromIconfontCN({ + scriptUrl: '/icons/iconfont.js', // 在 iconfont.cn 上生成 +}); + +const AntdIcon = (props: {type: string}) => { + const {type} = props; + let antIcon: {[key: string]: any} = $Icon + return createVNode(antIcon[type]) +} + +const iconKeys = [ + 'EyeOutlined', + 'EditOutlined', + 'PlusOutlined', + 'DeleteOutlined', + 'CheckCircleOutlined', + 'StopOutlined', + 'CheckOutlined', + 'CloseOutlined', + 'DownOutlined', + 'ImportOutlined', + 'ExportOutlined', + 'SyncOutlined', + 'ExclamationCircleOutlined' +] + +const Icon = (props: {type: string}) => { + if(iconKeys.includes(props.type)) return + return +} + +export default Icon \ No newline at end of file diff --git a/src/components/BadgeStatus/index.vue b/src/components/BadgeStatus/index.vue index 47870618..067ee58b 100644 --- a/src/components/BadgeStatus/index.vue +++ b/src/components/BadgeStatus/index.vue @@ -6,8 +6,7 @@ \ No newline at end of file diff --git a/src/views/device/Instance/Import/index.vue b/src/views/device/Instance/Import/index.vue new file mode 100644 index 00000000..f3e68440 --- /dev/null +++ b/src/views/device/Instance/Import/index.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue new file mode 100644 index 00000000..972da530 --- /dev/null +++ b/src/views/device/Instance/Process/index.vue @@ -0,0 +1,51 @@ + + + \ No newline at end of file diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue new file mode 100644 index 00000000..447a2053 --- /dev/null +++ b/src/views/device/Instance/index.vue @@ -0,0 +1,397 @@ + + + \ No newline at end of file diff --git a/src/views/home/modules/config.ts b/src/views/home/modules/config.ts index 68281b8c..5857b8d0 100644 --- a/src/views/home/modules/config.ts +++ b/src/views/home/modules/config.ts @@ -6,11 +6,11 @@ import { recommendList, bootConfig } from "../index"; // 权限控制 const hasPermission = usePermissionStore().hasPermission; const productPermission = (action: string) => - hasPermission(`device/Product:${action}"`); + hasPermission(`device/Product:${action}`); const devicePermission = (action: string) => - hasPermission(`device/Instance:${action}"`); + hasPermission(`device/Instance:${action}`); const rulePermission = (action: string) => - hasPermission(`rule-engine/Instance:${action}"`); + hasPermission(`rule-engine/Instance:${action}`); // 物联网引导-数据 diff --git a/src/views/link/AccessConfig/components/Media/GB28181.vue b/src/views/link/AccessConfig/components/Media/GB28181.vue new file mode 100644 index 00000000..d302e98e --- /dev/null +++ b/src/views/link/AccessConfig/components/Media/GB28181.vue @@ -0,0 +1,748 @@ + + + + + diff --git a/src/views/link/AccessConfig/components/Media/index.vue b/src/views/link/AccessConfig/components/Media/index.vue index 14e48b22..ef37d143 100644 --- a/src/views/link/AccessConfig/components/Media/index.vue +++ b/src/views/link/AccessConfig/components/Media/index.vue @@ -1,6 +1,6 @@ +const router = useRouter(); +const route = useRoute(); +const useForm = Form.useForm; + +// 消息类型 +const msgType = ref([ + { + label: '钉钉消息', + value: 'dingTalkMessage', + logo: getImage('/notice/dingtalk.png'), + }, + { + label: '群机器人消息', + value: 'dingTalkRobotWebHook', + logo: getImage('/notice/dingTalk-rebot.png'), + }, +]); + +// 表单数据 +const formData = ref({ + description: '', + name: '', + provider: '', + type: NOTICE_METHOD[2].value, + template: { + subject: '', + sendTo: [], + attachments: [], + message: '', + text: '', + }, +}); + +// 根据通知方式展示对应的字段 +watch( + () => formData.value.type, + (val) => { + formData.value.configuration = CONFIG_FIELD_MAP[val]; + msgType.value = MSG_TYPE[val]; + + formData.value.provider = msgType.value[0].value; + }, +); + +// 验证规则 +const formRules = ref({ + type: [{ required: true, message: '请选择通知方式' }], + name: [ + { required: true, message: '请输入名称' }, + { max: 64, message: '最多可输入64个字符' }, + ], + provider: [{ required: true, message: '请选择类型' }], + // 钉钉 + 'configuration.appKey': [ + { required: true, message: '请输入AppKey' }, + { max: 64, message: '最多可输入64个字符' }, + ], + 'configuration.appSecret': [ + { required: true, message: '请输入AppSecret' }, + { max: 64, message: '最多可输入64个字符' }, + ], + // 'configuration.url': [{ required: true, message: '请输入WebHook' }], + // 微信 + 'configuration.corpId': [ + { required: true, message: '请输入corpId' }, + { max: 64, message: '最多可输入64个字符' }, + ], + 'configuration.corpSecret': [ + { required: true, message: '请输入corpSecret' }, + { max: 64, message: '最多可输入64个字符' }, + ], + // 阿里云语音/短信 + 'configuration.regionId': [ + { required: true, message: '请输入RegionId' }, + { max: 64, message: '最多可输入64个字符' }, + ], + 'configuration.accessKeyId': [ + { required: true, message: '请输入AccessKeyId' }, + { max: 64, message: '最多可输入64个字符' }, + ], + 'configuration.secret': [ + { required: true, message: '请输入Secret' }, + { max: 64, message: '最多可输入64个字符' }, + ], + // 邮件 + 'configuration.host': [{ required: true, message: '请输入服务器地址' }], + 'configuration.sender': [{ required: true, message: '请输入发件人' }], + 'configuration.username': [ + { required: true, message: '请输入用户名' }, + { max: 64, message: '最多可输入64个字符' }, + ], + 'configuration.password': [ + { required: true, message: '请输入密码' }, + { max: 64, message: '最多可输入64个字符' }, + ], + // webhook + 'configuration.url': [ + { required: true, message: '请输入Webhook' }, + { + pattern: + /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, + message: 'Webhook需要是一个合法的URL', + }, + ], + description: [{ max: 200, message: '最多可输入200个字符' }], +}); + +const { resetFields, validate, validateInfos, clearValidate } = useForm( + formData.value, + formRules.value, +); +watch( + () => formData.value.type, + () => { + clearValidate(); + }, + { deep: true }, +); + +const getDetail = async () => { + const res = await configApi.detail(route.params.id as string); + // console.log('res: ', res); + formData.value = res.result; + // console.log('formData.value: ', formData.value); +}; +getDetail(); + +/** + * 表单提交 + */ +const btnLoading = ref(false); +const handleSubmit = () => { + validate() + .then(async () => { + // console.log('formData.value: ', formData.value); + btnLoading.value = true; + let res; + if (!formData.value.id) { + res = await configApi.save(formData.value); + } else { + res = await configApi.update(formData.value); + } + // console.log('res: ', res); + if (res?.success) { + message.success('保存成功'); + router.back(); + } + btnLoading.value = false; + }) + .catch((err) => { + console.log('err: ', err); + }); +}; + + + diff --git a/src/views/notice/Template/types.d.ts b/src/views/notice/Template/types.d.ts new file mode 100644 index 00000000..664ab4c9 --- /dev/null +++ b/src/views/notice/Template/types.d.ts @@ -0,0 +1,74 @@ +export interface IHeaders { + id?: number; + key: string; + value: string; +} + +interface IAttachments { + location: string; + name: string; +} +interface IVariableDefinitions { + id: string; + name: string; + type: string; + format: string; +} + +export type TemplateFormData = { + name: string; + type: string; + provider: string; + description: string; + id?: string; + creatorId?: string; + createTime?: number; + configId?: string; + template: { + // 钉钉消息 + agentId?: string; + message?: string; + // 钉钉机器人 + messageType?: string; + markdown?: { + text: string; + title: string; + }; + link?: { + title: string; + picUrl: string; + messageUrl: string; + text: string; + }; + // 微信 + agentId?: string; + // message?: string; + toParty?: string; + toUser?: string; + toTag?: string; + // 邮件 + subject?: string; + sendTo?: string[]; + attachments?: IAttachments[]; + // message?: string; + text?: string; + // 语音 + templateType?: string; + templateCode?: string; + ttsCode?: string; + // message?: string; + playTimes?: number; + calledShowNumbers?: string; + calledNumber?: string; + // 短信 + code?: string; + // message?: string; + phoneNumber?: string; + signName?: string; + // webhook + contextAsBody?: boolean; + body?: string; + }; + variableDefinitions: IVariableDefinitions[]; + +}; \ No newline at end of file diff --git a/src/views/notice/const.ts b/src/views/notice/const.ts index 47a86c03..a0e48d70 100644 --- a/src/views/notice/const.ts +++ b/src/views/notice/const.ts @@ -123,4 +123,72 @@ export const CONFIG_FIELD_MAP = { url: undefined, headers: [], }, +}; + +// 模板 +export const TEMPLATE_FIELD_MAP = { + dingTalk: { + dingTalkMessage: { + agentId: '', + message: '', + }, + dingTalkRobotWebHook: { + message: '', + messageType: '', + markdown: { + text: '', + title: '', + }, + link: { + title: '', + picUrl: '', + messageUrl: '', + text: '', + }, + } + }, + weixin: { + corpMessage: { + agentId: '', + message: '', + toParty: '', + toUser: '', + toTag: '', + }, + officialMessage: {}, + }, + email: { + embedded: { + subject: '', + sendTo: [], + attachments: [], + message: '', + text: '', + } + }, + voice: { + aliyun: { + templateType: '', + templateCode: '', + ttsCode: '', + message: '', + playTimes: undefined, + calledShowNumbers: '', + calledNumber: '', + } + }, + sms: { + aliyunSms: { + code: '', + message: '', + phoneNumber: '', + signName: '', + } + }, + webhook: { + http: { + contextAsBody: false, + body: '' + } + }, }; \ No newline at end of file diff --git a/src/views/system/Basis/index.d.ts b/src/views/system/Basis/index.d.ts new file mode 100644 index 00000000..29c40c1d --- /dev/null +++ b/src/views/system/Basis/index.d.ts @@ -0,0 +1,37 @@ +import type { Rule } from 'ant-design-vue/es/form'; + +/**基本信息表单 */ +export interface formValueType { + title: string; // 系统名称 + headerTheme: string; // 主题色 + apiKey: string; // 高德 API key + 'base-path': string; // 系统后台访问的URL + logo:string, + ico:string, + backgroud:string +} + +export interface formType { + formValue: formValueType, + rulesFrom: Record + logoLoading: boolean, + backLoading: boolean, + iconLoading: boolean, + saveLoading: boolean, + clickSave?: Function, + getDetails: Function +} + +/** +* 图片上传表单 +*/ +export interface uploaderType { + imageTypes: Array; + iconTypes: Array, + beforeLogoUpload: (file: UploadProps['beforeUpload']) => void + handleChangeLogo: (info: UploadChangeParam) => void + beforeBackUpload: (file: UploadProps['beforeUpload']) => void + changeBackUpload: (info: UploadChangeParam) => void + beforeIconUpload: (file: UploadProps['beforeUpload']) => void + changeIconUpload: (info: UploadChangeParam) => void +} diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue new file mode 100644 index 00000000..547ec67f --- /dev/null +++ b/src/views/system/Basis/index.vue @@ -0,0 +1,627 @@ + + + + + diff --git a/yarn.lock b/yarn.lock index 53f50f7d..fd3938f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -796,6 +796,11 @@ dependencies: "@types/webxr" "*" +"@types/web-bluetooth@^0.0.16": + version "0.0.16" + resolved "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz" + integrity sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ== + "@types/webxr@*": version "0.5.0" resolved "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.0.tgz" @@ -1003,6 +1008,28 @@ three "0.143.0" uppercamelcase "^1.1.0" +"@vueuse/core@^9.10.0": + version "9.10.0" + resolved "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz#2ef6e55ca773c5b2db1e3f13b8292af96dd32214" + integrity sha512-CxMewME07qeuzuT/AOIQGv0EhhDoojniqU6pC3F8m5VC76L47UT18DcX88kWlP3I7d3qMJ4u/PD8iSRsy3bmNA== + dependencies: + "@types/web-bluetooth" "^0.0.16" + "@vueuse/metadata" "9.10.0" + "@vueuse/shared" "9.10.0" + vue-demi "*" + +"@vueuse/metadata@9.10.0": + version "9.10.0" + resolved "https://registry.npmjs.org/@vueuse/metadata/-/metadata-9.10.0.tgz" + integrity sha512-G5VZhgTCapzU9rv0Iq2HBrVOSGzOKb+OE668NxhXNcTjUjwYxULkEhAw70FtRLMZc+hxcFAzDZlKYA0xcwNMuw== + +"@vueuse/shared@9.10.0": + version "9.10.0" + resolved "https://registry.npmjs.org/@vueuse/shared/-/shared-9.10.0.tgz" + integrity sha512-vakHJ2ZRklAzqmcVBL38RS7BxdBA4+5poG9NsSyqJxrt9kz0zX3P5CXMy0Hm6LFbZXUgvKdqAS3pUH1zX/5qTQ== + dependencies: + vue-demi "*" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.npmmirror.com/JSONStream/-/JSONStream-1.3.5.tgz" @@ -2030,7 +2057,7 @@ entities@^2.0.0: entities@~2.1.0: version "2.1.0" - resolved "https://registry.npmmirror.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== errno@^0.1.1: @@ -2115,6 +2142,11 @@ esutils@^2.0.2: resolved "https://registry.npmmirror.com/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +event-source-polyfill@^1.0.31: + version "1.0.31" + resolved "https://registry.npmmirror.com/event-source-polyfill/-/event-source-polyfill-1.0.31.tgz#45fb0a6fc1375b2ba597361ba4287ffec5bf2e0c" + integrity sha512-4IJSItgS/41IxN5UVAVuAyczwZF7ZIEsM1XAoUzIHA6A+xzusEZUutdXz2Nr+MQPLxfTiCvqE79/C8HT8fKFvA== + execa@^0.7.0: version "0.7.0" resolved "https://registry.npmmirror.com/execa/-/execa-0.7.0.tgz" @@ -2505,7 +2537,7 @@ header-case@^2.0.4: highlight.js@^11.3.1: version "11.7.0" - resolved "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.7.0.tgz#3ff0165bc843f8c9bce1fd89e2fda9143d24b11e" + resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-11.7.0.tgz" integrity sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ== homedir-polyfill@^1.0.0: @@ -3013,7 +3045,7 @@ lines-and-columns@^1.1.6: linkify-it@^3.0.1: version "3.0.3" - resolved "https://registry.npmmirror.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz" integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== dependencies: uc.micro "^1.0.1" @@ -3095,7 +3127,7 @@ lodash.camelcase@^4.3.0: lodash.flow@^3.5.0: version "3.5.0" - resolved "https://registry.npmmirror.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a" + resolved "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz" integrity sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw== lodash.isfunction@^3.0.9: @@ -3262,32 +3294,32 @@ map-obj@^4.0.0: markdown-it-abbr@^1.0.4: version "1.0.4" - resolved "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz#d66b5364521cbb3dd8aa59dadfba2fb6865c8fd8" + resolved "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz" integrity sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg== markdown-it-anchor@^8.4.1: version "8.6.6" - resolved "https://registry.npmmirror.com/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz#4a12e358c9c2167ee28cb7a5f10e29d6f1ffd7ca" + resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz" integrity sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA== markdown-it-deflist@^2.1.0: version "2.1.0" - resolved "https://registry.npmmirror.com/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz#50d7a56b9544cd81252f7623bd785e28a8dcef5c" + resolved "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz" integrity sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg== markdown-it-emoji@^2.0.0: version "2.0.2" - resolved "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz#cd42421c2fda1537d9cc12b9923f5c8aeb9029c8" + resolved "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz" integrity sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ== markdown-it-footnote@^3.0.3: version "3.0.3" - resolved "https://registry.npmmirror.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8" + resolved "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz" integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w== markdown-it-highlightjs@^3.6.0: version "3.6.0" - resolved "https://registry.npmmirror.com/markdown-it-highlightjs/-/markdown-it-highlightjs-3.6.0.tgz#b567408c633d71e5e4cc33e1d0121a44447d2f29" + resolved "https://registry.npmjs.org/markdown-it-highlightjs/-/markdown-it-highlightjs-3.6.0.tgz" integrity sha512-ex+Lq3cVkprh0GpGwFyc53A/rqY6GGzopPCG1xMsf8Ya3XtGC8Uw9tChN1rWbpyDae7tBBhVHVcMM29h4Btamw== dependencies: highlight.js "^11.3.1" @@ -3295,37 +3327,37 @@ markdown-it-highlightjs@^3.6.0: markdown-it-ins@^3.0.1: version "3.0.1" - resolved "https://registry.npmmirror.com/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz#c09356b917cf1dbf73add0b275d67ab8c73d4b4d" + resolved "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-3.0.1.tgz" integrity sha512-32SSfZqSzqyAmmQ4SHvhxbFqSzPDqsZgMHDwxqPzp+v+t8RsmqsBZRG+RfRQskJko9PfKC2/oxyOs4Yg/CfiRw== markdown-it-mark@^3.0.1: version "3.0.1" - resolved "https://registry.npmmirror.com/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz#51257db58787d78aaf46dc13418d99a9f3f0ebd3" + resolved "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-3.0.1.tgz" integrity sha512-HyxjAu6BRsdt6Xcv6TKVQnkz/E70TdGXEFHRYBGLncRE9lBFwDNLVtFojKxjJWgJ+5XxUwLaHXy+2sGBbDn+4A== markdown-it-sub@^1.0.0: version "1.0.0" - resolved "https://registry.npmmirror.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8" + resolved "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz" integrity sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q== markdown-it-sup@^1.0.0: version "1.0.0" - resolved "https://registry.npmmirror.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3" + resolved "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz" integrity sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ== markdown-it-task-lists@^2.1.1: version "2.1.1" - resolved "https://registry.npmmirror.com/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz#f68f4d2ac2bad5a2c373ba93081a1a6848417088" + resolved "https://registry.npmjs.org/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz" integrity sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA== markdown-it-toc-done-right@^4.2.0: version "4.2.0" - resolved "https://registry.npmmirror.com/markdown-it-toc-done-right/-/markdown-it-toc-done-right-4.2.0.tgz#3ccdce22d5022ffae7b991d07261b1b1de5459d0" + resolved "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-4.2.0.tgz" integrity sha512-UB/IbzjWazwTlNAX0pvWNlJS8NKsOQ4syrXZQ/C72j+jirrsjVRT627lCaylrKJFBQWfRsPmIVQie8x38DEhAQ== markdown-it@^12.3.2: version "12.3.2" - resolved "https://registry.npmmirror.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz" integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== dependencies: argparse "^2.0.1" @@ -3336,7 +3368,7 @@ markdown-it@^12.3.2: mdurl@^1.0.1: version "1.0.1" - resolved "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== meow@^8.0.0: @@ -4761,7 +4793,7 @@ typescript@^4.6.4, typescript@^4.9.3: uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" - resolved "https://registry.npmmirror.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== ufo@^1.0.0: @@ -5077,7 +5109,7 @@ vue-types@^3.0.0: vue3-markdown-it@^1.0.10: version "1.0.10" - resolved "https://registry.npmmirror.com/vue3-markdown-it/-/vue3-markdown-it-1.0.10.tgz#c4b0e94990b3f9d66123ef5b775cd7ea177c609b" + resolved "https://registry.npmjs.org/vue3-markdown-it/-/vue3-markdown-it-1.0.10.tgz" integrity sha512-mTvHu0zl7jrh7ojgaZ+tTpCLiS4CVg4bTgTu4KGhw/cRRY5YgIG8QgFAPu6kCzSW6Znc9a52Beb6hFvF4hSMkQ== dependencies: markdown-it "^12.3.2"