增加:综合浏览系统资源查询页面增加数据表表头配置功能按钮和页面

master
Guo XIn 1 year ago
parent 5f1e778fd6
commit ad5eb5aa48
  1. 14
      shandan-browser/src/main/java/com/keyware/shandan/browser/controller/BrowserIndexController.java
  2. 112
      shandan-browser/src/main/resources/static/js/browser.js
  3. 57
      shandan-browser/src/main/resources/view/browser.html
  4. 42
      shandan-system/src/main/java/com/keyware/shandan/system/controller/SysTheadConfigController.java
  5. 65
      shandan-system/src/main/java/com/keyware/shandan/system/entity/SysTheadConfig.java
  6. 15
      shandan-system/src/main/java/com/keyware/shandan/system/mapper/SysTheadConfigMapper.java
  7. 16
      shandan-system/src/main/java/com/keyware/shandan/system/service/SysTheadConfigService.java
  8. 78
      shandan-system/src/main/java/com/keyware/shandan/system/service/impl/SysTheadConfigServiceImpl.java
  9. 5
      shandan-system/src/main/resources/static/js/sys/form/formConfig.js

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.keyware.shandan.bianmu.entity.MetadataBasicVo; import com.keyware.shandan.bianmu.entity.MetadataBasicVo;
import com.keyware.shandan.bianmu.service.DirPermissionService; import com.keyware.shandan.bianmu.service.DirPermissionService;
import com.keyware.shandan.bianmu.service.DirectoryService;
import com.keyware.shandan.bianmu.service.MetadataService; import com.keyware.shandan.bianmu.service.MetadataService;
import com.keyware.shandan.common.enums.SystemTypes; import com.keyware.shandan.common.enums.SystemTypes;
import com.keyware.shandan.common.util.RsaUtil; import com.keyware.shandan.common.util.RsaUtil;
@ -13,11 +12,12 @@ import com.keyware.shandan.datasource.entity.DBTableColumnVo;
import com.keyware.shandan.frame.config.security.SecurityUtil; import com.keyware.shandan.frame.config.security.SecurityUtil;
import com.keyware.shandan.system.entity.SysSetting; import com.keyware.shandan.system.entity.SysSetting;
import com.keyware.shandan.system.entity.SysUser; import com.keyware.shandan.system.entity.SysUser;
import com.keyware.shandan.system.service.SysFileService; import com.keyware.shandan.system.service.SysTheadConfigService;
import com.keyware.shandan.system.service.SysUserService; import com.keyware.shandan.system.service.SysUserService;
import com.keyware.shandan.system.utils.SysSettingUtil; import com.keyware.shandan.system.utils.SysSettingUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -39,9 +39,6 @@ import java.util.List;
@RequestMapping("/") @RequestMapping("/")
public class BrowserIndexController { public class BrowserIndexController {
@Autowired
private DirectoryService directoryService;
@Autowired @Autowired
private MetadataService metadataService; private MetadataService metadataService;
@ -49,10 +46,10 @@ public class BrowserIndexController {
private SysUserService sysUserService; private SysUserService sysUserService;
@Autowired @Autowired
private SysFileService sysFileService; private DirPermissionService permissionService;
@Autowired @Autowired
private DirPermissionService permissionService; private SysTheadConfigService theadConfigService;
@Value("${project.cors-lib-search:#}") @Value("${project.cors-lib-search:#}")
private String corsLibSearchUrl; private String corsLibSearchUrl;
@ -90,10 +87,11 @@ public class BrowserIndexController {
} }
@GetMapping("/browser") @GetMapping("/browser")
public ModelAndView browser(ModelAndView mov) { public ModelAndView browser(ModelAndView mov, Authentication auth) {
mov.setViewName("browser"); mov.setViewName("browser");
SysSetting bianmuSetting = SysSettingUtil.getSysSetting(SystemTypes.BIANMU.name()); SysSetting bianmuSetting = SysSettingUtil.getSysSetting(SystemTypes.BIANMU.name());
mov.addObject("bianmuServer", bianmuSetting.getSysAddress()); mov.addObject("bianmuServer", bianmuSetting.getSysAddress());
mov.addObject("theadConfig", theadConfigService.listByCreateUser(auth.getName()));
return mov; return mov;
} }

@ -135,11 +135,10 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop
height: 'full-110', height: 'full-110',
method: 'post', method: 'post',
autoSort: false, autoSort: false,
defaultToolbar: [{ defaultToolbar: [
title: '导出' //标题 {title: '导出', layEvent: 'export', icon: 'layui-icon-export'},
, layEvent: 'export' //事件名,用于 toolbar 事件中使用 {title: '列表配置', layEvent: 'theadSet', icon: 'layui-icon-cols'}
, icon: 'layui-icon-export' //图标类名 ],
}],
request: {pageName: 'page', limitName: 'size'}, request: {pageName: 'page', limitName: 'size'},
limit: 30, limit: 30,
cols: [[ cols: [[
@ -218,6 +217,8 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop
openMaxLayerWithURL(`${ctx}/search/meta/${obj.id}`) openMaxLayerWithURL(`${ctx}/search/meta/${obj.id}`)
} }
}) })
new THeadSetLayer(metaListTable, layui);
} }
function initFileSearchTable(id) { function initFileSearchTable(id) {
@ -230,6 +231,9 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop
url: `${ctx}/search/full/file?metaId=${id}`, url: `${ctx}/search/full/file?metaId=${id}`,
height: 'full-110', height: 'full-110',
request: {pageName: 'page', limitName: 'size'}, request: {pageName: 'page', limitName: 'size'},
defaultToolbar: [
{title: '列表配置', layEvent: 'theadSet', icon: 'layui-icon-cols'}
],
autoSort: false, autoSort: false,
limit: 30, limit: 30,
method: 'get', method: 'get',
@ -285,6 +289,8 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop
dirFileTable.addTableRowEvent('details-file', function (obj) { dirFileTable.addTableRowEvent('details-file', function (obj) {
openMaxLayerWithURL(`${ctx}/sys/file/view?fileId=${obj.id}`) openMaxLayerWithURL(`${ctx}/sys/file/view?fileId=${obj.id}`)
}) })
new THeadSetLayer(dirFileTable, layui);
} }
/** /**
@ -508,4 +514,98 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop
closeBtn: 1 closeBtn: 1
}); });
} }
}) })
/**
* 表格表头配置组件
*/
class THeadSetLayer {
constructor(pageTable, lay) {
this.layer = lay.layer;
this.form = lay.form;
this.gtable = lay.gtable;
this.pageTable = pageTable;
this.id = pageTable.id + 'Set';
this.pageTable.addTableRowEvent('theadSet', () => this.show())
}
show() {
const {layer, pageTable, id} = this;
layer.open({
id: id + 'Layer',
title: '数据列表配置',
type: 1,
area: ['1000px', '700px'],
shadeClose: true,
maxmin: false,
anim: 0,
content: `<table id="${id}" lay-filter="${id}"></table>`,
btn: ['保存', '取消'],
success: () => {
this._renderInnerTable();
},
yes: (layerIndex) => {
this._saveTheadSet().then(() => {
pageTable.reloadTable();
layer.close(layerIndex);
})
}
});
}
_renderInnerTable() {
const {gtable, form, id} = this;
gtable.init({
id,
data: [...sourceTableConfigMap.values()],
method: 'get',
toolbar: false,
height: 'full-310',
page: false,
cols: [[
{field: 'id', hide: true},
{field: 'colName', title: '列名'},
{field: 'colTitle', title: '列标题', edit: 'text'},
{field: 'colSort', title: '列顺序', edit: 'text'},
{field: 'colWidth', title: '列宽度', edit: 'text'},
{
field: 'isSort',
title: '是否允许排序',
templet: (data) => renderSwitch('isSort', data)
},
{
field: 'isShow',
title: '是否显示',
templet: (data) => renderSwitch('isShow', data)
}
]],
});
gtable.on(`edit(${id})`, ({field, value, data}) => {
sourceTableConfigMap.get(data.id)[field] = value;
})
// 监听switch按钮
form.on(`switch(${id}-switch)`, ({elem}) => {
const id = $(elem).attr('id'), name = $(elem).attr('name');
const value = sourceTableConfigMap.get(id)[name];
sourceTableConfigMap.get(id)[name] = !value;
});
function renderSwitch(colName, data) {
const dataId = data.id, value = data[colName];
return `<input type="checkbox" id="${dataId}" name="${colName}" value="${value}" title="是|否" lay-skin="switch" lay-filter="${id}-switch" ${value ? 'checked' : ''} />`
}
}
_saveTheadSet() {
return new Promise(resolve => {
Util.post(`/sys/thead/config/api/save`, {params: JSON.stringify([...sourceTableConfigMap.values()])}).then(res=>{
if(res.flag){
showOkMsg('保存成功')
}else{
showErrorMsg2('保存失败:'+res.msg)
}
})
resolve();
})
}
}

