centaline-data-driven-v3 0.0.72 → 0.0.73

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.72",
3
+ "version": "0.0.73",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -69,6 +69,7 @@ const props = defineProps({
69
69
  vmodel: Object,
70
70
  source: Object,
71
71
  flagAppMode: Boolean,
72
+ parentModel: Object,
72
73
  })
73
74
  const model = initData(props, Button)
74
75
  if (model.value.controlType == Enum.ControlType.ButtonAdvancedSearch) {
@@ -95,24 +96,35 @@ const headers = computed(() => {
95
96
  return common.getDataDrivenOpts().handler.getRequestHeaders();
96
97
  })
97
98
  function clickHandle() {
98
- emit('fieldClick', model.value);
99
+ emit('fieldClick', model.value);
99
100
  }
100
101
 
101
102
  function handleAvatarBeforeUpload(file) {
102
- if (model.value.form && model.value.form.$vue) {
103
- let submitData = model.value.form.$vue.getFileData(model.value);
104
- for (var key in submitData) {
105
- if (typeof submitData[key] === "object") {
106
- uploadData.value[key] = JSON.stringify(submitData[key]);
107
- }
108
- else {
109
- uploadData.value[key] = submitData[key];
110
- }
111
- }
103
+ if (model.value.form && model.value.form.$vue) {
104
+ let submitData = model.value.form.$vue.getFileData(model.value);
105
+ for (var key in submitData) {
106
+ if (typeof submitData[key] === "object") {
107
+ uploadData.value[key] = JSON.stringify(submitData[key]);
108
+ }
109
+ else {
110
+ uploadData.value[key] = submitData[key];
111
+ }
112
+ }
113
+ }
114
+ if(props.parentModel && props.parentModel.is && props.parentModel.is=="ct-formlist" && props.parentModel.form && props.parentModel.form.$vue){
115
+ let submitData = props.parentModel.form.$vue.getFileData(model.value);
116
+ for (var key in submitData) {
117
+ if (typeof submitData[key] === "object") {
118
+ uploadData.value[key] = JSON.stringify(submitData[key]);
119
+ }
120
+ else {
121
+ uploadData.value[key] = submitData[key];
122
+ }
112
123
  }
124
+ }
113
125
  }
114
126
  function handleAvatarSuccess(res) {
115
- emit('importComplete', res, model.value);
127
+ emit('importComplete', res, model.value);
116
128
  }
117
129
  function handleAvatarError(info) {
118
130
  ElMessage({
@@ -129,8 +141,8 @@ function dropClick() {
129
141
  }
130
142
  }
131
143
  function commandClick(code) {
132
- model.value.selectOptionCode = code;
133
- emit('fieldClick', model.value);
144
+ model.value.selectOptionCode = code;
145
+ emit('fieldClick', model.value);
134
146
  }
135
147
  </script>
136
148
  <style scoped>
@@ -413,6 +413,14 @@ function importComplete(res, field) {
413
413
  .catch(() => {
414
414
  });
415
415
  }
416
+ else if(res && res.rtnCode && res.rtnCode === 200 && res.rtnMsg){
417
+ ElMessage({
418
+ message: res.rtnMsg,
419
+ type: 'success',
420
+ showClose: true,
421
+ });
422
+ }
423
+
416
424
  if (field.flagAsync) {
417
425
  if (res.rtnCode && res.rtnCode === 202 && res.rtnMsg) {
418
426
  common.confirm(res.rtnMsg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
@@ -448,8 +456,13 @@ function importComplete(res, field) {
448
456
  type: 'success',
449
457
  showClose: true,
450
458
  });
459
+ }
460
+ if (field && field.callBackFunName) {
461
+ changeCallBackHandler(field, field.callBackFunName, data.content);
462
+ }
463
+ else {
464
+ Form.doAction(data);
451
465
  }
452
- getPage(1, false);
453
466
  },
454
467
  onError(data) {
455
468
  common.closeDialog(dialogOption);
@@ -501,7 +514,12 @@ function importComplete(res, field) {
501
514
  showClose: true,
502
515
  });
503
516
  }
504
- getPage(1, false);
517
+ if (field && field.callBackFunName) {
518
+ changeCallBackHandler(field, field.callBackFunName, data.content);
519
+ }
520
+ else {
521
+ Form.doAction(data);
522
+ }
505
523
  },
506
524
  onError(data) {
507
525
  common.closeDialog(dialogOption);
@@ -523,7 +541,7 @@ function importComplete(res, field) {
523
541
  changeCallBackHandler(field, field.callBackFunName, res.content);
524
542
  }
525
543
  else {
526
- model.doAction(res)
544
+ Form.doAction(res)
527
545
  }
528
546
  }
529
547
  }
@@ -72,18 +72,27 @@
72
72
  <h5>{{ model.controlLabel }}</h5>
73
73
  </div>
74
74
  <div class="list-button">
75
- <component v-if="model.selectRouter !== null" :is="model.selectRouter.is"
76
- :vmodel="model.selectRouter" @click="popupSearchListHandle(model.selectRouter)"></component>
77
- <el-button v-if="model.create" :disabled="model.disabled" class="btn-add" type="success"
78
- style="width: auto;" size="small" :icon="CirclePlus" @click="addRow">
79
- {{ model.createText }}
80
- </el-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>
81
90
  </div>
82
91
  <el-table :data="model.tableData" border :show-summary="model.showSummary"
83
92
  :summary-method="getSummaries" style="width: 100%" highlight-current-row>
84
93
  <template v-if="model.rowActionRoutersAlign === 1">
85
94
  <el-table-column label="操作"
86
- v-if="model.rows[0].edit || model.rows[0].delete || model.buttons.length > 0"
95
+ v-if="model.rows[0].edit || model.rows[0].delete || (model.buttons.length > 0 && model.buttonsShow.length > 0)"
87
96
  :width="'100%'">
88
97
  <template #header="{ column, $index }">
89
98
  {{ setcolumnminWidth(column) }}
@@ -104,13 +113,9 @@
104
113
  @click="saveRow(scope.row, scope.$index, false)"
105
114
  style="cursor: pointer;">取消</el-tag>
106
115
  <template v-for="(v, i) in model.buttons">
107
- <el-tag
108
- v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
109
- style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label }}
110
- 1</el-tag>
111
-
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>
112
118
  </template>
