mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-02 02:25:27 +08:00
Jeecg Boot 2.2.1 版本发布,低代码平台
This commit is contained in:
@ -127,16 +127,16 @@ spring:
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false
|
||||
url: jdbc:mysql://127.0.0.1:3306/ jeecg-boot-os-re?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.jdbc.Driver
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 0
|
||||
@ -177,17 +177,17 @@ jeecg :
|
||||
webapp: D://opt//webapp
|
||||
#短信秘钥
|
||||
sms:
|
||||
accessKeyId: ??
|
||||
accessKeySecret: ??
|
||||
accessKeyId: ??
|
||||
accessKeySecret: ??
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储配置
|
||||
oss:
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
accessKey: ??
|
||||
secretKey: ??
|
||||
bucketName: jeecgos
|
||||
staticDomain: https://static.jeecg.com
|
||||
staticDomain: ??
|
||||
# ElasticSearch 6设置
|
||||
elasticsearch:
|
||||
cluster-name: jeecg-ES
|
||||
@ -197,14 +197,27 @@ jeecg :
|
||||
desform:
|
||||
# 主题颜色(仅支持 16进制颜色代码)
|
||||
theme-color: "#1890ff"
|
||||
# 文件、图片上传方式,可选项:qiniu(七牛云)、system(跟随系统配置)
|
||||
upload-type: system
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://fileview.jeecg.com
|
||||
file-view-domain: 127.0.0.1:8012
|
||||
# minio文件上传
|
||||
minio:
|
||||
minio_url: http://minio.jeecg.com
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#是否需要校验token
|
||||
is_verify_token: false
|
||||
#必须校验方法
|
||||
verify_methods: remove,delete,save,add,update
|
||||
#Wps在线文档
|
||||
wps:
|
||||
domain: https://wwo.wps.cn/office/
|
||||
appid: ??
|
||||
appsecret: ??
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
@ -215,3 +228,4 @@ cas:
|
||||
#enable swagger
|
||||
swagger:
|
||||
enable: true
|
||||
|
||||
|
||||
@ -127,10 +127,10 @@ spring:
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
|
||||
@ -180,7 +180,7 @@ jeecg :
|
||||
accessKeyId: LTAIpW4gUG7xYDNI
|
||||
accessKeySecret: ??
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储配置
|
||||
oss:
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
@ -197,6 +197,8 @@ jeecg :
|
||||
desform:
|
||||
# 主题颜色(仅支持 16进制颜色代码)
|
||||
theme-color: "#1890ff"
|
||||
# 文件、图片上传方式,可选项:qiniu(七牛云)、system(跟随系统配置)
|
||||
upload-type: system
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://fileview.jeecg.com
|
||||
# minio文件上传
|
||||
@ -205,6 +207,17 @@ jeecg :
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#是否需要校验token
|
||||
is_verify_token: true
|
||||
#必须校验方法
|
||||
verify_methods: remove,delete,save,add,update
|
||||
#Wps在线文档
|
||||
wps:
|
||||
domain: https://wwo.wps.cn/office/
|
||||
appid: ??
|
||||
appsecret: ??
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
@ -213,4 +226,4 @@ logging:
|
||||
org.jeecg.modules.system.mapper : debug
|
||||
#enable swagger
|
||||
swagger:
|
||||
enable: false
|
||||
enable: false
|
||||
|
||||
@ -8,16 +8,16 @@ server:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: metrics,httptrace
|
||||
|
||||
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
mail:
|
||||
@ -25,10 +25,10 @@ spring:
|
||||
username: jeecgos@163.com
|
||||
password: ??
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
mail:
|
||||
smtp:
|
||||
auth: true
|
||||
starttls:
|
||||
starttls:
|
||||
enable: true
|
||||
required: true
|
||||
## quartz定时任务,采用数据库方式
|
||||
@ -88,7 +88,7 @@ spring:
|
||||
# 设置静态文件路径,js,css等
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
resource:
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
@ -101,7 +101,7 @@ spring:
|
||||
allow:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
dynamic:
|
||||
dynamic:
|
||||
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
@ -125,14 +125,14 @@ spring:
|
||||
filters: stat,wall,slf4j
|
||||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
|
||||
#username: root
|
||||
#password: root
|
||||
@ -180,7 +180,7 @@ jeecg :
|
||||
accessKeyId: LTAIpW4gUG7xYDNI
|
||||
accessKeySecret: ??
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储配置
|
||||
oss:
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
@ -197,6 +197,8 @@ jeecg :
|
||||
desform:
|
||||
# 主题颜色(仅支持 16进制颜色代码)
|
||||
theme-color: "#1890ff"
|
||||
# 文件、图片上传方式,可选项:qiniu(七牛云)、system(跟随系统配置)
|
||||
upload-type: system
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://127.0.0.1:8012
|
||||
# minio文件上传
|
||||
@ -205,9 +207,20 @@ jeecg :
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#是否需要校验token
|
||||
is_verify_token: false
|
||||
#必须校验方法
|
||||
verify_methods: remove,delete,save,add,update
|
||||
#Wps在线文档
|
||||
wps:
|
||||
domain: https://wwo.wps.cn/office/
|
||||
appid: ??
|
||||
appsecret: ??
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
#enable swagger
|
||||
swagger:
|
||||
enable: true
|
||||
enable: true
|
||||
|
||||
@ -13,16 +13,16 @@ justauth:
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: 0277e675495f14a4a183
|
||||
client-secret: ??
|
||||
client-secret: 4681b5153f7158bcdb9b781d8374841d5f51af04
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: wwc2a8c8b19c201bcc
|
||||
client-secret: ??
|
||||
client-secret: Z6VtKLr3dSzuq8zxTaWacGexQW6qxVK8AHrI2ARDv9c
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: 1000002
|
||||
DINGTALK:
|
||||
client-id: dingoa33vjqxrbyidnmgwo
|
||||
client-secret: ??
|
||||
client-secret: RK1020ctw9mRRElz7oMjfHY12BuYVvjP99iraxu76cq9CIB0gyqeb5FJw_OEBnXA
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/thirdLogin/dingtalk/callback
|
||||
cache:
|
||||
type: default
|
||||
|
||||
@ -9,6 +9,6 @@ ${AnsiColor.BRIGHT_BLUE}
|
||||
|
||||
|
||||
${AnsiColor.BRIGHT_GREEN}
|
||||
Jeecg Boot Version: 2.2.0
|
||||
Jeecg Boot Version: 2.2.1
|
||||
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
||||
${AnsiColor.BLACK}
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
<#-- 非空校验 -->
|
||||
<#if po.nullable == 'N' || fieldValidType == '*'>
|
||||
{ required: true, message: '请输入${po.filedComment}!'},
|
||||
<#else>
|
||||
{ required: false},
|
||||
</#if>
|
||||
<#-- 唯一校验 -->
|
||||
<#if fieldValidType == 'only'>
|
||||
|
||||
@ -35,6 +35,12 @@ import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
<#assign bpm_flag=false>
|
||||
<#list originalColumns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
@ -82,6 +88,9 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
<#if bpm_flag>
|
||||
${entityName?uncap_first}.setBpmStatus("1");
|
||||
</#if>
|
||||
${entityName?uncap_first}Service.save(${entityName?uncap_first});
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
@ -19,8 +19,15 @@
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign query_switch=false>
|
||||
<#assign list_need_switch=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#assign query_flag=true>
|
||||
<#if query_field_no==2>
|
||||
@ -41,6 +48,9 @@
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='switch'>
|
||||
<#assign query_switch=true>
|
||||
<#if query_field_no gt 1> </#if><j-switch placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> query></j-switch>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
@ -108,6 +118,9 @@
|
||||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='switch'>
|
||||
<#assign list_need_switch=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<#t>
|
||||
@ -156,6 +169,9 @@
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
<#if tableVo.extendParams.scroll=='1'>
|
||||
:scroll="{x:true}"
|
||||
</#if>
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
@ -186,7 +202,7 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
@ -198,6 +214,14 @@
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<#if bpm_flag>
|
||||
<a-menu-item v-if="record.bpmStatus === '1'">
|
||||
<a @click="startProcess(record)">发起流程</a>
|
||||
</a-menu-item>
|
||||
</#if>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
@ -210,7 +234,7 @@
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<${entityName?uncap_first}-modal ref="modalForm" @ok="modalFormOk"></${entityName?uncap_first}-modal>
|
||||
<${tableName?replace("_","-")}-modal ref="modalForm" @ok="modalFormOk"></${tableName?replace("_","-")}-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@ -220,6 +244,10 @@
|
||||
import { mixinDevice } from '@/utils/mixin'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
<#if bpm_flag>
|
||||
import { postAction } from '@/api/manage'
|
||||
</#if>
|
||||
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
@ -256,6 +284,9 @@
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
@ -288,6 +319,9 @@
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
JSwitch,
|
||||
</#if>
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
@ -331,6 +365,9 @@
|
||||
<#elseif po.classType=='image'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'imgSlot'}
|
||||
<#elseif po.classType=='switch'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : ''),
|
||||
<#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart' || po.classType=='sel_user'>
|
||||
dataIndex: '${po.fieldName}_dictText'
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
@ -352,7 +389,7 @@
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
<#if tableVo.extendParams.scroll=='1'>
|
||||
// fixed:"right",
|
||||
fixed:"right",
|
||||
width:147,
|
||||
</#if>
|
||||
scopedSlots: { customRender: 'action' }
|
||||
@ -364,18 +401,42 @@
|
||||
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
|
||||
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
|
||||
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
|
||||
<#if bpm_flag>startProcess: '/process/extActProcess/startMutilProcess'</#if>
|
||||
},
|
||||
<#if bpm_flag>
|
||||
//代码生成后需手动设置流程编码
|
||||
flowCode: 'dev_${tableName}_001',
|
||||
</#if>
|
||||
dictOptions:{},
|
||||
<#if list_need_pca>
|
||||
pcaData:''
|
||||
</#if>
|
||||
}
|
||||
},
|
||||
<#if list_need_pca>
|
||||
created() {
|
||||
<#if list_need_pca>
|
||||
this.pcaData = new Area()
|
||||
},
|
||||
</#if>
|
||||
<#if list_need_switch>
|
||||
<#list columns as po>
|
||||
<#if po.classType=='switch'>
|
||||
<#if po.dictField?default("")?trim?length gt 1>
|
||||
<#assign switch_extend_arr=po.dictField?eval>
|
||||
<#else>
|
||||
<#assign switch_extend_arr=['Y','N']>
|
||||
</#if>
|
||||
<#list switch_extend_arr as a>
|
||||
<#if a_index == 0>
|
||||
<#assign switch_extend_arr1=a>
|
||||
<#else>
|
||||
<#assign switch_extend_arr2=a>
|
||||
</#if>
|
||||
</#list>
|
||||
this.$set(this.dictOptions, '${po.fieldName}', [{text:'是',value:'${switch_extend_arr1}'},{text:'否',value:'${switch_extend_arr2}'}])
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
|
||||
@ -387,6 +448,33 @@
|
||||
return this.pcaData.getText(code);
|
||||
},
|
||||
</#if>
|
||||
<#if bpm_flag>
|
||||
startProcess(record){
|
||||
this.$confirm({
|
||||
title:'提示',
|
||||
content:'确认提交流程吗?',
|
||||
onOk:()=>{
|
||||
let params = {
|
||||
flowCode: this.flowCode,
|
||||
id: record.id,
|
||||
formUrl: '${entityPackage}/modules/${entityName}Form',
|
||||
formUrlMobile: ''
|
||||
}
|
||||
postAction(this.url.startProcess, params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message);
|
||||
this.loadData();
|
||||
this.onClearSelected();
|
||||
}else{
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
}).catch((e)=>{
|
||||
this.$message.warning('不识别的请求!');
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
</#if>
|
||||
initDictConfig(){
|
||||
<#list columns as po>
|
||||
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
|
||||
|
||||
@ -0,0 +1,346 @@
|
||||
<#--<#include "../../../../../../../common/utils.ftl">-->
|
||||
<#include "/common/utils.ftl">
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign form_span = 12>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign form_span = 8>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign form_span = 6>
|
||||
</#if>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
|
||||
<a-button @click="submitForm">提 交</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction, getAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}Form",
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props: {
|
||||
//流程表单data
|
||||
formData: {
|
||||
type: Object,
|
||||
default: ()=>{},
|
||||
required: false
|
||||
},
|
||||
//表单模式:false流程表单 true普通表单
|
||||
normal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
},
|
||||
//表单禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||
url: {
|
||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
||||
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formDisabled(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
return this.disabled
|
||||
},
|
||||
showFlowSubmitButton(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
//如果是流程中表单,则需要加载流程表单data
|
||||
this.showFlowData();
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
})
|
||||
},
|
||||
//渲染流程表单数据
|
||||
showFlowData(){
|
||||
if(this.normal === false){
|
||||
let params = {id:this.formData.dataId};
|
||||
getAction(this.url.queryById,params).then((res)=>{
|
||||
if(res.success){
|
||||
this.edit (res.result);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
submitForm () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj)
|
||||
}
|
||||
</#if>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1,226 +1,54 @@
|
||||
<#--<#include "../../../../../../../common/utils.ftl">-->
|
||||
<#include "/common/utils.ftl">
|
||||
<#assign modal_width = 800>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign modal_width = 896>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign modal_width = 1024>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign modal_width = 1280>
|
||||
</#if>
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class:{'jee-hidden': disablesubmit} }"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${tableName?replace("_","-")}-form>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
|
||||
|
||||
import ${entityName}Form from './${entityName}Form'
|
||||
export default {
|
||||
name: "${entityName}Modal",
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
components: {
|
||||
${entityName}Form
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
title:"操作",
|
||||
width:800,
|
||||
title:'',
|
||||
width:${modal_width},
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||
url: {
|
||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
||||
}
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
})
|
||||
},
|
||||
close () {
|
||||
@ -228,50 +56,15 @@
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
this.$refs.realForm.submitForm();
|
||||
},
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj)
|
||||
}
|
||||
</#if>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1,4 +1,12 @@
|
||||
<#include "/common/utils.ftl">
|
||||
<#assign modal_width = 800>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign modal_width = 896>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign modal_width = 1024>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign modal_width = 1280>
|
||||
</#if>
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
@ -7,210 +15,58 @@
|
||||
:closable="false"
|
||||
@close="close"
|
||||
:visible="visible">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField?default("")}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<a-button type="primary" @click="handleOk">确定</a-button>
|
||||
<a-button type="primary" @click="handleCancel">取消</a-button>
|
||||
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${tableName?replace("_","-")}-form>
|
||||
<div class="drawer-footer">
|
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
|
||||
import ${entityName}Form from './${entityName}Form'
|
||||
|
||||
export default {
|
||||
name: "${entityName}Modal",
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
components: {
|
||||
${entityName}Form
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
title:"操作",
|
||||
width:800,
|
||||
width:${modal_width},
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||
url: {
|
||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
||||
}
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model<#list columns as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
})
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
this.$refs.realForm.submitForm();
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -222,4 +78,15 @@
|
||||
margin-bottom: 30px;
|
||||
float: right;
|
||||
}
|
||||
.drawer-footer{
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
||||
@ -45,6 +45,12 @@ import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
<#assign bpm_flag=false>
|
||||
<#list originalColumns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
@ -98,6 +104,9 @@ public class ${entityName}Controller {
|
||||
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
<#if bpm_flag>
|
||||
${entityName?uncap_first}.setBpmStatus("1");
|
||||
</#if>
|
||||
${entityName?uncap_first}Service.saveMain(${entityName?uncap_first}, <#list subTables as sub>${entityName?uncap_first}Page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.util.Date;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -27,6 +28,19 @@ public class ${entityName}Page {
|
||||
|
||||
<#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
|
||||
<#list originalColumns as po>
|
||||
<#-- 生成字典Code -->
|
||||
<#assign list_field_dictCode="">
|
||||
<#if po.classType='sel_user'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
|
||||
<#elseif po.classType='sel_depart'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
|
||||
<#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
|
||||
</#if>
|
||||
</#if>
|
||||
/**${po.filedComment}*/
|
||||
<#if po.fieldName == primaryKeyField>
|
||||
<#else>
|
||||
@ -46,18 +60,21 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
<#else>
|
||||
<#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
|
||||
@Excel(name = "${po.filedComment}", width = 15)
|
||||
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if list_field_dictCode?length gt 1>
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
</#list>
|
||||
|
||||
|
||||
<#list subTables as sub>
|
||||
@ExcelCollection(name="${sub.ftlDescription}")
|
||||
@ApiModelProperty(value = "${sub.ftlDescription}")
|
||||
private List<${sub.entityName}> ${sub.entityName?uncap_first}List;
|
||||
</#list>
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -19,8 +19,13 @@
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#assign query_flag=true>
|
||||
<#if query_field_no==2>
|
||||
@ -159,6 +164,7 @@
|
||||
bordered
|
||||
rowKey="id"
|
||||
class="j-table-force-nowrap"
|
||||
:scroll="{x:true}"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
@ -181,10 +187,15 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
<#if list_need_pca>
|
||||
<template slot="pcaSlot" slot-scope="text">
|
||||
<div>{{ getPcaText(text) }}</div>
|
||||
</template>
|
||||
</#if>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
@ -193,6 +204,14 @@
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<#if bpm_flag>
|
||||
<a-menu-item v-if="record.bpmStatus === '1'">
|
||||
<a @click="startProcess(record)">发起流程</a>
|
||||
</a-menu-item>
|
||||
</#if>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
@ -205,7 +224,7 @@
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<${entityName?uncap_first}-modal ref="modalForm" @ok="modalFormOk"></${entityName?uncap_first}-modal>
|
||||
<${tableName?replace("_","-")}-modal ref="modalForm" @ok="modalFormOk"/>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@ -250,6 +269,9 @@
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
<#if bpm_flag>
|
||||
import { postAction } from '@/api/manage'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
@ -319,6 +341,9 @@
|
||||
<#elseif po.classType=='file'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'fileSlot'}
|
||||
<#elseif po.classType=='pca'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'pcaSlot'}
|
||||
<#elseif po.classType=='image'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'imgSlot'}
|
||||
@ -342,6 +367,7 @@
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
fixed:"right",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
@ -351,16 +377,30 @@
|
||||
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
|
||||
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
|
||||
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
|
||||
<#if bpm_flag>startProcess: '/process/extActProcess/startMutilProcess'</#if>
|
||||
},
|
||||
<#if bpm_flag>
|
||||
flowCode: 'dev_${tableName}_001',
|
||||
</#if>
|
||||
dictOptions:{},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
<#if list_need_pca>
|
||||
this.pcaData = new Area()
|
||||
</#if>
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
<#if list_need_pca>
|
||||
getPcaText(code){
|
||||
return this.pcaData.getText(code);
|
||||
},
|
||||
</#if>
|
||||
initDictConfig(){
|
||||
<#list columns as po>
|
||||
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
|
||||
@ -373,7 +413,34 @@
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
<#if bpm_flag>
|
||||
startProcess(record){
|
||||
this.$confirm({
|
||||
title:'提示',
|
||||
content:'确认提交流程吗?',
|
||||
onOk:()=>{
|
||||
let params = {
|
||||
flowCode: this.flowCode,
|
||||
id: record.id,
|
||||
formUrl: '${entityPackage}/modules/${entityName}Form',
|
||||
formUrlMobile: ''
|
||||
}
|
||||
postAction(this.url.startProcess, params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message);
|
||||
this.loadData();
|
||||
this.onClearSelected();
|
||||
}else{
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
}).catch((e)=>{
|
||||
this.$message.warning('不识别的请求!');
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
</#if>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,534 @@
|
||||
<#include "/common/utils.ftl">
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<!-- 主表单区域 -->
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign form_span = 12>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign form_span = 8>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign form_span = 6>
|
||||
</#if>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<#if po.classType =='textarea'>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<#else>
|
||||
<a-col :span="${form_span}" >
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
<!-- 子表单区域 -->
|
||||
<a-tabs v-model="activeKey" @change="handleChangeTabs">
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
<a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
|
||||
<${Format.humpToShortbar(sub.entityName)}-form ref="${sub.entityName?uncap_first}Form" @validateError="validateError" :disabled="formDisabled"></${Format.humpToShortbar(sub.entityName)}-form>
|
||||
</a-tab-pane>
|
||||
|
||||
<#else>
|
||||
<a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
|
||||
<j-editable-table
|
||||
:ref="refKeys[${sub_index}]"
|
||||
:loading="${sub.entityName?uncap_first}Table.loading"
|
||||
:columns="${sub.entityName?uncap_first}Table.columns"
|
||||
:dataSource="${sub.entityName?uncap_first}Table.dataSource"
|
||||
:maxHeight="300"
|
||||
:disabled="formDisabled"
|
||||
:rowNumber="true"
|
||||
:rowSelection="true"
|
||||
:actionButton="true"/>
|
||||
</a-tab-pane>
|
||||
</#if>
|
||||
</#list>
|
||||
</a-tabs>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import pick from 'lodash.pick'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Form',
|
||||
mixins: [JEditableTableMixin],
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
labelCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 3 },
|
||||
},
|
||||
wrapperCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 20 },
|
||||
},
|
||||
// 新增时子表默认添加几行空数据
|
||||
addDefaultRowNum: 1,
|
||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||
refKeys: [<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>],
|
||||
<#assign hasOne2Many = false>
|
||||
tableKeys:[<#list subTables as sub><#if sub.foreignRelationType =='0'>'${sub.entityName?uncap_first}', <#assign hasOne2Many = true></#if></#list>],
|
||||
activeKey: '${subTables[0].entityName?uncap_first}',
|
||||
<#list subTables as sub><#rt/>
|
||||
// ${sub.ftlDescription}
|
||||
${sub.entityName?uncap_first}Table: {
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
<#assign popupBackFields = "">
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
<#if col.classType =='date'>
|
||||
type: FormTypes.date,
|
||||
<#elseif col.classType =='datetime'>
|
||||
type: FormTypes.datetime,
|
||||
<#elseif "int,decimal,double,"?contains(col.classType)>
|
||||
type: FormTypes.inputNumber,
|
||||
<#elseif col.classType =='list' || col.classType =='radio'>
|
||||
type: FormTypes.select,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='list_multi' || col.classType =='checkbox'>
|
||||
type: FormTypes.list_multi,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='sel_search'>
|
||||
type: FormTypes.sel_search,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='image'>
|
||||
type: FormTypes.image,
|
||||
token:true,
|
||||
responseName:"message",
|
||||
<#elseif col.classType =='file'>
|
||||
type: FormTypes.file,
|
||||
token:true,
|
||||
responseName:"message",
|
||||
<#elseif col.classType =='popup'>
|
||||
<#if popupBackFields?length gt 0>
|
||||
<#assign popupBackFields = "${popupBackFields}"+","+"${col.dictText}">
|
||||
<#else>
|
||||
<#assign popupBackFields = "${col.dictText}">
|
||||
</#if>
|
||||
type: FormTypes.popup,
|
||||
popupCode:"${col.dictTable}",
|
||||
destFields:"${Format.underlineToHump(col.dictText)}",
|
||||
orgFields:"${col.dictField}",
|
||||
<#elseif col.fieldDbType=='int' || col.fieldDbType=='double' || col.fieldDbType=='BigDecimal'>
|
||||
type: FormTypes.inputNumber,
|
||||
<#else>
|
||||
type: FormTypes.input,
|
||||
</#if>
|
||||
<#if col.classType =='list_multi' || col.classType =='checkbox'>
|
||||
width:"250px",
|
||||
<#else>
|
||||
width:"200px",
|
||||
</#if>
|
||||
<#if col.classType =='file'>
|
||||
placeholder: '请选择文件',
|
||||
<#else>
|
||||
placeholder: '请输入${'$'}{title}',
|
||||
</#if>
|
||||
defaultValue: '',
|
||||
<#-- 子表的校验 -->
|
||||
<#assign subFieldValidType = col.fieldValidType!''>
|
||||
<#-- 非空校验 -->
|
||||
<#if col.nullable == 'N' || subFieldValidType == '*'>
|
||||
validateRules: [{ required: true, message: '${'$'}{title}不能为空' }],
|
||||
<#-- 其他情况下,只要有值就被认为是正则校验 -->
|
||||
<#elseif subFieldValidType?length gt 0>
|
||||
<#assign subMessage = '格式不正确'>
|
||||
<#if subFieldValidType == 'only' >
|
||||
<#assign subMessage = '不能重复'>
|
||||
</#if>
|
||||
validateRules: [{ pattern: "${subFieldValidType}", message: "${'$'}{title}${subMessage}" }],
|
||||
</#if>
|
||||
},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 循环子表的列 结束 -->
|
||||
|
||||
<#-- 处理popup的隐藏列 -->
|
||||
<#if popupBackFields?length gt 0>
|
||||
<#list popupBackFields?split(",") as item>
|
||||
<#if item?length gt 0>
|
||||
<#assign tempItemFlag = true>
|
||||
|
||||
<#list sub.colums as col>
|
||||
<#if col.isShow =='Y' && col.fieldName == item>
|
||||
<#assign tempItemFlag = false>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if tempItemFlag>
|
||||
{
|
||||
title: '${item}',
|
||||
key: '${item}',
|
||||
type:"hidden"
|
||||
},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#if>
|
||||
]
|
||||
},
|
||||
</#list>
|
||||
url: {
|
||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
||||
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById",
|
||||
<#list subTables as sub><#rt/>
|
||||
${sub.entityName?uncap_first}: {
|
||||
list: '/${entityPackage}/${entityName?uncap_first}/query${sub.entityName}ByMainId'
|
||||
},
|
||||
</#list>
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
//流程表单data
|
||||
formData: {
|
||||
type: Object,
|
||||
default: ()=>{},
|
||||
required: false
|
||||
},
|
||||
//表单模式:false流程表单 true普通表单
|
||||
normal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
},
|
||||
//表单禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formDisabled(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
return this.disabled
|
||||
},
|
||||
showFlowSubmitButton(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
//如果是流程中表单,则需要加载流程表单data
|
||||
this.showFlowData();
|
||||
},
|
||||
methods: {
|
||||
getAllTable() {
|
||||
<#if hasOne2Many==true>
|
||||
let values = this.tableKeys.map(key => getRefPromise(this, key))
|
||||
return Promise.all(values)
|
||||
<#else>
|
||||
return new Promise(resolve => {
|
||||
resolve([]);
|
||||
})
|
||||
</#if>
|
||||
},
|
||||
/** 调用完edit()方法之后会自动调用此方法 */
|
||||
editAfter() {
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
this.$refs.${sub.entityName?uncap_first}Form.initFormData(this.url.${sub.entityName?uncap_first}.list,this.model.id)
|
||||
</#if>
|
||||
</#list>
|
||||
})
|
||||
// 加载子表数据
|
||||
if (this.model.id) {
|
||||
let params = { id: this.model.id }
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
this.requestSubTableData(this.url.${sub.entityName?uncap_first}.list, params, this.${sub.entityName?uncap_first}Table)
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
/** 整理成formData */
|
||||
classifyIntoFormData(allValues) {
|
||||
let main = Object.assign(this.model, allValues.formValue)
|
||||
return {
|
||||
...main, // 展开
|
||||
<#assign subManyIndex = 0>
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
${sub.entityName?uncap_first}List: allValues.tablesValue[${subManyIndex}].values,
|
||||
<#assign subManyIndex = subManyIndex+1>
|
||||
<#else>
|
||||
${sub.entityName?uncap_first}List: this.$refs.${sub.entityName?uncap_first}Form.getFormData(),
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
//渲染流程表单数据
|
||||
showFlowData(){
|
||||
if(this.normal === false){
|
||||
let params = {id:this.formData.dataId};
|
||||
getAction(this.url.queryById,params).then((res)=>{
|
||||
if(res.success){
|
||||
this.edit (res.result);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
validateError(msg){
|
||||
this.$message.error(msg)
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj)
|
||||
}
|
||||
</#if>
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -5,435 +5,58 @@
|
||||
:width="1200"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
||||
@cancel="handleCancel">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<!-- 主表单区域 -->
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<#if po.classType =='textarea'>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<#else>
|
||||
<a-col :xs="24" :sm="12">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
<!-- 子表单区域 -->
|
||||
<a-tabs v-model="activeKey" @change="handleChangeTabs">
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
<a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
|
||||
<${Format.humpToShortbar(sub.entityName)}-form ref="${sub.entityName?uncap_first}Form" @validateError="validateError"></${Format.humpToShortbar(sub.entityName)}-form>
|
||||
</a-tab-pane>
|
||||
|
||||
<#else>
|
||||
<a-tab-pane tab="${sub.ftlDescription}" :key="refKeys[${sub_index}]" :forceRender="true">
|
||||
<j-editable-table
|
||||
:ref="refKeys[${sub_index}]"
|
||||
:loading="${sub.entityName?uncap_first}Table.loading"
|
||||
:columns="${sub.entityName?uncap_first}Table.columns"
|
||||
:dataSource="${sub.entityName?uncap_first}Table.dataSource"
|
||||
:maxHeight="300"
|
||||
:rowNumber="true"
|
||||
:rowSelection="true"
|
||||
:actionButton="true"/>
|
||||
</a-tab-pane>
|
||||
|
||||
</#if>
|
||||
</#list>
|
||||
</a-tabs>
|
||||
|
||||
</a-spin>
|
||||
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal/>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import pick from 'lodash.pick'
|
||||
import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
import ${entityName}Form from './${entityName}Form'
|
||||
|
||||
export default {
|
||||
name: '${entityName}Modal',
|
||||
mixins: [JEditableTableMixin],
|
||||
components: {
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect
|
||||
</#if>
|
||||
${entityName}Form
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
labelCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 3 },
|
||||
},
|
||||
wrapperCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 20 },
|
||||
},
|
||||
// 新增时子表默认添加几行空数据
|
||||
addDefaultRowNum: 1,
|
||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||
refKeys: [<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>],
|
||||
<#assign hasOne2Many = false>
|
||||
tableKeys:[<#list subTables as sub><#if sub.foreignRelationType =='0'>'${sub.entityName?uncap_first}', <#assign hasOne2Many = true></#if></#list>],
|
||||
activeKey: '${subTables[0].entityName?uncap_first}',
|
||||
<#list subTables as sub><#rt/>
|
||||
// ${sub.ftlDescription}
|
||||
${sub.entityName?uncap_first}Table: {
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
<#assign popupBackFields = "">
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
<#if col.classType =='date'>
|
||||
type: FormTypes.date,
|
||||
<#elseif col.classType =='datetime'>
|
||||
type: FormTypes.datetime,
|
||||
<#elseif "int,decimal,double,"?contains(col.classType)>
|
||||
type: FormTypes.inputNumber,
|
||||
<#elseif col.classType =='list' || col.classType =='radio'>
|
||||
type: FormTypes.select,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='list_multi' || col.classType =='checkbox'>
|
||||
type: FormTypes.list_multi,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='sel_search'>
|
||||
type: FormTypes.sel_search,
|
||||
<#if col.dictTable?default("")?trim?length gt 1>
|
||||
dictCode:"${col.dictTable},${col.dictText},${col.dictField}",
|
||||
<#else>
|
||||
dictCode:"${col.dictField}",
|
||||
</#if>
|
||||
<#elseif col.classType =='image'>
|
||||
type: FormTypes.image,
|
||||
token:true,
|
||||
responseName:"message",
|
||||
<#elseif col.classType =='file'>
|
||||
type: FormTypes.file,
|
||||
token:true,
|
||||
responseName:"message",
|
||||
<#elseif col.classType =='popup'>
|
||||
<#if popupBackFields?length gt 0>
|
||||
<#assign popupBackFields = "${popupBackFields}"+","+"${col.dictText}">
|
||||
<#else>
|
||||
<#assign popupBackFields = "${col.dictText}">
|
||||
</#if>
|
||||
type: FormTypes.popup,
|
||||
popupCode:"${col.dictTable}",
|
||||
destFields:"${Format.underlineToHump(col.dictText)}",
|
||||
orgFields:"${col.dictField}",
|
||||
<#else>
|
||||
type: FormTypes.input,
|
||||
</#if>
|
||||
<#if col.classType =='list_multi' || col.classType =='checkbox'>
|
||||
width:"250px",
|
||||
<#else>
|
||||
width:"200px",
|
||||
</#if>
|
||||
<#if col.classType =='file'>
|
||||
placeholder: '请选择文件',
|
||||
<#else>
|
||||
placeholder: '请输入${'$'}{title}',
|
||||
</#if>
|
||||
defaultValue: '',
|
||||
<#-- 子表的校验 -->
|
||||
<#assign subFieldValidType = col.fieldValidType!''>
|
||||
<#-- 非空校验 -->
|
||||
<#if col.nullable == 'N' || subFieldValidType == '*'>
|
||||
validateRules: [{ required: true, message: '${'$'}{title}不能为空' }],
|
||||
<#-- 其他情况下,只要有值就被认为是正则校验 -->
|
||||
<#elseif subFieldValidType?length gt 0>
|
||||
<#assign subMessage = '格式不正确'>
|
||||
<#if subFieldValidType == 'only' >
|
||||
<#assign subMessage = '不能重复'>
|
||||
</#if>
|
||||
validateRules: [{ pattern: "${subFieldValidType}", message: "${'$'}{title}${subMessage}" }],
|
||||
</#if>
|
||||
},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 循环子表的列 结束 -->
|
||||
|
||||
<#-- 处理popup的隐藏列 -->
|
||||
<#if popupBackFields?length gt 0>
|
||||
<#list popupBackFields?split(",") as item>
|
||||
<#if item?length gt 0>
|
||||
<#assign tempItemFlag = true>
|
||||
|
||||
<#list sub.colums as col>
|
||||
<#if col.isShow =='Y' && col.fieldName == item>
|
||||
<#assign tempItemFlag = false>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if tempItemFlag>
|
||||
{
|
||||
title: '${item}',
|
||||
key: '${item}',
|
||||
type:"hidden"
|
||||
},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#if>
|
||||
]
|
||||
},
|
||||
</#list>
|
||||
url: {
|
||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
||||
<#list subTables as sub><#rt/>
|
||||
${sub.entityName?uncap_first}: {
|
||||
list: '/${entityPackage}/${entityName?uncap_first}/query${sub.entityName}ByMainId'
|
||||
},
|
||||
</#list>
|
||||
}
|
||||
title:'',
|
||||
width:800,
|
||||
visible: false,
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAllTable() {
|
||||
<#if hasOne2Many==true>
|
||||
let values = this.tableKeys.map(key => getRefPromise(this, key))
|
||||
return Promise.all(values)
|
||||
<#else>
|
||||
return new Promise(resolve => {
|
||||
resolve([]);
|
||||
methods:{
|
||||
add () {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
</#if>
|
||||
},
|
||||
/** 调用完edit()方法之后会自动调用此方法 */
|
||||
editAfter() {
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
this.$refs.${sub.entityName?uncap_first}Form.initFormData(this.url.${sub.entityName?uncap_first}.list,this.model.id)
|
||||
</#if>
|
||||
</#list>
|
||||
edit (record) {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
})
|
||||
// 加载子表数据
|
||||
if (this.model.id) {
|
||||
let params = { id: this.model.id }
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
this.requestSubTableData(this.url.${sub.entityName?uncap_first}.list, params, this.${sub.entityName?uncap_first}Table)
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
/** 整理成formData */
|
||||
classifyIntoFormData(allValues) {
|
||||
let main = Object.assign(this.model, allValues.formValue)
|
||||
return {
|
||||
...main, // 展开
|
||||
<#assign subManyIndex = 0>
|
||||
<#list subTables as sub><#rt/>
|
||||
<#if sub.foreignRelationType =='0'>
|
||||
${sub.entityName?uncap_first}List: allValues.tablesValue[${subManyIndex}].values,
|
||||
<#assign subManyIndex = subManyIndex+1>
|
||||
<#else>
|
||||
${sub.entityName?uncap_first}List: this.$refs.${sub.entityName?uncap_first}Form.getFormData(),
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
validateError(msg){
|
||||
this.$message.error(msg)
|
||||
handleOk () {
|
||||
this.$refs.realForm.handleOk();
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj)
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
</#if>
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -3,20 +3,34 @@
|
||||
<#if sub.foreignRelationType=='1'>
|
||||
#segment#${sub.entityName}Form.vue
|
||||
<template>
|
||||
<div>
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<j-form-container :disabled="disabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum == 2>
|
||||
<#assign form_span = 12>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign form_span = 8>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign form_span = 6>
|
||||
</#if>
|
||||
<#list sub.colums as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -24,64 +38,95 @@
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<#if po.classType =='textarea'>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<#else>
|
||||
<a-col :xs="24" :sm="12">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
</#list>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
@ -103,10 +148,29 @@
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${sub.entityName}Form',
|
||||
components: {
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
@ -128,6 +192,31 @@
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props:{
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -204,8 +293,12 @@
|
||||
clearFormData(){
|
||||
this.form.resetFields()
|
||||
this.model={}
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj);
|
||||
}
|
||||
|
||||
</#if>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -97,9 +97,35 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},HttpServletRequest req) {
|
||||
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
|
||||
List<${entityName}> list = ${entityName?uncap_first}Service.list(queryWrapper);
|
||||
return Result.ok(list);
|
||||
IPage<LvTestTree> pageList = new Page<>(1, 10, list.size());
|
||||
pageList.setRecords(list);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量查询子节点
|
||||
* @param parentIds 父ID(多个采用半角逗号分割)
|
||||
* @return 返回 IPage
|
||||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量获取子数据")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量获取子数据", notes="${tableVo.ftlDescription}-批量获取子数据")
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
QueryWrapper<${entityName}> queryWrapper = new QueryWrapper<>();
|
||||
List<String> parentIdList = Arrays.asList(parentIds.split(","));
|
||||
queryWrapper.in("${Format.humpToUnderline(pidFieldName)}", parentIdList);
|
||||
List<${entityName}> list = ${entityName?uncap_first}Service.list(queryWrapper);
|
||||
IPage<${entityName}> pageList = new Page<>(1, 10, list.size());
|
||||
pageList.setRecords(list);
|
||||
return Result.ok(pageList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("批量查询子节点失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
||||
@ -10,7 +10,150 @@
|
||||
</#list>
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign query_switch=false>
|
||||
<#assign list_need_switch=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#assign query_flag=true>
|
||||
<#if query_field_no==2>
|
||||
<template v-if="toggleSearchStatus">
|
||||
</#if>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign query_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign query_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<#if po.queryMode=='single'>
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='switch'>
|
||||
<#assign query_switch=true>
|
||||
<#if query_field_no gt 1> </#if><j-switch placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> query></j-switch>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictField}"/>
|
||||
<#else>
|
||||
<#if query_field_no gt 1> </#if><a-input placeholder="请输入${po.filedComment}" v-model="queryParam.${po.fieldName}"></a-input>
|
||||
</#if>
|
||||
<#else>
|
||||
<#if query_field_no gt 1> </#if><a-input placeholder="请输入${po.filedComment}" v-model="queryParam.${po.fieldName}"></a-input>
|
||||
</#if>
|
||||
<#if query_field_no gt 1> </#if></a-form-item>
|
||||
<#if query_field_no gt 1> </#if></a-col>
|
||||
<#else>
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#else>
|
||||
<#if query_field_no gt 1> </#if><a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></a-input>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></a-input>
|
||||
</#if>
|
||||
<#if query_field_no gt 1> </#if></a-form-item>
|
||||
<#if query_field_no gt 1> </#if></a-col>
|
||||
</#if>
|
||||
<#assign query_field_no=query_field_no+1>
|
||||
</#if>
|
||||
<#if !list_need_dict && po.fieldShowType!='popup' && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign list_need_dict=true>
|
||||
</#if>
|
||||
<#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
|
||||
<#assign list_need_category=true>
|
||||
</#if>
|
||||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='switch'>
|
||||
<#assign list_need_switch=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<#t>
|
||||
<#if query_field_no gt 2>
|
||||
</template>
|
||||
</#if>
|
||||
<#if query_flag>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</span>
|
||||
</a-col>
|
||||
</#if>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 查询区域-END -->
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
@ -45,7 +188,7 @@
|
||||
@change="handleTableChange"
|
||||
@expand="handleExpand"
|
||||
v-bind="tableProps">
|
||||
|
||||
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||
@ -58,7 +201,7 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
@ -95,11 +238,78 @@
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
|
||||
import { filterObj } from '@/utils/util';
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
JSwitch,
|
||||
</#if>
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
@ -152,6 +362,7 @@
|
||||
url: {
|
||||
list: "/${entityPackage}/${entityName?uncap_first}/rootList",
|
||||
childList: "/${entityPackage}/${entityName?uncap_first}/childList",
|
||||
getChildListBatch: "/${entityPackage}/${entityName?uncap_first}/getChildListBatch",
|
||||
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
|
||||
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
|
||||
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
|
||||
@ -185,36 +396,95 @@
|
||||
this.ipagination.current=1
|
||||
}
|
||||
this.loading = true
|
||||
this.expandedRowKeys = []
|
||||
let params = this.getQueryParams()
|
||||
return new Promise((resolve) => {
|
||||
getAction(this.url.list,params).then(res=>{
|
||||
if(res.success){
|
||||
let result = res.result
|
||||
if(Number(result.total)>0){
|
||||
this.ipagination.total = Number(result.total)
|
||||
this.dataSource = this.getDataByResult(res.result.records)
|
||||
resolve()
|
||||
}else{
|
||||
this.ipagination.total=0
|
||||
this.dataSource=[]
|
||||
}
|
||||
getAction(this.url.list,params).then(res=>{
|
||||
if(res.success){
|
||||
let result = res.result
|
||||
if(Number(result.total)>0){
|
||||
this.ipagination.total = Number(result.total)
|
||||
this.dataSource = this.getDataByResult(res.result.records)
|
||||
return this.loadDataByExpandedRows(this.dataSource)
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
this.ipagination.total=0
|
||||
this.dataSource=[]
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
|
||||
loadDataByExpandedRows(dataList) {
|
||||
if (this.expandedRowKeys.length > 0) {
|
||||
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
|
||||
if (res.success && res.result.records.length>0) {
|
||||
//已展开的数据批量子节点
|
||||
let records = res.result.records
|
||||
const listMap = new Map();
|
||||
for (let item of records) {
|
||||
let pid = item.pid;
|
||||
if (this.expandedRowKeys.join(',').includes(pid)) {
|
||||
let mapList = listMap.get(pid);
|
||||
if (mapList == null) {
|
||||
mapList = [];
|
||||
}
|
||||
mapList.push(item);
|
||||
listMap.set(pid, mapList);
|
||||
}
|
||||
}
|
||||
let childrenMap = listMap;
|
||||
let fn = (list) => {
|
||||
list.forEach(data => {
|
||||
if (this.expandedRowKeys.includes(data.id)) {
|
||||
data.children = this.getDataByResult(childrenMap.get(data.id))
|
||||
fn(data.children)
|
||||
}
|
||||
})
|
||||
}
|
||||
fn(dataList)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return Promise.resolve()
|
||||
}
|
||||
},
|
||||
getQueryParams(arg) {
|
||||
//获取查询条件
|
||||
let sqp = {}
|
||||
let param = {}
|
||||
if(this.superQueryParams){
|
||||
sqp['superQueryParams']=encodeURI(this.superQueryParams)
|
||||
sqp['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
if(arg){
|
||||
param = Object.assign(sqp, this.isorter ,this.filters);
|
||||
}else{
|
||||
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
|
||||
}
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
return filterObj(param);
|
||||
},
|
||||
searchReset() {
|
||||
//重置
|
||||
this.expandedRowKeys = []
|
||||
this.queryParam = {}
|
||||
this.loadData(1);
|
||||
},
|
||||
getDataByResult(result){
|
||||
return result.map(item=>{
|
||||
//判断是否标记了带有子节点
|
||||
if(item[this.hasChildrenField]=='1'){
|
||||
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
|
||||
item.children = [loadChild]
|
||||
}
|
||||
return item
|
||||
})
|
||||
if(result){
|
||||
return result.map(item=>{
|
||||
//判断是否标记了带有子节点
|
||||
if(item[this.hasChildrenField]=='1'){
|
||||
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
|
||||
item.children = [loadChild]
|
||||
}
|
||||
return item
|
||||
})
|
||||
}
|
||||
},
|
||||
handleExpand(expanded, record){
|
||||
// 判断是否是展开状态
|
||||
@ -225,8 +495,8 @@
|
||||
params[this.pidField] = record.id
|
||||
getAction(this.url.childList,params).then((res)=>{
|
||||
if(res.success){
|
||||
if(res.result && res.result.length>0){
|
||||
record.children = this.getDataByResult(res.result)
|
||||
if(res.result.records){
|
||||
record.children = this.getDataByResult(res.result.records)
|
||||
this.dataSource = [...this.dataSource]
|
||||
}else{
|
||||
record.children=''
|
||||
@ -244,84 +514,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
initDictConfig(){
|
||||
<#list columns as po>
|
||||
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
|
||||
</#if>
|
||||
</#list>
|
||||
},
|
||||
modalFormOk(formData,arr){
|
||||
if(!formData.id){
|
||||
this.addOk(formData,arr)
|
||||
}else{
|
||||
if(!arr){
|
||||
this.loadData()
|
||||
}else{
|
||||
this.editOk(formData,this.dataSource)
|
||||
this.dataSource=[...this.dataSource]
|
||||
}
|
||||
}
|
||||
},
|
||||
editOk(formData,arr){
|
||||
if(arr && arr.length>0){
|
||||
for(let i=0;i<arr.length;i++){
|
||||
if(arr[i].id==formData.id){
|
||||
arr[i]=formData
|
||||
break
|
||||
}else{
|
||||
this.editOk(formData,arr[i].children)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async addOk(formData,arr){
|
||||
if(!formData[this.pidField]){
|
||||
this.loadData()
|
||||
}else{
|
||||
if(this.loadParent===true){
|
||||
this.expandTreeNode(formData[this.pidField])
|
||||
this.loadParent = false
|
||||
}else{
|
||||
this.expandedRowKeys=[]
|
||||
for(let i of arr){
|
||||
await this.expandTreeNode(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
expandTreeNode(nodeId){
|
||||
return new Promise((resolve,reject)=>{
|
||||
this.getFormDataById(nodeId,this.dataSource)
|
||||
let row = this.parentFormData
|
||||
this.expandedRowKeys.push(nodeId)
|
||||
let params = this.getQueryParams();//查询条件
|
||||
params[this.pidField] = nodeId
|
||||
getAction(this.url.childList,params).then((res)=>{
|
||||
if(res.success){
|
||||
if(res.result && res.result.length>0){
|
||||
row.children = this.getDataByResult(res.result)
|
||||
}else{
|
||||
row.children=''
|
||||
}
|
||||
this.dataSource = [...this.dataSource]
|
||||
resolve()
|
||||
}else{
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
getFormDataById(id,arr){
|
||||
if(arr && arr.length>0){
|
||||
for(let i=0;i<arr.length;i++){
|
||||
if(arr[i].id==id){
|
||||
this.parentFormData = arr[i]
|
||||
}else{
|
||||
this.getFormDataById(id,arr[i].children)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAddChild(record){
|
||||
this.loadParent = true
|
||||
let obj = {}
|
||||
@ -336,12 +528,7 @@
|
||||
var that = this;
|
||||
deleteAction(that.url.delete, {id: record.id}).then((res) => {
|
||||
if (res.success) {
|
||||
if(!record[this.pidField] || record[this.pidField] =='0' || record[this.pidField].length==0){
|
||||
that.loadData(1)
|
||||
}else{
|
||||
that.$message.success(res.message);
|
||||
that.expandTreeNode(record[this.pidField]);
|
||||
}
|
||||
that.loadData(1)
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.submitSuccess(formData,old_pid==new_pid)
|
||||
this.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -26,6 +27,19 @@ public class ${entityName} implements Serializable {
|
||||
|
||||
<#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
|
||||
<#list originalColumns as po>
|
||||
<#-- 生成字典Code -->
|
||||
<#assign list_field_dictCode="">
|
||||
<#if po.classType='sel_user'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
|
||||
<#elseif po.classType='sel_depart'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
|
||||
<#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
|
||||
</#if>
|
||||
</#if>
|
||||
/**${po.filedComment}*/
|
||||
<#if po.fieldName == primaryKeyField>
|
||||
@TableId(type = IdType.ID_WORKER_STR)
|
||||
@ -46,9 +60,12 @@ public class ${entityName} implements Serializable {
|
||||
</#if>
|
||||
<#else>
|
||||
<#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
|
||||
@Excel(name = "${po.filedComment}", width = 15)
|
||||
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if list_field_dictCode?length gt 1>
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
@ -153,6 +153,7 @@
|
||||
bordered
|
||||
rowKey="id"
|
||||
class="j-table-force-nowrap"
|
||||
:scroll="{x:true}"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
@ -176,10 +177,15 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
<#if list_need_pca>
|
||||
<template slot="pcaSlot" slot-scope="text">
|
||||
<div>{{ getPcaText(text) }}</div>
|
||||
</template>
|
||||
</#if>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
@ -318,6 +324,9 @@
|
||||
<#elseif po.classType=='umeditor'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'htmlSlot'}
|
||||
<#elseif po.classType=='pca'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'pcaSlot'}
|
||||
<#elseif po.classType=='file'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'fileSlot'}
|
||||
@ -356,6 +365,8 @@
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
fixed:"right",
|
||||
width:147,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
@ -391,12 +402,22 @@
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
<#if list_need_pca>
|
||||
this.pcaData = new Area()
|
||||
</#if>
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
<#if list_need_pca>
|
||||
getPcaText(code){
|
||||
return this.pcaData.getText(code);
|
||||
},
|
||||
</#if>
|
||||
initDictConfig(){
|
||||
<#list columns as po>
|
||||
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:scroll="{x:true}"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
@ -57,7 +58,7 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
@click="downloadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
@ -161,6 +162,8 @@
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
fixed:"right",
|
||||
width:147,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
@ -23,79 +24,95 @@
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>pcode="${po.dictField}"<#else>pcode="0"</#if> placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
@ -136,6 +153,15 @@
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}Modal",
|
||||
@ -167,8 +193,17 @@
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data () {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
@ -25,79 +26,95 @@
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list sub.originalColumns as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>pcode="${po.dictField}"<#else>pcode="0"</#if> placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
@ -138,6 +155,15 @@
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${sub.entityName}Modal",
|
||||
@ -169,8 +195,17 @@
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props:{
|
||||
|
||||
@ -12,6 +12,7 @@ import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.util.Date;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -27,6 +28,19 @@ public class ${entityName}Page {
|
||||
|
||||
<#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
|
||||
<#list originalColumns as po>
|
||||
<#-- 生成字典Code -->
|
||||
<#assign list_field_dictCode="">
|
||||
<#if po.classType='sel_user'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
|
||||
<#elseif po.classType='sel_depart'>
|
||||
<#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
|
||||
<#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
|
||||
</#if>
|
||||
</#if>
|
||||
/**${po.filedComment}*/
|
||||
<#if po.fieldName == primaryKeyField>
|
||||
<#else>
|
||||
@ -46,8 +60,11 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
<#else>
|
||||
<#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
|
||||
@Excel(name = "${po.filedComment}", width = 15)
|
||||
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
|
||||
</#if>
|
||||
<#if list_field_dictCode?length gt 1>
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
|
||||
@ -157,6 +157,7 @@
|
||||
bordered
|
||||
rowKey="id"
|
||||
class="j-table-force-nowrap"
|
||||
:scroll="{x:true}"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
@ -199,7 +200,7 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)"
|
||||
@click="downloadFile(text)"
|
||||
>
|
||||
<span>下载</span>
|
||||
</a-button>
|
||||
@ -323,12 +324,14 @@
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed:"right",
|
||||
width:147,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
},
|
||||
],
|
||||
// 字典选项
|
||||
dictOptions: {},
|
||||
// 展开的行
|
||||
// 展开的行test
|
||||
expandedRowKeys: [],
|
||||
<#assign urlPrefix="/${entityPackage}/${entityName?uncap_first}">
|
||||
url: {
|
||||
|
||||
@ -25,9 +25,12 @@
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -53,15 +56,26 @@
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${po.dictText}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
@ -178,6 +192,15 @@
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Modal',
|
||||
@ -215,8 +238,17 @@
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)"
|
||||
@click="downloadFile(text)"
|
||||
>
|
||||
<span>下载</span>
|
||||
</a-button>
|
||||
|
||||
Reference in New Issue
Block a user