centaline-data-driven 1.3.43 → 1.3.44

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",
3
- "version": "1.3.43",
3
+ "version": "1.3.44",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -63,7 +63,7 @@
63
63
  @tableButtonClick="clickHandler"></component>
64
64
  </el-col>
65
65
  </el-row>
66
- <el-row v-if="model.links.length > -1" style="margin-top: 8px;">
66
+ <el-row v-if="model.links.findIndex((v)=>{return v.show}).length > -1" style="margin-top: 8px;">
67
67
  <el-col :span="24" style="text-align:left">
68
68
  <component v-for="(btn, index) in model.links" :key="index" :is="btn.is" :vmodel="btn" @click="clickHandler" v-if="btn.show"></component>
69
69
  </el-col>
@@ -22,9 +22,27 @@
22
22
  <span class="el-select__tags-text">{{item}}</span>
23
23
  </span>
24
24
  </span>
25
- <label v-else class="ct-lable isWidth">
26
- <span class="isEllipsis"> {{ model.labelValue }}</span>
27
- </label>
25
+ <div v-else style="display:inline-block">
26
+ <!-- --计算占用宽度-- -->
27
+ <div style="position: relative" v-if="isShowComput">
28
+ <label class="ct-lable" style="position: absolute; left: -10000px">
29
+ <span :ref="'computLabel' + model.index"> {{ model.labelValue }}</span>
30
+ </label>
31
+ </div>
32
+ <!-- 展示 -->
33
+ <label class="ct-lable" :style="{ display: (model.labelValue ? 'inline-flex' : '') }">
34
+ <el-tooltip placement="top" effect="light" :disabled="isShowTooltip">
35
+ <div slot="content" :style="{ 'width': (model.labelValue.length > 66 ? '400px' : 'auto') }">{{
36
+ model.labelValue
37
+ }}</div>
38
+ <div class="isEllipsis" :style="{ display: (model.labelValue ? '-webkit-box' : 'none') }"
39
+ @mouseover="onMouseOver('refLabelValue' + model.index, model.index)">
40
+ <span :ref="'refLabelValue' + model.index">{{ model.labelValue
41
+ }}</span>
42
+ </div>
43
+ </el-tooltip>
44
+ </label>
45
+ </div>
28
46
  <span slot="suffix" v-if="model.unitName" class="ct-unitnameLable">{{model.unitName}}</span>
29
47
  <span v-if="model.sufLabel" style="width:auto" class="spanMessage">{{model.sufLabel}}</span>
30
48
  </div>
@@ -41,7 +59,9 @@
41
59
  },
42
60
  data() {
43
61
  return {
44
- }
62
+ isShowTooltip: true,// 是否需要禁止提示
63
+ isShowComput: false
64
+ }
45
65
  },
46
66
  created() {
47
67
  if (typeof this.vmodel === 'undefined') {
@@ -51,7 +71,23 @@
51
71
  this.model = this.vmodel;
52
72
  }
53
73
  this.model.self=this;
74
+ },
75
+ methods: {
76
+ // 移入事件: 判断内容的宽度contentWidth是否大于父级的宽度
77
+ onMouseOver(str, index) {
78
+ this.isShowComput = true
79
+ this.$nextTick(function () {
80
+ if (this.model.labelValue.length > 0) {
81
+ let sumLabelItem = 'computLabel' + index;
82
+ let contentWidth = this.$refs[sumLabelItem].offsetWidth;
83
+ let parentWidth = this.$refs[str].parentNode.offsetWidth;
84
+ // 判断是否禁用tooltip功能
85
+ this.isShowTooltip = contentWidth <= parentWidth;
86
+ this.isShowComput = false
87
+ }
88
+ });
54
89
  }
90
+ }
55
91
  }
56
92
  </script>
57
93
  <style scoped>
@@ -89,6 +89,9 @@
89
89
  this.$emit('search', this.model);
90
90
  break;
91
91
  default:
92
+ if (model.type === 15) {
93
+ this.$emit('clickHandler', model);
94
+ }
92
95
  break;
93
96
  }
94
97
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <ct-searchtreescreen ref="treescreen" :api="searchConditionApi" :screenPara="screenPara" @search="search"></ct-searchtreescreen>
3
+ <ct-searchtreescreen ref="treescreen" :api="searchConditionApi" :screenPara="screenPara" @search="search" @clickHandler="rolRouterClickHandler"></ct-searchtreescreen>
4
4
  <ct-tree ref="tree" :api="searchDataApi" @loaded="loaded"></ct-tree>
5
5
  </div>
6
6
  </template>
