centaline-data-driven-v3 0.0.87 → 0.0.89

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.87",
3
+ "version": "0.0.89",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -178,7 +178,7 @@ function init() {
178
178
  function load(data) {
179
179
  model.value = data
180
180
  model.value.parentModelForm = props.parentModelForm
181
- model.value.$vue = { fieldClickHandler, clickHandler, emit, getFormObj, getFileData, Form, validExcute, changeCallBackHandler, load, init, updateFields };
181
+ model.value.$vue = { fieldClickHandler, clickHandler, emit, getFormObj, getFileData, Form, validExcute, changeCallBackHandler, load, init, updateFields,loaded };
182
182
  if (model.value.scripts) {
183
183
  model.value.scripts.formData = model.value.formData;
184
184
  model.value.scripts.formData.form = model.value;
@@ -213,6 +213,9 @@ function load(data) {
213
213
  //通知父组件加载完成
214
214
  emit('loaded', model.value);
215
215
  }
216
+ function loaded(model) {
217
+ emit('loaded', model);
218
+ }
216
219
  function failLoad() {
217
220
  emit('failLoad', model.value);
218
221
  }
@@ -523,23 +523,30 @@ const getTemplateType = (fullText) => {
523
523
  if (eventData.rtnCode != '200') {
524
524
  rtn = "error";
525
525
  outtext.value = (eventData.rtnMsg || fullText);
526
- if (eventData.rtnCode == '401') {
527
- common.message(eventData.rtnMsg, 'error');
526
+ if (eventData.rtnCode == Enum.ReturnCode.Unauthorized) {
527
+ if (common.getDataDrivenOpts().handler?.login) {
528
+ common.getDataDrivenOpts().handler.login();
529
+ };
528
530
  }
529
531
  }
530
532
  else if (eventData.clientActionType == Enum.ClientActionType.ExcuteScript) {
531
533
  rtn = 'js';
532
- if (eventData.content&&props.form) {
534
+ if (eventData.content && props.form) {
533
535
  common.excute.call(props.form?.scripts, eventData.content);
534
536
  }
535
537
  outtext.value = (eventData.rtnMsg || "脚本执行成功!");
536
538
 
537
539
  }
538
- else if (eventData.content?.rows) {
539
- rtn = 'table';
540
- }
541
- else if (eventData.content?.fields) {
542
- rtn = 'form';
540
+ else if (eventData.content) {
541
+ if (!isJSONObject(eventData.content)) {
542
+ outtext.value = eventData.content;
543
+ }
544
+ else if (eventData.content?.rows) {
545
+ rtn = 'table';
546
+ }
547
+ else if (eventData.content?.fields) {
548
+ rtn = 'form';
549
+ }
543
550
  }
544
551
 
545
552
  }
@@ -551,14 +558,25 @@ const getTemplateType = (fullText) => {
551
558
  return rtn;
552
559
 
553
560
  }
561
+ function isJSONObject(value) {
562
+ if (typeof value !== 'object' || value === null) {
563
+ return false; // 如果不是对象,直接返回 false
564
+ }
554
565
 
566
+ try {
567
+ JSON.stringify(value);
568
+ return true; // 如果可以序列化为 JSON,说明是 JSON 对象
569
+ } catch (e) {
570
+ return false; // 如果序列化失败,说明不是 JSON 对象
571
+ }
572
+ }
555
573
 
556
574
  function startTypingEffect(fullText) {
557
575
  fullText = fullText.replace(/\\n/gi, '\n\n');
558
576
  let index = 0;
559
577
  outtext.value = ''; // 清空内容
560
578
  function typeNext() {
561
- // 随机生成310之间的字符数
579
+ // 随机生成412之间的字符数
562
580
  const randomChars = Math.floor(Math.random() * 5) + 8;
563
581
  const charsToLoad = Math.min(randomChars, fullText.length - index);
564
582
 
@@ -12,7 +12,7 @@
12
12
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
13
13
  <div v-if="col.show !== false"
14
14
  :class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
15
- :style="{ 'width': (col.width != '0' ? col.width + 'px' : '100%'), 'flex': (col.width != '0' ? '0 0 ' + col.width + 'px' : '100%') }">
15
+ :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '100%') }">
16
16
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
17
17
  v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
18
18
  @popupSearchList="popupSearchListHandler"></component>
@@ -28,7 +28,7 @@
28
28
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
29
29
  <el-col v-if="col.show !== false"
30
30
  :class="[index > 0 && (col.controlLabel == '' || col.is == 'ct-btn') ? 'complex-left-10' : '', 'containerCol']"
31
- :style="{ 'width': (col.width != '0' ? col.width + 'px' : '100%'), 'flex': (col.width != '0' ? '0 0 ' + col.width + 'px' : '100%') }">
31
+ :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0 ? '0 0 ' + col.width + 'px' : '100%') }">
32
32
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
33
33
  v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
34
34
  @popupSearchList="popupSearchListHandler">
@@ -56,7 +56,25 @@ const Fields = ref()
56
56
  const itemKey = ref(0)
57
57
  model.value.selfValidExcute = () => {
58
58
  let rtnBool = true;
59
- if (typeof Fields.value !== 'undefined') {
59
+ if (model.value.layoutTemplate) {
60
+ var i = 0;
61
+ if (model.value.fields.length > 0) {
62
+ model.value.fields.forEach((f) => {
63
+ if (f.validExcute) {
64
+ if (!f.validExcute()) {
65
+ if (i === 0) {
66
+ if (f.displayValidMessage) {
67
+ model.value.displayValidMessage = f.displayValidMessage;
68
+ }
69
+ }
70
+ i++;
71
+ rtnBool = false;
72
+ }
73
+ }
74
+ });
75
+ }
76
+ }
77
+ else if (typeof Fields.value !== 'undefined') {
60
78
  Fields.value.forEach((f) => {
61
79
  if (f.model && typeof f.model.validExcute !== 'undefined') {
62
80
  if (!f.model.validExcute(f.model)) {
@@ -3,7 +3,7 @@ import LibFunction from './LibFunction';
3
3
  import Router from './Router';
4
4
  import Enum from '../../utils/Enum';
5
5
  import common from '../../utils/common';
6
- import request from '../../utils/request';
6
+ import request from '../../utils/request';
7
7
 
8
8
  function loadFormApi(api, callBack, apiParam, failCallBack, isFormList) {
9
9
  if (api) {
@@ -47,7 +47,7 @@ function loadFromModel(source, isFormList) {
47
47
  return rtn1.code1;
48
48
  }
49
49
  },
50
-
50
+
51
51
  //获取code2
52
52
  getCode2ByField1(id) {
53
53
  var rtn1 = this.fieldsDic[id];
@@ -69,6 +69,9 @@ function loadFromModel(source, isFormList) {
69
69
  });
70
70
  if (router) {
71
71
  router[attrKey] = attrValue;
72
+ if (common.flagApp() && this.form.$vue.loaded) {
73
+ this.form.$vue.loaded(this.form)
74
+ }
72
75
  }
73
76
  },
74
77
  //获取Field的属性attrKey的值
@@ -304,6 +307,9 @@ function loadFromModel(source, isFormList) {
304
307
  if (flagTemplate) {
305
308
  data.field[attrName] = value;
306
309
  }
310
+ if (data.listData.flagTemplate && data.listData.$vue) {
311
+ data.listData.$vue.itemKey = Math.random()
312
+ }
307
313
  }
308
314
 
309
315
  //如果有汇总列,触发重新计算汇总
@@ -748,13 +754,13 @@ function loadFromModel(source, isFormList) {
748
754
  return v1.key === field.fieldName1;
749
755
  });
750
756
  }
751
- rtn._aiRouter= router;
757
+ rtn._aiRouter = router;
752
758
  return rtn._aiRouter;
753
759
  }
754
- },
760
+ },
755
761
  get aiChat() {
756
762
  return source.aiChat;
757
- },
763
+ },
758
764
  //获取表单数据
759
765
  getFormObj() {
760
766
  var rtnFormObj = {};
@@ -797,9 +803,9 @@ function loadFromModel(source, isFormList) {
797
803
  getRefFieldPara(refFieldNameArr) {
798
804
  let submitData = {};
799
805
  var tempFormData = rtn.getFormObj();
800
-
806
+
801
807
  refFieldNameArr.forEach((v) => {
802
- submitData[v] = common.getDataOfUpperLower(tempFormData,v);
808
+ submitData[v] = common.getDataOfUpperLower(tempFormData, v);
803
809
  });
804
810
  return submitData;
805
811
  },
package/src/main.js CHANGED
@@ -21,9 +21,10 @@ 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:"https://uplink.centaline.com.cn/xian/",
25
+ baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
25
26
  //baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
26
- baseUrl: "http://10.88.22.66:6060/onecard-api/",
27
+ //baseUrl: "http://10.88.22.13:6060/onecard-api/",
27
28
  //baseUrl: "http://10.88.22.66:6060/xian/",
28
29
  //baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
29
30
  //baseUrl: "http://10.1.245.111:38028/",
@@ -66,8 +67,8 @@ app.use(centaline, {
66
67
  return {
67
68
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
68
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
69
- authObject: '{token:"1647-1909419453867757568",platform:"WEB"}',
70
- //authObject: '{EmpID:"Token_2fa5c93f-ae55-4e77-98a4-ef9c8b3bec34",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_2fa5c93f-ae55-4e77-98a4-ef9c8b3bec34",Platform:"IOS"}',
70
+ //authObject: '{token:"1-bce18a8d-21f0-4022-a6ca-450de105cafc"}',
71
+ authObject: '{EmpID:"Token_2053032d-9248-494b-9295-12c2ddf81d22",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_2053032d-9248-494b-9295-12c2ddf81d22",Platform:"WEB"}',
71
72
  };
72
73
  },
73
74
  getToken() {
@@ -294,7 +294,7 @@ const common = {
294
294
  center = true;
295
295
  }
296
296
  if (typeof duration === 'undefined') {
297
- duration = 1500;
297
+ duration = 3000;
298
298
  }
299
299
  if (typeof showClose === 'undefined') {
300
300
  showClose = false;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="data-driven" id="app-form" >
3
3
 
4
- <ct-form :api="'/PropertyPublish/getLayoutOfAudit'" :apiParam="apiParam" :flagNavbar="true"></ct-form>
4
+ <ct-form :api="'/admin/SchoolTeachingPlanExam/readDetail'" :apiParam="apiParam" :flagNavbar="true"></ct-form>
5
5
  <!-- <ct-form :api="'/api/third-dept-tran/tran-comm-adjust/task'" :apiParam="apiParam"></ct-form> -->
6
6
  <!-- <ct-form :api="'/PropertyTranToActive/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
7
7
  <!-- <ct-textbox :source="source"></ct-textbox> -->
@@ -10,5 +10,5 @@
10
10
  </template>
11
11
  <script lang="ts" setup>
12
12
  //const apiParam={"originalTraId":"1739561435204980737","actionType":1,"pageStyle":2,"pageTitle":"成交报告","pageOnly":true}
13
- const apiParam={"workListID":"1902920155446489088","actionType":3}
13
+ const apiParam={"actionType":2,"teachingPlanId":"1"}
14
14
  </script>
@@ -4,12 +4,12 @@
4
4
  :searchDataApi="'/propertyPublishList/getListOfSearchModel'"
5
5
  :searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist> -->
6
6
 
7
- <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
8
- :searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist> -->
7
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
8
+ :searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist>
9
9
 
10
10
 
11
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/ReportWorkQuantifyList/getLayoutOfSearch'"
12
- :searchDataApi="'/ReportWorkQuantifyList/getListOfSearchModel'"></ct-searchlist>
11
+ <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeAttendanceBillList/getLayoutOfSearchForMy'"
12
+ :searchDataApi="'/EmployeeAttendanceBillList/getListOfSearchModelForMy'"></ct-searchlist> -->
13
13
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
14
14
 
15
15
  </div>