diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index 5a23638..aff9bc8 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -409,7 +409,11 @@ export default [ config: {}, styles: { divStyle: { - marginBot: "15" + marginBot: "15", + paddingTop: "10", + paddingBot: "10", + paddingRight: "10", + paddingLeft: "10" }, labelStyle: { //paddingLeft: "7", diff --git a/src/components/DesignForm/public/expand/rangedUserTree.vue b/src/components/DesignForm/public/expand/rangedUserTree.vue index a8e88ed..491963f 100644 --- a/src/components/DesignForm/public/expand/rangedUserTree.vue +++ b/src/components/DesignForm/public/expand/rangedUserTree.vue @@ -20,12 +20,12 @@ const emits = defineEmits<{ (e: 'update:modelValue', value: string): void }>() -const value = ref([]) -const treeData = ref([]) // 存储懒加载的数据 +const value = ref([]) +const treeData = ref([]) // 存储懒加载的数据 const isDataLoaded = ref(false) // 标记数据是否已加载 const loading = ref(false) // 是否正在加载 const treeSelectRef = ref() // 树选择器引用 -// const { location, updateLocation } = inject('location') +const { updateLocation } = inject('location') // 上一次选择的值,用于比较 const lastSelectedValue = ref(null) @@ -34,7 +34,7 @@ const lastSelectedValue = ref(null) const isMounted = ref(false) // 处理值变化 -const handleValueChange = (newValue) => { +const handleValueChange = (newValue: any[]) => { if (!multiSelect.value) { // 单选模式 if (newValue.length === 0) { @@ -48,7 +48,7 @@ const handleValueChange = (newValue) => { lastSelectedValue.value = currentValue; } else { // 当有多个选择时,找出新增的那个 - const newSelections = newValue.filter(item => item !== lastSelectedValue.value); + const newSelections = newValue.filter((item: null) => item !== lastSelectedValue.value); if (newSelections.length > 0) { // 只保留最新选择的那个 const latestSelection = newSelections[newSelections.length - 1]; @@ -195,7 +195,7 @@ const loadFullData = async () => { const result = await checkorgAndManTree1(); // 修复:先清洗非法children,再处理禁用状态 - const cleanedData = sanitizeTreeData(result); + const cleanedData = sanitizeTreeData(result as any[]); const processedData = !multiSelect.value ? processTreeData(cleanedData) : cleanedData; // 修复:仅在组件挂载时更新数据 @@ -240,7 +240,7 @@ function checkorgAndManTree1() { resolve([]); return; } - let result = [] + let result: unknown = [] let i = 0 props.orgAndManTree.forEach((element: any) => { if (element.hasOwnProperty('tree') && hasNodesInTree(element.tree)) { @@ -266,12 +266,12 @@ function checkorgAndManTree1() { /** * 判断树形结构是否存在节点 */ -function hasNodesInTree(tree) { +function hasNodesInTree(tree: any) { if (!Array.isArray(tree)) { return false; } - function checkNode(node) { + function checkNode(node: null) { if (node == null) { return false; } @@ -313,9 +313,8 @@ function hasNodesInTree(tree) { > diff --git a/src/components/DesignForm/public/form/form.vue b/src/components/DesignForm/public/form/form.vue index 7347626..dfc8cf5 100644 --- a/src/components/DesignForm/public/form/form.vue +++ b/src/components/DesignForm/public/form/form.vue @@ -67,7 +67,7 @@ const props = withDefaults( { type: 1, // 1新增;2修改;3查看(表单模式) ;4查看; 5设计 numrun: 2, - formData: () => { + formDataEs: () => { return { list: [], form: {}, @@ -575,7 +575,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) // console.log("表单组件值改变事件----------6--------->", attribute); // console.log("表单组件值改变事件----------11--------->", model.value); - let fieldVal = {}; + const fieldVal: any = {}; for (let i in model.value) { if (i == key) { fieldVal[i] = typeof value == "number" ? value.toString() : value; @@ -682,7 +682,7 @@ let mustBeHidden: any = []; let newModelKeyArr: string[] = []; // 判断对象是否是“内容为空的纯对象” -function isEmptyPlainObject(obj) { +function isEmptyPlainObject(obj: {}) { // 先确认是对象类型,再检查属性数量为0 return Object.prototype.toString.call(obj) === '[object Object]' && Object.keys(obj).length === 0; @@ -927,7 +927,7 @@ function showOrHide(data: any,currentDataNameValue?:any) { const radioSelectArr2: any[] = []; - const radioSelectZdtcszConfigArr = []; + const radioSelectZdtcszConfigArr: any[] = []; //20240815 关联选项设置的隐藏效果嵌套在内时不生效的问题修复 liwenxuan start //console.log(props.formData.list) newModelKeyArr @@ -1362,7 +1362,7 @@ console.log("设置了标题行和索引列====2===>",model.value) * @param {string} str - 待处理的原始字符串 * @returns {string} 最后一个冒号后的子串;无冒号/冒号在末尾时返回空字符串 */ -function getLastColonAfterString(str) { +function getLastColonAfterString(str: string | string[]) { // 1. 输入校验:确保输入是字符串类型(处理非字符串入参) if (typeof str !== 'string') { //console.warn('输入必须为字符串类型'); @@ -1395,7 +1395,7 @@ function getLastColonAfterString(str) { * @param {String|Number} columnValue - 列标识 * @returns {String|undefined} - 返回对应的单元格值,如果未找到则返回undefined */ -function getTableCellValueV3(tableData, rowValue, columnValue) { +function getTableCellValueV3(tableData: { [x: string]: any; default: { [x: string]: any; }; }, rowValue: null, columnValue: null) { try { // 检查输入参数 if (!tableData || typeof tableData !== 'object' || Array.isArray(tableData)) { @@ -1475,7 +1475,7 @@ function getTableCellValueV3(tableData, rowValue, columnValue) { * 增强版:自动检测tableData结构并获取值 * 支持动态结构检测 */ -function getTableCellValueEnhanced(tableData, rowValue, columnValue) { +function getTableCellValueEnhanced(tableData: { [x: string]: any; default?: { [x: string]: any; } | { [x: string]: any; } | { [x: string]: any; }; }, rowValue: string | null, columnValue: string | null) { try { if (!tableData || typeof tableData !== 'object') { return undefined; @@ -1530,7 +1530,7 @@ function getTableCellValueEnhanced(tableData, rowValue, columnValue) { * 检测tableData的结构 * @returns {string} - 结构类型:'standard', 'singleRow', 'singleColumn', 'mixed', 'unknown' */ -function detectTableStructure(tableData) { +function detectTableStructure(tableData: { [x: string]: any; default: { [x: string]: any; }; }) { if (!tableData || typeof tableData !== 'object') { return 'unknown'; } @@ -1613,14 +1613,14 @@ function detectTableStructure(tableData) { /** * 从仅一行结构中获取值 */ -function getFromSingleRowStructure(tableData, columnStr) { +function getFromSingleRowStructure(tableData: { default: { [x: string]: any; }; }, columnStr: string) { return tableData.default?.[columnStr]; } /** * 从仅一列结构中获取值 */ -function getFromSingleColumnStructure(tableData, columnStr) { +function getFromSingleColumnStructure(tableData: { [x: string]: any; }, columnStr: string) { const colData = tableData[columnStr]; if (colData && typeof colData === 'object') { // 优先返回default值,如果没有则返回第一个值 @@ -1632,7 +1632,7 @@ function getFromSingleColumnStructure(tableData, columnStr) { /** * 从混合结构中获取值 */ -function getFromMixedStructure(tableData, rowStr, columnStr) { +function getFromMixedStructure(tableData: { [x: string]: any; default: { [x: string]: any; }; }, rowStr: string, columnStr: string) { // 尝试多种方式 // 1. 尝试标准方式 @@ -1675,7 +1675,7 @@ function getFromMixedStructure(tableData, rowStr, columnStr) { /** * 统一方法,推荐使用这个 */ -function getTableCellValue(tableData, rowValue, columnValue) { +function getTableCellValue(tableData: any, rowValue: string, columnValue: string) { return getTableCellValueEnhanced(tableData, rowValue, columnValue); } @@ -2375,7 +2375,7 @@ function getAfterLastColon(str:string) { -function modifyTreeData(treeData, idList) { +function modifyTreeData(treeData: any, idList: any) { //console.log("modifyTreeDataMinimal 执行了"); let gkFlag = true const idArray = Array.isArray(idList) ? idList : [idList]; @@ -2460,7 +2460,7 @@ function modifyTreeData(treeData, idList) { } // 辅助函数:查找特定条件的节点 -function findTargetNode(treeData) { +function findTargetNode(treeData: any) { if (!treeData) return null; const stack = Array.isArray(treeData) ? [...treeData] : [treeData]; @@ -2483,11 +2483,13 @@ function findTargetNode(treeData) { } // 辅助函数:递归构建节点树 -function buildNodeTree(node, keepIds, idArray, processedIds) { +function buildNodeTree(node: { id: any; label: any; value: any; children: string | any[]; }, keepIds: Set, idArray: string | any[], processedIds: Set) { const newNode = { id: node.id, label: node.label, - value: node.value + value: node.value, + number: node.label, + children: node.children, }; // 修改目标节点的标签 @@ -2516,7 +2518,7 @@ function buildNodeTree(node, keepIds, idArray, processedIds) { } // 当 idList 为空时处理树数据,使用与不为空时相同的格式化逻辑 -function processTreeWithAllNodes(treeData) { +function processTreeWithAllNodes(treeData: any) { if (!treeData) { return Array.isArray(treeData) ? [] : null; } @@ -2548,7 +2550,7 @@ function processTreeWithAllNodes(treeData) { } // 递归格式化所有节点,保持与非空时相同的格式,并过滤没有用户的组织节点 -function formatAllNodes(node, processedIds) { +function formatAllNodes(node: { id: string | any[]; children: string | any[]; label: any; value: null | undefined; }, processedIds: Set) { // 判断是否为组织节点(ID长度小于5) const isOrganization = node.id && node.id.length < 5; @@ -2577,7 +2579,9 @@ function formatAllNodes(node, processedIds) { const newNode = { id: node.id, label: node.label, - value: node.value + value: node.value, + number: node.label, + children: node.children, }; // 对所有节点应用相同的标签格式化 @@ -2594,12 +2598,12 @@ function formatAllNodes(node, processedIds) { return newNode; } -function groupExpandUserConfigs(configs) { +function groupExpandUserConfigs(configs: { control: { queryBy: string; orgRange: any; roleRange: any; }; name: any; }[]) { // 用于存储分组结果的Map // key是排序后的范围数组字符串,value是包含names和原始keys的对象 const groupMap = new Map(); - configs.forEach(config => { + configs.forEach((config: { control: { queryBy: string; orgRange: any; roleRange: any; }; name: any; }) => { // 根据queryBy确定使用哪个范围数组 let range, rangeType; if (config.control.queryBy === 'org') { diff --git a/src/components/DesignForm/public/form/formGroup.vue b/src/components/DesignForm/public/form/formGroup.vue index a65e286..c8ede43 100644 --- a/src/components/DesignForm/public/form/formGroup.vue +++ b/src/components/DesignForm/public/form/formGroup.vue @@ -357,7 +357,7 @@ const linksIf = (obj: FormList) => { //按钮点击事件 const injectBtnEvent: any = inject(constFormBtnEvent); const clickBtn = (control: any) => { - console.log(type.value,"------->",control) + console.log("按钮点击事件----->",type.value,"------->",control) // 0: '提交表单', // 1: '重置表单', // 2: '取消返回', @@ -900,7 +900,7 @@ const judgaButClass = (btnClass:string):string => { @@ -989,7 +989,7 @@ const judgaButClass = (btnClass:string):string => { + ([]) let emits = defineEmits(['update:visible', 'change']) let list = computed(() => { if(props.formtype == 1){ @@ -41,7 +42,15 @@ let list = computed(() => { isActive: (item:any) => $func.toggleClass(checkedFormList.value, item, 'id'), change: (item:any) => { - checkedFormList.value = [item] + console.log("------>",item) + if(checkedFormList.value.length == 0){ + checkedFormList.value.push(item) + }else{ + if(checkedFormList.value.some((a:any) => a.id != item.id)){ + checkedFormList.value.push(item) + } + } + // checkedFormList.value = [item] } }] }else{ diff --git a/src/utils/request.ts b/src/utils/request.ts index a533583..e36273f 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -58,11 +58,11 @@ service.interceptors.request.use( data: sm4EncryptMethod(JSON.stringify(data), randomString) } } - console.log('请求拦截---------->', randomString) - console.log('请求拦截----headers------>', headers) - console.log('请求拦截----config---url--->', config.url) - console.log('请求拦截----data------>', data) - console.log('请求拦截----config------>', config) + // console.log('请求拦截---------->', randomString) + // console.log('请求拦截----headers------>', headers) + // console.log('请求拦截----config---url--->', config.url) + // console.log('请求拦截----data------>', data) + // console.log('请求拦截----config------>', config) // console.log('请求拦截----content-type------>', config.headers['Content-Type']) // console.log('请求拦截----config------>', config.headers) @@ -88,7 +88,7 @@ service.interceptors.response.use( let jsonData = sm4DecryptMethod(data.data, authKey) response.data.data = JSON.parse(jsonData) } - console.log('行营结果----解密结构------>', response.data) + // console.log('行营结果----解密结构------>', response.data) const { code, msg } = response.data; if (code === 0 || code === 200 || code === 10001) { return response.data; diff --git a/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue b/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue index 061eb50..88eda17 100644 --- a/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue +++ b/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue @@ -409,16 +409,20 @@ const afterSubmit = (type: string, val?: any) => { }; startRunFlow(sendInfo).then((data: any) => { console.log("流程提交成功--------1---------->",data) - emits("searchquery"); + // emits("searchquery"); + closeAppSubmit() }); }else{ - emits("searchquery"); + // emits("searchquery"); + closeAppSubmit() } }else{ - emits("searchquery"); + // emits("searchquery"); + closeAppSubmit() } }else{ - emits("searchquery"); + // emits("searchquery"); + closeAppSubmit() } } closeAppSubmit(); @@ -430,7 +434,7 @@ const afterSubmit = (type: string, val?: any) => { */ const saveDraftPage = (type: string, val?: any) => { if (type === "success") { - emits("searchquery"); + // emits("searchquery"); if (isFlowTable.value) { if (val.code == 0) { let sendInfo = { @@ -807,7 +811,7 @@ provide('currentNodeKey', nodeKey) ref="aiassistRef" :agent="currentAgent" /> - +