113
-
114
119
  </template>
115
120
  </el-table-column>
116
121
  </template>
@@ -146,7 +151,7 @@
146
151
  </template>
147
152
  <template v-if="model.rowActionRoutersAlign !== 1">
148
153
  <el-table-column label="操作"
149
- v-if="model.rows[0].edit || model.rows[0].delete || model.buttons.length > 0"
154
+ v-if="model.rows[0].edit || model.rows[0].delete || (model.buttons.length > 0 && model.buttonsShow.length > 0)"
150
155
  :width="'100%'">
151
156
  <template #header="{ column, $index }">
152
157
  {{ setcolumnminWidth(column) }}
@@ -167,13 +172,9 @@
167
172
  @click="saveRow(scope.row, scope.$index, false)"
168
173
  style="cursor: pointer;">取消</el-tag>
169
174
  <template v-for="(v, i) in model.buttons">
170
- <el-tag
171
- v-if="!scope.row.isSet && v.show && (!v.rightField || !scope.row[v.rightField] || scope.row[v.rightField].value == 1)"
172
- style="cursor: pointer;" @click="buttonClick(scope.row, v)">{{ v.label }}
173
- 1</el-tag>
174
-
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>
175
177
  </template>
176
-
177
178
  </template>
178
179
  </el-table-column>
179
180
  </template>
