diff --git a/package.json b/package.json index 5ba8cef..0f761da 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "element-resize-detector": "^1.2.4", "font-awesome": "^4.7.0", "gm-crypto": "^0.1.12", + "gm-crypto-wasm": "^0.1.5", "html2canvas": "^1.4.1", "install": "^0.13.0", "js-beautify": "^1.14.8", diff --git a/src/api/DesignForm/type.ts b/src/api/DesignForm/type.ts index d1d3527..8609073 100644 --- a/src/api/DesignForm/type.ts +++ b/src/api/DesignForm/type.ts @@ -6,6 +6,9 @@ export interface SearchForm extends PageQuery{ } //自定义表单列表内容 export interface customerFormCont{ + signCodeStr: any; + isEdit: any; + describe: any; id: number, name: string, tablename: string, diff --git a/src/api/date/type.ts b/src/api/date/type.ts index 0ea87af..f641eab 100644 --- a/src/api/date/type.ts +++ b/src/api/date/type.ts @@ -95,7 +95,8 @@ export interface appSetInfo { appName:string; appSvg:string; state:number; - uuid:string; + uuid:string; + describe?:string; } /** @ 作者: 秦东 diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index d7201fa..90c9d78 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -4085,17 +4085,17 @@ getCustomerFormList().then(({ data }) => { }); const orgAndManTree = ref(); -getAssociatedFormsOrgAndManTree().then(({ data }) => { - let resData = ref(data.children); - orgAndManTree.value = [ - { - id: data.id, - //label: data.label, - label: "组织机构", - children: [...resData.value], - }, - ]; -}); +// getAssociatedFormsOrgAndManTree().then(({ data }) => { +// let resData = ref(data.children); +// orgAndManTree.value = [ +// { +// id: data.id, +// //label: data.label, +// label: "组织机构", +// children: [...resData.value], +// }, +// ]; +// }); const roleTree = ref(); getAssociatedFormsRoleTree().then(({ data }) => { diff --git a/src/utils/encryptionAndDecryption/sm4UtilsWasm.ts b/src/utils/encryptionAndDecryption/sm4UtilsWasm.ts new file mode 100644 index 0000000..95d6989 --- /dev/null +++ b/src/utils/encryptionAndDecryption/sm4UtilsWasm.ts @@ -0,0 +1,74 @@ +import { SM4 } from "gm-crypto-wasm"; +import * as CryptoJS from 'crypto-js' +/** +@ 作者: 秦东 +@ 时间: 2025-12-07 10:26:51 +@ 备注: 将字符串转换成16进制 +*/ +const strToHexMethod = (str: string): string => { + return CryptoJS.enc.Utf8.parse(str).toString(CryptoJS.enc.Hex) +} +/** +@ 作者: 秦东 +@ 时间: 2025-12-07 10:29:48 +@ 备注: 判断是不是12位16进制参数 +*/ +const isValidHex32 = (str: string): boolean => { + return /^[0-9a-fA-F]{32}$/.test(str) +} +/** +@ 作者: 秦东 +@ 时间: 2025-12-07 10:28:33 +@ 备注: 初始化SM4密钥参数 +*/ +const appSystemKey = strToHexMethod(import.meta.env.VITE_APP_SYSTEM_KEY) +const sm4TokenKey = strToHexMethod(import.meta.env.VITE_APP_SM4_APP_KEY) + +/** +@ 作者: 秦东 +@ 时间: 2026-02-11 08:17:36 +@ 功能: SM4加密方法 +*/ +const sm4EncryptMethod = (data: string, customKey: string): string => { + let ivSetup = sm4TokenKey + if (customKey) { + ivSetup = strToHexMethod(customKey) + if (!isValidHex32(ivSetup)) { + ivSetup = sm4TokenKey + } + } + return SM4.encrypt(data, appSystemKey, { + iv: ivSetup, + mode: SM4.constants.CBC, + inputEncoding: 'utf8', + outputEncoding: 'hex', + padding: 1 + } as never) +} +/** +@ 作者: 秦东 +@ 时间: 2025-12-07 10:31:22 +@ 备注: SM4解密方法 +*/ +const sm4DecryptMethod = (data: string, customKey: string): string => { + let ivSetup = sm4TokenKey + if (customKey) { + ivSetup = strToHexMethod(customKey) + if (!isValidHex32(ivSetup)) { + ivSetup = sm4TokenKey + } + } + // console.log('SM4解密方法----解密结构---data--->', data) + // console.log('SM4解密方法----解密结构----customKey-->', customKey) + // console.log('SM4解密方法----解密结构--ivSetup---->', ivSetup) + // console.log('SM4解密方法----解密结构---sm4TokenKey--->', sm4TokenKey) + // console.log('SM4解密方法----解密结构---appSystemKey--->', appSystemKey) + return SM4.decrypt(data, appSystemKey, { + iv: ivSetup, + mode: SM4.constants.CBC, + inputEncoding: 'hex', + outputEncoding: 'utf8', + padding: 1 + } as never) +} +export { sm4EncryptMethod, sm4DecryptMethod } diff --git a/src/utils/request.ts b/src/utils/request.ts index ae4496c..485f690 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -6,7 +6,7 @@ import axios, { AxiosError, type InternalAxiosRequestConfig } from 'axios' import { ElMessage, ElMessageBox } from 'element-plus' import { generateRandomString } from '@/utils/encryptionAndDecryption/randNumber' -import { sm4DecryptMethod, sm4EncryptMethod } from '@/utils/encryptionAndDecryption/sm4Utils' +import { sm4DecryptMethod, sm4EncryptMethod } from '@/utils/encryptionAndDecryption/sm4UtilsWasm' import { useUserStoreHook } from '@/store/modules/user'; import { useRouter } from 'vue-router' diff --git a/src/views/sysworkflow/lowcodepage/newLowCode/appLayout/appContainer.vue b/src/views/sysworkflow/lowcodepage/newLowCode/appLayout/appContainer.vue index f7803e8..91ba5b1 100644 --- a/src/views/sysworkflow/lowcodepage/newLowCode/appLayout/appContainer.vue +++ b/src/views/sysworkflow/lowcodepage/newLowCode/appLayout/appContainer.vue @@ -10,6 +10,9 @@ import { gainAppEditPsge } from "@/api/DesignForm/requestapi"; import RegularPage from "@/views/sysworkflow/lowcodepage/runApp/regularPage.vue"; import RunAppForm from "@/views/sysworkflow/lowcodepage/runApp/runAppForm.vue"; +// import NewRunAppForm from "@/views/sysworkflow/lowcodepage/runApp/newRunAppForm.vue"; + +import { AllowDropType } from "element-plus/es/components/tree/src/tree.type"; const props = defineProps({ drawerWith: { @@ -36,9 +39,10 @@ const props = defineProps({ const emits = defineEmits(["update:runIsOpen", "refreshPage"]); const userStore = useUserStore(); const menusTree = ref([]); //菜单树 -const pickAppMenu = ref(""); //选中的菜单 +const pickAppMenu = ref(""); //选中的菜单 const switchPAge = ref(1); //页面类型 1:执行页面,2:表单页面 const pickAppMenuSel = ref(""); //下拉框选中的值 + /** @ 作者: 秦东 @ 时间: 2024-07-22 11:40:06 @@ -72,7 +76,7 @@ const gainAppContent = () => { appCont.state = data.data.state; appCont.uuid = data.data.uuid; let isIn = true; - data.data.menuTree.forEach((item) => { + data.data.menuTree.forEach((item:any) => { if (item.isLock == 1 && item.isMain == 1) { pickAppMenu.value = item; isIn = false; @@ -121,10 +125,20 @@ const openAppPage = (val: any) => { pickAppMenu.value = val; } }; +const openOrClose = computed(() => props.runIsOpen); +const allowDrop = (draggingNode: any, dropNode: any, type: AllowDropType) => { + + if (draggingNode.data.type === 2 && dropNode.data.type === 2 && type == "inner") { + return false; + } else { + return true; + } + // return true +};