@ -11,6 +11,18 @@
<link rel="stylesheet" th:href="@{/css/browser.css}"/> <link rel="stylesheet" th:href="@{/css/browser.css}"/>
<script th:inline="javascript"> <script th:inline="javascript">
const bus_type = 0; const bus_type = 0;
const resourceTableId = 'browser_resource_table',
fileTableId = 'browser_file_table',
theadConfig = /*[[${theadConfig}]]*/ [];
const sourceTableConfigMap = new Map(), fileTableConfigMap = new Map();
theadConfig.forEach(item => {
if (item.tableId === resourceTableId) {
sourceTableConfigMap.set(item.id, item);
} else if (item.tableId === fileTableId) {
fileTableConfigMap.set(item.id, item);
}
});
</script> </script>
</head> </head>
<body onselectstart="return false"> <body onselectstart="return false">
@ -79,18 +91,23 @@
<div class="current-position">当前位置:<label></label></div> <div class="current-position">当前位置:<label></label></div>
<table class="layui-hide" id="dirMetadataTable" lay-filter="dirMetadataTable"></table> <table class="layui-hide" id="dirMetadataTable" lay-filter="dirMetadataTable"></table>
<script type="text/html" id="tableToolBar"> <script type="text/html" id="tableToolBar">
<div class="layui-form" lay-filter="search-form" style="display: flex;flex-direction: column;"> <div class="layui-form" lay-filter="search-form"
<div class="layui-btn-container" style="display: flex; justify-content: flex-start; margin-bottom: 0"> style="display: flex;flex-direction: column;">
<div class="layui-btn-container"
style="display: flex; justify-content: flex-start; margin-bottom: 0">
<div style="position: unset;"> <div style="position: unset;">
<input type="text" id="searchKeyInput" name="searchKeyInput" <input type="text" id="searchKeyInput" name="searchKeyInput"
autocomplete="off" autocomplete="off"
placeholder="请输入关键字查询" class="layui-input layui-btn-sm"> placeholder="请输入关键字查询" class="layui-input layui-btn-sm">
<button class="layui-btn layui-btn-sm" id="begin-search-btn" lay-event="query">查询</button> <button class="layui-btn layui-btn-sm" id="begin-search-btn"
lay-event="query">查询
</button>
</div> </div>
<div style="position: unset;"> <div style="position: unset;">
<button class="layui-btn layui-btn-primary layui-border-green" <button class="layui-btn layui-btn-primary layui-border-green"
style="border: 0" style="border: 0"
id="condition-btn">更多条件<i class="layui-icon layui-icon-down"></i> id="condition-btn">更多条件<i
class="layui-icon layui-icon-down"></i>
</button> </button>
<button class="layui-btn layui-btn-primary layui-border-green" <button class="layui-btn layui-btn-primary layui-border-green"
style="border: 0;padding:0;margin:0" style="border: 0;padding:0;margin:0"
@ -106,7 +123,8 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" id="input-date-begin" name="inputDate" <input type="text" id="input-date-begin" name="inputDate"
autocomplete="off" autocomplete="off"
class="layui-input input-date c-input" placeholder="选择日期范围"/> class="layui-input input-date c-input"
placeholder="选择日期范围"/>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
@ -117,7 +135,8 @@
<option value="nq">不等于</option> <option value="nq">不等于</option>
<!--<option value="like">包含</option>--> <!--<option value="like">包含</option>-->
</select> </select>
<div dict-component="select" dict-type="data_source" dict-name="dataFrom" id="dict-data-form"></div> <div dict-component="select" dict-type="data_source"
dict-name="dataFrom" id="dict-data-form"></div>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
@ -128,11 +147,13 @@
<option value="nq">不等于</option> <option value="nq">不等于</option>
<!--<option value="like">包含</option>--> <!--<option value="like">包含</option>-->
</select> </select>
<div dict-component="select" dict-type="data_type" dict-name="dataType" id="dict-data-type"></div> <div dict-component="select" dict-type="data_type"
dict-name="dataType" id="dict-data-type"></div>
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label" label-name="secretLevel">数据密级</label> <label class="layui-form-label"
label-name="secretLevel">数据密级</label>
<div class="layui-input-inline" <div class="layui-input-inline"
style="width: 80px;height: 38px; margin-right: -1px;"> style="width: 80px;height: 38px; margin-right: -1px;">
<select name="logic-secretLevel" lay-verify="select-condition"> <select name="logic-secretLevel" lay-verify="select-condition">
@ -142,14 +163,16 @@
<option value="lt">小于</option> <option value="lt">小于</option>
</select> </select>
</div> </div>
<div dict-component="select" dict-type="secret_level" dict-name="secretLevel" id="dict-secret-level"></div> <div dict-component="select" dict-type="secret_level"
dict-name="secretLevel" id="dict-secret-level"></div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label" label-name="mark">置标标签</label> <label class="layui-form-label" label-name="mark">置标标签</label>
<div class="layui-input-inline mark-selector" style="width: 340px;"> <div class="layui-input-inline mark-selector" style="width: 340px;">
<div class="layui-unselect layui-form-select"> <div class="layui-unselect layui-form-select">
<div class="layui-select-title"> <div class="layui-select-title">
<input placeholder="请选择" id="mark-selector-input" readonly <input placeholder="请选择" id="mark-selector-input"
readonly
type="text" class="layui-input layui-unselect"> type="text" class="layui-input layui-unselect">
<i class="layui-edge"></i> <i class="layui-edge"></i>
</div> </div>
@ -157,13 +180,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item" style="justify-content: center; align-items: center"> <div class="layui-form-item"
style="justify-content: center; align-items: center">
<button class="layui-btn layui-border-green" <button class="layui-btn layui-border-green"
style="height: 20px;line-height: 16px; color: #FFFFFF !important;margin-right: 10px; padding: 0 10px" style="height: 20px;line-height: 16px; color: #FFFFFF !important;margin-right: 10px; padding: 0 10px"
onclick="$(`#condition-btn`).click()">确定 onclick="$(`#condition-btn`).click()">确定
</button> </button>
<button class="layui-btn layui-btn-primary layui-border-green" <button class="layui-btn layui-btn-primary layui-border-green"
style="border: 0;padding:0;margin:0;height: 16px;line-height: 16px;" id="condition-cancel-btn">取消 style="border: 0;padding:0;margin:0;height: 16px;line-height: 16px;"
id="condition-cancel-btn">取消
</button> </button>
</div> </div>
</div> </div>
@ -180,7 +205,8 @@
</div>--> </div>-->
</div> </div>
</div> </div>
<div id="mengban" style="width: 100%; display: none; height: 100%; position: fixed; top:0px; left: 0px; background: #0C0C0C47; z-index: 1"></div> <div id="mengban"
style="width: 100%; display: none; height: 100%; position: fixed; top:0px; left: 0px; background: #0C0C0C47; z-index: 1"></div>
</script> </script>
<script type="text/html" id="rowToolBar"> <script type="text/html" id="rowToolBar">
<div class="layui-btn-container"> <div class="layui-btn-container">
@ -204,7 +230,8 @@
</script> </script>
<script type="text/html" id="fileRowToolBar"> <script type="text/html" id="fileRowToolBar">
<div class="layui-btn-container"> <div class="layui-btn-container">
<button class="layui-btn layui-btn-xs remove-link" lay-event="details-file">查看</button> <button class="layui-btn layui-btn-xs remove-link" lay-event="details-file">查看
</button>
</div> </div>
</script> </script>
</div> </div>