@@ -494,7 +495,7 @@ function setcolumnminWidth(column) {
494
495
  function buttonClick(row, button) {
495
496
  var submitData = {};
496
497
  button.submitFormField.forEach((v) => {
497
- submitData[v] = row[v].code1;
498
+ submitData[v] = common.getDataOfUpperLower(row,v).code1;
498
499
  });
499
500
  model.value.currentRowIndex = model.value.source.rows.findIndex(v => v.$sourceIndex === row.$sourceIndex);
500
501
 
@@ -503,6 +504,15 @@ function buttonClick(row, button) {
503
504
  function rolRouterClickHandler(field, rowData,rowindex) {
504
505
  buttonClick(rowData, field);
505
506
  }
507
+ function toolButtonsClick(field) {
508
+ emit('tableButtonClick', field, null);
509
+ }
510
+ function toolButtonsChangeHandler(field) {
511
+ emit('change', field);
512
+ }
513
+ function importComplete(res, button) {
514
+ emit('importComplete', res, button);
515
+ }
506
516
  function insertOrUpdateRow(row) {
507
517
  FormList.insertOrUpdateRow(row, true, model.value);
508
518
  }
@@ -613,7 +623,10 @@ defineExpose({
613
623
  padding: 10px;
614
624
  width: 100%;
615
625
  }
616
-
626
+ .list-button ul li {
627
+ margin-right: 5px;
628
+ float: left;
629
+ }
617
630
 
618
631
  .ct-form-repeat .list-title {
619
632
  padding-bottom: 5px;
@@ -238,7 +238,7 @@ import TableToolbar from './TableToolbar.vue';
238
238
  import Tabletip from './Tabletip.vue';
239
239
  import Tablecurrency from './Tablecurrency.vue';
240
240
  import SearchTable from '../../../loader/src/SearchTable'
241
- import { RouterClickHandler, RouterMouseenterHandler } from '../../../utils/mixins';
241
+ import { RouterClickHandler } from '../../../utils/mixins';
242
242
  import { ElMessage } from 'element-plus'
243
243
  const emit = defineEmits(['rowClickHandle', 'searchComplate', 'refreshRowHandle', 'simpleRouterRefreshHandler', 'loaded', 'scrollHandle', 'closeSideBar', 'refreshParent', 'popupClickHandler', 'drag'])
244
244
  const props = defineProps({
@@ -685,7 +685,7 @@ function rowLayoutClickHandle(index) {
685
685
  }
686
686
 
687
687
  //表单列表操作
688
- function rolRouterClickHandler(field, rowData, rowindex, visible, columnName) {
688
+ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName,callBack,flagMouseenter) {
689
689
  field.rowindex = rowindex;
690
690
  if (refRowsPopover.value[rowindex]) {
691
691
  refRowsPopover.value[rowindex].hide();
@@ -717,42 +717,11 @@ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName) {
717
717
  action = rowData[field.actionField];
718
718
  }
719
719
 
720
- RouterClickHandler(field, submitData, action, model.value, 'table')
720
+ RouterClickHandler(field, submitData, action, model.value, 'table',callBack,flagMouseenter)
721
721
  }
722
722
  //表单列表操作
723
- function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName, callBack) {
724
- field.rowindex = rowindex;
725
- if (refRowsPopover.value[rowindex]) {
726
- refRowsPopover.value[rowindex].hide();
727
- }
728
- if (field.isListenVoice) {
729
- if (model.value.currentListenVoice) {
730
- refRowsRouter.value[model.value.currentListenVoice].closeListenVoice()
731
- }
732
- model.value.currentListenVoice = visible ? 'router' + field.id + rowindex : '';
733
- }
734
-
735
- var submitData = {};
736
- field.submitListField.forEach((k) => {
737
- submitData[k] = rowData[k];
738
- });
739
-
740
- if (field.flagAttachSearchCondition) {
741
- submitData["searchFields"] = model.value.getSearchData();
742
- }
743
- if (field.isCallTel) {
744
- submitData.flagHaveAlert = visible || false;
745
- }
746
- if (columnName) {
747
- submitData.columnName = columnName;
748
- }
749
-
750
- let action = field.action;
751
- if (field.actionField) {
752
- action = rowData[field.actionField];
753
- }
754
-
755
- RouterMouseenterHandler(field, submitData, action, model.value, 'table', callBack)
723
+ function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName, callBack,flagMouseenter) {
724
+ rolRouterClickHandler(field,rowData,rowindex,visible,columnName,callBack,true)
756
725
  }
757
726
  function popupClickHandler() {
758
727
  var tempListData = model.value.getSelectRowData({ isMulti: model.value.isMulti });
@@ -5,7 +5,7 @@
5
5
  <el-popover @before-enter="onShow" :width="tooltipModel.width"
6
6
  :fallback-placements="['bottom', 'top', 'right', 'left']">
7
7
  <template #default>
8
- <div :style="'height: '+(tooltipModel.height+50)+'px;'">
8
+ <div :style="'height: ' + tooltipModel.height + ''">
9
9
  <component v-bind="tooltipModel.attrs" :is="tooltipModel.component"></component>
10
10
  </div>
11
11
  </template>
@@ -107,7 +107,7 @@ const option = ref({
107
107
  const tooltipModel = ref({});
108
108
  const labelColor = ref('')
109
109
  const video = ref()
110
- const label = computed(() => {
110
+ const label = computed(() => {
111
111
  return (typeof props.colValue === "undefined" || props.colValue === '') ? props.router.controlLabel : props.colValue
112
112
  })
113
113
  const isShowLabel = computed(() => {
@@ -173,6 +173,9 @@ function voiceEndedHandler() {
173
173
  }
174
174
  function onShow() {
175
175
  emit('mouseenter', props.router, props.rowData, props.rowindex, null, props.columnName, function (data) {
176
+ if (data.height) {
177
+ data.height = (parseInt(data.height.replace('px', ''))+50)+'px';
178
+ }
176
179
  tooltipModel.value = data
177
180
  });
178
181
  }
@@ -120,6 +120,12 @@ function FormListModel(source, master,actionRouters) {
120
120
  get totalCols() {
121
121
  return source.totalCols;
122
122
  },
123
+ get tableDisabled() {
124
+ return source.disabled || master.locked || false;
125
+ },
126
+ set tableDisabled(v) {
127
+ source.disabled = v;
128
+ },
123
129
  //表单表格 选择数据来源的路由
124
130
  get selectRouter() {
125
131
  if (source.selectRouter) {
@@ -128,7 +134,7 @@ function FormListModel(source, master,actionRouters) {
128
134
  return button;
129
135
  }
130
136
  return null;
131
- },
137
+ },
132
138
  //表格编辑模式
133
139
  get editMode() {
134
140
  return source.editMode;
@@ -168,6 +174,57 @@ function FormListModel(source, master,actionRouters) {
168
174
  return rtn._buttons;
169
175
  }
170
176
  },
177
+ _buttonsShow: null,
178
+ get buttonsShow() {
179
+ if (rtn._buttonsShow !== null) {
180
+ return rtn._buttonsShow;
181
+ }
182
+ else {
183
+ rtn._buttonsShow = [];
184
+ if (rtn.buttons) {
185
+ rtn.buttons.forEach((v) => {
186
+ if(v.show){
187
+ rtn._buttonsShow.push(v);
188
+ }
189
+ });
190
+ }
191
+ return rtn._buttonsShow;
192
+ }
193
+ },
194
+ _toolButtons: null,
195
+ get toolButtons() {
196
+ if (rtn._toolButtons !== null) {
197
+ return rtn._toolButtons;
198
+ }
199
+ else {
200
+ rtn._toolButtons = [];
201
+ if (source.toolButtons) {
202
+ source.toolButtons.forEach((v) => {
203
+ var button = Router(v);
204
+ button.is = "ct-button";
205
+ rtn._toolButtons.push(button);
206
+ });
207
+ }
208
+ return rtn._toolButtons;
209
+ }
210
+ },
211
+ _toolButtonsShow: null,
212
+ get toolButtonsShow() {
213
+ if (rtn._toolButtonsShow !== null) {
214
+ return rtn._toolButtonsShow;
215
+ }
216
+ else {
217
+ rtn._toolButtonsShow = [];
218
+ if (rtn.toolButtons) {
219
+ rtn.toolButtons.forEach((v) => {
220
+ if(v.show){
221
+ rtn._toolButtonsShow.push(v);
222
+ }
223
+ });
224
+ }
225
+ return rtn._toolButtonsShow;
226
+ }
227
+ },
171
228
  _rows: null,
172
229
  get rows() {
173
230
  if (this._rows) {
package/src/main.js CHANGED
@@ -21,11 +21,11 @@ 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/",
24
+ baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
25
25
  //baseUrl: "http://10.88.22.66:6060/xian/",
26
26
  //baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
27
- baseUrl: "http://10.88.22.66:6060/onecard-api/",
28
-
27
+ //baseUrl: "http://10.1.245.111:38028/",
28
+
29
29
  flagRouterSelf: true,
30
30
  flagApp: false,//是否app端
31
31
  zindex: 999,
@@ -64,8 +64,8 @@ app.use(centaline, {
64
64
  return {
65
65
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
66
66
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
67
- authObject: '{token:"1647-1902992017571581952",platform:"WEB"}',
68
- //authObject: '{EmpID:"Token_2e493771-28ae-485d-afea-0e6dcef23f64",MachineCode:"e1f39b75-7069-4c4f-b5d5-c590da2d9aa2",SSO_Token:"SSOToken_2e493771-28ae-485d-afea-0e6dcef23f64",Platform:"WEB"}',
67
+ //authObject: '{token:"1-a7289bb2-9f1e-4a04-9016-1e555bf39188"}',
68
+ authObject: '{EmpID:"Token_8ce6c140-f584-45ed-b683-ca52837993aa",MachineCode:"e1f39b75-7069-4c4f-b5d5-c590da2d9aa2",SSO_Token:"SSOToken_8ce6c140-f584-45ed-b683-ca52837993aa",Platform:"WEB"}',
69
69
  };
70
70
  },
71
71
  // 请求完成事件,可判断是否登录过期执行响应操作