@epoint-testtech/ep-stage-skill 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/codex-skill/ep-stage/code-list-generate/SKILL.md +168 -0
  2. package/codex-skill/ep-stage/code-list-generate/assets/code_list.template.json5 +325 -0
  3. package/codex-skill/ep-stage/code-list-generate/assets/example-zwplace.json5 +588 -0
  4. package/codex-skill/ep-stage/code-list-generate/evals/evals.json +47 -0
  5. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceAddAction.java +119 -0
  6. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceDetailAction.java +70 -0
  7. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceEditAction.java +107 -0
  8. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceListAction.java +167 -0
  9. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/api/ISchemeResourceService.java +84 -0
  10. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/api/entity/SchemeResource.java +218 -0
  11. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/impl/SchemeResourceService.java +146 -0
  12. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/impl/SchemeResourceServiceImpl.java +110 -0
  13. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourceadd.html +158 -0
  14. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourcedetail.html +89 -0
  15. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourceedit.html +125 -0
  16. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourcelist.html +224 -0
  17. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/docs//345/234/272/346/211/200/347/252/227/345/217/243/344/277/241/346/201/257/347/256/241/347/220/206/345/217/212/345/220/204/347/253/257/347/273/237/350/256/241/346/243/200/347/264/242/346/237/245/347/234/213_prd.md +602 -0
  18. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceAddAction.java +210 -0
  19. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceDetailAction.java +69 -0
  20. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceEditAction.java +235 -0
  21. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceListAction.java +145 -0
  22. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/IGxhZwPlaceService.java +87 -0
  23. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwPlace.java +306 -0
  24. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwPlaceHistory.java +205 -0
  25. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwWindow.java +184 -0
  26. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/impl/GxhZwPlaceService.java +151 -0
  27. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/impl/GxhZwPlaceServiceImpl.java +96 -0
  28. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplaceadd.html +253 -0
  29. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplacedetail.html +146 -0
  30. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplaceedit.html +275 -0
  31. package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplacelist.html +168 -0
  32. package/codex-skill/ep-stage/code-list-generate/evals/grade-code-list.mjs +184 -0
  33. package/codex-skill/ep-stage/code-list-generate/references/epoint-extraction.md +106 -0
  34. package/codex-skill/ep-stage/code-list-generate/references/field-contract.md +122 -0
  35. package/codex-skill/ep-stage/code-list-generate/scripts/validate-code-list.mjs +202 -0
  36. package/codex-skill/ep-stage/glue-create-project/SKILL.md +227 -223
  37. package/dist/src/cli/index.js +0 -0
  38. package/dist/src/extractors/code-list-json5.d.ts +5 -0
  39. package/dist/src/extractors/code-list-json5.d.ts.map +1 -1
  40. package/dist/src/generators/stage-skeleton-script.d.ts +4 -0
  41. package/dist/src/generators/stage-skeleton-script.d.ts.map +1 -1
  42. package/dist/src/generators/stage-skeleton-script.js +389 -362
  43. package/dist/src/testcase/contract-testcase-assembler.d.ts +10 -1
  44. package/dist/src/testcase/contract-testcase-assembler.d.ts.map +1 -1
  45. package/dist/src/testcase/contract-testcase-assembler.js +80 -21
  46. package/package.json +14 -12