@@ -41,6 +41,324 @@
41
41
  } catch (e) {
42
42
  }
43
43
  },
44
+ rolRouterClickHandler(field) {
45
+ this.routerClickHandler(field, {}, "");
46
+ },
47
+ routerClickHandler(field, submitData, action) {
48
+ let self = this;
49
+ action = action || field.action;
50
+ var clickAcion = function () {
51
+ //若不是客户端方法,则直接访问接口
52
+ if (!field.isClientFuntion) {
53
+ // 外部框架tab页打开
54
+ if (field.isFormPageInTab) {
55
+ submitData = field.getActionPara(submitData).para;
56
+ if (field.pageStyle) {
57
+ submitData.pageStyle = field.pageStyle;
58
+ }
59
+ self.$emit('doClosePopoverHandle');
60
+ self.$common.getDataDrivenOpts().handler.openTab(action, submitData, field.pageTitle, self.model, field.dialogWidth);
61
+ }
62
+ else if (field.isSearchPageInTab) {// 外部框架tab页打开
63
+ submitData = field.getActionPara(submitData).para;
64
+ self.$emit('doClosePopoverHandle');
65
+ self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
66
+ }
67
+ else if (field.isBrowserNewTab) {// 浏览器打开
68
+ submitData = field.getActionPara(submitData).para;
69
+ let query = self.$common.objectToQueryStr(submitData);
70
+ window.open(action + query, "_blank");
71
+ }
72
+ else if (field.isOpenUrlInBrowse) {// 浏览器打开
73
+ window.open(submitData[field.submitFormField], "_blank");
74
+ }
75
+ else if (field.isSeeVoice) {//看视频
76
+ self.$common.browseVideo(field, submitData);
77
+ }
78
+ else if (field.isBrowseAttachment) {//浏览附件
79
+ var MediaAlbum = [
80
+ { albumName: self.model.title || "媒体", medias: [] },
81
+ ];
82
+ if (field.action) {
83
+ var callback = function (data) {
84
+ MediaAlbum[0].medias = data;
85
+ self.$common.viewerfile(field, MediaAlbum, 0, 0);
86
+ }
87
+ self.model.getAction(field.action, submitData, callback);
88
+ }
89
+ else {
90
+ submitData.mediaData.forEach((v) => {
91
+ MediaAlbum[0].medias.push(v);
92
+ });
93
+ self.$common.viewerfile(field, MediaAlbum, 0, 0);
94
+ }
95
+ }
96
+ else if (field.isUrlInLayer) {//URL页面(弹层)
97
+ var dialogOption = {
98
+ title: field.pageTitle,
99
+ pane: self.$common.getParentPane(self),
100
+ content: [
101
+ {
102
+ component: "ct-iframe",
103
+ attrs: {
104
+ src: submitData[field.submitListField],
105
+ width: field.dialogWidth + "px",
106
+ height: field.dialogHeight + "px",
107
+ },
108
+ on: {
109
+ new(id) {
110
+ field.flagAddRowAfterAction = true;
111
+ field.flagFreshCurrentRow = false;
112
+ var res = { responseData: { content: id } };
113
+ self.updateCurrentRow(field, res);
114
+ self.$forceUpdate();
115
+ self.$refs.footer.$forceUpdate();
116
+ self.$common.closeDialog(dialogOption.dialog);
117
+ },
118
+ update() {
119
+ field.flagAddRowAfterAction = false;
120
+ field.flagFreshCurrentRow = true;
121
+ self.updateCurrentRow(field, null);
122
+ self.$common.closeDialog(dialogOption.dialog);
123
+ },
124
+ delete() {
125
+ var res = {};
126
+ res.notification = 4;
127
+ res.content = self.model.listData[self.model.selectIndex][self.model.primaryKey];
128
+ self.model.doAction(res);
129
+ self.$common.closeDialog(dialogOption.dialog);
130
+ },
131
+ refreshParent() {
132
+ self.getPage(1);
133
+ self.$common.closeDialog(dialogOption.dialog);
134
+ },
135
+ closeDialog() {
136
+ self.$common.closeDialog(dialogOption.dialog);
137
+ },
138
+ },
139
+ },
140
+ ],
141
+ };
142
+ self.$common.openDialog(dialogOption);
143
+ }
144
+ else if (field.isExport || field.flagAsync) {
145
+ if (field.flagAsync) {
146
+ field.doAction(submitData, (res) => {
147
+ if (res.content && res.content.action) {
148
+ var dialogOption = {
149
+ title: field.pageTitle || field.label,
150
+ content: [{
151
+ component: 'ct-progress',
152
+ attrs: {
153
+ progressAction: res.content.action,
154
+ progressKey: res.content.key,
155
+ progressType: 'import',
156
+ width: '350px',
157
+ height: '165px'
158
+ },
159
+ on: {
160
+ finished() {
161
+ self.$common.closeDialog(dialogOption.dialog);
162
+ self.getPage(1);
163
+ },
164
+ error(data) {
165
+ self.$common.closeDialog(dialogOption.dialog);
166
+ self.$message.warning(data.rtnMsg);
167
+ }
168
+ }
169
+ }]
170
+ };
171
+ self.$common.openDialog(dialogOption);
172
+ }
173
+ });
174
+ }
175
+ else {
176
+ if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
177
+ window.open(field.action, "_blank");
178
+ }
179
+ else {
180
+ field.doAction(submitData, (data) => {
181
+ if (data.content) {
182
+ if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
183
+ window.open(data.content, "_blank");
184
+ }
185
+ else {
186
+ }
187
+ }
188
+ });
189
+ }
190
+ }
191
+ }
192
+ else {
193
+ //self.operationLoading = true;
194
+
195
+ //Form
196
+ if (field.isOpenForm) {
197
+ var dialogOption = {
198
+ title: field.pageTitle,
199
+ pane: self.$common.getParentPane(self),
200
+ content: [
201
+ {
202
+ component: field.navToNewPageName,
203
+ attrs: {
204
+ //source: data.content,
205
+ api: action,
206
+ apiParam: field.getActionPara(submitData).para,
207
+ showTitle: false,
208
+ width: field.dialogWidth + "px",
209
+ height: field.dialogHeight + "px",
210
+ },
211
+ on: {
212
+ submit(ev) {
213
+ if (ev.responseData.notification == 24) {
214
+ //更新列
215
+ self.model.selectIndex = 0;
216
+ if (self.currentRow !== null) {
217
+ for (var i = 0; i < self.currentRow.children.length; i++) {
218
+ self.currentRow.children[i].classList.remove("select");
219
+ }
220
+ }
221
+ if (typeof self.$refs.tableParent !== "undefined") {
222
+ self.$refs.tableParent.scrollTop = 0;
223
+ self.$refs.tableParent.scrollLeft = 0;
224
+ self.scrollTop = 0;
225
+ self.scrollLeft = 0;
226
+ }
227
+ self.$forceUpdate();
228
+ self.$nextTick(() => {
229
+ if (self.$refs.tableParent.scrollHeight <= self.$refs.tableParent.offsetHeight) {
230
+ self.tableLoading = true;
231
+ self.model.nextPage(next);
232
+ }
233
+ else {
234
+ self.tableLoading = false;
235
+ self.rowColorChange();
236
+ self.resetScroll();
237
+ self.calculatingRowHeight();
238
+ self.getScrollAttr();
239
+ }
240
+ self.setfixedSize();
241
+ });
242
+ self.loaderObj.SearchTable(self.api, self.load, self.model.searchModel, true);
243
+ self.$common.closeDialog(dialogOption.dialog);
244
+ }
245
+ else {
246
+ if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
247
+ self.model.doAction(ev);
248
+ }
249
+ self.$forceUpdate();
250
+ self.$refs.footer.$forceUpdate();
251
+ self.$common.closeDialog(dialogOption.dialog);
252
+ self.updateCurrentRow(field, ev);
253
+ }
254
+ },
255
+ refreshParent() {
256
+ self.getPage(1);
257
+ self.$common.closeDialog(dialogOption.dialog);
258
+ },
259
+ closeDialog() {
260
+ self.updateCurrentRow(field);
261
+ },
262
+ },
263
+ },
264
+ ],
265
+ };
266
+ self.$common.openDialog(dialogOption);
267
+ }
268
+ //SearchList
269
+ else if (field.isOpenList) {
270
+ var dialogOption = {
271
+ title: field.pageTitle,
272
+ pane: self.$common.getParentPane(self),
273
+ content: [
274
+ {
275
+ component: field.navToNewPageName,
276
+ attrs: {
277
+ searchConditionApi: field.actionForSearchLayout,
278
+ searchDataApi: field.actionForSearch,
279
+ apiParam: submitData,
280
+ width: field.dialogWidth + "px",
281
+ height: field.dialogHeight + "px",
282
+ },
283
+ on: {
284
+ refreshParent() {
285
+ self.getPage(1);
286
+ self.$common.closeDialog(dialogOption.dialog);
287
+ },
288
+ closeDialog() {
289
+ self.updateCurrentRow(field);
290
+ },
291
+ },
292
+ },
293
+ ],
294
+ };
295
+ self.$common.openDialog(dialogOption);
296
+ }
297
+ //Tabs
298
+ else if (field.isOpenTabs) {
299
+ var dialogOption = {
300
+ title: field.pageTitle,
301
+ pane: self.$common.getParentPane(self),
302
+ content: [
303
+ {
304
+ component: field.navToNewPageName,
305
+ attrs: {
306
+ searchConditionApi: field.actionForSearchLayout,
307
+ searchDataApi: field.actionForSearch,
308
+ apiParam: submitData,
309
+ width: field.dialogWidth + "px",
310
+ height: field.dialogHeight + "px",
311
+ },
312
+ on: {},
313
+ },
314
+ ],
315
+ };
316
+ self.$common.openDialog(dialogOption);
317
+ }
318
+ else {
319
+ self.operationLoading = true;
320
+ field.doAction(submitData, (data) => {
321
+ self.operationLoading = false;
322
+ if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
323
+ self.model.doAction({ responseData: data });
324
+ self.$emit("refreshRowHandle");
325
+ }
326
+ self.$forceUpdate();
327
+ self.$refs.footer.$forceUpdate();
328
+ self.updateCurrentRow(field, data);
329
+ });
330
+ }
331
+ }
332
+ }
333
+ //执行客户端脚本
334
+ else {
335
+ // let parm={submitData:submitData,field:field}
336
+ // self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
337
+ // var fun = self.model.scripts.formData[action];
338
+ // fun(submitData,field);
339
+ let title = field.pageTitle == undefined ? field.label : field.pageTitle;
340
+ submitData.actionType = field.actionType;
341
+ var fun = self.$common.getDataDrivenOpts().handler[action];
342
+ fun(submitData, title, self.$parent);
343
+ }
344
+ };
345
+
346
+ if (field.alert) {
347
+ self.$common.confirm(field.alertMsg, field.alertCaption, {
348
+ confirmButtonText: field.alertOKButtonText,
349
+ cancelButtonText: field.alertCancelButtonText,
350
+ //type: 'warning'
351
+ center: field.alertCenter,
352
+ })
353
+ .then(() => {
354
+ clickAcion();
355
+ })
356
+ .catch(() => { });
357
+ }
358
+ else {
359
+ clickAcion();
360
+ }
361
+ },
44
362
  },
