From f470a7fece0246120fbb44b8c64590367b3778ea Mon Sep 17 00:00:00 2001 From: ks3356143 <314298729@qq.com> Date: Tue, 3 Sep 2024 17:40:15 +0800 Subject: [PATCH] 0099 --- cdTMP/package-lock.json | 33 ++-- cdTMP/package.json | 6 +- cdTMP/src/api/project/case.js | 12 ++ .../ma-crud/components/contextMenu.vue | 8 +- cdTMP/src/components/ma-editor/index.vue | 8 +- .../ma-form/formItem/form-userinfo.vue | 9 - .../ma-form/formItem/form-verify-code.vue | 9 - cdTMP/src/directives/role/index.js | 3 +- cdTMP/src/directives/role/role.js | 5 +- cdTMP/src/hooks/workarea/currentCasePage.ts | 52 ++++++ cdTMP/src/layout/components/navbar.vue | 13 +- cdTMP/src/router/routes/modules/dashboard.js | 4 +- cdTMP/src/router/routes/modules/minitor.js | 4 +- cdTMP/src/views/login.vue | 2 +- .../case/components/CaseForm/index.vue | 155 ++++++++++++++++++ .../project/case/components/CaseModal.vue | 56 ++++++- .../project/case/components/ProblemChoose.vue | 15 +- .../views/project/case/components/types.ts | 24 +++ cdTMP/src/views/project/case/index.vue | 15 +- .../projmanage/hooks/useCrudInit.ts | 19 ++- .../src/views/testmanage/projmanage/index.vue | 2 + 21 files changed, 383 insertions(+), 71 deletions(-) create mode 100644 cdTMP/src/hooks/workarea/currentCasePage.ts create mode 100644 cdTMP/src/views/project/case/components/CaseForm/index.vue create mode 100644 cdTMP/src/views/project/case/components/types.ts diff --git a/cdTMP/package-lock.json b/cdTMP/package-lock.json index 3b2e51d..28ba5d7 100644 --- a/cdTMP/package-lock.json +++ b/cdTMP/package-lock.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/lodash": "^4.14.195", - "@types/node": "^22.5.1", + "@types/node": "^22.5.2", "@types/nprogress": "^0.2.3", "@types/qs": "^6.9.15", "@vitejs/plugin-vue": "^5.1.3", @@ -45,10 +45,10 @@ "browserslist": "^4.23.0", "caniuse-lite": "^1.0.30001655", "eslint": "^9.9.1", - "eslint-plugin-vue": "^9.27.0", + "eslint-plugin-vue": "^9.28.0", "less": "^4.2.0", "less-loader": "^12.2.0", - "postcss": "^8.4.42", + "postcss": "^8.4.44", "prettier": "^3.3.3", "tailwindcss": "^3.4.10", "typescript": "^5.5.3", @@ -1410,9 +1410,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.5.1", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.5.1.tgz", - "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "version": "22.5.2", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.5.2.tgz", + "integrity": "sha512-acJsPTEqYqulZS/Yp/S3GgeE6GZ0qYODUR8aVr/DkhHQ8l9nd4j5x1/ZJy9/gHrRlFMqkO6i0I3E27Alu4jjPg==", "dev": true, "license": "MIT", "dependencies": { @@ -2747,9 +2747,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.27.0", - "resolved": "https://registry.npmmirror.com/eslint-plugin-vue/-/eslint-plugin-vue-9.27.0.tgz", - "integrity": "sha512-5Dw3yxEyuBSXTzT5/Ge1X5kIkRTQ3nvBn/VwPwInNiZBSJOO/timWMUaflONnFBzU6NhB68lxnCda7ULV5N7LA==", + "version": "9.28.0", + "resolved": "https://registry.npmmirror.com/eslint-plugin-vue/-/eslint-plugin-vue-9.28.0.tgz", + "integrity": "sha512-ShrihdjIhOTxs+MfWun6oJWuk+g/LAhN+CiuOl/jjkG3l0F2AuK5NMTaWqyvBgkFtpYmyks6P4603mLmhNJW8g==", "dev": true, "license": "MIT", "dependencies": { @@ -2758,7 +2758,7 @@ "natural-compare": "^1.4.0", "nth-check": "^2.1.1", "postcss-selector-parser": "^6.0.15", - "semver": "^7.6.0", + "semver": "^7.6.3", "vue-eslint-parser": "^9.4.3", "xml-name-validator": "^4.0.0" }, @@ -2785,10 +2785,11 @@ } }, "node_modules/eslint-plugin-vue/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -4349,9 +4350,9 @@ } }, "node_modules/postcss": { - "version": "8.4.42", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.42.tgz", - "integrity": "sha512-hywKUQB9Ra4dR1mGhldy5Aj1X3MWDSIA1cEi+Uy0CjheLvP6Ual5RlwMCh8i/X121yEDLDIKBsrCQ8ba3FDMfQ==", + "version": "8.4.44", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.44.tgz", + "integrity": "sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw==", "funding": [ { "type": "opencollective", diff --git a/cdTMP/package.json b/cdTMP/package.json index 23ea907..005c173 100644 --- a/cdTMP/package.json +++ b/cdTMP/package.json @@ -38,7 +38,7 @@ }, "devDependencies": { "@types/lodash": "^4.14.195", - "@types/node": "^22.5.1", + "@types/node": "^22.5.2", "@types/nprogress": "^0.2.3", "@types/qs": "^6.9.15", "@vitejs/plugin-vue": "^5.1.3", @@ -48,10 +48,10 @@ "browserslist": "^4.23.0", "caniuse-lite": "^1.0.30001655", "eslint": "^9.9.1", - "eslint-plugin-vue": "^9.27.0", + "eslint-plugin-vue": "^9.28.0", "less": "^4.2.0", "less-loader": "^12.2.0", - "postcss": "^8.4.42", + "postcss": "^8.4.44", "prettier": "^3.3.3", "tailwindcss": "^3.4.10", "typescript": "^5.5.3", diff --git a/cdTMP/src/api/project/case.js b/cdTMP/src/api/project/case.js index 84fe69d..838b674 100644 --- a/cdTMP/src/api/project/case.js +++ b/cdTMP/src/api/project/case.js @@ -76,5 +76,17 @@ export default { method: "get", params }) + }, + /** + * 请求单个case信息 + * @params 传入case完整的key + * @params 项目id + */ + getCaseOne(params = {}) { + return request({ + url: "/project/getCaseOne", + method: "get", + params + }) } } diff --git a/cdTMP/src/components/ma-crud/components/contextMenu.vue b/cdTMP/src/components/ma-crud/components/contextMenu.vue index 4591035..07a5aff 100644 --- a/cdTMP/src/components/ma-crud/components/contextMenu.vue +++ b/cdTMP/src/components/ma-crud/components/contextMenu.vue @@ -100,11 +100,7 @@ const openContextMenu = async (ev, record) => { currentRow.value = record await nextTick(() => { const domHeight = document.querySelector(".ma-crud-contextmenu").offsetHeight - if (document.body.offsetHeight - ev.pageY < domHeight) { - top.value = ev.clientY - domHeight - } else { - top.value = ev.clientY - } + top.value = ev.clientY - domHeight left.value = ev.clientX }) } @@ -145,7 +141,7 @@ defineExpose({ background: var(--color-bg-2); border: 1px solid var(--color-border-2); padding: 7px 0; - border-radius: 1px; + border-radius: 4px; li .context-menu-item { cursor: pointer; padding: 5px 10px; diff --git a/cdTMP/src/components/ma-editor/index.vue b/cdTMP/src/components/ma-editor/index.vue index aa0464f..ff51ee2 100644 --- a/cdTMP/src/components/ma-editor/index.vue +++ b/cdTMP/src/components/ma-editor/index.vue @@ -36,6 +36,7 @@ import "tinymce/plugins/searchreplace" // 查找替换 import "tinymce/plugins/table" // 表格 // import "tinymce/plugins/visualblocks" //显示元素范围 import "tinymce/plugins/visualchars" // 显示不可见字符 +import "tinymce/plugins/autoresize" // 自动调整高度 import { storeToRefs } from "pinia" // import "tinymce/plugins/wordcount" // 字数统计 @@ -50,7 +51,7 @@ const props = defineProps({ }, plugins: { type: [String, Array], - default: "searchreplace visualchars code table nonbreaking lists autosave" + default: "searchreplace visualchars code table nonbreaking lists autosave autoresize" }, toolbar: { type: [String, Array], @@ -142,6 +143,11 @@ const initConfig = reactive({ toolbar: props.toolbar, skeletonScreen: true, branding: false, + // autoresize插件和resize配置 + resize: true, + min_height: 100, + max_height: 600, + autoresize_bottom_margin: 10, content_css: theme.value === "dark" ? "/tinymce/skins/content/dark/content.css" diff --git a/cdTMP/src/components/ma-form/formItem/form-userinfo.vue b/cdTMP/src/components/ma-form/formItem/form-userinfo.vue index 02c14e4..050103f 100644 --- a/cdTMP/src/components/ma-form/formItem/form-userinfo.vue +++ b/cdTMP/src/components/ma-form/formItem/form-userinfo.vue @@ -1,12 +1,3 @@ -