Browse Source

优化

master
陈裕财 2 years ago
parent
commit
ce680615c7
  1. 6
      src/lang/zh_form.js
  2. 12
      src/router/routes_form.js
  3. 2
      src/views/mdp/form/formDef/DesignRoute.vue
  4. 11
      src/views/mdp/form/formDef/Index.vue
  5. 49
      src/views/mdp/form/formField/Index.vue

6
src/lang/zh_form.js

@ -2,8 +2,10 @@ export default {
route: {
dashboard: '首页',
IntelligentForm:'智能表单',
FormDefAdd:'表单定义',
FormDesign:'表单设计',
FormDesign:'表单设计',
FormDefMng:'表单管理',
FormDataMng:'表单数据'
FormDataMng:'表单数据',
FormDefIndex:'表单中心'
}
}

12
src/router/routes_form.js

@ -17,12 +17,12 @@ export default {
//leaf: true,//只有一个节点
children: [
{
iconCls: 'fa el-icon-menu', path: 'index', component: _import("mdp/form/formDef/Index"), name: 'FormDefMng' ,meta:{
title: 'IntelligentForm',
icon: 'capacity-form'} },
{ path: 'design/index/:expandId', component: _import("mdp/form/formDef/Index"), name: 'FormDefMng',meta:{title:'FormDefMng'} ,hidden:true },
{ path: 'design/:expandId', component: _import("mdp/form/formDef/DesignRoute"), name: 'FormDesign',meta:{title:'FormDefMng'} ,hidden:true },
iconCls: 'fa el-icon-star-off', path: 'index', component: _import("mdp/form/formDef/Index"), name: 'FormDefMng' ,meta:{
title: 'FormDefIndex', } },
{ path: 'design/index/:expandId', component: _import("mdp/form/formDef/Index"), name: 'FormDefIndex',meta:{title:'FormDefIndex'} ,hidden:true },
{ path: 'design/:expandId', component: _import("mdp/form/formDef/DesignRoute"), name: 'FormDesignRoute',meta:{title:'FormDesign'} ,hidden:true },
{ iconCls: 'fa el-icon-circle-plus', path: 'create', component: _import("mdp/form/formDef/DesignRoute"), name: 'FormDesign',meta:{title:'FormDesign'} },
{ path: 'data/edit/:formId/:dataId', component: _import("mdp/form/formData/FormRoute"), name: '数据填报',meta:{title:'FormDataAddRoute'} ,hidden:true },
{ path: 'data/add/:formId', component: _import("mdp/form/formData/FormRoute"), name: '数据填报',meta:{title:'FormDataAddRoute'} ,hidden:true },

2
src/views/mdp/form/formDef/DesignRoute.vue

@ -1,6 +1,6 @@
<template>
<el-row>
<form-def-form v-if="expandId" :form-id="expandId" sub-op-type="edit" :visible="true"></form-def-form>
<form-def-form :form-id="expandId" sub-op-type="edit" :visible="true"></form-def-form>
</el-row>
</template>

11
src/views/mdp/form/formDef/Index.vue

@ -9,7 +9,7 @@
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchTableDatas()" icon="el-icon-search" type="primary">查询</el-button>
<span style="float:right;" v-if="currOpType=='mng'">
<el-button :disabled="disabledJudge('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="openForm({parentOpType:currOpType,subOpType:'add',formData:addForm,title:'新增'})" icon="el-icon-plus"/>
<el-button :disabled="disabledJudge('addBtn') || !checkBtnQx('addBtn',menuDefId) " type="primary" @click="toDesignAdd()" icon="el-icon-plus"/>
</span>
<span style="float:right;" v-else-if="currOpType=='select' && this.multiple==true">
<el-button :disabled="disabledJudge('selectBtn') || this.sels.length===0" type="primary" @click="selectListConfirm" icon="el-icon-check"/>
@ -309,6 +309,15 @@ export default {
openRoute(data){
this.$router.push({path:'/mdp/form/data/index/'+data.formId})
},
toDesignAdd(){
if(!this.$route.params.expandId){
this.$router.push({path:'/mdp/form/design/'})
}else{
this.$router.push({path:'/mdp/form/design/'+this.$route.params.expandId})
}
},
toDesign(formDef){
this.$router.push({path:'/mdp/form/design/'+formDef.id})
},

49
src/views/mdp/form/formField/Index.vue

@ -43,8 +43,8 @@
<el-form-item label="字段来源" title="该组件能够快速初始化一系列已定义的列">
<el-row type="flex">
<el-button type="primary" @click="$refs['tableDialog'].open()" title="自动读取表格的列作为该表单的字段" >数据库表</el-button>
<el-button type="success" @click="$refs['itemDialog'].open()" title="ai输出了表格列信息,黏贴到此组件即可以解析出列信息作为该表单字段">AI输出</el-button>
<el-button type="warning" @click="$refs['itemDialog'].open()" title="api输出的结果如果是json,可以根据第一条数据结果解析出字段编码,手动加上中文注释即可">API输出</el-button>
<el-button type="success" @click="$refs['aiTableDialog'].open()" title="ai输出了表格列信息,黏贴到此组件即可以解析出列信息作为该表单字段">AI输出</el-button>
<el-button type="warning" @click="$refs['apiDialog'].open()" title="api输出的结果如果是json,可以根据第一条数据结果解析出字段编码,手动加上中文注释即可">API输出</el-button>
<el-button type="primary" @click="$refs['itemDialog'].open()" title="自动读取数据字典中的下拉列表作为该表单的字段信息">数据字典</el-button>
</el-row>
</el-form-item>
@ -64,13 +64,45 @@
<mdp-dialog ref="tableDialog">
<el-row>
请输入数据库表名:
<el-input v-modle="tableName"></el-input>
<el-input v-model="tableName"></el-input>
</el-row>
<el-row slot="footer">
<el-button @click="$refs['tableDialog'].close()">关闭</el-button>
<el-button type="primary" @click="initFormFieldsByTable">确定</el-button>
</el-row>
</mdp-dialog>
<mdp-dialog ref="aiTableDialog">
<el-row>
请从Ai输出的表格配置信息中复制黏贴到此:
<el-input rows="20" type="textarea" v-model="aiTableInfosStr"></el-input>
</el-row>
<el-row slot="footer">
<el-button @click="$refs['aiTableDialog'].close()">关闭</el-button>
<el-button type="primary" @click="initFormFieldsByAiTable">确定</el-button>
</el-row>
</mdp-dialog>
<mdp-dialog ref="apiDialog">
<el-form :model="apiParams" >
<el-form-item label="api地址" prop="url" :rules="{required:true,message:'此项必输',trigger:'blur'}">
<el-input v-model="apiParams.url" placeholder="如 http://127.0.0.1:8015/sys/user/list?userid=xxxx"></el-input>
</el-form-item>
<el-form-item label="请求方式" prop="method" :rules="{required:true,message:'此项必输',trigger:'blur'}">
<mdp-select item-code="request_method" v-model="apiParams.method" placeholder="如 get/post/"></mdp-select>
</el-form-item>
<el-form-item label="请求参数" prop="params">
<el-input type="textarea" :rows="10" v-model="apiParams.params" placeholder="如 { userid:xxxx }"></el-input>
</el-form-item>
<el-form-item label="授权信息" prop="header">
<el-checkbox v-model="apiParams.useMyLoginToken">使用本系统登陆的token</el-checkbox>
<el-input v-if="apiParams.useMyLoginToken==false" type="textarea" :rows="10" v-model="apiParams.header" placeholder="格式 如 Authorization:Bearer jwtTokenXXadkfdfdadfd"></el-input>
</el-form-item>
</el-form>
<el-row slot="footer">
<el-button @click="$refs['apiDialog'].close()">关闭</el-button>
<el-button type="primary" @click="initFormFieldsByAiTable">确定</el-button>
</el-row>
</mdp-dialog>
<mdp-dialog ref="itemDialog" title="选择数据组" width="80%" :modal="false">
<template v-slot="{visible,data,dialog}">
<mdp-meta-item :visible="visible" sub-op-type="select" @select="(item)=>{
@ -140,6 +172,14 @@
}
return {
tableName:'',
aiTableInfosStr:'',
apiParams:{
url:'',
method:'',
params:'',
header:'Authorization:Bearer jwtTokenXXadkfdfdadfd',
useMyLoginToken:true,
},
filters:{
users:[]
},
@ -309,6 +349,9 @@
this.$mdp.getTableInfos({tableName:this.tableName}).then(res=>{
})
},
initFormFieldsByAiTable(){
},
initFormFieldsByItemCode(item){

Loading…
Cancel
Save