centaline-data-driven-v3 0.0.88 → 0.0.90

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.88",
3
+ "version": "0.0.90",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -4,7 +4,8 @@
4
4
  <span v-if="rowMenuDisplayCountForAPP == 1 && RouterlistMore.length > 0" style="font-size: 24px;font-weight:bold"
5
5
  @click="clickmore">...</span>
6
6
  <template v-else>
7
- <van-button v-for="(field, index) in Routerlist" :key="index" color="#999999" plain size="small"
7
+ <van-button v-for="(field, index) in Routerlist" :key="index" plain size="small"
8
+ :style="{ color: field.textColor ? field.textColor : '#999999', backgroundColor: field.bgColor ? field.bgColor : '#ffffff', borderColor: field.borderColor ? field.borderColor : '#cccccc' }"
8
9
  @click="clickHandler(field)">{{ field.controlLabel }}</van-button>
9
10
  <van-button v-if="RouterlistMore.length>0" color="#999999" plain size="small"
10
11
  @click="clickmore">...</van-button>
@@ -21,8 +21,7 @@
21
21
  :border="false">
22
22
  <component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field"
23
23
  :parameterAction="model.parameterAction" v-bind="field.bindPara" @fieldClick="fieldClickHandler"
24
- @tableButtonClick="clickHandler"
25
- @change="changeHandler" />
24
+ @tableButtonClick="clickHandler" @change="changeHandler" />
26
25
  </van-cell-group>
27
26
  <template v-if="model.collapse.length > 0">
28
27
  <!--tabs-->
@@ -37,8 +36,7 @@
37
36
  <component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field"
38
37
  :parameterAction="model.parameterAction" v-bind="field.bindPara"
39
38
  @fieldClick="fieldClickHandler" @change="changeHandler"
40
- @tableButtonClick="clickHandler"
41
- @popupSearchList="popupSearchListHandler" />
39
+ @tableButtonClick="clickHandler" @popupSearchList="popupSearchListHandler" />
42
40
  </van-cell-group>
43
41
  </van-tab>
44
42
  </template>
@@ -49,17 +47,16 @@
49
47
  <!--分组-->
50
48
  <template v-else>
51
49
  <van-cell-group v-for="(item, index) in model.collapse" :key="index">
52
- <template v-if="item.show !== false" v-for="(field, collapseIndex) in model.collapseFields[index + 1]"
53
- :key="collapseIndex">
50
+ <template v-if="item.show !== false"
51
+ v-for="(field, collapseIndex) in model.collapseFields[index + 1]" :key="collapseIndex">
54
52
  <component ref="Fields" :is="field.is" v-if="field.show !== false" :vmodel="field"
55
53
  :parameterAction="model.parameterAction" v-bind="field.bindPara"
56
- @fieldClick="fieldClickHandler" @change="changeHandler"
57
- @tableButtonClick="clickHandler"
54
+ @fieldClick="fieldClickHandler" @change="changeHandler" @tableButtonClick="clickHandler"
58
55
  @popupSearchList="popupSearchListHandler" />
59
56
  </template>
60
57
  <template #title v-if="item.show !== false">
61
- <span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel }}</span>
62
- <span v-html="item.sufLabel1"></span>
58
+ <div :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel }}</div>
59
+ <div v-html="item.sufLabel1"></div>
63
60
  </template>
64
61
  </van-cell-group>
65
62
  </template>
@@ -71,8 +68,8 @@
71
68
  :border="false">
72
69
  <component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field"
73
70
  :parameterAction="model.parameterAction" v-bind="field.bindPara" @fieldClick="fieldClickHandler"
74
- @tableButtonClick="clickHandler"
75
- @change="changeHandler" @popupSearchList="popupSearchListHandler" />
71
+ @tableButtonClick="clickHandler" @change="changeHandler"
72
+ @popupSearchList="popupSearchListHandler" />
76
73
  </van-cell-group>
77
74
  </template>
78
75
  <div v-if="model.links.findIndex((v) => { return v.show }) > -1" style="padding: 0 10px;">
@@ -85,7 +82,7 @@
85
82
  <div class="safe-area-inset-bottom-height"></div>
86
83
  </div>
