centaline-data-driven-v3 0.1.23 → 0.1.25

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.1.23",
3
+ "version": "0.1.25",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -18,7 +18,7 @@
18
18
  </template>
19
19
 
20
20
  <slot name="PreLabel">
21
- <div v-if="model.preLabel1" class="preLabel">
21
+ <div v-if="model.preLabel1" class="preLabel" :style="model.isList ? 'white-space: nowrap' : ''">
22
22
  <span v-html="model.preLabel1"></span>
23
23
  </div>
24
24
  </slot>
@@ -37,7 +37,7 @@
37
37
  </template>
38
38
 
39
39
  <slot name="PreLabel">
40
- <div v-if="model.preLabel1" class="preLabel">
40
+ <div v-if="model.preLabel1" class="preLabel" :style="model.isList ? 'white-space: nowrap' : ''">
41
41
  <span v-html="model.preLabel1"></span>
42
42
  </div>
43
43
  </slot>
@@ -71,7 +71,18 @@ function clickHandle() {
71
71
  emit('change', model);
72
72
  }
73
73
  function HtmlReplace(v) {
74
- return v.replace(/ /g, "&nbsp;&nbsp;")
74
+ return v.replace(
75
+ /(?:<[^>]*>)|([^<]+)/g, // 匹配所有标签,或标签外的文本
76
+ (match, text) => {
77
+ if (text) {
78
+ // 若匹配到文本部分,替换其中的空格(例如替换为 &nbsp; 或保留连续空格)
79
+ return text.replace(/ /g, '&nbsp;&nbsp;'); // 仅替换文本中的空格
80
+ } else {
81
+ // 若匹配到标签(含属性),不做处理,直接返回原标签
82
+ return match;
83
+ }
84
+ }
85
+ )
75
86
  }
