From 301d6b418da9c3c0ad0580557e8b0c3a49065502 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Tue, 2 Apr 2024 08:05:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/DesignForm/requestapi.ts | 16 + src/api/DesignForm/tableButton.ts | 14 + src/api/DesignForm/types.ts | 2 + .../DesignForm/tableListPage/index.vue | 490 ++++++++++++++++++ src/store/DesignForm/designForm.ts | 13 +- src/types/components.d.ts | 6 + src/views/sysworkflow/codepage/index.ts | 2 + .../sysworkflow/lowcodepage/appFormList.vue | 95 +++- src/views/sysworkflow/lowcodepage/index.vue | 10 +- .../sysworkflow/lowcodepage/pageList.vue | 306 ++++++++--- 10 files changed, 880 insertions(+), 74 deletions(-) create mode 100644 src/components/DesignForm/tableListPage/index.vue diff --git a/src/api/DesignForm/requestapi.ts b/src/api/DesignForm/requestapi.ts index eee6a1163..24009cccd 100644 --- a/src/api/DesignForm/requestapi.ts +++ b/src/api/DesignForm/requestapi.ts @@ -317,3 +317,19 @@ export function gainFormTableField(data?:any){ data: data }); } +//编辑自定义表单列表数据 +export function editCustomerFormList(data: any) { + return request({ + url: '/systemapi/customer_form/editCustomerFormList', + method: 'post', + data: data + }); +} +//获取表单列表数据 +export function gainFormListCont(data: getContForId) { + return request({ + url: '/systemapi/customer_form/gainFormListCont', + method: 'post', + data: data + }); +} diff --git a/src/api/DesignForm/tableButton.ts b/src/api/DesignForm/tableButton.ts index 20551274f..9a6f20609 100644 --- a/src/api/DesignForm/tableButton.ts +++ b/src/api/DesignForm/tableButton.ts @@ -118,3 +118,17 @@ export const diaOrDrawer = [ value:"dialog" } ] + +//表单结构 +export interface FormPageList { + columns: tableButton[], + config: any, + controlBtn:tableButton[], + operateBtn:tableButton[] +} +export interface FormPageConfig{ + pageSize:number, + searchIsShow:boolean, + searchFormIsShow:boolean, + openPageMode:string +} diff --git a/src/api/DesignForm/types.ts b/src/api/DesignForm/types.ts index 869001111..58f8ab189 100644 --- a/src/api/DesignForm/types.ts +++ b/src/api/DesignForm/types.ts @@ -199,3 +199,5 @@ export interface CarsuselConfig { imgUrl:string, link:string } + + diff --git a/src/components/DesignForm/tableListPage/index.vue b/src/components/DesignForm/tableListPage/index.vue new file mode 100644 index 000000000..8313cf626 --- /dev/null +++ b/src/components/DesignForm/tableListPage/index.vue @@ -0,0 +1,490 @@ + + + + diff --git a/src/store/DesignForm/designForm.ts b/src/store/DesignForm/designForm.ts index 005106c97..6af14f964 100644 --- a/src/store/DesignForm/designForm.ts +++ b/src/store/DesignForm/designForm.ts @@ -1,10 +1,12 @@ import { defineStore } from 'pinia' +import { getStorage, setStorage } from '@/utils/lowCodeForm' export const useDesignFormStore = defineStore('designForm', { state: () => { return { controlAttr: {}, - activeKey: '' + activeKey: '', + columnsCheck: getStorage('tableColumns', true) || [], // 表格勾选的列 //type: 1, //当前表单状态 1新增;2查看(表单模式) ;3查看; 4设计 //isEdit: false, //编辑状态,type=1新增模式下有编辑状态,主要用于控制编辑模式下某些字段的禁用状态,即可新增但不能修改 //model: {}, // 给form-group提供联动条件设置 @@ -17,6 +19,13 @@ export const useDesignFormStore = defineStore('designForm', { }, setActiveKey(key: string) { this.activeKey = key - } + }, + setColumnsCheck(path: string, data: string[]) { + this.columnsCheck[path] = data + setStorage('tableColumns', this.columnsCheck, 0) + }, + getColumnsCheck(path: string) { + return this.columnsCheck[path] || [] + }, } }) diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 9ec12b513..5cea651e1 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -26,6 +26,7 @@ declare module '@vue/runtime-core' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] @@ -74,6 +75,8 @@ declare module '@vue/runtime-core' { ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] @@ -100,6 +103,8 @@ declare module '@vue/runtime-core' { IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default'] IEpClose: typeof import('~icons/ep/close')['default'] + IEpRefresh: typeof import('~icons/ep/refresh')['default'] + IEpSearch: typeof import('~icons/ep/search')['default'] IEpSetting: typeof import('~icons/ep/setting')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] LayoutPage: typeof import('./../components/DesignForm/layoutPage/index.vue')['default'] @@ -125,6 +130,7 @@ declare module '@vue/runtime-core' { SingleUpload: typeof import('./../components/Upload/SingleUpload.vue')['default'] SizeSelect: typeof import('./../components/SizeSelect/index.vue')['default'] SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default'] + TableListPage: typeof import('./../components/DesignForm/tableListPage/index.vue')['default'] Template: typeof import('./../components/DesignForm/template.vue')['default'] TextPage: typeof import('./../components/DesignForm/designLayout/textPage.vue')['default'] Tinymce: typeof import('./../components/DesignForm/public/form/tinymce.vue')['default'] diff --git a/src/views/sysworkflow/codepage/index.ts b/src/views/sysworkflow/codepage/index.ts index d02f93321..da5356626 100644 --- a/src/views/sysworkflow/codepage/index.ts +++ b/src/views/sysworkflow/codepage/index.ts @@ -2,10 +2,12 @@ import formDesign from '@/components/DesignForm/public/form/form.vue' import tableList from '@/components/DesignForm/public/form/components/list.vue' import flow from '@/components/DesignForm/public/form/components/flow.vue' import Screen from '@/components/DesignForm/public/form/components/screen.vue' +import akPageList from '@/components/DesignForm/tableListPage/index.vue' export default (app: any) => { app.component('AkForm', formDesign) app.component('AkList', tableList) app.component('AkFlow', flow) app.component('AkScreen', Screen) + app.component('AkPageList', akPageList) } diff --git a/src/views/sysworkflow/lowcodepage/appFormList.vue b/src/views/sysworkflow/lowcodepage/appFormList.vue index e1762ffe1..7294ae561 100644 --- a/src/views/sysworkflow/lowcodepage/appFormList.vue +++ b/src/views/sysworkflow/lowcodepage/appFormList.vue @@ -7,7 +7,7 @@ import { customerFormCont } from "@/api/DesignForm/type"; import { getCustomerFormList,editProductionFormStatus } from '@/api/DesignForm/requestapi' import {Delete,Edit,View,MoreFilled} from '@element-plus/icons-vue' - +import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' import LowCodeFormPage from "@/views/sysworkflow/lowcodepage/lowCodeFormPage.vue" import TaskCustomerForm from '@/views/taskplatform/taskmanagement/taskcustomerformnew.vue' @@ -27,7 +27,7 @@ const props = defineProps({ } }); -const emits = defineEmits(["update:formKey"]); +const emits = defineEmits(["update:formKey","getRongQiAttr"]); //表单ID const formKeyStr = computed({ @@ -49,6 +49,8 @@ const pageApp = ref(1) //页码 const pageAppSize = ref(12) //每页显示几个 const pageAppTotal = ref(0) //总记录数 const contList = ref() + +const lookPageIsShow = ref(false) /** @ 作者: 秦东 @ 时间: 2024-03-21 10:54:23 @@ -74,6 +76,7 @@ const getFormAppList = () => { @ 功能: 创建表单任务 */ const startUsing = (id:string,title:string) => { + emits('getRongQiAttr') versionId.value = id versionTitle.value = title openTaskDrawer.value = true @@ -84,6 +87,7 @@ const startUsing = (id:string,title:string) => { @ 功能: 编辑表单 */ const editFormApp = (id:string) => { + emits('getRongQiAttr') formId.value = id.toString() addFormIsShow.value= true console.log("编辑表单",id,"-",formId.value,"-",addFormIsShow.value) @@ -127,6 +131,71 @@ const refreshPage = (pageType:string) =>{ onMounted(()=>{ getFormAppList() }) +/** +@ 作者: 秦东 +@ 时间: 2024-04-01 14:32:18 +@ 功能: 查看表单列表 +*/ +const lookFormList = (val:any) => { + emits('getRongQiAttr') + console.log("查看表单列表", val) + lookPageIsShow.value = true + state.formId = val.idStr + let stateData = string2json(val.listjson) + console.log("查看表单列表---->",stateData) + state.tableData = stateData.tableData + state.searchData = stateData.searchData + state.loading = stateData.loading + state.attrObj = stateData.attrObj + state.config = stateData.config + state.tagList = stateData.tagList + + state.formList = stateData.formList + state.name = stateData.name + state.treeData = stateData.treeData + state.previewVisible = stateData.previewVisible + state.formFieldList = stateData.formFieldList + state.formApi = stateData.formApi + state.dict = stateData.dict + state.refreshTable = stateData.refreshTable + + +} +const state = reactive({ + tableData: { + // tableProps: {}, //表格所有参数 + columns: [], + config: {}, + controlBtn:[], + operateBtn:[] + }, + searchData: [], + loading: false, + attrObj: {}, + config: { + pageSize:10, + searchIsShow:true, + searchFormIsShow:true, + openPageMode:"drawer" + }, + tagList: {}, + formId: props.formKey || '', + formList: [], // 所有可选表单数据源 + name: '', + treeData: {}, // 左侧树相关 + previewVisible: false, + tabsName: 'second', + formFieldList: [], // 表单数据源所有可选字段 + formApi:{ + type:"1", + addApiUrl:"", + editApiUrl:"", + delApiUrl:"", + lookApiUrl:"" + }, + dict: {}, + refreshTable: true +})