centaline-data-driven 1.6.21 → 1.6.23

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 (37) hide show
  1. package/package.json +1 -1
  2. package/release-log.md +14 -0
  3. package/src/SearchList.vue +5 -3
  4. package/src/centaline/dialogList/src/dialog.vue +6 -0
  5. package/src/centaline/dynamicComboBoxWithTextBox/src/dynamicComboBoxWithTextBox.vue +6 -1
  6. package/src/centaline/dynamicDetail/src/dynamicCustomerSimpleDetail.vue +3 -0
  7. package/src/centaline/dynamicDetail/src/dynamicEstateBuildingDetail.vue +3 -0
  8. package/src/centaline/dynamicDetail/src/dynamicEstateSimpleDetail.vue +3 -0
  9. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +3 -0
  10. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +5 -1
  11. package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +3 -0
  12. package/src/centaline/dynamicDrop/src/dynamicDrop.vue +4 -1
  13. package/src/centaline/dynamicForm/src/dynamicForm.vue +19 -0
  14. package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +4 -0
  15. package/src/centaline/dynamicL/src/dynamicL.vue +28 -31
  16. package/src/centaline/dynamicMo/src/dynamicMo.vue +8 -2
  17. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +4 -3
  18. package/src/centaline/dynamicSearchList/src/dynamicSearchScreen.vue +12 -0
  19. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +18 -5
  20. package/src/centaline/dynamicSeg/src/dynamicSeg.vue +6 -1
  21. package/src/centaline/dynamicSo/src/dynamicSo.vue +8 -2
  22. package/src/centaline/dynamicSos/src/dynamicSos.vue +14 -4
  23. package/src/centaline/dynamicSosTt/src/dynamicSosTt.vue +12 -3
  24. package/src/centaline/dynamicSteps/src/dynamicSteps.vue +5 -1
  25. package/src/centaline/dynamicT/src/dynamicT.vue +9 -1
  26. package/src/centaline/dynamicTags/src/dynamicTags.vue +12 -3
  27. package/src/centaline/dynamicTree/src/dynamicSearchTree.vue +4 -1
  28. package/src/centaline/formData/index.js +4 -4
  29. package/src/centaline/loader/src/ctl/SearchScreen.js +377 -2
  30. package/src/centaline/loader/src/ctl/SearchTable.js +378 -2
  31. package/src/centaline/mixins/dynamicElement.js +13 -3
  32. package/src/centaline/quickInput/src/quickInput.vue +4 -1
  33. package/src/centaline/quickInputSos/src/quickInput.vue +9 -1
  34. package/src/centaline/selectOption/src/selectOptionVertical.vue +3 -0
  35. package/src/main.js +4 -4
  36. package/wwwroot/static/centaline/centaline-data-driven.js +2691 -1768
  37. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
@@ -80,7 +80,8 @@
80
80
  tagsWidth: 175,
81
81
  showClear: false,
82
82
  searchText: "",
83
- globalOptions: []
83
+ globalOptions: [],
84
+ timeoutHandle: null,
84
85
  }
85
86
  },
86
87
  created() {
@@ -94,6 +95,14 @@
94
95
  this.model.searchInputHeight = 26;
95
96
  this.model.$self=this;
96
97
  },