87
84
  <div class="button-absoluteAPP"
88
- v-if="common.flagMicroMessenger() && model.buttons.findIndex((v) => { return v.show }) > -1">
85
+ v-if="(common.flagMicroMessenger() || common.flagHK()) && model.buttons.findIndex((v) => { return v.show }) > -1">
89
86
  <template v-for="(field, index) in model.buttons" :key="index">
90
87
  <component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field"
91
88
  :parameterAction="model.parameterAction" v-bind="field.bindPara" @fieldClick="clickHandler" />
@@ -178,7 +175,7 @@ function init() {
178
175
  function load(data) {
179
176
  model.value = data
180
177
  model.value.parentModelForm = props.parentModelForm
181
- model.value.$vue = { fieldClickHandler, clickHandler, emit, getFormObj, getFileData, Form, validExcute, changeCallBackHandler, load, init, updateFields,loaded };
178
+ model.value.$vue = { fieldClickHandler, clickHandler, emit, getFormObj, getFileData, Form, validExcute, changeCallBackHandler, load, init, updateFields, loaded };
182
179
  if (model.value.scripts) {
183
180
  model.value.scripts.formData = model.value.formData;
184
181
  model.value.scripts.formData.form = model.value;
@@ -251,7 +248,7 @@ function setFormHeight() {
251
248
  h2 = refForm.value.offsetTop
252
249
  }
253
250
  let formHeight = h1 - h2
254
- if (common.flagMicroMessenger()) {
251
+ if (common.flagMicroMessenger()||common.flagHK()) {
255
252
  formHeight = formHeight - 64
256
253
  }
257
254
  model.value.formHeight = formHeight
@@ -284,11 +281,11 @@ function validExcute() {
284
281
  }
285
282
  setTimeout(function () {
286
283
  if (f.$el.offsetParent) {
287
- var h1=0;
288
- if(!props.flagNavbar){
289
- h1=46
284
+ var h1 = 0;
285
+ if (!props.flagNavbar) {
286
+ h1 = 46
290
287
  }
291
- refForm.value.scrollTop = f.$el.offsetTop + f.$el.offsetParent.offsetTop-h1
288
+ refForm.value.scrollTop = f.$el.offsetTop + f.$el.offsetParent.offsetTop - h1
292
289
  }
293
290
 
294
291
  }, timeOut);
@@ -8,11 +8,11 @@
8
8
  </div>
9
9
  <template v-if="imageList.length > 0">
10
10
  <template v-if="layout">
11
- <div style="display: flex;" v-for="(item, index) in imageList" :key="index">
12
- <van-radio v-if="selectedMode == 1" @click="chooseRadio(item)" style="margin: 0 5px;"
11
+ <div style="display: flex;" v-for="(item, index) in imageList" :key="index" @click="changeChoose(item,false)" >
12
+ <van-radio v-if="selectedMode == 1" @click.stop="changeChoose(item,true)" style="margin: 0 5px;"
13
13
  :checked="item.ischeck" icon-size="14px"></van-radio>
14
- <van-checkbox v-else style="margin: 0 5px;" @change="choose(item, true)" v-model="item.ischeck"
15
- shape="square" icon-size="14px"></van-checkbox>
14
+ <van-checkbox v-else style="margin: 0 5px;" v-model="item.ischeck"
15
+ shape="square" @click.stop="changeChoose(item,true)" icon-size="14px"></van-checkbox>
16
16
  <ct-layout :vmodel="item" :cellLayout="layout" :key="itemKey" :rowindex="index"
17
17
  :flagMediaSelect="true" @rolRouterclick="rolRouterCellClickHandler">
18
18
  </ct-layout>
@@ -163,6 +163,16 @@ function load(data) {
163
163
  });
164
164
  }
165
165
  }
166
+ function changeChoose(item,flagCheckboxOrRadio){
167
+ if(!flagCheckboxOrRadio){
168
+ item.ischeck=!item.ischeck;
169
+ }
170
+ if(selectedMode.value==1){
171
+ chooseRadio(item)
172
+ }else{
173
+ choose(item,true);
174
+ }
175
+ }
166
176
  // 点击选中图片
167
177
  function choose(item, flagCheckbox) {
168
178
  let chooseItem = common.deepClone(item);
@@ -227,11 +237,12 @@ function handleClick() {
227
237
  function rolRouterCellClickHandler(routerKey, rowindex, sourceIndex) {
228
238
  if (routerKey == 'photoPreview') {
229
239
  viewerfile(imageList.value, rowindex)
240
+ event.stopPropagation();
230
241
  }
231
242
  }
232
243
  function viewerfile(list, index) {
233
244
 
234
- var MediaAlbum = [{ albumName: model.value.label || "媒体", medias: [] as any }];
245
+ var MediaAlbum = [{ albumName: model.value.label || common.LocalizedString('媒体', '媒體'), medias: [] as any }];
235
246
 
236
247
  let fileList = list.filter((item) => {
237
248
  return item.flagDeleted !== true;
@@ -239,7 +250,7 @@ function viewerfile(list, index) {
239
250
  fileList.forEach((v) => {
240
251
  MediaAlbum[0].medias.push(v);
241
252
  });
242
- common.viewerfile((model.value.label || "预览媒体"), MediaAlbum, 0, index, props.mediaViewPageType);
253
+ common.viewerfile((model.value.label || common.LocalizedString('预览媒体', '預覽媒體')), MediaAlbum, 0, index, props.mediaViewPageType);
243
254
  }
244
255
  function change(item) {
245
256
  showPicker.value = false;
@@ -15,9 +15,9 @@
15
15
  @load="onLoad" :immediate-check="false" :style="'min-height:' + model.tableHeight + 'px'">
16
16
  <template v-if="flagPopupSearchlist && singleSelectio">
17
17
  <van-radio-group v-model="checkeds" ref="refCheckboxGroup">
18
- <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex">
19
- <van-radio @click="selectRow(row)" icon-size="16px" checked-color="#EE6B6B"
20
- :name="rowindex" :disabled="!flagSelect(row)"> </van-radio>
18
+ <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex" @click="selectRow(row,rowindex,false)">
19
+ <van-radio @click.stop="selectRow(row,rowindex,true)" icon-size="16px" checked-color="#EE6B6B"
20
+ :name="rowindex" :checked="row.$select" :disabled="!flagSelect(row)"> </van-radio>
21
21
  <ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex"
22
22
  :key="itemKey" @rolRouterclick="rolRouterCellClickHandler"
23
23
  :actionRouter="model.actionRouter"
@@ -28,11 +28,11 @@
28
28
  </template>
29
29
  <template v-else>
30
30
  <van-checkbox-group v-model="checkeds" ref="refCheckboxGroup">
31
- <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex">
31
+ <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex" @click="selectRow(row,rowindex,false)">
32
32
  <template v-if="isoperate || flagPopupSearchlist">
33
33
  <van-checkbox v-if="flagSelect(row)" shape="square" checked-color="#EE6B6B"
34
- icon-size="14px" :name="rowindex" @click="selectRow(row)"></van-checkbox>
35
- <div class="van-checkbox" v-else></div>
34
+ icon-size="14px" :name="rowindex" @click.stop="selectRow(row,rowindex,true)"></van-checkbox>
35
+ <div class="van-checkbox" v-else>{{row.$select}}</div>
36
36
  </template>
37
37
  <ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex"
38
38
  :key="itemKey" @rolRouterclick="rolRouterCellClickHandler"
@@ -339,6 +339,7 @@ function rolRouterCellClickHandler(routerKey, rowindex, forname, forrowindex, fl
339
339
  }
340
340
  model.value.selectIndex = rowindex
341
341
  RouterClickHandler(field, submitData, action, model.value, 'table')
342
+ event.stopPropagation();
342
343
  }
343
344
  //toolButtons操作
344
345
  function toolbarClickHandler(field) {
@@ -388,21 +389,34 @@ function modeClickHandler() {
388
389
  selectCount.value = getSelectRowLength();
389
390
  }
390
391
  //选择行
391
- function selectRow(row) {
392
- if (props.singleSelectio) {
393
- model.value.listData.forEach((ro) => {
394
- if (
395
- !model.value.rightCheckBoxColumn ||
396
- common.getDataOfUpperLower(ro, model.value.rightCheckBoxColumn) == 1
397
- ) {
398
- ro.$select = false
392
+ function selectRow(row,rowIndex,flagCheckboxOrRadio) {
393
+ if(flagSelect(row)&&(isoperate.value || props.flagPopupSearchlist)){
394
+ if (props.singleSelectio) {
395
+ model.value.listData.forEach((ro) => {
396
+ if (
397
+ !model.value.rightCheckBoxColumn ||
398
+ common.getDataOfUpperLower(ro, model.value.rightCheckBoxColumn) == 1
399
+ ) {
400
+ ro.$select = false
401
+ }
402
+ });
403
+ }
404
+ row.$select = !row.$select
405
+ if(!flagCheckboxOrRadio){
406
+ if(row.$select){
407
+ if(checkeds.value.indexOf(rowIndex) == -1){
408
+ checkeds.value.push(rowIndex);
409
+ }
410
+ }else{
411
+ if(checkeds.value.indexOf(rowIndex) > -1){
412
+ checkeds.value.splice(checkeds.value.indexOf(rowIndex),1);
413
+ }
399
414
  }
400
- });
415
+ }
416
+ SearchTable.setSelectAll(model.value);
417
+ SearchTable.getSelectAll(model.value);
418
+ selectCount.value = getSelectRowLength();
401
419
  }
402
- row.$select = !row.$select
403
- SearchTable.setSelectAll(model.value);
404
- SearchTable.getSelectAll(model.value);
405
- selectCount.value = getSelectRowLength();
406
420
  }
407
421
  function exit() {
408
422
  model.value.selectAll = false
@@ -94,10 +94,10 @@ function getLableShow() {
94
94
  labelShow = props.vmodel.getCheckedName();;
95
95
  break;
96
96
  case Enum.ControlType.Switch:
97
- labelShow = props.vmodel.code1 ? '开启' : '关闭';
97
+ labelShow = props.vmodel.value ? '开启' : '关闭';
98
98
  break;
99
99
  case Enum.ControlType.CheckBox:
100
- labelShow = props.vmodel.code1 ? '是' : '否';
100
+ labelShow = props.vmodel.value ? '是' : '否';
101
101
  break;
102
102
  default:
103
103
  break;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <van-popup :show="true" :z-index="zindex" position="right" :style="{ width: '100%', height: '100%' }">
3
3
  <van-nav-bar :title="vmodel.title" :left-arrow="true" @click-left="close" @click-right="onClickRight">
4
- <template #right v-if="!common.flagMicroMessenger()">
4
+ <template #right v-if="!common.flagMicroMessenger()&&!common.flagHK()">
5
5
  <template v-if="buttons.length == 1">
6
6
  {{ buttons[0].controlLabel }}
7
7
  </template>
@@ -57,7 +57,7 @@
57
57
  </div>
58
58
  <div class="screen-condition" v-if="searchdata.length > 0">
59
59
  <van-dropdown-menu active-color="#323233">
60
- <van-dropdown-item :title="'当前搜索条件:已选中' + searchdata.length + '个条件'">
60
+ <van-dropdown-item :title="common.LocalizedString('当前搜索条件:已选中' + searchdata.length + '个条件', '當前搜尋條件:已選中' + searchdata.length + '個條件')">
61
61
  <van-row gutter="20" v-for="(field, index) in searchdata" :key="index">
62
62
  <van-col span="6" style="text-align: right;">{{ field.controlLabel }}</van-col>
63
63
  <van-col span="18">
@@ -81,8 +81,15 @@
81
81
  </van-dropdown-item>
82
82
  </van-dropdown-menu>
83
83
  </div>
84
- <van-action-sheet v-model:show="issort" :actions="actions" cancel-text="取消" @select="selectsort($event)"
85
- :round="false" />
84
+ <van-action-sheet v-model:show="issort" cancel-text="取消"
85
+ :round="false">
86
+ <template #default>
87
+ <button type="button" class="van-action-sheet__item" v-for="(v, i) in actions" :key="i"
88
+ :style="{ 'background': v.name==sortname ? '#f2f3f5' : ''}">
89
+ <span class="van-action-sheet__name" @click="selectsort(v)">{{ v.name}}</span>
90
+ </button>
91
+ </template>
92
+ </van-action-sheet>
86
93
  </div>
87
94
  </template>
88
95
  <script setup lang="ts">
@@ -292,7 +292,7 @@ const getDistanceToBottom = () => {
292
292
  function getRefFieldJson() {
293
293
  let rtn = {};
294
294
  let router = props.router;
295
- if (router.refFieldName) {
295
+ if (router?.refFieldName && props.form?.getFormObj) {
296
296
  let refFieldName = router.refFieldName.split(',');
297
297
  let submitData = props.form.getFormObj();
298
298
  if (refFieldName.length > 0 && submitData) {
@@ -523,23 +523,30 @@ const getTemplateType = (fullText) => {
523
523
  if (eventData.rtnCode != '200') {
524
524
  rtn = "error";
525
525
  outtext.value = (eventData.rtnMsg || fullText);
526
- if (eventData.rtnCode == '401') {
527
- common.message(eventData.rtnMsg, 'error');
526
+ if (eventData.rtnCode == Enum.ReturnCode.Unauthorized) {
527
+ if (common.getDataDrivenOpts().handler?.login) {
528
+ common.getDataDrivenOpts().handler.login();
529
+ };
528
530
  }
529
531
  }
530
532
  else if (eventData.clientActionType == Enum.ClientActionType.ExcuteScript) {
531
533
  rtn = 'js';
532
- if (eventData.content&&props.form) {
534
+ if (eventData.content && props.form) {
533
535
  common.excute.call(props.form?.scripts, eventData.content);
534
536
  }
535
537
  outtext.value = (eventData.rtnMsg || "脚本执行成功!");
536
538
 
537
539
  }
538
- else if (eventData.content?.rows) {
539
- rtn = 'table';
540
- }
541
- else if (eventData.content?.fields) {
542
- rtn = 'form';
540
+ else if (eventData.content) {
541
+ if (!isJSONObject(eventData.content)) {
542
+ outtext.value = eventData.content;
543
+ }
544
+ else if (eventData.content?.rows) {
545
+ rtn = 'table';
546
+ }
547
+ else if (eventData.content?.fields) {
548
+ rtn = 'form';
549
+ }
543
550
  }
544
551
 
545
552
  }
@@ -551,14 +558,25 @@ const getTemplateType = (fullText) => {
551
558
  return rtn;
552
559
 
553
560
  }
561
+ function isJSONObject(value) {
562
+ if (typeof value !== 'object' || value === null) {
563
+ return false; // 如果不是对象,直接返回 false
564
+ }
554
565
 
566
+ try {
567
+ JSON.stringify(value);
568
+ return true; // 如果可以序列化为 JSON,说明是 JSON 对象
569
+ } catch (e) {
570
+ return false; // 如果序列化失败,说明不是 JSON 对象
571
+ }
572
+ }
555
573
 
556
574
  function startTypingEffect(fullText) {
557
575
  fullText = fullText.replace(/\\n/gi, '\n\n');
558
576
  let index = 0;
559
577
  outtext.value = ''; // 清空内容
560
578
  function typeNext() {
561
- // 随机生成310之间的字符数
579
+ // 随机生成412之间的字符数
562
580
  const randomChars = Math.floor(Math.random() * 5) + 8;
563
581
  const charsToLoad = Math.min(randomChars, fullText.length - index);
564
582
 
@@ -74,7 +74,7 @@ function visibleChange(visible) {
74
74
  //出现获取数据
75
75
  if (visible) {
76
76
  open.value = true;
77
- nodatatext.value = '加载中';
77
+ nodatatext.value = common.LocalizedString('加载中', '加載中');
78
78
  if (!model.value.filterable) {
79
79
  getOptions('')
80
80
  }
@@ -12,7 +12,7 @@
12
12
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
13
13
  <div v-if="col.show !== false"
14
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%') }">
15
+ :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '100%') }">
16
16
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
17
17
  v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
18
18
  @popupSearchList="popupSearchListHandler"></component>
@@ -28,7 +28,7 @@
28
28
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
29
29
  <el-col v-if="col.show !== false"
30
30
  :class="[index > 0 && (col.controlLabel == '' || col.is == 'ct-btn') ? 'complex-left-10' : '', 'containerCol']"
31
- :style="{ 'width': (col.width != '0' ? col.width + 'px' : '100%'), 'flex': (col.width != '0' ? '0 0 ' + col.width + 'px' : '100%') }">
31
+ :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0 ? '0 0 ' + col.width + 'px' : '100%') }">
32
32
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
33
33
  v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
34
34
  @popupSearchList="popupSearchListHandler">
@@ -240,8 +240,8 @@ const props = defineProps({
240
240
  return [];
241
241
  },
242
242
  },
243
- dialogHeight: String,
244
- dialoWidth: String,
243
+ dialogHeight: Number,
244
+ dialoWidth: Number,
245
245
  })
246
246
 
247
247
  const itemKey = ref(1)
@@ -72,21 +72,25 @@
72
72
  <h5>{{ model.controlLabel }}</h5>
73
73
  </div>
74
74
  <div class="list-button">
75
- <template v-if="!model.tableDisabled">
76
- <ul>
77
- <li v-for="(v,i) in model.toolButtonsShow" >
78
- <component :is="v.is" :vmodel="v" :parentModel="model" @fieldClick="toolButtonsClick" @importComplete="importComplete" @change="toolButtonsChangeHandler(v,$event)"></component>
79
- </li>
80
- <li v-if="model.selectRouter!==null">
81
- <component :is="model.selectRouter.is" :vmodel="model.selectRouter" @click="popupSearchListHandle(model.selectRouter)"></component>
82
- </li>
83
- <li v-if="model.create">
84
- <el-button :disabled="model.disabled" class="btn-add" type="success" style="width: auto;" size="small" :icon="CirclePlus" @click="addRow">
85
- {{ model.createText }}
86
- </el-button>
87
- </li>
88
- </ul>
89
- </template>
75
+ <template v-if="!model.tableDisabled">
76
+ <ul>
77
+ <li v-for="(v, i) in model.toolButtonsShow">
78
+ <component :is="v.is" :vmodel="v" :parentModel="model" @fieldClick="toolButtonsClick"
79
+ @importComplete="importComplete" @change="toolButtonsChangeHandler(v, $event)">
80
+ </component>
81
+ </li>
82
+ <li v-if="model.selectRouter !== null">
83
+ <component :is="model.selectRouter.is" :vmodel="model.selectRouter"
84
+ @click="popupSearchListHandle(model.selectRouter)"></component>
85
+ </li>
86
+ <li v-if="model.create">
87
+ <el-button :disabled="model.disabled" class="btn-add" type="success"
88
+ style="width: auto;" size="small" :icon="CirclePlus" @click="addRow">
89
+ {{ model.createText }}
90
+ </el-button>
91
+ </li>
92
+ </ul>
93
+ </template>
90
94
  </div>
91
95
  <el-table :data="model.tableData" border :show-summary="model.showSummary"
92
96
  :summary-method="getSummaries" style="width: 100%" highlight-current-row>
@@ -113,8 +117,10 @@
113
117
  @click="saveRow(scope.row, scope.$index, false)"
114
118
  style="cursor: pointer;">取消</el-tag>
115
119
  <template v-for="(v, i) in model.buttons">
116
- <el-tag v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
117
- style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label }}</el-tag>
120
+ <el-tag
121
+ v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
122
+ style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label
123
+ }}</el-tag>
118
124
  </template>
119
125
  </template>
120
126
  </el-table-column>
@@ -141,8 +147,9 @@
141
147
  </span>
142
148
  <!--可点击的列-->
143
149
  <span v-else-if="v.router" :class="'cell'" style="display: flex;">
144
- <Tablecurrency :router="v.router" :colValue="scope.row[v.fieldName1].code1" :rowData="scope.row" @click="rolRouterClickHandler">
145
- </Tablecurrency>
150
+ <Tablecurrency :router="v.router" :colValue="scope.row[v.fieldName1].code1"
151
+ :rowData="scope.row" @click="rolRouterClickHandler">
152
+ </Tablecurrency>
146
153
  </span>
147
154
  <ct-span v-else-if="scope.row[v.fieldName1]" :vmodel="scope.row[v.fieldName1]"
148
155
  :rowNum="scope.row.$sourceIndex" :rowData="scope.row"></ct-span>
@@ -172,8 +179,10 @@
172
179
  @click="saveRow(scope.row, scope.$index, false)"
173
180
  style="cursor: pointer;">取消</el-tag>
174
181
  <template v-for="(v, i) in model.buttons">
175
- <el-tag v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
176
- style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label }}</el-tag>
182
+ <el-tag
183
+ v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
184
+ style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label
185
+ }}</el-tag>
177
186
  </template>
178
187
  </template>
179
188
  </el-table-column>
@@ -424,9 +433,26 @@ function getSummaries(param) {
424
433
  function fieldsValidExcute() {
425
434
  var rtnBool = true;
426
435
  var i = 0;
436
+ var controlLabel = model.value.controlLabel;
437
+ //如果当前组件的controlLabel为空 取上一个分组组的controlLabel
438
+ if (!model.value.controlLabel) {
439
+ if (model.value.form && model.value.form.fields) {
440
+ const currentIndex = model.value.form.fields.findIndex(v => v.fieldName1 === model.value.fieldName1);
441
+ if (currentIndex - 1 >= 0) {
442
+ if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group){
443
+ controlLabel = model.value.form.fields[currentIndex - 1].controlLabel;
444
+ }
445
+ }
446
+ }
447
+ }
427
448
  if (model.value.required) {
428
449
  if (model.value.tableData.length == 0) {
429
- model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + model.value.controlLabel + ']'
450
+ if (controlLabel) {
451
+ model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + controlLabel + ']'
452
+ }
453
+ else {
454
+ model.value.displayValidMessage = '表格不能为空'
455
+ }
430
456
  return false;
431
457
  }
432
458
  }
@@ -495,23 +521,23 @@ function setcolumnminWidth(column) {
495
521
  function buttonClick(row, button) {
496
522
  var submitData = {};
497
523
  button.submitFormField.forEach((v) => {
498
- submitData[v] = common.getDataOfUpperLower(row,v).code1;
524
+ submitData[v] = common.getDataOfUpperLower(row, v).code1;
499
525
  });
500
526
  model.value.currentRowIndex = model.value.source.rows.findIndex(v => v.$sourceIndex === row.$sourceIndex);
501
527
 
502
528
  emit('tableButtonClick', button, submitData);
503
529
  }
504
- function rolRouterClickHandler(field, rowData,rowindex) {
505
- buttonClick(rowData, field);
530
+ function rolRouterClickHandler(field, rowData, rowindex) {
531
+ buttonClick(rowData, field);
506
532
  }
507
533
  function toolButtonsClick(field) {
508
- emit('tableButtonClick', field, null);
534
+ emit('tableButtonClick', field, null);
509
535
  }
510
536
  function toolButtonsChangeHandler(field) {
511
- emit('change', field);
537
+ emit('change', field);
512
538
  }
513
539
  function importComplete(res, button) {
514
- emit('importComplete', res, button);
540
+ emit('importComplete', res, button);
515
541
  }
516
542
  function insertOrUpdateRow(row) {
517
543
  FormList.insertOrUpdateRow(row, true, model.value);
@@ -623,6 +649,7 @@ defineExpose({
623
649
  padding: 10px;
624
650
  width: 100%;
625
651
  }
652
+
626
653
  .list-button ul li {
627
654
  margin-right: 5px;
628
655
  float: left;
@@ -95,10 +95,10 @@ function getLableShow() {
95
95
  labelShow = props.vmodel.getCheckedName();;
96
96
  break;
97
97
  case Enum.ControlType.Switch:
98
- labelShow = props.vmodel.code1 ? '开启' : '关闭';
98
+ labelShow = props.vmodel.value? '开启' : '关闭';
99
99
  break;
100
100
  case Enum.ControlType.CheckBox:
101
- labelShow = props.vmodel.code1 ? '是' : '否';
101
+ labelShow = props.vmodel.value? '是' : '否';
102
102
  break;
103
103
  default:
104
104
  break;