diff --git a/cdTMP/package-lock.json b/cdTMP/package-lock.json index f57342c..fbfbd8b 100644 --- a/cdTMP/package-lock.json +++ b/cdTMP/package-lock.json @@ -18,7 +18,7 @@ "echarts": "^5.4.2", "file2md5": "^1.3.0", "lodash": "^4.17.21", - "mammoth": "^1.7.2", + "mammoth": "^1.8.0", "mitt": "^3.0.0", "monaco-editor": "^0.33.0", "nprogress": "^0.2.0", @@ -28,7 +28,7 @@ "qs": "^6.11.2", "sortablejs": "^1.15.0", "tinymce": "^6.8.3", - "vue": "^3.4.31", + "vue": "^3.4.33", "vue-clipboard3": "^2.0.0", "vue-color-kit": "^1.0.5", "vue-echarts": "^6.5.5", @@ -54,7 +54,8 @@ "postcss": "^8.4.38", "prettier": "^2.8.8", "tailwindcss": "^3.3.2", - "vite": "^5.3.2" + "typescript": "^5.5.3", + "vite": "^5.3.4" } }, "node_modules/@alloc/quick-lru": { @@ -1501,49 +1502,53 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.31.tgz", - "integrity": "sha512-skOiodXWTV3DxfDhB4rOf3OGalpITLlgCeOwb+Y9GJpfQ8ErigdBUHomBzvG78JoVE8MJoQsb+qhZiHfKeNeEg==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.33.tgz", + "integrity": "sha512-MoIREbkdPQlnGfSKDMgzTqzqx5nmEjIc0ydLVYlTACGBsfvOJ4tHSbZXKVF536n6fB+0eZaGEOqsGThPpdvF5A==", + "license": "MIT", "dependencies": { "@babel/parser": "^7.24.7", - "@vue/shared": "3.4.31", + "@vue/shared": "3.4.33", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-dom": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.31.tgz", - "integrity": "sha512-wK424WMXsG1IGMyDGyLqB+TbmEBFM78hIsOJ9QwUVLGrcSk0ak6zYty7Pj8ftm7nEtdU/DGQxAXp0/lM/2cEpQ==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.33.tgz", + "integrity": "sha512-GzB8fxEHKw0gGet5BKlpfXEqoBnzSVWwMnT+dc25wE7pFEfrU/QsvjZMP9rD4iVXHBBoemTct8mN0GJEI6ZX5A==", + "license": "MIT", "dependencies": { - "@vue/compiler-core": "3.4.31", - "@vue/shared": "3.4.31" + "@vue/compiler-core": "3.4.33", + "@vue/shared": "3.4.33" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.31.tgz", - "integrity": "sha512-einJxqEw8IIJxzmnxmJBuK2usI+lJonl53foq+9etB2HAzlPjAS/wa7r0uUpXw5ByX3/0uswVSrjNb17vJm1kQ==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.33.tgz", + "integrity": "sha512-7rk7Vbkn21xMwIUpHQR4hCVejwE6nvhBOiDgoBcR03qvGqRKA7dCBSsHZhwhYUsmjlbJ7OtD5UFIyhP6BY+c8A==", + "license": "MIT", "dependencies": { "@babel/parser": "^7.24.7", - "@vue/compiler-core": "3.4.31", - "@vue/compiler-dom": "3.4.31", - "@vue/compiler-ssr": "3.4.31", - "@vue/shared": "3.4.31", + "@vue/compiler-core": "3.4.33", + "@vue/compiler-dom": "3.4.33", + "@vue/compiler-ssr": "3.4.33", + "@vue/shared": "3.4.33", "estree-walker": "^2.0.2", "magic-string": "^0.30.10", - "postcss": "^8.4.38", + "postcss": "^8.4.39", "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.31.tgz", - "integrity": "sha512-RtefmITAje3fJ8FSg1gwgDhdKhZVntIVbwupdyZDSifZTRMiWxWehAOTCc8/KZDnBOcYQ4/9VWxsTbd3wT0hAA==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.33.tgz", + "integrity": "sha512-0WveC9Ai+eT/1b6LCV5IfsufBZ0HP7pSSTdDjcuW302tTEgoBw8rHVHKPbGUtzGReUFCRXbv6zQDDgucnV2WzQ==", + "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.4.31", - "@vue/shared": "3.4.31" + "@vue/compiler-dom": "3.4.33", + "@vue/shared": "3.4.33" } }, "node_modules/@vue/devtools-api": { @@ -1552,49 +1557,54 @@ "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" }, "node_modules/@vue/reactivity": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.31.tgz", - "integrity": "sha512-VGkTani8SOoVkZNds1PfJ/T1SlAIOf8E58PGAhIOUDYPC4GAmFA2u/E14TDAFcf3vVDKunc4QqCe/SHr8xC65Q==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.33.tgz", + "integrity": "sha512-B24QIelahDbyHipBgbUItQblbd4w5HpG3KccL+YkGyo3maXyS253FzcTR3pSz739OTphmzlxP7JxEMWBpewilA==", + "license": "MIT", "dependencies": { - "@vue/shared": "3.4.31" + "@vue/shared": "3.4.33" } }, "node_modules/@vue/runtime-core": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.31.tgz", - "integrity": "sha512-LDkztxeUPazxG/p8c5JDDKPfkCDBkkiNLVNf7XZIUnJ+66GVGkP+TIh34+8LtPisZ+HMWl2zqhIw0xN5MwU1cw==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.33.tgz", + "integrity": "sha512-6wavthExzT4iAxpe8q37/rDmf44nyOJGISJPxCi9YsQO+8w9v0gLCFLfH5TzD1V1AYrTAdiF4Y1cgUmP68jP6w==", + "license": "MIT", "dependencies": { - "@vue/reactivity": "3.4.31", - "@vue/shared": "3.4.31" + "@vue/reactivity": "3.4.33", + "@vue/shared": "3.4.33" } }, "node_modules/@vue/runtime-dom": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.31.tgz", - "integrity": "sha512-2Auws3mB7+lHhTFCg8E9ZWopA6Q6L455EcU7bzcQ4x6Dn4cCPuqj6S2oBZgN2a8vJRS/LSYYxwFFq2Hlx3Fsaw==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.33.tgz", + "integrity": "sha512-iHsMCUSFJ+4z432Bn9kZzHX+zOXa6+iw36DaVRmKYZpPt9jW9riF32SxNwB124i61kp9+AZtheQ/mKoJLerAaQ==", + "license": "MIT", "dependencies": { - "@vue/reactivity": "3.4.31", - "@vue/runtime-core": "3.4.31", - "@vue/shared": "3.4.31", + "@vue/reactivity": "3.4.33", + "@vue/runtime-core": "3.4.33", + "@vue/shared": "3.4.33", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.31.tgz", - "integrity": "sha512-D5BLbdvrlR9PE3by9GaUp1gQXlCNadIZytMIb8H2h3FMWJd4oUfkUTEH2wAr3qxoRz25uxbTcbqd3WKlm9EHQA==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.33.tgz", + "integrity": "sha512-jTH0d6gQcaYideFP/k0WdEu8PpRS9MF8d0b6SfZzNi+ap972pZ0TNIeTaESwdOtdY0XPVj54XEJ6K0wXxir4fw==", + "license": "MIT", "dependencies": { - "@vue/compiler-ssr": "3.4.31", - "@vue/shared": "3.4.31" + "@vue/compiler-ssr": "3.4.33", + "@vue/shared": "3.4.33" }, "peerDependencies": { - "vue": "3.4.31" + "vue": "3.4.33" } }, "node_modules/@vue/shared": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.31.tgz", - "integrity": "sha512-Yp3wtJk//8cO4NItOPpi3QkLExAr/aLBGZMmTtW9WpdwBCJpRM6zj9WgWktXAl8IDIozwNMByT45JP3tO3ACWA==" + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.33.tgz", + "integrity": "sha512-aoRY0jQk3A/cuvdkodTrM4NMfxco8n55eG4H7ML/CRy7OryHfiqvug4xrCBBMbbN+dvXAetDDwZW9DXWWjBntA==", + "license": "MIT" }, "node_modules/@vueuse/core": { "version": "10.10.0", @@ -2318,7 +2328,8 @@ "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "license": "MIT" }, "node_modules/dayjs": { "version": "1.11.8", @@ -2431,6 +2442,7 @@ "version": "4.5.0", "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -2784,7 +2796,8 @@ "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", @@ -3572,9 +3585,10 @@ } }, "node_modules/mammoth": { - "version": "1.7.2", - "resolved": "https://registry.npmmirror.com/mammoth/-/mammoth-1.7.2.tgz", - "integrity": "sha512-MqWU2hcLf1I5QMKyAbfJCvrLxnv5WztrAQyorfZ+WPq7Hk82vZFmvfR2/64ajIPpM4jlq0TXp1xZvp/FFaL1Ug==", + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/mammoth/-/mammoth-1.8.0.tgz", + "integrity": "sha512-pJNfxSk9IEGVpau+tsZFz22ofjUsl2mnA5eT8PjPs2n0BP+rhVte4Nez6FdgEuxv3IGI3afiV46ImKqTGDVlbA==", + "license": "BSD-2-Clause", "dependencies": { "@xmldom/xmldom": "^0.8.6", "argparse": "~1.0.3", @@ -3939,9 +3953,10 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -4021,9 +4036,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.39.tgz", + "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", "funding": [ { "type": "opencollective", @@ -4038,9 +4053,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { @@ -4810,6 +4826,20 @@ "node": ">=10" } }, + "node_modules/typescript": { + "version": "5.5.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/underscore": { "version": "1.13.6", "resolved": "https://registry.npmmirror.com/underscore/-/underscore-1.13.6.tgz", @@ -4852,13 +4882,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/vite": { - "version": "5.3.2", - "resolved": "https://registry.npmmirror.com/vite/-/vite-5.3.2.tgz", - "integrity": "sha512-6lA7OBHBlXUxiJxbO5aAY2fsHHzDr1q7DvXYnyZycRs2Dz+dXBWuhpWHvmljTRTpQC2uvGmUFFkSHF2vGo90MA==", + "version": "5.3.4", + "resolved": "https://registry.npmmirror.com/vite/-/vite-5.3.4.tgz", + "integrity": "sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.38", + "postcss": "^8.4.39", "rollup": "^4.13.0" }, "bin": { @@ -4907,15 +4938,16 @@ } }, "node_modules/vue": { - "version": "3.4.31", - "resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.31.tgz", - "integrity": "sha512-njqRrOy7W3YLAlVqSKpBebtZpDVg21FPoaq1I7f/+qqBThK9ChAIjkRWgeP6Eat+8C+iia4P3OYqpATP21BCoQ==", + "version": "3.4.33", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.33.tgz", + "integrity": "sha512-VdMCWQOummbhctl4QFMcW6eNtXHsFyDlX60O/tsSQuCcuDOnJ1qPOhhVla65Niece7xq/P2zyZReIO5mP+LGTQ==", + "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.4.31", - "@vue/compiler-sfc": "3.4.31", - "@vue/runtime-dom": "3.4.31", - "@vue/server-renderer": "3.4.31", - "@vue/shared": "3.4.31" + "@vue/compiler-dom": "3.4.33", + "@vue/compiler-sfc": "3.4.33", + "@vue/runtime-dom": "3.4.33", + "@vue/server-renderer": "3.4.33", + "@vue/shared": "3.4.33" }, "peerDependencies": { "typescript": "*" diff --git a/cdTMP/package.json b/cdTMP/package.json index 0f3ec8e..0eb68c2 100644 --- a/cdTMP/package.json +++ b/cdTMP/package.json @@ -21,7 +21,7 @@ "echarts": "^5.4.2", "file2md5": "^1.3.0", "lodash": "^4.17.21", - "mammoth": "^1.7.2", + "mammoth": "^1.8.0", "mitt": "^3.0.0", "monaco-editor": "^0.33.0", "nprogress": "^0.2.0", @@ -31,7 +31,7 @@ "qs": "^6.11.2", "sortablejs": "^1.15.0", "tinymce": "^6.8.3", - "vue": "^3.4.31", + "vue": "^3.4.33", "vue-clipboard3": "^2.0.0", "vue-color-kit": "^1.0.5", "vue-echarts": "^6.5.5", @@ -57,6 +57,7 @@ "postcss": "^8.4.38", "prettier": "^2.8.8", "tailwindcss": "^3.3.2", - "vite": "^5.3.2" + "typescript": "^5.5.3", + "vite": "^5.3.4" } } diff --git a/cdTMP/src/api/project/project.js b/cdTMP/src/api/project/project.js index 444026f..6fdc97e 100644 --- a/cdTMP/src/api/project/project.js +++ b/cdTMP/src/api/project/project.js @@ -83,5 +83,18 @@ export default { id: projectId } }) + }, + /** + * 根据项目id查询项目->查看全部时间 + * @returns 返回看板所有信息 + */ + getDocumentTimeShow(projectId) { + return request({ + url: `/testmanage/project/document_time_show`, + method: "get", + params: { + id: projectId + } + }) } } diff --git a/cdTMP/src/components/ma-crud/components/searchFormItem/form-input.vue b/cdTMP/src/components/ma-crud/components/searchFormItem/form-input.vue index 4d00392..5c2f490 100644 --- a/cdTMP/src/components/ma-crud/components/searchFormItem/form-input.vue +++ b/cdTMP/src/components/ma-crud/components/searchFormItem/form-input.vue @@ -1,12 +1,3 @@ - diff --git a/cdTMP/src/components/ma-form/formItem/form-input-number.vue b/cdTMP/src/components/ma-form/formItem/form-input-number.vue index aef3e4f..693c9b9 100644 --- a/cdTMP/src/components/ma-form/formItem/form-input-number.vue +++ b/cdTMP/src/components/ma-form/formItem/form-input-number.vue @@ -1,12 +1,3 @@ - + + + @@ -119,6 +122,7 @@ const crudColumns = ref([ title: "ID", align: "center", width: 50, + hide: true, dataIndex: "id", commonRules: [{ required: true, message: "ID必填" }], validateTrigger: "blur" @@ -132,7 +136,8 @@ const crudColumns = ref([ search: true, validateTrigger: "blur", placeholder: "请输入文档中设计需求的标识", - help: '若不知道则填"无"或不填' + help: '若不知道则填"无"或不填', + openPrepend: true }, { title: "设需名称", @@ -191,8 +196,7 @@ const crudColumns = ref([ { title: "接口来源", dataIndex: "source", - hide: true, - extra: "接口独有四个字段,决定大纲的接口列表信息" + hide: true }, { title: "目的地", @@ -206,11 +210,10 @@ const crudColumns = ref([ { title: "接口类型", dataIndex: "type", - hide: true, - extra: "接口类型例如:网络" + hide: true }, { - title: "接口协议", + title: "接口内容", dataIndex: "protocal", hide: true } @@ -232,6 +235,10 @@ const fileInputRef = ref(null) const handleAddFileInputDemand = () => { fileInputRef.value.open() } + +defineOptions({ + name: "dut" +}) diff --git a/cdTMP/src/views/project/dut/tools/parser.ts b/cdTMP/src/views/project/dut/tools/parser.ts new file mode 100644 index 0000000..eb893b3 --- /dev/null +++ b/cdTMP/src/views/project/dut/tools/parser.ts @@ -0,0 +1,174 @@ +// 根据后端定义,不能更改的枚举 +enum DemandType { + gn = "1", + xn = "2", + jk = "3", + kkx = "4", + aqx = "5", + other = "6" +} + +// 数据每一项的结构 +interface DemandObj { + chapter: string + title: string + ident?: string // 如果其标题有()则放入 + demandType: DemandType + content: string +} + +// 定义h元素对象接口 +interface IHobj { + level: number // h1 -> 1 + title: string // 标题文字 + ident?: string // 如果有()则放入 + index: number // 该标题的索引,先map的时候不设置后续再排列 + demandType: DemandType +} + +// h元素对象带计算出的章节号的对象 +interface IHobjWithChapter extends IHobj { + chapter: string +} + +export class HtmlParser { + domArray: Element[] // 初始化得到一个元素的集合 + hWithChapter: IHobjWithChapter[] + constructor(htmlText: string) { + const parser = new DOMParser() + const doc = parser.parseFromString(htmlText, "text/html") + this.domArray = Array.from(doc.body.children) + // 解析domArray将h元素加入 + const HDomArray = this.domArray.filter((domItem) => domItem.tagName.startsWith("H")) + const storeArray: IHobj[] = [] + HDomArray.forEach((it, i) => { + !it.textContent && (it.textContent = "") + // 这里判断是什么类型的设计需求 -> 后续可以添加 + let type: DemandType = DemandType.gn + if (it.textContent.includes("接口")) { + type = DemandType.jk + } else if (it.textContent.includes("性能")) { + type = DemandType.xn + } else if (it.textContent.includes("可靠")) { + type = DemandType.kkx + } else if (it.textContent.includes("安全")) { + type = DemandType.aqx + } + // 获取章节号 + const level = +it.tagName.slice(1) + // 1.判断当前的章节级别的前一个级别的level是否一样/小于/大于 + let index = 0 + if (i > 0) { + // 找上一个标题对象的level + if (level === storeArray[i - 1].level) { + index = storeArray[i - 1].index + 1 + } else if (level < storeArray[i - 1].level) { + // 如果等级小于上一个标题对象,找storeArray里面level一样的长度 + for (let j = storeArray.length - 1; j >= 0; j--) { + if (storeArray[j].level === level) { + index = storeArray[j].index + 1 + break + } + } + } + } + storeArray.push({ + level: level, + title: it.textContent, + ident: it.textContent.match(/[\((](.*?)[\))]/)?.[1], + index: index, + demandType: type + }) + }) + // 直接将storeArray计算出章节号 + const chapterArray: any[] = storeArray.map((it, indx) => { + let str = it.index + 1 + "" + for (let i = it.level - 1; i > 0; i--) { + for (let j = indx - 1; j >= 0; j--) { + if (storeArray[j].level === i) { + str = storeArray[j].index + 1 + "." + str + break + } + } + } + return { + ...it, + chapter: str + } + }) + this.hWithChapter = chapterArray + } + /** + * 将所有Element元素遍历,输出列表格式 + */ + parseToArray(): DemandObj[] { + const resArr: DemandObj[] = [] + let index = 0 + let currentHElement: IHobjWithChapter = this.hWithChapter[index] + let adapterIndex: number = 1 + this.domArray.forEach((item) => { + // 1.如果循环到H元素,将其存入 + if (item.tagName.startsWith("H")) { + const text = item.textContent + if (text !== currentHElement.title) { + currentHElement = this.hWithChapter[index + 1] + index++ + adapterIndex = 1 + } + } else { + // 2.构造每一项放入 - chapter和content计算 + let content = "" + let ident = currentHElement.ident + if (!ident) { + ident = "" + } + // 这里对图片进行处理 + if (item.querySelector("img")) { + const img = item.querySelector("img") + if (img) { + const strblob = img.src + "" + const blob = strblob.split(",")[1] + content = `` + } + ident += `-g${adapterIndex}` + adapterIndex++ + resArr.push({ + chapter: currentHElement.chapter, + title: currentHElement.title, + ident: ident, + demandType: currentHElement.demandType, + content + }) + } else { + // 如果不是图片进行判断 + if (item.textContent) { + if (item.tagName === "TABLE") { + content = item.outerHTML + ident += `-t${adapterIndex}` + adapterIndex++ + } + if (item.tagName === "P" && !item.querySelector("img")) { + content = item.innerHTML.trim() + ident += `-p${adapterIndex}` + adapterIndex++ + } + if (item.tagName === "OL" || item.tagName === "UL") { + content = item.innerHTML.trim() + ident += `-u${adapterIndex}` + adapterIndex++ + } + // title要将括号去除 + resArr.push({ + chapter: currentHElement.chapter, + title: currentHElement.title, + ident: ident, + demandType: currentHElement.demandType, + content + }) + } + } + } + }) + return resArr + } +} diff --git a/cdTMP/src/views/project/problem/index.vue b/cdTMP/src/views/project/problem/index.vue index 462b2f6..38bb453 100644 --- a/cdTMP/src/views/project/problem/index.vue +++ b/cdTMP/src/views/project/problem/index.vue @@ -50,6 +50,10 @@ const fetchProblemData = async ( } } fetchProblemData() + +defineOptions({ + name: "problem" +}) diff --git a/cdTMP/src/views/project/round/index.vue b/cdTMP/src/views/project/round/index.vue index a36698e..6b2fcbd 100644 --- a/cdTMP/src/views/project/round/index.vue +++ b/cdTMP/src/views/project/round/index.vue @@ -2,7 +2,10 @@
- + + + +
@@ -81,6 +84,7 @@ const crudColumns = ref([ title: "ID", width: 50, align: "center", + hide: true, dataIndex: "id", commonRules: [{ required: true, message: "ID是必填" }], validateTrigger: "blur" @@ -152,7 +156,9 @@ const crudColumns = ref([ dataIndex: "version", search: true, commonRules: [{ required: true, message: "版本必填" }], - validateTrigger: "blur" + validateTrigger: "blur", + help: "填写不带V字符", + openPrepend: true }, { title: "用户标识", @@ -271,6 +277,10 @@ const crudColumns = ref([ } } ]) + +defineOptions({ + name: "round" +}) diff --git a/cdTMP/src/views/project/testDemand/index.vue b/cdTMP/src/views/project/testDemand/index.vue index 8e3b4d1..f053222 100644 --- a/cdTMP/src/views/project/testDemand/index.vue +++ b/cdTMP/src/views/project/testDemand/index.vue @@ -8,15 +8,18 @@ + diff --git a/cdTMP/src/views/redirect/index.vue b/cdTMP/src/views/redirect/index.vue index 3a67128..82eb464 100644 --- a/cdTMP/src/views/redirect/index.vue +++ b/cdTMP/src/views/redirect/index.vue @@ -8,6 +8,10 @@ const router = useRouter() const route = useRoute() const gotoPath = route.params.path as string router.replace({ path: gotoPath }) + +defineOptions({ + name: "redirect" +}) diff --git a/cdTMP/src/views/testmanage/projBoard/cpns/TimeLine.vue b/cdTMP/src/views/testmanage/projBoard/cpns/TimeLine.vue index 294ab4e..e18b421 100644 --- a/cdTMP/src/views/testmanage/projBoard/cpns/TimeLine.vue +++ b/cdTMP/src/views/testmanage/projBoard/cpns/TimeLine.vue @@ -25,20 +25,46 @@
测试人员填写的项目开始时间、结束时间、轮次时间均会影响生成文档的时间! + 展示目前文档生成的日期
+ + + + +

+ +

+
+