centaline-data-driven-v3 0.0.56 → 0.0.58

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.56",
3
+ "version": "0.0.58",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -452,11 +452,11 @@ body {
452
452
  .ct-searchtable .ct-tr {
453
453
  background-color: #ffffff;
454
454
  color: var(--centalineBlack);
455
+ cursor: default;
455
456
  }
456
457
 
457
458
  .ct-searchtable .ct-tr>.ct-td {
458
459
  padding: 2px 20px;
459
- cursor: default;
460
460
  box-sizing: border-box;
461
461
  }
462
462
 
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  listData: Array,
19
19
  apiParam: Object,
20
20
  parameterAction: String,
21
- formListactionRouter:{
21
+ formListactionRouter: {
22
22
  type: Array,
23
23
  default: [],
24
24
  },
@@ -218,8 +218,13 @@ function xmlToJson(xml) {
218
218
  }
219
219
  else if (props.vmodel.delete && attribute.nodeValue == 'delete') {
220
220
  obj["rightRouter"] = true
221
+ }
222
+ else if (props.vmodel.delete && attribute.nodeValue == 'moveup') {
223
+ obj["rightRouter"] = true
224
+ }
225
+ else if (props.vmodel.delete && attribute.nodeValue == 'movedown') {
226
+ obj["rightRouter"] = true
221
227
  } else {
222
-
223
228
  var actionRouter = props.formListactionRouter;
224
229
  if (actionRouter) {
225
230
  let field = actionRouter.find((b) => {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="model.className" :style="model.styleObject">
2
+ <div :class="model.className" :style="model.styleObject" v-if="field">
3
3
  <component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field" :actionRouter="actionRouter"
4
4
  :parameterAction="parameterAction" v-bind="field.bindPara" @change="changeHandler(field)" />
5
5
 
@@ -10,9 +10,9 @@
10
10
  <div ref="refTableParent" class="ct-tableParentAPP" :style="'height:' + model.tableHeight + 'px'"
11
11
  @scroll="scrollHandle($event)">
12
12
  <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
13
- <van-list v-if="!tableError" v-model:loading="tableLoading" :error-text="common.LocalizedString('没有查到数据,点我刷新','沒有查到數據,點我刷新')"
14
- :finished="finished" @load="onLoad" :immediate-check="false"
15
- :style="'min-height:' + model.tableHeight + 'px'">
13
+ <van-list v-if="!tableError" v-model:loading="tableLoading"
14
+ :error-text="common.LocalizedString('没有查到数据,点我刷新', '沒有查到數據,點我刷新')" :finished="finished"
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
18
  <div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex">
@@ -43,7 +43,7 @@
43
43
  </van-checkbox-group>
44
44
  </template>
45
45
  </van-list>
46
- <van-empty v-else :description="common.LocalizedString('没有查到数据','沒有查到數據')" />
46
+ <van-empty v-else :description="common.LocalizedString('没有查到数据', '沒有查到數據')" />
47
47
  </van-pull-refresh>
48
48
  <div v-if="isoperate || flagPopupSearchlist" style="height: 50px;"></div>
49
49
  <div class="safe-area-inset-bottom" style="background-color: #fafafa;"></div>
@@ -59,7 +59,8 @@
59
59
  </div>
60
60
  <div class="ct-checkboxtips" v-if="isoperate || flagPopupSearchlist">
61
61
  <van-checkbox v-if="!singleSelectio" v-model="model.selectAll" shape="square" checked-color="#EE6B6B"
62
- icon-size="14px" :indeterminate="model.isIndeterminate" @click="selectAll()">{{common.LocalizedString('本页全选(已选','本頁全選(已選')}}{{ selectCount }})
62
+ icon-size="14px" :indeterminate="model.isIndeterminate"
63
+ @click="selectAll()">{{ common.LocalizedString('本页全选(已选', '本頁全選(已選') }}{{ selectCount }})
63
64
  </van-checkbox>
64
65
  <div style="display: flex;flex: 1; justify-content: right;">
65
66
  <template v-if="!flagPopupSearchlist">
@@ -71,7 +72,7 @@
71
72
  </template>
72
73
  <template v-else>
73
74
  <van-button color="#EE6B6B" size="small" @click="confirmClickHandler()"
74
- style=" width: 25%;margin-left: 10px;">{{common.LocalizedString('确认','確認')}}</van-button>
75
+ style=" width: 25%;margin-left: 10px;">{{ common.LocalizedString('确认', '確認') }}</van-button>
75
76
  </template>
76
77
  </div>
77
78
  </div>
@@ -386,6 +387,16 @@ function modeClickHandler() {
386
387
  }
387
388
  //选择行
388
389
  function selectRow(row) {
390
+ if (props.singleSelectio) {
391
+ model.value.listData.forEach((ro) => {
392
+ if (
393
+ !model.value.rightCheckBoxColumn ||
394
+ common.getDataOfUpperLower(ro, model.value.rightCheckBoxColumn) == 1
395
+ ) {
396
+ ro.$select = false
397
+ }
398
+ });
399
+ }
389
400
  row.$select = !row.$select
390
401
  SearchTable.setSelectAll(model.value);
391
402
  SearchTable.getSelectAll(model.value);
@@ -425,7 +436,7 @@ function nextbnt() {
425
436
  }
426
437
  function onActionSheet(ev) {
427
438
  show.value = false;
428
- var field = modeButtons.value.find((v) => {
439
+ var field = model.value.buttons.find((v) => {
429
440
  return v.key == ev.key;
430
441
  });
431
442
  toolbarClickHandler(field)
@@ -64,6 +64,7 @@ import { ElMessage } from 'element-plus'
64
64
  const emit = defineEmits(['input', 'fieldClick', 'importComplete'])
65
65
  const props = defineProps({
66
66
  parameterAction: String,
67
+ fileData: Object,
67
68
  vmodel: Object,
68
69
  source: Object,
69
70
  flagAppMode: Boolean,
@@ -94,10 +95,9 @@ const headers = computed(() => {
94
95
  function clickHandle() {
95
96
  emit('fieldClick', model.value);
96
97
  }
98
+
97
99
  function handleAvatarSuccess(res) {
98
- request.postThenHandler({ data: res }).then(function () {
99
- emit('importComplete', res, model.value);
100
- });
100
+ emit('importComplete', res, model.value);
101
101
  }
102
102
  function handleAvatarError(info) {
103
103
  ElMessage({
@@ -9,6 +9,21 @@
9
9
 
10
10
  <!--可根据场景判断显示el-card还是el-main-->
11
11
  <component :is="model.showTitle ? 'el-main' : 'el-card'">
12
+ <!--relationParentFormFields-->
13
+ <el-row v-if="relationParentFormFields.length > 0">
14
+ <template v-for="(col, index) in relationParentFormFields" :key="index">
15
+ <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
16
+ <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
17
+ <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
18
+ :parameterAction="model.parameterAction" v-bind="col.bindPara" @change="changeHandler"
19
+ @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
20
+ @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
21
+ @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
22
+ </component>
23
+ </el-col>
24
+ </template>
25
+ </el-row>
26
+
12
27
  <!--头部元素-->
13
28
  <el-row v-if="model.collapseFields.length > 0">
14
29
  <template v-for="(col, index) in model.collapseFields[0]" :key="index">
@@ -17,7 +32,7 @@
17
32
  <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
18
33
  :parameterAction="model.parameterAction" v-bind="col.bindPara" @change="changeHandler"
19
34
  @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
20
- @tableButtonClick="clickHandler"
35
+ @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
21
36
  @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
22
37
  </component>
23
38
  </el-col>
@@ -26,7 +41,7 @@
26
41
  <!--tabs-->
27
42
  <el-tabs v-if="model.isHorizontalLayout" v-model="activeName">
28
43
  <template v-for="(item, index) in model.collapse" :key="index">
29
- <el-tab-pane :label="item.controlLabel" :name="index.toString()" v-if="item.show !== false"
44
+ <el-tab-pane :label="item.controlLabel" :name="index.toString()" :lazy="item.lazyLoad" v-if="item.show !== false"
30
45
  :key="index">
31
46
  <el-row>
32
47
  <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
@@ -36,7 +51,8 @@
36
51
  <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
37
52
  :parameterAction="model.parameterAction" v-bind="col.bindPara"
38
53
  @change="changeHandler" @fieldClick="fieldClickHandler"
39
- @popupSearchList="popupSearchListHandler" @tableButtonClick="clickHandler"
54
+ @popupSearchList="popupSearchListHandler"
55
+ @popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
40
56
  @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
41
57
  </component>
42
58
  </el-col>
@@ -66,7 +82,8 @@
66
82
  <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
67
83
  :parameterAction="model.parameterAction" v-bind="col.bindPara"
68
84
  @change="changeHandler" @fieldClick="fieldClickHandler"
69
- @popupSearchList="popupSearchListHandler" @tableButtonClick="clickHandler"
85
+ @popupSearchList="popupSearchListHandler"
86
+ @popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
70
87
  @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
71
88
  </component>
72
89
  </el-col>
@@ -83,7 +100,7 @@
83
100
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="model.parameterAction"
84
101
  v-bind="col.bindPara" @change="changeHandler" :key="itemKey"
85
102
  @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
86
- @tableButtonClick="clickHandler"
103
+ @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
87
104
  @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
88
105
  </component>
89
106
  </el-col>
@@ -162,7 +179,18 @@ const props = defineProps({
162
179
  String,
163
180
  default: '',
164
181
  },
182
+ isIframe: {
183
+ Boolean,
184
+ default: false,
185
+ },
186
+ relationParentFormFields: {
187
+ Array,
188
+ default: function () {
189
+ return [];
190
+ },
191
+ },
165
192
  })
193
+
166
194
  const itemKey = ref(1)
167
195
  const router = useRouter()
168
196
  const loading = ref(true)
@@ -205,6 +233,7 @@ function load(data) {
205
233
  model.value.parentModelForm = props.parentModelForm
206
234
  model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey };
207
235
  model.value.$vue.openType = props.openType
236
+ model.value.isIframe = props.isIframe
208
237
  if (model.value.scripts) {
209
238
  model.value.scripts.formData = model.value.formData;
210
239
  model.value.scripts.formData.form = model.value;
@@ -291,8 +320,8 @@ function validExcute() {
291
320
  setTimeout(function () {
292
321
  if (f.model.controlType == Enum.ControlType.List) {
293
322
  if (f.$el.offsetParent) {
294
- let total = f.$el.offsetParent.offsetTop;
295
- document.querySelector(".ct-dialog_body").children[0].scrollTop = total-50;
323
+ let total = f.$el.offsetParent.offsetTop;
324
+ document.querySelector(".ct-dialog_body").children[0].scrollTop = total - 50;
296
325
  }
297
326
  }
298
327
  else {
@@ -357,6 +386,10 @@ function changeCallBackHandler(field, callBackFunName, callBackPara) {
357
386
  function popupSearchListHandler(singleSelectio, field, router, callBack) {
358
387
  Form.popupSearchListHandler(singleSelectio, field, router, model.value, Fields.value, props, callBack)
359
388
  }
389
+ //弹出分组列表
390
+ function popupGroupListHandler(field, router, callBack) {
391
+ Form.popupGroupListHandler(field, router, model.value, Fields.value, props, callBack)
392
+ }
360
393
  function flagNotificationParentAfterContentChanged() {
361
394
  init();
362
395
  }
@@ -135,7 +135,7 @@
135
135
  </template>
136
136
  </el-table-column>
137
137
  <template #empty>
138
- {{common.LocalizedString('暂无数据','暫無數據')}}
138
+ {{ common.LocalizedString('暂无数据', '暫無數據') }}
139
139
  </template>
140
140
  </el-table>
141
141
  </template>
@@ -177,9 +177,9 @@ model.value.parentModel = props.parentModel;
177
177
  model.value.parameterAction = props.parameterAction
178
178
  model.value.$vue = { insertOrUpdateRow, insertRow, delRow, deleteAll, insertSingleRow, itemKey };
179
179
  model.value.validExcute = () => {
180
- var rtn=fieldsValidExcute();
181
- if(!rtn){
182
- model.value.displayValidMessage=common.LocalizedString('请填写','請填寫')+'['+model.value.controlLabel+']'
180
+ var rtn = fieldsValidExcute();
181
+ if (!rtn) {
182
+ model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + model.value.controlLabel + ']'
183
183
  }
184
184
  return fieldsValidExcute();
185
185
  }
@@ -379,8 +379,8 @@ function getSummaries(param) {
379
379
  //验证
380
380
  function fieldsValidExcute() {
381
381
  var rtnBool = true;
382
- if(model.value.required){
383
- if(model.value.tableData.length==0){
382
+ if (model.value.required) {
383
+ if (model.value.tableData.length == 0) {
384
384
  return false;
385
385
  }
386
386
  }
@@ -400,7 +400,7 @@ function fieldsValidExcute() {
400
400
  }
401
401
 
402
402
  }
403
- else if(Fields.value) {
403
+ else if (Fields.value) {
404
404
  Fields.value.forEach((f) => {
405
405
  if (f.model.validExcute) {
406
406
  if (!f.model.validExcute()) {
@@ -473,6 +473,26 @@ function rolRouterCellClickHandler(routerKey, rowindex, sourceIndex) {
473
473
  emit('change', model.value);
474
474
  });
475
475
  }
476
+ else if (routerKey == 'moveup') {
477
+ if (rowindex === 0) {
478
+ model.value.tableData.push(model.value.tableData.shift());
479
+ } else {
480
+ const temp = model.value.tableData[rowindex - 1];
481
+ model.value.tableData[rowindex - 1] = model.value.tableData[rowindex];
482
+ model.value.tableData[rowindex] = temp;
483
+ }
484
+ onMoveEnd()
485
+ }
486
+ else if (routerKey == 'movedown') {
487
+ if (rowindex === model.value.tableData.length - 1) {
488
+ model.value.tableData.unshift(model.value.tableData.pop());
489
+ } else {
490
+ const temp = model.value.tableData[rowindex + 1];
491
+ model.value.tableData[rowindex + 1] = model.value.tableData[rowindex];
492
+ model.value.tableData[rowindex] = temp;
493
+ }
494
+ onMoveEnd()
495
+ }
476
496
  else {
477
497
  var router = model.value.buttons.find((v) => {
478
498
  return v.key === routerKey;
@@ -512,7 +532,7 @@ function onMoveEnd(event) {
512
532
 
513
533
  }
514
534
  defineExpose({
515
- model
535
+ model
516
536
  })
517
537
  </script>
518
538
  <style scoped>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <ct-field :vmodel="model">
3
+ <template #Control>
4
+
5
+ </template>
6
+ <template #Sufbutton v-if="model.moreActionRouter">
7
+ <div style="margin-left: 5px;">
8
+ <el-button size="small" type="primary" class="h26" @click="popupSearchListHandle">
9
+ {{ model.moreActionRouter.controlLabel }}</el-button>
10
+ </div>
11
+ </template>
12
+ </ct-field>
13
+ </template>
14
+ <script lang="ts" setup>
15
+ import { initData } from '../../utils/mixins';
16
+ import GroupList from '../../loader/src/GroupList';
17
+ const emit = defineEmits(['input', 'change', 'click','search','popupGroupList'])
18
+ const props = defineProps({
19
+ parameterAction: String,
20
+ vmodel: Object,
21
+ source: Object,
22
+ from: {
23
+ type: String,
24
+ default: ''
25
+ },
26
+ })
27
+ const model = initData(props, GroupList)
28
+
29
+ //弹出选择列表
30
+ function popupSearchListHandle() {
31
+ emit('popupGroupList',model, model.value.moreActionRouter);
32
+ }
33
+ defineExpose({
34
+ model
35
+ })
36
+ </script>
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <div class="ct-field">
3
+ <div class="el-form-item el-form-item--small">
4
+ <div class="el-form-item__label" v-if="model.showLabel && model.controlLabel">
5
+ <div class="requiredLabel">
6
+ <span>{{ model.controlLabel }}</span>
7
+ </div>
8
+ </div>
9
+ <div class="fieldControl">
10
+ <el-input-number v-model="model.maxValue1" :min="1" :max="26" @change="handleChange" />
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <template v-for="(item, index) in model.value" :key="index">
15
+ <div class="ct-field" style="margin-top: 10px;" v-if="!item.flagDeleted">
16
+ <div class="el-form-item el-form-item--small">
17
+ <div class="el-form-item__label">
18
+ <div class="requiredLabel">
19
+ <span
20
+ style="background-color: #EE6B6B;width: 20px; height: 24px;display: block;line-height: 24px; text-align: center; border-radius: 5px;color: #ffffff;">{{
21
+ item.code }}</span>
22
+ </div>
23
+ </div>
24
+ <div class="fieldControl">
25
+ <el-input v-model="item.name" placeholder="" @input="changeOption()" />
26
+ </div>
27
+ <span class="sufLabel" style="background-color: #EE6B6B;border-radius: 50px;width: 20px;height: 20PX;text-align: center;color: #ffffff;cursor: pointer;" @click="handleDelete(item)"><el-icon><Minus /></el-icon></span>
28
+ </div>
29
+ </div>
30
+ </template>
31
+ </template>
32
+ <script lang="ts" setup>
33
+ import { initData } from '../../utils/mixins';
34
+ import NumberWithPlusAndMinus from '../../loader/src/NumberWithPlusAndMinus';
35
+ const emit = defineEmits(['click', 'change', 'search'])
36
+ const props = defineProps({
37
+ parameterAction: String,
38
+ vmodel: Object,
39
+ source: Object,
40
+ })
41
+ const model = initData(props, NumberWithPlusAndMinus)
42
+ function handleChange() {
43
+ var count = model.value.maxValue1;
44
+ var rows = model.value.value;
45
+ const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
46
+ var newRows = [];
47
+ for (let i = 0; i < count; i++) {
48
+ var item = {};
49
+ item['code'] = str[i];
50
+
51
+ var name = '';
52
+ var rowID = '';
53
+ if (i < rows.length) {
54
+ rowID = rows[i]['rowID'];
55
+ name = rows[i]['name'];
56
+ }
57
+
58
+ item['rowID'] = rowID;
59
+ item['name'] = name;
60
+ item['flagDeleted'] = false
61
+ newRows.push(item)
62
+ }
63
+ if(rows.length>count){
64
+ for (let i = rows.length; i > count; i--){
65
+ rows[i-1]['flagDeleted']=true
66
+ newRows.push(rows[i-1])
67
+ }
68
+ }
69
+ model.value.value = newRows;
70
+ model.value.code1 = newRows;
71
+ }
72
+ function changeOption() {
73
+ var data = model.value.value.filter((v) => {
74
+ return v.name != '';
75
+ });
76
+ model.value.code1 = data;
77
+ }
78
+ function handleDelete(ev){
79
+ ev['flagDeleted']=true
80
+ model.value.maxValue1--;
81
+ var count = model.value.maxValue1;
82
+ var rows = model.value.value.filter((v) => {
83
+ return !v.flagDeleted;
84
+ });
85
+ const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
86
+ var newRows = [];
87
+ for (let i = 0; i < count; i++) {
88
+ var item = {};
89
+ item['code'] = str[i];
90
+
91
+ var name = '';
92
+ var rowID = '';
93
+ if (i < rows.length) {
94
+ rowID = rows[i]['rowID'];
95
+ name = rows[i]['name'];
96
+ }
97
+
98
+ item['rowID'] = rowID;
99
+ item['name'] = name;
100
+ item['flagDeleted'] = false
101
+ newRows.push(item)
102
+ }
103
+ newRows.push(ev)
104
+ model.value.value = newRows;
105
+ model.value.code1 = newRows;
106
+ }
107
+ defineExpose({
108
+ model
109
+ })
110
+ </script>
@@ -0,0 +1,6 @@
1
+ <template>
2
+
3
+ </template>
4
+ <script setup lang="ts">
5
+
6
+ </script>