@ -0,0 +1,42 @@
package com.keyware.shandan.system.controller;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.keyware.shandan.common.entity.Result;
import com.keyware.shandan.common.util.StringUtils;
import com.keyware.shandan.system.entity.SysTheadConfig;
import com.keyware.shandan.system.service.SysTheadConfigService;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 前端数据表格表头配置前端控制器
*
* @author GuoXin
* @date 2023/8/30
*/
@RestController
@RequestMapping("/sys/thead/config")
public class SysTheadConfigController {
private final SysTheadConfigService theadConfigService;
public SysTheadConfigController(SysTheadConfigService theadConfigService) {
this.theadConfigService = theadConfigService;
}
@PostMapping(value = "/api/save")
public Result<Object> save(String params, Authentication auth) {
JSONArray jsonArray = JSONUtil.parseArray(params);
List<SysTheadConfig> list = jsonArray.toList(SysTheadConfig.class);
list.forEach(item->{
if(!StringUtils.hasText(item.getId())){
item.genId(auth.getName());
}
});
return Result.of(theadConfigService.saveOrUpdateBatch(list));
}
}

@ -0,0 +1,65 @@
package com.keyware.shandan.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.keyware.shandan.common.entity.BaseEntity;
import com.keyware.shandan.common.util.MD5Util;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 前端数据表格表头配置实体类
*
* @author GuoXin
* @date 2023/8/30
*/
@Data
@Builder
@EqualsAndHashCode(callSuper = true)
@TableName("SYS_THEAD_CONFIG")
public class SysTheadConfig extends BaseEntity {
private static final long serialVersionUID = 1480474706145625172L;
/**
* 主键
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* 数据表ID对应前端页面上的layui中table组件的id
*/
private String tableId;
/**
* 列名
*/
private String colName;
/**
* 列标题
*/
private String colTitle;
/**
* 列顺序
*/
@OrderBy(isDesc = false, sort = 2)
private Integer colSort;
/**
* 列宽度
*/
private String colWidth;
/**
* 是否显示
*/
@OrderBy(sort = 1)
private Boolean isShow;
/**
* 是否允许排序
*/
private Boolean isSort;
public void genId(String userName) {
this.id = MD5Util.getMD5(tableId + colName + userName);
}
}

