centaline-data-driven-v3 0.1.4 → 0.1.6

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.4",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -20,9 +20,7 @@
20
20
  @refreshParent="refreshParentHandler" @simpleRouterRefreshHandler="simpleRouterRefreshHandler"
21
21
  @closeSideBar="closeSideBar" @popupClickHandler="popupClickHandler" :dragStartItem="dragStartItem"
22
22
  :dragStartName="dragStartName" @loadedError="tableLoadedError"
23
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
24
- @drag="drag"
25
- >
23
+ @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged" @drag="drag">
26
24
  </searchTable>
27
25
  </div>
28
26
  <div ref="refSidebar" v-if="flagSideBar && flagSideBarOfData"
@@ -45,7 +43,7 @@ import SearchCategory from './SearchList/SearchCategory.vue';
45
43
  import SearchSideMenu from './SearchList/SearchSideMenu.vue';
46
44
  import SearchSideRight from './SearchList/SearchSideRight.vue';
47
45
  import { ref, nextTick, onMounted, watch, onActivated, onBeforeUnmount } from 'vue'
48
- const emit = defineEmits(['loaded', 'failLoad', 'tableLoaded', 'scrollHandle', 'rowClickHandle', 'refreshParent', 'submit', 'flagNotificationParentAfterContentChanged','drag'])
46
+ const emit = defineEmits(['loaded', 'failLoad', 'tableLoaded', 'scrollHandle', 'rowClickHandle', 'refreshParent', 'submit', 'flagNotificationParentAfterContentChanged', 'drag'])
49
47
  const props = defineProps({
50
48
  vmodel: Object,
51
49
  parameterAction: String,
@@ -122,8 +120,8 @@ const RefSideRight = ref()
122
120
  const refSideMenu = ref()
123
121
  const flagShow = ref(true)
124
122
  const isLayout = ref(true)
125
- onBeforeUnmount(()=>{
126
- window.removeEventListener('resize',resizeSearchList)
123
+ onBeforeUnmount(() => {
124
+ window.removeEventListener('resize', resizeSearchList)
127
125
  })
128
126
  onMounted(() => {
129
127
  nextTick(() => {
@@ -244,7 +242,9 @@ function tableLoaded() {
244
242
  flagDefaultDisplaySideBar.value = refTable.value.model.flagDefaultDisplaySideBar;
245
243
  isLayout.value = refTable.value.model.isLayout;
246
244
  if (refTable.value.model.rowSelectRouter) {
247
- rowSelectRouter.value = refTable.value.model.rowSelectRouter
245
+ if (sideBarStatus.value == 'open') {
246
+ rowSelectRouter.value = refTable.value.model.rowSelectRouter
247
+ }
248
248
  sideBarPageType.value = refTable.value.model.rowSelectRouter.actionSource;
249
249
  }
250
250
  else {
@@ -288,7 +288,7 @@ function tableLoaded() {
288
288
  emit('loaded', refTable.value.model);
289
289
  }
290
290
  function tableLoadedError() {
291
- pageDisabled.value = false;
291
+ pageDisabled.value = false;
292
292
  }
293
293
  function sideMenuClickHandler(v) {
294
294
  drowerClose.value = v;
@@ -304,6 +304,7 @@ function sideMenuClickHandler(v) {
304
304
  }
305
305
  }
306
306
  else if (v == 'close') {
307
+ rowSelectRouter.value = refTable.value.model.rowSelectRouter;
307
308
  sideBarStatus.value = 'open';
308
309
  sideBarRight.value = 0;
309
310
  sideBarWidth.value = refTable.value.model.sideBarWidth;
@@ -458,8 +459,8 @@ function popupClickHandler(tempListData) {
458
459
  function flagNotificationParentAfterContentChanged() {
459
460
  emit('flagNotificationParentAfterContentChanged');
460
461
  }
461
- function drag(row, column,type) {
462
- emit('drag',row,column,type);
462
+ function drag(row, column, type) {
463
+ emit('drag', row, column, type);
463
464
  }
464
465
  watch(() => props.pageHeight, (value) => {
465
466
  if (props.pageHeight) {
@@ -853,7 +853,9 @@ const Base = function (source, moreActionRouter) {
853
853
  this.code1 = this.defaultCode1 || '';
854
854
  this.code2 = this.defaultCode2 || '';
855
855
  this.name1 = this.defaultName1 || '';
856
-
856
+ if(this.controlType === Enum.ControlType.SearchListBox && this.defaultCode1 && this.defaultName1){
857
+ this.options=[{ value: this.code1, label: this.name1 }]
858
+ }
857
859
  }
858
860
  else {
859
861
  if (this.controlType === Enum.ControlType.DateRange
package/src/main.js CHANGED
@@ -22,7 +22,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
22
22
 
23
23
  app.use(centaline, {
24
24
  //baseUrl:"https://uplink.centaline.com.cn/xian/",
25
- baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
25
+ baseUrl:"http://10.88.22.13:6060/smartclass-api/",
26
26
  //baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
27
27
  //baseUrl: "http://10.88.22.13:6060/onecard-api/",
28
28
  //baseUrl: "http://10.88.22.66:6060/xian/",
@@ -67,8 +67,8 @@ app.use(centaline, {
67
67
  return {
68
68
  //authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
- //authObject: '{token:"1647-1927532276019761152",platform:"WEB"}',
71
- authObject: '{EmpID:"Token_256e18aa-5aeb-4033-9d75-80bbc3dec2c3",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_256e18aa-5aeb-4033-9d75-80bbc3dec2c3",Platform:"WEB"}',
70
+ authObject: '{token:"1-b757dd78-dd0d-4bbb-8bd8-e9a98b8c3d39"}',
71
+ //authObject: '{token:"1-90f7df2c-fba7-4ea0-8874-aa7202034f06"}',
72
72
  };
73
73
  },
74
74
  getToken() {
@@ -546,15 +546,22 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
546
546
  onFinished: (data) => {
547
547
  common.closeDialog(dialogOption);
548
548
  if (field.isExport) {
549
- if (data.content.indexOf(".zip") > -1) {
550
- window.location.href = encodeURI(data.content);
549
+ if (data.content.toLowerCase().indexOf('downloadFileName'.toLowerCase()) > -1) {
550
+ getBlob(data.content).then(blob => {
551
+ downloadFile(blob, getUrlParameter(data.content, 'downloadFileName') + '.' + getExtensionFromUrl(data.content))
552
+ })
551
553
  }
552
554
  else {
553
- if (data.content.indexOf("?") > -1) {
554
- model.$vue.downloadUrl = data.content + "&" + Math.random();
555
+ if (data.content.indexOf(".zip") > -1) {
556
+ window.location.href = encodeURI(data.content);
555
557
  }
556
558
  else {
557
- model.$vue.downloadUrl = data.content + "?" + Math.random();
559
+ if (data.content.indexOf("?") > -1) {
560
+ model.$vue.downloadUrl = data.content + "&" + Math.random();
561
+ }
562
+ else {
563
+ model.$vue.downloadUrl = data.content + "?" + Math.random();
564
+ }
558
565
  }
559
566
  }
560
567
  }
@@ -606,15 +613,22 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
606
613
  onFinished: (data) => {
607
614
  common.closeDialog(dialogOption);
608
615
  if (field.isExport) {
609
- if (data.content.indexOf(".zip") > -1) {
610
- window.location.href = encodeURI(data.content);
616
+ if (data.content.toLowerCase().indexOf('downloadFileName'.toLowerCase()) > -1) {
617
+ getBlob(data.content).then(blob => {
618
+ downloadFile(blob, getUrlParameter(data.content, 'downloadFileName') + '.' + getExtensionFromUrl(data.content))
619
+ })
611
620
  }
612
621
  else {
613
- if (data.content.indexOf("?") > -1) {
614
- model.$vue.downloadUrl = data.content + "&" + Math.random();
622
+ if (data.content.indexOf(".zip") > -1) {
623
+ window.location.href = encodeURI(data.content);
615
624
  }
616
625
  else {
617
- model.$vue.downloadUrl = data.content + "?" + Math.random();
626
+ if (data.content.indexOf("?") > -1) {
627
+ model.$vue.downloadUrl = data.content + "&" + Math.random();
628
+ }
629
+ else {
630
+ model.$vue.downloadUrl = data.content + "?" + Math.random();
631
+ }
618
632
  }
619
633
  }
620
634
  }
@@ -794,10 +808,10 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
794
808
  onSubmit: () => {
795
809
  common.closeDialog(dialogOption.dialog);
796
810
  },
797
- onCloseDialog:()=>{
798
- if (source == 'table') {
799
- model.$vue.updateCurrentRow(field);
800
- }
811
+ onCloseDialog: () => {
812
+ if (source == 'table') {
813
+ model.$vue.updateCurrentRow(field);
814
+ }
801
815
  },
802
816
  isIframe: model.isIframe,
803
817
  },
@@ -992,6 +1006,35 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
992
1006
  }
993
1007
 
994
1008
  }
1009
+ //通过文件下载url拿到对应的blob对象
1010
+ function getBlob(url) {
1011
+ return new Promise(resolve => {
1012
+ const xhr = new XMLHttpRequest()
1013
+ xhr.open('GET', url, true)
1014
+ xhr.responseType = 'blob'
1015
+ xhr.onload = () => {
1016
+ if (xhr.status === 200) {
1017
+ resolve(xhr.response)
1018
+ }
1019
+ }
1020
+
1021
+ xhr.send()
1022
+ })
1023
+ }
1024
+ //下载文件
1025
+ function downloadFile(blob, filename) {
1026
+ var link = document.createElement('a')
1027
+ link.href = window.URL.createObjectURL(blob)
1028
+ link.download = filename
1029
+ link.click()
1030
+ }
1031
+ function getExtensionFromUrl(url) {
1032
+ return url.split('.').pop().split(/#|\?/)[0];
1033
+ }
1034
+ function getUrlParameter(href, name) {
1035
+ const url = new URL(href); // 创建URL对象
1036
+ return url.searchParams.get(name); // 返回查询参数的值,例如 /user?userId=123 中的 userId
1037
+ }
995
1038
 
996
1039
 
997
1040
 
@@ -1,15 +1,14 @@
1
1
  <template>
2
2
  <div id="app-search" style="width:100%;height:100%;position: fixed;">
3
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
3
+ <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
4
4
  :searchDataApi="'/propertyPublishList/getListOfSearchModel'"
5
- :searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist>
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="'/admin/SchoolTeachingPlanResourceList/getLayoutOfSearch'"
8
+ :searchDataApi="'/admin/SchoolTeachingPlanResourceList/getListOfSearchModel'"></ct-searchlist>
9
9
 
10
-
11
- <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/AttendanceClassList/getLayoutOfSearch'"
12
- :searchDataApi="'/AttendanceClassList/getListOfSearchModel'"></ct-searchlist> -->
10
+ <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/OvertimeList/getLayoutOfSearch'"
11
+ :searchDataApi="'/OvertimeList/getListOfSearchModel'"></ct-searchlist> -->
13
12
  <ct-dialoglist ref="dialogList"></ct-dialoglist>
14
13
 
15
14
  </div>