centaline-data-driven-v3 0.1.37 → 0.1.39

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.
@@ -23,6 +23,7 @@ import Steps from './Steps';
23
23
  import Tags from './Tags';
24
24
  import Location from './Location';
25
25
  import AIChat from './AIChat';
26
+ import JsonViewer from './JsonViewer';
26
27
  const LibFunction = {
27
28
  install(app) {
28
29
  },
@@ -80,7 +81,7 @@ const LibFunction = {
80
81
  moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
81
82
  }
82
83
 
83
- item = Field(field, moreActionRouter,source.labelPlacement);
84
+ item = Field(field, moreActionRouter, source.labelPlacement);
84
85
  item.isList = isList;
85
86
  switch (field.controlType) {
86
87
  case Enum.ControlType.Group:
@@ -217,10 +218,10 @@ const LibFunction = {
217
218
  item.is = 'ct-customizecolumns'
218
219
  break;
219
220
  case Enum.ControlType.Location:
220
- moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
221
- item = Location(item,moreActionRouter);
222
- item.is = 'ct-location';
223
- break;
221
+ moreActionRouter = LibFunction.getRouter(source.actionRouters, field.moreActionRouterKey);
222
+ item = Location(item, moreActionRouter);
223
+ item.is = 'ct-location';
224
+ break;
224
225
  case Enum.ControlType.SearchPage: //搜索列表页面
225
226
  //item = {};
226
227
  item.is = 'ct-searchlist';
@@ -255,8 +256,8 @@ const LibFunction = {
255
256
  case Enum.ControlType.Image:
256
257
  item.is = 'ct-image'
257
258
  break;
258
-
259
- case Enum.ControlType.AIChat: //AI
259
+
260
+ case Enum.ControlType.AIChat: //AI
260
261
  var router = {};
261
262
  if (source.actionRouters) {
262
263
  router = source.actionRouters.find((v1) => {
@@ -270,10 +271,14 @@ const LibFunction = {
270
271
  } else {
271
272
  messages = field.code1 && field.code1 != "[]" ? JSON.parse(field.code1) : [];
272
273
  }
273
-
274
+
274
275
  item = AIChat.loadFromModel(item, messages, router);
275
276
  item.is = 'ct-aichat';
276
277
  break;
278
+ case Enum.ControlType.JsonViewer: //JSON预览控件
279
+ item = JsonViewer.loadJsonViewerModel(item);
280
+ item.is = 'ct-jsonviewer';
281
+ break;
277
282
  default:
278
283
  item = Label(item)
279
284
  item.is = 'ct-label'
@@ -296,7 +301,7 @@ const LibFunction = {
296
301
  else {
297
302
  num = 24 / colNum;
298
303
  }
299
- return num;
304
+ return parseInt(num);
300
305
  },
301
306
  get for() {
302
307
  return field.for;
@@ -85,6 +85,11 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
85
85
  set title(v) {
86
86
  source.content.title = v;
87
87
  },
88
+ get flagShowTitle() {
89
+ let v = false;
90
+ if (source.flagShowTitle) v = source.flagShowTitle;
91
+ return v;
92
+ },
88
93
  //源数据
89
94
  get source() {
90
95
  return source;
@@ -1,7 +1,15 @@
1
-
1
+ import common from '../../utils/common';
2
2
  async function postFile(api, data, callback) {
3
3
  var xhr = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
4
4
  xhr.open('POST', api, !0)
5
+
6
+ // let headers=common.getDataDrivenOpts().handler.getRequestHeaders(api);
7
+ // if(headers){
8
+ // for (const [key, value] of Object.entries(headers)) {
9
+ // xhr.setRequestHeader(key,value)
10
+ // }
11
+ // }
12
+
5
13
  xhr.onreadystatechange = function () {
6
14
  if (xhr.readyState != 4 || xhr.status < 200) {
7
15
  return false;
package/src/main.js CHANGED
@@ -65,7 +65,7 @@ app.use(centaline, {
65
65
  //获取请求头
66
66
  getRequestHeaders: function () {
67
67
  return {
68
- authobject: '{EmpID:"Token_3d65f2f0-d6a3-432e-9af6-5c378b501b76",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_3d65f2f0-d6a3-432e-9af6-5c378b501b76",Platform:"WEB"}',
68
+ authobject: '{EmpID:"Token_a3e4add3-642b-40b6-bc3f-32bdf8114668",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_a3e4add3-642b-40b6-bc3f-32bdf8114668",Platform:"WEB"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
70
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
71
71
  //authObject: '{EmpID:"Token_4e09499b-4b76-46df-9ce5-5498d48ed062",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_4e09499b-4b76-46df-9ce5-5498d48ed062",Platform:"WEB"}',
package/src/utils/Enum.js CHANGED
@@ -309,7 +309,11 @@ const Enum = {
309
309
  /// <summary>
310
310
  /// AI会话控件
311
311
  /// </summary>
312
- AIChat: 62
312
+ AIChat: 62,
313
+ /// <summary>
314
+ /// Json预览控件
315
+ /// </summary>
316
+ JsonViewer: 63
313
317
  },
314
318
 
315
319
  //返回状态码
@@ -278,7 +278,10 @@ const common = {
278
278
  */
279
279
  message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
280
280
  if (dataDrivenOpts.flagApp) {
281
- if (this.hasHtml(message)) {
281
+ if (typeof duration === 'undefined') {
282
+ duration = 3000;
283
+ }
284
+ if (duration == 0) {
282
285
  showDialog({ message: message, allowHtml: true });
283
286
  }
284
287
  else if (type == 'error') {
@@ -287,7 +290,7 @@ const common = {
287
290
  else {
288
291
  showToast({
289
292
  message: message,
290
- duration: 3000,
293
+ duration: duration,
291
294
  });
292
295
  }
293
296
 
@@ -303,9 +306,7 @@ const common = {
303
306
  showClose = false;
304
307
  }
305
308
  if (this.hasHtml(message)) {
306
- duration = 0;
307
309
  dangerouslyUseHTMLString = true;
308
- showClose = true;
309
310
  }
310
311
  ElMessage({
311
312
  message: message,//消息文字
@@ -0,0 +1,84 @@
1
+ export const useDistanceCalculator = (elementRef) => {
2
+ const getAllDistances = (retryCount = 0) => {
3
+ if (!elementRef?.value) {
4
+ console.warn('元素引用为空');
5
+ return null;
6
+ }
7
+
8
+ const element = elementRef.value;
9
+
10
+ // 检查元素是否在 DOM 中
11
+ if (!document.body.contains(element)) {
12
+ console.warn('元素不在 DOM 中');
13
+ return null;
14
+ }
15
+
16
+ const rect = element.getBoundingClientRect();
17
+ const scrollTop = window.pageYOffset;
18
+
19
+ // 检查是否有实际尺寸
20
+ const hasSize = rect.height > 0 && rect.width > 0;
21
+
22
+ if (!hasSize && retryCount < 3) {
23
+ console.warn(`元素尺寸为 0,尝试重试 (${retryCount + 1}/3)`);
24
+ // 延迟重试
25
+ setTimeout(() => getAllDistances(retryCount + 1), 50);
26
+ return null;
27
+ }
28
+
29
+ // 获取计算样式,检查是否隐藏
30
+ const computedStyle = window.getComputedStyle(element);
31
+ const isVisible = computedStyle.display !== 'none' &&
32
+ computedStyle.visibility !== 'hidden' &&
33
+ computedStyle.opacity !== '0';
34
+
35
+ if (!isVisible) {
36
+ console.warn('元素不可见,无法获取尺寸');
37
+ return null;
38
+ }
39
+
40
+ return {
41
+ // 到文档顶部的距离
42
+ toDocumentTop: rect.top + scrollTop,
43
+
44
+ // 到视口顶部的距离
45
+ toViewportTop: rect.top,
46
+
47
+ // 元素自身信息
48
+ elementInfo: {
49
+ height: rect.height,
50
+ width: rect.width,
51
+ top: rect.top,
52
+ right: rect.right,
53
+ bottom: rect.bottom,
54
+ left: rect.left,
55
+ // 添加更多诊断信息
56
+ hasSize,
57
+ isVisible,
58
+ displayStyle: computedStyle.display,
59
+ positionStyle: computedStyle.position
60
+ },
61
+
62
+ // 视口信息
63
+ viewportInfo: {
64
+ height: window.innerHeight,
65
+ width: window.innerWidth,
66
+ scrollTop: scrollTop
67
+ }
68
+ };
69
+ };
70
+
71
+ // 添加一个延迟获取的方法,用于异步内容
72
+ const getDistancesWithDelay = (delay = 100) => {
73
+ return new Promise((resolve) => {
74
+ setTimeout(() => {
75
+ resolve(getAllDistances());
76
+ }, delay);
77
+ });
78
+ };
79
+
80
+ return {
81
+ getAllDistances,
82
+ getDistancesWithDelay
83
+ };
84
+ };
@@ -181,7 +181,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
181
181
  }
182
182
  }
183
183
  if (data.rtnMsg) {
184
- common.message(data.rtnMsg, 'success')
184
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
185
+ common.message(data.rtnMsg, 'success', '', 0, true)
186
+ }
187
+ else {
188
+ common.message(data.rtnMsg, 'success')
189
+ }
185
190
  }
186
191
  if (data.notification === Enum.ActionType.Router) {
187
192
  if (common.dialogList && common.dialogList.List.value.length > 0
@@ -242,7 +247,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
242
247
  }
243
248
  }
244
249
  if (data.rtnMsg) {
245
- common.message(data.rtnMsg, 'success')
250
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
251
+ common.message(data.rtnMsg, 'success', '', 0, true)
252
+ }
253
+ else {
254
+ common.message(data.rtnMsg, 'success')
255
+ }
246
256
  }
247
257
  if (data.notification === Enum.ActionType.Router) {
248
258
  if (common.dialogList && common.dialogList.List.value.length > 0
@@ -565,7 +575,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
565
575
  }
566
576
  }
567
577
  if (data.rtnMsg) {
568
- common.message(data.rtnMsg, 'success')
578
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
579
+ common.message(data.rtnMsg, 'success', '', 0, true)
580
+ }
581
+ else {
582
+ common.message(data.rtnMsg, 'success')
583
+ }
569
584
  }
570
585
  if (field && field.callBackFunName) {
571
586
  model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
@@ -632,7 +647,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
632
647
  }
633
648
  }
634
649
  if (data.rtnMsg) {
635
- common.message(data.rtnMsg, 'success')
650
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
651
+ common.message(data.rtnMsg, 'success', '', 0, true)
652
+ }
653
+ else {
654
+ common.message(data.rtnMsg, 'success')
655
+ }
636
656
  }
637
657
  if (field && field.callBackFunName) {
638
658
  model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
@@ -73,11 +73,11 @@ const request = {
73
73
  //common.getDataDrivenOpts().handler.closeTab();
74
74
  }
75
75
  }
76
+
76
77
  if (data.rtnCode === Enum.ReturnCode.Successful) {
77
78
  if (data.rtnMsg && common.getDataDrivenOpts().showRequestSuccessMessage) {
78
- if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
79
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
79
80
  common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
80
-
81
81
  }
82
82
  else {
83
83
  common.message(response.data.rtnMsg, 'success')
@@ -114,7 +114,7 @@ const request = {
114
114
  }
115
115
  else {
116
116
  if (response.data.rtnMsg && common.getDataDrivenOpts().showRequestErrorMessage) {
117
- if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
117
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
118
118
 
119
119
  common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
120
120
  }
@@ -84,6 +84,9 @@ const actions = {
84
84
  }
85
85
  },
86
86
  numberMax(v, o) {
87
+ if (v.code1 == '-') {
88
+ return true;
89
+ }
87
90
  if (v.code1 <= parseFloat(v.maxValue1)) {
88
91
  return true
89
92
  }
@@ -91,7 +94,7 @@ const actions = {
91
94
  if (!v.code1) {
92
95
  return false;
93
96
  }
94
- common.message("【"+v.controlLabel+"】最大值为" + v.maxValue1 + "");
97
+ common.message("【" + v.controlLabel + "】最大值为" + v.maxValue1 + "");
95
98
  v.code1 = o;
96
99
  return true;
97
100
  }
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div id="form-app" class="data-driven" style="width:100%;height:100%;overflow:auto">
3
- <ct-form :api="'/propertyTender/readDetail'" :apiParam="apiParam"></ct-form>
3
+ <ct-form :api="'/Role/readDetail'" :apiParam="apiParam"></ct-form>
4
4
  <!-- <ct-textbox :source="source"></ct-textbox> -->
5
5
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
6
6
  </div>
7
7
  </template>
8
8
  <script lang="ts" setup>
9
- const apiParam={"actionType":2}
9
+ const apiParam={"roleId":"61","actionType":3}
10
10
  </script>
@@ -1,13 +1,15 @@
1
1
  <template>
2
2
  <div id="app-search" style="width:100%;height:100%;position: fixed;">
3
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/UIResourceList/getLayoutOfSearch'"
4
- :searchDataApi="'/UIResourceList/getListOfSearchModel'"></ct-searchlist>
3
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
4
+ :searchStatsApi="'/propertyPublishList/getListStats'"
5
+ :searchDataApi="'/propertyPublishList/getListOfSearchModel'"></ct-searchlist>
5
6
 
6
7
  <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
7
8
  :searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->
8
9
 
9
10
  <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/OvertimeList/getLayoutOfSearch'"
10
- :searchDataApi="'/OvertimeList/getListOfSearchModel'"></ct-searchlist> -->
11
+ :searchStatsApi="'/ProfileWorklistList/getListStats'"
12
+ :searchDataApi="'/OvertimeList/getListOfSearchModel'"></ct-searchlist> -->
11
13
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
12
14
 
13
15
  </div>