diff --git a/docs/index.html b/docs/index.html index a892af26d..1640c68b8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,7 +7,7 @@ - AK低代码快速开发平台 + 数通智联化工平台 diff --git a/index.html b/index.html index 10995604d..db63f07fd 100644 --- a/index.html +++ b/index.html @@ -12,11 +12,11 @@
- - - - - + + + + + diff --git a/package.json b/package.json index d855b9d8e..8dc067c03 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "path-to-regexp": "^6.2.0", "pinia": "^2.0.33", "screenfull": "^6.0.0", + "tinymce": "^6.7.0", "ts-md5": "^1.3.1", "vue": "^3.3.1", "vue-i18n": "9.2.2", diff --git a/src/api/DesignForm/requestapi.ts b/src/api/DesignForm/requestapi.ts index 865626e7e..8ffd86842 100644 --- a/src/api/DesignForm/requestapi.ts +++ b/src/api/DesignForm/requestapi.ts @@ -4,7 +4,10 @@ import { customerFormCont, CustomerFormPageResult, SearchForm, - customerFormConfig + customerFormConfig, + getContForId, + editFormStatus, + setupCustomerFormCont } from './type'; //自定义表单列表 export function getCustomerFormList(queryParams: SearchForm): AxiosPromise { @@ -21,7 +24,7 @@ export function getProductionMarkForm(): AxiosPromise { method: 'post', }); } - +//保存自定义表单 export function saveProductionForm(data: any) { return request({ url: '/systemapi/customer_form/save_customer_form', @@ -29,3 +32,28 @@ export function saveProductionForm(data: any) { data: data }); } +//获取单一表单内容 +export function getOneProductionForm(data: getContForId) { + return request({ + url: '/systemapi/customer_form/look_customer_form', + method: 'post', + data: data + }); +} +//编辑自定义表单状态 +export function editProductionFormStatus(data: editFormStatus) { + return request({ + url: '/systemapi/customer_form/edit_customer_form_status', + method: 'post', + data: data + }); +} + +//编辑自定义表单设置 +export function saveSetupCont(data: setupCustomerFormCont) { + return request({ + url: '/systemapi/customer_form/save_setup_cont', + method: 'post', + data: data + }); +} diff --git a/src/api/DesignForm/type.ts b/src/api/DesignForm/type.ts index 3ae8f1152..a1ab839dd 100644 --- a/src/api/DesignForm/type.ts +++ b/src/api/DesignForm/type.ts @@ -21,3 +21,22 @@ export interface customerFormConfig{ formname:string; formlogo:string; } +//根据Id获取信息 +export interface getContForId{ + id:string; +} +//编辑表单状态 +export interface editFormStatus{ + id:string[]; + status:number; + is_delete:boolean; +} + +//自定义表单设置字段 +export interface setupCustomerFormCont{ + id:number; + name:string; + permit:any; + states:number; + status:boolean; +} diff --git a/src/components/DesignForm/public/form/formGroup.vue b/src/components/DesignForm/public/form/formGroup.vue index 43552beb8..5c084f482 100644 --- a/src/components/DesignForm/public/form/formGroup.vue +++ b/src/components/DesignForm/public/form/formGroup.vue @@ -32,6 +32,7 @@ const props = withDefaults( const store = useDesignFormStore() as any const formProps = inject(constFormProps, {}) as any const type = computed(() => { + console.log("11111",formProps.value.type) return formProps.value.type }) const state = reactive({ diff --git a/src/views/matrix/matrixcont/setupmatrixuser.vue b/src/views/matrix/matrixcont/setupmatrixuser.vue index ba05ce45b..0788e5314 100644 --- a/src/views/matrix/matrixcont/setupmatrixuser.vue +++ b/src/views/matrix/matrixcont/setupmatrixuser.vue @@ -11,8 +11,7 @@ import { Search } from '@element-plus/icons-vue' * 引入页面 */ import PickOrg from '@/views/matrix/orgoruser/pickorg.vue' -import PickUser from '@/views/matrix/orgoruser/pickuser.vue' -import { th } from 'element-plus/es/locale'; + const props = defineProps({ userShow:{ diff --git a/src/views/sysworkflow/codepage/createform.vue b/src/views/sysworkflow/codepage/createform.vue index 3aeaf316a..c7c6e4ca7 100644 --- a/src/views/sysworkflow/codepage/createform.vue +++ b/src/views/sysworkflow/codepage/createform.vue @@ -33,7 +33,7 @@ import { ElMessage } from 'element-plus' import { useLayoutStore } from '@/store/DesignForm/layout' import { FormData,formStruct,DrawerStruct } from '@/api/DesignForm/types' -import { saveProductionForm } from '@/api/DesignForm/requestapi' +import { saveProductionForm,getOneProductionForm } from '@/api/DesignForm/requestapi' const isSave = ref(false) @@ -42,6 +42,10 @@ const props = defineProps({ type:Boolean, default:true }, + formid:{ + type:String, + default:"" + }, formconfigcont:{ type:Object, default(){ @@ -100,35 +104,70 @@ const vueFileEl = ref() const formControlAttrEl = ref() // 当前表单设计类型,供各子组件调用以展示不同页面,统一方式不需要每个组件都从路由中取 provide('formDesignType', state.designType) - const getInitData = () => { - const id = route.id // 当前记录保存的id +const getInitData = () => { + const id = props.formid // 当前记录保存的id if (id) { // 获取初始表单数据 state.loading = true - getRequest('designById', { id: id }) - .then(res => { - const result = res.data - // 初始设计搜索时res.data='' - if (result.data) { - state.formData = stringToObj(result.data) - } - state.formDict = string2json(result.dict) - // 恢复表单名称 - state.formOtherData.source = result.source - state.formOtherData.formName = result.name - if (result.source && state.designType !== 'search') { - // 加载属性侧边栏的字段标识,搜索时不需要请求 - formControlAttrEl.value.getFormFieldBySource(result.source) - } - state.loading = false - }) - .catch((res: any) => { + + getOneProductionForm({id: id.toString()}) + .then((res:any) => { + state.loading = false + console.log(" 获取初始表单数据",res) + if(res.code == 0){ + const result = res.data + // 初始设计搜索时res.data='' + if (result.mastesform) { + state.formData = stringToObj(result.mastesform) + } + state.formDict = string2json(result.dict) + // 恢复表单名称 + state.formOtherData.source = result.source + state.formOtherData.formName = result.name + + state.formOtherData.formName = result.name + state.formData.form.name = result.tablename + state.formData.form.formName = result.name + if (result.source && state.designType !== 'search') { + // 加载属性侧边栏的字段标识,搜索时不需要请求 + formControlAttrEl.value.getFormFieldBySource(result.source) + } + }else{ + ElMessage.error(res.msg || '加载异常') + } + }) + .finally(()=>{ + isSave.value = true + }) + .catch((res: any) => { // console.log(res) - ElMessage.error(res.message || '加载异常') + ElMessage.error(res.msg || '加载异常') state.loading = false }) + // getRequest('designById', { id: id }) + // .then(res => { + // const result = res.data + // // 初始设计搜索时res.data='' + // if (result.data) { + // state.formData = stringToObj(result.data) + // } + // state.formDict = string2json(result.dict) + // // 恢复表单名称 + // state.formOtherData.source = result.source + // state.formOtherData.formName = result.name + // if (result.source && state.designType !== 'search') { + // // 加载属性侧边栏的字段标识,搜索时不需要请求 + // formControlAttrEl.value.getFormFieldBySource(result.source) + // } + // state.loading = false + // }) + // .catch((res: any) => { + // // console.log(res) + // ElMessage.error(res.message || '加载异常') + // state.loading = false + // }) } - } +} const headToolClick = (type: string) => { switch (type) { case 'del': @@ -171,8 +210,13 @@ provide('formDesignType', state.designType) emits("update:draweropenclose", false); break case 'close': - console.log("关闭") + console.log("关闭") + if(isSave.value){ + + state.formData.list = [] + store.setActiveKey('') + store.setControlAttr({}) emits("update:draweropenclose", false); }else{ ElMessageBox.confirm( @@ -188,6 +232,10 @@ provide('formDesignType', state.designType) saveDataNew(); }) .catch(() => { + + state.formData.list = [] + store.setActiveKey('') + store.setControlAttr({}) emits("update:draweropenclose", false); }) } @@ -462,7 +510,7 @@ const saveDataNew = () => { const searchCheckField = (data: FormData) => { state.formData.list.push(data) } - getInitData() + // 从数据源点创建表单过来时,带有参数source onMounted(() => { if (route.source) { @@ -470,6 +518,7 @@ const saveDataNew = () => { } }) onMounted(() => { + getInitData() console.log("监听数据",route.type,props.formconfigcont.formname,props.formconfigcont.formlogo,state) state.formOtherData.formName = props.formconfigcont.formname state.formData.form.name = props.formconfigcont.formlogo @@ -481,9 +530,11 @@ onMounted(() => { watch(() => props.draweropenclose,() => { console.log("监听数据",props.draweropenclose,state) if(props.draweropenclose){ + getInitData() state.formOtherData.formName = props.formconfigcont.formName state.formData.form.name = props.formconfigcont.formlogo state.formData.form.formName = props.formconfigcont.formName + }else{ state.formOtherData.formName = "未命名表单" state.formData.form.name = props.formconfigcont.formlogo diff --git a/src/views/sysworkflow/codepage/index.vue b/src/views/sysworkflow/codepage/index.vue index ce2263d0b..a0c8da2ce 100644 --- a/src/views/sysworkflow/codepage/index.vue +++ b/src/views/sysworkflow/codepage/index.vue @@ -5,24 +5,30 @@ --> @@ -172,9 +232,10 @@ window.addEventListener("resize", function(){ /> - - + + + diff --git a/src/views/sysworkflow/codepage/setupconfig.vue b/src/views/sysworkflow/codepage/setupconfig.vue new file mode 100644 index 000000000..b75405e79 --- /dev/null +++ b/src/views/sysworkflow/codepage/setupconfig.vue @@ -0,0 +1,147 @@ + + + + diff --git a/vite.config.ts b/vite.config.ts index 01cd65142..885c38093 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -52,7 +52,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { }, }, }, + plugins: [ + vue(), UnoCSS({ /* options */