45
363
  mounted() {
46
364
  if (this.flagsearch) {
@@ -37,6 +37,23 @@ const SearchScreen = function (source, callBack, screenPara) {
37
37
  get defaultSearch() {
38
38
  return source.content.flagSearch === true;
39
39
  },
40
+ _actionRouters: null,
41
+ get actionRouters() {
42
+ if (rtn._actionRouters !== null) {
43
+ return rtn._actionRouters;
44
+ }
45
+ else {
46
+ rtn._actionRouters = [];
47
+ if (source.actionRouters) {
48
+ source.actionRouters.forEach((v) => {
49
+ var button = Router(v);
50
+ button.is = "ct-btn";
51
+ rtn._actionRouters.push(button);
52
+ });
53
+ }
54
+ return rtn._actionRouters;
55
+ }
56
+ },
40
57
  _screen: null,
41
58
  _btnScreen: null,
42
59
  _highScreen: null,
@@ -63,6 +80,7 @@ const SearchScreen = function (source, callBack, screenPara) {
63
80
  },
64
81
  //表单组件
65
82
  get screen() {
83
+
66
84
  if (this._screen !== null) {
67
85
  return this._screen;
68
86
  }
@@ -75,8 +93,16 @@ const SearchScreen = function (source, callBack, screenPara) {
75
93
  });
76
94
 
77
95
  rtnscreens = this.initScreen(screens);
78
- rtnscreens.forEach((v)=>{
79
- v.action='search';
96
+ rtnscreens.forEach((v) => {
97
+ try {
98
+ if (v.type !== Enum.ControlType.ButtonCommon) {
99
+ v.action = 'search';
100
+ }
101
+ } catch (e) {
102
+ }
103
+
104
+
105
+
80
106
  });
81
107
  this._screen = rtnscreens;
82
108
  return rtnscreens;
@@ -272,7 +298,8 @@ const SearchScreen = function (source, callBack, screenPara) {
272
298
  var rtnscreens = [];
273
299
 
274
300
  screens.forEach((value) => {
275
- let item = LibFunction.GetControl(value, source, true, true);
301
+ let item = LibFunction.GetControl(value, source.content, true, true);
302
+
276
303
  if (item instanceof Object) {
277
304
  item.form = rtn;
278
305
  rtnscreens.push(item);