文档片段全面改进,不使用render

This commit is contained in:
2025-04-20 17:50:07 +08:00
parent e43f9230eb
commit 68c93f5d83
48 changed files with 1330 additions and 732 deletions

View File

@@ -0,0 +1,32 @@
import { isEqual } from "lodash-es"
import { getCurrentInstance } from "vue"
/**
* 该hook为测试项子项和测试用例步骤设计当其改变时候弹窗通知用户
*/
export default function useBeforeCancel(formData: any, beforeFormContent: any, visible: any) {
const app = getCurrentInstance()!.appContext.config.globalProperties
const handleBeforeCancel = () => {
if (!beforeFormContent.value) {
return true
}
const content = formData.value.testContent || formData.value.testStep
const iuEqualValue = isEqual(content, beforeFormContent.value)
!iuEqualValue &&
app.$modal.confirm({
title: "测试项步骤内容你已改动,是否保留您编写的测试项/测试用例步骤数据?",
content: "",
okText: "返回重新编辑",
cancelText: "取消",
simple: true,
onOk: () => {
visible.value = true
},
onCancel: () => {}
})
return true
}
return {
handleBeforeCancel
}
}