@ -0,0 +1,15 @@
package com.keyware.shandan.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.keyware.shandan.system.entity.SysTheadConfig;
import org.apache.ibatis.annotations.Mapper;
/**
* 前端数据表格表头配置数据库操作映射接口
*
* @author GuoXin
* @date 2023/8/30
*/
@Mapper
public interface SysTheadConfigMapper extends BaseMapper<SysTheadConfig> {
}

@ -0,0 +1,16 @@
package com.keyware.shandan.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.keyware.shandan.system.entity.SysTheadConfig;
import java.util.List;
/**
* 前端数据表格表头配置数据库操作接口
*
* @author GuoXin
* @date 2023/8/30
*/
public interface SysTheadConfigService extends IService<SysTheadConfig> {
List<SysTheadConfig> listByCreateUser(String userId);
}

@ -0,0 +1,78 @@
package com.keyware.shandan.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.keyware.shandan.common.util.StringUtils;
import com.keyware.shandan.system.entity.SysTheadConfig;
import com.keyware.shandan.system.mapper.SysTheadConfigMapper;
import com.keyware.shandan.system.service.SysTheadConfigService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* 前端数据表格表头配置数据库操作接口实现类
*
* @author GuoXin
* @date 2023/8/30
*/
@Service
public class SysTheadConfigServiceImpl extends ServiceImpl<SysTheadConfigMapper, SysTheadConfig> implements SysTheadConfigService {
static final String resourceTableId = "browser_resource_table", fileTableId = "browser_file_table";
static List<SysTheadConfig> defaultConfig = new ArrayList<>();
static {
SysTheadConfig.SysTheadConfigBuilder builder = SysTheadConfig.builder();
// 初始化综合浏览系统资源查询数据表表头默认配置
defaultConfig.add(builder.tableId(resourceTableId).colName("resourceName").colTitle("资源名称").colSort(1).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("resourceComment").colTitle("资源注释").colSort(2).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("directoryPath").colTitle("目录路径").colSort(3).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("themeTask").colTitle("主题任务").colSort(4).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("dataSource").colTitle("数据来源").colSort(5).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("taskTime").colTitle("任务时间").colSort(6).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("dataType").colTitle("数据类型").colSort(7).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("secretLevel").colTitle("数据密级").colSort(8).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(resourceTableId).colName("resourceType").colTitle("资源类型").colSort(9).colWidth("100").isShow(true).isSort(false).build());
// 初始化综合浏览系统文件全文检索数据表表头默认配置
defaultConfig.add(builder.tableId(fileTableId).colName("fileName").colTitle("文件名称").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("fileType").colTitle("文件类型").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("fileSize").colTitle("文件大小").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("remark").colTitle("文件描述").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("exerciseData").colTitle("是否演训数据").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("entryStaff").colTitle("录入人员").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("equipmentModel").colTitle("装备型号").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("inputDate").colTitle("任务时间").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("source").colTitle("文件来源").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("taskCode").colTitle("任务代号").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("taskNature").colTitle("任务性质").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("troopCode").colTitle("部队代号").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("targetNumber").colTitle("目标/靶标类型").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("missileNumber").colTitle("导弹编号").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("themeTask").colTitle("主题任务").colSort(9).colWidth("100").isShow(true).isSort(false).build());
defaultConfig.add(builder.tableId(fileTableId).colName("secretLevel").colTitle("文件密级").colSort(9).colWidth("100").isShow(true).isSort(false).build());
}
@Override
public List<SysTheadConfig> listByCreateUser(String userId) {
if (StringUtils.hasText(userId)) {
LambdaQueryWrapper<SysTheadConfig> query = new LambdaQueryWrapper<>();
query.eq(SysTheadConfig::getCreateUser, userId);
List<SysTheadConfig> list = list(query);
if (list.size() == 0) {
// 为默认数据生成包含用户主键的ID
defaultConfig.forEach(conf -> conf.genId(userId));
return defaultConfig;
}
return list;
}
return Collections.emptyList();
}
@Override
public boolean saveOrUpdateBatch(Collection<SysTheadConfig> entityList, int batchSize) {
return super.saveOrUpdateBatch(entityList, batchSize);
}
}

@ -53,7 +53,12 @@ class FormConfigComponent {
}) })
} }
} }
});
gtable.on(`edit(${elemId})`, ({field, value, data}) => {
this.dataMap.get(data.id)[field] = value;
}) })
// 监听switch按钮 // 监听switch按钮
form.on(`switch(${elemId}-switch)`, (data) => this.switchChangeListen(data)); form.on(`switch(${elemId}-switch)`, (data) => this.switchChangeListen(data));