98
+ destroyed (){
99
+ this.model = null;
100
+ this.$el = null;
101
+ if(this.timeoutHandle){
102
+ clearTimeout(this.timeoutHandle)
103
+ }
104
+ if(this.unwatch)this.unwatch();
105
+ },
97
106
  computed: {
98
107
  tagsPlaceholder: {
99
108
  get: function () {
@@ -133,7 +142,7 @@
133
142
  var self = this;
134
143
  this.$nextTick(function () {
135
144
  var dropdown = self.$refs["pop"];
136
- self.$watch('model.options', function (newVal, oldVal) {
145
+ this.unwatch=self.$watch('model.options', function (newVal, oldVal) {
137
146
  self.$nextTick(() => {
138
147
  if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
139
148
  dropdown.popperJS.destroy();
@@ -339,7 +348,7 @@
339
348
  },
340
349
  searchTickControl: function (search) {
341
350
  var self = this;
342
- setTimeout(function () {
351
+ this.timeoutHandle=setTimeout(function () {
343
352
  if (search === self.searchText) {
344
353
  self.getOptions(self.searchText);
345
354
  }
@@ -446,7 +446,7 @@ export default {
446
446
  },
447
447
  mounted() {
448
448
  if (this.flagsearch) {
449
- this.$watch(
449
+ this.unwatch=this.$watch(
450
450
  "$refs.treescreen.model.searchData",
451
451
  function (newVal, oldVal) {
452
452
  // 做点什么
@@ -471,5 +471,8 @@ export default {
471
471
  created() {
472
472
  this.model = this.vmodel;
473
473
  },
474
+ destroyed (){
475
+ if(this.unwatch)this.unwatch();
476
+ },
474
477
  };
475
478
  </script>
@@ -4,10 +4,10 @@ import Enum from '../loader/src/ctl/lib/Enum';
4
4
  import Axios from 'axios';
5
5
  const formData = {
6
6
  install(Vue) {
7
- Vue.prototype.$formData = formData;
8
- if (typeof window !== 'undefined') {
9
- window.$formData = formData;
10
- }
7
+ // Vue.prototype.$formData = formData;
8
+ // if (typeof window !== 'undefined') {
9
+ // window.$formData = formData;
10
+ // }
11
11
  },
12
12
  common: common,
13
13
  Axios: Axios,
@@ -6,13 +6,388 @@ import valid from '../../../validate/index';
6
6
  import common from '../../../common';
7
7
  import Axios from 'axios';
8
8
  import Vue from 'vue';
9
- import formData from '../../../formData';
10
9
 
11
10
  const SearchScreen = function (source, callBack, screenPara, prevParam) {
12
11
  var init = function (source,prevParam) {
13
12
  var rtn = {
14
13
  $vue: null,
15
- formData: formData,
14
+ // formData: formData,
15
+ formData:{
16
+ common: common,
17
+ Axios: Axios,
18
+ form: null,
19
+ formTable:null,
20
+ excuteData: null,//fields
21
+ fieldsDic: null,//fieldsDic
22
+ _excuteListData: undefined,
23
+
24
+ //获取code1
25
+ getCode1ByField1(id) {
26
+ var rtn1 = this.fieldsDic[id];
27
+ if (rtn1) {
28
+ return rtn1.value;
29
+ }
30
+ },
31
+ //获取code2
32
+ getCode2ByField1(id) {
33
+ var rtn1 = this.fieldsDic[id];
34
+ if (rtn1) {
35
+ return rtn1.value1;
36
+ }
37
+ },
38
+ //获取Field的属性attrKey的值
39
+ getValueByFieldName(id, attrKey) {
40
+ attrKey = this.common.initialsToLowerCase(attrKey);
41
+ var rtn1 = this.fieldsDic[id];
42
+ if (rtn1) {
43
+ if(rtn1.is && rtn1.is=='ct-btn'){
44
+ return rtn1[attrKey];
45
+ }
46
+ return rtn1.source[attrKey];
47
+ }
48
+ },
49
+ getValueByFieldNameFromParent(id, attrKey) {
50
+ if(this.form && this.form.self && this.form.self.$parent){
51
+ return this.form.self.$parent.vmodel.content[0].on.getValueByFieldName(id, attrKey);
52
+ }
53
+ return null;
54
+ },
55
+ //设置Field的属性attrKey的值
56
+ setValueByFieldName(id, attrKey, attrValue) {
57
+ attrKey = this.common.initialsToLowerCase(attrKey);
58
+ var rtn1 = this.fieldsDic[id];
59
+ if (rtn1) {
60
+ if (attrKey == 'code1' && rtn1.source.controlType === 4
61
+ && attrValue != undefined && attrValue != null && attrValue != '') {
62
+ if (rtn1.source.decimals1 != undefined && rtn1.source.decimals1 != null && rtn1.source.decimals1 > -1) {
63
+ attrValue = Number(attrValue).toFixed(rtn1.source.decimals1)
64
+ }
65
+ }
66
+ else if (attrKey == 'code1' && (rtn1.source.controlType === 25 || rtn1.source.controlType === 51)
67
+ && attrValue != undefined && attrValue != null && attrValue != '') {
68
+ rtn1.jsSetFile(attrValue);
69
+ }
70
+
71
+ rtn1.source[attrKey] = attrValue;
72
+ this.form.hatchHandle(id, attrKey, attrValue, rtn1);
73
+
74
+ //用于处理源数据改动,强制更新视图数据 todo
75
+ if (rtn1.self.$forceUpdate) {
76
+ rtn1.self.$forceUpdate();
77
+ }
78
+ }
79
+ },
80
+ setValueByFieldNameFromParent(id, attrKey, attrValue) {
81
+ if(this.form && this.form.self && this.form.self.$parent){
82
+ return this.form.self.$parent.vmodel.content[0].on.setValueByFieldName(id, attrKey, attrValue);
83
+ }
84
+ return null;
85
+ },
86
+ //设置Field的v1、v2的值
87
+ setV1AndV2ByField1(id, code1, code2) {
88
+ var rtn1 = this.fieldsDic[id];
89
+ if (rtn1) {
90
+ if (typeof rtn1.value !== 'undefined') {
91
+ rtn1.value = code1;
92
+
93
+ this.form.validMrf(rtn1);//验证必填关联组件
94
+ this.form.hiddenHandle(rtn1, true);//隐藏关联的
95
+ }
96
+ if (typeof rtn1.value1 !== 'undefined') {
97
+ rtn1.value1 = code2;
98
+ }
99
+
100
+ if (rtn1.self.$forceUpdate) {
101
+ rtn1.self.$forceUpdate();
102
+ }
103
+ }
104
+ },
105
+ setTabsSelect(id){
106
+ if(this.form && this.form.self){
107
+ var f = this.fieldsDic[id];
108
+ if(this.form.isHorizontalLayout){
109
+ this.form.self.activeName = f.collapseName.toString() === '-1' ? this.form.self.activeName : f.collapseName.toString();
110
+ }
111
+ }
112
+ },
113
+ submit(id){
114
+ if(this.form && this.form.self){
115
+ this.form.self.fieldClickHandler({id:id});
116
+ }
117
+ },
118
+
119
+ //获取列表数据
120
+ get excuteListData() {
121
+ if (this._excuteListData) {
122
+ return this._excuteListData;
123
+ }
124
+ else {
125
+ if (this.excuteData !== null) {
126
+ this._excuteListData = this.excuteData.filter((v) => {
127
+ return typeof v.is !== undefined && (v.is === 'ct-form-list-table'||v.is === 'ct-repeat');
128
+ });
129
+ }
130
+ }
131
+ return this._excuteListData;
132
+ },
133
+ setExcuteListData(fields) {
134
+ this._excuteListData=null;
135
+ if (fields !== null) {
136
+ this.excuteData=fields;
137
+ this._excuteListData = fields.filter((v) => {
138
+ return typeof v.is !== undefined && (v.is === 'ct-form-list-table'||v.is === 'ct-repeat');
139
+ });
140
+ }
141
+ },
142
+ //获取列表的Field
143
+ getListField(tableName, rowNum, fiedlId) {
144
+ let listData = this.excuteListData.find((v) => {
145
+ return v.id === tableName;
146
+ });
147
+ if (listData) {
148
+ let field = null;
149
+ //正在编辑的Field
150
+ if (rowNum === null && (fiedlId === null || listData.currentEventField.id === fiedlId)) {
151
+ field = listData.currentEventField;
152
+ }
153
+ //正在编辑的行
154
+ else if (rowNum === null && listData.currentRowIndex === 0) {
155
+ let fields = listData.currentRow.data;
156
+ field = fields[fiedlId];
157
+ }
158
+ //源数据
159
+ else {
160
+ if (rowNum === null && listData.currentRowIndex) {
161
+ rowNum = listData.currentRowIndex;
162
+ }
163
+
164
+ if (rowNum === 0 || (rowNum && fiedlId)) {
165
+ try {
166
+ let fields = listData.rows[rowNum].field;
167
+ field = fields.find((v) => {
168
+ return v.id === fiedlId;
169
+ });
170
+ }
171
+ catch (e) {
172
+ if (listData.rows.length <= rowNum) {
173
+ var checkMsg = "获取列表行索引超出界限";
174
+ this.message(checkMsg);
175
+ }
176
+ }
177
+ }
178
+ }
179
+
180
+ return { listData: listData, field: field };
181
+ }
182
+ },
183
+ //获取列表的行数(注意 这里包括列头)
184
+ getListCount(tableName) {
185
+ tableName = tableName ? tableName : this.form.scripts.$fd;
186
+ let data = this.getListField(tableName, null, null);
187
+ if (data) {
188
+ return data.listData.rows.length;
189
+ }
190
+ },
191
+ //获取表格某行某列的值
192
+ getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
193
+ tableName = tableName ? tableName : this.form.scripts.$fd;
194
+
195
+ let data = this.getListField(tableName, rowNum, fiedlId);
196
+
197
+ attrName = this.common.initialsToLowerCase(attrName);
198
+ attrName = attrName ? attrName : 'code1';
199
+
200
+ if (!fiedlId) {
201
+ fiedlId = data.listData.currentEventField.id;
202
+ }
203
+ if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.id) {
204
+ data.field = data.listData.currentEventField;
205
+ }
206
+ rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
207
+
208
+ //若该行正在编辑,则取编辑状态的。
209
+ if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && rowNum>-1
210
+ && data.listData.currentRow.data.$sourceIndex === data.listData.source.rows[rowNum].$sourceIndex && data.listData.currentRow.isSet) {
211
+ if(fiedlId=='deleted' || fiedlId=='flagDeleted'){
212
+ return data.listData.currentRow.data.deleted || false;
213
+ }
214
+ return data.listData.currentRow.data[fiedlId].source[attrName];
215
+ }
216
+ else if (data && data.field) {
217
+ if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
218
+ return defaultValue;
219
+ }
220
+ return data.field.source[attrName];
221
+ }
222
+ else if (data && (fiedlId=='deleted' || fiedlId=='flagDeleted')) {
223
+ return data.listData.rows[rowNum].deleted || false;
224
+ }
225
+ },
226
+ getListFieldValueFromParent(tableName, rowNum, fiedlId, attrName, defaultValue) {
227
+ if(this.form && this.form.self && this.form.self.$parent){
228
+ return this.form.self.$parent.vmodel.content[0].on.getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue);
229
+ }
230
+ return null;
231
+ },
232
+ //设置表格某行某列的值
233
+ setListFieldValue(value, tableName, rowNum, fiedlId, attrName) {
234
+ value = value==undefined?"":value.toString();
235
+ tableName = tableName ? tableName : this.form.scripts.$fd;
236
+ let data = this.getListField(tableName, rowNum, fiedlId);
237
+
238
+ attrName = this.common.initialsToLowerCase(attrName);
239
+ attrName = attrName ? attrName : 'code1';
240
+
241
+ if (!fiedlId) {
242
+ fiedlId = data.listData.currentEventField.id;
243
+ }
244
+ if (fiedlId && !rowNum && fiedlId === data.listData.currentEventField.id) {
245
+ //data.field = data.listData.currentEventField;
246
+ }
247
+ rowNum = rowNum !== undefined && rowNum !== null && rowNum !== '' ? rowNum : data.listData.currentRowIndex;
248
+
249
+ if (data) {
250
+ //正在编辑的行
251
+ if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && rowNum>-1
252
+ && data.listData.currentRow.data.$sourceIndex === data.listData.source.rows[rowNum].$sourceIndex) {
253
+ let currentField = data.listData.currentRow.data[fiedlId];
254
+ currentField.source[attrName] = value;
255
+ currentField.rowKey=Math.random();
256
+ //校验自己
257
+ if (currentField.self && currentField.self.validExcute) {
258
+ currentField.self.validExcute();
259
+ }
260
+ if (typeof currentField.self.$forceUpdate === "function") {
261
+ currentField.self.$forceUpdate();
262
+ }
263
+ if (data.field) {
264
+ data.field.source[attrName] = value;
265
+ if(data.listData.$self && data.listData.$self.$refs){
266
+ data.listData.updateListField(data.listData.$self.$refs.FieldsLabel, data.listData.source.rows[rowNum].$sourceIndex, fiedlId);
267
+ }
268
+ }
269
+ }
270
+ else if (data.field) {
271
+ data.field.source[attrName] = value;
272
+ if(data.listData.$self && data.listData.$self.$refs){
273
+ data.listData.updateListField(data.listData.$self.$refs.FieldsLabel, data.listData.source.rows[rowNum].$sourceIndex, fiedlId);
274
+ }
275
+ }
276
+
277
+ //如果有汇总列,触发重新计算汇总
278
+ if (data.listData.showSummary) {
279
+ data.listData.tableData.push({});
280
+ data.listData.tableData.pop();
281
+ }
282
+
283
+ return true;
284
+ }
285
+ return false;
286
+ },
287
+ //设置表格属性值
288
+ setListAttr(tableId, attrName, attrValue) {
289
+ let listData = this.excuteListData.find((v) => {
290
+ return v.id === tableId;
291
+ });
292
+ if(listData){
293
+ listData[attrName] = attrValue
294
+ }
295
+ },
296
+ //新增表格数据
297
+ insertRow(tableId,rows) {
298
+ let listData = this.excuteListData.find((v) => {
299
+ return v.id === tableId;
300
+ });
301
+ if(listData){
302
+ listData.insertRow(rows);
303
+ if(this.form && this.form.self){
304
+ this.form.self.computeScroll();
305
+ }
306
+ }
307
+ },
308
+ //新增或替换表格数据
309
+ insertOrUpdateRow(tableId,row) {
310
+ let listData = this.excuteListData.find((v) => {
311
+ return v.id === tableId;
312
+ });
313
+ if(listData){
314
+ listData.insertOrUpdateRow(row);
315
+ }
316
+ },
317
+ //删除表格数据
318
+ deleteRow(tableId,row) {
319
+ let listData = this.excuteListData.find((v) => {
320
+ return v.id === tableId;
321
+ });
322
+ if(listData){
323
+ listData.delRow(row);
324
+ }
325
+ },
326
+ //清空表格数据
327
+ clear(tableId) {
328
+ let listData = this.excuteListData.find((v) => {
329
+ return v.id === tableId;
330
+ });
331
+ if(listData){
332
+ listData.deleteAll();
333
+ }
334
+ },
335
+
336
+ //获取后台数据,并返回脚本。
337
+ execServerScript(action, object, successCallback) {
338
+ let formData = this;//作用域保存
339
+
340
+ //是否是行内触发的
341
+ let data = this.getListField(this.form.scripts.$fd, null, null);
342
+ object.editMode = data ? 1 : 0;
343
+
344
+ Vue.prototype.$api.postHandler(this.common.globalUri(), { action: action, para: object }).then(
345
+ function (response) {
346
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
347
+ var data = response.content;
348
+ if (response.clientActionType === Enum.ClientActionType.ExcuteScript && data) {
349
+ formData.common.excute.call(formData.form.scripts, data);
350
+ }
351
+ else
352
+ if (response.clientActionType === Enum.ClientActionType.None && data && successCallback) {
353
+ //因为要传参,并直接执行方法,故successCallback回调里要使用formData的话,要加this
354
+ //若不能接受this,也可修改common.excute方法
355
+ //successCallback.call(formData.form.scripts, data);
356
+
357
+ //优化,不需要加this
358
+ formData.common.excuteFun.call(formData.form.scripts, successCallback, data);
359
+ }
360
+ }
361
+ }
362
+ );
363
+ },
364
+ execRouter(routerKey) {
365
+ let field={id:routerKey};
366
+ this.form.self.fieldClickHandler(field);
367
+ },
368
+ //消息提示 type主题:success/warning/info/error。 center是否居中true/flase。 duration 显示时间, 毫秒。设为 0 则不会自动关闭。
369
+ //showClose 是否显示关闭按钮。dangerouslyUseHtmlString 属性设置为 true ,message 就会被当做 HTML 片段处理。
370
+ message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
371
+ if (typeof center === 'undefined') {
372
+ center = true;
373
+ }
374
+ if (typeof duration === 'undefined') {
375
+ duration = 1500;
376
+ }
377
+ if (typeof showClose === 'undefined') {
378
+ showClose = false;
379
+ }
380
+
381
+ Vue.prototype.$message({
382
+ message: message,//消息文字
383
+ dangerouslyUseHTMLString: dangerouslyUseHTMLString || false,
384
+ type: type || 'error',//主题:success/warning/info/error
385
+ center: center,//是否居中
386
+ duration: duration, //显示时间, 毫秒。设为 0 则不会自动关闭
387
+ showClose: showClose,//是否显示关闭按钮
388
+ });
389
+ },
390
+ },
16
391
  enableRelationFields: true,
17
392
  get source() {
18
393
  return source;