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',