centaline-data-driven-v3 0.1.38 → 0.1.40

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.
@@ -12,6 +12,7 @@ const contentTop = ref(0)
12
12
  const content = ref()
13
13
  const captionBarButtons = ref([])
14
14
  const modelSelf = ref(null)
15
+ const submitCancelData= ref(null)
15
16
  onBeforeUnmount(()=>{
16
17
  modelSelf.value=null
17
18
  })
@@ -23,7 +24,7 @@ onActivated(() => {
23
24
  function close() {
24
25
  emit('close', props);
25
26
  if (props.vmodel.content[0].component != 'ct-iframe' && props.vmodel.content[0].attrs && typeof props.vmodel.content[0].attrs["onCloseDialog"] === "function") {
26
- props.vmodel.content[0].attrs["onCloseDialog"]();
27
+ props.vmodel.content[0].attrs["onCloseDialog"](submitCancelData.value);
27
28
  }
28
29
  }
29
30
  function scrollHandle(ev) {
@@ -159,6 +160,13 @@ const render = () => {
159
160
  close();
160
161
  }
161
162
  }
163
+
164
+ //加载失败关闭弹框
165
+ if (!item.attrs.onSubmitCancel) {
166
+ item.attrs.onSubmitCancel = (ev) => {
167
+ submitCancelData.value = ev;
168
+ }
169
+ }
162
170
  //此行代码是为了防止弹出的窗口高度 大于父级页面的高度
163
171
  //暂时注释 高度由接口控制
164
172
  var ph = 0;
@@ -0,0 +1,11 @@
1
+ import base from '../../loader/index';
2
+ import valid from '../../utils//validate';
3
+ const Cron = function (source) {
4
+ let rtn = {
5
+
6
+ };
7
+ rtn = base.copy(source, rtn);
8
+ rtn = base.copy(rtn, valid.Init(rtn));
9
+ return rtn;
10
+ };
11
+ export default Cron
@@ -41,13 +41,6 @@ const DatePicker = function (source) {
41
41
 
42
42
  if (this.flagtime) {
43
43
  dateformat = 'HH:mm';
44
- if (source.paramName1 && source.paramName1.length >= 2) {
45
- dateformat = source.paramName1;
46
- }
47
- }
48
-
49
- else if (source.paramName1 && source.paramName1.length >= 10) {
50
- dateformat = source.paramName1;
51
44
  }
52
45
  else if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange) {
53
46
  dateformat = 'YYYY-MM-DD HH:mm';
@@ -55,6 +48,9 @@ const DatePicker = function (source) {
55
48
  else if (source.controlType == Enum.ControlType.DateYearMonth) {
56
49
  dateformat = 'YYYY-MM';
57
50
  }
51
+ if (source.paramName1) {
52
+ dateformat = source.paramName1;
53
+ }
58
54
  return dateformat
59
55
  },
60
56
  get minuteStep() {
@@ -98,6 +98,9 @@ function loadFromModel(source, isFormList) {
98
98
  }
99
99
 
100
100
  rtn1[attrKey] = attrValue;
101
+ if (rtn1.fieldItemKey) {
102
+ rtn1.fieldItemKey = Math.random()
103
+ }
101
104
 
102
105
  if (rtn1.controlType === Enum.ControlType.Tags) {
103
106
  rtn1["value"] = JSON.parse(attrValue);
@@ -533,10 +536,12 @@ function loadFromModel(source, isFormList) {
533
536
  if (f.controlType == Enum.ControlType.Compound || f.controlType == Enum.ControlType.ContainerControl) {
534
537
  if (f.fields) {
535
538
  f.fields.forEach((v) => {
539
+ v.fieldItemKey = Math.random();
536
540
  rtn._fieldsDic[v.fieldName1] = v;
537
541
  });
538
542
  }
539
543
  }
544
+ f.fieldItemKey = Math.random();
540
545
  rtn._fieldsDic[f.fieldName1] = f;
541
546
  });
542
547
  }
@@ -765,6 +770,12 @@ function loadFromModel(source, isFormList) {
765
770
  get tip() {
766
771
  return source.tip;
767
772
  },
773
+ get bottomTip() {
774
+ return source.bottomTip;
775
+ },
776
+ get flagFixedTabOnHorizontalLayout() {
777
+ return source.flagFixedTabOnHorizontalLayout === true;
778
+ },
768
779
  get flagAlertCloseWindowAfterSave() {
769
780
  return source.flagAlertCloseWindowAfterSave === true;
770
781
  },
@@ -24,6 +24,7 @@ import Tags from './Tags';
24
24
  import Location from './Location';
25
25
  import AIChat from './AIChat';
26
26
  import JsonViewer from './JsonViewer';
27
+ import Cron from './Cron';
27
28
  const LibFunction = {
28
29
  install(app) {
29
30
  },
@@ -279,6 +280,10 @@ const LibFunction = {
279
280
  item = JsonViewer.loadJsonViewerModel(item);
280
281
  item.is = 'ct-jsonviewer';
281
282
  break;
283
+ case Enum.ControlType.Cron: //Cron表达式控件
284
+ item = Cron(item)
285
+ item.is = 'ct-cron'
286
+ break;
282
287
  default:
283
288
  item = Label(item)
284
289
  item.is = 'ct-label'
@@ -301,7 +306,7 @@ const LibFunction = {
301
306
  else {
302
307
  num = 24 / colNum;
303
308
  }
304
- return num;
309
+ return parseInt(num);
305
310
  },
306
311
  get for() {
307
312
  return field.for;
@@ -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
@@ -21,7 +21,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
21
21
  }
22
22
 
23
23
  app.use(centaline, {
24
- baseUrl: "http://10.88.22.13:7080/ibs-api/",
24
+ baseUrl: "http://10.88.22.46:20808/service-api/",
25
25
  //baseUrl:"http://10.88.22.13:7070/onecard-api/",
26
26
  //baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
27
27
  //baseUrl: "http://10.88.22.13:6060/onecard-api/",
@@ -65,7 +65,9 @@ app.use(centaline, {
65
65
  //获取请求头
66
66
  getRequestHeaders: function () {
67
67
  return {
68
- authobject: '{token:"T5067-1993594422771769344",platform:"WEB"}',
68
+
69
+ AuthorizationCode:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjI3NjY3NmE5LWE5ZDEtNDJhNy05N2UwLWZjYjM4ZmM4NGExYiJ9.NMtc9T_b_BHBj1Ru6_BsVrlkUiptS4EKrrMsx9i7FScbcpGSnQqd1JnQ0ObEu_kwkNAqvMA4LDHuve1DsS8hkA',
70
+ authobject: '{"currentEstate":{},"platform":1,"osVersion":"","clientVersion":"","machineCode":"f1fe9ca3d9c88ffd7d1298227dbb4def","token":"","random":"c6HfeQ","time":1766043585321,"sign":""}',
69
71
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
72
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
71
73
  //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
@@ -313,7 +313,12 @@ const Enum = {
313
313
  /// <summary>
314
314
  /// Json预览控件
315
315
  /// </summary>
316
- JsonViewer: 63
316
+ JsonViewer: 63,
317
+
318
+ /**
319
+ * cron 表达式生成/选择
320
+ */
321
+ Cron:65,
317
322
  },
318
323
 
319
324
  //返回状态码
@@ -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
@@ -300,6 +310,9 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
300
310
  }
301
311
  }
302
312
  model.$vue.emit('submit', { formData: model, responseData: data });
313
+ }, () => {
314
+ model.$vue.emit('submitCancel', { formData: model, responseData: data });
315
+ model.$vue.init();
303
316
  }).catch(() => {
304
317
  model.$vue.init();
305
318
  });
@@ -565,7 +578,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
565
578
  }
566
579
  }
567
580
  if (data.rtnMsg) {
568
- common.message(data.rtnMsg, 'success')
581
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
582
+ common.message(data.rtnMsg, 'success', '', 0, true)
583
+ }
584
+ else {
585
+ common.message(data.rtnMsg, 'success')
586
+ }
569
587
  }
570
588
  if (field && field.callBackFunName) {
571
589
  model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
@@ -632,7 +650,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
632
650
  }
633
651
  }
634
652
  if (data.rtnMsg) {
635
- common.message(data.rtnMsg, 'success')
653
+ if (data.msgAlertStyle && data.msgAlertStyle == Enum.MessageAlertStyle.Dialog) {
654
+ common.message(data.rtnMsg, 'success', '', 0, true)
655
+ }
656
+ else {
657
+ common.message(data.rtnMsg, 'success')
658
+ }
636
659
  }
637
660
  if (field && field.callBackFunName) {
638
661
  model.$vue.changeCallBackHandler(field, field.callBackFunName, data.content);
@@ -768,6 +791,53 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
768
791
  }
769
792
  common.closeDialog(dialogOption);
770
793
  },
794
+ onCloseDialog: (ev) => {
795
+ if (ev) {
796
+ if (source == 'table') {
797
+ if (ev.responseData.notification == Enum.ActionType.UpdateColumns) {
798
+ //更新列
799
+ model.$vue.refreshTableColumns();
800
+ }
801
+ else if (ev.responseData.notification == Enum.ActionType.Delete
802
+ || ev.responseData.notification == Enum.ActionType.Refersh
803
+ ) {
804
+ model.$vue.doAction(ev);
805
+ model.$vue.loadStats();
806
+ }
807
+ else {
808
+ if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
809
+ model.$vue.doAction(ev);
810
+ let response = ev;
811
+ if (response.responseData) {
812
+ response = response.responseData;
813
+ }
814
+ if (response.notification === Enum.ActionType.Delete || response.notification === Enum.ActionType.CloseTabThenDelete) {
815
+ model.$vue.loadStats();
816
+ }
817
+ }
818
+ model.$vue.updateCurrentRow(field, ev);
819
+ if (ev.responseData && ev.responseData.notification === Enum.ActionType.Router) {
820
+ setTimeout(() => {
821
+ routerClickHandler(model.getRtnRouter(ev.responseData.content), {}, action, model, source);
822
+ });
823
+ }
824
+ }
825
+ }
826
+ else {
827
+ if (callBack) {
828
+ callBack(ev.responseData.content[0]);
829
+ }
830
+ if (ev.responseData && ev.responseData.notification === Enum.ActionType.Refersh) {
831
+ model.$vue.init();
832
+ }
833
+ else {
834
+ if (model.$vue && model.$vue.updateFields) {
835
+ model.$vue.updateFields(ev);
836
+ }
837
+ }
838
+ }
839
+ }
840
+ },
771
841
  isIframe: model.isIframe,
772
842
  },
773
843
  }]
@@ -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,6 +1,6 @@
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="'/jobschedulingmanage/JobManage/readDetail'" :apiParam="apiParam"></ct-form>
4
4
  <!-- <ct-textbox :source="source"></ct-textbox> -->
5
5
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
6
6
  </div>
@@ -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="'/comprehensive/ApplicationList/getLayoutOfSearch'"
4
+
5
+ :searchDataApi="'/comprehensive/ApplicationList/getList'"></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>