Commit 5e3804c4 authored by 赵啸非's avatar 赵啸非

修改树表页面

parent ae366943
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>大英交易平台</title> <title>工程代码构建平台</title>
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/index.css"> <link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/index.css">
</head> </head>
<body> <body>
......
...@@ -17,8 +17,8 @@ export const type = (data) => { ...@@ -17,8 +17,8 @@ export const type = (data) => {
/** /**
* 获取登录状态 * 获取登录状态
* *
* @returns * @returns
*/ */
export const getLoginStatus = () => { export const getLoginStatus = () => {
return window.sessionStorage.isLogin; return window.sessionStorage.isLogin;
...@@ -35,7 +35,7 @@ export const query = () => { ...@@ -35,7 +35,7 @@ export const query = () => {
/** /**
* 编码url参数 * 编码url参数
* *
* @param {object} data 参数对象 * @param {object} data 参数对象
* @returns string * @returns string
...@@ -91,12 +91,12 @@ export function formatterDateDay(datetime) { ...@@ -91,12 +91,12 @@ export function formatterDateDay(datetime) {
}; };
/** /**
* 当前日期加天数后得到的相应日期 * 当前日期加天数后得到的相应日期
* @param {*} day * @param {*} day
*/ */
export function getAddDay(day){ export function getAddDay(day){
var today = new Date(); var today = new Date();
var targetday_milliseconds=today.getTime() + 1000*60*60*24*day; var targetday_milliseconds=today.getTime() + 1000*60*60*24*day;
today.setTime(targetday_milliseconds); today.setTime(targetday_milliseconds);
var tYear = today.getFullYear(); var tYear = today.getFullYear();
var tMonth = today.getMonth(); var tMonth = today.getMonth();
var tDate = today.getDate(); var tDate = today.getDate();
...@@ -330,7 +330,7 @@ export async function getUserListByQuery(query) { ...@@ -330,7 +330,7 @@ export async function getUserListByQuery(query) {
//对源数据深度克隆 //对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data)) const cloneData = JSON.parse(JSON.stringify(data))
//循环所有项 //循环所有项
console.log("11111",cloneData) //console.log("11111",cloneData)
const treeData = cloneData.filter(father => { const treeData = cloneData.filter(father => {
let branchArr = cloneData.filter(child => { let branchArr = cloneData.filter(child => {
//返回每一项的子级数组 //返回每一项的子级数组
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<el-form-item label="密码"> <el-form-item label="密码">
<el-input v-model="form.password" type='password'></el-input> <el-input v-model="form.password" type='password'></el-input>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <!-- <el-form-item label="验证码">
<el-input v-model="form.securityCode"> <el-input v-model="form.securityCode">
<img slot="append" width='60' height="30" :src='securityCodeUrl' @click='refreshCode'/> <img slot="append" width='60' height="30" :src='securityCodeUrl' @click='refreshCode'/>
</el-input> </el-input>
</el-form-item> </el-form-item>-->
<el-form-item size="large"> <el-form-item size="large">
<el-button type="primary" native-type='submit' :loading='loading' @click='onSubmit'>登录</el-button> <el-button type="primary" native-type='submit' :loading='loading' @click='onSubmit'>登录</el-button>
</el-form-item> </el-form-item>
...@@ -36,8 +36,7 @@ const securityCodeUrl = '/m/securitycode/createCode?v='; ...@@ -36,8 +36,7 @@ const securityCodeUrl = '/m/securitycode/createCode?v=';
export default { export default {
name: 'login', name: 'login',
created() { created() {
console.log(11111) //this.refreshCode()
this.refreshCode()
}, },
methods: { methods: {
...@@ -57,13 +56,13 @@ this.refreshCode() ...@@ -57,13 +56,13 @@ this.refreshCode()
}, },
loginFail(error) { loginFail(error) {
this.loading = false; this.loading = false;
this.refreshCode(); //this.refreshCode();
this.$message.error(error.message); this.$message.error(error.message);
}, },
refreshCode() { // refreshCode() {
this.form.securityCode = ''; // this.form.securityCode = '';
this.securityCodeUrl = securityCodeUrl + Math.random(); // this.securityCodeUrl = securityCodeUrl + Math.random();
}, // },
onSubmit(e) { onSubmit(e) {
e.preventDefault(); e.preventDefault();
...@@ -73,9 +72,9 @@ this.refreshCode() ...@@ -73,9 +72,9 @@ this.refreshCode()
if(!this.form.password.length){ if(!this.form.password.length){
return this.$message.warning('请输入密码') return this.$message.warning('请输入密码')
} }
if(!this.form.securityCode.length){ // if(!this.form.securityCode.length){
return this.$message.warning('请输入验证码') // return this.$message.warning('请输入验证码')
} // }
this.login(); this.login();
}, },
}, },
...@@ -83,11 +82,11 @@ this.refreshCode() ...@@ -83,11 +82,11 @@ this.refreshCode()
return { return {
loading: false, loading: false,
redirect: this.$route.query.redirect || '/', redirect: this.$route.query.redirect || '/',
securityCodeUrl: securityCodeUrl, /// securityCodeUrl: securityCodeUrl,
form: { form: {
loginName: '', loginName: '',
password: '', password: '',
securityCode: '', // securityCode: '',
} }
} }
} }
......
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
// 选中选项卡的 name // 选中选项卡的 name
activeName: "cloum", activeName: "cloum",
// 表格的高度 // 表格的高度
tableHeight: 500 + "px", tableHeight: 700 + "px",
// 表信息 // 表信息
tables: [], tables: [],
// 表列信息 // 表列信息
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
const tableId = this.$route.query && this.$route.query.tableId; const tableId = this.$route.query && this.$route.query.tableId;
const appId = this.$route.query && this.$route.query.appId; const appId = this.$route.query && this.$route.query.appId;
console.log("tableId", tableId); console.log("tableId", tableId);
if (tableId) { if (tableId) {
...@@ -260,7 +260,6 @@ export default { ...@@ -260,7 +260,6 @@ export default {
this.data = this.rule2; this.data = this.rule2;
}, },
methods: { methods: {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm; const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
......
...@@ -50,12 +50,12 @@ export default { ...@@ -50,12 +50,12 @@ export default {
// 操作菜单状态 // 操作菜单状态
changeStatus(row, column) { changeStatus(row, column) {
return ( return (
<my-switch <my-switch
confirm confirm
url='/menu/save' url='/menu/save'
row={row} row={row}
onChange={this.statusChange} onChange={this.statusChange}
value={this.tableData.result} value={this.tableData.result}
onInput={(data)=>{ onInput={(data)=>{
this.tableData.result = data; this.tableData.result = data;
}}/> }}/>
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
{ {
prop: 'id', prop: 'id',
label: 'ID', label: 'ID',
width: 60, width: 240,
}, },
{ {
prop: 'name', prop: 'name',
......
...@@ -20,7 +20,7 @@ module.exports = { ...@@ -20,7 +20,7 @@ module.exports = {
target: 'http://127.0.0.1:17311', target: 'http://127.0.0.1:17311',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
cookieDomainRewrite: 'plm.testnew.com', cookieDomainRewrite: 'localhost',
} }
} }
} }
......
...@@ -65,7 +65,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor ...@@ -65,7 +65,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
String securityCode = loginForm.getSecurityCode(); // String securityCode = loginForm.getSecurityCode();
String ip = super.getRequestIP(request); String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) { if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
...@@ -74,14 +74,14 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor ...@@ -74,14 +74,14 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
} }
UserEntity userEntity = null; UserEntity userEntity = null;
try { try {
loginForm.validate(); // loginForm.validate();
boolean result = validCodeService.doCheckImageValidCode(request.getSession().getId(), ip, securityCode); // boolean result = validCodeService.doCheckImageValidCode(request.getSession().getId(), ip, securityCode);
if (!result) { // if (!result) {
recordSysLog(request, userEntity, "登录验证码不正确或已过期!"); // recordSysLog(request, userEntity, "登录验证码不正确或已过期!");
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); // ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "登录验证码不正确或已过期!"); // ret.put(KEY_RESULT_MSG, "登录验证码不正确或已过期!");
return ret.toJSONString(); // return ret.toJSONString();
} // }
userEntity = userService.doLogin(loginName, password, ip); userEntity = userService.doLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip); userEntity.setLastLoginAddress(ip);
saveCurrUser(request, response, userEntity); saveCurrUser(request, response, userEntity);
......
...@@ -242,11 +242,24 @@ public class FreeMarkerUtils { ...@@ -242,11 +242,24 @@ public class FreeMarkerUtils {
String treeCode = getTreecode(paramsObj); String treeCode = getTreecode(paramsObj);
String treeParentCode = getTreeParentCode(paramsObj); String treeParentCode = getTreeParentCode(paramsObj);
//获取树编码父节点类型 todo
String treeParentCodeType ="String";
List<GentableColumnEntity> columns = genTable.getColumns();
for (GentableColumnEntity column : columns) {
if(treeParentCode.equals(column.getColumnName())){
treeParentCodeType=column.getJavaType();
break;
}
}
//树名称 //树名称
String treeName = getTreeName(paramsObj); String treeName = getTreeName(paramsObj);
data.put("treeCode", treeCode); data.put("treeCode", treeCode);
data.put("treeParentCode", treeParentCode); data.put("treeParentCode", treeParentCode);
data.put("treeParentCodeType", treeParentCodeType);
data.put("treeName", treeName); data.put("treeName", treeName);
data.put("expandColumn", getExpandColumn(genTable)); data.put("expandColumn", getExpandColumn(genTable));
......
...@@ -107,17 +107,17 @@ public class GenUtils { ...@@ -107,17 +107,17 @@ public class GenUtils {
} }
} }
// 查询字段 // 查询字段
if (ObjectUtils.isEmpty(column.getIsQuery())) { /* if (ObjectUtils.isEmpty(column.getIsQuery())) {
if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && column.getIsPrimaryKey() != YesNo.YES.getValue()) { if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && column.getIsPrimaryKey() != YesNo.YES.getValue()) {
column.setIsQuery(GenConstants.REQUIRE); column.setIsQuery(GenConstants.REQUIRE);
} else { } else {
column.setIsQuery(GenConstants.NOREQUIRE); column.setIsQuery(GenConstants.NOREQUIRE);
} }
} }*/
//默认都是否 //默认都是否
//column.setIsList(GenConstants.NOREQUIRE); //column.setIsList(GenConstants.NOREQUIRE);
//column.setIsQuery(GenConstants.NOREQUIRE); column.setIsQuery(GenConstants.NOREQUIRE);
//拆解枚举类,格式必须为(1.啊啊啊,2.不不不) //拆解枚举类,格式必须为(1.啊啊啊,2.不不不)
String temp = column.getColumnComment().replaceAll("(", "(").replaceAll(")", ")"); String temp = column.getColumnComment().replaceAll("(", "(").replaceAll(")", ")");
......
...@@ -56,5 +56,5 @@ public interface ${ClassName}Service extends ${Service}<${ClassName}Entity,${pkC ...@@ -56,5 +56,5 @@ public interface ${ClassName}Service extends ${Service}<${ClassName}Entity,${pkC
* @param context * @param context
* @return * @return
*/ */
List<${ClassName}TreeSelect> getListByParentId(String parentId,Context context); List<${ClassName}TreeSelect> getListByParentId(${treeParentCodeType} parentId,Context context);
} }
\ No newline at end of file
...@@ -199,12 +199,12 @@ public class ${ClassName}ServiceImpl extends ${Service}<${ClassName}Dao, ${Class ...@@ -199,12 +199,12 @@ public class ${ClassName}ServiceImpl extends ${Service}<${ClassName}Dao, ${Class
} }
@Override @Override
public List<${ClassName}TreeSelect> getListByParentId(String parentId, Context context) { public List<${ClassName}TreeSelect> getListByParentId(${treeParentCodeType} parentId, Context context) {
if (ObjectUtils.isEmpty(parentId)) { if (ObjectUtils.isEmpty(parentId)) {
parentId = "0"; parentId = "0";
} }
//只做一层 //只做一层
List<${ClassName}TreeSelect> collect = this.find(new ${ClassName}Query().${treeParentCode?cap_first}(parentId), context).stream().map(item -> new ${ClassName}TreeSelect(item) List<${ClassName}TreeSelect> collect = this.find(new ${ClassName}Query().${treeParentCode}(parentId), context).stream().map(item -> new ${ClassName}TreeSelect(item)
).collect(Collectors.toList()); ).collect(Collectors.toList());
if ("0".equals(parentId)) { if ("0".equals(parentId)) {
return collect; return collect;
......
...@@ -28,12 +28,14 @@ import com.mortals.framework.model.${Entity}; ...@@ -28,12 +28,14 @@ import com.mortals.framework.model.${Entity};
import ${packageName}.model.${ClassName}Entity; import ${packageName}.model.${ClassName}Entity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import lombok.Data;
/** /**
* ${functionName}视图对象 * ${functionName}视图对象
* *
* @author ${author} * @author ${author}
* @date ${datetime} * @date ${datetime}
*/ */
@Data
public class ${ClassName}Vo extends ${Entity} { public class ${ClassName}Vo extends ${Entity} {
<#if table.tplCategory=="tree" > <#if table.tplCategory=="tree" >
......
...@@ -12,6 +12,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; ...@@ -12,6 +12,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import ${packageName}.model.${ClassName}Entity; import ${packageName}.model.${ClassName}Entity;
import ${packageName}.service.${ClassName}Service; import ${packageName}.service.${ClassName}Service;
<#if table.tplCategory=="tree"> <#if table.tplCategory=="tree">
import ${packageName}.model.${ClassName}Query;
import ${packageName}.model.${ClassName}TreeSelect; import ${packageName}.model.${ClassName}TreeSelect;
</#if> </#if>
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
...@@ -55,17 +56,17 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${ ...@@ -55,17 +56,17 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${
<#if table.tplCategory=="tree"> <#if table.tplCategory=="tree">
@PostMapping("list/exclude") @PostMapping("list/exclude")
public String excludeList(${ClassName}Form form) { public String excludeList(${ClassName}Entity query) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String busiDesc = "查询" + this.getModuleDesc(); String busiDesc = "查询" + this.getModuleDesc();
Long id = form.getId()[0]; ${pkColumn.javaType} id = query.get${pkColumn.javaField?cap_first}();
int code=VALUE_RESULT_SUCCESS; int code=VALUE_RESULT_SUCCESS;
try { try {
Set<${pkColumn.javaType}> idSet = new HashSet<>();
idSet.add(query.get${pkColumn.javaField?cap_first}());
List<${ClassName}Entity> collect = this.service.find(new ${ClassName}Query()).stream().map(item -> { List<${ClassName}Entity> collect = this.service.find(new ${ClassName}Query()).stream().map(item -> {
if (item.getId().intValue() == id || ArrayUtils.contains(StringUtils.split(item.getAncestors(), ","), id + "")) { if(idSet.contains(item.getget${pkColumn.javaField?cap_first}())) return null;
return null;
}
return item; return item;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
model.put("result", collect); model.put("result", collect);
...@@ -84,7 +85,7 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${ ...@@ -84,7 +85,7 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${
* 获取站点下拉树列表 * 获取站点下拉树列表
*/ */
@PostMapping("treeselect") @PostMapping("treeselect")
public String treeselect(${ClassName}Form form) { public String treeselect(${ClassName}Entity query) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String busiDesc = "查询" + this.getModuleDesc(); String busiDesc = "查询" + this.getModuleDesc();
...@@ -108,7 +109,7 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${ ...@@ -108,7 +109,7 @@ public class ${ClassName}Controller extends BaseCRUDJsonBodyMappingController<${
* 根据parentId查询子信息 * 根据parentId查询子信息
*/ */
@GetMapping(value = "getListByParentId") @GetMapping(value = "getListByParentId")
public String getListByParentId(String parentId) { public String getListByParentId(${treeParentCodeType} parentId) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String busiDesc = "查询" + this.getModuleDesc()+"子节点"; String busiDesc = "查询" + this.getModuleDesc()+"子节点";
......
...@@ -36,6 +36,10 @@ CREATE TABLE ${table.tableName}( ...@@ -36,6 +36,10 @@ CREATE TABLE ${table.tableName}(
`${column.columnName}` ${column.columnType} ${Required} ${autoInc} ${Default} COMMENT '${column.columnComment}', `${column.columnName}` ${column.columnType} ${Required} ${autoInc} ${Default} COMMENT '${column.columnComment}',
</#list> </#list>
PRIMARY KEY (`${table.pkColumn.columnName}`) PRIMARY KEY (`${table.pkColumn.columnName}`)
<#list table.columns as column>
<#if column.isQuery==1 >
<#sep>,</#sep>KEY `${column.columnName}` (`${column.columnName}`) USING BTREE
</#if>
</#list>
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.functionName}'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.functionName}';
</#list> </#list>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- ---------------------------- -- ----------------------------
-- ${table.functionName}菜单 SQL -- ${table.functionName}菜单 SQL
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '${table.tableComment}', '/${table.requestMapping}/list', 0, 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL); INSERT INTO `mortals_xhx_menu` VALUES (null, '${table.tableComment}', '/${table.requestMapping}/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ---------------------------- -- ----------------------------
-- ${table.functionName}资源路径 SQL -- ${table.functionName}资源路径 SQL
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<el-col span="12"> <el-col span="12">
<el-form-item label="${comment}"> <el-form-item label="${comment}">
<fileUpload v-model="form.${column.javaField}" prePath="/uploadfile" /> <fileUpload v-model="form.${column.javaField}" prePath="/file/fileupload" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<#elseif column.htmlType == 7> <#elseif column.htmlType == 7>
<Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field> <Field label="${comment}"><imageUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/preview"/></Field>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/uploadfile"/></Field> <Field label="${comment}"><fileUpload v-model="form.${subclassName}Entity.${column.javaField}" prePath="/file/fileupload"/></Field>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field> <Field label="${comment}"><editor v-model="form.${subclassName}Entity.${column.javaField}" :min-height="256"/></Field>
<#else > <#else >
......
...@@ -127,17 +127,13 @@ ...@@ -127,17 +127,13 @@
}, },
</#if> </#if>
afterRender(data) { afterRender(data) {
data.result = handleTree(data.result, "${treeCode}","${treeParentCode}"); data.data = handleTree(data.data, "${treeCode}","${treeParentCode}");
this.${className}Options = data.result; this.${className}Options = data.data;
this.$refs.layoutTable.showType="treetable" this.$refs.layoutTable.showType="treetable"
}, },
handleAdd(row) { handleAdd(row) {
if (row.fileType == 2) { this.$refs.dialogform.add(row, this.${className}Options);
this.$message.info("文件节点不允许添加子节点!");
return;
}
this.$refs.dialogform.add(row, this.${className}fileOptions);
}, },
/** 重写新增方法 */ /** 重写新增方法 */
...@@ -147,10 +143,10 @@ ...@@ -147,10 +143,10 @@
/** 重写编辑方法 */ /** 重写编辑方法 */
toEdit(row) { toEdit(row) {
this.loading = true; this.loading = true;
this.$post(this.pageInfo.exclude, {${pkColumn.javaField} : [row.${pkColumn.javaField}] }) this.$post(this.pageInfo.exclude, {${pkColumn.javaField} : row.${pkColumn.javaField} })
.then((res) => { .then((res) => {
if (res && res.code && res.code == 1) { if (res && res.code && res.code == 1) {
this.${className}Options = handleTree(res.data.result); this.${className}Options = handleTree(res.data.data);
this.$refs.dialogform.edit(row, this.${className}Options); this.$refs.dialogform.edit(row, this.${className}Options);
this.loading = false; this.loading = false;
} }
...@@ -271,4 +267,40 @@ ...@@ -271,4 +267,40 @@
}; };
} }
}; };
</script> </script>
\ No newline at end of file <style lang="scss">
.ml-row {
margin-bottom: 5px;
}
.el-radio-button__inner {
// width: 82px;
height: 36px;
border-radius: 4px 0px 0px 4px;
border: 1px solid rgba(0, 0, 0, 0) !important;
border-radius: 2px !important;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
color: #606677;
line-height: 14px;
outline: none;
box-shadow: none;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
background: rgba(0, 0, 0, 0);
border: 1px solid #3E7BFA !important;
color: #3E7BFA;
line-height: 14px;
outline: none;
box-shadow: none;
}
.ml-top-button {
border-color: #ffffff;
background: rgba(0, 0, 0, 0);
font-size: 16px;
margin: 0 10px 0 10px;
}
</style>
\ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</el-descriptions-item> </el-descriptions-item>
<#elseif column.htmlType == 8> <#elseif column.htmlType == 8>
<el-descriptions-item label="${comment}" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="${comment}" label-class-name="labelClass" content-class-name="contentClass">
<fileUpload v-model="form.${column.javaField}" prePath="/file/uploadfile"/> <fileUpload v-model="form.${column.javaField}" prePath="/file/fileupload"/>
</el-descriptions-item> </el-descriptions-item>
<#elseif column.htmlType == 9> <#elseif column.htmlType == 9>
<el-descriptions-item label="${comment}" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="${comment}" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -328,13 +328,13 @@ ...@@ -328,13 +328,13 @@
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} is null <#noparse>${_conditionType_}</#noparse> a.${column.columnName} is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('${column.javaField}List')"> <if test="conditionParamRef.containsKey('${column.javaField}List') and conditionParamRef.${column.javaField}List.size() > 0">
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} in <#noparse>${_conditionType_}</#noparse> a.${column.columnName} in
<foreach collection="conditionParamRef.${column.javaField}List" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.${column.javaField}List" open="(" close=")" index="index" item="item" separator=",">
<#noparse>#{item}</#noparse> <#noparse>#{item}</#noparse>
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('${column.javaField}NotList')"> <if test="conditionParamRef.containsKey('${column.javaField}NotList') and conditionParamRef.${column.javaField}NotList.size() > 0">
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} not in <#noparse>${_conditionType_}</#noparse> a.${column.columnName} not in
<foreach collection="conditionParamRef.${column.javaField}NotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.${column.javaField}NotList" open="(" close=")" index="index" item="item" separator=",">
<#noparse>#{item}</#noparse> <#noparse>#{item}</#noparse>
...@@ -357,13 +357,13 @@ ...@@ -357,13 +357,13 @@
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} is null <#noparse>${_conditionType_}</#noparse> a.${column.columnName} is null
</if> </if>
</if> </if>
<if test="conditionParamRef.containsKey('${column.javaField}List')"> <if test="conditionParamRef.containsKey('${column.javaField}List') and conditionParamRef.${column.javaField}List.size() > 0">
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} in <#noparse>${_conditionType_}</#noparse> a.${column.columnName} in
<foreach collection="conditionParamRef.${column.javaField}List" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.${column.javaField}List" open="(" close=")" index="index" item="item" separator=",">
<#noparse>#</#noparse>{item} <#noparse>#</#noparse>{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('${column.javaField}NotList')"> <if test="conditionParamRef.containsKey('${column.javaField}NotList') and conditionParamRef.${column.javaField}NotList.size() > 0">
<#noparse>${_conditionType_}</#noparse> a.${column.columnName} not in <#noparse>${_conditionType_}</#noparse> a.${column.columnName} not in
<foreach collection="conditionParamRef.${column.javaField}NotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.${column.javaField}NotList" open="(" close=")" index="index" item="item" separator=",">
<#noparse>#</#noparse>{item} <#noparse>#</#noparse>{item}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment