From c3f3967aeb52ddf4bda63c3e704ebfb65ff44b14 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Sat, 2 Aug 2025 16:41:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BF=91=E6=9C=9F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 343 +++++++++--------- .../DesignForm/tableListPage/formPageCont.vue | 108 +++--- .../DesignForm/tableListPage/index.vue | 90 ++--- src/permission.ts | 1 + src/store/modules/permission.ts | 3 +- .../appPage/appPageForm/pageList.vue | 2 +- .../sysworkflow/lowcodepage/pageList.vue | 2 +- .../lowcodepage/runApp/runAppForm.vue | 4 +- 8 files changed, 279 insertions(+), 274 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index bcd66a3..60c45d7 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -54,7 +54,7 @@ import CalendarPage from "@/components/DesignForm/app/calendar/calendar1/calenda import SearchSelect from "@/components/DesignForm/app/calendar/selectSearch.vue"; import AKSelect from "@/components/DesignForm/public/form/select.vue"; import ContainerPath from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/container.vue"; -import exportPanel from '../exportPanel.vue'; +import exportPanel from "../exportPanel.vue"; import importPanel from "../importPanel.vue"; const props = withDefaults( @@ -155,7 +155,7 @@ const currentAsfTableDataList = ref([]); //当前点击的关联表单数据 const openTaskDrawer = ref(false); //新增数据 //导出窗口的父元素 -const dynamicVNode = ref(null) //组件的父组件 +const dynamicVNode = ref(null); //组件的父组件 const state = reactive({ loading: false, @@ -551,10 +551,10 @@ const setUpClick = (val: string, id: string) => { if (val.key == "newAdd") { drawerWith.value = container.value?.clientWidth; openTaskDrawer.value = true; - }else if (val.key === "export"){ - doExportTableData() - }else if (val.key === "import"){ - doImportTableData() + } else if (val.key === "export") { + doExportTableData(); + } else if (val.key === "import") { + doImportTableData(); } else if (val.key == "showQrCode") { //liwenxuan 20250114 二维码打印弹窗 start //在此组装参数,以生成二维码图片 @@ -869,19 +869,19 @@ const columnsFilter = computed(() => { console.log("获取表格头内容", props.data.columns); }); -const subTableFieldsFilter=computed(()=>{ - const arr:{table:string,field:string,label:string}[]=[] - const names:string[]=[] - props.fieldsDetailList.forEach((item:any) => { - if(item.type==="table"){ - names.push(item.name) +const subTableFieldsFilter = computed(() => { + const arr: { table: string; field: string; label: string }[] = []; + const names: string[] = []; + props.fieldsDetailList.forEach((item: any) => { + if (item.type === "table") { + names.push(item.name); item.list.forEach((sub: any) => { - arr.push({table:item.name, field: sub.name, label: sub.item.label}) - }) + arr.push({ table: item.name, field: sub.name, label: sub.item.label }); + }); } - }) - return {tables:names,fields:arr} -}) + }); + return { tables: names, fields: arr }; +}); /** @ 作者: 秦东 @@ -981,42 +981,46 @@ const getPageData = () => { default: state.loading = true; //by han2015, 抽成独立部分,方便其他功能调用 - doGainFormPageListCont(sendData).then(datas=>{ - tableDataList.value = datas.list - state.total=datas.total - }).finally(()=>{ - //原 finally的处理内容 - state.loading = false; - asfs = []; - radios = []; - checkboxs = []; - switchs = []; - selects = []; - tables = []; - dofs = []; - getAsfs(); - }) + doGainFormPageListCont(sendData) + .then((datas) => { + tableDataList.value = datas.list; + state.total = datas.total; + }) + .finally(() => { + //原 finally的处理内容 + state.loading = false; + asfs = []; + radios = []; + checkboxs = []; + switchs = []; + selects = []; + tables = []; + dofs = []; + getAsfs(); + }); } }; //表单导入 -function doImportTableData(){ - dynamicVNode.value=h(importPanel,{ - fields:props.fieldsDetailList.filter(val=>val.type!=="table"), - formId:props.versionid, - commitFunc:()=>{ - getPageData() //刷新table页面 - dynamicVNode.value=null +function doImportTableData() { + dynamicVNode.value = h(importPanel, { + fields: props.fieldsDetailList.filter((val) => val.type !== "table"), + formId: props.versionid, + commitFunc: () => { + getPageData(); //刷新table页面 + dynamicVNode.value = null; }, - closeFunc:()=>dynamicVNode.value=null - }) - + closeFunc: () => (dynamicVNode.value = null), + }); } //表格导出 -function doExportTableData(){ +function doExportTableData() { //fields表示主表单的导出字段,subs表示主表单包含的子表格的导出字段 - function exportFunc(fields:{field:string,label:string}[],subs:{table:string,field:string,label:string}[]){ + function exportFunc( + fields: { field: string; label: string }[], + subs: { table: string; field: string; label: string }[] + ) { let sendData = { formId: props.formId, page: 1, @@ -1024,79 +1028,87 @@ function doExportTableData(){ searchData: json2string(props.searchData), }; //全量获取页面的数据 - doGainFormPageListCont(sendData).then(datas=>{ - const array: string[] = []; - //写入表头行 - const title:string[] = []; - for (let val of fields){ - title.push(val.label) - } - for (let val of subs){ - title.push(val.label) - } - array.push(title.join(",")) - - //写入数据行 - datas.list.forEach((item)=>{ - const line=[]; - let maxline=0; - //写主表列 - for (let val of fields){ - if(typeof(val)==="string") line.push((item[val.field] as string).replaceAll(",",",")) - else line.push(item[val.field]) + doGainFormPageListCont(sendData) + .then((datas) => { + const array: string[] = []; + //写入表头行 + const title: string[] = []; + for (let val of fields) { + title.push(val.label); } - - //写子表列 - if (subs.length>0){ - //计算所有子列表的最大行数 - for (let tab of subTableFieldsFilter.value.tables){ - if(item[tab] && item[tab].length>maxline) maxline=item[tab].length - } - //全都是空的 - if(maxline===0){ - array.push(line.join(",")+","+Array(subs.length).fill("")) - return + for (let val of subs) { + title.push(val.label); + } + array.push(title.join(",")); + + //写入数据行 + datas.list.forEach((item) => { + const line = []; + let maxline = 0; + //写主表列 + for (let val of fields) { + if (typeof val === "string") + line.push((item[val.field] as string).replaceAll(",", ",")); + else line.push(item[val.field]); } - //除第一行数据包含子表数据外,其他行都省略主表字段数据,用spaceprefix填充,避免重复 - const spacePrefix=Array(line.length).fill("") - - for(let i=0;i { - if(item[name] && item[name].length-1>=i){ - //添加实际数据 - subs.filter(v=>v.table===name).forEach(f=>{ - row.push(item[name][i][f.field]) - }) - }else{ - //添加字段长度的N个空列 - row.push(...(Array(subs.filter(v=>v.table===name).length).fill(""))) - } - }) - - //写入总csv数组 - if(i===0){ - array.push(line.join(",")+","+row.join(",")) - }else{ - array.push(spacePrefix+","+row.join(",")) + //写子表列 + if (subs.length > 0) { + //计算所有子列表的最大行数 + for (let tab of subTableFieldsFilter.value.tables) { + if (item[tab] && item[tab].length > maxline) maxline = item[tab].length; + } + //全都是空的 + if (maxline === 0) { + array.push(line.join(",") + "," + Array(subs.length).fill("")); + return; + } + + //除第一行数据包含子表数据外,其他行都省略主表字段数据,用spaceprefix填充,避免重复 + const spacePrefix = Array(line.length).fill(""); + + for (let i = 0; i < maxline; i++) { + const row: any[] = []; + subTableFieldsFilter.value.tables.forEach((name) => { + if (item[name] && item[name].length - 1 >= i) { + //添加实际数据 + subs + .filter((v) => v.table === name) + .forEach((f) => { + row.push(item[name][i][f.field]); + }); + } else { + //添加字段长度的N个空列 + row.push( + ...Array(subs.filter((v) => v.table === name).length).fill("") + ); + } + }); + + //写入总csv数组 + if (i === 0) { + array.push(line.join(",") + "," + row.join(",")); + } else { + array.push(spacePrefix + "," + row.join(",")); + } } + + return; } + //没有子表 + array.push(line.join(",")); + }); - return - } - //没有子表 - array.push(line.join(",")) - }) + //去掉标题行的统计 + if (array.length - 1 !== datas.total) + alert(`导出记录数:${datas.total}, 共计:${array.length - 1} 行`); - //去掉标题行的统计 - if((array.length-1)!==datas.total) alert(`导出记录数:${datas.total}, 共计:${array.length-1} 行`) - - const filename= props.pickAppMenu.label+".csv" - const csvString = array.join('\n'); - const blob = new Blob([csvString], { type: "text/csv;charset=utf-8;" }); - const link = document.createElement("a"); - if (link.download !== undefined) { // feature detection + const filename = props.pickAppMenu.label + ".csv"; + const csvString = array.join("\n"); + const blob = new Blob([csvString], { type: "text/csv;charset=utf-8;" }); + const link = document.createElement("a"); + if (link.download !== undefined) { + // feature detection // Browsers that support HTML5 download attribute const url = URL.createObjectURL(blob); link.setAttribute("href", url); @@ -1105,21 +1117,22 @@ function doExportTableData(){ document.body.appendChild(link); link.click(); document.body.removeChild(link); - } - }).finally(()=>dynamicVNode.value=null) + } + }) + .finally(() => (dynamicVNode.value = null)); } - dynamicVNode.value=h(exportPanel,{ - fields:columnsFilter.value.filter((item)=>item.pattern!=="table"), - subtabs:columnsFilter.value.filter((item)=>item.pattern==="table"), - subFields:subTableFieldsFilter.value.fields, - commitFunc:exportFunc, - closeFunc:()=>dynamicVNode.value=null - }) + dynamicVNode.value = h(exportPanel, { + fields: columnsFilter.value.filter((item) => item.pattern !== "table"), + subtabs: columnsFilter.value.filter((item) => item.pattern === "table"), + subFields: subTableFieldsFilter.value.fields, + commitFunc: exportFunc, + closeFunc: () => (dynamicVNode.value = null), + }); } -async function doGainFormPageListCont(sendData:any){ - const data =await gainFormPageListCont(sendData) +async function doGainFormPageListCont(sendData: any) { + const data = await gainFormPageListCont(sendData); // console.log("获取列表详细信息----------------->",data) //console.log(dataList) asfDetails = props.data.columns.filter((item: any) => { @@ -1179,68 +1192,68 @@ async function doGainFormPageListCont(sendData:any){ } return dataList.data; }); - } - + } + return data.data; - } + } //console.log(data.data.list) - transferDetails.forEach(element => { + transferDetails.forEach((element) => { //console.log(element) data.data.list.forEach((obj: any) => { //console.log(obj) for (const key in obj) { // 确保只处理对象自身的属性(不包括原型链上的) if (Object.prototype.hasOwnProperty.call(obj, key)) { - const value = obj[key]; - - // 特殊处理数组/嵌套对象(使用JSON格式化) - const formattedValue = - (Array.isArray(value) || (typeof value === 'object' && value !== null)) - ? JSON.stringify(value, null, 2) - : value; - - //console.log(`${key}: ${formattedValue}`); - if(key==element.field){ - //console.log(key) - /* console.log(element.control.fixedOptions) + const value = obj[key]; + + // 特殊处理数组/嵌套对象(使用JSON格式化) + const formattedValue = + Array.isArray(value) || (typeof value === "object" && value !== null) + ? JSON.stringify(value, null, 2) + : value; + + //console.log(`${key}: ${formattedValue}`); + if (key == element.field) { + //console.log(key) + /* console.log(element.control.fixedOptions) console.log(obj[key]) */ - obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key]) - } + obj[key] = mapIdsToLabels(element.control.fixedOptions, obj[key]); + } } - } + } }); }); - + return data.data; - + //tableDataList.value = data.data.list //liwenxuan 关联表单数据获取 end } interface TreeNode { - id: string; - label: string; - disabled: boolean; - children: TreeNode[]; + id: string; + label: string; + disabled: boolean; + children: TreeNode[]; } function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { - const ids: string[] = JSON.parse(ids1); - // 创建id到label的映射字典 - const idToLabelMap: Record = {}; - - // 递归遍历树节点并填充映射字典 - function traverse(node: TreeNode) { - idToLabelMap[node.id] = node.label; // 存储当前节点的映射 - node.children.forEach(child => traverse(child)); // 递归处理子节点 - } + const ids: string[] = JSON.parse(ids1); + // 创建id到label的映射字典 + const idToLabelMap: Record = {}; + + // 递归遍历树节点并填充映射字典 + function traverse(node: TreeNode) { + idToLabelMap[node.id] = node.label; // 存储当前节点的映射 + node.children.forEach((child) => traverse(child)); // 递归处理子节点 + } - // 遍历根节点列表 - treeNodes.forEach(root => traverse(root)); - //console.log(ids) - // 将id数组转换为label数组 - return ids.map(id => idToLabelMap[id] || "已删除的节点(id):"+id); + // 遍历根节点列表 + treeNodes.forEach((root) => traverse(root)); + //console.log(ids) + // 将id数组转换为label数组 + return ids.map((id) => idToLabelMap[id] || "已删除的节点(id):" + id); } const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { @@ -1764,9 +1777,9 @@ const readerColumnSun = (column: any) => { let countLenght = 3; column.children.forEach((item: any) => { if (item.label.length < 3) { - countLenght = countLenght + 90; + countLenght = countLenght + 15; } else { - countLenght = countLenght + item.label.length * 40; + countLenght = countLenght + item.label.length * 15; } }); console.log("表头label长度-->", countLenght); @@ -2044,7 +2057,6 @@ const readerColumnSun = (column: any) => { > - + { {{ scope.row[scope.column.property] }}== - @@ -2516,7 +2527,7 @@ const readerColumnSun = (column: any) => { width: 100%; } .table-list-comm { - padding: 0px 15px 5px 15px; + padding: 0px 5px 5px 5px; } .seacherForm { min-height: auto; diff --git a/src/components/DesignForm/tableListPage/formPageCont.vue b/src/components/DesignForm/tableListPage/formPageCont.vue index a5b6978..a80c35d 100644 --- a/src/components/DesignForm/tableListPage/formPageCont.vue +++ b/src/components/DesignForm/tableListPage/formPageCont.vue @@ -80,7 +80,7 @@ const formProps = inject(constFormProps, {}) as any; let getFieldRecordPromises: any[] = []; let objMastesform: any; -let transferDetails:any = []; +let transferDetails: any = []; /** @ 作者: 秦东 @@ -159,8 +159,6 @@ watch( }); }) .finally(() => { - - //console.log(objMastesform.list) transferDetails = objMastesform.list.filter((item: any) => { return item.type == "lowcodeTransfer"; @@ -169,44 +167,44 @@ watch( //alert(props.pageInfo.masters_key) gainEditDataLog({ id: props.pageInfo.masters_key }).then(({ data }) => { //console.log(formState.formData.list) - + //console.log("获取修改记录-1111-->",data) transferDetails.forEach((element: any) => { - //console.log(element) - data.forEach((obj: any) => { - //console.log(obj.masterdata) - obj.masterdata.forEach((item: any) => { - if(item.field==element.name){ - //console.log(element.control.fixedOptions) - //console.log(item) + //console.log(element) + data.forEach((obj: any) => { + //console.log(obj.masterdata) + obj.masterdata.forEach((item: any) => { + if (item.field == element.name) { + //console.log(element.control.fixedOptions) + //console.log(item) - for (const key in item) { - const value = item[key]; - // 确保只处理对象自身的属性(不包括原型链上的) - if (Object.prototype.hasOwnProperty.call(item, key)) { - - if(key=="value"){ - - // 特殊处理数组/嵌套对象(使用JSON格式化) - const formattedValue = - (Array.isArray(value) || (typeof value === 'object' && value !== null)) - ? JSON.stringify(value, null, 2) - : value; - - //console.log(`${key}: ${formattedValue}`); - if(item[key]&&item[key].length>0){ - item[key] = mapIdsToLabels(element.control.fixedOptions,item[key]) - } - - } + for (const key in item) { + const value = item[key]; + // 确保只处理对象自身的属性(不包括原型链上的) + if (Object.prototype.hasOwnProperty.call(item, key)) { + if (key == "value") { + // 特殊处理数组/嵌套对象(使用JSON格式化) + const formattedValue = + Array.isArray(value) || + (typeof value === "object" && value !== null) + ? JSON.stringify(value, null, 2) + : value; + + //console.log(`${key}: ${formattedValue}`); + if (item[key] && item[key].length > 0) { + item[key] = mapIdsToLabels( + element.control.fixedOptions, + item[key] + ); + } } } - } - }); + } }); + }); }); - + pageLog.value = data; }); }); @@ -216,37 +214,33 @@ watch( } ); - - interface TreeNode { - id: string; - label: string; - disabled: boolean; - children: TreeNode[]; + id: string; + label: string; + disabled: boolean; + children: TreeNode[]; } function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { - /* console.log(treeNodes) + /* console.log(treeNodes) console.log(ids1) */ - const ids: string[] = JSON.parse(ids1); - // 创建id到label的映射字典 - const idToLabelMap: Record = {}; + const ids: string[] = JSON.parse(ids1); + // 创建id到label的映射字典 + const idToLabelMap: Record = {}; - // 递归遍历树节点并填充映射字典 - function traverse(node: TreeNode) { - idToLabelMap[node.id] = node.label; // 存储当前节点的映射 - node.children.forEach(child => traverse(child)); // 递归处理子节点 - } + // 递归遍历树节点并填充映射字典 + function traverse(node: TreeNode) { + idToLabelMap[node.id] = node.label; // 存储当前节点的映射 + node.children.forEach((child) => traverse(child)); // 递归处理子节点 + } - // 遍历根节点列表 - treeNodes.forEach(root => traverse(root)); - //console.log(ids) - // 将id数组转换为label数组 - return ids.map(id => idToLabelMap[id]); + // 遍历根节点列表 + treeNodes.forEach((root) => traverse(root)); + //console.log(ids) + // 将id数组转换为label数组 + return ids.map((id) => idToLabelMap[id]); } - - /** @ 作者: 秦东 @ 时间: 2024-04-03 14:25:15 @@ -272,8 +266,6 @@ const pageLog = ref([]); let gainTaskFormInfoData: customerFormVersionCont; let gainTaskFormInfoPromise: any[] = []; - - /** @ 作者: 秦东 @ 时间: 2024-04-03 14:33:15 @@ -418,7 +410,7 @@ const jsuanKuandu = () => { if (props.pageInfo.flowIsOpen == 1) { return 900 + 350; } else { - return 900; + return 900 + 350; } }; diff --git a/src/components/DesignForm/tableListPage/index.vue b/src/components/DesignForm/tableListPage/index.vue index b5b8ef7..2930c6f 100644 --- a/src/components/DesignForm/tableListPage/index.vue +++ b/src/components/DesignForm/tableListPage/index.vue @@ -547,10 +547,10 @@ const setUpClick = (val: string, id: string) => { if (val.key == "newAdd") { drawerWith.value = container.value?.clientWidth; openTaskDrawer.value = true; - }else if (val.key === "export"){ - alert("请在非编辑模式操作") - }else if (val.key === "import"){ - alert("请在非编辑模式操作") + } else if (val.key === "export") { + alert("请在非编辑模式操作"); + } else if (val.key === "import") { + alert("请在非编辑模式操作"); } else if (val.key == "showQrCode") { //liwenxuan 20250114 二维码打印弹窗 start //在此组装参数,以生成二维码图片 @@ -978,7 +978,7 @@ const getPageData = () => { //console.log(asfDetails) if (asfDetails.length > 0 && data.data.list != null) { - console.log(data.data.list) + console.log(data.data.list); //拼装参数,asf值对象数组 asfQueryParams = []; for (let j = 0; j < asfDetails.length; j++) { @@ -1020,7 +1020,7 @@ const getPageData = () => { } } } - + tableDataList.value = dataList.data.list; }); } else { @@ -1028,32 +1028,32 @@ const getPageData = () => { } } else { //console.log(data.data.list) - transferDetails.forEach(element => { + transferDetails.forEach((element) => { //console.log(element) data.data.list.forEach((obj: any) => { //console.log(obj) for (const key in obj) { - // 确保只处理对象自身的属性(不包括原型链上的) - if (Object.prototype.hasOwnProperty.call(obj, key)) { - const value = obj[key]; - - // 特殊处理数组/嵌套对象(使用JSON格式化) - const formattedValue = - (Array.isArray(value) || (typeof value === 'object' && value !== null)) - ? JSON.stringify(value, null, 2) - : value; - - //console.log(`${key}: ${formattedValue}`); - if(key==element.field){ - //console.log(key) - /* console.log(element.control.fixedOptions) + // 确保只处理对象自身的属性(不包括原型链上的) + if (Object.prototype.hasOwnProperty.call(obj, key)) { + const value = obj[key]; + + // 特殊处理数组/嵌套对象(使用JSON格式化) + const formattedValue = + Array.isArray(value) || + (typeof value === "object" && value !== null) + ? JSON.stringify(value, null, 2) + : value; + + //console.log(`${key}: ${formattedValue}`); + if (key == element.field) { + //console.log(key) + /* console.log(element.control.fixedOptions) console.log(obj[key]) */ - obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key]) - } + obj[key] = mapIdsToLabels(element.control.fixedOptions, obj[key]); } + } } }); - }); //console.log(transferDetails) //convertIdsToLabels(data.data.list.) @@ -1077,28 +1077,28 @@ const getPageData = () => { }; interface TreeNode { - id: string; - label: string; - disabled: boolean; - children: TreeNode[]; + id: string; + label: string; + disabled: boolean; + children: TreeNode[]; } function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { - const ids: string[] = JSON.parse(ids1); - // 创建id到label的映射字典 - const idToLabelMap: Record = {}; - - // 递归遍历树节点并填充映射字典 - function traverse(node: TreeNode) { - idToLabelMap[node.id] = node.label; // 存储当前节点的映射 - node.children.forEach(child => traverse(child)); // 递归处理子节点 - } + const ids: string[] = JSON.parse(ids1); + // 创建id到label的映射字典 + const idToLabelMap: Record = {}; + + // 递归遍历树节点并填充映射字典 + function traverse(node: TreeNode) { + idToLabelMap[node.id] = node.label; // 存储当前节点的映射 + node.children.forEach((child) => traverse(child)); // 递归处理子节点 + } - // 遍历根节点列表 - treeNodes.forEach(root => traverse(root)); - //console.log(ids) - // 将id数组转换为label数组 - return ids.map(id => idToLabelMap[id] || "已删除的节点( id : "+id+") "); + // 遍历根节点列表 + treeNodes.forEach((root) => traverse(root)); + //console.log(ids) + // 将id数组转换为label数组 + return ids.map((id) => idToLabelMap[id] || "已删除的节点( id : " + id + ") "); } const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { @@ -1624,7 +1624,7 @@ const readerColumn = (column: any, isSun: int) => { if (column.label.length < 3) { labelLong = 3; } - let size = 30; // 根据需求定义一个字体的标尺 + let size = 15; // 根据需求定义一个字体的标尺 return labelLong * size; } else { return "100%"; @@ -1639,9 +1639,9 @@ const readerColumnSun = (column: any) => { let countLenght = 3; column.children.forEach((item: any) => { if (item.label.length < 3) { - countLenght = countLenght + 90; + countLenght = countLenght + 15; } else { - countLenght = countLenght + item.label.length * 40; + countLenght = countLenght + item.label.length * 15; } }); console.log("表头label长度-->", countLenght); diff --git a/src/permission.ts b/src/permission.ts index 1294ba2..25939e0 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -43,6 +43,7 @@ router.beforeEach(async (to:any, from:any, next:any) => { try { // const { roles } = await userStore.getInfo(); const { perms } = await userStore.getInfo(); + console.log("路由权限---》",perms); const accessRoutes = await permissionStore.generateRoutes(perms); console.log("路由权限--perms--》",accessRoutes); accessRoutes.forEach((route:any) => { diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 7843ea9..5245f4f 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -61,9 +61,10 @@ const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => { tmpRoute.component = Layout; // console.log(); } else { + console.log("判断用户-251->",tmpRoute.component); const component = modules[`../../views/${tmpRoute.component}.vue`]; // const component = modules[`${tmpRoute.component}.vue`]; - // console.log("判断用户-->",component); + console.log("判断用户-1111111111111111->",component); if (component) { tmpRoute.component = component; } else { diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue index e3b2ea0..e06d922 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue @@ -608,7 +608,7 @@ const readerColumn = (column: any, isSun: int) => { if (column.label.length < 3) { labelLong = 3; } - let size = 30; // 根据需求定义一个字体的标尺 + let size = 15; // 根据需求定义一个字体的标尺 return labelLong * size; } else { return "100%"; diff --git a/src/views/sysworkflow/lowcodepage/pageList.vue b/src/views/sysworkflow/lowcodepage/pageList.vue index 90c7925..fc619a4 100644 --- a/src/views/sysworkflow/lowcodepage/pageList.vue +++ b/src/views/sysworkflow/lowcodepage/pageList.vue @@ -612,7 +612,7 @@ const readerColumn = (column: any) => { if (column.label.length < 3) { labelLong = 3; } - let size = 30; // 根据需求定义一个字体的标尺 + let size = 15; // 根据需求定义一个字体的标尺 // column.minWidth = labelLong * size //@ts-ignore return labelLong * size; diff --git a/src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue b/src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue index 5def235..4868882 100644 --- a/src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue +++ b/src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue @@ -459,10 +459,10 @@ function optionsValue3Get3(data: any, fieldName: string) { justify-content: space-between; background-color: #ffffff; padding: 15px 15px 5px 15px; - margin-bottom: 15px; + margin-bottom: 10px; } .scroBox { - padding: 0 15px; + padding: 0 10px; height: calc(100vh - 110px); .tispMsg { margin: 0 auto 15px auto; From 2d9401f145c03817b0d7d8184090b9720f6c743b Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Mon, 4 Aug 2025 16:28:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 4 +- .../DesignForm/tableListPage/index.vue | 8 +- .../appPageForm/echatesUnit/chart/bar.vue | 57 +++++++++-- .../appPageForm/echatesUnit/chart/barRace.vue | 4 +- .../appPageForm/echatesUnit/chart/line.vue | 94 ++++++++++++++++--- .../appPageForm/echatesUnit/chart/pie.vue | 1 + .../appPageForm/echatesUnit/chart/radar.vue | 2 +- .../appPageForm/echatesUnit/container.vue | 5 +- 8 files changed, 142 insertions(+), 33 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index 60c45d7..a15ae6d 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -1768,7 +1768,7 @@ const transformOption = (val: string | number, type?: string) => { }; const readerColumnSun = (column: any) => { - console.log("表头label长度-11->", column); + // console.log("表头label长度-11->", column); let labelLong = 0; // 表头label长度 if (column.children) { labelLong = column.children.length; @@ -1782,7 +1782,7 @@ const readerColumnSun = (column: any) => { countLenght = countLenght + item.label.length * 15; } }); - console.log("表头label长度-->", countLenght); + // console.log("表头label长度-->", countLenght); return countLenght; } else { return 100; diff --git a/src/components/DesignForm/tableListPage/index.vue b/src/components/DesignForm/tableListPage/index.vue index 2930c6f..0df0289 100644 --- a/src/components/DesignForm/tableListPage/index.vue +++ b/src/components/DesignForm/tableListPage/index.vue @@ -1644,7 +1644,7 @@ const readerColumnSun = (column: any) => { countLenght = countLenght + item.label.length * 15; } }); - console.log("表头label长度-->", countLenght); + // console.log("表头label长度-->", countLenght); return countLenght; } else { return 100; @@ -2047,8 +2047,7 @@ const readerColumnSun = (column: any) => { :label="item.label" :width="readerColumnSun(item)" > - diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue index 727ab61..34b0ce6 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue @@ -30,6 +30,17 @@ const props = withDefaults( } ); var myChart = ref(); +const seriesAnlay = (listVal: any[]) => { + if (listVal && Array.isArray(listVal)) { + listVal.forEach((item: any) => { + item.label = { + show: true, + position: "top", + }; + }); + } + return listVal; +}; /** @ 作者: 秦东 @ 时间: 2025-06-26 11:34:21 @@ -45,16 +56,44 @@ const drawPictures = () => { }).then((data) => { console.log("火1111111兔", data); if (data.code == 0 && data.data != null) { - let optVal = data.data; - // optVal.grid = { - // left: "2%", - // right: "2%", - // bottom: "15%", - // top: "15%", - // containLabel: true, + // let optVal = data.data; + // let optVal = { + // tooltip: { + // trigger: "axis", + // axisPointer: { + // type: "shadow", + // }, + // }, + // grid: { + // left: "2%", + // right: "2%", + // bottom: "15%", + // top: "15%", + // containLabel: true, + // }, + // ...data.data, // }; - myChart.value.setOption(optVal); - myChart.value.resize(); + let optChart = { + grid: { + left: "2%", + right: "2%", + bottom: "15%", + top: "15%", + containLabel: true, + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: data.data.legend, + yAxis: data.data.yAxis, + xAxis: data.data.xAxis, + series: seriesAnlay(data.data.series), + }; + myChart.value.setOption(optChart); + // myChart.value.resize(); } else { myChart.value.setOption({ grid: { diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue index 0c5f3ea..bd58334 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue @@ -87,7 +87,7 @@ const drawBarracetures = () => { series: seriesList, }; myChart.value.setOption(optionData); - myChart.value.resize(); + // myChart.value.resize(); } else { myChart.value.setOption({ grid: { @@ -120,7 +120,7 @@ const drawBarracetures = () => { }, ], }); - myChart.value.resize(); + // myChart.value.resize(); } }); diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue index 6b57cd7..786dca3 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue @@ -28,7 +28,31 @@ const props = withDefaults( } ); var myChartPie = ref(); +const pinhuaOrzejiao = ref(false); +/** +@ 作者: 秦东 +@ 时间: 2025-08-04 14:31:20 +@ 功能: 解析数据结果 +*/ +const seriesAnlay = (listVal: any[]) => { + if (listVal && Array.isArray(listVal)) { + listVal.forEach((item: any) => { + item.smooth = pinhuaOrzejiao.value; + item.label = { + show: true, + position: "top", + }; + }); + } + return listVal; +}; +watch( + () => pinhuaOrzejiao.value, + () => { + drawLine(); + } +); /** @ 作者: 秦东 @ 时间: 2025-06-26 11:34:21 @@ -46,18 +70,50 @@ const drawLine = () => { }).then((data) => { console.log("火兔", data); if (data.code == 0 && data.data != null) { - let optVal = data.data; - optVal.grid = { - left: "2%", - right: "2%", - bottom: "15%", - top: "15%", - containLabel: true, + let optChart = { + grid: { + left: "2%", + right: "2%", + bottom: "15%", + top: "15%", + containLabel: true, + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: data.data.legend, + yAxis: data.data.yAxis, + xAxis: data.data.xAxis, + series: seriesAnlay(data.data.series), }; - myChartPie.value.setOption(optVal); - myChartPie.value.resize(); + + // let optVal = data.data; + // optVal.grid = { + // left: "2%", + // right: "2%", + // bottom: "15%", + // top: "15%", + // containLabel: true, + // }; + // (optVal.tooltip = { + // trigger: "axis", + // axisPointer: { + // type: "shadow", + // }, + // }), + myChartPie.value.setOption(optChart); + // myChartPie.value.resize(); } else { myChartPie.value.setOption({ + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, grid: { left: "2%", right: "2%", @@ -80,17 +136,17 @@ const drawLine = () => { name: "销量", data: [820, 932, 901, 934, 1290, 1330, 1320], type: "line", - smooth: true, + smooth: pinhuaOrzejiao.value, }, { name: "销量科技", data: [822, 942, 951, 4, 1290, 1330, 1320], type: "line", - smooth: true, + smooth: pinhuaOrzejiao.value, }, ], }); - myChartPie.value.resize(); + // myChartPie.value.resize(); } }); @@ -126,9 +182,12 @@ onMounted(() => {