From 7d984cec03670a2883697e64848eb24796f147fd Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Sun, 19 Feb 2023 20:48:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E6=A1=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023273 --user=宋昌昌 【测试跟踪】功能用例列表-操作删除和批量删除/编辑用例-更错操作-删除-提示信息不符 https://www.tapd.cn/55049933/s/1337901 --- .../click-outside/custom-click-outside.js | 19 +++++++++++++++++ .../frontend/src/directive/index.js | 21 ++----------------- .../case/components/BaseEditItemComponent.vue | 2 +- .../business/case/components/TestCaseEdit.vue | 2 +- 4 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 framework/sdk-parent/frontend/src/directive/click-outside/custom-click-outside.js diff --git a/framework/sdk-parent/frontend/src/directive/click-outside/custom-click-outside.js b/framework/sdk-parent/frontend/src/directive/click-outside/custom-click-outside.js new file mode 100644 index 0000000000..f1339ec944 --- /dev/null +++ b/framework/sdk-parent/frontend/src/directive/click-outside/custom-click-outside.js @@ -0,0 +1,19 @@ +export default { + bind(el, binding, vnode) { + function clickHandler(e) { + if (el.contains(e.target)) { + return false; + } + if (binding.expression) { + binding.value(e); + } + } + el.__vueClickOutside__ = clickHandler; + document.addEventListener('click', clickHandler); + }, + update() {}, + unbind(el, binding) { + document.removeEventListener('click', el.__vueClickOutside__); + delete el.__vueClickOutside__; + } +}; diff --git a/framework/sdk-parent/frontend/src/directive/index.js b/framework/sdk-parent/frontend/src/directive/index.js index 2b31678d4b..865b91a183 100644 --- a/framework/sdk-parent/frontend/src/directive/index.js +++ b/framework/sdk-parent/frontend/src/directive/index.js @@ -1,4 +1,5 @@ import ClickOutside from "element-ui/src/utils/clickoutside"; +import CustomClickOutside from "./click-outside/custom-click-outside"; import Permission from "./permission"; import Drag from "./drag"; import directive from './loading/directive'; @@ -48,25 +49,7 @@ export default { Vue.directive('bottom-to-top-drag', Drag.bottom2TopDrag); Vue.directive('top-bottom-to-drag', Drag.top2BottomDrag); Vue.directive('vertical-drag', Drag.verticalDrag); - Vue.directive('my-click-outside', { - bind(el, binding, vnode) { - function clickHandler(e) { - if (el.contains(e.target)) { - return false; - } - if (binding.expression) { - binding.value(e); - } - } - el.__vueClickOutside__ = clickHandler; - document.addEventListener('click', clickHandler); - }, - update() {}, - unbind(el, binding) { - document.removeEventListener('click', el.__vueClickOutside__); - delete el.__vueClickOutside__; - }, - }); + Vue.directive('custom-click-outside', CustomClickOutside); Vue.use(directive); Vue.prototype.$loading = service; }, diff --git a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue index fff02113f7..49d753e18b 100644 --- a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue +++ b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue @@ -2,7 +2,7 @@
diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index a163b597bc..bfbe2bf927 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -1517,7 +1517,7 @@ export default { this.$refs.apiDeleteConfirm.open(this.testCase, this.$t('test_track.case.delete_confirm')); } else { let title = this.$t('test_track.case.case_delete_confirm') + ": " + this.testCase.name + "?"; - this.$confirm(this.$t('test_track.case.batch_delete_tip'), title, { + this.$confirm(this.$t('test_track.case.batch_delete_soft_tip'), title, { cancelButtonText: this.$t("commons.cancel"), confirmButtonText: this.$t("commons.delete"), customClass: 'custom-confirm-delete',