76
87
  defineExpose({
77
88
  model
@@ -140,7 +140,7 @@
140
140
  v-if="!router.rightField || row[router.rightField] == 1"
141
141
  :key="rowRouterIndex" :rowData="row"
142
142
  :rowindex="rowindex" :isOperationalColumn="true"
143
- :router="router" :colValue="router.label"
143
+ :router="router" :colValue="router.controlLabel"
144
144
  :isShowImg="false" @click="rolRouterClickHandler">
145
145
  </Tablecurrency>
146
146
  </template>
@@ -183,7 +183,8 @@
183
183
  <Tablecurrency v-else :rowindex="rowindex" :align="column.attrs.align"
184
184
  :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'"
185
185
  :columnName="column.id" :router="column.router"
186
- :colValue="row[column.id]" :rowData="row"
186
+ :columnGroupId="column.groupId"
187
+ :colValue="getValueCaseInsensitive(row,column.id)" :rowData="row"
187
188
  :eventTriggerType="column.eventTriggerType"
188
189
  @click="rolRouterClickHandler"
189
190
  @mouseenter="rolRouterMouseenterHandler">
@@ -726,7 +727,7 @@ function rowLayoutClickHandle(index) {
726
727
  }
727
728
 
728
729
  //表单列表操作
729
- function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, callBack, flagMouseenter) {
730
+ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, columnGroupId,callBack, flagMouseenter) {
730
731
  field.rowindex = rowindex;
731
732
  if (refRowsPopover.value[rowindex]) {
732
733
  refRowsPopover.value[rowindex].hide();
@@ -752,6 +753,9 @@ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, ca
752
753
  if (columnName) {
753
754
  submitData.columnName = columnName;
754
755
  }
756
+ if (columnGroupId) {
757
+ submitData.columnGroupId = columnGroupId;
758
+ }
755
759
 
756
760
  let action = field.action;
757
761
  if (field.actionField) {
@@ -761,8 +765,8 @@ function rolRouterClickHandler(field, rowData, rowindex, visible, columnName, ca
761
765
  RouterClickHandler(field, submitData, action, model.value, 'table', callBack, flagMouseenter)
762
766
  }
763
767
  //表单列表操作
764
- function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName, callBack, flagMouseenter) {
765
- rolRouterClickHandler(field, rowData, rowindex, visible, columnName, callBack, true)
768
+ function rolRouterMouseenterHandler(field, rowData, rowindex, visible, columnName,columnGroupId, callBack, flagMouseenter) {
769
+ rolRouterClickHandler(field, rowData, rowindex, visible, columnName,columnGroupId, callBack, true)
766
770
  }
767
771
  function popupClickHandler() {
768
772
  var tempListData = model.value.getSelectRowData({ isMulti: model.value.isMulti });
@@ -1604,6 +1608,11 @@ function addClass(el, className) {
1604
1608
  newClassName.push(className);
1605
1609
  el.className = newClassName.join(" ");
1606
1610
  }
1611
+ function getValueCaseInsensitive(obj, key) {
1612
+ const searchKey = key.toLowerCase();
1613
+ const foundKey = Object.keys(obj).find(k => k.toLowerCase() === searchKey);
1614
+ return foundKey ? obj[foundKey] : undefined;
1615
+ }
1607
1616
 
1608
1617
  defineExpose({
1609
1618
  model,
@@ -77,6 +77,7 @@ const props = defineProps({
77
77
  colValue: String,
78
78
  rowindex: Number,
79
79
  columnName: String,
80
+ columnGroupId: String,
80
81
  isOperationalColumn: {
81
82
  type: Boolean,
82
83
  default: false
@@ -141,10 +142,10 @@ function clickHandler(ev) {
141
142
  video.value.pause();
142
143
  }
143
144
  visible.value = !visible.value;
144
- emit('click', props.router, props.rowData, props.rowindex, visible.value, props.columnName);
145
+ emit('click', props.router, props.rowData, props.rowindex, visible.value, props.columnName,props.columnGroupId);
145
146
  }
146
147
  else {
147
- emit('click', props.router, props.rowData, props.rowindex, null, props.columnName);
148
+ emit('click', props.router, props.rowData, props.rowindex, null, props.columnName, props.columnGroupId);
148
149
  }
149
150
  labelColor.value = 'mazarine'
150
151
 
@@ -4,7 +4,7 @@ import request from '../../utils/request';
4
4
  import Router from './Router';
5
5
 
6
6
  function loadSearchTableApi(action, callBack, searchModel, flagSearch, defaultSearchData, postThenHandler, searchAction) {
7
- var apiData = searchModel?.searchData ? searchModel.searchData : {};
7
+ var apiData = searchModel?.searchData ? searchModel.searchData : {};
8
8
 
9
9
  request.postHandler(common.globalUri(), {
10
10
  action: action,
@@ -18,7 +18,7 @@ function loadSearchTableApi(action, callBack, searchModel, flagSearch, defaultSe
18
18
  }).then(
19
19
  function (response) {
20
20
  if (response.rtnCode === Enum.ReturnCode.Successful) {
21
- let rtn = loadSearchTableModel(response, searchModel, defaultSearchData, action, searchAction);
21
+ let rtn = loadSearchTableModel(response, searchModel, defaultSearchData, action, searchAction);
22
22
  if (callBack) {
23
23
  callBack(rtn);
24
24
  }
@@ -32,7 +32,7 @@ function loadSearchTableApi(action, callBack, searchModel, flagSearch, defaultSe
32
32
  );
33
33
  }
34
34
  function loadSearchTableModel(source, searchModel, defaultSearchData, action, searchAction) {
35
- let rtn = {
35
+ let rtn = {
36
36
  formData: {
37
37
  formTable: null,
38
38
  execRouter(routerKey) {
@@ -64,6 +64,7 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
64
64
  toolbarKey: 0,
65
65
  downloadUrl: '',
66
66
  _scripts: null,
67
+ OriginalColumns:JSON.parse(JSON.stringify(source.content.columns)),
67
68
  get scripts() {
68
69
  if (rtn._scripts !== null) {
69
70
  return rtn._scripts;
@@ -262,7 +263,7 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
262
263
  get parameterAction() {
263
264
  return source.content.parameterAction;
264
265
  },
265
- get multiRowSpan(){
266
+ get multiRowSpan() {
266
267
  if (this.isMergeTitle) {
267
268
  if (typeof source.content.columns !== 'undefined') {
268
269
  return source.content.columns.reduce((max, item) => Math.max(max, item.rowSpan), -Infinity);
@@ -449,6 +450,9 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
449
450
  get rowspan() {
450
451
  return v.rowSpan || 1;
451
452
  },
453
+ get groupId() {
454
+ return v.groupId;
455
+ },
452
456
  get colspan() {
453
457
  return v.colSpan || 1;
454
458
  },
@@ -504,8 +508,15 @@ function loadSearchTableModel(source, searchModel, defaultSearchData, action, se
504
508
  }
505
509
 
506
510
  if (col.width) {
507
- styleObj["width"] = col.width + 'px'; //列宽
508
- styleObj["min-width"] = col.width + 'px'; //列宽
511
+ if (col.width == 'auto') {
512
+ styleObj["width"] = col.width; //列宽
513
+ styleObj["min-width"] = col.width; //列宽
514
+ }
515
+ else {
516
+ styleObj["width"] = col.width + 'px'; //列宽
517
+ styleObj["min-width"] = col.width + 'px'; //列宽
518
+ }
519
+
509
520
  }
510
521
  if (col.paramName == 'drag') {
511
522
  styleObj["cursor"] = 'move';
@@ -787,7 +798,8 @@ function apiData(model, callback) {
787
798
  if (typeof response.page.flagMoreData !== 'undefined') {
788
799
  model.flagMoreData = response.page.flagMoreData;
789
800
  }
790
- if (response.content.updateTableColumns && response.page.pageIndex <= 1) {
801
+ if (response.content.updateTableColumns && response.page.pageIndex <= 1
802
+ &&JSON.stringify(model.OriginalColumns) !== JSON.stringify(response.content.columns)) {
791
803
  model.columns = response.content.columns;
792
804
  if (model.template) {
793
805
  // var tempLoader = template.loader(model.template).default;
@@ -1024,7 +1036,9 @@ function getCurrentRowApiData(model, callback, rtnData, router) {
1024
1036
  if (typeof response.content.bottomText !== 'undefined') {
1025
1037
  model.listFooter = response.content.bottomText;
1026
1038
  }
1027
- if (response.content.updateTableColumns && response.page.pageIndex <= 1) {
1039
+ if (response.content.updateTableColumns && response.page.pageIndex <= 1
1040
+ &&JSON.stringify(model.OriginalColumns) !== JSON.stringify(response.content.columns)
1041
+ ) {
1028
1042
  model.columns = response.content.columns;
1029
1043
  if (model.template) {
1030
1044
  // var tempLoader = template.loader(model.template).default;
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.13:7070/onecard-api/",
24
+ //baseUrl: "http://10.88.22.13:7070/onecard-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/",
28
- //baseUrl: "http://10.88.22.66:6060/xian/",
28
+ baseUrl: "http://10.88.22.66/IBS.Mvc/api/",
29
29
  //baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
30
30
  //baseUrl: "http://10.1.245.111:38028/",
31
31
 
@@ -65,10 +65,10 @@ app.use(centaline, {
65
65
  //获取请求头
66
66
  getRequestHeaders: function () {
67
67
  return {
68
- authobject: '{token:"jiangzf-1968847679618506752",platform:"WEB"}',
68
+ //authobject: '{token:"jiangzf-1977901360645029888",platform:"WEB"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
70
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
71
- //authObject: '{token:"1-90f7df2c-fba7-4ea0-8874-aa7202034f06"}',
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"}',
72
72
  };
73
73
  },
74
74
  getToken() {
@@ -662,68 +662,54 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
662
662
  });
663
663
  }
664
664
  else {
665
- if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
666
- if (field.action.indexOf(".zip") > -1) {
667
- window.location.href = encodeURI(field.action);
668
- }
669
- else {
670
- if (field.action.indexOf("?") > -1) {
671
- model.$vue.downloadUrl = field.action + "&" + Math.random();
672
- }
673
- else {
674
- model.$vue.downloadUrl = field.action + "?" + Math.random();
675
- }
676
- }
665
+
666
+ field.loading = true;
667
+ if (!field.flagAlert && field.content) {
668
+ common.message(field.content, 'info', 1500, true)
677
669
  }
678
- else {
679
- field.loading = true;
680
- if (!field.flagAlert && field.content) {
681
- common.message(field.content, 'info', 1500, true)
682
- }
683
- field.doBlobAction(submitData, (data, headers) => {
684
- field.loading = false;
685
- if (data.type == "application/json") {
686
- const reader = new FileReader();
687
- reader.readAsText(data, 'utf-8');
688
- reader.onload = function () {
689
- data = JSON.parse(reader.result);
690
- if (data.content) {
691
- if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
692
- if (data.content.indexOf(".zip") > -1) {
693
- window.location.href = encodeURI(data.action);
670
+ field.doBlobAction(submitData, (data, headers) => {
671
+ field.loading = false;
672
+ if (data.type == "application/json") {
673
+ const reader = new FileReader();
674
+ reader.readAsText(data, 'utf-8');
675
+ reader.onload = function () {
676
+ data = JSON.parse(reader.result);
677
+ if (data.content) {
678
+ if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
679
+ if (data.content.indexOf(".zip") > -1) {
680
+ window.location.href = encodeURI(data.action);
681
+ }
682
+ else {
683
+ if (data.content.indexOf("?") > -1) {
684
+ model.$vue.downloadUrl = data.content + "&" + Math.random();
694
685
  }
695
686
  else {
696
- if (data.content.indexOf("?") > -1) {
697
- model.$vue.downloadUrl = data.content + "&" + Math.random();
698
- }
699
- else {
700
- model.$vue.downloadUrl = data.content + "?" + Math.random();
701
- }
687
+ model.$vue.downloadUrl = data.content + "?" + Math.random();
702
688
  }
703
689
  }
704
- else {
705
- }
706
690
  }
707
- };
708
- }
709
- else {
710
- if (!headers['content-disposition']) {
711
- common.message('返回结果headers必须包含Access-Control-Expose-Headers和Content-Disposition!', 'error')
712
- return false;
691
+ else {
692
+ }
713
693
  }
714
-
715
- let blob = new Blob([data], { type: "application/octet-stream;" })
716
- const url = window.URL.createObjectURL(blob);
717
- const link = document.createElement('a');
718
- let fileName = decodeURIComponent(escape(headers['content-disposition'].split('filename=')[1]));
719
- link.href = url;
720
- link.setAttribute('download', fileName);
721
- document.body.appendChild(link);
722
- link.click();
723
- document.body.removeChild(link);
694
+ };
695
+ }
696
+ else {
697
+ if (!headers['content-disposition']) {
698
+ common.message('返回结果headers必须包含Access-Control-Expose-Headers和Content-Disposition!', 'error')
699
+ return false;
724
700
  }
725
- });
726
- }
701
+
702
+ let blob = new Blob([data], { type: "application/octet-stream;" })
703
+ const url = window.URL.createObjectURL(blob);
704
+ const link = document.createElement('a');
705
+ let fileName = decodeURIComponent(escape(headers['content-disposition'].split('filename=')[1]));
706
+ link.href = url;
707
+ link.setAttribute('download', fileName);
708
+ document.body.appendChild(link);
709
+ link.click();
710
+ document.body.removeChild(link);
711
+ }
712
+ });
727
713
  }
728
714
  }
729
715
  else if (field.isOpenForm) {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div id="app-search" style="width:100%;height:100%;position: fixed;">
3
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/ReportPersonAttendanceList/getLayoutOfSearch'"
4
- :searchDataApi="'/ReportPersonAttendanceList/getListOfSearchModel'"></ct-searchlist>
3
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'http://10.88.22.13:7070/onecard-api/EmployeeWorkLogList/getLayoutOfSearch'"
4
+ :searchDataApi="'http://10.88.22.13:7070/onecard-api/EmployeeWorkLogList/getListOfSearchModel'"></ct-searchlist>
5
5
 
6
6
  <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
7
7
  :searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->