From 9bc5f4d58da606c6a465e152d05a1c31b0611f74 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期五, 30 五月 2025 18:04:27 +0800 Subject: [PATCH] 系统配置页面 --- igds-dzhwk-web/src/main/resources/static/ruoyi/js/common.js | 265 ++-- igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DeviceModbus.java | 101 + igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Depot.view.xml | 12 igds-dzhwk-view/src/main/java/models/igds.model.xml | 277 +++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/DepotConfRepository.java | 56 + igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotConfService.java | 251 ++++ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStore.view.xml | 476 +++++++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DepotConf.java | 165 +++ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotConf.view.xml | 509 +++++++++ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DeviceModbus.view.xml | 313 ++++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/GasModbus.java | 60 + igds-dzhwk-web/src/main/resources/static/ruoyi/js/ry-ui.js | 84 igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/DepotConfPR.java | 75 + igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStatusConfirm.view.xml | 460 ++++++++ 14 files changed, 2,929 insertions(+), 175 deletions(-) diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DepotConf.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DepotConf.java new file mode 100644 index 0000000..9031b6d --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DepotConf.java @@ -0,0 +1,165 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.igds.dzhwk.constant.Constant; +import com.fzzy.igds.dzhwk.constant.GrainFrequence; +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * 浠撳簱閰嶇疆 鐢ㄤ簬閰嶇疆绮儏鍒嗘満绛夐厤缃紝姘斾綋閲囬泦閰嶇疆绛� + */ +@Data +@Entity +@Table(name = "D_DEPOT_CONF") +public class DepotConf implements Serializable { + + + @Id + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炰粨搴�") + private String depotId; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 40) + @PropertyDef(label = "鎵�灞炲垎搴�") + private String deptId; + + @Column(name = "GRAIN_SER_", length = 40) + @PropertyDef(label = "绮儏鍒嗘満", description = "浠呬粎绮儏閲囬泦鍒嗘満") + private String grainSer; + + @Column(name = "TH_SER_", length = 40) + @PropertyDef(label = "娓╂箍搴﹀垎鏈�", description = "浠撴俯浠撴箍鐨勫垎鏈�") + private String thSer; + + @Column(name = "ES_SER_", length = 40) + @PropertyDef(label = "鑳借�楀垎鏈�") + private String esSer; + + @Column(name = "ES_SER_TAG_", length = 40) + @PropertyDef(label = "澶氳兘鑰楀垎鏈�") + private String esSerTag; + + @Column(name = "GAS_SER_", length = 40) + @PropertyDef(label = "姘斾綋鍒嗘満") + private String gasSer; + + @Column(name = "GAS_SER_TAG_", length = 40) + @PropertyDef(label = "澶氭皵浣撳垎鏈�") + private String gasSerTag; + + @Column(name = "PEST_SER_", length = 40) + @PropertyDef(label = "铏鍒嗘満") + private String pestSer; + + @Column(name = "PEST_SER_TAG_", length = 40) + @PropertyDef(label = "澶氳櫕瀹冲垎鏈�") + private String pestSerTag; + + @Column(name = "VERB_SER_", length = 40) + @PropertyDef(label = "閫氶鍒嗘満") + private String verbSer; + + @Column(name = "GRAIN_FREQ_", length = 4) + @PropertyDef(label = "绮儏淇濆瓨棰戠巼", description = "榛樿涓�澶╁娆�") + private String grainFreq = GrainFrequence.FREQ_01.getCode(); + + @Column(name = "TH_CONF_", length = 5) + @PropertyDef(label = "浠撴俯浠撴箍閫氶亾") + private String thConf = "1"; + + @Column(name = "CABLE_RULE_", length = 20) + @PropertyDef(label = "甯冪嚎瑙勫垯", description = "骞虫柟浠撹〃绀哄眰琛屽垪锛岀瓛浠撹〃绀烘瘡鍦堢殑鍒楁暟") + private String cableRule; + + @Column(name = "CABLE_CIR_", length = 20) + @PropertyDef(label = "绛掍粨灞傝鍒�", description = "閽堝绛掍粨") + private String cableCir; + + @Column(name = "CABLE_CONE_", length = 2) + @PropertyDef(label = "绛掍粨閿ュ舰", description = "閽堝绛掍粨閿ュ舰锛�0=鏃犲垽鏂紝1=涓婇敟褰紝2=涓嬮敟褰�") + private String cableCone = Constant.CABLE_CONE_0; + + @Column(name = "CABLE_START_") + @PropertyDef(label = "鐢电紗寮�濮嬪垪") + private int cableStart; + + @Column(name = "CABLE_END_") + @PropertyDef(label = "鐢电紗鎴嚦鍒�") + private int cableEnd; + + @Column(name = "START_ORIENTATION_", length = 20) + @PropertyDef(label = "鐢电紗璧峰鏂逛綅", description = "榛樿鍙宠竟(鍙宠竟銆佸彸涓娿�佸乏杈广�佸乏涓�)") + private String startOrientation = Constant.GRAIN_START_ORIENTATION_RIGHT; + + @Column(name = "START_DIRECTION_", length = 20) + @PropertyDef(label = "鐢电紗璧峰鏂瑰悜", description = "榛樿绾靛悜(绾靛悜銆佹í鍚�)") + private String startDirection = Constant.GRAIN_START_DIRECTION_PORTRAIT; + + @Column(name = "START_POINT_", length = 20) + @PropertyDef(label = "鐢电紗璧峰鐐逛綅", description = "榛樿椤堕儴(椤堕儴銆佸簳閮�)") + private String startPoint = Constant.GRAIN_START_POINT_TOP; + + @Column(name = "START_CONVERT_", length = 20) + @PropertyDef(label = "灞傝杞崲", description = "榛樿涓嶈浆鎹�(榛樿銆侀『鏃堕拡銆侀�嗘椂閽�)") + private String startConvert = Constant.GRAIN_CONVERT_DEFAULT; + + @Column(name = "TEMP_MAX_") + @PropertyDef(label = "娓╁害涓婇檺") + private Double tempMax; + + @Column(name = "GAS_START_") + @PropertyDef(label = "姘斾綋閲囬泦鐐瑰紑濮�") + private int gasStart; + + @Column(name = "GAS_END_") + @PropertyDef(label = "姘斾綋閲囬泦鐐规埅鑷�") + private int gasEnd; + + @Column(name = "N2_MAX_") + @PropertyDef(label = "姘皵涓婇檺") + private Double n2Max; + + @Column(name = "CO2_MAX_") + @PropertyDef(label = "浜屾哀鍖栫⒊涓婇檺") + private Double co2Max; + + @Column(name = "O2_MAX_") + @PropertyDef(label = "姘ф皵涓婇檺") + private Double o2Max; + + @Column(name = "PH3_MAX_") + @PropertyDef(label = "纾峰寲姘笂闄�") + private Double ph3Max; + + @Column(name = "PEST_START_") + @PropertyDef(label = "铏閲囬泦鐐瑰紑濮�") + private int pestStart; + + @Column(name = "PEST_END_") + @PropertyDef(label = "铏閲囬泦鐐规埅鑷�") + private int pestEnd; + + @Column(name = "PEST_MAX_") + @PropertyDef(label = "铏涓婇檺") + private Double pestMax; + + @Column(name = "IS_ONLY_TH_", length = 2) + @PropertyDef(label = "绮儏鏄惁娓╂箍搴�", description = "榛樿鍚︺��") + private String isOnlyTH = Constant.YN_N; + + // 浠撳簱鍚嶇О + @Transient + private String depotName; + + //浠撳簱绫诲瀷 + @Transient + private String depotType; + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DeviceModbus.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DeviceModbus.java new file mode 100644 index 0000000..53bdf9a --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DeviceModbus.java @@ -0,0 +1,101 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.igds.dzhwk.constant.BizType; +import com.fzzy.igds.dzhwk.constant.Constant; +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.List; + +/** + * 鏍规嵁璁惧閰嶇疆鐨凪odbus-TCP鍙傛暟閰嶇疆 + */ +@Data +@Entity +@Table(name = "D_DEVICE_MODBUS") +public class DeviceModbus implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "ID") + private String id; + + @Column(name = "DEVICE_CODE_", length = 40) + @PropertyDef(label = "璁惧缂栫爜") + private String deviceCode; + + @Column(name = "BIZ_TYEP_", length = 10) + @PropertyDef(label = "涓氬姟绫诲瀷") + private String bizType = BizType.AREATION.getCode(); + + @Column(name = "OPEN_", length = 10) + @PropertyDef(label = "寮�鍦板潃", description = "寮�鍦板潃銆佽兘鑰楄鍙栧湴鍧�") + private String open = Constant.YN_N; + + + @Column(name = "OPEN_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String openFun = "99"; + + @Column(name = "CLOSE_", length = 10) + @PropertyDef(label = "鍏冲湴鍧�", description = "鍏冲湴鍧�銆佺┖璋冩俯搴﹁缃湴鍧�") + private String close = Constant.YN_N; + + @Column(name = "CLOSE_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String closeFun = "99"; + + @Column(name = "STOP_", length = 10) + @PropertyDef(label = "鍋滃湴鍧�") + private String stop = Constant.YN_N; + + @Column(name = "STOP_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String stopFun = "99"; + + @Column(name = "OPEN_END_", length = 10) + @PropertyDef(label = "寮�鍒颁綅鍦板潃", description = "寮�鍒颁綅鍦板潃銆佽繍琛岀姸鎬佸湴鍧�(椋庢満鍜岀┖璋�)") + private String openEnd = Constant.YN_N; + + @Column(name = "OPEN_END_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String openEndFun = "99"; + + @Column(name = "CLOSE_END_", length = 10) + @PropertyDef(label = "鍏冲埌浣嶅湴鍧�") + private String closeEnd = Constant.YN_N; + + @Column(name = "CLOSE_END_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String closeEndFun = "99"; + + @Column(name = "OPEN_ERROR_", length = 10) + @PropertyDef(label = "寮�鏁呴殰鍦板潃") + private String openError = Constant.YN_N; + + @Column(name = "OPEN_ERROR_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String openErrorFun = "99"; + + @Column(name = "CLOSE_ERROR_", length = 10) + @PropertyDef(label = "鍏虫晠闅滃湴鍧�") + private String closeError = Constant.YN_N; + + @Column(name = "CLOSE_ERROR_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String closeErrorFun = "99"; + + //杞存祦椋庢満鍜岃酱娴佺獥鍙兘涓嶅湪涓�涓垎鏈轰笂锛孖P涓嶅悓 + @Column(name = "SER_ID_", length = 10) + @PropertyDef(label = "鎵�灞炲垎鏈�") + private String serId; + + + @Transient + private List<GasModbus> listGas; + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/GasModbus.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/GasModbus.java new file mode 100644 index 0000000..9d4c3d6 --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/GasModbus.java @@ -0,0 +1,60 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.igds.dzhwk.constant.Constant; +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.io.Serializable; + +/** + * 閰嶇疆娴嬫皵鍜屾祴铏殑MODBUS锛峊CP閰嶇疆淇℃伅 + */ +@Data +@Entity +@Table(name = "D_GAS_MODBUS") +public class GasModbus implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "ID") + private String id; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炰粨搴�") + private String depotId; + + @Column(name = "PASS_CODE_") + @PropertyDef(label = "閫氶亾") + private int passcode; + + @Column(name = "CO2_", length = 10) + @PropertyDef(label = "浜屾哀鍖栫⒊") + private String co2 = Constant.YN_N; + + @Column(name = "CO2_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String co2Fun = "99"; + + @Column(name = "O2_", length = 10) + @PropertyDef(label = "姘ф皵") + private String o2 = Constant.YN_N; + + @Column(name = "O2_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String o2Fun = "99"; + + @Column(name = "PH3_", length = 10) + @PropertyDef(label = "纾峰寲姘�") + private String ph3= Constant.YN_N; + + @Column(name = "PH3_FUN", length = 4) + @PropertyDef(label = "鍔熻兘鍙�") + private String ph3Fun = "99"; + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotConfService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotConfService.java new file mode 100644 index 0000000..61d9d7b --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotConfService.java @@ -0,0 +1,251 @@ +package com.fzzy.igds.sys; + +import com.fzzy.igds.dzhwk.constant.RedisConst; +import com.fzzy.igds.dzhwk.domain.Depot; +import com.fzzy.igds.dzhwk.domain.DepotConf; +import com.fzzy.igds.sys.repository.DepotConfRepository; +import com.fzzy.igds.util.ContextUtil; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.StringUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Description + * @Author CZT + * @Date 2024/11/25 14:56 + */ +@Slf4j +@Service("sys.depotConfService") +public class DepotConfService { + + @Resource + private DepotConfRepository depotConfRepository; + @Resource + private DepotService depotService; + @Resource + private RedisCache redisCache; + + /** + * jpa鏌ヨ閰嶇疆淇℃伅 + * + * @param companyId + * @param deptId + * @return + */ + public List<DepotConf> getConfList(String companyId, String deptId) { + + if (StringUtils.isEmpty(companyId)) { + companyId = ContextUtil.getCompanyId(); + } + if (StringUtils.isEmpty(deptId)) { + deptId = ContextUtil.subDeptId(null); + } + //鏌ヨ閰嶇疆淇℃伅 + List<DepotConf> list = depotConfRepository.getDepotConf(companyId, deptId); + //閰嶇疆淇℃伅涓虹┖锛屽垯鑷姩鐢熸垚 + if(null == list || list.isEmpty()){ + addConfByDepot(companyId); + } + return depotConfRepository.getDepotConf(companyId, deptId); + } + + /** + * jpa鏇存柊淇濆瓨閰嶇疆淇℃伅 + * + * @param conf + */ + public void saveConf(DepotConf conf) { + if (StringUtils.isEmpty(conf.getCompanyId())) { + conf.setCompanyId(ContextUtil.getCompanyId()); + } + if (StringUtils.isEmpty(conf.getDeptId())) { + conf.setDeptId(ContextUtil.subDeptId(null)); + } + depotConfRepository.save(conf); + flushConfCache(conf.getCompanyId()); + } + + /** + * jpa鍒犻櫎閰嶇疆淇℃伅 + * + * @param conf + * @return + */ + public void deleteDepotConf(DepotConf conf) { + depotConfRepository.delete(conf); + + //鍒犻櫎閰嶇疆缂撳瓨 + this.delCacheDepotConf(conf, conf.getCompanyId()); + } + + /** + * 璁剧疆缂撳瓨淇℃伅 + * + * @param list + * @param companyId + */ + public void setCacheDepotConf(List<DepotConf> list, String companyId) { + if (null != list) { + Depot depot; + String key; + for (DepotConf depotConf : list) { + depot = depotService.getCacheDepot(companyId, depotConf.getDepotId()); + if (null != depot) { + depotConf.setDepotName(depot.getName()); + depotConf.setDepotType(depot.getDepotType()); + } + key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotConf.getDepotId()); + redisCache.setCacheObject(key, depotConf); + } + } + } + + /** + * 鍒犻櫎缂撳瓨淇℃伅 + * + * @param depotConf + * @param companyId + */ + public void delCacheDepotConf(DepotConf depotConf, String companyId) { + if (null == depotConf) { + return; + } + if (StringUtils.isEmpty(companyId)) { + companyId = ContextUtil.getCompanyId(); + } + String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotConf.getDepotId()); + redisCache.deleteObject(key); + } + + /** + * 鑾峰彇缂撳瓨-鏍规嵁缁勭粐缂栫爜鑾峰彇閰嶇疆淇℃伅闆嗗悎 + * + * @param companyId + * @return + */ + public List<DepotConf> getCacheDepotConfList(String companyId) { + if (StringUtils.isEmpty(companyId)) { + companyId = ContextUtil.getCompanyId(); + } + String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF) + "*"; + + Collection<String> keys = redisCache.keys(patten); + if (null == keys || keys.isEmpty()) { + return null; + } + + List<DepotConf> result = new ArrayList<>(); + for (String key : keys) { + result.add((DepotConf) redisCache.getCacheObject(key)); + } + + return result; + } + + /** + * 鑾峰彇缂撳瓨-鏍规嵁缁勭粐缂栫爜鍜岀伯鎯呭垎鏈篒D鑾峰彇閰嶇疆淇℃伅闆嗗悎 + * + * @param companyId + * @param serId + * @return + */ + public List<DepotConf> getCacheDepotConfList(String companyId, String serId) { + List<DepotConf> list = getCacheDepotConfList(companyId); + + if (null == list || list.isEmpty()) { + return null; + } + return list.stream() + .filter(item -> null != item.getGrainSer() && item.getGrainSer().equals(serId)) + .collect(Collectors.toList()); + } + + /** + * 鑾峰彇缂撳瓨-鏍规嵁缁勭粐缂栫爜鍜岀伯鎯呭垎鏈篒D鑾峰彇閰嶇疆淇℃伅 + * + * @param companyId + * @param serId + * @return + */ + public DepotConf getCacheDepotConfBySerId(String companyId, String serId) { + List<DepotConf> data = getCacheDepotConfList(companyId); + if (null == data) { + return null; + } + + return data.stream().filter(item -> (serId.equals(item.getGrainSer()) || serId.equals(item.getGasSer()) || serId.equals(item.getEsSer()))) + .findAny().orElse(null); + } + + /** + * 鑾峰彇缂撳瓨-鏍规嵁缁勭粐缂栫爜鍜屼粨搴撶紪鐮佽幏鍙栭厤缃俊鎭� + * + * @param companyId + * @param depotId + * @return + */ + public DepotConf getCacheDepotConfByDepotId(String companyId, String depotId) { + if (StringUtils.isEmpty(depotId)) { + return null; + } + if (StringUtils.isEmpty(companyId)) { + companyId = ContextUtil.getCompanyId(); + } + String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotId); + DepotConf depotConf = redisCache.getCacheObject(key); + if (null == depotConf) { + depotConf = depotConfRepository.getDepotConfByDepotId(companyId, depotId); + redisCache.setCacheObject(key, depotConf); + } + + return depotConf; + } + + /** + * 鏍规嵁浠撳簱鍒楄〃锛岃嚜鍔ㄧ敓鎴愪粨搴撻厤缃俊鎭� + * @param companyId + */ + private void addConfByDepot(String companyId) { + List<Depot> list = depotService.getCacheDepotList(companyId); + if (null == list || list.isEmpty()) { + return; + } + DepotConf conf; + for (Depot depot : list) { + conf = new DepotConf(); + conf.setDepotId(depot.getId()); + conf.setCompanyId(depot.getCompanyId()); + conf.setDeptId(depot.getDeptId()); + this.saveConf(conf); + } + } + + /** + * 鍒锋柊浠撳簱閰嶇疆缂撳瓨 + * @param companyId + */ + public void flushConfCache(String companyId) { + if (StringUtils.isEmpty(companyId)) { + companyId = ContextUtil.getCompanyId(); + } + + List<DepotConf> list = depotConfRepository.getDepotConfByCompanyId(companyId); + + this.setCacheDepotConf(list, companyId); + } + + /** + * 鏇存柊绮儏淇濆瓨棰戠巼 + * @param freq + */ + public void updateFreq(String freq) { + depotConfRepository.updateGrainFreq(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null), freq); + } +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/DepotConfRepository.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/DepotConfRepository.java new file mode 100644 index 0000000..bbbe8ed --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/DepotConfRepository.java @@ -0,0 +1,56 @@ +package com.fzzy.igds.sys.repository; + +import com.fzzy.igds.dzhwk.domain.DepotConf; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Description + * @Author CZT + * @Date 2024/11/25 14:59 + */ +@Service +public interface DepotConfRepository extends JpaRepository<DepotConf, String> { + + /** + * 鏍规嵁缁勭粐缂栫爜鑾峰彇浠撳簱璐т綅淇℃伅 + * + * @param companyId + * @return + */ + @Query("from DepotConf where companyId =:companyId order by depotId") + List<DepotConf> getDepotConfByCompanyId(@Param("companyId") String companyId); + + /** + * 鏍规嵁缁勭粐缂栫爜鍜屽簱鍖虹紪鐮佽幏鍙栦粨搴撹揣浣嶄俊鎭� + * + * @param companyId + * @param deptId + * @return + */ + @Query("from DepotConf where companyId =:companyId and deptId =:deptId order by depotId") + List<DepotConf> getDepotConf(@Param("companyId") String companyId, @Param("deptId") String deptId); + + + /** + * 鏍规嵁缁勭粐缂栫爜鍜屼粨搴撶紪鐮佽幏鍙栦粨搴撹揣浣嶄俊鎭� + * @param companyId + * @param depotId + * @return + */ + @Query("from DepotConf where companyId =:companyId and depotId =:depotId") + DepotConf getDepotConfByDepotId(@Param("companyId") String companyId, @Param("depotId") String depotId); + + + @Transactional + @Modifying + @Query("update DepotConf set grainFreq=:grainFreq where companyId=:companyId and deptId =:deptId") + int updateGrainFreq(@Param("grainFreq") String grainFreq, @Param("companyId") String companyId, @Param("deptId") String deptId); + +} diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Depot.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Depot.view.xml index 2d944c8..72917bc 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Depot.view.xml +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Depot.view.xml @@ -131,18 +131,8 @@ */
 query = function(){
 view.get("#dataSetdepot").flushAsync();
 -}
 -//鎵撳嵃璐т綅鍗�
 -printBill = function (htmlStr) {
 - var LODOP = CLODOP;
 - LODOP.PRINT_INIT("璐т綅鍗�");
 - LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
 - //LODOP.SET_PRINT_PAGESIZE(1, 0, '90mm', "A4");
 - LODOP.ADD_PRINT_HTM(0, 0, "96%", "100%", htmlStr);
 - LODOP.PREVIEW();
 -};</ClientEvent> +}
</ClientEvent> <Property name="packages">font-awesome,css-common</Property> - <Property name="javaScriptFile">./static/js/plugins/lodop/LodopFuncs.js</Property> <DataSet id="dataSetdepot"> <Property name="dataProvider">depotPR#getData</Property> <Property name="dataType">[dtDepot]</Property> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotConf.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotConf.view.xml new file mode 100644 index 0000000..0b63371 --- /dev/null +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotConf.view.xml @@ -0,0 +1,509 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViewConfig> + <Arguments/> + <Context/> + <Model/> + <View layout="padding:5;regionPadding:5"> + <ClientEvent name="onReady">var depotList = null;
 +</ClientEvent> + <Property name="packages">font-awesome,css-common</Property> + <DataSet id="dsMain"> + <Property name="dataProvider">depotConfPR#getConfList</Property> + <Property name="dataType">[dtDepotConf]</Property> + </DataSet> + <Container layout="regionPadding:10" layoutConstraint="top"> + <Property name="exClassName">bg-color</Property> + <Property name="height">55</Property> + <Property name="contentOverflow">hidden</Property> + <Label layoutConstraint="left"> + <Property name="text">鑿滃崟鏍忥細</Property> + </Label> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsMain").insert();
 +view.get("#depotId").set("readOnly",false);
 +view.get("#dgMain").show();</ClientEvent> + <Property name="caption">鏂板</Property> + <Property name="exClassName">btn1</Property> + <Property name="iconClass">fa fa-plus</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">var select = view.get("#dataGridMain").get("selection");
 +if(select){
 + view.get("#dgMain").show();
 + view.get("#depotId").set("readOnly",true);
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 +}</ClientEvent> + <Property name="caption">淇敼</Property> + <Property name="exClassName">btn2</Property> + <Property name="iconClass">fa fa-pencil</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">
 +
 +var select = view.get("#dataGridMain").get("selection");
 +if(select){
 + view.get("#ajaxDel2").set("parameter",select).execute(function(result){
 + if(result){
 + $alert(result);
 + }else{
 + entity.remove();
 + }
 + });
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 +}</ClientEvent> + <Property name="caption">鍒犻櫎</Property> + <Property name="exClassName">btn3</Property> + <Property name="iconClass">fa fa-trash-o</Property> + </Button> + <Button layoutConstraint="left"> + <Property name="caption">鍒锋柊缂撳瓨</Property> + <Property name="exClassName">btn-flush</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="action">ajaxRefreshCache</Property> + </Button> + </Container> + <DataGrid id="dataGridMain" layoutConstraint="center "> + <ClientEvent name="onDataRowDoubleClick">var cur = view.get("#dsMain.data:#");
 +if(!cur) return ;
 +view.get("#depotId").set("readOnly",true);
 +view.get("#dgMain").show();</ClientEvent> + <Property name="dataSet">dsMain</Property> + <Property name="readOnly">true</Property> + <Property name="selectionMode">singleRow</Property> + <RowSelectorColumn/> + <RowNumColumn/> + <DataColumn name="depotId"> + <Property name="property">depotId</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="grainSer"> + <Property name="property">grainSer</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn> + <Property name="property">cableRule</Property> + <Property name="align">center</Property> + <Property name="name">cableRule</Property> + </DataColumn> + <DataColumn name="cableCir"> + <Property name="property">cableCir</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="tempMax"> + <Property name="property">tempMax</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="grainFreq"> + <Property name="property">grainFreq</Property> + </DataColumn> + <DataColumn name="n2Max"> + <Property name="property">n2Max</Property> + </DataColumn> + <DataColumn name="co2Max"> + <Property name="property">co2Max</Property> + </DataColumn> + <DataColumn name="o2Max"> + <Property name="property">o2Max</Property> + </DataColumn> + <DataColumn name="ph3Max"> + <Property name="property">ph3Max</Property> + </DataColumn> + </DataGrid> + <UpdateAction id="uaMain"> + <Property name="dataResolver">depotConfPR#saveConf</Property> + <UpdateItem> + <Property name="dataSet">dsMain</Property> + <Property name="dataPath">[#current]</Property> + </UpdateItem> + </UpdateAction> + <AjaxAction id="ajaxRefreshCache"> + <Property name="service">depotConfPR#flushConfCache</Property> + <Property name="successMessage">鍒锋柊鎴愬姛锛�</Property> + <Property name="confirmMessage">纭畾瑕佸埛鏂扮紦瀛樹箞锛�</Property> + </AjaxAction> + <Dialog id="dgMain" layout="regionPadding:10"> + <ClientEvent name="onShow">//鏍规嵁浠撳簱绫诲瀷涓嶅悓锛屾樉绀轰笉鍚岀殑閰嶇疆淇℃伅</ClientEvent> + <Property name="caption">妫�娴嬮厤缃弬鏁�</Property> + <Property name="width">75%</Property> + <Property name="closeable">false</Property> + <Property name="height">600</Property> + <Buttons> + <Button> + <ClientEvent name="onClick">view.get("#uaMain").execute(function(){
 + view.get("#dgMain").hide();
 +});</ClientEvent> + <Property name="iconClass">fa fa-check</Property> + <Property name="caption">纭鏇存柊</Property> + <Property name="exClassName">btn1</Property> + </Button> + <Button> + <ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
 +view.get("#dgMain").hide();</ClientEvent> + <Property name="caption">鍙栨秷鏇存柊</Property> + <Property name="iconClass">fa fa-share-square-o</Property> + <Property name="exClassName">btn3</Property> + </Button> + </Buttons> + <Children> + <FieldSet layout="padding:5"> + <Property name="caption">绮俯妫�娴嬮厤缃�</Property> + <Buttons/> + <Children> + <AutoForm layoutConstraint="padding:5"> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*,*,*</Property> + <Property name="labelSeparator">锛�</Property> + <Property name="labelWidth">120</Property> + <AutoFormElement id="depotId"> + <Property name="name">depotId</Property> + <Property name="property">depotId</Property> + <Property name="readOnly">true</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">cableRule</Property> + <Property name="property">cableRule</Property> + <Property name="label">甯冪嚎瑙勫垯</Property> + <Editor/> + </AutoFormElement> + <Label layoutConstraint="colSpan:2"> + <Property name="text">璇存槑锛氬钩鏂逛粨锛氬眰-琛�-鍒楋紝绛掍粨锛氱1鍦堟牴鏁�-绗�2鍦堟牴鏁�-绗琻鍦堟牴鏁�</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">grainSer</Property> + <Property name="property">grainSer</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">cableCir</Property> + <Property name="property">cableCir</Property> + <Property name="label">灞傝鍒�</Property> + <Editor/> + </AutoFormElement> + <Label layoutConstraint="colSpan:2"> + <Property name="text">璇存槑锛氬彧閽堝绛掍粨锛氱1鍦堝眰鏁�-绗�2鍦堝眰鏁�-绗琻鍦堝眰鏁�</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">cableStart</Property> + <Property name="property">cableStart</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">cableEnd</Property> + <Property name="property">cableEnd</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="property">startConvert</Property> + <Property name="name">startConvert</Property> + <Property name="editable">false</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="property">cableCone</Property> + <Property name="name">cableCone</Property> + <Property name="editable">false</Property> + <Property name="trigger">autoMappingDropDown1</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">tempMax</Property> + <Property name="property">tempMax</Property> + <Property name="label">绮俯涓婇檺</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="property">startOrientation</Property> + <Property name="name">startOrientation</Property> + <Property name="editable">false</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="property">startDirection</Property> + <Property name="name">startDirection</Property> + <Property name="editable">false</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="property">startPoint</Property> + <Property name="name">startPoint</Property> + <Property name="editable">false</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">thSer</Property> + <Property name="property">thSer</Property> + <Property name="trigger">autoMappingDropDown2</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">thConf</Property> + <Property name="property">thConf</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">isOnlyTH</Property> + <Property name="property">isOnlyTH</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璇存槑锛氶粯璁ょ伯鎯呯數缂嗭紝涓烘俯婀垮害璁惧闇�閫夋嫨锛�</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">grainFreq</Property> + <Property name="property">grainFreq</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var grainFreq = view.get("#dsMain.data:#").get("grainFreq");
 +
 +if(grainFreq){
 + view.get("#ajaxUpdateFreq").set("parameter",grainFreq).execute(function(){
 + view.get("#dgMain").hide();
 + view.get("#dsMain").flushAsync();
 + });
 +}else{
 + $alert("璇峰厛閰嶇疆鏇存柊棰戠巼锛�")
 +}</ClientEvent> + <Property name="caption">棰戠巼鍚屾</Property> + <Property name="tip">鏇存柊鎵�鏈変粨搴撻鐜囦竴鑷�</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn2</Property> + </Button> + </AutoForm> + </Children> + </FieldSet> + <FieldSet layout="padding:5"> + <Property name="caption">姘斾綋妫�娴嬮厤缃�</Property> + <Buttons/> + <Children> + <AutoForm layoutConstraint="padding:5"> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*,*,*</Property> + <Property name="labelSeparator">锛�</Property> + <Property name="labelWidth">120</Property> + <AutoFormElement> + <Property name="name">gasSer</Property> + <Property name="property">gasSer</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">gasStart</Property> + <Property name="property">gasStart</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">gasEnd</Property> + <Property name="property">gasEnd</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 +var path = "com.fzzy.igds.sys.GasModbus.d?depotId="+depotId;
 +view.get("#iframModbus").set("path",path);
 +view.get("#dialogModbus").show();</ClientEvent> + <Property name="caption">Modbus閰嶇疆</Property> + <Property name="tip">閽堝Modbus鍗忚鐨勯厤缃�</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn4</Property> + </Button> + <AutoFormElement> + <Property name="name">gasSerTag</Property> + <Property name="property">gasSerTag</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 +var path = "com.fzzy.igds.sys.GasSerConf.d?depotId="+depotId;
 +view.get("#iframGasSerConf").set("path",path);
 +view.get("#dialogGasSerConf").show();</ClientEvent> + <Property name="caption">澶氭皵浣撳垎鏈洪厤缃�</Property> + <Property name="tip">閽堝澶氭皵浣撳垎鏈虹殑閰嶇疆</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn2</Property> + </Button> + <Label layoutConstraint="colSpan:2"> + <Property name="text">璇存槑锛氬姘斾綋鍒嗘満鏃讹紝鎵�鏈夊垎鏈洪渶瑕佸叏閮ㄩ厤缃�傛皵浣撴娴嬮厤缃�氶亾榛樿鍏ㄩ儴閫氶亾锛�</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">n2Max</Property> + <Property name="property">n2Max</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">co2Max</Property> + <Property name="property">co2Max</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">o2Max</Property> + <Property name="property">o2Max</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">ph3Max</Property> + <Property name="property">ph3Max</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + </FieldSet> + <FieldSet layout="padding:5"> + <Property name="caption">铏妫�娴嬮厤缃�</Property> + <Buttons/> + <Children> + <AutoForm layoutConstraint="padding:5"> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*,*,*</Property> + <Property name="labelSeparator">锛�</Property> + <Property name="labelWidth">120</Property> + <AutoFormElement> + <Property name="name">pestSer</Property> + <Property name="property">pestSer</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">pestStart</Property> + <Property name="property">pestStart</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">pestEnd</Property> + <Property name="property">pestEnd</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 +var path = "com.fzzy.igds.modbus.PestModbus.d?depotId="+depotId;
 +view.get("#iframModbus").set("path",path);
 +view.get("#dialogModbus").show();</ClientEvent> + <Property name="caption">Modbus閰嶇疆</Property> + <Property name="tip">閽堝Modbus鍗忚鐨勯厤缃�</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn4</Property> + </Button> + <AutoFormElement> + <Property name="name">pestSerTag</Property> + <Property name="property">pestSerTag</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 +var path = "com.fzzy.igds.sys.GasSerConf.d?depotId="+depotId;
 +view.get("#iframGasSerConf").set("path",path);
 +view.get("#dialogGasSerConf").show();</ClientEvent> + <Property name="caption">澶氳櫕瀹冲垎鏈洪厤缃�</Property> + <Property name="tip">閽堝澶氳櫕瀹冲垎鏈虹殑閰嶇疆</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn2</Property> + </Button> + <Label layoutConstraint="colSpan:2"> + <Property name="text">璇存槑锛氬铏鍒嗘満鏃讹紝鎵�鏈夊垎鏈洪渶瑕佸叏閮ㄩ厤缃�傝櫕瀹虫娴嬮厤缃�氶亾榛樿鍏ㄩ儴閫氶亾锛�</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">pestMax</Property> + <Property name="property">pestMax</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + </FieldSet> + <FieldSet layout="padding:5"> + <Property name="caption">鍏朵粬閰嶇疆</Property> + <Buttons/> + <Children> + <AutoForm layoutConstraint="padding:5"> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*,*,*</Property> + <Property name="labelSeparator">锛�</Property> + <Property name="labelWidth">100</Property> + <AutoFormElement> + <Property name="name">esSer</Property> + <Property name="property">esSer</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">esSerTag</Property> + <Property name="property">esSerTag</Property> + <Editor/> + </AutoFormElement> + <Button> + <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 +var path = "com.fzzy.igds.sys.GasSerConf.d?depotId="+depotId;
 +view.get("#iframGasSerConf").set("path",path);
 +view.get("#dialogGasSerConf").show();</ClientEvent> + <Property name="caption">澶氳兘鑰楀垎鏈洪厤缃�</Property> + <Property name="tip">閽堝澶氳兘鑰楀垎鏈虹殑閰嶇疆</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="exClassName">btn2</Property> + </Button> + <Label layoutConstraint="colSpan:1"> + <Property name="text">璇存槑锛氬鑳借�楀垎鏈烘椂锛屾墍鏈夊垎鏈洪渶瑕佸叏閮ㄩ厤缃��</Property> + <Property name="style"> + <Property name="color">blue</Property> + </Property> + </Label> + <AutoFormElement layoutConstraint="colSpan:3"> + <Property name="name">verbSer</Property> + <Property name="property">verbSer</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + </FieldSet> + </Children> + <Tools/> + </Dialog> + <AjaxAction id="ajaxUpdateFreq"> + <Property name="confirmMessage">纭畾瑕佹洿鏂版墍鏈変粨搴擄紵</Property> + <Property name="service">depotConfPR#updateFreq</Property> + </AjaxAction> + <AjaxAction id="ajaxDel2"> + <Property name="successMessage">鍒犻櫎鎴愬姛</Property> + <Property name="service">depotConfPR#delDepotConf</Property> + <Property name="executingMessage">姝e湪鍒犻櫎</Property> + <Property name="confirmMessage">纭畾瑕佸垹闄や箞锛�</Property> + </AjaxAction> + <Dialog id="dialogModbus"> + <Property name="width">80%</Property> + <Property name="height">95%</Property> + <Property name="caption">Modbus-TCP閰嶇疆</Property> + <Buttons/> + <Children> + <IFrame id="iframModbus"> + <Property name="path">com.fzzy.igds.sys.GasModbus.d</Property> + </IFrame> + </Children> + <Tools/> + </Dialog> + <Dialog id="dialogGasSerConf"> + <Property name="width">80%</Property> + <Property name="height">95%</Property> + <Property name="caption">姘斾綋澶氬垎鏈洪厤缃�</Property> + <Buttons/> + <Children> + <IFrame id="iframGasSerConf"> + <Property name="path">com.fzzy.igds.sys.GasSerConf.d</Property> + </IFrame> + </Children> + <Tools/> + </Dialog> + </View> +</ViewConfig> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStatusConfirm.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStatusConfirm.view.xml new file mode 100644 index 0000000..2818360 --- /dev/null +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStatusConfirm.view.xml @@ -0,0 +1,460 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViewConfig> + <Arguments/> + <Context/> + <Model> + <DataType name="dtMain"> + <Property name="creationType">com.fzzy.igds.dzhwk.domain.DepotStatusConfirm</Property> + <PropertyDef name="fcqrdh"> + <Property></Property> + <Property name="label">灏佷粨纭鍗曞彿</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="companyId"> + <Property></Property> + <Property name="label">缁勭粐缂栫爜</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="deptId"> + <Property></Property> + <Property name="label">鎵�灞炲簱鍖�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deptPR#loadParents").getResult()}</Property> + <Property name="keyProperty">deptId</Property> + <Property name="valueProperty">deptName</Property> + </Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="depotId"> + <Property></Property> + <Property name="label">璐т綅</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="fcrq"> + <Property name="dataType">Date</Property> + <Property name="label">灏佷粨鏃ユ湡</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="foodVariety"> + <Property></Property> + <Property name="label">绮鍝佺</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("FOOD_VARIETY_")}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="foodType"> + <Property></Property> + <Property name="label">绮鎬ц川</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("FOOD_TYPE_")}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="foodLevel"> + <Property></Property> + <Property name="label">绮绛夌骇</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerFoodLevel").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="foodLocation"> + <Property></Property> + <Property name="label">浜у湴鍚嶇О</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="foodYear"> + <Property></Property> + <Property name="label">鏀惰揣骞村害</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="country"> + <Property></Property> + <Property name="label">鍥藉埆</Property> + <Property name="readOnly">true</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("GB_")}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="storeKeeperName"> + <Property></Property> + <Property name="label">淇濈鍛�</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="fcsl"> + <Property name="dataType">Double</Property> + <Property name="label">灏佷粨鏁伴噺</Property> + <Property name="readOnly">true</Property> + <Property name="displayFormat">#,##0 KG</Property> + </PropertyDef> + <PropertyDef name="applyUser"> + <Property></Property> + <Property name="label">鐢宠浜�</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="deptAuditUser"> + <Property></Property> + <Property name="label">閮ㄩ棬瀹℃牳浜�</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="leaderAuditUser"> + <Property></Property> + <Property name="label">棰嗗瀹℃牳浜�</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="remarks"> + <Property></Property> + <Property name="label">澶囨敞淇℃伅</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + <PropertyDef name="updateTime"> + <Property name="dataType">Date</Property> + <Property name="label">鏁版嵁鏇存柊鏃堕棿</Property> + <Property name="readOnly">true</Property> + </PropertyDef> + </DataType> + <DataType name="dtQuery"> + <PropertyDef name="depotId"> + <Property></Property> + <Property name="label">浠撳簱璐т綅</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="start"> + <Property></Property> + <Property name="label">寮�濮嬫棩鏈�</Property> + <Property name="dataType">Date</Property> + </PropertyDef> + <PropertyDef name="end"> + <Property></Property> + <Property name="label">缁撴潫鏃ユ湡</Property> + <Property name="dataType">Date</Property> + </PropertyDef> + </DataType> + </Model> + <View layout="padding:5;regionPadding:5"> + <ClientEvent name="onReady">view.get("#dsQuery").insert();
 +
 +</ClientEvent> + <Property name="packages">font-awesome,css-common</Property> + <DataSet id="dsMain"> + <Property name="dataProvider"> depotStatusConfirmPR#pageDepotStatusConfirm</Property> + <Property name="pageSize">20</Property> + <Property name="loadMode">lazy</Property> + <Property name="dataType">[dtMain]</Property> + </DataSet> + <DataSet id="dsQuery"> + <Property name="dataType">dtQuery</Property> + </DataSet> + <AutoForm> + <Property name="cols">*,*,*,*,*</Property> + <Property name="exClassName">bg-color</Property> + <Property name="dataSet">dsQuery</Property> + <AutoFormElement> + <Property name="name">depotId</Property> + <Property name="property">depotId</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">start</Property> + <Property name="property">start</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">end</Property> + <Property name="property">end</Property> + <Editor/> + </AutoFormElement> + <Container layout="hbox regionPadding:10" layoutConstraint="colSpan:2"> + <Button> + <ClientEvent name="onClick">var param = view.get("#dsQuery.data");
 +view.get("#dsMain").set("parameter",param.toJSON()).flushAsync(); </ClientEvent> + <Property name="caption">鏌ヨ</Property> + <Property name="iconClass">fa fa-search</Property> + <Property name="exClassName">btn1</Property> + </Button> + <Button> + <ClientEvent name="onClick">var select = view.get("#dgMain").get("selection");
 +if(select){
 + view.get("#dialogMain").show();
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 +}</ClientEvent> + <Property name="caption">鏌ョ湅璇︽儏</Property> + <Property name="iconClass">fa fa-pencil</Property> + <Property name="exClassName">btn2</Property> + </Button> + <Button> + <ClientEvent name="onClick">
 +var select = view.get("#dgMain").get("selection");
 +if(select){
 + view.get("#ajaxDel").set("parameter",select).execute(function(){
 + select.remove();
 + });
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 +}
 +</ClientEvent> + <Property name="action">actionDeviceDelete</Property> + <Property name="iconClass">fa fa-minus</Property> + <Property name="caption">鍒犻櫎</Property> + <Property name="exClassName">btn3</Property> + </Button> + </Container> + </AutoForm> + <DataGrid id="dgMain" layoutConstraint="center "> + <ClientEvent name="onDataRowDoubleClick">view.get("#actionDeviceUpdate").execute();</ClientEvent> + <Property name="dataSet">dsMain</Property> + <Property name="readOnly">true</Property> + <Property name="selectionMode">singleRow</Property> + <RowSelectorColumn/> + <RowNumColumn/> + <DataColumn name="fcqrdh"> + <Property name="property">fcqrdh</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="depotId"> + <Property name="property">depotId</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="fcrq"> + <Property name="property">fcrq</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodVariety"> + <Property name="property">foodVariety</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodType"> + <Property name="property">foodType</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodLevel"> + <Property name="property">foodLevel</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodLocation"> + <Property name="property">foodLocation</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodYear"> + <Property name="property">foodYear</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="storeKeeperName"> + <Property name="property">storeKeeperName</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="fcsl"> + <Property name="property">fcsl</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="updateTime"> + <Property name="property">updateTime</Property> + <Property name="align">center</Property> + </DataColumn> + </DataGrid> + <ToolBar layoutConstraint="bottom"> + <Fill/> + <DataPilot layoutConstraint="right"> + <Property name="dataSet">dsMain</Property> + <Property name="itemCodes">pageSize,pages</Property> + </DataPilot> + </ToolBar> + <Dialog id="dialogMain"> + <ClientEvent name="onHide">view.id("dsMain").getData().cancel();</ClientEvent> + <Property name="caption">缂栬緫椤甸潰</Property> + <Property name="width">800</Property> + <Buttons> + <Button> + <ClientEvent name="onClick">view.get("#dialogMain").hide();</ClientEvent> + <Property name="caption">鍙栨秷</Property> + <Property name="action">actionCancel</Property> + <Property name="width">90</Property> + <Property name="iconClass">fa fa-times-circle-o</Property> + <Property name="exClassName">btn3</Property> + </Button> + </Buttons> + <Children> + <AutoForm> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*</Property> + <Property name="labelWidth">100</Property> + <AutoFormElement> + <Property name="name">fcqrdh</Property> + <Property name="property">fcqrdh</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">companyId</Property> + <Property name="property">companyId</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">deptId</Property> + <Property name="property">deptId</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">depotId</Property> + <Property name="property">depotId</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">fcrq</Property> + <Property name="property">fcrq</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodVariety</Property> + <Property name="property">foodVariety</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodType</Property> + <Property name="property">foodType</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodLevel</Property> + <Property name="property">foodLevel</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodLocation</Property> + <Property name="property">foodLocation</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodYear</Property> + <Property name="property">foodYear</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">country</Property> + <Property name="property">country</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">storeKeeperName</Property> + <Property name="property">storeKeeperName</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">fcsl</Property> + <Property name="property">fcsl</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">applyUser</Property> + <Property name="property">applyUser</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">deptAuditUser</Property> + <Property name="property">deptAuditUser</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">leaderAuditUser</Property> + <Property name="property">leaderAuditUser</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">remarks</Property> + <Property name="property">remarks</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">updateTime</Property> + <Property name="property">updateTime</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + <Tools/> + </Dialog> + <AjaxAction id="ajaxDel"> + <Property name="service">depotStatusConfirmPR#delData</Property> + <Property name="confirmMessage">纭畾瑕佸垹闄ゅ悧锛�</Property> + </AjaxAction> + <CustomDropDown id="ddFoodOrigin"> + <Property name="minHeight">500</Property> + <Property name="assignmentMap">foodLocation=name</Property> + <Property name="minWidth">500</Property> + <Container layout="regionPadding:5"> + <DataSet id="dsFoodOrigin"> + <Property name="dataProvider">dicAreaPR#pageList</Property> + <Property name="parameter"></Property> + <Property name="pageSize">30</Property> + <Property name="dataType">[dtArea]</Property> + </DataSet> + <Container layout="hbox regionPadding:5"> + <TextEditor id="key2"> + <Property name="blankText"> -- 缂栫爜鎴栬�呭悕绉� --</Property> + <Property name="width">200</Property> + </TextEditor> + <Button> + <ClientEvent name="onClick">var key = view.get("#key2.value");
 + view.get("#dsFoodOrigin").set("parameter",{key:key}).flushAsync();</ClientEvent> + <Property name="caption">鏌ヨ</Property> + <Property name="iconClass">fa fa-search</Property> + </Button> + <Button> + <ClientEvent name="onClick">var data = view.get("#dsFoodOrigin.data:#");
 + if(data){
 + view.get("#ddFoodOrigin").close(data.toJSON());
 + }</ClientEvent> + <Property name="iconClass">fa fa-check</Property> + <Property name="caption">纭畾</Property> + </Button> + </Container> + <DataGrid> + <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsFoodOrigin.data:#");
 + if(data){
 + view.get("#ddFoodOrigin").close(data.toJSON());
 + }</ClientEvent> + <Property name="dataSet">dsFoodOrigin</Property> + <Property name="readOnly">true</Property> + <DataColumn name="code"> + <Property name="property">code</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="name"> + <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = "bold";
 +arg.processDefault = true;</ClientEvent> + <Property name="property">name</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="simple"> + <Property name="property">simple</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + </DataGrid> + <DataPilot layoutConstraint="bottom"> + <Property name="dataSet">dsFoodOrigin</Property> + </DataPilot> + </Container> + </CustomDropDown> + </View> +</ViewConfig> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStore.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStore.view.xml new file mode 100644 index 0000000..cd85bcb --- /dev/null +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DepotStore.view.xml @@ -0,0 +1,476 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViewConfig> + <Arguments/> + <Context/> + <Model> + <DataType name="dtMain" parent="dtDepotStore"/> + <DataType name="dtQuery"> + <PropertyDef name="start"> + <Property name="dataType">Date</Property> + <Property name="label">寮�濮嬫椂闂�</Property> + </PropertyDef> + <PropertyDef name="end"> + <Property name="dataType">Date</Property> + <Property name="label">缁撴潫鏃堕棿</Property> + </PropertyDef> + <PropertyDef name="depotId"> + <Property></Property> + <Property name="label">鎵�灞炰粨鎴�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="depotStatus"> + <Property name="label">浠撴埧鐘舵��</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerDepotStatus").getResult()}</Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + </DataType> + </Model> + <View layout="padding:5;regionPadding:5"> + <ClientEvent name="onReady">//榛樿鏌ヨ鏌ヨ鎻愭潯浠�
 +view.get("#dsQuery").insert({});</ClientEvent> + <Property name="packages">font-awesome,css-common</Property> + <DataSet id="dsMain"> + <Property name="pageSize">20</Property> + <Property name="dataType">[dtMain]</Property> + <Property name="dataProvider">depotStorePR#pageList</Property> + <Property name="loadMode">lazy</Property> + </DataSet> + <DataSet id="dsQuery"> + <Property name="dataType">dtQuery</Property> + </DataSet> + <AutoForm> + <Property name="cols">*,*,*,*,*</Property> + <Property name="dataSet">dsQuery</Property> + <Property name="exClassName">bg-color</Property> + <Property name="labelAlign">right</Property> + <AutoFormElement> + <Property name="name">depotId</Property> + <Property name="property">depotId</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">start</Property> + <Property name="property">start</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">end</Property> + <Property name="property">end</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">depotStatus</Property> + <Property name="property">depotStatus</Property> + <Editor/> + </AutoFormElement> + <Container layout="regionPadding:15"> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">//鏌ヨ
 +var data = view.get("#dsQuery.data");
 +view.get("#dsMain").set("parameter",data).flushAsync();
 +</ClientEvent> + <Property name="caption">鏌ヨ</Property> + <Property name="exClassName">btn1</Property> + <Property name="iconClass">fa fa-search</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsQuery").setData({});</ClientEvent> + <Property name="caption">閲嶇疆</Property> + <Property name="exClassName">btn2</Property> + <Property name="iconClass">fa fa-refresh</Property> + </Button> + </Container> + </AutoForm> + <Container layout="regionPadding:10" layoutConstraint="top"> + <Property name="exClassName">bg-color</Property> + <Property name="height">55</Property> + <Property name="contentOverflow">hidden</Property> + <Label layoutConstraint="left"> + <Property name="text">鑿滃崟鏍忥細</Property> + </Label> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsMain").insert();
 +view.get("#dialogMain").show();</ClientEvent> + <Property name="caption">鏂板</Property> + <Property name="exClassName">btn1</Property> + <Property name="iconClass">fa fa-plus</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">var select = view.get("#dataGridMain").get("selection");
 +if(select){
 + view.get("#dialogMain").show();
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 +}</ClientEvent> + <Property name="caption">淇敼</Property> + <Property name="exClassName">btn2</Property> + <Property name="iconClass">fa fa-pencil</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">
 +var select = view.get("#dataGridMain").get("selection");
 +if(select){
 + view.get("#ajaxDel").set("parameter",select).execute(function(){
 + select.remove();
 + });
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 +}
 +
 +</ClientEvent> + <Property name="caption">鍒犻櫎</Property> + <Property name="exClassName">btn3</Property> + <Property name="iconClass">fa fa-trash-o</Property> + </Button> + </Container> + <Container layout="regionPadding:1" layoutConstraint="center"> + <Property name="exClassName">bg-color</Property> + <DataGrid id="dataGridMain"> + <Property name="dataSet">dsMain</Property> + <Property name="readOnly">true</Property> + <Property name="selectionMode">singleRow</Property> + <RowSelectorColumn/> + <RowNumColumn/> + <DataColumn> + <Property name="property">depotId</Property> + <Property name="align">center</Property> + <Property name="name">depotId</Property> + </DataColumn> + <DataColumn name="depotStatus"> + <Property name="property">depotStatus</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodType"> + <Property name="property">foodType</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodVariety"> + <Property name="property">foodVariety</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodLevel"> + <Property name="property">foodLevel</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodLocation"> + <Property name="property">foodLocation</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="foodYear"> + <Property name="property">foodYear</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="storageReal"> + <Property name="property">storageReal</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="storageSettle"> + <Property name="property">storageSettle</Property> + </DataColumn> + <DataColumn name="updateDate"> + <Property name="property">updateDate</Property> + <Property name="align">center</Property> + </DataColumn> + </DataGrid> + <ToolBar layoutConstraint="bottom"> + <Fill/> + <DataPilot layoutConstraint="right"> + <Property name="itemCodes">pageSize,pages</Property> + <Property name="dataSet">dsMain</Property> + </DataPilot> + </ToolBar> + </Container> + <Dialog id="dialogMain"> + <Property name="caption">搴撳瓨淇℃伅</Property> + <Property name="width">800</Property> + <Property name="closeable">false</Property> + <Buttons> + <Button> + <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 +view.get("#uaAction").execute(function(result){
 + if(result){
 + $alert(result);
 + }else{
 + self.get("parent").hide();
 + }
 +});</ClientEvent> + <Property name="caption">淇濆瓨</Property> + <Property name="iconClass">fa fa-check</Property> + <Property name="exClassName">btn1</Property> + </Button> + <Button> + <ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
 +self.get("parent").hide();</ClientEvent> + <Property name="caption">鍙栨秷</Property> + <Property name="iconClass">fa fa-times</Property> + <Property name="exClassName">btn3</Property> + </Button> + </Buttons> + <Children> + <AutoForm> + <Property name="dataSet">dsMain</Property> + <Property name="readOnly">false</Property> + <Property name="labelSeparator"> : </Property> + <Property name="labelAlign">right</Property> + <Property name="cols">*,*</Property> + <Property name="labelWidth">120</Property> + <Property name="height">85%</Property> + <AutoFormElement> + <Property name="name">depotId</Property> + <Property name="property">depotId</Property> + <Property name="trigger">autoMappingDropDown1</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">depotStatus</Property> + <Property name="property">depotStatus</Property> + <Property name="trigger">autoMappingDropDown1</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">storeType</Property> + <Property name="property">storeType</Property> + <Property name="trigger">autoMappingDropDown1</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodType</Property> + <Property name="property">foodType</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodVariety</Property> + <Property name="property">foodVariety</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodLevel</Property> + <Property name="property">foodLevel</Property> + <Property name="trigger">autoMappingDropDown1</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">lqgsdwdm</Property> + <Property name="property">lqgsdwdm</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">manageType</Property> + <Property name="property">manageType</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodYear</Property> + <Property name="property">foodYear</Property> + <Property name="trigger">yearDropDown1</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝蹇呭~</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">country</Property> + <Property name="property">country</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝蹇呭~</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">foodLocation</Property> + <Property name="property">foodLocation</Property> + <Property name="trigger">ddFoodOrigin</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝蹇呭~</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">storageReal</Property> + <Property name="property">storageReal</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">蹇呭~锛岀┖浠�=0锛屽叆搴�/鍑哄簱鏁伴噺涔嬪拰</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">storageSettle</Property> + <Property name="property">storageSettle</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">蹇呭~锛岀┖浠�=0锛屽叆搴�/鍑哄簱缁撶畻鏁伴噺涔嬪拰</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">fullDate</Property> + <Property name="property">fullDate</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨/鍑哄簱涓紝蹇呭~</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">storeDate</Property> + <Property name="property">storeDate</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝蹇呭~銆傜涓�杞﹀叆浠撴椂闂�</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">outDate</Property> + <Property name="property">outDate</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=绌轰粨锛屽繀濉�傛渶鍚庝竴杞︾伯椋熷嚭浠撴椂闂�</Property> + <Property name="style"> + <Property name="color">red</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">grainHeight</Property> + <Property name="property">grainHeight</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨锛屽彲濉�</Property> + <Property name="style"> + <Property name="color">blue</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement> + <Property name="name">grainVolume</Property> + <Property name="property">grainVolume</Property> + <Editor/> + </AutoFormElement> + <Label> + <Property name="text">璐т綅鐘舵��=灏佷粨锛屽彲濉�</Property> + <Property name="style"> + <Property name="color">blue</Property> + <Property name="font-size">12px</Property> + </Property> + </Label> + <AutoFormElement layoutConstraint="colSpan:2"> + <Property name="name">remark</Property> + <Property name="property">remark</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + <Tools/> + </Dialog> + <UpdateAction id="uaAction"> + <Property name="successMessage">鎵ц鎴愬姛!</Property> + <Property name="executingMessage">姝e湪鎵ц涓�..</Property> + <Property name="dataResolver">depotStorePR#saveDepotStore</Property> + <UpdateItem> + <Property name="dataSet">dsMain</Property> + <Property name="dataPath">[#current]</Property> + </UpdateItem> + </UpdateAction> + <AjaxAction id="ajaxDel"> + <Property name="confirmMessage">纭畾瑕佸垹闄ゅ悧锛�</Property> + <Property name="service">depotStorePR#delDepotStore</Property> + </AjaxAction> + <YearDropDown id="yearDropDown1"/> + <CustomDropDown id="ddFoodOrigin"> + <Property name="minHeight">500</Property> + <Property name="assignmentMap">foodLocation=name,foodLocationId=code</Property> + <Property name="minWidth">500</Property> + <Container layout="regionPadding:5"> + <DataSet id="dsFoodOrigin"> + <Property name="dataProvider">dicAreaPR#pageList</Property> + <Property name="dataType">[dtArea]</Property> + <Property name="parameter"></Property> + <Property name="pageSize">30</Property> + </DataSet> + <Container layout="hbox regionPadding:5"> + <TextEditor id="key2"> + <Property name="blankText"> -- 鍚嶇О --</Property> + <Property name="width">200</Property> + </TextEditor> + <Button> + <ClientEvent name="onClick">var key = view.get("#key2.value");
 + view.get("#dsFoodOrigin").set("parameter",{key:key}).flushAsync();</ClientEvent> + <Property name="caption">鏌ヨ</Property> + <Property name="iconClass">fa fa-search</Property> + </Button> + <Button> + <ClientEvent name="onClick">var data = view.get("#dsFoodOrigin.data:#");
 + if(data){
 + view.get("#ddFoodOrigin").close(data.toJSON());
 + }</ClientEvent> + <Property name="iconClass">fa fa-check</Property> + <Property name="caption">纭畾</Property> + </Button> + </Container> + <DataGrid> + <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsFoodOrigin.data:#");
 + if(data){
 + view.get("#ddFoodOrigin").close(data.toJSON());
 + }</ClientEvent> + <Property name="dataSet">dsFoodOrigin</Property> + <Property name="readOnly">true</Property> + <DataColumn name="code"> + <Property name="property">code</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="name"> + <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = "bold";
 +arg.processDefault = true;</ClientEvent> + <Property name="property">name</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="simple"> + <Property name="property">simple</Property> + <Property name="readOnly">true</Property> + <Property name="align">center</Property> + </DataColumn> + </DataGrid> + <DataPilot layoutConstraint="bottom"> + <Property name="dataSet">dsFoodOrigin</Property> + </DataPilot> + </Container> + </CustomDropDown> + </View> +</ViewConfig> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DeviceModbus.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DeviceModbus.view.xml new file mode 100644 index 0000000..eeec2a4 --- /dev/null +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/DeviceModbus.view.xml @@ -0,0 +1,313 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViewConfig> + <Arguments/> + <Context/> + <Model> + <DataType name="dtMain"> + <Property name="creationType">com.fzzy.igds.dzhwk.domain.DeviceModbus</Property> + <PropertyDef name="id"> + <Property></Property> + <Property name="label">ID</Property> + </PropertyDef> + <PropertyDef name="deviceCode"> + <Property></Property> + <Property name="label">璁惧缂栫爜</Property> + </PropertyDef> + <PropertyDef name="open"> + <Property></Property> + <Property name="label">寮�鍦板潃</Property> + </PropertyDef> + <PropertyDef name="openFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="close"> + <Property></Property> + <Property name="label">鍏冲湴鍧�</Property> + </PropertyDef> + <PropertyDef name="closeFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="stop"> + <Property></Property> + <Property name="label">鍋滃湴鍧�</Property> + </PropertyDef> + <PropertyDef name="stopFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="openEnd"> + <Property></Property> + <Property name="label">鍋滃湴鍧�</Property> + </PropertyDef> + <PropertyDef name="openEndFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="closeEnd"> + <Property></Property> + <Property name="label">鍏冲埌浣嶅湴鍧�</Property> + </PropertyDef> + <PropertyDef name="closeEndFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="openError"> + <Property></Property> + <Property name="label">寮�鏁呴殰鍦板潃</Property> + </PropertyDef> + <PropertyDef name="openErrorFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="closeError"> + <Property></Property> + <Property name="label">鍏虫晠闅滃湴鍧�</Property> + </PropertyDef> + <PropertyDef name="closeErrorFun"> + <Property></Property> + <Property name="label">鍔熻兘鍙�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="bizType"> + <Property></Property> + <Property name="label">涓氬姟绫诲瀷</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerBizType").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="serId"> + <Property></Property> + <Property name="label">鎵�灞炲垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + </DataType> + </Model> + <View layout="padding:5;regionPadding:5"> + <Property name="packages">font-awesome,css-common</Property> + <DataSet id="dsMain"> + <Property name="loadMode">lazy</Property> + <Property name="dataType">[dtMain]</Property> + <Property name="dataProvider">deviceModbusPR#listAll</Property> + </DataSet> + <Container layout="regionPadding:10" layoutConstraint="top"> + <Property name="exClassName">bg-color</Property> + <Property name="contentOverflow">hidden</Property> + <Property name="height">55</Property> + <Label layoutConstraint="left"> + <Property name="text">鑿滃崟鏍忥細</Property> + </Label> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsMain").insert({});</ClientEvent> + <Property name="caption">鏂板</Property> + <Property name="exClassName">btn1</Property> + <Property name="iconClass">fa fa-plus</Property> + </Button> + <Button> + <ClientEvent name="onClick"> view.get("#uaAction").execute(); </ClientEvent> + <Property name="caption">淇濆瓨</Property> + <Property name="iconClass">fa fa-check</Property> + <Property name="exClassName">btn2</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 +if(!data){
 + return;
 +}
 +view.get("#ajaxDel").set("parameter",data).execute(function(result){
 + if(result){
 + $alert(result);
 + return;
 + }else{
 + data.remove();
 + }
 +}); </ClientEvent> + <Property name="caption">鍒犻櫎</Property> + <Property name="exClassName">btn3</Property> + <Property name="iconClass">fa fa-minus</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsMain").flushAsync(); </ClientEvent> + <Property name="caption">鍒锋柊</Property> + <Property name="exClassName">btn4</Property> + <Property name="iconClass">fa fa-refresh</Property> + </Button> + <Button layoutConstraint="left"> + <Property name="caption">鍒锋柊缂撳瓨</Property> + <Property name="exClassName">btn1</Property> + <Property name="iconClass">fa fa-refresh</Property> + <Property name="action">ajaxFlushCache</Property> + </Button> + </Container> + <Container layout="regionPadding:10" layoutConstraint="center"> + <Property name="exClassName">bg-color</Property> + <DataGrid layoutConstraint="center padding:5px"> + <Property name="dataSet">dsMain</Property> + <RowNumColumn/> + <DataColumn name="deviceCode"> + <Property name="property">deviceCode</Property> + </DataColumn> + <DataColumn name="serId"> + <Property name="property">serId</Property> + </DataColumn> + <DataColumn name="bizType"> + <Property name="property">bizType</Property> + </DataColumn> + <ColumnGroup> + <Property name="caption">寮�鎿嶄綔</Property> + <DataColumn name="open"> + <Property name="property">open</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="openFun"> + <Property name="property">openFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">鍏虫搷浣�</Property> + <DataColumn name="close"> + <Property name="property">close</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="closeFun"> + <Property name="property">closeFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">鍋滄搷浣�</Property> + <DataColumn name="stop"> + <Property name="property">stop</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="stopFun"> + <Property name="property">stopFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">寮�鍒颁綅</Property> + <DataColumn name="openEnd"> + <Property name="property">openEnd</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="openEndFun"> + <Property name="property">openEndFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">鍏冲埌浣�</Property> + <DataColumn name="closeEnd"> + <Property name="property">closeEnd</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="closeEndFun"> + <Property name="property">closeEndFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">寮�鏁呴殰</Property> + <DataColumn name="openError"> + <Property name="property">openError</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="openErrorFun"> + <Property name="property">openErrorFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + <ColumnGroup> + <Property name="caption">鍏虫晠闅�</Property> + <DataColumn name="closeError"> + <Property name="property">closeError</Property> + <Property name="caption">鍦板潃</Property> + <Property name="width">80</Property> + </DataColumn> + <DataColumn name="closeErrorFun"> + <Property name="property">closeErrorFun</Property> + <Property name="caption">鍔熻兘</Property> + <Property name="width">100</Property> + <Property name="trigger">autoMappingDropDown1</Property> + </DataColumn> + </ColumnGroup> + </DataGrid> + </Container> + <UpdateAction id="uaAction"> + <Property name="dataResolver">deviceModbusPR#updateData</Property> + <UpdateItem> + <Property name="dataSet">dsMain</Property> + <Property name="dataPath">!DIRTY_TREE</Property> + </UpdateItem> + </UpdateAction> + <AjaxAction id="ajaxDel"> + <Property name="service">deviceModbusPR#delData</Property> + <Property name="confirmMessage">纭畾瑕佸垹闄や箞锛�</Property> + </AjaxAction> + <AjaxAction id="ajaxFlushCache"> + <Property name="service">deviceModbusPR#flushCache</Property> + <Property name="successMessage">缂撳瓨鏇存柊鎴愬姛</Property> + </AjaxAction> + </View> +</ViewConfig> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/DepotConfPR.java b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/DepotConfPR.java new file mode 100644 index 0000000..d2a0375 --- /dev/null +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/DepotConfPR.java @@ -0,0 +1,75 @@ +package com.fzzy.igds.sys.pr; + +import com.bstek.dorado.annotation.DataProvider; +import com.bstek.dorado.annotation.DataResolver; +import com.bstek.dorado.annotation.Expose; +import com.fzzy.igds.dzhwk.domain.DepotConf; +import com.fzzy.igds.sys.DepotConfService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author jiazx + */ +@Slf4j +@Component +public class DepotConfPR { + + @Resource + private DepotConfService depotConfService; + + /** + * 鍙傛暟閰嶇疆鍒楄〃 depotConfPR#getConfList + * + * @return + */ + @DataProvider + public List<DepotConf> getConfList() { + return depotConfService.getConfList(null,null); + } + + /** + * depotConfPR#saveConf 鍙傛暟閰嶇疆鏇存柊锛屽寘鎷柊澧炲拰淇敼 + * + * @param conf + */ + @DataResolver + public void saveConf(DepotConf conf) { + DepotConf depotConf = new DepotConf(); + BeanUtils.copyProperties(conf, depotConf); + depotConfService.saveConf(depotConf); + } + + /** + * depotConfPR#delDepotConf 鍒犻櫎鍙傛暟閰嶇疆 + * + * @param conf + */ + @Expose + public void delDepotConf(DepotConf conf) { + DepotConf depotConf = new DepotConf(); + BeanUtils.copyProperties(conf, depotConf); + depotConfService.deleteDepotConf(depotConf); + } + + /** + * depotConfPR#flushConfCache 鍒锋柊閰嶇疆缂撳瓨 + */ + @Expose + public void flushConfCache() { + depotConfService.flushConfCache(null); + } + + /** + * depotConfPR#updateFreq 鏇存柊鎵�鏈夌伯搴撶殑绮儏棰戠巼 + */ + @Expose + public void updateFreq(String freq) { + depotConfService.updateFreq(freq); + } + +} diff --git a/igds-dzhwk-view/src/main/java/models/igds.model.xml b/igds-dzhwk-view/src/main/java/models/igds.model.xml index d51bada..acd3ec3 100644 --- a/igds-dzhwk-view/src/main/java/models/igds.model.xml +++ b/igds-dzhwk-view/src/main/java/models/igds.model.xml @@ -413,4 +413,281 @@ <Property name="required">false</Property> </PropertyDef> </DataType> + <DataType name="dtDepotConf"> + <Property name="creationType">com.fzzy.igds.dzhwk.domain.DepotConf</Property> + <PropertyDef name="depotId"> + <Property></Property> + <Property name="label">鎵�灞炰粨搴�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="deptId"> + <Property></Property> + <Property name="label">鎵�灞炲垎搴�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deptPR#loadParents").getResult()}</Property> + <Property name="keyProperty">deptId</Property> + <Property name="valueProperty">deptName</Property> + </Property> + <Property name="required">true</Property> + </PropertyDef> + <PropertyDef name="companyId"> + <Property></Property> + <Property name="label">缁勭粐缂栫爜</Property> + </PropertyDef> + <PropertyDef name="grainSer"> + <Property></Property> + <Property name="label">绮儏鍒嗘満</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + <Property name="required">true</Property> + </PropertyDef> + <PropertyDef name="grainFreq"> + <Property></Property> + <Property name="label">淇濆瓨棰戠巼</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("GRAIN_FREQ")}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="thConf"> + <Property></Property> + <Property name="label">娓╂箍搴﹂�氶亾</Property> + </PropertyDef> + <PropertyDef name="cableStart"> + <Property name="dataType">int</Property> + <Property name="label">鐢电紗寮�濮嬪垪</Property> + </PropertyDef> + <PropertyDef name="cableEnd"> + <Property name="dataType">int</Property> + <Property name="label">鐢电紗鎴嚦鍒�</Property> + </PropertyDef> + <PropertyDef name="tempMax"> + <Property name="dataType">Double</Property> + <Property name="label">娓╁害涓婇檺</Property> + </PropertyDef> + <PropertyDef name="gasStart"> + <Property name="dataType">int</Property> + <Property name="label">閲囬泦寮�濮嬬偣</Property> + </PropertyDef> + <PropertyDef name="gasEnd"> + <Property name="dataType">int</Property> + <Property name="label">閲囨埅鑷抽泦鐐�</Property> + </PropertyDef> + <PropertyDef name="n2Max"> + <Property name="dataType">Double</Property> + <Property name="label">姘皵涓婇檺</Property> + </PropertyDef> + <PropertyDef name="co2Max"> + <Property name="dataType">Double</Property> + <Property name="label">浜屾哀鍖栫⒊涓婇檺</Property> + </PropertyDef> + <PropertyDef name="o2Max"> + <Property name="dataType">Double</Property> + <Property name="label">姘ф皵涓婇檺</Property> + </PropertyDef> + <PropertyDef name="ph3Max"> + <Property name="dataType">Double</Property> + <Property name="label">纾峰寲姘笂闄�</Property> + </PropertyDef> + <PropertyDef name="pestStart"> + <Property name="dataType">int</Property> + <Property name="label">閲囬泦寮�濮嬬偣</Property> + </PropertyDef> + <PropertyDef name="pestEnd"> + <Property name="dataType">int</Property> + <Property name="label">閲囬泦鎴嚦鐐�</Property> + </PropertyDef> + <PropertyDef name="pestMax"> + <Property name="dataType">Double</Property> + <Property name="label">铏涓婇檺</Property> + </PropertyDef> + <PropertyDef name="thSer"> + <Property></Property> + <Property name="label">娓╂箍搴﹀垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="cableRule"> + <Property></Property> + <Property name="label">甯冪嚎瑙勫垯</Property> + </PropertyDef> + <PropertyDef name="cableCir"> + <Property></Property> + <Property name="label">绛掍粨灞傝鍒�</Property> + </PropertyDef> + <PropertyDef name="esSer"> + <Property></Property> + <Property name="label">鑳借�楀垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="esSerTag"> + <Property></Property> + <Property name="label">鏄惁澶氬垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues"> + <Collection> + <Entity> + <Property name="code">Y</Property> + <Property name="name">鏄�</Property> + </Entity> + <Entity> + <Property name="code">N</Property> + <Property name="name">鍚�</Property> + </Entity> + </Collection> + </Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="startOrientation"> + <Property></Property> + <Property name="label">鐢电紗璧峰鏂逛綅</Property> + <Property name="mapping"> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerStartOrientation").getResult()}</Property> + </Property> + </PropertyDef> + <PropertyDef name="startDirection"> + <Property name="label">鐢电紗甯冪嚎鏂瑰悜</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerStartDirection").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="startPoint"> + <Property name="label">鐢电紗璧峰鐐逛綅</Property> + <Property name="mapping"> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerStartPoint").getResult()}</Property> + </Property> + </PropertyDef> + <PropertyDef name="startConvert"> + <Property name="label">灞傝杞崲</Property> + <Property name="mapping"> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerStartConvert").getResult()}</Property> + </Property> + </PropertyDef> + <PropertyDef name="depotName"> + <Property></Property> + </PropertyDef> + <PropertyDef name="depotType"> + <Property></Property> + </PropertyDef> + <PropertyDef name="cableCone"> + <Property name="label">绛掍粨閿ュ舰</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicPR#triggerCableCone").getResult()}</Property> + <Property name="keyProperty">dictValue</Property> + <Property name="valueProperty">dictLabel</Property> + </Property> + </PropertyDef> + <PropertyDef name="isOnlyTH"> + <Property></Property> + <Property name="label">绮儏绫诲瀷</Property> + <Property name="mapping"> + <Property name="mapValues"> + <Collection> + <Entity> + <Property name="code">Y</Property> + <Property name="name">娓╂箍搴﹁澶�</Property> + </Entity> + <Entity> + <Property name="code">N</Property> + <Property name="name">绮儏鐢电紗</Property> + </Entity> + </Collection> + </Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="gasSer"> + <Property></Property> + <Property name="label">姘斾綋鍒嗘満</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="gasSerTag"> + <Property></Property> + <Property name="label">鏄惁澶氬垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues"> + <Collection> + <Entity> + <Property name="code">Y</Property> + <Property name="name">鏄�</Property> + </Entity> + <Entity> + <Property name="code">N</Property> + <Property name="name">鍚�</Property> + </Entity> + </Collection> + </Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="pestSer"> + <Property></Property> + <Property name="label">铏鍒嗘満</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="pestSerTag"> + <Property></Property> + <Property name="label">鏄惁澶氬垎鏈�</Property> + <Property name="mapping"> + <Property name="mapValues"> + <Collection> + <Entity> + <Property name="code">Y</Property> + <Property name="name">鏄�</Property> + </Entity> + <Entity> + <Property name="code">N</Property> + <Property name="name">鍚�</Property> + </Entity> + </Collection> + </Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + <PropertyDef name="verbSer"> + <Property></Property> + <Property name="label">閫氶鍒嗘満</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> + <Property name="keyProperty">id</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> + </DataType> </Model> diff --git a/igds-dzhwk-web/src/main/resources/static/ruoyi/js/common.js b/igds-dzhwk-web/src/main/resources/static/ruoyi/js/common.js index 23af98b..a326020 100644 --- a/igds-dzhwk-web/src/main/resources/static/ruoyi/js/common.js +++ b/igds-dzhwk-web/src/main/resources/static/ruoyi/js/common.js @@ -1,6 +1,6 @@ /** * 閫氱敤鏂规硶灏佽澶勭悊 - * Copyright (c) 2019 ruoyi + * Copyright (c) 2019 ruoyi */ var startLayDate; @@ -8,7 +8,7 @@ var isScrollToTop = parent.isScrollToTop; $(function() { - + // layer鎵╁睍鐨偆 if (window.layer !== undefined) { layer.config({ @@ -16,12 +16,12 @@ skin: 'layer-ext-moon' }); } - + // 鍥炲埌椤堕儴缁戝畾 if ($.fn.toTop !== undefined) { $('#scroll-up').toTop(); } - + // select2澶嶉�夋浜嬩欢缁戝畾 if ($.fn.select2 !== undefined) { $.fn.select2.defaults.set( "theme", "bootstrap" ); @@ -31,7 +31,7 @@ }) }) } - + // iCheck鍗曢�夋鍙婂閫夋浜嬩欢缁戝畾 if ($.fn.iCheck !== undefined) { $(".check-box:not(.noicheck),.radio-box:not(.noicheck)").each(function() { @@ -41,17 +41,17 @@ }) }) } - + // 鍙栨秷鍥炶溅鑷姩鎻愪氦琛ㄥ崟 $(document).on("keypress", ":input:not(textarea):not([type=submit])", function(event) { if (event.keyCode == 13) { event.preventDefault(); } }); - + // laydate 鏃堕棿鎺т欢缁戝畾 if ($(".select-time").length > 0) { - layui.use('laydate', function() { + layui.use('laydate', function() { var laydate = layui.laydate; startLayDate = laydate.render({ elem: '#startTime', @@ -94,7 +94,7 @@ }); }); } - + // laydate time-input 鏃堕棿鎺т欢缁戝畾 if ($(".time-input").length > 0) { layui.use('laydate', function () { @@ -142,7 +142,7 @@ }); }); } - + // tree 鍏抽敭瀛楁悳绱㈢粦瀹� if ($("#keyword").length > 0) { $("#keyword").bind("focus", function focusKey(e) { @@ -156,7 +156,7 @@ $.tree.searchNode(e); }).bind("input propertychange", $.tree.searchNode); } - + // tree琛ㄦ牸鏍� 灞曞紑/鎶樺彔 var expandFlag; $("#expandAllBtn").click(function() { @@ -169,7 +169,7 @@ } expandFlag = expandFlag ? false: true; }) - + // 鎸変笅ESC鎸夐挳鍏抽棴寮瑰眰 $('body', document).on('keyup', function(e) { if (e.which === 27) { @@ -232,33 +232,38 @@ /** 鍏抽棴閫夐」鍗� */ var closeItem = function(dataId){ - var topWindow = $(window.parent.document); - if ($.common.isNotEmpty(dataId)) { - window.parent.$.modal.closeLoading(); - // 鏍规嵁dataId鍏抽棴鎸囧畾閫夐」鍗� - $('.menuTab[data-id="' + dataId + '"]', topWindow).remove(); - // 绉婚櫎鐩稿簲tab瀵瑰簲鐨勫唴瀹瑰尯 - $('.mainContent .RuoYi_iframe[data-id="' + dataId + '"]', topWindow).remove(); - return; - } - var panelUrl = window.frameElement.getAttribute('data-panel'); - $('.page-tabs-content .active i', topWindow).click(); - if ($.common.isNotEmpty(panelUrl)) { - $('.menuTab[data-id="' + panelUrl + '"]', topWindow).addClass('active').siblings('.menuTab').removeClass('active'); - $('.mainContent .RuoYi_iframe', topWindow).each(function() { - if ($(this).data('id') == panelUrl) { - openToCurrentTab(this); - return false; + var topWindow = $(window.parent.document); + if ($.common.isNotEmpty(dataId)) { + window.parent.$.modal.closeLoading(); + // 鏍规嵁dataId鍏抽棴鎸囧畾閫夐」鍗� + $('.menuTab[data-id="' + dataId + '"]', topWindow).remove(); + // 绉婚櫎鐩稿簲tab瀵瑰簲鐨勫唴瀹瑰尯 + $('.mainContent .RuoYi_iframe[data-id="' + dataId + '"]', topWindow).remove(); + return; + } + var panelUrl = window.frameElement.getAttribute('data-panel'); + $('.page-tabs-content .active i', topWindow).click(); + if ($.common.isNotEmpty(panelUrl)) { + $('.menuTab[data-id="' + panelUrl + '"]', topWindow).addClass('active').siblings('.menuTab').removeClass('active'); + $('.mainContent .RuoYi_iframe', topWindow).each(function() { + if ($(this).data('id') == panelUrl) { + openToCurrentTab(this); + return false; } }); } } /** 鍒涘缓閫夐」鍗� */ -function createMenuItem(dataUrl, menuName, isRefresh) { - var panelUrl = window.frameElement.getAttribute('data-id'), - dataIndex = $.common.random(1, 100), - flag = true; +function createMenuItem(dataUrl, menuName, isRefresh, panelId) { + var panelUrl = null; + if(panelId){ + panelUrl = panelId; + }else { + panelUrl = window.frameElement.getAttribute('data-id'); + } + var dataIndex = $.common.random(1, 100), + flag = true; if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false; var topWindow = $(window.parent.document); // 閫夐」鍗¤彍鍗曞凡瀛樺湪 @@ -295,7 +300,7 @@ } else { $('.mainContent', topWindow).find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1); } - + window.parent.$.modal.loading("鏁版嵁鍔犺浇涓紝璇风◢鍊�..."); $('.mainContent iframe:visible', topWindow).on('load', function() { window.parent.$.modal.closeLoading(); @@ -310,18 +315,18 @@ // 鍒锋柊iframe function refreshTab() { - var topWindow = $(window.parent.document); - var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id'); - var target = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow); + var topWindow = $(window.parent.document); + var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id'); + var target = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow); var url = target.attr('src'); - target.attr('src', url).ready(); + target.attr('src', url).ready(); } // 婊氬姩鍒版寚瀹氶�夐」鍗� function scrollToTab(element) { var topWindow = $(window.parent.document); var marginLeftVal = calSumWidth($(element).prevAll()), - marginRightVal = calSumWidth($(element).nextAll()); + marginRightVal = calSumWidth($(element).nextAll()); // 鍙鍖哄煙闈瀟ab瀹藉害 var tabOuterWidth = calSumWidth($(".content-tabs", topWindow).children().not(".menuTabs")); //鍙鍖哄煙tab瀹藉害 @@ -356,11 +361,11 @@ // 杩斿洖褰撳墠婵�娲荤殑Tab椤甸潰鍏宠仈鐨刬frame鐨刉indows瀵硅薄 function activeWindow() { - var topWindow = $(window.parent.document); - var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id'); - if (!currentId) { - return window.parent; - } + var topWindow = $(window.parent.document); + var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id'); + if (!currentId) { + return window.parent; + } return $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow; } @@ -414,14 +419,14 @@ /** 閲嶇疆鏃ユ湡/骞存湀鏃� */ function resetDate() { - if ($.common.isNotEmpty(startLayDate) && $.common.isNotEmpty(endLayDate)) { - endLayDate.config.min.year = ''; - endLayDate.config.min.month = ''; - endLayDate.config.min.date = ''; - startLayDate.config.max.year = '2099'; - startLayDate.config.max.month = '12'; - startLayDate.config.max.date = '31'; - } + if ($.common.isNotEmpty(startLayDate) && $.common.isNotEmpty(endLayDate)) { + endLayDate.config.min.year = ''; + endLayDate.config.min.month = ''; + endLayDate.config.min.date = ''; + startLayDate.config.max.year = '2099'; + startLayDate.config.max.month = '12'; + startLayDate.config.max.date = '31'; + } } // 鏃ュ織鎵撳嵃灏佽澶勭悊 @@ -459,47 +464,47 @@ // 涓诲瓙琛ㄦ搷浣滃皝瑁呭鐞� var sub = { editRow: function() { - var dataColumns = []; - for (var columnIndex = 0; columnIndex < table.options.columns.length; columnIndex++) { - if (table.options.columns[columnIndex].visible != false) { - dataColumns.push(table.options.columns[columnIndex]); - } - } - var params = new Array(); - var data = $("#" + table.options.id).bootstrapTable('getData'); - var count = data.length; - for (var dataIndex = 0; dataIndex < count; dataIndex++) { - var columns = $('#' + table.options.id + ' tr[data-index="' + dataIndex + '"] td:visible'); - var obj = new Object(); - for (var i = 0; i < columns.length; i++) { - var inputValue = $(columns[i]).find('input'); - var selectValue = $(columns[i]).find('select'); - var textareaValue = $(columns[i]).find('textarea'); - var key = dataColumns[i].field; - if ($.common.isNotEmpty(inputValue.val())) { - obj[key] = inputValue.val(); - } else if ($.common.isNotEmpty(selectValue.val())) { - obj[key] = selectValue.val(); - } else if ($.common.isNotEmpty(textareaValue.val())) { - obj[key] = textareaValue.val(); - } else { - if (key == "index" && $.common.isNotEmpty(data[dataIndex].index)) { - obj[key] = data[dataIndex].index; - } else { - obj[key] = ""; - } - } - } - var item = data[dataIndex]; - var extendObj = $.extend({}, item, obj); - params.push({ index: dataIndex, row: extendObj }); - } - $("#" + table.options.id).bootstrapTable("updateRow", params); + var dataColumns = []; + for (var columnIndex = 0; columnIndex < table.options.columns.length; columnIndex++) { + if (table.options.columns[columnIndex].visible != false) { + dataColumns.push(table.options.columns[columnIndex]); + } + } + var params = new Array(); + var data = $("#" + table.options.id).bootstrapTable('getData'); + var count = data.length; + for (var dataIndex = 0; dataIndex < count; dataIndex++) { + var columns = $('#' + table.options.id + ' tr[data-index="' + dataIndex + '"] td:visible'); + var obj = new Object(); + for (var i = 0; i < columns.length; i++) { + var inputValue = $(columns[i]).find('input'); + var selectValue = $(columns[i]).find('select'); + var textareaValue = $(columns[i]).find('textarea'); + var key = dataColumns[i].field; + if ($.common.isNotEmpty(inputValue.val())) { + obj[key] = inputValue.val(); + } else if ($.common.isNotEmpty(selectValue.val())) { + obj[key] = selectValue.val(); + } else if ($.common.isNotEmpty(textareaValue.val())) { + obj[key] = textareaValue.val(); + } else { + if (key == "index" && $.common.isNotEmpty(data[dataIndex].index)) { + obj[key] = data[dataIndex].index; + } else { + obj[key] = ""; + } + } + } + var item = data[dataIndex]; + var extendObj = $.extend({}, item, obj); + params.push({ index: dataIndex, row: extendObj }); + } + $("#" + table.options.id).bootstrapTable("updateRow", params); }, delRow: function(column) { - sub.editRow(); - var subColumn = $.common.isEmpty(column) ? "index" : column; - var ids = $.table.selectColumns(subColumn); + sub.editRow(); + var subColumn = $.common.isEmpty(column) ? "index" : column; + var ids = $.table.selectColumns(subColumn); if (ids.length == 0) { $.modal.alertWarning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�"); return; @@ -507,17 +512,17 @@ $("#" + table.options.id).bootstrapTable('remove', { field: subColumn, values: ids }); }, delRowByIndex: function(value, tableId) { - var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; - sub.editRow(); + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; + sub.editRow(); $("#" + currentId).bootstrapTable('remove', { field: "index", values: [value] }); sub.editRow(); }, addRow: function(row, tableId) { - var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; - table.set(currentId); - var count = $("#" + currentId).bootstrapTable('getData').length; - sub.editRow(); - $("#" + currentId).bootstrapTable('insertRow', { index: count + 1, row: row }); + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; + table.set(currentId); + var count = $("#" + currentId).bootstrapTable('getData').length; + sub.editRow(); + $("#" + currentId).bootstrapTable('insertRow', { index: count + 1, row: row }); } }; @@ -542,40 +547,40 @@ // 绂佹鍚庨��閿紙Backspace锛� window.onload = function() { - document.getElementsByTagName("body")[0].onkeydown = function() { - // 鑾峰彇浜嬩欢瀵硅薄 - var elem = event.relatedTarget || event.srcElement || event.target || event.currentTarget; - // 鍒ゆ柇鎸夐敭涓篵ackSpace閿� - if (event.keyCode == 8) { - // 鍒ゆ柇鏄惁闇�瑕侀樆姝㈡寜涓嬮敭鐩樼殑浜嬩欢榛樿浼犻�� - var name = elem.nodeName; - var className = elem.className; - // 灞忚斀鐗瑰畾鐨勬牱寮忓悕绉� - if (className.indexOf('note-editable') != -1) - { - return true; - } - if (name != 'INPUT' && name != 'TEXTAREA') { - return _stopIt(event); - } - var type_e = elem.type.toUpperCase(); - if (name == 'INPUT' && (type_e != 'TEXT' && type_e != 'TEXTAREA' && type_e != 'PASSWORD' && type_e != 'FILE' && type_e != 'SEARCH' && type_e != 'NUMBER' && type_e != 'EMAIL' && type_e != 'URL')) { - return _stopIt(event); - } - if (name == 'INPUT' && (elem.readOnly == true || elem.disabled == true)) { - return _stopIt(event); - } - } - }; + document.getElementsByTagName("body")[0].onkeydown = function() { + // 鑾峰彇浜嬩欢瀵硅薄 + var elem = event.relatedTarget || event.srcElement || event.target || event.currentTarget; + // 鍒ゆ柇鎸夐敭涓篵ackSpace閿� + if (event.keyCode == 8) { + // 鍒ゆ柇鏄惁闇�瑕侀樆姝㈡寜涓嬮敭鐩樼殑浜嬩欢榛樿浼犻�� + var name = elem.nodeName; + var className = elem.className; + // 灞忚斀鐗瑰畾鐨勬牱寮忓悕绉� + if (className.indexOf('note-editable') != -1) + { + return true; + } + if (name != 'INPUT' && name != 'TEXTAREA') { + return _stopIt(event); + } + var type_e = elem.type.toUpperCase(); + if (name == 'INPUT' && (type_e != 'TEXT' && type_e != 'TEXTAREA' && type_e != 'PASSWORD' && type_e != 'FILE' && type_e != 'SEARCH' && type_e != 'NUMBER' && type_e != 'EMAIL' && type_e != 'URL')) { + return _stopIt(event); + } + if (name == 'INPUT' && (elem.readOnly == true || elem.disabled == true)) { + return _stopIt(event); + } + } + }; }; function _stopIt(e) { - if (e.returnValue) { - e.returnValue = false; - } - if (e.preventDefault) { - e.preventDefault(); - } - return false; + if (e.returnValue) { + e.returnValue = false; + } + if (e.preventDefault) { + e.preventDefault(); + } + return false; } /** 璁剧疆鍏ㄥ眬ajax澶勭悊 */ diff --git a/igds-dzhwk-web/src/main/resources/static/ruoyi/js/ry-ui.js b/igds-dzhwk-web/src/main/resources/static/ruoyi/js/ry-ui.js index aee2d34..647c5ab 100644 --- a/igds-dzhwk-web/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/igds-dzhwk-web/src/main/resources/static/ruoyi/js/ry-ui.js @@ -157,7 +157,7 @@ // 鑾峰彇瀹炰緥ID锛屽瀛樺湪澶氫釜杩斿洖#id1,#id2 delimeter鍒嗛殧绗� getOptionsIds: function(separator) { var _separator = $.common.isEmpty(separator) ? "," : separator; - var optionsIds = ""; + var optionsIds = ""; $.each(table.config, function(key, value){ optionsIds += "#" + key + _separator; }); @@ -175,7 +175,7 @@ isAsc: params.order }; var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId; - return $.extend(curParams, $.common.formToJSON(currentId)); + return $.extend(curParams, $.common.formToJSON(currentId)); }, // 璇锋眰鑾峰彇鏁版嵁鍚庡鐞嗗洖璋冨嚱鏁� responseHandler: function(res) { @@ -393,6 +393,22 @@ }); }); }, + // Dorado椤甸潰瀵煎嚭鏁版嵁锛歶rl-璺宠浆璺緞锛宯ame-鏁版嵁鍚嶇О锛宲aram-鏌ヨ鍙傛暟 + exportExcelDorado: function(url, name, param) { + $.modal.confirm("纭畾瀵煎嚭褰撳墠椤甸潰" + name + "鍚楋紵", function() { + $.modal.loading("姝e湪瀵煎嚭鏁版嵁锛岃绋嶅��..."); + $.post(url, param, function(result) { + if (result.code == web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else if (result.code == web_status.WARNING) { + $.modal.alertWarning(result.msg) + } else { + $.modal.alertError(result.msg); + } + $.modal.closeLoading(); + }); + }); + }, // 涓嬭浇妯℃澘 importTemplate: function() { $.get(activeWindow().table.options.importTemplateUrl, function(result) { @@ -441,12 +457,12 @@ type: 'POST', success: function (result) { if (result.code == web_status.SUCCESS) { - $.modal.close(index); + $.modal.close(index); $.modal.closeAll(); $.modal.alertSuccess(result.msg); $.table.refresh(); } else if (result.code == web_status.WARNING) { - $.modal.close(index); + $.modal.close(index); $.modal.enable(); $.modal.alertWarning(result.msg) } else { @@ -456,7 +472,7 @@ } }, complete: function () { - layero.find('#file').val(''); + layero.find('#file').val(''); } }); } @@ -751,9 +767,9 @@ // 娑堟伅鎻愮ず msg: function(content, type) { if (type != undefined) { - top.layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 }); + top.layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 }); } else { - top.layer.msg(content); + top.layer.msg(content); } }, // 閿欒娑堟伅 @@ -792,17 +808,17 @@ // 娑堟伅鎻愮ず锛岄噸鏂板姞杞介〉闈� msgReload: function(msg, type) { top.layer.msg(msg, { - icon: $.modal.icon(type), - time: 500, - shade: [0.1, '#8F8F8F'] - }, - function() { - $.modal.reload(); - }); + icon: $.modal.icon(type), + time: 500, + shade: [0.1, '#8F8F8F'] + }, + function() { + $.modal.reload(); + }); }, // 娑堟伅鎻愮ず鎴愬姛骞跺埛鏂扮埗绐椾綋 msgSuccessReload: function(msg) { - $.modal.msgReload(msg, modal_status.SUCCESS); + $.modal.msgReload(msg, modal_status.SUCCESS); }, // 鑾峰彇iframe椤电殑DOM getChildFrame: function (index) { @@ -885,9 +901,9 @@ }, // 寮瑰嚭灞傛寚瀹氬弬鏁伴�夐」 openOptions: function (options) { - var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; - var _title = $.common.isEmpty(options.title) ? "绯荤粺绐楀彛" : options.title; - var _width = $.common.isEmpty(options.width) ? "800" : options.width; + var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; + var _title = $.common.isEmpty(options.title) ? "绯荤粺绐楀彛" : options.title; + var _width = $.common.isEmpty(options.width) ? "800" : options.width; var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height; var _btn = ['<i class="fa fa-check"></i> 纭', '<i class="fa fa-close"></i> 鍏抽棴']; // 濡傛灉鏄Щ鍔ㄧ锛屽氨浣跨敤鑷�傚簲澶у皬寮圭獥 @@ -980,8 +996,8 @@ top.layer.full(index); }, // 閫夊崱椤垫柟寮忔墦寮� - openTab: function (title, url, isRefresh) { - createMenuItem(url, title, isRefresh); + openTab: function (title, url, isRefresh, panelId) { + createMenuItem(url, title, isRefresh, panelId); }, // 閫夊崱椤靛悓涓�椤电鎵撳紑 parentTab: function (title, url) { @@ -1318,7 +1334,7 @@ if (result.code == web_status.SUCCESS) { var parent = activeWindow(); if ($.common.isEmpty(parent.table)) { - $.modal.msgSuccessReload(result.msg); + $.modal.msgSuccessReload(result.msg); } else if (parent.table.options.type == table_type.bootstrapTable) { $.modal.close(); parent.$.modal.msgSuccess(result.msg); @@ -1343,8 +1359,8 @@ var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel'); var topWindow = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0]; if ($.common.isNotEmpty(topWindow) && $.common.isNotEmpty(currentId)) { - var $contentWindow = topWindow.contentWindow; - $contentWindow.$.modal.msgSuccess(result.msg); + var $contentWindow = topWindow.contentWindow; + $contentWindow.$.modal.msgSuccess(result.msg); $contentWindow.$(".layui-layer-padding").removeAttr("style"); if ($contentWindow.table.options.type == table_type.bootstrapTable) { $contentWindow.$.table.refresh(); @@ -1636,12 +1652,12 @@ if (!date) return; if (!format) format = "yyyy-MM-dd"; switch (typeof date) { - case "string": - date = new Date(date.replace(/-/g, "/")); - break; - case "number": - date = new Date(date); - break; + case "string": + date = new Date(date.replace(/-/g, "/")); + break; + case "number": + date = new Date(date); + break; } if (!date instanceof Date) return; var dict = { @@ -1658,9 +1674,9 @@ "ss": ("" + (date.getSeconds() + 100)).substr(1) }; return format.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, - function() { - return dict[arguments[0]]; - }); + function() { + return dict[arguments[0]]; + }); }, // 鑾峰彇鑺傜偣鏁版嵁锛屾敮鎸佸灞傜骇璁块棶 getItemField: function (item, field) { @@ -1735,11 +1751,11 @@ }, // 鑾峰彇obj瀵硅薄闀垮害 getLength: function(obj) { - var count = 0;銆�銆� + var count = 0; for (var i in obj) { if (obj.hasOwnProperty(i)) { count++; - }銆�銆� + } } return count; }, -- Gitblit v1.9.3