@@ -0,0 +1,184 @@
1
+ /**
2
+ * 窗口信息实体
3
+ *
4
+ * @generated by zw-crud-gen (F9)
5
+ */
6
+ package com.epoint.zwplace.api.entity;
7
+
8
+ import com.epoint.core.BaseEntity;
9
+ import com.epoint.core.annotation.Entity;
10
+ import com.epoint.core.annotation.EntityLength;
11
+
12
+ @Entity(table = "gxh_zw_window", id = "rowguid")
13
+ public class GxhZwWindow extends BaseEntity implements Cloneable {
14
+ private static final long serialVersionUID = 1L;
15
+
16
+ /**
17
+ * 所属场所GUID
18
+ */
19
+ @EntityLength(length = 50)
20
+ public String getPlaceguid() {
21
+ return super.get("placeguid");
22
+ }
23
+
24
+ public void setPlaceguid(String placeguid) {
25
+ super.set("placeguid", placeguid);
26
+ }
27
+
28
+ /**
29
+ * 窗口名称
30
+ */
31
+ @EntityLength(length = 100)
32
+ public String getWindowname() {
33
+ return super.get("windowname");
34
+ }
35
+
36
+ public void setWindowname(String windowname) {
37
+ super.set("windowname", windowname);
38
+ }
39
+
40
+ /**
41
+ * 窗口类型
42
+ */
43
+ @EntityLength(length = 20)
44
+ public String getWindowtype() {
45
+ return super.get("windowtype");
46
+ }
47
+
48
+ public void setWindowtype(String windowtype) {
49
+ super.set("windowtype", windowtype);
50
+ }
51
+
52
+ /**
53
+ * 窗口地址
54
+ */
55
+ @EntityLength(length = 200)
56
+ public String getWindowaddress() {
57
+ return super.get("windowaddress");
58
+ }
59
+
60
+ public void setWindowaddress(String windowaddress) {
61
+ super.set("windowaddress", windowaddress);
62
+ }
63
+
64
+ /**
65
+ * 窗口编号
66
+ */
67
+ @EntityLength(length = 50)
68
+ public String getWindowguid() {
69
+ return super.get("windowguid");
70
+ }
71
+
72
+ public void setWindowguid(String windowguid) {
73
+ super.set("windowguid", windowguid);
74
+ }
75
+
76
+ // ========== 公共字段 ==========
77
+
78
+ /**
79
+ * 主键 GUID
80
+ */
81
+ @EntityLength(length = 50)
82
+ public String getRowguid() {
83
+ return super.get("rowguid");
84
+ }
85
+
86
+ public void setRowguid(String rowguid) {
87
+ super.set("rowguid", rowguid);
88
+ }
89
+
90
+ /**
91
+ * 整型 ID/序号
92
+ */
93
+ public Integer getRow_id() {
94
+ return super.getInt("row_id");
95
+ }
96
+
97
+ public void setRow_id(Integer row_id) {
98
+ super.set("row_id", row_id);
99
+ }
100
+
101
+ /**
102
+ * 操作时间
103
+ */
104
+ public java.util.Date getOperatedate() {
105
+ return super.getDate("operatedate");
106
+ }
107
+
108
+ public void setOperatedate(java.util.Date operatedate) {
109
+ super.set("operatedate", operatedate);
110
+ }
111
+
112
+ /**
113
+ * 操作人名字
114
+ */
115
+ @EntityLength(length = 50)
116
+ public String getOperateusername() {
117
+ return super.get("operateusername");
118
+ }
119
+
120
+ public void setOperateusername(String operateusername) {
121
+ super.set("operateusername", operateusername);
122
+ }
123
+
124
+ /**
125
+ * 操作人 GUID
126
+ */
127
+ @EntityLength(length = 50)
128
+ public String getOperateuserguid() {
129
+ return super.get("operateuserguid");
130
+ }
131
+
132
+ public void setOperateuserguid(String operateuserguid) {
133
+ super.set("operateuserguid", operateuserguid);
134
+ }
135
+
136
+ /**
137
+ * 操作人所属组
138
+ */
139
+ @EntityLength(length = 50)
140
+ public String getOperateuserouguid() {
141
+ return super.get("operateuserouguid");
142
+ }
143
+
144
+ public void setOperateuserouguid(String operateuserouguid) {
145
+ super.set("operateuserouguid", operateuserouguid);
146
+ }
147
+
148
+ /**
149
+ * 操作人所在组织 GUID
150
+ */
151
+ @EntityLength(length = 50)
152
+ public String getOperateuserbaseouguid() {
153
+ return super.get("operateuserbaseouguid");
154
+ }
155
+
156
+ public void setOperateuserbaseouguid(String operateuserbaseouguid) {
157
+ super.set("operateuserbaseouguid", operateuserbaseouguid);
158
+ }
159
+
160
+ /**
161
+ * 年份标识
162
+ */
163
+ @EntityLength(length = 10)
164
+ public String getYearflag() {
165
+ return super.get("yearflag");
166
+ }
167
+
168
+ public void setYearflag(String yearflag) {
169
+ super.set("yearflag", yearflag);
170
+ }
171
+
172
+ /**
173
+ * 所属辖区 code
174
+ */
175
+ @EntityLength(length = 50)
176
+ public String getBelongxiaqucode() {
177
+ return super.get("belongxiaqucode");
178
+ }
179
+
180
+ public void setBelongxiaqucode(String belongxiaqucode) {
181
+ super.set("belongxiaqucode", belongxiaqucode);
182
+ }
183
+
184
+ }
@@ -0,0 +1,151 @@
1
+ /**
2
+ * 场所信息管理对应的后台service
3
+ *
4
+ * @generated by zw-crud-gen (F9)
5
+ */
6
+ package com.epoint.zwplace.impl;
7
+
8
+ import java.util.ArrayList;
9
+ import java.util.Date;
10
+ import java.util.HashMap;
11
+ import java.util.List;
12
+ import java.util.Map;
13
+ import java.util.UUID;
14
+
15
+ import com.alibaba.fastjson.JSON;
16
+ import com.epoint.zwplace.api.entity.GxhZwPlace;
17
+ import com.epoint.zwplace.api.entity.GxhZwPlaceHistory;
18
+ import com.epoint.zwplace.api.entity.GxhZwWindow;
19
+ import com.epoint.core.dao.CommonDao;
20
+ import com.epoint.core.dao.ICommonDao;
21
+ import com.epoint.core.grammar.Record;
22
+ import com.epoint.core.utils.sql.SqlConditionUtil;
23
+ import com.epoint.core.utils.sql.SqlHelper;
24
+ import com.epoint.database.peisistence.crud.impl.model.PageData;
25
+
26
+ public class GxhZwPlaceService {
27
+
28
+ protected ICommonDao baseDao;
29
+
30
+ public GxhZwPlaceService() {
31
+ baseDao = CommonDao.getInstance();
32
+ }
33
+
34
+ public int insert(GxhZwPlace record) {
35
+ return baseDao.insert(record);
36
+ }
37
+
38
+ public <T extends Record> int deleteByGuid(String guid) {
39
+ T t = baseDao.find(GxhZwPlace.class, guid);
40
+ return baseDao.delete(t);
41
+ }
42
+
43
+ public int update(GxhZwPlace record) {
44
+ return baseDao.update(record);
45
+ }
46
+
47
+ public Integer countGxhZwPlace(Map<String, Object> conditionMap) {
48
+ SqlConditionUtil conditionUtil = new SqlConditionUtil(conditionMap);
49
+ conditionUtil.setSelectFields("count(*)");
50
+ List<Object> params = new ArrayList<>();
51
+ return baseDao.queryInt(new SqlHelper().getSqlComplete(GxhZwPlace.class, conditionUtil.getMap(), params),
52
+ params.toArray());
53
+ }
54
+
55
+ public GxhZwPlace find(Object primaryKey) {
56
+ return baseDao.find(GxhZwPlace.class, primaryKey);
57
+ }
58
+
59
+ public GxhZwPlace find(Map<String, Object> conditionMap) {
60
+ List<Object> params = new ArrayList<>();
61
+ return baseDao.find(new SqlHelper().getSqlComplete(GxhZwPlace.class, conditionMap, params), GxhZwPlace.class,
62
+ params.toArray());
63
+ }
64
+
65
+ public List<GxhZwPlace> findList(Map<String, Object> conditionMap) {
66
+ List<Object> params = new ArrayList<>();
67
+ return baseDao.findList(new SqlHelper().getSqlComplete(GxhZwPlace.class, conditionMap, params), GxhZwPlace.class,
68
+ params.toArray());
69
+ }
70
+
71
+ public PageData<GxhZwPlace> paginatorList(Map<String, Object> conditionMap, int pageNumber, int pageSize) {
72
+ List<Object> params = new ArrayList<>();
73
+ List<GxhZwPlace> list = baseDao.findList(new SqlHelper().getSqlComplete(GxhZwPlace.class, conditionMap, params),
74
+ pageNumber, pageSize, GxhZwPlace.class, params.toArray());
75
+ int count = countGxhZwPlace(conditionMap);
76
+ return new PageData<GxhZwPlace>(list, count);
77
+ }
78
+
79
+ public int insertWindow(GxhZwWindow window) {
80
+ return baseDao.insert(window);
81
+ }
82
+
83
+ public int deleteWindows(String placeguid) {
84
+ SqlConditionUtil sUtil = new SqlConditionUtil();
85
+ sUtil.eq("placeguid", placeguid);
86
+ List<GxhZwWindow> windows = findWindowList(placeguid);
87
+ int count = 0;
88
+ for (GxhZwWindow window : windows) {
89
+ baseDao.delete(window);
90
+ count++;
91
+ }
92
+ return count;
93
+ }
94
+
95
+ public List<GxhZwWindow> findWindowList(String placeguid) {
96
+ SqlConditionUtil sUtil = new SqlConditionUtil();
97
+ sUtil.eq("placeguid", placeguid);
98
+ sUtil.setOrderAsc("row_id");
99
+ List<Object> params = new ArrayList<>();
100
+ return baseDao.findList(new SqlHelper().getSqlComplete(GxhZwWindow.class, sUtil.getMap(), params),
101
+ GxhZwWindow.class, params.toArray());
102
+ }
103
+
104
+ public void archivePlace(String placeguid) {
105
+ GxhZwPlace place = find(placeguid);
106
+ if (place == null) {
107
+ return;
108
+ }
109
+ List<GxhZwWindow> windows = findWindowList(placeguid);
110
+ GxhZwPlaceHistory history = new GxhZwPlaceHistory();
111
+ history.setRowguid(UUID.randomUUID().toString());
112
+ history.setPlaceguid(placeguid);
113
+ history.setVersion(place.getVersion());
114
+ history.setPlacedata(JSON.toJSONString(place));
115
+ history.setWindowdata(JSON.toJSONString(windows));
116
+ history.setArchivedate(new Date());
117
+ history.setArchiveusername(place.getOperateusername());
118
+ history.setArchiveuserguid(place.getOperateuserguid());
119
+ history.setOperatedate(new Date());
120
+ baseDao.insert(history);
121
+ }
122
+
123
+ public String syncWindowSystem() {
124
+ return "同步功能暂未实现,请联系管理员配置窗口管理系统接口。";
125
+ }
126
+
127
+ private boolean equals(Object obj1, Object obj2) {
128
+ if (obj1 == null && obj2 == null) {
129
+ return true;
130
+ }
131
+ if (obj1 == null || obj2 == null) {
132
+ return false;
133
+ }
134
+ return obj1.equals(obj2);
135
+ }
136
+
137
+ @SuppressWarnings({ "unchecked", "rawtypes" })
138
+ public List<HashMap<String, Object>> findStreetList(Map<String, Object> conditionMap) {
139
+ String sql = "SELECT DISTINCT streetname FROM gxh_zw_place WHERE 1=1";
140
+ List<Object> params = new ArrayList<>();
141
+ if (conditionMap != null && conditionMap.get("districtname") != null) {
142
+ sql += " AND districtname = ?";
143
+ params.add(conditionMap.get("districtname"));
144
+ }
145
+ if (conditionMap != null && conditionMap.get("orderAsc") != null) {
146
+ sql += " ORDER BY " + conditionMap.get("orderAsc");
147
+ }
148
+ List<HashMap> list = baseDao.findList(sql, HashMap.class, params.toArray());
149
+ return (List<HashMap<String, Object>>) (List) list;
150
+ }
151
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * 场所信息管理对应的后台service实现类
3
+ *
4
+ * @generated by zw-crud-gen (F9)
5
+ */
6
+ package com.epoint.zwplace.impl;
7
+
8
+ import java.util.HashMap;
9
+ import java.util.List;
10
+ import java.util.Map;
11
+
12
+ import org.springframework.beans.factory.annotation.Autowired;
13
+ import org.springframework.context.ApplicationEventPublisher;
14
+ import org.springframework.stereotype.Component;
15
+
16
+ import com.epoint.zwplace.api.IGxhZwPlaceService;
17
+ import com.epoint.zwplace.api.entity.GxhZwPlace;
18
+ import com.epoint.zwplace.api.entity.GxhZwWindow;
19
+ import com.epoint.database.peisistence.crud.impl.model.PageData;
20
+
21
+ @Component
22
+ public class GxhZwPlaceServiceImpl implements IGxhZwPlaceService {
23
+
24
+ @Autowired
25
+ private ApplicationEventPublisher applicationEventPublisher;
26
+
27
+ @Override
28
+ public int insert(GxhZwPlace record) {
29
+ return new GxhZwPlaceService().insert(record);
30
+ }
31
+
32
+ @Override
33
+ public int deleteByGuid(String guid) {
34
+ return new GxhZwPlaceService().deleteByGuid(guid);
35
+ }
36
+
37
+ @Override
38
+ public int update(GxhZwPlace record) {
39
+ return new GxhZwPlaceService().update(record);
40
+ }
41
+
42
+ @Override
43
+ public Integer countGxhZwPlace(Map<String, Object> conditionMap) {
44
+ return new GxhZwPlaceService().countGxhZwPlace(conditionMap);
45
+ }
46
+
47
+ @Override
48
+ public GxhZwPlace find(Object primaryKey) {
49
+ return new GxhZwPlaceService().find(primaryKey);
50
+ }
51
+
52
+ @Override
53
+ public GxhZwPlace find(Map<String, Object> conditionMap) {
54
+ return new GxhZwPlaceService().find(conditionMap);
55
+ }
56
+
57
+ @Override
58
+ public List<GxhZwPlace> findList(Map<String, Object> conditionMap) {
59
+ return new GxhZwPlaceService().findList(conditionMap);
60
+ }
61
+
62
+ @Override
63
+ public PageData<GxhZwPlace> paginatorList(Map<String, Object> conditionMap, int pageNumber, int pageSize) {
64
+ return new GxhZwPlaceService().paginatorList(conditionMap, pageNumber, pageSize);
65
+ }
66
+
67
+ @Override
68
+ public int insertWindow(GxhZwWindow window) {
69
+ return new GxhZwPlaceService().insertWindow(window);
70
+ }
71
+
72
+ @Override
73
+ public int deleteWindows(String placeguid) {
74
+ return new GxhZwPlaceService().deleteWindows(placeguid);
75
+ }
76
+
77
+ @Override
78
+ public List<GxhZwWindow> findWindowList(String placeguid) {
79
+ return new GxhZwPlaceService().findWindowList(placeguid);
80
+ }
81
+
82
+ @Override
83
+ public void archivePlace(String placeguid) {
84
+ new GxhZwPlaceService().archivePlace(placeguid);
85
+ }
86
+
87
+ @Override
88
+ public String syncWindowSystem() {
89
+ return new GxhZwPlaceService().syncWindowSystem();
90
+ }
91
+
92
+ @Override
93
+ public List<HashMap<String, Object>> findStreetList(Map<String, Object> conditionMap) {
94
+ return new GxhZwPlaceService().findStreetList(conditionMap);
95
+ }
96
+ }
@@ -0,0 +1,253 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <title>场所信息管理添加</title>
7
+ <script src="../../frame/fui/js/cssboot.js"></script>
8
+ </head>
9
+ <body>
10
+ <div class="page-loading"></div>
11
+
12
+ <div class="fui-content">
13
+ <div id="fui-form" class="fui-form">
14
+ <div role="form">
15
+
16
+ <div role="row">
17
+
18
+ <div role="control" label="场所名称" starred="true">
19
+ <input class="mini-textbox" bind="dataBean.placename" required="true" requiredErrorText="场所名称不能为空!" maxLength="50" />
20
+ </div>
21
+
22
+ <div role="control" label="场所分类" starred="true">
23
+ <input class="mini-combobox" id="placecategory" bind="dataBean.placecategory" action="placecategoryModel" textField="text" valueField="id" emptyText="请选择..." required="true" requiredErrorText="场所分类不能为空!" />
24
+ </div>
25
+
26
+ </div>
27
+
28
+ <div role="row">
29
+
30
+ <div role="control" label="区划名称" starred="true">
31
+ <input class="mini-combobox" bind="dataBean.districtname" id="districtname" action="districtModel" textField="text" valueField="id" emptyText="请选择" required="true" requiredErrorText="区划名称不能为空!" onvaluechanged="onDistrictChanged" />
32
+ </div>
33
+
34
+ <div role="control" label="街道名称" starred="true">
35
+ <input class="mini-textbox" bind="dataBean.streetname" required="true" requiredErrorText="街道名称不能为空!" maxLength="50" />
36
+ </div>
37
+
38
+ </div>
39
+
40
+ <div role="row">
41
+
42
+ <div role="control" label="路/弄/号" starred="true">
43
+ <input class="mini-textbox" bind="dataBean.address" required="true" requiredErrorText="路/弄/号不能为空!" maxLength="50" />
44
+ </div>
45
+
46
+ <div role="control" label="是否社区办理" starred="true">
47
+ <input class="mini-combobox" id="iscommunity" bind="dataBean.iscommunity" action="iscommunityModel" textField="text" valueField="id" emptyText="请选择..." required="true" requiredErrorText="是否社区办理不能为空!" />
48
+ </div>
49
+
50
+ </div>
51
+
52
+ <div role="row">
53
+
54
+ <div role="control" label="统一对外服务时间" starred="true">
55
+ <input class="mini-textbox" bind="dataBean.servicetime" required="true" requiredErrorText="统一对外服务时间不能为空!" maxLength="100" />
56
+ </div>
57
+
58
+ <div role="control" label="咨询电话">
59
+ <input class="mini-textbox" bind="dataBean.consultphone" maxLength="20" />
60
+ </div>
61
+
62
+ </div>
63
+
64
+ <div role="row">
65
+
66
+ <div role="control" label="投诉电话">
67
+ <input class="mini-textbox" bind="dataBean.complaintphone" maxLength="20" />
68
+ </div>
69
+
70
+ </div>
71
+
72
+ <div role="row">
73
+ <div role="control" label="窗口信息">
74
+ <div style="width: 100%;">
75
+ <a class="mini-button" onclick="addWindow" state="primary" style="margin-bottom: 5px;">添加窗口</a>
76
+ <a class="mini-button" onclick="deleteSelectedWindow" state="danger" style="margin-bottom: 5px; margin-left: 5px;">删除选中</a>
77
+ <div id="windowGrid" class="mini-datagrid" idField="rowguid" style="height: 200px;" allowCellEdit="true" allowCellSelect="true" editNextOnEnterKey="true" editNextRowCell="true" multiSelect="true" allowMultiRowSelect="true">
78
+ <div property="columns">
79
+ <div type="checkcolumn" width="30"></div>
80
+ <div type="indexcolumn" width="30">序</div>
81
+ <div field="windowname" width="150" editor="{type:'textbox'}">窗口名称<span style="color:red;">*</span></div>
82
+ <div field="windowtype" width="100" renderer="windowtypeRenderer" editor="{type:'combobox',action:'windowtypeModel',textField:'text',valueField:'id',emptyText:'请选择...'}">窗口类型<span style="color:red;">*</span></div>
83
+ <div field="windowaddress" width="200" editor="{type:'textbox'}">窗口地址</div>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+ </div>
91
+ </div>
92
+ </div>
93
+
94
+ <div class="fui-toolbar-bottom">
95
+ <div class="btn-group">
96
+ <a class="mini-button" onclick="save" state="default">保存</a>
97
+ <a class="mini-button" onclick="saveAndClose" state="primary">保存并关闭</a>
98
+ <a class="mini-button" onclick="epoint.closeDialog('close')">关闭</a>
99
+ </div>
100
+ </div>
101
+
102
+ <script src="../../rest/resource/jsboot"></script>
103
+ <script>
104
+ var windowtypeData = [];
105
+ epoint.initPage('gxhzwplaceaddaction', '', function(data) {
106
+ // 预加载窗口类型数据
107
+ epoint.execute('getWindowtypeData', '@none', [], function(result) {
108
+ if (result && result.list) {
109
+ windowtypeData = result.list;
110
+ }
111
+ });
112
+ });
113
+
114
+ // 窗口类型渲染器
115
+ function windowtypeRenderer(e) {
116
+ var value = e.value;
117
+ if (!value) return '';
118
+ for (var i = 0; i < windowtypeData.length; i++) {
119
+ var item = windowtypeData[i];
120
+ if (item.id == value || item.value == value) {
121
+ return item.text;
122
+ }
123
+ }
124
+ return value;
125
+ }
126
+
127
+ // 区划改变事件
128
+ function onDistrictChanged(e) {
129
+ var districtname = e.value;
130
+ var streetCombo = mini.get("streetname");
131
+ if (!streetCombo) return;
132
+ streetCombo.setValue("");
133
+ if (districtname) {
134
+ epoint.execute("getStreetList", "@none", [districtname], function(data) {
135
+ if (streetCombo && data && data.list) {
136
+ streetCombo.setData(data.list);
137
+ }
138
+ });
139
+ } else {
140
+ streetCombo.setData([]);
141
+ }
142
+ }
143
+
144
+ // 添加窗口
145
+ function addWindow() {
146
+ var grid = mini.get("windowGrid");
147
+ var newRow = { rowguid: 'temp_' + new Date().getTime() + '_' + Math.random().toString(36).substr(2, 9) };
148
+ grid.addRow(newRow, 0);
149
+ grid.accept();
150
+ }
151
+
152
+ // 删除选中的窗口
153
+ function deleteSelectedWindow() {
154
+ var grid = mini.get("windowGrid");
155
+ if (!grid) {
156
+ epoint.alert('表格组件未找到!', '错误', null, 'error');
157
+ return;
158
+ }
159
+
160
+ // 尝试获取选中的行
161
+ var rows = grid.getSelecteds();
162
+
163
+ // 如果没有选中行,尝试获取当前行
164
+ if (!rows || rows.length == 0) {
165
+ var currentRow = grid.getSelected();
166
+ if (currentRow) {
167
+ rows = [currentRow];
168
+ }
169
+ }
170
+
171
+ // 如果还是没有,提示用户
172
+ if (!rows || rows.length == 0) {
173
+ epoint.alert('请先选择要删除的窗口!\n\n提示:点击窗口行左侧的复选框选中,或者直接点击某一行后删除。', '提示', null, 'warning');
174
+ return;
175
+ }
176
+
177
+ epoint.confirm('确定要删除选中的 ' + rows.length + ' 个窗口吗?', '确认', function(action) {
178
+ if (action == 'ok') {
179
+ if (rows.length == 1) {
180
+ grid.removeRow(rows[0], true);
181
+ } else {
182
+ grid.removeRows(rows, true);
183
+ }
184
+ epoint.showTips('删除成功!', { state: 'success' });
185
+ }
186
+ });
187
+ }
188
+
189
+ // 保存(草稿)
190
+ function save() {
191
+ if (epoint.validate()) {
192
+ if (!validateWindows()) return;
193
+ var windows = getWindowData();
194
+ epoint.execute('saveDraft', 'fui-form', [windows], saveCallback);
195
+ }
196
+ }
197
+
198
+ // 保存并关闭(在用)
199
+ function saveAndClose() {
200
+ if (epoint.validate()) {
201
+ if (!validateWindows()) return;
202
+ var windows = getWindowData();
203
+ epoint.execute('add', 'fui-form', [windows], closeCallback);
204
+ }
205
+ }
206
+
207
+ // 验证窗口数据
208
+ function validateWindows() {
209
+ var grid = mini.get("windowGrid");
210
+ var data = grid.getData();
211
+ for (var i = 0; i < data.length; i++) {
212
+ var row = data[i];
213
+ if (!row.windowname || row.windowname.trim() === '') {
214
+ epoint.alert('第' + (i + 1) + '行窗口名称不能为空!', '', null, 'warning');
215
+ return false;
216
+ }
217
+ if (!row.windowtype || row.windowtype.trim() === '') {
218
+ epoint.alert('第' + (i + 1) + '行窗口类型不能为空!', '', null, 'warning');
219
+ return false;
220
+ }
221
+ }
222
+ return true;
223
+ }
224
+
225
+ // 获取窗口数据
226
+ function getWindowData() {
227
+ var grid = mini.get("windowGrid");
228
+ var data = grid.getData();
229
+ return JSON.stringify(data);
230
+ }
231
+
232
+ function saveCallback(data) {
233
+ if (data.error) {
234
+ epoint.showTips(data.error, { state: "error" });
235
+ return;
236
+ }
237
+ if (data.msg) {
238
+ epoint.showTips(data.msg, { state: 'success' });
239
+ }
240
+ }
241
+
242
+ function closeCallback(data) {
243
+ if (data.error) {
244
+ epoint.showTips(data.error, { state: "error" });
245
+ return;
246
+ }
247
+ if (data.msg) {
248
+ epoint.closeDialog(data.msg);
249
+ }
250
+ }
251
+ </script>
252
+ </body>
253
+ </html>