@@ -0,0 +1,17 @@ | |||
package cc.smtweb.system.bpm.web.design.form.model; | |||
import cc.smtweb.system.bpm.web.design.form.ModelForm; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/1 16:05 | |||
*/ | |||
public class LcLc1Worker extends LcSingleWorker { | |||
private final static String tmpl = "model_list_list_1"; | |||
@Override | |||
protected String getTmplId(ModelForm bean) { | |||
return tmpl; | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
package cc.smtweb.system.bpm.web.design.form.model; | |||
import cc.smtweb.system.bpm.web.design.form.ModelForm; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/1 16:05 | |||
*/ | |||
public class LcLc2Worker extends LcSingleWorker { | |||
private final static String tmpl = "model_list_list_2"; | |||
@Override | |||
protected String getTmplId(ModelForm bean) { | |||
return tmpl; | |||
} | |||
} |
@@ -26,6 +26,8 @@ public class ModelFactory { | |||
mapWorker.put(SwEnum.ModelType.LC_LT.value, new LcLtWorker()); | |||
mapWorker.put(SwEnum.ModelType.LC_MS.value, new LcMsWorker()); | |||
mapWorker.put(SwEnum.ModelType.LC_LT_MS.value, new LcLtMsWorker()); | |||
mapWorker.put(SwEnum.ModelType.LC_LC_1.value, new LcLc1Worker()); | |||
mapWorker.put(SwEnum.ModelType.LC_LC_2.value, new LcLc2Worker()); | |||
mapWorker.put(SwEnum.ModelType.FLOW_SINGLE.value, new FlowSingleWorker()); | |||
} | |||
@@ -0,0 +1,106 @@ | |||
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; | |||
import cc.smtweb.framework.core.cache.AbstractCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.EntityHelper; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/2 11:44 | |||
*/ | |||
public class LCLC1DelHandler extends AbstractDynPageHandler { | |||
/** | |||
* 左列表删除 | |||
* @return | |||
*/ | |||
public R lLDel(){ | |||
del(LCLC1Handler.dsLList); | |||
return R.success(); | |||
} | |||
/** | |||
* 左卡片删除 | |||
* @return | |||
*/ | |||
public R lCDel(){ | |||
del(LCLC1Handler.dsLCard); | |||
return R.success(); | |||
} | |||
/** | |||
* 右列表删除 | |||
* @return | |||
*/ | |||
public R rLDel(){ | |||
del(LCLC1Handler.dsRList); | |||
return R.success(); | |||
} | |||
/** | |||
* 右卡片删除 | |||
* @return | |||
*/ | |||
public R rCDel(){ | |||
del(LCLC1Handler.dsRCard); | |||
return R.success(); | |||
} | |||
private void del(String dsName) { | |||
long id = params.readLong("id"); | |||
if (id == 0L) throw new BizException("没有收到待删除记录Id(" + id + ")!"); | |||
//数据集 | |||
PageDataset pageDataset = this.datasets.findByName(dsName); | |||
checkBean(pageDataset, id); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
@Override | |||
public void work() { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataset.masterTable); | |||
if (table == null) throw new BizException("没有找到指定的的表定义:" + pageDataset.name + "!"); | |||
EntityDao dao = DbEngine.getInstance().findDao(table.getName()); | |||
dao.deleteEntity(id); | |||
localDel(id, table); | |||
} | |||
@Override | |||
public void doAfterDbCommit() { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataset.masterTable); | |||
if (table.isNeedCache()) { | |||
AbstractCache cache = CacheManager.getIntance().getCache(table.getName()); | |||
cache.remove(id); | |||
} | |||
localDelSuccess(id, table); | |||
} | |||
}); | |||
} | |||
protected void localDel(long id, ModelTable table) { | |||
} | |||
protected void localDelSuccess(long id, ModelTable table) { | |||
} | |||
/** | |||
* 删除校验 | |||
* | |||
* @param pageDataSet | |||
* @param id | |||
*/ | |||
protected void checkBean(PageDataset pageDataSet, long id) { | |||
//校验外键引用关系 | |||
EntityHelper.checkExists(pageDataSet.masterTable, id); | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/2 12:00 | |||
*/ | |||
public class LCLC1Handler { | |||
public static String dsLList = "lList"; | |||
public static String dsLCard = "lCard"; | |||
public static String dsRList = "rList"; | |||
public static String dsRCard = "rCard"; | |||
} |
@@ -0,0 +1,139 @@ | |||
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageHelper; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean; | |||
import cc.smtweb.system.bpm.web.engine.model.listcard.single.LCSingleHelper; | |||
import org.springframework.util.Assert; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/2 11:44 | |||
*/ | |||
public class LCLC1LoadHandler extends AbstractDynPageHandler { | |||
/** | |||
* 左表新增 | |||
* @return | |||
*/ | |||
public R lAdd() { | |||
SwMap data = add(LCLC1Handler.dsLCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsLCard, data)); | |||
} | |||
/** | |||
* 右表新增 | |||
* @return | |||
*/ | |||
public R rAdd() { | |||
SwMap data = add(LCLC1Handler.dsRCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsRCard, data)); | |||
} | |||
private SwMap add(String dsName) { | |||
PageDataset addDataSet = this.datasets.findByName(dsName); | |||
Assert.notNull(addDataSet, "未获取到数据集:" + dsName); | |||
SwMap data; | |||
//懒加载,给个空对象 | |||
if (addDataSet.lazy) { | |||
data = new SwMap(); | |||
} else { | |||
data = DynPageHelper.createBean(addDataSet); | |||
} | |||
return data; | |||
} | |||
/** | |||
* 左表编辑 | |||
* @return | |||
*/ | |||
public R lLoad() { | |||
SwMap bean = load(LCLC1Handler.dsLCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsLCard, bean)); | |||
} | |||
/** | |||
* 右表编辑 | |||
* @return | |||
*/ | |||
public R rLoad() { | |||
SwMap bean = load(LCLC1Handler.dsRCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsRCard, bean)); | |||
} | |||
private SwMap load(String dsName) { | |||
//过滤条件 | |||
SwMap filter = params.readMap("filter"); | |||
//对应的数据集定义 | |||
PageDataset loadDataSet = this.datasets.findByName(dsName); | |||
Assert.notNull(loadDataSet, "未获取到数据集:" + dsName); | |||
return provider.loadData(filter, loadDataSet); | |||
} | |||
private DynPageListHandler getListWorker(SwMap filter, PageDataset pageDataSet) { | |||
DynPageListHandler listHandler = new DynPageListHandler(form.getId(), filter, pageDataSet); | |||
listHandler.init(params, us); | |||
return listHandler; | |||
} | |||
/** | |||
* 左列表加载 | |||
* @return | |||
*/ | |||
public R lList(){ | |||
DynRetBean list = list(LCLC1Handler.dsLList); | |||
return R.success(list); | |||
} | |||
/** | |||
* 右列表加载 | |||
* @return | |||
*/ | |||
public R rList(){ | |||
DynRetBean list = list(LCLC1Handler.dsRList); | |||
return R.success(list); | |||
} | |||
private DynRetBean list(String dsName) { | |||
//过滤条件 | |||
SwMap filter = params.readMap("filter"); | |||
//对应的数据集定义 | |||
PageDataset listDataSet = this.datasets.findByName(dsName); | |||
Assert.notNull(listDataSet, "未获取到数据集:" + dsName); | |||
return DynRetBean.createList(getListWorker(filter, listDataSet).buildListData()); | |||
} | |||
/** | |||
* 左列表分页数据 | |||
* @return | |||
*/ | |||
public R getLTotal(){ | |||
return getTotal(LCLC1Handler.dsLList); | |||
} | |||
/** | |||
* 右列表分页数据 | |||
* @return | |||
*/ | |||
public R getRTotal(){ | |||
return getTotal(LCLC1Handler.dsRList); | |||
} | |||
private R getTotal(String dsName) { | |||
//过滤条件 | |||
SwMap filter = params.readMap("filter"); | |||
//对应的数据集定义 | |||
PageDataset listDataSet = this.datasets.findByName(dsName); | |||
Assert.notNull(listDataSet, "未获取到数据集:" + dsName); | |||
return getListWorker(filter, listDataSet).getTotal(); | |||
} | |||
} |
@@ -0,0 +1,226 @@ | |||
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; | |||
import cc.smtweb.framework.core.cache.AbstractCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwEnum; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelIndex; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.mvc.service.TreeHelper; | |||
import cc.smtweb.framework.core.util.StringUtil; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDatasetFilter; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
import cc.smtweb.system.bpm.web.engine.model.listcard.single.LCSingleHelper; | |||
import cc.smtweb.system.bpm.web.engine.model.listcard.single.LCSingleSaveHandler; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/2 11:44 | |||
*/ | |||
public class LCLC1SaveHandler<T extends DefaultEntity> extends AbstractDynPageHandler { | |||
private Map<String, List<T>> mapTreeBean = new HashMap<>(); | |||
protected void setNewId(T bean) { | |||
bean.setEntityId(DbEngine.getInstance().nextId()); | |||
} | |||
/** | |||
* 左表保存 | |||
* @return | |||
*/ | |||
public R lSave() { | |||
T bean = save(LCLC1Handler.dsLCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsLCard, bean.getData())); | |||
} | |||
/** | |||
* 右表保存 | |||
* @return | |||
*/ | |||
public R rSave() { | |||
T bean = save(LCLC1Handler.dsRCard); | |||
return R.success(LCSingleHelper.buildRetData(LCLC1Handler.dsRCard, bean.getData())); | |||
} | |||
private T save(String dsName) { | |||
//数据集 | |||
SwMap filter = params.readMap("filter"); | |||
//待保存数据 | |||
SwMap data = params.readMap("data"); | |||
if (data == null) throw new BizException("没有收到待保存的的数据:" + dsName + "!"); | |||
//对应的数据集定义 | |||
PageDataset pageDataSet = this.datasets.findByName(dsName); | |||
//读取待保存的bean | |||
T bean = readBeanFromPage(pageDataSet, data.readMap(dsName).readMap("form")); | |||
if (filter != null && bean.isNew()) {//有过滤条件,将关联的值设上 | |||
setLinkValue(pageDataSet, bean, f -> filter.get(f.name)); | |||
} | |||
checkBean(bean); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
@Override | |||
public void work() { | |||
saveBean(bean); | |||
} | |||
@Override | |||
public void doAfterDbCommit() { | |||
afterCommit(bean); | |||
} | |||
@Override | |||
public void doAfterDbRollback() { | |||
afterRollback(bean); | |||
} | |||
}); | |||
return bean; | |||
} | |||
/** | |||
* 从页面获取待保存的bean | |||
* | |||
* @param pageDataSet | |||
* @param data | |||
* @return | |||
*/ | |||
protected T readBeanFromPage(PageDataset pageDataSet, SwMap data) { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable); | |||
if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataSet.name); | |||
long id = data.readLong(table.getIdField()); | |||
EntityDao<T> dao = DbEngine.getInstance().findDao(table.getName()); | |||
T bean; | |||
if (id <= 0L) { | |||
bean = dao.createBean(); | |||
bean.setIsNew(true); | |||
//暂时不考虑list保存的情况 | |||
bean.getData().putAll(data); | |||
bean.setEntityId(DbEngine.getInstance().nextId()); | |||
} else { | |||
bean = dao.queryEntity(id); | |||
if (bean == null) { | |||
throw new BizException("没有找到待保存的记录:" + table.getName() + "." + id); | |||
} | |||
//暂时不考虑list保存的情况 | |||
bean.getData().putAll(data); | |||
bean.setIsNew(false); | |||
} | |||
return bean; | |||
} | |||
/** | |||
* 保存校验 | |||
* | |||
* @param bean | |||
*/ | |||
protected void checkBean(T bean) { | |||
ModelTable table = ModelTableCache.getInstance().getByName(bean.getTableName()); | |||
for (ModelField field : table.getFields()) { | |||
String value = bean.getStr(field.getName()); | |||
//非空校验 | |||
if (field.isNotNull() && StringUtils.isEmpty(value)) { | |||
throw new BizException("字段不允许为空:" + field.getTitle()); | |||
} | |||
//长度校验 | |||
if (StringUtils.isNotEmpty(value)) { | |||
int len = SwEnum.DataType.instance.getByValue(field.getDataType()).dataLength; | |||
if (len > 0 && StringUtil.getStrLenB(value) > len) { | |||
throw new BizException("字段值超长:" + field.getTitle()); | |||
} | |||
} | |||
} | |||
//唯一键校验 | |||
EntityDao<T> dao = DbEngine.getInstance().findDao(bean.getTableName()); | |||
for (ModelIndex mi : table.getIndexes()) { | |||
if (mi.isUnique()) { | |||
dao.checkUnique(bean, mi.getFields().split(",")); | |||
} | |||
} | |||
} | |||
protected void saveBean(T bean) { | |||
final String tableName = bean.getTableName(); | |||
EntityDao<T> dao = DbEngine.getInstance().findDao(tableName); | |||
if (bean.isNew()) { | |||
dao.insertEntity(bean); | |||
} else { | |||
ModelTable table = ModelTableCache.getInstance().getByName(tableName); | |||
ModelField field = table.findFieldByType(SwEnum.FieldType.UPDATE_USER.value); | |||
if (field != null) bean.put(field.getName(), us.getUserId()); | |||
dao.updateEntity(bean); | |||
if (table.getType() == SwEnum.TableType.TYPE_TREE.value) { | |||
List<T> listTreeBean = TreeHelper.getTreeHelper(tableName).resetTreeLevel(bean); | |||
mapTreeBean.put(tableName, listTreeBean); | |||
} | |||
} | |||
} | |||
protected void afterCommit(T bean) { | |||
final String tableName = bean.getTableName(); | |||
ModelTable table = ModelTableCache.getInstance().getByName(tableName); | |||
if (table.isNeedCache()) { | |||
AbstractCache<DefaultEntity> cache = CacheManager.getIntance().getCache(tableName); | |||
List<T> listTreeBean = mapTreeBean.get(tableName); | |||
//树型表,父亲改变了,要多处理下缓存;还有个东东:级次码 | |||
if (listTreeBean != null && !listTreeBean.isEmpty()) { | |||
for (DefaultEntity b : listTreeBean) { | |||
cache.put(b); | |||
} | |||
} else { | |||
cache.put(bean); | |||
} | |||
} | |||
} | |||
protected void afterRollback(T bean) { | |||
final String tableName = bean.getTableName(); | |||
ModelTable table = ModelTableCache.getInstance().getByName(tableName); | |||
if (table.isNeedCache()) { | |||
AbstractCache<T> cache = CacheManager.getIntance().getCache(tableName); | |||
cache.reset(bean); | |||
} | |||
} | |||
//将关联的值设上 | |||
protected void setLinkValue(PageDataset pageDataSet, T bean, LCSingleSaveHandler.IGetValue iGetValue) { | |||
ModelTable table = ModelTableCache.getInstance().getByName(bean.getTableName()); | |||
for (PageDatasetFilter f : pageDataSet.filters) { | |||
String v = bean.getStr(f.field); | |||
//有值,就不管 | |||
if (v != null && !v.equals(table.findField(f.field).getDefaultValue())) continue; | |||
if (SwEnum.FilterType.CONST.value.equals(f.type)) {//常量 | |||
bean.put(f.field, f.value); | |||
} else if (SwEnum.FilterType.PARAM.value.equals(f.type)) {//参数 | |||
bean.put(f.field, f.value); | |||
} else if (SwEnum.FilterType.LINK.value.equals(f.type)) {//参数 | |||
Object value = iGetValue.getValue(f); | |||
if (value != null) { | |||
bean.put(f.field, value); | |||
} | |||
} | |||
} | |||
} | |||
public interface IGetValue { | |||
Object getValue(PageDatasetFilter f); | |||
} | |||
} |
@@ -0,0 +1,109 @@ | |||
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; | |||
import cc.smtweb.framework.core.annotation.SwBody; | |||
import cc.smtweb.framework.core.annotation.SwService; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | |||
import cc.smtweb.framework.core.session.UserSession; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageService; | |||
/** | |||
* @Author:lip | |||
* @Date : 2022/9/2 11:34 | |||
*/ | |||
@SwService | |||
public class LCLC1Service extends DynPageService { | |||
private final static String TYPE_MODEL_LIST = "modelList"; | |||
private final static String TYPE_MODEL_ADD = "modelAdd"; | |||
private final static String TYPE_MODEL_LOAD = "modelLoad"; | |||
private final static String TYPE_MODEL_SAVE = "modelSave"; | |||
private final static String TYPE_MODEL_DEL = "modelDel"; | |||
// | |||
@Override | |||
protected AbstractHandler createHandler(String type) { | |||
switch (type) { | |||
case TYPE_MODEL_LIST: | |||
case TYPE_MODEL_LOAD: | |||
case TYPE_MODEL_ADD: | |||
return new LCLC1LoadHandler(); | |||
case TYPE_MODEL_SAVE: | |||
return new LCLC1SaveHandler(); | |||
case TYPE_MODEL_DEL: | |||
return new LCLC1DelHandler(); | |||
} | |||
return super.createHandler(type); | |||
} | |||
//保存 | |||
public R modelLSave(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_SAVE, handler -> ((LCLC1SaveHandler)handler).lSave()); | |||
} | |||
//读取 | |||
public R modelLLoad(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LOAD, handler -> ((LCLC1LoadHandler)handler).lLoad()); | |||
} | |||
//读取 | |||
public R modelLAdd(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_ADD, handler -> ((LCLC1LoadHandler)handler).lAdd()); | |||
} | |||
//删除 | |||
public R modelLLDel(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_DEL, handler -> ((LCLC1DelHandler)handler).lLDel()); | |||
} | |||
//删除 | |||
public R modelLCDel(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_DEL, handler -> ((LCLC1DelHandler)handler).lCDel()); | |||
} | |||
//列表数据 | |||
public R modelLList(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LIST, handler -> ((LCLC1LoadHandler)handler).lList()); | |||
} | |||
//列表总记录数及合计栏 | |||
public R modelLListTotal(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LIST, handler -> ((LCLC1LoadHandler)handler).getLTotal()); | |||
} | |||
//右表 | |||
//保存 | |||
public R modelRSave(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_SAVE, handler -> ((LCLC1SaveHandler)handler).rSave()); | |||
} | |||
//读取 | |||
public R modelRLoad(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LOAD, handler -> ((LCLC1LoadHandler)handler).rLoad()); | |||
} | |||
//读取 | |||
public R modelRAdd(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_ADD, handler -> ((LCLC1LoadHandler)handler).rAdd()); | |||
} | |||
//删除 | |||
public R modelRLDel(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_DEL, handler -> ((LCLC1DelHandler)handler).rLDel()); | |||
} | |||
//删除 | |||
public R modelRCDel(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_DEL, handler -> ((LCLC1DelHandler)handler).rCDel()); | |||
} | |||
//列表数据 | |||
public R modelRList(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LIST, handler -> ((LCLC1LoadHandler)handler).rList()); | |||
} | |||
//列表总记录数及合计栏 | |||
public R modelRListTotal(@SwBody SwMap params, UserSession us) { | |||
return pageHandler(params, us, TYPE_MODEL_LIST, handler -> ((LCLC1LoadHandler)handler).getRTotal()); | |||
} | |||
} |
@@ -2,7 +2,6 @@ package cc.smtweb.system.bpm.web.engine.model.listcard.single; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageHelper; | |||
@@ -19,7 +19,7 @@ | |||
</#if> | |||
"props": { | |||
"label": "${dfield.label}", | |||
"type": "text", | |||
"type": "${dfield.editor}", | |||
"dataset": "${dfield.dataset}", | |||
"field": "${dfield.id}", | |||
"required": "${field.required}", | |||
@@ -4,8 +4,16 @@ | |||
"id": "id${newId()}", | |||
"type":"fx-dialog", | |||
"props": { | |||
"title": "查询条件", | |||
"key": "queryDialog", | |||
<#if dialogTitle?has_content> | |||
"title": "${dialogTitle}", | |||
<#else> | |||
"title": "高级筛选", | |||
</#if> | |||
<#if dialogKey?has_content> | |||
"key": "${dialogKey}", | |||
<#else> | |||
"key": "queryDialog", | |||
</#if> | |||
"destroyOnClose": true, | |||
"closeOnClickModal": true, | |||
"width": "20%", | |||
@@ -0,0 +1,735 @@ | |||
{ | |||
"version": 6, | |||
"form": [ | |||
{ | |||
"page": { | |||
"id": "id${newId()}", | |||
"type": "fx-page", | |||
"props": { | |||
"title": "${title}", | |||
"key": "${newId()}" | |||
} | |||
}, | |||
"graph": { | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"shadow": "" | |||
}, | |||
"children": [ | |||
{ | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"horizontal": true, | |||
"shadow": "" | |||
}, | |||
"children": [ | |||
<#list layout.lList as assist> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false, | |||
"size": "420" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "50", | |||
"alignY": "center", | |||
"backgroundImage": "bgImg-region-title", | |||
"paddingLeft": 32, | |||
"colNum": 2, | |||
"gridTemplateColumns": "", | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-title", | |||
"props": { | |||
"label": "${param.lListTitle}" | |||
} | |||
}, | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${assist.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "新增", | |||
"leftIcon": "plus", | |||
"type": "primary", | |||
"action": "button:addCard", | |||
"linkType": "dialog", | |||
"link": false, | |||
"fxLink": "dialog:lCardDialog", | |||
"fxLink_text": "${param.lCardTitle}" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id":"${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "0" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-divider", | |||
"props": { | |||
"label": "", | |||
"contentPosition": "center", | |||
"direction": "horizontal" | |||
} | |||
} | |||
] | |||
}, | |||
<#if (assist.cfilters?size>0)> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"alignY": "center", | |||
"size": "50", | |||
"gridTemplateColumns": "1fr 50px", | |||
"paddingLeft": 32, | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
<#list assist.cfilters as cfilters> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "${cfilters.editor}", | |||
"props": { | |||
"label": "${cfilters.label}", | |||
"type": "text", | |||
"maxlength": 50, | |||
"placeholder": "请输入${cfilters.label}", | |||
"labelWidth": 150, | |||
"affixError": false, | |||
"hideLabel": true, | |||
"leftIcon": "", | |||
"dataset": "${cfilters.dataset}", | |||
"field": "${cfilters.id}" | |||
}, | |||
"events": {} | |||
}, | |||
</#list> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${assist.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "查询", | |||
"leftIcon": "", | |||
"action": "button:loadList", | |||
"link": false, | |||
"type": "primary" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
</#if> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "", | |||
"colNum": 0 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table", | |||
"props": { | |||
"label": "${param.lListTitle}", | |||
"border": true, | |||
"stripe": true, | |||
"showHeader": false, | |||
"fit": true, | |||
"hideOp": false, | |||
"hideNo": true, | |||
"dataset": "${assist.dataset}", | |||
"hidePagination": true, | |||
"name":"leftTb" | |||
}, | |||
"slots": { | |||
"button": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "编辑", | |||
"type": "primary", | |||
"leftIcon": "edit", | |||
"action": "button:editCard", | |||
"linkType": "dialog", | |||
"dataset": "${assist.dataset}", | |||
"fxLink": "dialog:lCardDialog", | |||
"fxLink_text": "${param.lCardTitle}", | |||
"link": true | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "删除", | |||
"type": "primary", | |||
"leftIcon": "delete", | |||
"action": "button:delCard", | |||
"nextAction":"button:loadList", | |||
"link": true, | |||
"text": false, | |||
"dataset": "${assist.dataset}", | |||
"confirm": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
], | |||
"default": [ | |||
<#list assist.fields as field> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table-column", | |||
"props": { | |||
"field": "${field.id}", | |||
"label": "${field.label}" | |||
} | |||
}<#if field_has_next>,</#if> | |||
</#list> | |||
] | |||
}, | |||
"events": {}, | |||
"vars": { | |||
"$ref": "$ref" | |||
} | |||
} | |||
] | |||
} | |||
] | |||
}, | |||
</#list> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "10", | |||
"backgroundColor": "--color-transparent" | |||
}, | |||
"children": [] | |||
}, | |||
<#list layout.rList as main> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false | |||
}, | |||
"children": [ | |||
<#if (main.cfilters?size>0)> | |||
{ | |||
"shape": "panel", | |||
"id": "form_panel", | |||
"type": "fx-form-panel", | |||
"props": { | |||
"colNum": 3, | |||
"label": "查询条件", | |||
"size": "50", | |||
"alignY": "center" | |||
}, | |||
"children": [ | |||
<#list main.cfilters as cfilters> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "${cfilters.editor}", | |||
"props": { | |||
"label": "${cfilters.label}", | |||
"type": "text", | |||
"maxlength": 50, | |||
"placeholder": "请输入${cfilters.label}", | |||
"labelWidth": 100, | |||
"affixError": false | |||
}, | |||
"events": {} | |||
}, | |||
</#list> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "重置", | |||
"leftIcon": "clear", | |||
"action": "button:reset" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "查询", | |||
"leftIcon": "search", | |||
"type": "primary", | |||
"action": "button:loadList", | |||
"linkType": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
<#if (main.sfilters?size>0)> | |||
,{ | |||
"id": "id${newId()}", | |||
"type": "fx-button", | |||
"props": { | |||
"label": "高级筛选", | |||
"leftIcon": "hamburger-button", | |||
"action": "button:link", | |||
"link": true, | |||
"linkType": "drawer", | |||
"fxLink": "dialog:rQueryDialog" | |||
} | |||
} | |||
</#if> | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "间隔", | |||
"size": "10", | |||
"backgroundColor": "--color-transparent" | |||
}, | |||
"children": [] | |||
}, | |||
</#if> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "${param.rListTitle}", | |||
"size": "50", | |||
"backgroundImage": "bgImg-region-title", | |||
"colNum": 2, | |||
"alignY": "center", | |||
"paddingLeft": 32, | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-title", | |||
"props": { | |||
"label": "${param.rListTitle}" | |||
} | |||
}, | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "新增", | |||
"leftIcon": "plus", | |||
"type": "primary", | |||
"action": "button:addCard", | |||
"linkType": "dialog", | |||
"fxLink": "dialog:rCardDialog", | |||
"fxLink_text": "${param.rCardTitle}", | |||
"preAction": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "表格区", | |||
"colNum": 0 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table", | |||
"props": { | |||
"label": "表格", | |||
"border": true, | |||
"stripe": true, | |||
"showHeader": true, | |||
"fit": true, | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"button": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "编辑", | |||
"type": "primary", | |||
"leftIcon": "edit", | |||
"action": "button:editCard", | |||
"link": false, | |||
"text": true, | |||
"linkType": "dialog", | |||
"fxLink": "dialog:rCardDialog", | |||
"fxLink_text": "${param.rCardTitle}" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "删除", | |||
"type": "danger", | |||
"leftIcon": "delete", | |||
"action": "button:delCard", | |||
"nextAction":"button:loadList", | |||
"link": false, | |||
"text": true, | |||
"preAction": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
], | |||
"default": [ | |||
<#list main.fields as field> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table-column", | |||
"props": { | |||
"field": "${field.id}", | |||
"label": "${field.label}" | |||
} | |||
}<#if field_has_next>,</#if> | |||
</#list> | |||
] | |||
}, | |||
"events": {} | |||
} | |||
] | |||
} | |||
] | |||
} | |||
</#list> | |||
] | |||
}, | |||
{ | |||
"shape": "panel", | |||
"id": "fx-form-panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"shadow": "", | |||
"size": 24 | |||
}, | |||
"children": [] | |||
} | |||
] | |||
} | |||
}, | |||
<#list layout.lCard as lDialog> | |||
{ | |||
"page": { | |||
"id": "id${newId()}", | |||
"type": "fx-dialog", | |||
"props": { | |||
<#if (param.lCardTitle == "")> | |||
"title": "左表卡片", | |||
<#else> | |||
"title": "${param.lCardTitle}", | |||
</#if> | |||
"key": "lCardDialog", | |||
"closeOnClickModal": false | |||
}, | |||
"events": {} | |||
}, | |||
"graph": { | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"horizontal": false, | |||
"shadow": "never" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false, | |||
"scroll": true, | |||
"backgroundColor": "--color-white" | |||
}, | |||
"children": [ | |||
<#assign dfields = lDialog.fields> | |||
<#assign col = param.lCardCol> | |||
<#include "incModel/inc_list_dialog.ftl"/> | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "0" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-divider", | |||
"props": { | |||
"label": "", | |||
"contentPosition": "center", | |||
"direction": "horizontal" | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "56", | |||
"paddingRight": 10, | |||
"alignY": "center" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${lDialog.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "保存", | |||
"leftIcon": "save", | |||
"type": "success", | |||
"action": "button:saveCard" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "关闭", | |||
"leftIcon": "close", | |||
"type": "", | |||
"action": "button:closeDialog", | |||
"nextAction": "button:loadList" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
} | |||
] | |||
} | |||
}, | |||
</#list> | |||
<#list layout.rCard as rDialog> | |||
{ | |||
"page": { | |||
"id": "id${newId()}", | |||
"type": "fx-dialog", | |||
"props": { | |||
<#if (param.rCardTitle == "")> | |||
"title": "右表卡片", | |||
<#else> | |||
"title": "${param.rCardTitle}", | |||
</#if> | |||
"key": "rCardDialog", | |||
"closeOnClickModal": false | |||
}, | |||
"events": {} | |||
}, | |||
"graph": { | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"horizontal": false, | |||
"shadow": "never" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false, | |||
"scroll": true, | |||
"backgroundColor": "--color-white" | |||
}, | |||
"children": [ | |||
<#assign dfields = rDialog.fields> | |||
<#assign col = param.rCardCol> | |||
<#include "incModel/inc_list_dialog.ftl"/> | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "0" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-divider", | |||
"props": { | |||
"label": "", | |||
"contentPosition": "center", | |||
"direction": "horizontal" | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "56", | |||
"paddingRight": 10, | |||
"alignY": "center" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${rDialog.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "保存", | |||
"leftIcon": "save", | |||
"type": "success", | |||
"action": "button:saveCard" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "关闭", | |||
"leftIcon": "close", | |||
"type": "", | |||
"action": "button:closeDialog", | |||
"nextAction": "button:loadList" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
} | |||
] | |||
} | |||
} | |||
</#list> | |||
<#list layout.lList as lQDialog> | |||
<#assign group = lQDialog > | |||
<#assign dialogKey = "lQueryDialog"> | |||
<#assign dialogTitle = "左列表高级筛选"> | |||
<#if (group.sfilters?size>0)> | |||
<#include "incModel/inc_query_sfilters.ftl"/> | |||
</#if> | |||
</#list> | |||
<#list layout.rList as rQDialog> | |||
<#assign group = rQDialog > | |||
<#assign dialogKey = "rQueryDialog"> | |||
<#assign dialogTitle = "右列表高级筛选"> | |||
<#if (group.sfilters?size>0)> | |||
<#include "incModel/inc_query_sfilters.ftl"/> | |||
</#if> | |||
</#list> | |||
], | |||
"model": [ | |||
<#list datasets as dataset> | |||
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if> | |||
</#list> | |||
], | |||
"option": { | |||
"widgetRef": [${widgetRef}], | |||
"vars": [] | |||
} | |||
} |
@@ -0,0 +1,568 @@ | |||
{ | |||
"version": 6, | |||
"form": [ | |||
{ | |||
"page": { | |||
"id": "id${newId()}", | |||
"type": "fx-page", | |||
"props": { | |||
"title": "${title}", | |||
"key": "${newId()}" | |||
} | |||
}, | |||
"graph": { | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"shadow": "" | |||
}, | |||
"children": [ | |||
{ | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"horizontal": true, | |||
"shadow": "" | |||
}, | |||
"children": [ | |||
<#list layout.lList as assist> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false, | |||
"size": "420" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "50", | |||
"alignY": "center", | |||
"backgroundImage": "bgImg-region-title", | |||
"paddingLeft": 32, | |||
"colNum": 2, | |||
"gridTemplateColumns": "", | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-title", | |||
"props": { | |||
"label": "${param.lListTitle}" | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id":"${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "0" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-divider", | |||
"props": { | |||
"label": "", | |||
"contentPosition": "center", | |||
"direction": "horizontal" | |||
} | |||
} | |||
] | |||
}, | |||
<#if (assist.cfilters?size>0)> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"alignY": "center", | |||
"size": "50", | |||
"gridTemplateColumns": "1fr 50px", | |||
"paddingLeft": 32, | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
<#list assist.cfilters as cfilters> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "${cfilters.editor}", | |||
"props": { | |||
"label": "${cfilters.label}", | |||
"type": "text", | |||
"maxlength": 50, | |||
"placeholder": "请输入${cfilters.label}", | |||
"labelWidth": 150, | |||
"affixError": false, | |||
"hideLabel": true, | |||
"leftIcon": "", | |||
"dataset": "${cfilters.dataset}", | |||
"field": "${cfilters.id}" | |||
}, | |||
"events": {} | |||
}, | |||
</#list> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${assist.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "查询", | |||
"leftIcon": "", | |||
"action": "button:loadList", | |||
"link": false, | |||
"type": "primary" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
</#if> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "", | |||
"colNum": 0 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table", | |||
"props": { | |||
"label": "${param.lListTitle}", | |||
"border": true, | |||
"stripe": true, | |||
"showHeader": false, | |||
"fit": true, | |||
"hideOp": false, | |||
"hideNo": true, | |||
"dataset": "${assist.dataset}", | |||
"hidePagination": true, | |||
"name":"leftTb" | |||
}, | |||
"slots": { | |||
"button": [], | |||
"default": [ | |||
<#list assist.fields as field> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table-column", | |||
"props": { | |||
"field": "${field.id}", | |||
"label": "${field.label}" | |||
} | |||
}<#if field_has_next>,</#if> | |||
</#list> | |||
] | |||
}, | |||
"events": {}, | |||
"vars": { | |||
"$ref": "$ref" | |||
} | |||
} | |||
] | |||
} | |||
] | |||
}, | |||
</#list> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "10", | |||
"backgroundColor": "--color-transparent" | |||
}, | |||
"children": [] | |||
}, | |||
<#list layout.rList as main> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false | |||
}, | |||
"children": [ | |||
<#if (main.cfilters?size>0)> | |||
{ | |||
"shape": "panel", | |||
"id": "form_panel", | |||
"type": "fx-form-panel", | |||
"props": { | |||
"colNum": 3, | |||
"label": "查询条件", | |||
"size": "50", | |||
"alignY": "center" | |||
}, | |||
"children": [ | |||
<#list main.cfilters as cfilters> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "${cfilters.editor}", | |||
"props": { | |||
"label": "${cfilters.label}", | |||
"type": "text", | |||
"maxlength": 50, | |||
"placeholder": "请输入${cfilters.label}", | |||
"labelWidth": 100, | |||
"affixError": false | |||
}, | |||
"events": {} | |||
}, | |||
</#list> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "重置", | |||
"leftIcon": "clear", | |||
"action": "button:reset" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "查询", | |||
"leftIcon": "search", | |||
"type": "primary", | |||
"action": "button:loadList", | |||
"linkType": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
<#if (main.sfilters?size>0)> | |||
,{ | |||
"id": "id${newId()}", | |||
"type": "fx-button", | |||
"props": { | |||
"label": "高级筛选", | |||
"leftIcon": "hamburger-button", | |||
"action": "button:link", | |||
"link": true, | |||
"linkType": "drawer", | |||
"fxLink": "dialog:rQueryDialog" | |||
} | |||
} | |||
</#if> | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "间隔", | |||
"size": "10", | |||
"backgroundColor": "--color-transparent" | |||
}, | |||
"children": [] | |||
}, | |||
</#if> | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "${param.rListTitle}", | |||
"size": "50", | |||
"backgroundImage": "bgImg-region-title", | |||
"colNum": 2, | |||
"alignY": "center", | |||
"paddingLeft": 32, | |||
"paddingRight": 32 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-title", | |||
"props": { | |||
"label": "${param.rListTitle}" | |||
} | |||
}, | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "新增", | |||
"leftIcon": "plus", | |||
"type": "primary", | |||
"action": "button:addCard", | |||
"linkType": "dialog", | |||
"fxLink": "dialog:rCardDialog", | |||
"fxLink_text": "${param.rCardTitle}", | |||
"preAction": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"label": "表格区", | |||
"colNum": 0 | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table", | |||
"props": { | |||
"label": "表格", | |||
"border": true, | |||
"stripe": true, | |||
"showHeader": true, | |||
"fit": true, | |||
"dataset": "${main.dataset}" | |||
}, | |||
"slots": { | |||
"button": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "编辑", | |||
"type": "primary", | |||
"leftIcon": "edit", | |||
"action": "button:editCard", | |||
"link": false, | |||
"text": true, | |||
"linkType": "dialog", | |||
"fxLink": "dialog:rCardDialog", | |||
"fxLink_text": "${param.rCardTitle}" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "删除", | |||
"type": "danger", | |||
"leftIcon": "delete", | |||
"action": "button:delCard", | |||
"nextAction":"button:loadList", | |||
"link": false, | |||
"text": true, | |||
"preAction": "" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
], | |||
"default": [ | |||
<#list main.fields as field> | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-table-column", | |||
"props": { | |||
"field": "${field.id}", | |||
"label": "${field.label}" | |||
} | |||
}<#if field_has_next>,</#if> | |||
</#list> | |||
] | |||
}, | |||
"events": {} | |||
} | |||
] | |||
} | |||
] | |||
} | |||
</#list> | |||
] | |||
}, | |||
{ | |||
"shape": "panel", | |||
"id": "fx-form-panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"shadow": "", | |||
"size": 24 | |||
}, | |||
"children": [] | |||
} | |||
] | |||
} | |||
}, | |||
<#list layout.rCard as rDialog> | |||
{ | |||
"page": { | |||
"id": "id${newId()}", | |||
"type": "fx-dialog", | |||
"props": { | |||
<#if (param.rCardTitle == "")> | |||
"title": "右表卡片", | |||
<#else> | |||
"title": "${param.rCardTitle}", | |||
</#if> | |||
"key": "rCardDialog", | |||
"closeOnClickModal": false | |||
}, | |||
"events": {} | |||
}, | |||
"graph": { | |||
"shape": "panel", | |||
"id": "root_panel", | |||
"type": "fx-split-panel", | |||
"props": { | |||
"horizontal": false, | |||
"shadow": "never" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-split-panel", | |||
"shape": "panel", | |||
"props": { | |||
"horizontal": false, | |||
"scroll": true, | |||
"backgroundColor": "--color-white" | |||
}, | |||
"children": [ | |||
<#assign dfields = rDialog.fields> | |||
<#assign col = param.rCardCol> | |||
<#include "incModel/inc_list_dialog.ftl"/> | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "0" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-divider", | |||
"props": { | |||
"label": "", | |||
"contentPosition": "center", | |||
"direction": "horizontal" | |||
} | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "${newId()}", | |||
"type": "fx-form-panel", | |||
"shape": "panel", | |||
"props": { | |||
"size": "56", | |||
"paddingRight": 10, | |||
"alignY": "center" | |||
}, | |||
"children": [ | |||
{ | |||
"id": "id${newId()}", | |||
"type": "fx-button-group", | |||
"props": { | |||
"menus": [], | |||
"textAlign": "right", | |||
"dataset": "${rDialog.dataset}" | |||
}, | |||
"slots": { | |||
"default": [ | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "保存", | |||
"leftIcon": "save", | |||
"type": "success", | |||
"action": "button:saveCard" | |||
}, | |||
"id": "id${newId()}" | |||
}, | |||
{ | |||
"type": "fx-button", | |||
"props": { | |||
"label": "关闭", | |||
"leftIcon": "close", | |||
"type": "", | |||
"action": "button:closeDialog", | |||
"nextAction": "button:loadList" | |||
}, | |||
"id": "id${newId()}" | |||
} | |||
] | |||
} | |||
} | |||
] | |||
} | |||
] | |||
} | |||
} | |||
</#list> | |||
<#list layout.lList as lQDialog> | |||
<#assign group = lQDialog > | |||
<#assign dialogKey = "lQueryDialog"> | |||
<#assign dialogTitle = "左列表高级筛选"> | |||
<#if (group.sfilters?size>0)> | |||
<#include "incModel/inc_query_sfilters.ftl"/> | |||
</#if> | |||
</#list> | |||
<#list layout.rList as rQDialog> | |||
<#assign group = rQDialog > | |||
<#assign dialogKey = "rQueryDialog"> | |||
<#assign dialogTitle = "右列表高级筛选"> | |||
<#if (group.sfilters?size>0)> | |||
<#include "incModel/inc_query_sfilters.ftl"/> | |||
</#if> | |||
</#list> | |||
], | |||
"model": [ | |||
<#list datasets as dataset> | |||
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if> | |||
</#list> | |||
], | |||
"option": { | |||
"widgetRef": [${widgetRef}], | |||
"vars": [] | |||
} | |||
} |
@@ -343,6 +343,8 @@ public interface SwEnum { | |||
public static StrEnumBean LC_LT = instance.addEnum("LC_LT", "列表卡片(左树+列表)"); | |||
public static StrEnumBean LC_MS = instance.addEnum("LC_MS", "列表卡片(主子表)"); | |||
public static StrEnumBean LC_LT_MS = instance.addEnum("LC_LT_MS", "列表卡片(左树+列表+主子表)"); | |||
public static StrEnumBean LC_LC_1 = instance.addEnum("LC_LC_1", "左列表+右列表(含卡片、左列表可编辑)"); | |||
public static StrEnumBean LC_LC_2 = instance.addEnum("LC_LC_2", "左列表+右列表(含卡片、左列表不可编辑)"); | |||
public static StrEnumBean FLOW_SINGLE = instance.addEnum("FLOW_SINGLE", "列表卡片(含工作流)"); | |||
} | |||