diff --git a/src/components/mdp-ui-ext/mdp-expand/FormData.vue b/src/components/mdp-ui-ext/mdp-expand/FormData.vue index bcbee5e..eeb3826 100644 --- a/src/components/mdp-ui-ext/mdp-expand/FormData.vue +++ b/src/components/mdp-ui-ext/mdp-expand/FormData.vue @@ -3,8 +3,9 @@ - - + + + @@ -14,34 +15,7 @@ 关闭 提交 - - - - - - { - if(data.item.isMultiple=='1'){ - data.formData[data.item.fieldIdCamel]=imgs&&imgs.length>0?imgs.map(i=>i.url).join(','):null - }else{ - data.formData[data.item.fieldIdCamel]=imgs&&imgs.length>0?imgs[0].url:null - } - dialog.close(); - }"> - - - - - { - if(data.item.isMultiple=='1'){ - data.formData[data.item.fieldIdCamel]=imgs&&imgs.length>0?imgs.map(i=>i.url).join(','):null - }else{ - data.formData[data.item.fieldIdCamel]= (imgs?imgs.url:null) - } - - dialog.close(); - }" split=","> - - + @@ -70,9 +44,22 @@ import treeTool from '@/components/mdp-ui/js/treeTool.js' this.initFieldQx(k) }) return formFields - } + }, + + isExtInfosCpd(){ + return this.formDef?this.formDef.dataType=='2':false + }, + camelDataField(){ + if(this.formDef){ + return this.$mdp.toCamel(this.formDef.dataField)+"2" + }else{ + return 'extInfos2' + } + + }, }, props:{ + visible:{type:Boolean,default:false}, value:{type:Object,default:null}, formDef:{type:Object,default:null}, diff --git a/src/router/routes_lcode.js b/src/router/routes_lcode.js index ebe2c72..a4f9e2a 100644 --- a/src/router/routes_lcode.js +++ b/src/router/routes_lcode.js @@ -27,6 +27,7 @@ export default { { path: 'data/add/:formId', component: _import("mdp/lcode/formData/FormRoute"), name: '数据填报',meta:{title:'FormDataAddRoute'} ,hidden:true }, { path: 'data/index/:formId', component: _import("mdp/lcode/formData/Index"), name: '智能表单数据管理',meta:{title:'FormDataMng' } ,hidden:true }, + { path: 'data/index/:formId/:dataType/:dataField', component: _import("mdp/lcode/formData/Index"), name: '智能表单数据管理',meta:{title:'FormDataMng' } ,hidden:true }, { path: 'data/mng', component: _import("mdp/lcode/formData/Index"), name: 'FormDataMng', meta:{title:'FormDataMng'},hidden:true } ] diff --git a/src/views/mdp/lcode/formData/Index.vue b/src/views/mdp/lcode/formData/Index.vue index e88b731..85ef493 100644 --- a/src/views/mdp/lcode/formData/Index.vue +++ b/src/views/mdp/lcode/formData/Index.vue @@ -55,10 +55,16 @@ - - - - {{scope.row[c.idCamel]}} + + + + + {{scope.row[camelDataField][c.idCamel]}} + + + + {{scope.row[c.idCamel]}} + @@ -175,6 +181,12 @@ export default { FormDataForm, }, computed: { + isExtInfosCpd(){ + return this.myFormDef.dataType=='2' + }, + camelDataField(){ + return this.$mdp.toCamel(this.myFormDef.dataField)+"2" + } }, watch:{ $route(to){ @@ -253,15 +265,26 @@ export default { //页面数据加载完后需要对数据进行加工处理的 afterList(datas,isOk,apiName){ if(datas){ + debugger; + var dataType=this.$route.params.dataType + var dataField=this.$route.params.dataField + var camelDf=this.$mdp.toCamel(dataField) datas.forEach(d=>{ - if(d.extInfos){ - var extInfos=JSON.parse(d.extInfos) - var extInfos2={} - extInfos.forEach(e=>{ - extInfos2[e.id]=e.value - d['extInfos.'+e.id]=e.value - }) - d.extInfos=extInfos2 + if(d[camelDf]){ + var extInfosStr=d[camelDf] + if(extInfosStr){ + var extInfos=typeof(extInfosStr)=='string'?JSON.parse(extInfosStr):extInfosStr + var extInfos2={} + extInfos.forEach(e=>{ + extInfos2[e.id]=e.value + }) + d[camelDf]=extInfos + d[camelDf+'2']=extInfos2 + }else{ + d[camelDf]=[] + d[camelDf+'2']={} + } + } }) diff --git a/src/views/mdp/lcode/formDef/Index.vue b/src/views/mdp/lcode/formDef/Index.vue index 7ee64f7..9169461 100644 --- a/src/views/mdp/lcode/formDef/Index.vue +++ b/src/views/mdp/lcode/formDef/Index.vue @@ -131,7 +131,7 @@ 设计 权限 - 数据 + 数据 @@ -302,7 +302,7 @@ export default { } }, openRoute(data){ - this.$router.push({path:'/mdp/lcode/data/index/'+data.formId}) + this.$router.push({path:`/mdp/lcode/data/index/${data.formId}/${data.dataType}/${data.dataField}`}) }, toDesignAdd(){