centaline-data-driven-v3 0.0.60 → 0.0.62

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <div class="ct-Layout" v-if="Layout !== null && !loading">
3
3
  <ct-layoutchildren :rowindex="rowindex" :actionRouter="actionRouter" :rowdata="vmodel" :vmodel="LayoutList"
4
- :flagflex="true" :parameterAction="parameterAction" :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP"
5
- @click="clickHandler" @changeHandler="changeHandler"></ct-layoutchildren>
4
+ :flagflex="true" :fields="fields" :parameterAction="parameterAction"
5
+ :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler"
6
+ @changeHandler="changeHandler"></ct-layoutchildren>
6
7
  </div>
7
8
  </template>
8
9
  <script setup lang="ts">
@@ -18,6 +19,7 @@ const props = defineProps({
18
19
  listData: Array,
19
20
  apiParam: Object,
20
21
  parameterAction: String,
22
+ fields: Array,
21
23
  formListactionRouter: {
22
24
  type: Array,
23
25
  default: [],
@@ -46,6 +48,9 @@ function init() {
46
48
  if (typeof props.vmodel !== "undefined") {
47
49
  load(props.vmodel, props.cellLayout);
48
50
  }
51
+ else if (props.fields) {
52
+ load(null, props.cellLayout);
53
+ }
49
54
  });
50
55
  }
51
56
  function load(data, cellLayout) {
@@ -106,6 +111,7 @@ function load(data, cellLayout) {
106
111
  }
107
112
  loading.value = false;
108
113
  }
114
+
109
115
  function getValue(data, val) {
110
116
  return val.split(".").reduce((data, currentVal) => {
111
117
  var rtn = data[common.initialsToLowerCase(currentVal)];
@@ -218,10 +224,10 @@ function xmlToJson(xml) {
218
224
  }
219
225
  else if (props.vmodel.delete && attribute.nodeValue == 'delete') {
220
226
  obj["rightRouter"] = true
221
- }
227
+ }
222
228
  else if (props.vmodel.delete && attribute.nodeValue == 'moveup') {
223
229
  obj["rightRouter"] = true
224
- }
230
+ }
225
231
  else if (props.vmodel.delete && attribute.nodeValue == 'movedown') {
226
232
  obj["rightRouter"] = true
227
233
  } else {
@@ -302,7 +308,12 @@ function clickHandler(routerKey, rowindex, forname, forrowindex, flagHaveAlert)
302
308
  }
303
309
  }
304
310
  function changeHandler(field) {
305
- emit("changeHandler", field, props.vmodel.$sourceIndex);
311
+ if (props.fields) {
312
+ emit("changeHandler", field);
313
+ }
314
+ else {
315
+ emit("changeHandler", field, props.vmodel.$sourceIndex);
316
+ }
306
317
  }
307
318
  </script>
308
319
  <style scoped>
@@ -3,14 +3,14 @@
3
3
  <div style="display: flex;height: max-content;cursor: pointer;" :class="[flagflex == true ? 'flagflex' : '',model.className]"
4
4
  v-if="model.rightRouter && model.value != ''" :style="model.styleObject" @click="clickHandlerLayout()">
5
5
  <component v-for="(item, index) in model.fields" :actionRouter="actionRouter" :rowdata="rowdata" :key="index"
6
- :is="item.is" :vmodel="item" :rowindex="rowindex" :forname="forname" :forrowindex="forrowindex" :parameterAction="parameterAction"
6
+ :is="item.is" :vmodel="item" :rowindex="rowindex" :fields="fields" :forname="forname" :forrowindex="forrowindex" :parameterAction="parameterAction"
7
7
  :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler" @changeHandler="changeHandler"></component>
8
8
  </div>
9
9
  </template>
10
10
  <div style="display: flex;height: max-content;" :class="[flagflex == true ? 'flagflex' : '',model.className]"
11
11
  v-else-if="model.value != '' && model.visibility != '0'" :style="model.styleObject">
12
12
  <component v-for="(item, index) in model.fields" :actionRouter="actionRouter" :rowdata="rowdata" :key="index"
13
- :is="item.is" :vmodel="item" :rowindex="rowindex" :forname="forname" :forrowindex="forrowindex" :parameterAction="parameterAction"
13
+ :is="item.is" :vmodel="item" :rowindex="rowindex" :fields="fields" :forname="forname" :forrowindex="forrowindex" :parameterAction="parameterAction"
14
14
  :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler" @changeHandler="changeHandler"></component>
15
15
  </div>
16
16
  </template>
@@ -26,6 +26,7 @@ const props = defineProps({
26
26
  forname: String,
27
27
  forrowindex: String,
28
28
  parameterAction: String,
29
+ fields:Array,
29
30
  flagflex: {
30
31
  type: Boolean,
31
32
  default: false,
@@ -3,14 +3,14 @@
3
3
  <div style="display: flex;height: max-content;cursor: pointer;" v-if="model.rightRouter && model.value != ''"
4
4
  :style="model.styleObject" :class="model.className" @click="clickHandlerLayout($event)">
5
5
  <component v-for="(item, index) in model.fields" :actionRouter="actionRouter" :rowdata="rowdata" :key="index"
6
- :is="item.is" :vmodel="item" :rowindex="rowindex" :forname="forname" :forrowindex="forrowindex"
6
+ :is="item.is" :vmodel="item" :rowindex="rowindex" :fields="fields" :forname="forname" :forrowindex="forrowindex"
7
7
  :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler"></component>
8
8
  </div>
9
9
  </template>
10
10
  <div style="display: flex;height: max-content;" v-else-if="model.value != '' && model.visibility != '0'"
11
11
  :style="model.styleObject" :class="model.className">
12
12
  <component v-for="(item, index) in model.fields" :actionRouter="actionRouter" :rowdata="rowdata" :key="index"
13
- :is="item.is" :vmodel="item" :rowindex="rowindex" :forname="forname" :forrowindex="forrowindex"
13
+ :is="item.is" :vmodel="item" :rowindex="rowindex" :fields="fields" :forname="forname" :forrowindex="forrowindex"
14
14
  :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler"></component>
15
15
  </div>
16
16
  </template>
@@ -26,6 +26,7 @@ const props = defineProps({
26
26
  forname: String,
27
27
  forrowindex: String,
28
28
  parameterAction: String,
29
+ fields:Array,
29
30
  rowMenuDisplayCountForAPP:{
30
31
  type: Number,
31
32
  default: 4,
@@ -17,10 +17,23 @@ const props = defineProps({
17
17
  forname: String,
18
18
  forrowindex: String,
19
19
  parameterAction: String,
20
+ fields: Array,
20
21
  })
21
22
  const model = ref(null)
22
23
  model.value = CellLayout(props.vmodel);
23
- const field = props.rowdata[model.value.fieldName]
24
+ const field = ref({})
25
+ init()
26
+ function init() {
27
+ if (props.fields) {
28
+ field.value= props.fields.find((v) => {
29
+ return v.fieldName1 === model.value.fieldName;
30
+ });
31
+ }
32
+ else {
33
+ field.value = props.rowdata[model.value.fieldName]
34
+ }
35
+ }
36
+
24
37
  function changeHandler(field) {
25
38
  emit('changeHandler', field);
26
39
  }
@@ -10,6 +10,11 @@
10
10
  </div>
11
11
  </slot>
12
12
  </template>
13
+ <template #left-icon>
14
+ <slot name="PreLabel">
15
+ <template v-if="model.preLabel1"><span style="display: flex;height: 28px;align-items: center;" v-html="model.preLabel1"></span></template>
16
+ </slot>
17
+ </template>
13
18
  <template #input>
14
19
  <slot name="Control">
15
20
 
@@ -2,15 +2,22 @@
2
2
  <el-container v-if="model.fields.length > 0"
3
3
  :class="model.controlType != Enum.ControlType.Compound ? 'ct-container' : ''">
4
4
  <template v-if="model.controlType == Enum.ControlType.Compound">
5
- <template v-for="(col, index) in model.fields" :key="index">
6
- <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
7
- <div v-if="col.show !== false"
8
- :class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
9
- :style="{ 'width': (col.width != '0' ? col.width + 'px' : '100%'), 'flex': (col.width != '0' ? '0 0 ' + col.width + 'px' : '100%') }">
10
- <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
11
- v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
12
- @popupSearchList="popupSearchListHandler"></component>
13
- </div>
5
+ <template v-if="model.layoutTemplate">
6
+ <ct-layout :fields="model.fields" :cellLayout="model.layoutTemplate" :parameterAction="parameterAction"
7
+ :key="itemKey" @changeHandler="change">
8
+ </ct-layout>
9
+ </template>
10
+ <template v-else>
11
+ <template v-for="(col, index) in model.fields" :key="index">
12
+ <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
13
+ <div v-if="col.show !== false"
14
+ :class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
15
+ :style="{ 'width': (col.width != '0' ? col.width + 'px' : '100%'), 'flex': (col.width != '0' ? '0 0 ' + col.width + 'px' : '100%') }">
16
+ <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
17
+ v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
18
+ @popupSearchList="popupSearchListHandler"></component>
19
+ </div>
20
+ </template>
14
21
  </template>
15
22
  </template>
16
23
  <template v-else>
@@ -46,14 +53,14 @@ const props = defineProps({
46
53
  })
47
54
  const model = initData(props, ContainerControl)
48
55
  const Fields = ref()
49
-
56
+ const itemKey = ref(0)
50
57
  model.value.selfValidExcute = () => {
51
58
  let rtnBool = true;
52
59
  if (typeof Fields.value !== 'undefined') {
53
60
  Fields.value.forEach((f) => {
54
61
  if (f.model && typeof f.model.validExcute !== 'undefined') {
55
62
  if (!f.model.validExcute(f.model)) {
56
- model.value.displayValidMessage=f.model.displayValidMessage
63
+ model.value.displayValidMessage = f.model.displayValidMessage
57
64
  rtnBool = false;
58
65
  }
59
66
  }
@@ -662,33 +662,11 @@ function PasteUpload(event) {
662
662
  }
663
663
  }
664
664
 
665
- function ListenerPaste(event) {
666
- var target = event.target;
665
+ function ListenerPaste(event) {
667
666
  const uploads = document.querySelectorAll('[uploadStatus="upload"]');
668
-
669
- if (!window.uploads) {
670
- window.uploads = { count: 0, length: uploads.length };
671
- }
672
- if (uploads.length > 1) {
673
- window.uploads.count = window.uploads.count + 1;
674
- window.uploads.length = uploads.length;
675
-
676
- if (window.uploads.count == window.uploads.length) {
677
- window.uploads = null;
678
- ElMessage({
679
- message: "存在多个上传组件,请点击粘贴上传!",
680
- type: 'info',
681
- showClose: true,
682
- });
683
- return false;
684
- }
685
- }
686
- else if (uploads.length == 1) {
687
- window.uploads = null;
667
+ if (uploads.length == 1) {
688
668
  PasteUpload(event);
689
669
  }
690
-
691
-
692
670
  }
693
671
 
694
672
  // 添加粘贴事件监听器
@@ -273,7 +273,8 @@ function saveRow(row, index, isCancel) {
273
273
  if (k !== '$sourceIndex') {
274
274
  row[k].code1 = data[k].code1;
275
275
  row[k].code2 = data[k].code2;
276
- row[k].text = data[k].text;
276
+ row[k].name1 = data[k].name1;
277
+ row[k].name2 = data[k].name2;
277
278
  }
278
279
  };
279
280
  if (model.value.currentRow.isNew) {
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <ct-field :vmodel="model">
3
+ <template #Control v-if="model.code1">
4
+ <div class="ct-image" style="width:100%;text-align: center">
5
+ <el-image :src="model.code1"
6
+ :style="{ 'width': model.minValue1 ? model.minValue1 + 'px' : null, 'height': model.maxValue1 ? model.maxValue1 + 'px' : null, 'border-radius': (model.width1 || 0) + 'px' }">
7
+ </el-image>
8
+ </div>
9
+ </template>
10
+ </ct-field>
11
+ </template>
12
+ <script lang="ts" setup>
13
+ const props = defineProps({
14
+ parameterAction: String,
15
+ vmodel: Object,
16
+ source: Object,
17
+ })
18
+ const model = props.vmodel
19
+ defineExpose({
20
+ model
21
+ })
22
+ </script>
23
+ <style scoped></style>
@@ -2,8 +2,9 @@
2
2
  <div v-loading="loading" style="width: 100%;height: 100%;">
3
3
  <div style="width: 100%;height: 100%;position: relative;" class="ct-photoSelectList" v-if="FlagPhoto">
4
4
  <div style="padding: 10px 0 0 20px" v-if="paramName">
5
- <el-select-v2 v-model="mediaLabelID" :props="optionAttrs" :options="options" :placeholder="common.LocalizedString('类别','類別')"
6
- style="width: 150px;" @change="change" clearable />
5
+ <el-select-v2 v-model="mediaLabelID" :props="optionAttrs" :options="options"
6
+ :placeholder="common.LocalizedString('类别', '類別')" style="width: 150px;" @change="change"
7
+ clearable />
7
8
  </div>
8
9
  <el-main :style="paramName ? 'top: 40px' : 'top: 10px'"
9
10
  style="position: absolute; bottom: 50PX;left: 10px;right: 0;padding:0px">
@@ -11,9 +12,11 @@
11
12
  <template v-if="imageList.length > 0">
12
13
  <template v-if="layout">
13
14
  <div style="display: flex;" v-for="(item, index) in imageList" :key="index">
14
- <el-checkbox style="margin: 0 5px;" @change="choose(item, true)"
15
+ <el-radio v-if="selectedMode == 1" style="margin: 0 5px;height: auto;"
16
+ @change="chooseRadio(item)" v-model="item.ischeck" :label="true">&nbsp;</el-radio>
17
+ <el-checkbox v-else style="margin: 0 5px;" @change="choose(item, true)"
15
18
  v-model="item.ischeck"></el-checkbox>
16
- <ct-layout :vmodel="item" :cellLayout="layout" :rowindex="index" :flagMediaSelect="true"
19
+ <ct-layout :vmodel="item" :cellLayout="layout" :key="itemKey" :rowindex="index" :flagMediaSelect="true"
17
20
  @rolRouterclick="rolRouterCellClickHandler">
18
21
  </ct-layout>
19
22
  </div>
@@ -53,14 +56,15 @@
53
56
  </template>
54
57
  </template>
55
58
  <template v-else>
56
- <el-empty :description="common.LocalizedString('没有数据','沒有數據')" />
59
+ <el-empty :description="common.LocalizedString('没有数据', '沒有數據')" />
57
60
  </template>
58
61
  </el-main>
59
62
 
60
63
  <div style="width:100%;text-align:center">
61
- <el-checkbox style="position:absolute;bottom:10px;left: 15px;" @change="allchoose"
62
- v-model="allcheck">{{common.LocalizedString('全选','全選')}}</el-checkbox>
63
- <el-button type="primary" style="position:absolute;bottom:10px;" @click="handleClick()">{{common.LocalizedString('确定','確認')}}</el-button>
64
+ <el-checkbox v-if="selectedMode != 1" style="position:absolute;bottom:10px;left: 15px;"
65
+ @change="allchoose" v-model="allcheck">{{ common.LocalizedString('全选', '全選') }}</el-checkbox>
66
+ <el-button type="primary" style="position:absolute;bottom:10px;" @click="handleClick()">{{
67
+ common.LocalizedString('确定', '確認') }}</el-button>
64
68
  </div>
65
69
  </div>
66
70
  </div>
@@ -91,6 +95,8 @@ const allcheck = ref(false)
91
95
  const options = ref([])
92
96
  const mediaLabelID = ref('')
93
97
  const loading = ref(true)
98
+ const selectedMode = ref(2)
99
+ const itemKey = ref(0)
94
100
  const optionAttrs = {
95
101
  label: 'name',
96
102
  value: 'code',
@@ -121,6 +127,9 @@ function load(data) {
121
127
  layout.value = data.source.content.layout;
122
128
  paramName.value = data.source.content.paramName;
123
129
  sourceRows = common.deepClone(data.source.content.mediaList);
130
+ if (data.source.content.selectedMode) {
131
+ selectedMode.value = data.source.content.selectedMode
132
+ }
124
133
  }
125
134
  else {
126
135
  sourceRows = common.deepClone(data.source.content);
@@ -151,6 +160,7 @@ function load(data) {
151
160
  options.value = data
152
161
  });
153
162
  }
163
+ itemKey.value = Math.random()
154
164
  } catch (e) {
155
165
  ElMessage({
156
166
  message: e,
@@ -192,6 +202,16 @@ function choose(item, flagCheckbox) {
192
202
  item.ischeck = false;
193
203
  }
194
204
 
205
+ }
206
+ function chooseRadio(item) {
207
+ let chooseItem = common.deepClone(item);
208
+ chooseList.value = [];
209
+ imageList.value.forEach((v) => {
210
+ v.ischeck = false;
211
+ });
212
+ item.ischeck = true;
213
+ chooseList.value.push(chooseItem);
214
+
195
215
  }
196
216
  function allchoose() {
197
217
  chooseList.value = [];
@@ -584,8 +584,8 @@ function importComplete(res, field) {
584
584
  }
585
585
  }
586
586
  else {
587
- if (field && field.changeCallBackFunName) {
588
- this.changeCallBackHandler(field, field.changeCallBackFunName, res.content);
587
+ if (field && field.callBackFunName) {
588
+ this.changeCallBackHandler(field, field.callBackFunName, res.content);
589
589
  }
590
590
  else {
591
591
  doAction(res)
@@ -511,28 +511,8 @@ function PasteUpload(event) {
511
511
 
512
512
  function ListenerPaste(event) {
513
513
 
514
- var target = event.target;
515
514
  const uploads = document.querySelectorAll('[uploadStatus="upload"]');
516
-
517
- if (!window.uploads) {
518
- window.uploads = { count: 0, length: uploads.length };
519
- }
520
- if (uploads.length > 1) {
521
- window.uploads.count = window.uploads.count + 1;
522
- window.uploads.length = uploads.length;
523
-
524
- if (window.uploads.count == window.uploads.length) {
525
- window.uploads = null;
526
- ElMessage({
527
- message: "存在多个上传组件,请点击上传!",
528
- type: 'info',
529
- showClose: true,
530
- });
531
- return false;
532
- }
533
- }
534
- else if (uploads.length == 1) {
535
- window.uploads = null;
515
+ if (uploads.length == 1) {
536
516
  PasteUpload(event);
537
517
  }
538
518
 
@@ -741,6 +741,13 @@ const Base = function (source, moreActionRouter) {
741
741
  set vueComponentName(v) {
742
742
  source.vueComponentName = v;
743
743
  },
744
+ // 控件类型为 VueCustomizedComponent 时 对应的 前端vue的组件名称
745
+ get layoutTemplate() {
746
+ return source.layoutTemplate;
747
+ },
748
+ set layoutTemplate(v) {
749
+ source.layoutTemplate = v;
750
+ },
744
751
  //Field结束
745
752
 
746
753
  collapseName: -1,//所属分组
@@ -393,8 +393,10 @@ function handleAvatarSuccess(res, file, fileList, model) {
393
393
  model.fileList.push(res.content[0]);
394
394
  i = model.fileList.findIndex(v => v.uid === file.uid);
395
395
  }
396
+ data.uid = file.uid;
396
397
 
397
- model.fileList[i] = { ...model.fileList[i], data }
398
+ model.fileList[i] = data;
399
+ //model.fileList[i] = { ...model.fileList[i], data }
398
400
  // rtn.fileList = fileList;//无数据会监听不到
399
401
  }
400
402
  else {
@@ -70,6 +70,12 @@ function loadFromModel(source, isFormList) {
70
70
  return rtn1[attrKey];
71
71
  }
72
72
  },
73
+ getValueByFieldNameFromParent(id, attrKey) {
74
+ if(this.form && this.form.parentModelForm){
75
+ return this.form.parentModelForm.getValueByFieldName(id, attrKey);
76
+ }
77
+ return null;
78
+ },
73
79
  //设置Field的属性attrKey的值
74
80
  setValueByFieldName(id, attrKey, attrValue) {
75
81
  attrKey = common.initialsToLowerCase(attrKey);
@@ -110,6 +116,12 @@ function loadFromModel(source, isFormList) {
110
116
  requiredHandle(rtn1, this.form);
111
117
  }
112
118
  },
119
+ setValueByFieldNameFromParent(id, attrKey, attrValue) {
120
+ if(this.form && this.form.parentModelForm){
121
+ return this.form.parentModelForm.setValueByFieldName(id, attrKey, attrValue);
122
+ }
123
+ return null;
124
+ },
113
125
  //设置Field的v1、v2的值
114
126
  setV1AndV2ByField1(id, code1, code2) {
115
127
  var rtn1 = this.fieldsDic[id];
@@ -395,6 +407,32 @@ function loadFromModel(source, isFormList) {
395
407
  common.message(message, type, center, duration, showClose, dangerouslyUseHTMLString)
396
408
  },
397
409
 
410
+ },
411
+ getValueByFieldName(id, attrKey) {
412
+ attrKey = common.initialsToLowerCase(attrKey);
413
+ var rtn1 = this.fieldsDic[id];
414
+ if (rtn1) {
415
+ return rtn1[attrKey];
416
+ }
417
+ },
418
+ setValueByFieldName(id, attrKey, attrValue) {
419
+ attrKey = common.initialsToLowerCase(attrKey);
420
+ var rtn1 = this.fieldsDic[id];
421
+ if (rtn1) {
422
+ if(attrKey=='code1' && rtn1.controlType===4
423
+ && attrValue!=undefined && attrValue!=null && attrValue!=''){
424
+ if(rtn1.decimals1 != undefined && rtn1.decimals1 != null && rtn1.decimals1>-1){
425
+ attrValue = Number(attrValue).toFixed(rtn1.decimals1)
426
+ }
427
+ }
428
+ rtn1[attrKey] = attrValue;
429
+ // this.self.hatchHandle(id, attrKey, attrValue, rtn1);
430
+
431
+ //用于处理源数据改动,强制更新视图数据 todo
432
+ // if (rtn1.self.$forceUpdate) {
433
+ // rtn1.self.$forceUpdate();
434
+ // }
435
+ }
398
436
  },
399
437
  get source() {
400
438
  return source;
@@ -470,7 +508,9 @@ function loadFromModel(source, isFormList) {
470
508
  item.fields = []
471
509
  if (item.compoundFields) {
472
510
  item.compoundFields.forEach((v) => {
473
- item.fields.push(LibFunction.GetControl(v, source, showLabel, isList))
511
+ let itemCompound = LibFunction.GetControl(v, source, showLabel, isList);
512
+ itemCompound.form = rtn;
513
+ item.fields.push(itemCompound)
474
514
  });
475
515
  }
476
516
  }
@@ -838,7 +878,7 @@ function requiredHandle(item, model) {
838
878
  //清除关联当前组件的组件值
839
879
  function clearRelatedHandle(field, fields) {
840
880
  var f = fields.filter((v) => {
841
- return v.parentField && v.parentField.indexOf(field.fieldName1) > -1;
881
+ return v.parentField && field.fieldName1 && (','+v.parentField+',').indexOf(','+field.fieldName1+',') > -1;
842
882
  });
843
883
  f.forEach((v) => {
844
884
  if (v.reset) {
@@ -1098,10 +1138,10 @@ function changeHandler(field, model) {
1098
1138
  }
1099
1139
  if (field.onAfterChanged && field.controlType !== Enum.ControlType.NumericTextBox) {
1100
1140
  var router = model.actionRouters.find((v) => {
1101
- return v.id === field.onAfterChanged;
1141
+ return v.key === field.onAfterChanged;
1102
1142
  });
1103
1143
  if (router) {
1104
- clickHandler(router);
1144
+ model.$vue.clickHandler(router);
1105
1145
  }
1106
1146
  else {
1107
1147
  if (model.scripts) {
@@ -247,8 +247,11 @@ const LibFunction = {
247
247
  item = NumberWithPlusAndMinus(item)
248
248
  item.is = 'ct-numberwithplusandminus'
249
249
  break;
250
- case Enum.ControlType.VueCustomizedComponent:
251
- item.is = 'ct-'+item.vueComponentName.toLowerCase();
250
+ case Enum.ControlType.VueCustomizedComponent:
251
+ item.is = 'ct-' + item.vueComponentName.toLowerCase();
252
+ break;
253
+ case Enum.ControlType.Image:
254
+ item.is = 'ct-image'
252
255
  break;
253
256
  default:
254
257
  item = Label(item)
@@ -77,8 +77,7 @@ function loadSearchScreenModel(source, prevParam) {
77
77
  return v.controlType === Enum.ControlType.ButtonSearch;
78
78
  });
79
79
  var screens = rtn.sourceFieldsArr.filter((v, i) => {
80
- return (advIndex === -1 || i < advIndex) && v.controlType !== Enum.ControlType.From
81
- || v.controlType == Enum.ControlType.Hidden;
80
+ return (advIndex === -1 || i < advIndex) && v.controlType !== Enum.ControlType.From;
82
81
  });
83
82
 
84
83
  rtnscreens = this.initScreen(screens);
@@ -1106,7 +1106,7 @@ function doAction(response, model) {
1106
1106
  model.dataDictionary = response.content;
1107
1107
 
1108
1108
  model.source.page.rows = model.source.page.rows + response.content.length;
1109
- model.setRow(rtn.listData);
1109
+ model.setRow(model.listData);
1110
1110
  if (!common.flagApp()) {
1111
1111
  model.$vue.calculatingRowHeight();
1112
1112
  model.$vue.emit("searchComplate");
@@ -1125,10 +1125,10 @@ function doAction(response, model) {
1125
1125
  if (response.content && Array.isArray(response.content)) {
1126
1126
  response.content.forEach((row) => {
1127
1127
  for (var vkey in row) {
1128
- model.dataDictionary[row[model.primaryKey]][vkey] = row[vkey];
1128
+ model.dataDictionary[row[model.primaryFieldName]][vkey] = row[vkey];
1129
1129
  }
1130
1130
  });
1131
- model.setRow(rtn.listData);
1131
+ model.setRow(model.listData);
1132
1132
  }
1133
1133
  else {
1134
1134
  model.$vue.updateCurrentRow({ flagFreshCurrentRow: true }, { responseData: response });
@@ -1154,7 +1154,7 @@ function doAction(response, model) {
1154
1154
 
1155
1155
  case Enum.ActionType.Replace: //替换
1156
1156
  if (response.content && Array.isArray(response.content)) {
1157
- delete model.dataDictionary[rtn.listData[model.selectIndex][model.primaryKey]];
1157
+ delete model.dataDictionary[model.listData[model.selectIndex][model.primaryFieldName]];
1158
1158
  response.content.forEach((row) => {
1159
1159
  model.listData.splice(model.selectIndex, 1, row);
1160
1160
  });
package/src/main.js CHANGED
@@ -21,8 +21,8 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
21
21
  }
22
22
 
23
23
  app.use(centaline, {
24
- baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
25
- //baseUrl: "http://10.88.22.66:6060/onecard-api/",
24
+ //baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
25
+ baseUrl: "http://10.88.22.66:6060/xian/",
26
26
  //baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
27
27
  //baseUrl: "http://10.1.245.111:38028/",
28
28
  flagRouterSelf: true,
@@ -63,8 +63,8 @@ app.use(centaline, {
63
63
  return {
64
64
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
65
65
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
66
- //authObject: '{token:"1-7acf3f06-c2ea-471c-a5fa-07e1c2a81728"}',
67
- authObject: '{EmpID:"Token_5f3cda7e-a0b5-4899-8231-f6a4aaae661b",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_5f3cda7e-a0b5-4899-8231-f6a4aaae661b",Platform:"WEB"}',
66
+ authObject: '{token:"1-62bcf715-79c4-4a23-9780-269ea2f31478"}',
67
+ //authObject: '{EmpID:"Token_1f937895-684b-4db0-83e5-6a18ce16763b",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_1f937895-684b-4db0-83e5-6a18ce16763b",Platform:"WEB"}',
68
68
  };
69
69
  },
70
70
  // 请求完成事件,可判断是否登录过期执行响应操作
@@ -888,8 +888,8 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
888
888
  if (callBack) {
889
889
  callBack(data);
890
890
  }
891
- if (field && field.changeCallBackFunName) {
892
- model.$vue.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
891
+ if (field && field.callBackFunName) {
892
+ model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
893
893
  }
894
894
  else if (field.isRefersh) {
895
895
  model.$vue.load(model.$vue.Form.loadFromModel(data.content));
@@ -1622,8 +1622,8 @@ export function RouterMouseenterHandler(field, submitData, action, model, source
1622
1622
  if (callBack) {
1623
1623
  callBack(data);
1624
1624
  }
1625
- if (field && field.changeCallBackFunName) {
1626
- model.$vue.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
1625
+ if (field && field.callBackFunName) {
1626
+ model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
1627
1627
  }
1628
1628
  else if (field.isRefersh) {
1629
1629
  model.$vue.load(model.$vue.Form.loadFromModel(data.content));