1111
This commit is contained in:
@@ -10,7 +10,9 @@ module.exports = {
|
|||||||
"@vue/typescript/recommended",
|
"@vue/typescript/recommended",
|
||||||
"plugin:@typescript-eslint/recommended"
|
"plugin:@typescript-eslint/recommended"
|
||||||
],
|
],
|
||||||
|
parser: "vue-eslint-parser",
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020,
|
||||||
ecmaFeatures: {
|
ecmaFeatures: {
|
||||||
|
|||||||
@@ -2,10 +2,18 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"],
|
"@/*": [
|
||||||
"@cps/*": ["src/components/*"]
|
"src/*"
|
||||||
|
],
|
||||||
|
"@cps/*": [
|
||||||
|
"src/components/*"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"jsx": "preserve"
|
"jsx": "preserve"
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "dist", "build"]
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"dist",
|
||||||
|
"build"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
140
cdTMP/package-lock.json
generated
140
cdTMP/package-lock.json
generated
@@ -11,7 +11,7 @@
|
|||||||
"@arco-design/color": "^0.4.0",
|
"@arco-design/color": "^0.4.0",
|
||||||
"@arco-design/web-vue": "^2.56.0",
|
"@arco-design/web-vue": "^2.56.0",
|
||||||
"@tinymce/tinymce-vue": "^6.0.1",
|
"@tinymce/tinymce-vue": "^6.0.1",
|
||||||
"@vueuse/core": "^10.11.0",
|
"@vueuse/core": "^10.11.1",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"dayjs": "^1.11.12",
|
"dayjs": "^1.11.12",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"postcss-import": "^16.1.0",
|
"postcss-import": "^16.1.0",
|
||||||
"qs": "^6.13.0",
|
"qs": "^6.13.0",
|
||||||
"tinymce": "^6.8.4",
|
"tinymce": "^6.8.4",
|
||||||
"vue": "^3.4.36",
|
"vue": "^3.4.37",
|
||||||
"vue-clipboard3": "^2.0.0",
|
"vue-clipboard3": "^2.0.0",
|
||||||
"vue-color-kit": "^1.0.6",
|
"vue-color-kit": "^1.0.6",
|
||||||
"vue-echarts": "^6.5.5",
|
"vue-echarts": "^6.5.5",
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
"less-loader": "^12.2.0",
|
"less-loader": "^12.2.0",
|
||||||
"postcss": "^8.4.41",
|
"postcss": "^8.4.41",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"tailwindcss": "^3.4.8",
|
"tailwindcss": "^3.4.9",
|
||||||
"typescript": "^5.5.3",
|
"typescript": "^5.5.3",
|
||||||
"vite": "^5.4.0"
|
"vite": "^5.4.0"
|
||||||
}
|
}
|
||||||
@@ -1550,39 +1550,39 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-core": {
|
"node_modules/@vue/compiler-core": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.37.tgz",
|
||||||
"integrity": "sha512-qBkndgpwFKdupmOPoiS10i7oFdN7a+4UNDlezD0GlQ1kuA1pNrscg9g12HnB5E8hrWSuEftRsbJhL1HI2zpJhg==",
|
"integrity": "sha512-ZDDT/KiLKuCRXyzWecNzC5vTcubGz4LECAtfGPENpo0nrmqJHwuWtRLxk/Sb9RAKtR9iFflFycbkjkY+W/PZUQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/parser": "^7.24.7",
|
"@babel/parser": "^7.24.7",
|
||||||
"@vue/shared": "3.4.36",
|
"@vue/shared": "3.4.37",
|
||||||
"entities": "^5.0.0",
|
"entities": "^5.0.0",
|
||||||
"estree-walker": "^2.0.2",
|
"estree-walker": "^2.0.2",
|
||||||
"source-map-js": "^1.2.0"
|
"source-map-js": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-dom": {
|
"node_modules/@vue/compiler-dom": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.37.tgz",
|
||||||
"integrity": "sha512-eEIjy4GwwZTFon/Y+WO8tRRNGqylaRlA79T1RLhUpkOzJ7EtZkkb8MurNfkqY6x6Qiu0R7ESspEF7GkPR/4yYg==",
|
"integrity": "sha512-rIiSmL3YrntvgYV84rekAtU/xfogMUJIclUMeIKEtVBFngOL3IeZHhsH3UaFEgB5iFGpj6IW+8YuM/2Up+vVag==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-core": "3.4.36",
|
"@vue/compiler-core": "3.4.37",
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-sfc": {
|
"node_modules/@vue/compiler-sfc": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.37.tgz",
|
||||||
"integrity": "sha512-rhuHu7qztt/rNH90dXPTzhB7hLQT2OC4s4GrPVqmzVgPY4XBlfWmcWzn4bIPEWNImt0CjO7kfHAf/1UXOtx3vw==",
|
"integrity": "sha512-vCfetdas40Wk9aK/WWf8XcVESffsbNkBQwS5t13Y/PcfqKfIwJX2gF+82th6dOpnpbptNMlMjAny80li7TaCIg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/parser": "^7.24.7",
|
"@babel/parser": "^7.24.7",
|
||||||
"@vue/compiler-core": "3.4.36",
|
"@vue/compiler-core": "3.4.37",
|
||||||
"@vue/compiler-dom": "3.4.36",
|
"@vue/compiler-dom": "3.4.37",
|
||||||
"@vue/compiler-ssr": "3.4.36",
|
"@vue/compiler-ssr": "3.4.37",
|
||||||
"@vue/shared": "3.4.36",
|
"@vue/shared": "3.4.37",
|
||||||
"estree-walker": "^2.0.2",
|
"estree-walker": "^2.0.2",
|
||||||
"magic-string": "^0.30.10",
|
"magic-string": "^0.30.10",
|
||||||
"postcss": "^8.4.40",
|
"postcss": "^8.4.40",
|
||||||
@@ -1590,13 +1590,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-ssr": {
|
"node_modules/@vue/compiler-ssr": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.37.tgz",
|
||||||
"integrity": "sha512-Wt1zyheF0zVvRJyhY74uxQbnkXV2Le/JPOrAxooR4rFYKC7cFr+cRqW6RU3cM/bsTy7sdZ83IDuy/gLPSfPGng==",
|
"integrity": "sha512-TyAgYBWrHlFrt4qpdACh8e9Ms6C/AZQ6A6xLJaWrCL8GCX5DxMzxyeFAEMfU/VFr4tylHm+a2NpfJpcd7+20XA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-dom": "3.4.36",
|
"@vue/compiler-dom": "3.4.37",
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/devtools-api": {
|
"node_modules/@vue/devtools-api": {
|
||||||
@@ -1606,64 +1606,64 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@vue/reactivity": {
|
"node_modules/@vue/reactivity": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.37.tgz",
|
||||||
"integrity": "sha512-wN1aoCwSoqrt1yt8wO0gc13QaC+Vk1o6AoSt584YHNnz6TGDhh1NCMUYgAnvp4HEIkLdGsaC1bvu/P+wpoDEXw==",
|
"integrity": "sha512-UmdKXGx0BZ5kkxPqQr3PK3tElz6adTey4307NzZ3whZu19i5VavYal7u2FfOmAzlcDVgE8+X0HZ2LxLb/jgbYw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/runtime-core": {
|
"node_modules/@vue/runtime-core": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.37.tgz",
|
||||||
"integrity": "sha512-9+TR14LAVEerZWLOm/N/sG2DVYhrH2bKgFrbH/FVt/Q8Jdw4OtdcGMRC6Tx8VAo0DA1eqAqrZaX0fbOaOxxZ4A==",
|
"integrity": "sha512-MNjrVoLV/sirHZoD7QAilU1Ifs7m/KJv4/84QVbE6nyAZGQNVOa1HGxaOzp9YqCG+GpLt1hNDC4RbH+KtanV7w==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/reactivity": "3.4.36",
|
"@vue/reactivity": "3.4.37",
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/runtime-dom": {
|
"node_modules/@vue/runtime-dom": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.37.tgz",
|
||||||
"integrity": "sha512-2Qe2fKkLxgZBVvHrG0QMNLL4bsx7Ae88pyXebY2WnQYABpOnGYvA+axMbcF9QwM4yxnsv+aELbC0eiNVns7mGw==",
|
"integrity": "sha512-Mg2EwgGZqtwKrqdL/FKMF2NEaOHuH+Ks9TQn3DHKyX//hQTYOun+7Tqp1eo0P4Ds+SjltZshOSRq6VsU0baaNg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/reactivity": "3.4.36",
|
"@vue/reactivity": "3.4.37",
|
||||||
"@vue/runtime-core": "3.4.36",
|
"@vue/runtime-core": "3.4.37",
|
||||||
"@vue/shared": "3.4.36",
|
"@vue/shared": "3.4.37",
|
||||||
"csstype": "^3.1.3"
|
"csstype": "^3.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/server-renderer": {
|
"node_modules/@vue/server-renderer": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.37.tgz",
|
||||||
"integrity": "sha512-2XW90Rq8+Y7S1EIsAuubZVLm0gCU8HYb5mRAruFdwfC3XSOU5/YKePz29csFzsch8hXaY5UHh7ZMddmi1XTJEA==",
|
"integrity": "sha512-jZ5FAHDR2KBq2FsRUJW6GKDOAG9lUTX8aBEGq4Vf6B/35I9fPce66BornuwmqmKgfiSlecwuOb6oeoamYMohkg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-ssr": "3.4.36",
|
"@vue/compiler-ssr": "3.4.37",
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "3.4.36"
|
"vue": "3.4.37"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/shared": {
|
"node_modules/@vue/shared": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.37.tgz",
|
||||||
"integrity": "sha512-fdPLStwl1sDfYuUftBaUVn2pIrVFDASYerZSrlBvVBfylObPA1gtcWJHy5Ox8jLEJ524zBibss488Q3SZtU1uA==",
|
"integrity": "sha512-nIh8P2fc3DflG8+5Uw8PT/1i17ccFn0xxN/5oE9RfV5SVnd7G0XEFRwakrnNFE/jlS95fpGXDVG5zDETS26nmg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@vueuse/core": {
|
"node_modules/@vueuse/core": {
|
||||||
"version": "10.11.0",
|
"version": "10.11.1",
|
||||||
"resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.1.tgz",
|
||||||
"integrity": "sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==",
|
"integrity": "sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/web-bluetooth": "^0.0.20",
|
"@types/web-bluetooth": "^0.0.20",
|
||||||
"@vueuse/metadata": "10.11.0",
|
"@vueuse/metadata": "10.11.1",
|
||||||
"@vueuse/shared": "10.11.0",
|
"@vueuse/shared": "10.11.1",
|
||||||
"vue-demi": ">=0.14.8"
|
"vue-demi": ">=0.14.8"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
@@ -1697,18 +1697,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vueuse/metadata": {
|
"node_modules/@vueuse/metadata": {
|
||||||
"version": "10.11.0",
|
"version": "10.11.1",
|
||||||
"resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.11.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.11.1.tgz",
|
||||||
"integrity": "sha512-kQX7l6l8dVWNqlqyN3ePW3KmjCQO3ZMgXuBMddIu83CmucrsBfXlH+JoviYyRBws/yLTQO8g3Pbw+bdIoVm4oQ==",
|
"integrity": "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/antfu"
|
"url": "https://github.com/sponsors/antfu"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vueuse/shared": {
|
"node_modules/@vueuse/shared": {
|
||||||
"version": "10.11.0",
|
"version": "10.11.1",
|
||||||
"resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.11.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.11.1.tgz",
|
||||||
"integrity": "sha512-fyNoIXEq3PfX1L3NkNhtVQUSRtqYwJtJg+Bp9rIzculIZWHTkKSysujrOk2J+NrRulLTQH9+3gGSfYLWSEWU1A==",
|
"integrity": "sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue-demi": ">=0.14.8"
|
"vue-demi": ">=0.14.8"
|
||||||
@@ -4957,9 +4957,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/tailwindcss": {
|
"node_modules/tailwindcss": {
|
||||||
"version": "3.4.8",
|
"version": "3.4.9",
|
||||||
"resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-3.4.8.tgz",
|
"resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-3.4.9.tgz",
|
||||||
"integrity": "sha512-GkP17r9GQkxgZ9FKHJQEnjJuKBcbFhMFzKu5slmN6NjlCuFnYJMQ8N4AZ6VrUyiRXlDtPKHkesuQ/MS913Nvdg==",
|
"integrity": "sha512-1SEOvRr6sSdV5IDf9iC+NU4dhwdqzF4zKKq3sAbasUWHEM6lsMhX+eNN5gkPx1BvLFEnZQEUFbXnGj8Qlp83Pg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -5307,16 +5307,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vue": {
|
"node_modules/vue": {
|
||||||
"version": "3.4.36",
|
"version": "3.4.37",
|
||||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.36.tgz",
|
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.37.tgz",
|
||||||
"integrity": "sha512-mIFvbLgjODfx3Iy1SrxOsiPpDb8Bo3EU+87ioimOZzZTOp15IEdAels70IjBOLO3ZFlLW5AhdwY4dWbXVQKYow==",
|
"integrity": "sha512-3vXvNfkKTBsSJ7JP+LyR7GBuwQuckbWvuwAid3xbqK9ppsKt/DUvfqgZ48fgOLEfpy1IacL5f8QhUVl77RaI7A==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-dom": "3.4.36",
|
"@vue/compiler-dom": "3.4.37",
|
||||||
"@vue/compiler-sfc": "3.4.36",
|
"@vue/compiler-sfc": "3.4.37",
|
||||||
"@vue/runtime-dom": "3.4.36",
|
"@vue/runtime-dom": "3.4.37",
|
||||||
"@vue/server-renderer": "3.4.36",
|
"@vue/server-renderer": "3.4.37",
|
||||||
"@vue/shared": "3.4.36"
|
"@vue/shared": "3.4.37"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "*"
|
"typescript": "*"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"@arco-design/color": "^0.4.0",
|
"@arco-design/color": "^0.4.0",
|
||||||
"@arco-design/web-vue": "^2.56.0",
|
"@arco-design/web-vue": "^2.56.0",
|
||||||
"@tinymce/tinymce-vue": "^6.0.1",
|
"@tinymce/tinymce-vue": "^6.0.1",
|
||||||
"@vueuse/core": "^10.11.0",
|
"@vueuse/core": "^10.11.1",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"dayjs": "^1.11.12",
|
"dayjs": "^1.11.12",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"postcss-import": "^16.1.0",
|
"postcss-import": "^16.1.0",
|
||||||
"qs": "^6.13.0",
|
"qs": "^6.13.0",
|
||||||
"tinymce": "^6.8.4",
|
"tinymce": "^6.8.4",
|
||||||
"vue": "^3.4.36",
|
"vue": "^3.4.37",
|
||||||
"vue-clipboard3": "^2.0.0",
|
"vue-clipboard3": "^2.0.0",
|
||||||
"vue-color-kit": "^1.0.6",
|
"vue-color-kit": "^1.0.6",
|
||||||
"vue-echarts": "^6.5.5",
|
"vue-echarts": "^6.5.5",
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"less-loader": "^12.2.0",
|
"less-loader": "^12.2.0",
|
||||||
"postcss": "^8.4.41",
|
"postcss": "^8.4.41",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"tailwindcss": "^3.4.8",
|
"tailwindcss": "^3.4.9",
|
||||||
"typescript": "^5.5.3",
|
"typescript": "^5.5.3",
|
||||||
"vite": "^5.4.0"
|
"vite": "^5.4.0"
|
||||||
}
|
}
|
||||||
|
|||||||
13
cdTMP/src/config/textInfo.ts
Normal file
13
cdTMP/src/config/textInfo.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* 该文件主要用于代码写死的文字信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface ITextInfo {
|
||||||
|
[p: string]: string
|
||||||
|
}
|
||||||
|
const textInfo: ITextInfo = {
|
||||||
|
testUnitAddDefaultText: "中国科学院卫星软件测评中心",
|
||||||
|
testUnitContactPersonName: "高才栋",
|
||||||
|
testUnintContactPhoneNumber: "13564753024"
|
||||||
|
}
|
||||||
|
export default textInfo
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
>
|
>
|
||||||
测试管理平台
|
测试管理平台
|
||||||
</a-typography-title>
|
</a-typography-title>
|
||||||
|
<a-typography-title :heading="6" class="version">V0.0.1</a-typography-title>
|
||||||
<icon-menu-fold
|
<icon-menu-fold
|
||||||
v-if="!topMenu && appStore.device === 'mobile'"
|
v-if="!topMenu && appStore.device === 'mobile'"
|
||||||
style="font-size: 22px; cursor: pointer"
|
style="font-size: 22px; cursor: pointer"
|
||||||
@@ -207,6 +208,10 @@ const handleClickLogo = () => {
|
|||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.version {
|
||||||
|
color: #666;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -222,10 +227,18 @@ const handleClickLogo = () => {
|
|||||||
}
|
}
|
||||||
@keyframes neon6 {
|
@keyframes neon6 {
|
||||||
from {
|
from {
|
||||||
text-shadow: 0 0 10px #fff, 0 0 20px #2563eb, 0 0 30px #2563eb, 0 0 40px #2563eb;
|
text-shadow:
|
||||||
|
0 0 10px #fff,
|
||||||
|
0 0 20px #2563eb,
|
||||||
|
0 0 30px #2563eb,
|
||||||
|
0 0 40px #2563eb;
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
text-shadow: 0 0 5px #fff, 0 0 10px #2563eb, 0 0 15px #2563eb, 0 0 20px #2563eb;
|
text-shadow:
|
||||||
|
0 0 5px #fff,
|
||||||
|
0 0 10px #2563eb,
|
||||||
|
0 0 15px #2563eb,
|
||||||
|
0 0 20px #2563eb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* 获取a-tree右键的元素信息
|
||||||
|
*/
|
||||||
export function getContextNodeInfo(element) {
|
export function getContextNodeInfo(element) {
|
||||||
const pElement = element.parentElement
|
const pElement = element.parentElement
|
||||||
if (pElement.dataset.key) {
|
if (pElement.dataset.key) {
|
||||||
|
|||||||
@@ -232,811 +232,113 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { provide, ref, onMounted, h } from "vue"
|
import { provide, ref } from "vue"
|
||||||
import NavBar from "@/layout/components/navbar.vue"
|
import NavBar from "@/layout/components/navbar.vue"
|
||||||
import PageLayout from "@/layout/page-layout.vue"
|
import PageLayout from "@/layout/page-layout.vue"
|
||||||
import MaFormModal from "@/components/ma-form-modal/index.vue"
|
import MaFormModal from "@/components/ma-form-modal/index.vue"
|
||||||
import projectApi from "@/api/project/project"
|
|
||||||
import roundApi from "@/api/project/round"
|
|
||||||
import dutApi from "@/api/project/dut"
|
|
||||||
import copyApi from "@/api/treeOperation/copy"
|
|
||||||
import caseApi from "@/api/project/case"
|
|
||||||
import designApi from "@/api/project/designDemand"
|
|
||||||
import demandApi from "@/api/project/testDemand"
|
|
||||||
// 轮次的右键菜单,单独一个组件 -> 在treeComponents里面
|
// 轮次的右键菜单,单独一个组件 -> 在treeComponents里面
|
||||||
import roundRight from "./treeComponents/roundRight.vue"
|
import roundRight from "./treeComponents/roundRight.vue"
|
||||||
// 问题单ma-crud
|
// 问题单ma-crud
|
||||||
import ProblemChoose from "@/views/project/case/components/ProblemChoose.vue"
|
import ProblemChoose from "@/views/project/case/components/ProblemChoose.vue"
|
||||||
import { Message, Notification, Tr } from "@arco-design/web-vue"
|
|
||||||
import { useRoute } from "vue-router"
|
import { useRoute } from "vue-router"
|
||||||
import { useRouter } from "vue-router"
|
|
||||||
import { useTreeDataStore } from "@/store"
|
import { useTreeDataStore } from "@/store"
|
||||||
import { storeToRefs } from "pinia"
|
import { storeToRefs } from "pinia"
|
||||||
import dayjs from "dayjs"
|
|
||||||
import Progress from "@/views/testmanage/projmanage/cpns/progress.vue"
|
import Progress from "@/views/testmanage/projmanage/cpns/progress.vue"
|
||||||
import { getContextNodeInfo } from "@/layout/hooks/tools"
|
// hooks模块化
|
||||||
// router-view里面组件的ref
|
import useTreeDrag from "@/layout/treeHooks/treeDrag.js"
|
||||||
|
import { useRightClick } from "./treeHooks/rightClick"
|
||||||
|
import useNodeCopy from "./treeHooks/nodeCopy"
|
||||||
|
import useSearchNodes from "./treeHooks/searchNodes"
|
||||||
|
import useMustSoDut from "./treeHooks/mustSoDut"
|
||||||
|
import useNodeExpand from "./treeHooks/useNodeExpand"
|
||||||
|
import useNodeClick from "./treeHooks/useNodeClick"
|
||||||
|
import useLoadTreeNode from "./treeHooks/useLoadTreeNodes"
|
||||||
|
import useRoundMaForm from "./treeHooks/useRoundMaForm"
|
||||||
|
// router-view里面组件的ref -> 多个hook使用
|
||||||
const routeViewRef = ref()
|
const routeViewRef = ref()
|
||||||
/// 初始化round轮次数据
|
|
||||||
const treeDataStore = useTreeDataStore()
|
const treeDataStore = useTreeDataStore()
|
||||||
const route = useRoute()
|
|
||||||
const router = useRouter()
|
|
||||||
const treeRef = ref()
|
|
||||||
const { treeData, currentNode } = storeToRefs(treeDataStore)
|
const { treeData, currentNode } = storeToRefs(treeDataStore)
|
||||||
|
const route = useRoute()
|
||||||
|
const treeRef = ref()
|
||||||
const projectInfo = ref({ ...route.query })
|
const projectInfo = ref({ ...route.query })
|
||||||
const projectId = ref(route.query.id)
|
const projectId = ref(route.query.id)
|
||||||
//~~~~ 复制粘贴流程
|
|
||||||
const checkedKeys = ref([])
|
|
||||||
/// 点击复制按钮
|
|
||||||
const handleCopyNode = async () => {
|
|
||||||
// 0.先判断是否是同一个轮次的节点
|
|
||||||
let firstNodeRoundKey = ""
|
|
||||||
let isFirst = true
|
|
||||||
checkedKeys.value.forEach((item) => {
|
|
||||||
if (isFirst) {
|
|
||||||
firstNodeRoundKey = item.split("-")[0]
|
|
||||||
isFirst = false
|
|
||||||
} else {
|
|
||||||
if (item.split("-")[0] !== firstNodeRoundKey) {
|
|
||||||
Message.error("请选择同一轮次的节点进行复制")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 1.先判断是否选中了节点
|
|
||||||
if (checkedKeys.value.length < 1) {
|
|
||||||
Message.error("您未选择节点,请选择后再试...")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 打印下checked节点key
|
|
||||||
visible.value = true
|
|
||||||
isComplete.value = false
|
|
||||||
const st = await copyApi
|
|
||||||
.copyCheckedNode({ checkedNodes: checkedKeys.value, project_id: projectId.value })
|
|
||||||
.catch((err) => {
|
|
||||||
isComplete.value = true
|
|
||||||
visible.value = false
|
|
||||||
})
|
|
||||||
isComplete.value = true
|
|
||||||
Message.success(st.message)
|
|
||||||
Notification.warning("请注意自动生成的设计需求、测试项、用例信息重复,需要修改")
|
|
||||||
// 清空checkedKeys
|
|
||||||
checkedKeys.value = []
|
|
||||||
// 处理完后需要更新树结构
|
|
||||||
treeDataStore.resetTreeData(projectId.value)
|
|
||||||
// 清除右侧路由的组件显示,不然会因为数据而出错,当然直接复制query可能是错误信息
|
|
||||||
router.replace({ name: "project", query: route.query })
|
|
||||||
}
|
|
||||||
/// 进度条变量
|
|
||||||
const visible = ref(false)
|
|
||||||
const isComplete = ref(false)
|
|
||||||
const ptext = ref("轮次数据")
|
|
||||||
const handleModalConfirmClick = () => {
|
|
||||||
visible.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
//~~~~ 缩小后的menu菜单
|
//~~~~~~大模块:选择同一节点新建复制到下一轮~~~~~~
|
||||||
|
const { checkedKeys, visible, isComplete, ptext, handleCopyNode, handleModalConfirmClick } = useNodeCopy(projectId)
|
||||||
|
|
||||||
|
//~~~~~~provide:menu缩小菜单~~~~~~
|
||||||
const drawerVisible = ref(false)
|
const drawerVisible = ref(false)
|
||||||
provide("toggleDrawerMenu", () => {
|
provide("toggleDrawerMenu", () => {
|
||||||
drawerVisible.value = !drawerVisible.value
|
drawerVisible.value = !drawerVisible.value
|
||||||
})
|
})
|
||||||
//~~~~ 搜索绑定与搜索按钮点击
|
|
||||||
const searchKey = ref("")
|
|
||||||
const handleSearchTreeDataClick = () => {
|
|
||||||
const loop = (itemdata) => {
|
|
||||||
const result = []
|
|
||||||
itemdata.forEach((item) => {
|
|
||||||
if (item.title.indexOf(searchKey.value.replace(" ", "")) > -1) {
|
|
||||||
result.push({ ...item })
|
|
||||||
} else if (item.children) {
|
|
||||||
const filterdata = loop(item.children)
|
|
||||||
if (filterdata.length) {
|
|
||||||
result.push({
|
|
||||||
...item,
|
|
||||||
children: filterdata
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
// 返回过滤后的treeData
|
|
||||||
// treeDataStore.originTreeData
|
|
||||||
if (searchKey.value) {
|
|
||||||
treeData.value = loop(treeDataStore.treeData)
|
|
||||||
} else {
|
|
||||||
treeData.value = treeDataStore.originTreeData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//~~~~ 树状组件
|
|
||||||
// ~~~~定义弹出a-form-modal的submit方法~~~
|
|
||||||
const handleSoDutSubmit = async (data) => {
|
|
||||||
// 只有一个参数就是被提交的数据,然后返回false阻止弹窗消失
|
|
||||||
const input_data = { ...data, project_id: projectId.value }
|
|
||||||
const res = await dutApi.createR1SoDut(input_data)
|
|
||||||
if (res.code == 200) {
|
|
||||||
treeDataStore.updateDutTreeData(res.data, projectId.value)
|
|
||||||
Message.success("添加源代码被测件成功,并自动创建第一轮的文档审查、静态分析、代码审查测试项和用例")
|
|
||||||
setTimeout(() => {
|
|
||||||
location.reload()
|
|
||||||
}, 500)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// ~~~~定义弹出a-form-modal的cancel方法-返回false则无法关闭弹窗~~~~
|
|
||||||
const handleSoDutCancel = () => {
|
|
||||||
Notification.error("必须按要求添加源代码信息,返回项目列表页面!")
|
|
||||||
router.replace({ name: "projmanage" })
|
|
||||||
}
|
|
||||||
// 初始化树状数据
|
|
||||||
// so_dut弹窗ref对象
|
|
||||||
const soDutFormRef = ref()
|
|
||||||
/// 强制弹窗的标题
|
|
||||||
const soDutModalTitle = ref("强制添加第一轮源代码信息")
|
|
||||||
// 辅助函数,传入res.data来判断是否强制弹窗
|
|
||||||
const handleSoDutExistsForceModal = async () => {
|
|
||||||
/// 主动后端请求
|
|
||||||
const res = await dutApi.getSoExists({ id: projectId.value })
|
|
||||||
res.data.round_list.forEach((item) => {
|
|
||||||
if (!item.isExists) {
|
|
||||||
Message.warning(`识别到您未添加第${parseInt(item.key) + 1}轮源代码的信息,请填写信息自动创建`)
|
|
||||||
soDutModalTitle.value = `强制添加第${parseInt(item.key) + 1}轮源代码的信息`
|
|
||||||
soDutFormRef.value.open({ round_key: item.key })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onMounted(async () => {
|
|
||||||
await treeDataStore.initTreeData(projectId.value)
|
|
||||||
// 依次找轮次里面是否有源代码被测件,如果没有则强制弹窗让用户创建
|
|
||||||
handleSoDutExistsForceModal()
|
|
||||||
})
|
|
||||||
// v-model绑定选中节点
|
|
||||||
const selectedKeys = ref([])
|
|
||||||
const previousKey = ref(null)
|
|
||||||
// 1.定义展开的tree-key 2.定义全部展开的数据 3.定义展开收缩函数 -> 注意在treeStore里面使用递归处理
|
|
||||||
const expandedKeys = ref([])
|
|
||||||
const allExpandedKeys = ref([])
|
|
||||||
const toggleExpanded = () => {
|
|
||||||
allExpandedKeys.value = treeDataStore.outExpandNode()
|
|
||||||
expandedKeys.value = expandedKeys?.value.length ? [] : allExpandedKeys.value
|
|
||||||
}
|
|
||||||
/// 点击树状节点-参数1:节点数组,参数2:树node对象 - 添加双击处理方式
|
|
||||||
let timerId = null
|
|
||||||
let count = 0
|
|
||||||
const pointNode = (value, data) => {
|
|
||||||
// 获取处理单击不选中,双击选中的变量
|
|
||||||
let catch_selected_key = selectedKeys.value
|
|
||||||
selectedKeys.value = previousKey.value
|
|
||||||
count++
|
|
||||||
if (timerId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
timerId = setTimeout(async () => {
|
|
||||||
if (count > 1) {
|
|
||||||
// 双击触发 value是点击的节点,data是节点数据
|
|
||||||
if (data.node.level == "0") {
|
|
||||||
projectApi.getDutInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
|
||||||
treeData.value[value].children = res.data
|
|
||||||
// 添加需要展开数据,注意不要一直push,判断在已展开节点是否包含点击的节点
|
|
||||||
if (!expandedKeys.value.includes(value[0])) {
|
|
||||||
expandedKeys.value.push(value[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (data.node.level == "1") {
|
|
||||||
projectApi.getDemandInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
|
||||||
data.node.children = res.data
|
|
||||||
if (!expandedKeys.value.includes(value[0])) {
|
|
||||||
expandedKeys.value.push(value[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (data.node.level == "2") {
|
|
||||||
projectApi.getTestInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
|
||||||
data.node.children = res.data
|
|
||||||
if (!expandedKeys.value.includes(value[0])) {
|
|
||||||
expandedKeys.value.push(value[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (data.node.level == "3") {
|
|
||||||
projectApi.getCaseInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
|
||||||
data.node.children = res.data
|
|
||||||
if (!expandedKeys.value.includes(value[0])) {
|
|
||||||
expandedKeys.value.push(value[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
count = 0
|
|
||||||
clearTimeout(timerId)
|
|
||||||
timerId = null
|
|
||||||
} else {
|
|
||||||
// 单击触发
|
|
||||||
if (data.node.level === "0") {
|
|
||||||
router.push({ name: "round", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
}
|
|
||||||
if (data.node.level === "1") {
|
|
||||||
router.push({ name: "dut", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
}
|
|
||||||
if (data.node.level === "2") {
|
|
||||||
router.push({ name: "designDemand", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
}
|
|
||||||
if (data.node.level === "3") {
|
|
||||||
router.push({ name: "testDemand", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
}
|
|
||||||
if (data.node.level === "4") {
|
|
||||||
router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
}
|
|
||||||
// if (data.node.level === "5") {
|
|
||||||
// router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } })
|
|
||||||
// }
|
|
||||||
treeDataStore.setCurrentNode(data.node.key)
|
|
||||||
// 单击设置选择的key
|
|
||||||
selectedKeys.value = catch_selected_key
|
|
||||||
// 单击后设置previous选中的key是什么
|
|
||||||
previousKey.value = catch_selected_key
|
|
||||||
count = 0
|
|
||||||
clearTimeout(timerId)
|
|
||||||
timerId = null
|
|
||||||
}
|
|
||||||
}, 250)
|
|
||||||
}
|
|
||||||
/// 动态加载函数-参数1:树node对象
|
|
||||||
const loadMore = (nodeData) => {
|
|
||||||
if (nodeData.level == "0") {
|
|
||||||
return new Promise(async (resolve) => {
|
|
||||||
const res = await projectApi.getDutInfo(projectInfo.value.id, nodeData.key, nodeData.level).catch((err) => {
|
|
||||||
resolve() // 捕获错误,让动态加载不再一直转圈
|
|
||||||
})
|
|
||||||
nodeData.children = res.data
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (nodeData.level == "1") {
|
|
||||||
return new Promise(async (resolve) => {
|
|
||||||
const res = await projectApi
|
|
||||||
.getDemandInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
|
||||||
.catch((err) => {
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
nodeData.children = res.data
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (nodeData.level == "2") {
|
|
||||||
return new Promise(async (resolve) => {
|
|
||||||
const res = await projectApi
|
|
||||||
.getTestInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
|
||||||
.catch((err) => {
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
nodeData.children = res.data
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (nodeData.level == "3") {
|
|
||||||
return new Promise(async (resolve) => {
|
|
||||||
const res = await projectApi
|
|
||||||
.getCaseInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
|
||||||
.catch((err) => {
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
nodeData.children = res.data
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//~~~~ 表单弹窗组件功能
|
|
||||||
const maFormModalRef = ref()
|
|
||||||
const title = ref("")
|
|
||||||
/// 点击新增轮次按钮
|
|
||||||
const handleRoundAddClick = (nodeData) => {
|
|
||||||
let create_number = treeDataStore.getRoundMiddleInfo()
|
|
||||||
// 这里是文档写错了,调用form是里面组件绑定的数据
|
|
||||||
maFormModalRef.value.form = {}
|
|
||||||
// 这里如果删除中间轮次,那么新增信息应该从中间开始
|
|
||||||
maFormModalRef.value.open({
|
|
||||||
beginTime: dayjs().format("YYYY-MM-DD"),
|
|
||||||
grade: "1",
|
|
||||||
key: `${create_number}`,
|
|
||||||
name: `第${create_number + 1}轮测试`,
|
|
||||||
ident: `${route.query.ident}-R${create_number + 1}`,
|
|
||||||
project: projectId.value
|
|
||||||
})
|
|
||||||
title.value = "新增轮次"
|
|
||||||
}
|
|
||||||
/// 点击编辑轮次按钮
|
|
||||||
const handleRoundEditClick = async (nodeData) => {
|
|
||||||
const data = await roundApi.getOneRoundInfo({
|
|
||||||
projectId: projectId.value,
|
|
||||||
round: nodeData.key
|
|
||||||
})
|
|
||||||
maFormModalRef.value.open(data.data)
|
|
||||||
title.value = `编辑轮次:${data.data.name}`
|
|
||||||
}
|
|
||||||
/// 点击删除轮次按钮
|
|
||||||
const handleRoundDelClick = async (value) => {
|
|
||||||
try {
|
|
||||||
await roundApi.delete(projectId.value, value)
|
|
||||||
Message.success("删除成功!")
|
|
||||||
treeDataStore.resetTreeData(projectId.value)
|
|
||||||
router.replace({ name: "project", query: route.query })
|
|
||||||
} catch {}
|
|
||||||
}
|
|
||||||
/// Ma-form-Modal的提交按钮 - 轮次新增/编辑逻辑
|
|
||||||
const handleRoundSubmit = async (value) => {
|
|
||||||
if (title.value.slice(0, 1) === "编") {
|
|
||||||
try {
|
|
||||||
await roundApi.update(value.id, value)
|
|
||||||
Message.success("编辑成功!")
|
|
||||||
} catch {
|
|
||||||
Message.error("编辑失败!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (title.value.slice(0, 1) === "新") {
|
|
||||||
try {
|
|
||||||
await roundApi.save(projectId.value, value)
|
|
||||||
Message.success("新增成功!")
|
|
||||||
treeDataStore.resetTreeData(projectId.value)
|
|
||||||
// 调用判断函数,判断是否轮次有源代码dut
|
|
||||||
handleSoDutExistsForceModal()
|
|
||||||
} catch {
|
|
||||||
Message.error("新增失败!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 设置轮次弹窗的列信息
|
//~~~~~~小功能:节点搜索功能~~~~~~
|
||||||
const roundColumn = ref([
|
const { searchKey, handleSearchTreeDataClick } = useSearchNodes()
|
||||||
{
|
|
||||||
title: "基本信息",
|
|
||||||
customClass: ["mb-2", "pb-0"],
|
|
||||||
formType: "card",
|
|
||||||
bodyStyle: { paddingBottom: 0 },
|
|
||||||
formList: [
|
|
||||||
{
|
|
||||||
formType: "grid",
|
|
||||||
cols: [
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [
|
|
||||||
{ title: "轮次标识", dataIndex: "ident", disabled: true },
|
|
||||||
{
|
|
||||||
title: "开始时间",
|
|
||||||
dataIndex: "beginTime",
|
|
||||||
formType: "date",
|
|
||||||
placeholder: "请选择时间",
|
|
||||||
extra: "尽量大于项目开始时间13天,生成文档才符合要求",
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: "开始时间必填" },
|
|
||||||
{
|
|
||||||
validator: (value, callback) => {
|
|
||||||
const projectBegin = route.query.beginTime
|
|
||||||
value <= projectBegin
|
|
||||||
? callback(
|
|
||||||
"不能早于项目开始时间,由于还有前期测试设计阶段,建议大于项目开始时间13天"
|
|
||||||
)
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "速度等级",
|
|
||||||
dataIndex: "speedGrade",
|
|
||||||
placeholder: "请填入速度等级"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "动态地点",
|
|
||||||
dataIndex: "location",
|
|
||||||
placeholder: "请填入测试地点",
|
|
||||||
extra: "该字段影响时间相关表格的地点",
|
|
||||||
rules: [{ required: true, message: "测试地点是必填的" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [
|
|
||||||
{ title: "名称", dataIndex: "name", rules: [{ required: true, message: "名称必填" }] },
|
|
||||||
{
|
|
||||||
title: "结束时间",
|
|
||||||
dataIndex: "endTime",
|
|
||||||
formType: "date",
|
|
||||||
placeholder: "请选择时间",
|
|
||||||
extra: "该字段决定《测试记录》封面时间",
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: "结束时间必填" },
|
|
||||||
{
|
|
||||||
validator(value, errorCallback) {
|
|
||||||
let start = maFormModalRef.value.form.beginTime
|
|
||||||
value < start ? errorCallback("结束时间不能小于开始时间") : null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "封装",
|
|
||||||
dataIndex: "package",
|
|
||||||
placeholder: "请填入封装"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "质量等级",
|
|
||||||
dataIndex: "grade",
|
|
||||||
formType: "select",
|
|
||||||
dict: {
|
|
||||||
data: [
|
|
||||||
{ label: "军级", value: "1" },
|
|
||||||
{ label: "商业级", value: "2" },
|
|
||||||
{ label: "宇航级", value: "3" },
|
|
||||||
{ label: "工业级", value: "4" }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
placeholder: "请填入质量等级",
|
|
||||||
rules: [{ required: true, message: "质量等级必填" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "card",
|
|
||||||
title: "极端工况信息",
|
|
||||||
customClass: ["mb-2", "pb-0"],
|
|
||||||
bodyStyle: { paddingBottom: 0 },
|
|
||||||
formList: [
|
|
||||||
{
|
|
||||||
formType: "divider",
|
|
||||||
title: "最好工况",
|
|
||||||
orientation: "left",
|
|
||||||
margin: "20px"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "grid",
|
|
||||||
cols: [
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "电压", dataIndex: "best_condition_voltage", placeholder: "请填入电压" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "温度", dataIndex: "best_condition_tem", placeholder: "请填入温度" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "divider",
|
|
||||||
title: "典型工况",
|
|
||||||
orientation: "left",
|
|
||||||
margin: "20px"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "grid",
|
|
||||||
cols: [
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "电压", dataIndex: "typical_condition_voltage", placeholder: "请填入电压" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "温度", dataIndex: "typical_condition_tem", placeholder: "请填入温度" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "divider",
|
|
||||||
title: "最差工况",
|
|
||||||
orientation: "left",
|
|
||||||
margin: "20px"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
formType: "grid",
|
|
||||||
cols: [
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "电压", dataIndex: "low_condition_voltage", placeholder: "请填入电压" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: 12,
|
|
||||||
formList: [{ title: "温度", dataIndex: "low_condition_tem", placeholder: "请填入温度" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
])
|
|
||||||
/// 表单的option
|
|
||||||
const roundOption = ref({
|
|
||||||
customClass: [""]
|
|
||||||
})
|
|
||||||
// 源代码so_dut的弹窗
|
|
||||||
const soDutColumn = ref([
|
|
||||||
{
|
|
||||||
title: "轮次key",
|
|
||||||
dataIndex: "round_key",
|
|
||||||
placeholder: "非用户填写",
|
|
||||||
disabled: true,
|
|
||||||
rules: [{ required: true, message: "非用户填写,但必填" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "代码版本",
|
|
||||||
dataIndex: "version",
|
|
||||||
placeholder: "请输入代码版本,注意不要带V",
|
|
||||||
rules: [{ required: true, message: "代码版本必填" }],
|
|
||||||
openPrepend: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "用户标识",
|
|
||||||
dataIndex: "userRef",
|
|
||||||
placeholder: "请输入用户标识",
|
|
||||||
help: "客户使用的标识",
|
|
||||||
rules: [{ required: true, message: "用户标识为客户的标识,必填,可随意填写后面再修改" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "单位",
|
|
||||||
dataIndex: "unit",
|
|
||||||
placeholder: "请选择单位名称",
|
|
||||||
formType: "select",
|
|
||||||
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true },
|
|
||||||
rules: [{ required: true, message: "单位必选" }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "空行",
|
|
||||||
dataIndex: "black_line",
|
|
||||||
formType: "input-number",
|
|
||||||
rules: [{ required: true, message: "空行数必填" }],
|
|
||||||
min: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "纯注释",
|
|
||||||
dataIndex: "comment_line",
|
|
||||||
formType: "input-number",
|
|
||||||
rules: [{ required: true, message: "纯注释数必填" }],
|
|
||||||
min: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "混合行",
|
|
||||||
dataIndex: "mix_line",
|
|
||||||
formType: "input-number",
|
|
||||||
rules: [{ required: true, message: "混合行必填" }],
|
|
||||||
min: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "纯代码",
|
|
||||||
dataIndex: "code_line",
|
|
||||||
formType: "input-number",
|
|
||||||
rules: [{ required: true, message: "纯代码行必填" }],
|
|
||||||
min: 0
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
// 大功能:右键菜单实现
|
//~~~~~~M功能:强制必须有源代码被测件~~~~~~
|
||||||
/// ~~~右键菜单弹出~~~
|
const {
|
||||||
const popupVisible = ref(false)
|
soDutFormRef,
|
||||||
/// 右键菜单的挂载容器
|
soDutModalTitle,
|
||||||
const popupContainer = ref()
|
handleSoDutExistsForceModal,
|
||||||
/// 组件全局
|
handleSoDutSubmit,
|
||||||
const rightClickNode = { level: 3, isLeaf: false, nodekey: "", title: "" }
|
handleSoDutCancel,
|
||||||
/// 轮次右键dropdown显示变量
|
soDutColumn
|
||||||
const roundRightVisible = ref(false)
|
} = useMustSoDut(projectId)
|
||||||
/// 轮次右键dropdown的容器
|
|
||||||
const roundRightContainer = ref(null)
|
//~~~~~~小功能:展开和收缩~~~~~~
|
||||||
/// 轮次问题单标题表里
|
const { expandedKeys, toggleExpanded } = useNodeExpand()
|
||||||
const problemTitle = ref("第1轮问题单")
|
|
||||||
/// 紧点击测试项节点显示右键菜单
|
//~~~~~~大功能:单击/双击节点逻辑~~~~~~
|
||||||
const displayRightMenu = (e) => {
|
const { selectedKeys, pointNode } = useNodeClick(expandedKeys)
|
||||||
const { nodekey, level, title, isLeaf } = getContextNodeInfo(e.target)
|
|
||||||
// 如果是测试项则弹出【1.根据测试项步骤生成当前测试项用例 2.复制测试项到设计需求】
|
//~~~~~~大功能:动态加载a-tree节点函数~~~~~~
|
||||||
if (+level === 3) {
|
const { loadMore } = useLoadTreeNode()
|
||||||
e.preventDefault()
|
|
||||||
// 首先将被右键点击的node储存到组件全局
|
//~~~~~~功能:轮次的Ma-Form~~~~~~
|
||||||
rightClickNode.level = level
|
const {
|
||||||
rightClickNode.isLeaf = isLeaf
|
maFormModalRef,
|
||||||
rightClickNode.nodekey = nodekey
|
title,
|
||||||
rightClickNode.title = title
|
roundColumn,
|
||||||
// 将popup组件绑定到被右键点击的元素
|
roundOption,
|
||||||
popupContainer.value = e.target
|
handleRoundAddClick,
|
||||||
popupVisible.value = true
|
handleRoundEditClick,
|
||||||
}
|
handleRoundDelClick,
|
||||||
if (+level === 0) {
|
handleRoundSubmit
|
||||||
// 测试显示下拉框
|
} = useRoundMaForm(projectId, handleSoDutExistsForceModal)
|
||||||
e.preventDefault()
|
|
||||||
rightClickNode.level = level
|
// 大功能:~~~~~~右键菜单实现~~~~~~
|
||||||
rightClickNode.isLeaf = isLeaf
|
const {
|
||||||
rightClickNode.nodekey = nodekey
|
popupVisible,
|
||||||
rightClickNode.title = title
|
popupContainer,
|
||||||
problemTitle.value = `第${+rightClickNode.nodekey + 1}轮问题单`
|
roundRightVisible,
|
||||||
roundRightContainer.value = e.target.parentElement
|
roundRightContainer,
|
||||||
roundRightVisible.value = true
|
problemRoundRef,
|
||||||
}
|
options,
|
||||||
}
|
modalVisible,
|
||||||
/// 点击轮次-用户选择了打开问题单
|
relatedCopyData,
|
||||||
const handleProblemShowClick = () => {
|
cascaderLoading,
|
||||||
// 这里要显示轮次的问题单
|
problemTitle,
|
||||||
problemRoundRef.value.open(rightClickNode.nodekey)
|
checkboxValue,
|
||||||
}
|
displayRightMenu,
|
||||||
/// 点击popup自动生成对应测试项的用例按钮处理函数
|
handleProblemShowClick,
|
||||||
const handleDoptionClickGreateCases = async () => {
|
handleDoptionClickGreateCases,
|
||||||
// 将project_id加入参数
|
handleDoptionClickCopyDemand,
|
||||||
rightClickNode.project_id = projectId.value
|
handleCopyDemand
|
||||||
await caseApi.createByDemand(rightClickNode)
|
} = useRightClick(projectId, routeViewRef)
|
||||||
routeViewRef.value.refresh()
|
|
||||||
}
|
|
||||||
/// 复制modal级联选择器的选项
|
|
||||||
const options = ref([])
|
|
||||||
const modalVisible = ref(false)
|
|
||||||
const relatedCopyData = ref(0)
|
|
||||||
const cascaderLoading = ref(false)
|
|
||||||
/// 点击popup复制测试项
|
|
||||||
const handleDoptionClickCopyDemand = async () => {
|
|
||||||
// 首先是要获取选项数据
|
|
||||||
cascaderLoading.value = true
|
|
||||||
modalVisible.value = true
|
|
||||||
// 请求后端给级联选择器数据
|
|
||||||
const res = await designApi.getRelatedCasDesign({ id: projectId.value }).catch((err) => {
|
|
||||||
Message.error("请求后端数据发生错误,请重试")
|
|
||||||
cascaderLoading.value = false
|
|
||||||
})
|
|
||||||
options.value = res.data
|
|
||||||
// 先获取当前右击的需求的key -> 然后找到所属design的nodekey
|
|
||||||
const currentDemandKey = rightClickNode.nodekey
|
|
||||||
const belongDesignKey = currentDemandKey.substring(0, currentDemandKey.lastIndexOf("-"))
|
|
||||||
// 默认赋值给demand的当前design,直接点击确定可以复制到当前
|
|
||||||
options.value.forEach((item) => {
|
|
||||||
item.children.forEach((tem) => {
|
|
||||||
tem.children.forEach((design_obj) => {
|
|
||||||
if (belongDesignKey === design_obj.key) {
|
|
||||||
relatedCopyData.value = design_obj.value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
cascaderLoading.value = false
|
|
||||||
// 将checkbox-depth参数设置为非勾选
|
|
||||||
checkboxValue.value = false
|
|
||||||
}
|
|
||||||
/// 点击复制modal弹窗确定按钮
|
|
||||||
const checkboxValue = ref(false)
|
|
||||||
const handleCopyDemand = async () => {
|
|
||||||
// 获取选择的design的id
|
|
||||||
const design_id = relatedCopyData.value
|
|
||||||
// 没有选取则直接返回false
|
|
||||||
if (!design_id) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 这里进行复制的数据处理
|
|
||||||
const res = await demandApi.copyToDesign({
|
|
||||||
project_id: projectId.value,
|
|
||||||
design_id: design_id,
|
|
||||||
demand_key: rightClickNode.nodekey,
|
|
||||||
depth: checkboxValue.value
|
|
||||||
})
|
|
||||||
if ((res.code = 200)) {
|
|
||||||
// 注意必须传projectId,否则返回空
|
|
||||||
treeDataStore.updateTestDemandTreeData(res.data, projectId.value)
|
|
||||||
Notification.success("复制成功,为避免重复,设置了(复制)字样,请手动修改...")
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
Message.error("复制失败,服务器错误")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~~~~~~~~大功能:拖拽~~~~~~~~
|
// ~~~~~~~~大功能:拖拽~~~~~~~~
|
||||||
const paoVisible = ref(false)
|
const {
|
||||||
const paoContainer = ref(null)
|
paoVisible,
|
||||||
const pao2Visible = ref(false)
|
paoContainer,
|
||||||
const pao2Container = ref(null)
|
pao2Visible,
|
||||||
/// 储存被拖拽到的节点以及拖拽的节点
|
pao2Container,
|
||||||
let dragNodeGlobal = null
|
ondrop,
|
||||||
let dropNodeGlobal = null
|
allowdrop,
|
||||||
let dragDropPosition = 0
|
paoOk,
|
||||||
|
paoCancel,
|
||||||
/// 节点在可释放目标释放的操作 - drapNode是被拖拽的节点,dropNone是释放在哪个节点下,dropPosition是释放的位置-1,0...
|
paoOk2,
|
||||||
const ondrop = ({ e, dragNode, dropNode, dropPosition }) => {
|
paoCancel2
|
||||||
const data = treeData.value // 1.这是整体的树数据
|
} = useTreeDrag(projectId, routeViewRef)
|
||||||
// 提示用户只能拖拽用例节点
|
|
||||||
if (dragNode.level === "3") {
|
|
||||||
Message.warning("只能拖拽用例节点")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 拖拽逻辑:
|
|
||||||
// 1.首先只能拖拽用例节点才能实现功能
|
|
||||||
if (dragNode.level === "4") {
|
|
||||||
// 2.1.如果是拖拽到测试项节点下
|
|
||||||
if (dropNode.level === "3") {
|
|
||||||
// 2.1.1.如果位置为0,则放在了测试项里面,为1,-1在测试上下都不处理
|
|
||||||
if (dropPosition === 0) {
|
|
||||||
// 判断用例是否已经测试项节点里面了
|
|
||||||
if (!dropNode.children || !dropNode.children.includes(dragNode)) {
|
|
||||||
// 不在测试项里面,则弹出提示是复制还是移动
|
|
||||||
dragNodeGlobal = dragNode
|
|
||||||
dropNodeGlobal = dropNode
|
|
||||||
paoContainer.value = e.target.parentElement
|
|
||||||
paoVisible.value = true
|
|
||||||
} else if (dropNode.children.includes(dragNode)) {
|
|
||||||
// 这里就用例拖拽到当前的测试项节点,则可弹出复制弹窗
|
|
||||||
dragNodeGlobal = dragNode
|
|
||||||
dropNodeGlobal = dropNode
|
|
||||||
paoContainer.value = e.target.parentElement
|
|
||||||
paoVisible.value = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (dropNode.level === "4") {
|
|
||||||
// 2.2.如果拖拽到测试用例节点,注意拖动到自己上下方不触发
|
|
||||||
// 2.2.1先要判断用例是否是同一个demand,则是改变顺序
|
|
||||||
dragNodeGlobal = dragNode
|
|
||||||
dropNodeGlobal = dropNode
|
|
||||||
pao2Container.value = e.target.parentElement
|
|
||||||
pao2Visible.value = true
|
|
||||||
dragDropPosition = dropPosition
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// 只运行拖拽用例节点和测试项2种节点
|
|
||||||
const allowdrop = (options) => {
|
|
||||||
if (options.dropNode.level === "4" || options.dropNode.level === "3") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// 拖拽后弹出气泡-移动
|
|
||||||
const paoOk = async () => {
|
|
||||||
const res = await caseApi.copyOrMoveCaseToDemand({
|
|
||||||
project_id: projectId.value,
|
|
||||||
case_key: dragNodeGlobal.key,
|
|
||||||
demand_key: dropNodeGlobal.key,
|
|
||||||
move: true
|
|
||||||
})
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.oldCaseKey, projectId.value)
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.newCaseKey, projectId.value)
|
|
||||||
routeViewRef.value.refresh()
|
|
||||||
Notification.success("移动用例成功")
|
|
||||||
}
|
|
||||||
/// 拖拽后弹出气泡-复制
|
|
||||||
const paoCancel = async () => {
|
|
||||||
const res = await caseApi.copyOrMoveCaseToDemand({
|
|
||||||
project_id: projectId.value,
|
|
||||||
case_key: dragNodeGlobal.key,
|
|
||||||
demand_key: dropNodeGlobal.key,
|
|
||||||
move: false
|
|
||||||
})
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.oldCaseKey, projectId.value)
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.newCaseKey, projectId.value)
|
|
||||||
routeViewRef.value.refresh()
|
|
||||||
Notification.success("复制用例成功")
|
|
||||||
}
|
|
||||||
/// 同级分2个气泡ok是移动,cancel是复制
|
|
||||||
const paoOk2 = async () => {
|
|
||||||
const res = await caseApi.copyOrMoveCaseByCase({
|
|
||||||
project_id: projectId.value,
|
|
||||||
drag_key: dragNodeGlobal.key,
|
|
||||||
drop_key: dropNodeGlobal.key,
|
|
||||||
position: dragDropPosition,
|
|
||||||
move: true
|
|
||||||
})
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.old, projectId.value)
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.new, projectId.value)
|
|
||||||
routeViewRef.value.refresh()
|
|
||||||
Notification.success("移动用例成功")
|
|
||||||
}
|
|
||||||
const paoCancel2 = async () => {
|
|
||||||
const res = await caseApi.copyOrMoveCaseByCase({
|
|
||||||
project_id: projectId.value,
|
|
||||||
drag_key: dragNodeGlobal.key,
|
|
||||||
drop_key: dropNodeGlobal.key,
|
|
||||||
position: dragDropPosition,
|
|
||||||
move: false
|
|
||||||
})
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.old, projectId.value)
|
|
||||||
await treeDataStore.updateCaseTreeData(res.data.new, projectId.value)
|
|
||||||
routeViewRef.value.refresh()
|
|
||||||
Notification.success("复制用例成功")
|
|
||||||
}
|
|
||||||
// ~~~~大功能:轮次问题单~~~~
|
|
||||||
const problemRoundRef = ref(null)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
130
cdTMP/src/layout/treeHooks/mustSoDut.ts
Normal file
130
cdTMP/src/layout/treeHooks/mustSoDut.ts
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
import { Message, Notification } from "@arco-design/web-vue"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import dutApi from "@/api/project/dut"
|
||||||
|
import { useRouter } from "vue-router"
|
||||||
|
import { ref, onMounted } from "vue"
|
||||||
|
import type { Ref } from "vue"
|
||||||
|
import MaFormModal from "@/components/ma-form-modal/index.vue"
|
||||||
|
|
||||||
|
// 源代码弹窗ma-form的列定义
|
||||||
|
// 源代码so_dut的弹窗
|
||||||
|
const soDutColumn = ref([
|
||||||
|
{
|
||||||
|
title: "轮次key",
|
||||||
|
dataIndex: "round_key",
|
||||||
|
placeholder: "非用户填写",
|
||||||
|
disabled: true,
|
||||||
|
rules: [{ required: true, message: "非用户填写,但必填" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "代码版本",
|
||||||
|
dataIndex: "version",
|
||||||
|
placeholder: "请输入代码版本,注意不要带V",
|
||||||
|
rules: [{ required: true, message: "代码版本必填" }],
|
||||||
|
openPrepend: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "用户标识",
|
||||||
|
dataIndex: "userRef",
|
||||||
|
placeholder: "请输入用户标识",
|
||||||
|
help: "客户使用的标识",
|
||||||
|
rules: [{ required: true, message: "用户标识为客户的标识,必填,可随意填写后面再修改" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "单位",
|
||||||
|
dataIndex: "unit",
|
||||||
|
placeholder: "请选择单位名称",
|
||||||
|
formType: "select",
|
||||||
|
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true },
|
||||||
|
rules: [{ required: true, message: "单位必选" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空行",
|
||||||
|
dataIndex: "black_line",
|
||||||
|
formType: "input-number",
|
||||||
|
rules: [{ required: true, message: "空行数必填" }],
|
||||||
|
min: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "纯注释",
|
||||||
|
dataIndex: "comment_line",
|
||||||
|
formType: "input-number",
|
||||||
|
rules: [{ required: true, message: "纯注释数必填" }],
|
||||||
|
min: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "混合行",
|
||||||
|
dataIndex: "mix_line",
|
||||||
|
formType: "input-number",
|
||||||
|
rules: [{ required: true, message: "混合行必填" }],
|
||||||
|
min: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "纯代码",
|
||||||
|
dataIndex: "code_line",
|
||||||
|
formType: "input-number",
|
||||||
|
rules: [{ required: true, message: "纯代码行必填" }],
|
||||||
|
min: 0
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
/**判断必须包含源代码被测件的弹窗,用户提交/取消逻辑 */
|
||||||
|
export default function useMustSoDut(projectId: Ref<string>) {
|
||||||
|
// global
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
const router = useRouter()
|
||||||
|
// refs
|
||||||
|
const soDutFormRef = ref<InstanceType<typeof MaFormModal>>() // 源代码强制弹窗ref
|
||||||
|
const soDutModalTitle = ref("强制添加第一轮源代码信息")
|
||||||
|
// lifecycles
|
||||||
|
onMounted(async () => {
|
||||||
|
await treeDataStore.initTreeData(projectId.value)
|
||||||
|
// 依次找轮次里面是否有源代码被测件,如果没有则强制弹窗让用户创建
|
||||||
|
handleSoDutExistsForceModal()
|
||||||
|
})
|
||||||
|
const handleSoDutExistsForceModal = async () => {
|
||||||
|
/// 主动后端请求
|
||||||
|
const res = await dutApi.getSoExists({ id: projectId.value })
|
||||||
|
res.data.round_list.forEach((item) => {
|
||||||
|
if (!item.isExists) {
|
||||||
|
Message.warning(`识别到您未添加第${parseInt(item.key) + 1}轮源代码的信息,请填写信息自动创建`)
|
||||||
|
soDutModalTitle.value = `强制添加第${parseInt(item.key) + 1}轮源代码的信息`
|
||||||
|
soDutFormRef.value!.open({ round_key: item.key })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// events
|
||||||
|
/**
|
||||||
|
* 提交源代码被测件
|
||||||
|
*/
|
||||||
|
const handleSoDutSubmit = async (data: object) => {
|
||||||
|
// 只有一个参数就是被提交的数据,然后返回false阻止弹窗消失
|
||||||
|
const input_data = { ...data, project_id: projectId.value }
|
||||||
|
const res = await dutApi.createR1SoDut(input_data)
|
||||||
|
if (res.code == 200) {
|
||||||
|
treeDataStore.updateDutTreeData(res.data, projectId.value)
|
||||||
|
Message.success("添加源代码被测件成功,并自动创建第一轮的文档审查、静态分析、代码审查测试项和用例")
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload()
|
||||||
|
}, 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户点击源代码被测件取消按钮
|
||||||
|
*/
|
||||||
|
const handleSoDutCancel = () => {
|
||||||
|
Notification.error("必须按要求添加源代码信息,返回项目列表页面!")
|
||||||
|
router.replace({ name: "projmanage" })
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
soDutFormRef,
|
||||||
|
soDutModalTitle,
|
||||||
|
handleSoDutExistsForceModal,
|
||||||
|
handleSoDutSubmit,
|
||||||
|
handleSoDutCancel,
|
||||||
|
soDutColumn
|
||||||
|
}
|
||||||
|
}
|
||||||
72
cdTMP/src/layout/treeHooks/nodeCopy.ts
Normal file
72
cdTMP/src/layout/treeHooks/nodeCopy.ts
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import type { Ref } from "vue"
|
||||||
|
import { Message, Notification } from "@arco-design/web-vue"
|
||||||
|
import copyApi from "@/api/treeOperation/copy"
|
||||||
|
import { useRouter } from "vue-router"
|
||||||
|
import { useRoute } from "vue-router"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
export default function useNodeCopy(projectId: Ref<string>) {
|
||||||
|
// global
|
||||||
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
// refs
|
||||||
|
const checkedKeys = ref<string[]>([]) // v-model勾选的节点
|
||||||
|
const visible = ref<boolean>(false) // 进度条专用modal
|
||||||
|
const isComplete = ref<boolean>(false)
|
||||||
|
const ptext = ref("轮次数据")
|
||||||
|
// 事件处理
|
||||||
|
/**
|
||||||
|
* 处理弹窗点击确定事件
|
||||||
|
*/
|
||||||
|
const handleCopyNode = async () => {
|
||||||
|
// 0.先判断是否是同一个轮次的节点,如果不是则不处理
|
||||||
|
let firstNodeRoundKey: string = ""
|
||||||
|
let isFirst: boolean = true
|
||||||
|
checkedKeys.value.forEach((item) => {
|
||||||
|
if (isFirst) {
|
||||||
|
firstNodeRoundKey = item.split("-")[0]
|
||||||
|
isFirst = false
|
||||||
|
} else {
|
||||||
|
if (item.split("-")[0] !== firstNodeRoundKey) {
|
||||||
|
Message.error("请选择同一轮次的节点进行复制")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 1.先判断是否选中了节点
|
||||||
|
if (checkedKeys.value.length < 1) {
|
||||||
|
Message.error("您未选择节点,请选择后再试...")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
visible.value = true // 显示气泡弹窗
|
||||||
|
isComplete.value = false
|
||||||
|
const st = await copyApi
|
||||||
|
.copyCheckedNode({ checkedNodes: checkedKeys.value, project_id: projectId.value })
|
||||||
|
.catch(() => {
|
||||||
|
// 如果接口出错则关闭进度显示
|
||||||
|
isComplete.value = true
|
||||||
|
visible.value = false
|
||||||
|
})
|
||||||
|
isComplete.value = true
|
||||||
|
Message.success(st.message)
|
||||||
|
Notification.warning("请注意自动生成的设计需求、测试项、用例信息重复,需要修改")
|
||||||
|
// 清空checkedKeys
|
||||||
|
checkedKeys.value = []
|
||||||
|
// 处理完后需要更新树结构
|
||||||
|
treeDataStore.resetTreeData(projectId.value)
|
||||||
|
// 清除右侧路由的组件显示,不然会因为数据而出错,当然直接复制query可能是错误信息
|
||||||
|
router.replace({ name: "project", query: route.query })
|
||||||
|
}
|
||||||
|
const handleModalConfirmClick = () => {
|
||||||
|
visible.value = false
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
checkedKeys,
|
||||||
|
visible,
|
||||||
|
isComplete,
|
||||||
|
ptext,
|
||||||
|
handleCopyNode,
|
||||||
|
handleModalConfirmClick
|
||||||
|
}
|
||||||
|
}
|
||||||
152
cdTMP/src/layout/treeHooks/rightClick.js
Normal file
152
cdTMP/src/layout/treeHooks/rightClick.js
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import { getContextNodeInfo } from "@/layout/hooks/tools"
|
||||||
|
import { Message, Notification } from "@arco-design/web-vue"
|
||||||
|
import caseApi from "@/api/project/case"
|
||||||
|
import designApi from "@/api/project/designDemand"
|
||||||
|
import demandApi from "@/api/project/testDemand"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
/**
|
||||||
|
* 右键测试项节点与轮次的hook
|
||||||
|
*/
|
||||||
|
export function useRightClick(projectId, routeViewRef) {
|
||||||
|
// global
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
// refs
|
||||||
|
const popupVisible = ref(false) // 右键弹出菜单显影
|
||||||
|
const popupContainer = ref() // 右键挂载容器
|
||||||
|
const roundRightVisible = ref(false) // 轮次右键dropdown显示变量
|
||||||
|
const roundRightContainer = ref(null) // 轮次右键dropdown的容器
|
||||||
|
const problemRoundRef = ref(null) // problemchoose组件的ref
|
||||||
|
// 复制refs
|
||||||
|
const options = ref([])
|
||||||
|
const modalVisible = ref(false)
|
||||||
|
const relatedCopyData = ref(0)
|
||||||
|
const cascaderLoading = ref(false)
|
||||||
|
// 闭包变量s
|
||||||
|
let rightClickNode = { level: 3, isLeaf: false, nodekey: "", title: "" } // 右键节点储存的信息
|
||||||
|
const problemTitle = ref("第1轮问题单") // 弹出问题列表标题
|
||||||
|
// 事件
|
||||||
|
/**
|
||||||
|
* 右键点击节点,判断节点级别来处理
|
||||||
|
*/
|
||||||
|
const displayRightMenu = (e) => {
|
||||||
|
if (e.target) {
|
||||||
|
const { nodekey, level, title, isLeaf } = getContextNodeInfo(e.target)
|
||||||
|
// 如果是测试项则弹出【1.根据测试项步骤生成当前测试项用例 2.复制测试项到设计需求】
|
||||||
|
if (+level === 3) {
|
||||||
|
e.preventDefault()
|
||||||
|
// 首先将被右键点击的node储存到组件全局
|
||||||
|
rightClickNode.level = level
|
||||||
|
rightClickNode.isLeaf = isLeaf
|
||||||
|
rightClickNode.nodekey = nodekey
|
||||||
|
rightClickNode.title = title
|
||||||
|
// 将popup组件绑定到被右键点击的元素 -> !注意!:现在固定为当前节点的父行div上,注意后续修改
|
||||||
|
popupContainer.value = e.target.parentElement.parentElement
|
||||||
|
popupVisible.value = true
|
||||||
|
}
|
||||||
|
if (+level === 0) {
|
||||||
|
// 测试显示下拉框
|
||||||
|
e.preventDefault()
|
||||||
|
rightClickNode.level = level
|
||||||
|
rightClickNode.isLeaf = isLeaf
|
||||||
|
rightClickNode.nodekey = nodekey
|
||||||
|
rightClickNode.title = title
|
||||||
|
problemTitle.value = `第${+rightClickNode.nodekey + 1}轮问题单`
|
||||||
|
roundRightContainer.value = e.target.parentElement
|
||||||
|
roundRightVisible.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 打开问题单事件
|
||||||
|
*/
|
||||||
|
const handleProblemShowClick = () => {
|
||||||
|
// 这里要显示轮次的问题单
|
||||||
|
problemRoundRef.value.open(rightClickNode.nodekey)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 右键测试项->自动根据子项生成用例
|
||||||
|
*/
|
||||||
|
const handleDoptionClickGreateCases = async () => {
|
||||||
|
rightClickNode.project_id = projectId.value // 在rightClickNode对象加入project_id属性
|
||||||
|
await caseApi.createByDemand(rightClickNode)
|
||||||
|
routeViewRef.value.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 右键弹出popup后复制
|
||||||
|
*/
|
||||||
|
const handleDoptionClickCopyDemand = async () => {
|
||||||
|
// 首先是要获取选项数据
|
||||||
|
cascaderLoading.value = true
|
||||||
|
modalVisible.value = true
|
||||||
|
// 请求后端给级联选择器数据
|
||||||
|
const res = await designApi.getRelatedCasDesign({ id: projectId.value }).catch((err) => {
|
||||||
|
Message.error("请求后端数据发生错误,请重试")
|
||||||
|
cascaderLoading.value = false
|
||||||
|
})
|
||||||
|
options.value = res.data
|
||||||
|
// 先获取当前右击的需求的key -> 然后找到所属design的nodekey
|
||||||
|
const currentDemandKey = rightClickNode.nodekey
|
||||||
|
const belongDesignKey = currentDemandKey.substring(0, currentDemandKey.lastIndexOf("-"))
|
||||||
|
// 默认赋值给demand的当前design,直接点击确定可以复制到当前
|
||||||
|
options.value.forEach((item) => {
|
||||||
|
item.children.forEach((tem) => {
|
||||||
|
tem.children.forEach((design_obj) => {
|
||||||
|
if (belongDesignKey === design_obj.key) {
|
||||||
|
relatedCopyData.value = design_obj.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
cascaderLoading.value = false
|
||||||
|
// 将checkbox-depth参数设置为非勾选
|
||||||
|
checkboxValue.value = false
|
||||||
|
}
|
||||||
|
/// refs
|
||||||
|
const checkboxValue = ref(false)
|
||||||
|
/**
|
||||||
|
* 确认复制
|
||||||
|
*/
|
||||||
|
const handleCopyDemand = async () => {
|
||||||
|
// 获取选择的design的id
|
||||||
|
const design_id = relatedCopyData.value
|
||||||
|
// 没有选取则直接返回false
|
||||||
|
if (!design_id) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 这里进行复制的数据处理
|
||||||
|
const res = await demandApi.copyToDesign({
|
||||||
|
project_id: projectId.value,
|
||||||
|
design_id: design_id,
|
||||||
|
demand_key: rightClickNode.nodekey,
|
||||||
|
depth: checkboxValue.value
|
||||||
|
})
|
||||||
|
if ((res.code = 200)) {
|
||||||
|
// 注意必须传projectId,否则返回空
|
||||||
|
treeDataStore.updateTestDemandTreeData(res.data, projectId.value)
|
||||||
|
Notification.success("复制成功,为避免重复,设置了(复制)字样,请手动修改...")
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
Message.error("复制失败,服务器错误")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
popupVisible,
|
||||||
|
popupContainer,
|
||||||
|
roundRightVisible,
|
||||||
|
roundRightContainer,
|
||||||
|
problemRoundRef,
|
||||||
|
options,
|
||||||
|
modalVisible,
|
||||||
|
relatedCopyData,
|
||||||
|
cascaderLoading,
|
||||||
|
problemTitle,
|
||||||
|
checkboxValue,
|
||||||
|
displayRightMenu,
|
||||||
|
handleProblemShowClick,
|
||||||
|
handleDoptionClickGreateCases,
|
||||||
|
handleDoptionClickCopyDemand,
|
||||||
|
handleCopyDemand
|
||||||
|
}
|
||||||
|
}
|
||||||
51
cdTMP/src/layout/treeHooks/searchNodes.ts
Normal file
51
cdTMP/src/layout/treeHooks/searchNodes.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import type { Ref } from "vue"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import { storeToRefs } from "pinia"
|
||||||
|
/**
|
||||||
|
* 辅助搜索:递归函数
|
||||||
|
*/
|
||||||
|
const loop = (itemdata: any[], searchKey: Ref<string>) => {
|
||||||
|
const result: any[] = []
|
||||||
|
itemdata.forEach((item) => {
|
||||||
|
if (item.title.indexOf(searchKey.value.replace(" ", "")) > -1) {
|
||||||
|
result.push({ ...item })
|
||||||
|
} else if (item.children) {
|
||||||
|
const filterdata = loop(item.children, searchKey)
|
||||||
|
if (filterdata.length) {
|
||||||
|
result.push({
|
||||||
|
...item,
|
||||||
|
children: filterdata
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索v-model/搜索按钮点击
|
||||||
|
*/
|
||||||
|
export default function useSearchNodes() {
|
||||||
|
// global
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
const { treeData } = storeToRefs(treeDataStore)
|
||||||
|
// refs
|
||||||
|
const searchKey = ref("")
|
||||||
|
// 点击搜索事件
|
||||||
|
const handleSearchTreeDataClick = () => {
|
||||||
|
console.log(searchKey.value)
|
||||||
|
// 返回过滤后的treeData
|
||||||
|
// treeDataStore.originTreeData
|
||||||
|
if (searchKey.value) {
|
||||||
|
treeData.value = treeDataStore.originTreeData
|
||||||
|
;(treeData as Ref<any[]>).value = loop(treeDataStore.treeData, searchKey)
|
||||||
|
} else {
|
||||||
|
treeData.value = treeDataStore.originTreeData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
searchKey,
|
||||||
|
handleSearchTreeDataClick
|
||||||
|
}
|
||||||
|
}
|
||||||
134
cdTMP/src/layout/treeHooks/treeDrag.js
Normal file
134
cdTMP/src/layout/treeHooks/treeDrag.js
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import { storeToRefs } from "pinia"
|
||||||
|
import { Message, Notification } from "@arco-design/web-vue"
|
||||||
|
import caseApi from "@/api/project/case"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
|
||||||
|
export default function useTreeDrag(projectId, routeViewRef) {
|
||||||
|
// global
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
const { treeData } = storeToRefs(treeDataStore)
|
||||||
|
// 闭包储存变量
|
||||||
|
let dragNodeGlobal = null
|
||||||
|
let dropNodeGlobal = null
|
||||||
|
let dragDropPosition = 0
|
||||||
|
// ref对象
|
||||||
|
const paoVisible = ref(false)
|
||||||
|
const paoContainer = ref(null)
|
||||||
|
const pao2Visible = ref(false)
|
||||||
|
const pao2Container = ref(null)
|
||||||
|
// a-tree -> 节点在可释放目标释放的操作 - drapNode是被拖拽的节点,
|
||||||
|
// dropNone是释放在哪个节点下,dropPosition是释放的位置-1,0...
|
||||||
|
const ondrop = ({ e, dragNode, dropNode, dropPosition }) => {
|
||||||
|
const data = treeData.value // 1.这是整体的树数据
|
||||||
|
// 提示用户只能拖拽用例节点
|
||||||
|
if (dragNode.level === "3") {
|
||||||
|
Message.warning("只能拖拽用例节点")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 拖拽逻辑:
|
||||||
|
// 1.首先只能拖拽用例节点才能实现功能
|
||||||
|
if (dragNode.level === "4") {
|
||||||
|
// 2.1.如果是拖拽到测试项节点下
|
||||||
|
if (dropNode.level === "3") {
|
||||||
|
// 2.1.1.如果位置为0,则放在了测试项里面,为1,-1在测试上下都不处理
|
||||||
|
if (dropPosition === 0) {
|
||||||
|
// 判断用例是否已经测试项节点里面了
|
||||||
|
if (!dropNode.children || !dropNode.children.includes(dragNode)) {
|
||||||
|
// 不在测试项里面,则弹出提示是复制还是移动
|
||||||
|
dragNodeGlobal = dragNode
|
||||||
|
dropNodeGlobal = dropNode
|
||||||
|
paoContainer.value = e.target.parentElement
|
||||||
|
paoVisible.value = true
|
||||||
|
} else if (dropNode.children.includes(dragNode)) {
|
||||||
|
// 这里就用例拖拽到当前的测试项节点,则可弹出复制弹窗
|
||||||
|
dragNodeGlobal = dragNode
|
||||||
|
dropNodeGlobal = dropNode
|
||||||
|
paoContainer.value = e.target.parentElement
|
||||||
|
paoVisible.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (dropNode.level === "4") {
|
||||||
|
// 2.2.如果拖拽到测试用例节点,注意拖动到自己上下方不触发
|
||||||
|
// 2.2.1先要判断用例是否是同一个demand,则是改变顺序
|
||||||
|
dragNodeGlobal = dragNode
|
||||||
|
dropNodeGlobal = dropNode
|
||||||
|
pao2Container.value = e.target.parentElement
|
||||||
|
pao2Visible.value = true
|
||||||
|
dragDropPosition = dropPosition
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// a-tree是否运行拖拽
|
||||||
|
const allowdrop = (options) => {
|
||||||
|
if (options.dropNode.level === "4" || options.dropNode.level === "3") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 拖拽后弹出气泡-移动
|
||||||
|
const paoOk = async () => {
|
||||||
|
const res = await caseApi.copyOrMoveCaseToDemand({
|
||||||
|
project_id: projectId.value,
|
||||||
|
case_key: dragNodeGlobal.key,
|
||||||
|
demand_key: dropNodeGlobal.key,
|
||||||
|
move: true
|
||||||
|
})
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.oldCaseKey, projectId.value)
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.newCaseKey, projectId.value)
|
||||||
|
routeViewRef.value.refresh()
|
||||||
|
Notification.success("移动用例成功")
|
||||||
|
}
|
||||||
|
/// 拖拽后弹出气泡-复制
|
||||||
|
const paoCancel = async () => {
|
||||||
|
const res = await caseApi.copyOrMoveCaseToDemand({
|
||||||
|
project_id: projectId.value,
|
||||||
|
case_key: dragNodeGlobal.key,
|
||||||
|
demand_key: dropNodeGlobal.key,
|
||||||
|
move: false
|
||||||
|
})
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.oldCaseKey, projectId.value)
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.newCaseKey, projectId.value)
|
||||||
|
routeViewRef.value.refresh()
|
||||||
|
Notification.success("复制用例成功")
|
||||||
|
}
|
||||||
|
/// 同级分2个气泡ok是移动,cancel是复制
|
||||||
|
const paoOk2 = async () => {
|
||||||
|
const res = await caseApi.copyOrMoveCaseByCase({
|
||||||
|
project_id: projectId.value,
|
||||||
|
drag_key: dragNodeGlobal.key,
|
||||||
|
drop_key: dropNodeGlobal.key,
|
||||||
|
position: dragDropPosition,
|
||||||
|
move: true
|
||||||
|
})
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.old, projectId.value)
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.new, projectId.value)
|
||||||
|
routeViewRef.value.refresh()
|
||||||
|
Notification.success("移动用例成功")
|
||||||
|
}
|
||||||
|
const paoCancel2 = async () => {
|
||||||
|
const res = await caseApi.copyOrMoveCaseByCase({
|
||||||
|
project_id: projectId.value,
|
||||||
|
drag_key: dragNodeGlobal.key,
|
||||||
|
drop_key: dropNodeGlobal.key,
|
||||||
|
position: dragDropPosition,
|
||||||
|
move: false
|
||||||
|
})
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.old, projectId.value)
|
||||||
|
await treeDataStore.updateCaseTreeData(res.data.new, projectId.value)
|
||||||
|
routeViewRef.value.refresh()
|
||||||
|
Notification.success("复制用例成功")
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
paoVisible,
|
||||||
|
paoContainer,
|
||||||
|
pao2Visible,
|
||||||
|
pao2Container,
|
||||||
|
ondrop,
|
||||||
|
allowdrop,
|
||||||
|
paoOk,
|
||||||
|
paoCancel,
|
||||||
|
paoOk2,
|
||||||
|
paoCancel2
|
||||||
|
}
|
||||||
|
}
|
||||||
59
cdTMP/src/layout/treeHooks/useLoadTreeNodes.ts
Normal file
59
cdTMP/src/layout/treeHooks/useLoadTreeNodes.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import projectApi from "@/api/project/project"
|
||||||
|
import { useRoute } from "vue-router"
|
||||||
|
export default function useLoadTreeNode() {
|
||||||
|
// global
|
||||||
|
const route = useRoute()
|
||||||
|
const projectInfo = ref({ ...route.query })
|
||||||
|
|
||||||
|
// Events
|
||||||
|
const loadMore = (nodeData) => {
|
||||||
|
if (nodeData.level == "0") {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
const res = await projectApi
|
||||||
|
.getDutInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
||||||
|
.catch(() => {
|
||||||
|
resolve(undefined) // 捕获错误,让动态加载不再一直转圈
|
||||||
|
})
|
||||||
|
nodeData.children = res.data
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (nodeData.level == "1") {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
const res = await projectApi
|
||||||
|
.getDemandInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
||||||
|
.catch(() => {
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
nodeData.children = res.data
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (nodeData.level == "2") {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
const res = await projectApi
|
||||||
|
.getTestInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
||||||
|
.catch(() => {
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
nodeData.children = res.data
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (nodeData.level == "3") {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
const res = await projectApi
|
||||||
|
.getCaseInfo(projectInfo.value.id, nodeData.key, nodeData.level)
|
||||||
|
.catch(() => {
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
nodeData.children = res.data
|
||||||
|
resolve(undefined)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
loadMore
|
||||||
|
}
|
||||||
|
}
|
||||||
103
cdTMP/src/layout/treeHooks/useNodeClick.ts
Normal file
103
cdTMP/src/layout/treeHooks/useNodeClick.ts
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import { Ref, ref } from "vue"
|
||||||
|
import projectApi from "@/api/project/project"
|
||||||
|
import { useRoute } from "vue-router"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import { storeToRefs } from "pinia"
|
||||||
|
import { useRouter } from "vue-router"
|
||||||
|
export default function useNodeClick(expandedKeys: Ref<string[]>) {
|
||||||
|
// global
|
||||||
|
const route = useRoute()
|
||||||
|
const projectInfo = ref({ ...route.query })
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
const { treeData } = storeToRefs(treeDataStore)
|
||||||
|
const router = useRouter()
|
||||||
|
// variable
|
||||||
|
let timerId: number | null = null
|
||||||
|
let count = 0
|
||||||
|
// refs
|
||||||
|
const selectedKeys = ref<any>([]) // 中间变量用于判断
|
||||||
|
const previousKey = ref<any>() // 上一次点击
|
||||||
|
// 点击事件
|
||||||
|
const pointNode = (value, data) => {
|
||||||
|
// 获取处理单击不选中,双击选中的变量
|
||||||
|
let catch_selected_key = selectedKeys.value
|
||||||
|
selectedKeys.value = previousKey.value
|
||||||
|
count++
|
||||||
|
if (timerId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
timerId = setTimeout(async () => {
|
||||||
|
if (count > 1) {
|
||||||
|
// 双击触发 value是点击的节点,data是节点数据
|
||||||
|
if (data.node.level == "0") {
|
||||||
|
projectApi.getDutInfo(projectInfo.value.id, data.node.key, data.node.level).then((res: any) => {
|
||||||
|
;(treeData.value[value] as any).children = res.data
|
||||||
|
// 添加需要展开数据,注意不要一直push,判断在已展开节点是否包含点击的节点
|
||||||
|
if (!expandedKeys.value.includes(value[0])) {
|
||||||
|
expandedKeys.value.push(value[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (data.node.level == "1") {
|
||||||
|
projectApi.getDemandInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
||||||
|
data.node.children = res.data
|
||||||
|
if (!expandedKeys.value.includes(value[0])) {
|
||||||
|
expandedKeys.value.push(value[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (data.node.level == "2") {
|
||||||
|
projectApi.getTestInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
||||||
|
data.node.children = res.data
|
||||||
|
if (!expandedKeys.value.includes(value[0])) {
|
||||||
|
expandedKeys.value.push(value[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (data.node.level == "3") {
|
||||||
|
projectApi.getCaseInfo(projectInfo.value.id, data.node.key, data.node.level).then((res) => {
|
||||||
|
data.node.children = res.data
|
||||||
|
if (!expandedKeys.value.includes(value[0])) {
|
||||||
|
expandedKeys.value.push(value[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
count = 0
|
||||||
|
if (timerId) clearTimeout(timerId)
|
||||||
|
timerId = null
|
||||||
|
} else {
|
||||||
|
// 单击触发
|
||||||
|
if (data.node.level === "0") {
|
||||||
|
router.push({ name: "round", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
}
|
||||||
|
if (data.node.level === "1") {
|
||||||
|
router.push({ name: "dut", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
}
|
||||||
|
if (data.node.level === "2") {
|
||||||
|
router.push({ name: "designDemand", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
}
|
||||||
|
if (data.node.level === "3") {
|
||||||
|
router.push({ name: "testDemand", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
}
|
||||||
|
if (data.node.level === "4") {
|
||||||
|
router.push({ name: "case", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
}
|
||||||
|
// if (data.node.level === "5") {
|
||||||
|
// router.push({ name: "problem", query: { ...projectInfo.value, key: data.node.key } })
|
||||||
|
// }
|
||||||
|
treeDataStore.setCurrentNode(data.node.key)
|
||||||
|
// 单击设置选择的key
|
||||||
|
selectedKeys.value = catch_selected_key
|
||||||
|
// 单击后设置previous选中的key是什么
|
||||||
|
previousKey.value = catch_selected_key
|
||||||
|
count = 0
|
||||||
|
timerId && clearTimeout(timerId)
|
||||||
|
timerId = null
|
||||||
|
}
|
||||||
|
}, 250)
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
selectedKeys,
|
||||||
|
pointNode
|
||||||
|
}
|
||||||
|
}
|
||||||
20
cdTMP/src/layout/treeHooks/useNodeExpand.ts
Normal file
20
cdTMP/src/layout/treeHooks/useNodeExpand.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { ref } from "vue"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
export default function useNodeExpand() {
|
||||||
|
// global
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
// refs
|
||||||
|
const expandedKeys = ref<string[]>([]) // v-model对应a-tree展开的节点
|
||||||
|
const allExpandedKeys = ref<string[]>([]) // 全部展开后的节点数组
|
||||||
|
/**
|
||||||
|
* 事件:用户点击切换展开或收缩
|
||||||
|
*/
|
||||||
|
const toggleExpanded = () => {
|
||||||
|
allExpandedKeys.value = treeDataStore.outExpandNode()
|
||||||
|
expandedKeys.value = expandedKeys?.value.length ? [] : allExpandedKeys.value
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
expandedKeys,
|
||||||
|
toggleExpanded
|
||||||
|
}
|
||||||
|
}
|
||||||
252
cdTMP/src/layout/treeHooks/useRoundMaForm.ts
Normal file
252
cdTMP/src/layout/treeHooks/useRoundMaForm.ts
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
import { Ref, ref } from "vue"
|
||||||
|
import { useRoute } from "vue-router"
|
||||||
|
import { useRouter } from "vue-router"
|
||||||
|
import roundApi from "@/api/project/round"
|
||||||
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import dayjs from "dayjs"
|
||||||
|
import { Message } from "@arco-design/web-vue"
|
||||||
|
export default function useRoundMaForm(projectId: Ref<string>, handleSoDutExistsForceModal: Function) {
|
||||||
|
// global
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const treeDataStore = useTreeDataStore()
|
||||||
|
// refs
|
||||||
|
const maFormModalRef = ref()
|
||||||
|
const title = ref("")
|
||||||
|
// MA-FORM表单配置
|
||||||
|
const roundColumn = ref([
|
||||||
|
{
|
||||||
|
title: "基本信息",
|
||||||
|
customClass: ["mb-2", "pb-0"],
|
||||||
|
formType: "card",
|
||||||
|
bodyStyle: { paddingBottom: 0 },
|
||||||
|
formList: [
|
||||||
|
{
|
||||||
|
formType: "grid",
|
||||||
|
cols: [
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [
|
||||||
|
{ title: "轮次标识", dataIndex: "ident", disabled: true },
|
||||||
|
{
|
||||||
|
title: "开始时间",
|
||||||
|
dataIndex: "beginTime",
|
||||||
|
formType: "date",
|
||||||
|
placeholder: "请选择时间",
|
||||||
|
extra: "尽量大于项目开始时间13天,生成文档才符合要求",
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: "开始时间必填" },
|
||||||
|
{
|
||||||
|
validator: (value, callback) => {
|
||||||
|
const projectBegin = route.query.beginTime!
|
||||||
|
value <= projectBegin
|
||||||
|
? callback(
|
||||||
|
"不能早于项目开始时间,由于还有前期测试设计阶段,建议大于项目开始时间13天"
|
||||||
|
)
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "速度等级",
|
||||||
|
dataIndex: "speedGrade",
|
||||||
|
placeholder: "请填入速度等级"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "动态地点",
|
||||||
|
dataIndex: "location",
|
||||||
|
placeholder: "请填入测试地点",
|
||||||
|
extra: "该字段影响时间相关表格的地点",
|
||||||
|
rules: [{ required: true, message: "测试地点是必填的" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [
|
||||||
|
{ title: "名称", dataIndex: "name", rules: [{ required: true, message: "名称必填" }] },
|
||||||
|
{
|
||||||
|
title: "结束时间",
|
||||||
|
dataIndex: "endTime",
|
||||||
|
formType: "date",
|
||||||
|
placeholder: "请选择时间",
|
||||||
|
extra: "该字段决定《测试记录》封面时间",
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: "结束时间必填" },
|
||||||
|
{
|
||||||
|
validator(value, errorCallback) {
|
||||||
|
let start = maFormModalRef.value.form.beginTime
|
||||||
|
value < start ? errorCallback("结束时间不能小于开始时间") : null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "封装",
|
||||||
|
dataIndex: "package",
|
||||||
|
placeholder: "请填入封装"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "质量等级",
|
||||||
|
dataIndex: "grade",
|
||||||
|
formType: "select",
|
||||||
|
dict: {
|
||||||
|
data: [
|
||||||
|
{ label: "军级", value: "1" },
|
||||||
|
{ label: "商业级", value: "2" },
|
||||||
|
{ label: "宇航级", value: "3" },
|
||||||
|
{ label: "工业级", value: "4" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
placeholder: "请填入质量等级",
|
||||||
|
rules: [{ required: true, message: "质量等级必填" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "card",
|
||||||
|
title: "极端工况信息",
|
||||||
|
customClass: ["mb-2", "pb-0"],
|
||||||
|
bodyStyle: { paddingBottom: 0 },
|
||||||
|
formList: [
|
||||||
|
{
|
||||||
|
formType: "divider",
|
||||||
|
title: "最好工况",
|
||||||
|
orientation: "left",
|
||||||
|
margin: "20px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "grid",
|
||||||
|
cols: [
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [
|
||||||
|
{ title: "电压", dataIndex: "best_condition_voltage", placeholder: "请填入电压" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [{ title: "温度", dataIndex: "best_condition_tem", placeholder: "请填入温度" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "divider",
|
||||||
|
title: "典型工况",
|
||||||
|
orientation: "left",
|
||||||
|
margin: "20px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "grid",
|
||||||
|
cols: [
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [
|
||||||
|
{ title: "电压", dataIndex: "typical_condition_voltage", placeholder: "请填入电压" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [{ title: "温度", dataIndex: "typical_condition_tem", placeholder: "请填入温度" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "divider",
|
||||||
|
title: "最差工况",
|
||||||
|
orientation: "left",
|
||||||
|
margin: "20px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
formType: "grid",
|
||||||
|
cols: [
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [{ title: "电压", dataIndex: "low_condition_voltage", placeholder: "请填入电压" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: 12,
|
||||||
|
formList: [{ title: "温度", dataIndex: "low_condition_tem", placeholder: "请填入温度" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
])
|
||||||
|
// 表单的option
|
||||||
|
const roundOption = ref({
|
||||||
|
customClass: [""]
|
||||||
|
})
|
||||||
|
// events
|
||||||
|
/// 点击新增轮次按钮
|
||||||
|
const handleRoundAddClick = (nodeData) => {
|
||||||
|
let create_number = treeDataStore.getRoundMiddleInfo()
|
||||||
|
// 这里是文档写错了,调用form是里面组件绑定的数据
|
||||||
|
maFormModalRef.value.form = {}
|
||||||
|
// 这里如果删除中间轮次,那么新增信息应该从中间开始
|
||||||
|
maFormModalRef.value.open({
|
||||||
|
beginTime: dayjs().format("YYYY-MM-DD"),
|
||||||
|
grade: "1",
|
||||||
|
key: `${create_number}`,
|
||||||
|
name: `第${create_number + 1}轮测试`,
|
||||||
|
ident: `${route.query.ident}-R${create_number + 1}`,
|
||||||
|
project: projectId.value
|
||||||
|
})
|
||||||
|
title.value = "新增轮次"
|
||||||
|
}
|
||||||
|
/// 点击编辑轮次按钮
|
||||||
|
const handleRoundEditClick = async (nodeData) => {
|
||||||
|
const data = await roundApi.getOneRoundInfo({
|
||||||
|
projectId: projectId.value,
|
||||||
|
round: nodeData.key
|
||||||
|
})
|
||||||
|
maFormModalRef.value.open(data.data)
|
||||||
|
title.value = `编辑轮次:${data.data.name}`
|
||||||
|
}
|
||||||
|
/// 点击删除轮次按钮
|
||||||
|
const handleRoundDelClick = async (value) => {
|
||||||
|
try {
|
||||||
|
await roundApi.delete(projectId.value, value)
|
||||||
|
Message.success("删除成功!")
|
||||||
|
treeDataStore.resetTreeData(projectId.value)
|
||||||
|
router.replace({ name: "project", query: route.query })
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
/// Ma-form-Modal的提交按钮 - 轮次新增/编辑逻辑
|
||||||
|
const handleRoundSubmit = async (value) => {
|
||||||
|
if (title.value.slice(0, 1) === "编") {
|
||||||
|
try {
|
||||||
|
await roundApi.update(value.id, value)
|
||||||
|
Message.success("编辑成功!")
|
||||||
|
} catch {
|
||||||
|
Message.error("编辑失败!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (title.value.slice(0, 1) === "新") {
|
||||||
|
try {
|
||||||
|
await roundApi.save(projectId.value, value)
|
||||||
|
Message.success("新增成功!")
|
||||||
|
treeDataStore.resetTreeData(projectId.value)
|
||||||
|
// 调用判断函数,判断是否轮次有源代码dut
|
||||||
|
handleSoDutExistsForceModal()
|
||||||
|
} catch {
|
||||||
|
Message.error("新增失败!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
maFormModalRef,
|
||||||
|
title,
|
||||||
|
roundColumn,
|
||||||
|
roundOption,
|
||||||
|
handleRoundAddClick,
|
||||||
|
handleRoundEditClick,
|
||||||
|
handleRoundDelClick,
|
||||||
|
handleRoundSubmit
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ const router = createRouter({
|
|||||||
component: PROJECT_LAYOUT,
|
component: PROJECT_LAYOUT,
|
||||||
meta: {
|
meta: {
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
|
ignoreCache: true, // 忽略缓存
|
||||||
roles: ["*"],
|
roles: ["*"],
|
||||||
order: 0,
|
order: 0,
|
||||||
locale: "项目工作区",
|
locale: "项目工作区",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, onMounted } from "vue"
|
import { reactive, ref, onMounted, readonly } from "vue"
|
||||||
import userApi from "@/api/system/user"
|
import userApi from "@/api/system/user"
|
||||||
import user from "@/api/system/user"
|
import user from "@/api/system/user"
|
||||||
import { Message } from "@arco-design/web-vue"
|
import { Message } from "@arco-design/web-vue"
|
||||||
@@ -44,7 +44,7 @@ const crudOptions = reactive({
|
|||||||
showCheckedAll: true
|
showCheckedAll: true
|
||||||
},
|
},
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
// 是否显示操作列
|
// 是否显示操作列
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="flex justify-between h-full">
|
<div class="flex justify-between h-full">
|
||||||
<div class="en-title bg-red-600">NA</div>
|
<div class="en-title bg-red-600">NA</div>
|
||||||
<div class="w-full ml-3.5 flex justify-between items-center">
|
<div class="w-full ml-3.5 flex justify-between items-center">
|
||||||
进行项目统计
|
进行中项目数
|
||||||
<a-space size="large" class="mr-3">
|
<a-space size="large" class="mr-3">
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<div>总数</div>
|
<div>总数</div>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<div class="flex justify-between h-full">
|
<div class="flex justify-between h-full">
|
||||||
<div class="en-title bg-green-600">OC</div>
|
<div class="en-title bg-green-600">OC</div>
|
||||||
<div class="w-full ml-3.5 flex justify-between items-center">
|
<div class="w-full ml-3.5 flex justify-between items-center">
|
||||||
完成项目总数
|
完成的项目数
|
||||||
<a-space size="large" class="mr-3">
|
<a-space size="large" class="mr-3">
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<div>总数</div>
|
<div>总数</div>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const crudOptions = ref({
|
|||||||
tablePagination: false,
|
tablePagination: false,
|
||||||
rowSelection: { showCheckedAll: true },
|
rowSelection: { showCheckedAll: true },
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const crudColumns = ref([
|
const crudColumns = ref([
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true, api: dictApi.updateDictItemData },
|
edit: { show: true, api: dictApi.updateDictItemData },
|
||||||
delete: { show: true, api: dictApi.realDeleteItem },
|
delete: { show: true, api: dictApi.realDeleteItem },
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const crudOptions = ref({
|
|||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
showTools: false,
|
showTools: false,
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const crudOptions = ref({
|
|||||||
rowSelection: { showCheckedAll: true },
|
rowSelection: { showCheckedAll: true },
|
||||||
showTools: false,
|
showTools: false,
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const crudColumns = ref([
|
const crudColumns = ref([
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ const crudOptions = ref({
|
|||||||
formOption: {
|
formOption: {
|
||||||
viewType: "drawer",
|
viewType: "drawer",
|
||||||
width: 600
|
width: 600
|
||||||
|
},
|
||||||
|
afterDelete(response) {
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const crudColumns = ref([
|
const crudColumns = ref([
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ const crudOptions = reactive({
|
|||||||
pageLayout: "fixed",
|
pageLayout: "fixed",
|
||||||
showTools: false,
|
showTools: false,
|
||||||
tablePagination: false,
|
tablePagination: false,
|
||||||
bordered: { wrapper: true, cell: true }
|
bordered: { wrapper: true, cell: true },
|
||||||
|
afterDelete(response) {
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const crudColumns = reactive([
|
const crudColumns = reactive([
|
||||||
{ title: "ID", dataIndex: "id", addDisplay: false, editDisplay: false, width: 50, hide: true },
|
{ title: "ID", dataIndex: "id", addDisplay: false, editDisplay: false, width: 50, hide: true },
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ const crudOptions = ref({
|
|||||||
formOption: {
|
formOption: {
|
||||||
viewType: "drawer",
|
viewType: "drawer",
|
||||||
width: 600
|
width: 600
|
||||||
|
},
|
||||||
|
afterDelete(response) {
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const crudColumns = ref([
|
const crudColumns = ref([
|
||||||
|
|||||||
@@ -124,9 +124,6 @@ const crudOptions = ref({
|
|||||||
showTools: false, // 不显示工具栏
|
showTools: false, // 不显示工具栏
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
operationColumnAlign: "center", // 操作列居中
|
operationColumnAlign: "center", // 操作列居中
|
||||||
afterDelete(response) {
|
|
||||||
crudRef.value.setSelecteds([])
|
|
||||||
},
|
|
||||||
isDbClickEdit: false, // 双击不编辑当前列
|
isDbClickEdit: false, // 双击不编辑当前列
|
||||||
contextMenu: {
|
contextMenu: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -233,6 +230,7 @@ const crudOptions = ref({
|
|||||||
// 添加删除后置处理方法:让父组件知道我删除了,你必须刷新表格
|
// 添加删除后置处理方法:让父组件知道我删除了,你必须刷新表格
|
||||||
afterDelete(response, record) {
|
afterDelete(response, record) {
|
||||||
emits("deleted")
|
emits("deleted")
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const crudOptions = ref({
|
|||||||
case: caseNumber
|
case: caseNumber
|
||||||
},
|
},
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
// 请求后置处理-用于新增/删除更新树状的用例关联问题单状态
|
// 请求后置处理-用于新增/删除更新树状的用例关联问题单状态
|
||||||
afterRequest(datas) {
|
afterRequest(datas) {
|
||||||
|
|||||||
@@ -153,9 +153,6 @@ const crudOptions = ref({
|
|||||||
add: { show: true, api: testDemandApi.save, text: "新增测试项" },
|
add: { show: true, api: testDemandApi.save, text: "新增测试项" },
|
||||||
edit: { show: true, api: testDemandApi.update, text: "修改测试项" },
|
edit: { show: true, api: testDemandApi.update, text: "修改测试项" },
|
||||||
delete: { show: true, api: testDemandApi.delete },
|
delete: { show: true, api: testDemandApi.delete },
|
||||||
afterDelete(response) {
|
|
||||||
crudRef.value.setSelecteds([])
|
|
||||||
},
|
|
||||||
showTools: false,
|
showTools: false,
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
let key_split = route.query.key.split("-")
|
let key_split = route.query.key.split("-")
|
||||||
@@ -189,6 +186,8 @@ const crudOptions = ref({
|
|||||||
record = { key: route.query.key + "-X" }
|
record = { key: route.query.key + "-X" }
|
||||||
}
|
}
|
||||||
treeDataStore.updateTestDemandTreeData(record, id)
|
treeDataStore.updateTestDemandTreeData(record, id)
|
||||||
|
// 清空选择
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
projectId: route.query.id,
|
projectId: route.query.id,
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ const crudOptions = ref({
|
|||||||
add: { show: true, api: designDemandApi.save, text: "新增设计需求" },
|
add: { show: true, api: designDemandApi.save, text: "新增设计需求" },
|
||||||
edit: { show: true, api: designDemandApi.editDesignDemand, text: "编辑设计需求" },
|
edit: { show: true, api: designDemandApi.editDesignDemand, text: "编辑设计需求" },
|
||||||
delete: { show: true, api: designDemandApi.delete },
|
delete: { show: true, api: designDemandApi.delete },
|
||||||
afterDelete(response) {
|
|
||||||
crudRef.value.setSelecteds([])
|
|
||||||
},
|
|
||||||
// 处理添加后函数
|
// 处理添加后函数
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
let key_split = route.query.key.split("-")
|
let key_split = route.query.key.split("-")
|
||||||
@@ -103,7 +100,10 @@ const crudOptions = ref({
|
|||||||
record = { key: route.query.key + "-X" }
|
record = { key: route.query.key + "-X" }
|
||||||
}
|
}
|
||||||
treeDataStore.updateDesignDemandTreeData(record, id)
|
treeDataStore.updateDesignDemandTreeData(record, id)
|
||||||
|
// 删除后情况行选择器
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
|
|
||||||
parameters: {
|
parameters: {
|
||||||
projectId: route.query.id,
|
projectId: route.query.id,
|
||||||
round: roundNumber,
|
round: roundNumber,
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ let beiceType = [
|
|||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
api: dutApi.getDutList,
|
api: dutApi.getDutList,
|
||||||
add: { show: true, api: dutApi.save, text: "新增被测件" },
|
add: { show: true, api: dutApi.save, text: "新增被测件" },
|
||||||
afterDelete(response) {
|
|
||||||
crudRef.value.setSelecteds([])
|
|
||||||
},
|
|
||||||
// 处理添加后函数
|
// 处理添加后函数
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
let round_str = parseInt(route.query.key) + 1
|
let round_str = parseInt(route.query.key) + 1
|
||||||
@@ -60,6 +57,8 @@ const crudOptions = ref({
|
|||||||
record = { key: route.query.key + "-X" }
|
record = { key: route.query.key + "-X" }
|
||||||
}
|
}
|
||||||
treeDataStore.updateDutTreeData(record, id)
|
treeDataStore.updateDutTreeData(record, id)
|
||||||
|
// 清空行选择器
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
edit: { show: true, api: dutApi.update, text: "编辑被测件" },
|
edit: { show: true, api: dutApi.update, text: "编辑被测件" },
|
||||||
delete: { show: true, api: dutApi.delete },
|
delete: { show: true, api: dutApi.delete },
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ const crudOptions = ref({
|
|||||||
delete: { show: true, api: caseApi.delete },
|
delete: { show: true, api: caseApi.delete },
|
||||||
operationColumnAlign: "center",
|
operationColumnAlign: "center",
|
||||||
isDbClickEdit: false, // 关闭双击编辑
|
isDbClickEdit: false, // 关闭双击编辑
|
||||||
afterDelete(response) {
|
|
||||||
crudRef.value.setSelecteds([])
|
|
||||||
},
|
|
||||||
// 处理新增删除后树状图显示
|
// 处理新增删除后树状图显示
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
let key_split = route.query.key.split("-")
|
let key_split = route.query.key.split("-")
|
||||||
@@ -87,6 +84,8 @@ const crudOptions = ref({
|
|||||||
record = { key: route.query.key + "-X" }
|
record = { key: route.query.key + "-X" }
|
||||||
}
|
}
|
||||||
treeDataStore.updateCaseTreeData(record, id)
|
treeDataStore.updateCaseTreeData(record, id)
|
||||||
|
// 被删除还是在选择里面
|
||||||
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
projectId: route.query.id,
|
projectId: route.query.id,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const crudOptions = ref<object>({
|
|||||||
params.projectId = route.params.projectId as string
|
params.projectId = route.params.projectId as string
|
||||||
},
|
},
|
||||||
afterDelete(response: any) {
|
afterDelete(response: any) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
showTools: false,
|
showTools: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { Message } from "@arco-design/web-vue"
|
import { Message } from "@arco-design/web-vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
/**
|
||||||
|
* 生成最终产品文档的进度条模块
|
||||||
|
*/
|
||||||
async create_entire_doc(visible, isComplete, api, record_id) {
|
async create_entire_doc(visible, isComplete, api, record_id) {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
isComplete.value = false
|
isComplete.value = false
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ import { Message } from "@arco-design/web-vue"
|
|||||||
import Progress from "./cpns/progress.vue"
|
import Progress from "./cpns/progress.vue"
|
||||||
import hoosk from "@/views/testmanage/projmanage/hooks.js"
|
import hoosk from "@/views/testmanage/projmanage/hooks.js"
|
||||||
import { validateBlank } from "@/utils/extensions/arcoValidator"
|
import { validateBlank } from "@/utils/extensions/arcoValidator"
|
||||||
|
// addDefault、editDefault信息导入
|
||||||
|
import textInfo from "@/config/textInfo"
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
// 定义预览组件的Ref
|
// 定义预览组件的Ref
|
||||||
const previewRef = ref()
|
const previewRef = ref()
|
||||||
@@ -350,7 +352,6 @@ const handleFragmentClick = (record) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// CRUD-OPTIONS
|
|
||||||
const crudRef = ref()
|
const crudRef = ref()
|
||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
rowSelection: { showCheckedAll: true },
|
rowSelection: { showCheckedAll: true },
|
||||||
@@ -367,7 +368,7 @@ const crudOptions = ref({
|
|||||||
operationColumnWidth: 280, // 操作列宽度
|
operationColumnWidth: 280, // 操作列宽度
|
||||||
operationColumnAlign: "center", // 操作列对齐方式
|
operationColumnAlign: "center", // 操作列对齐方式
|
||||||
afterDelete(response) {
|
afterDelete(response) {
|
||||||
crudRef.value.setSelecteds([])
|
crudRef.value.tableRef.selectAll(false)
|
||||||
},
|
},
|
||||||
// 处理弹窗的title
|
// 处理弹窗的title
|
||||||
beforeOpenAdd: function () {
|
beforeOpenAdd: function () {
|
||||||
@@ -775,6 +776,7 @@ const crudColumns = ref([
|
|||||||
title: "单位",
|
title: "单位",
|
||||||
dataIndex: "test_unit",
|
dataIndex: "test_unit",
|
||||||
hide: true,
|
hide: true,
|
||||||
|
addDefaultValue: textInfo.testUnitAddDefaultText,
|
||||||
commonRules: [{ required: true, message: "单位必选" }],
|
commonRules: [{ required: true, message: "单位必选" }],
|
||||||
formType: "select",
|
formType: "select",
|
||||||
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
|
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
|
||||||
@@ -783,6 +785,7 @@ const crudColumns = ref([
|
|||||||
formType: "input",
|
formType: "input",
|
||||||
title: "联系人",
|
title: "联系人",
|
||||||
dataIndex: "test_contact",
|
dataIndex: "test_contact",
|
||||||
|
addDefaultValue: textInfo.testUnitContactPersonName,
|
||||||
hide: true,
|
hide: true,
|
||||||
commonRules: [{ required: true, message: "联系人必填" }]
|
commonRules: [{ required: true, message: "联系人必填" }]
|
||||||
},
|
},
|
||||||
@@ -790,6 +793,7 @@ const crudColumns = ref([
|
|||||||
formType: "input",
|
formType: "input",
|
||||||
title: "联系电话",
|
title: "联系电话",
|
||||||
dataIndex: "test_contact_phone",
|
dataIndex: "test_contact_phone",
|
||||||
|
addDefaultValue: textInfo.testUnintContactPhoneNumber,
|
||||||
hide: true,
|
hide: true,
|
||||||
maxLength: 11,
|
maxLength: 11,
|
||||||
commonRules: [
|
commonRules: [
|
||||||
|
|||||||
Reference in New Issue
Block a user