centaline-data-driven 1.4.7 → 1.4.9

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.
@@ -104,7 +104,7 @@
104
104
  model: null,
105
105
  foucus: false,
106
106
  itemKey: Math.random(),
107
- tableColumnWith: 0
107
+ tableColumnWith: 0
108
108
  }
109
109
  },
110
110
  created() {
@@ -233,6 +233,7 @@
233
233
  fd.$forceUpdate();
234
234
  }
235
235
  });
236
+ self.itemKey = Math.random();
236
237
  });
237
238
  },
238
239
  fieldsValidExcute() {
@@ -375,23 +376,23 @@
375
376
 
376
377
  return sums;
377
378
  },
378
- // 表头部重新渲染
379
- renderHeader(h, { column, $index }) {
380
- // 新建一个 span
381
- let span = document.createElement('span');
382
- // 设置表头名称
383
- span.innerText = column.label;
384
- span.style.whiteSpace = 'nowrap';
385
- span.style.width = 'auto';
386
- // 临时插入 document
387
- document.body.appendChild(span);
388
- // 重点:获取 span 最小宽度,设置当前列,注意这里加了 10,字段较多时还是有挤压,且渲染后的 div 内左右 padding 都是 5,所以 +10 。(可能还有边距/边框等值,需要根据实际情况加上)
389
- column.minWidth = span.getBoundingClientRect().width + 10;
390
- this.tableColumnWith = column.minWidth
391
- // 移除 document 中临时的 span
392
- document.body.removeChild(span);
393
- return h('span', column.label);
394
- }
379
+ // 表头部重新渲染
380
+ renderHeader(h, { column, $index }) {
381
+ // 新建一个 span
382
+ let span = document.createElement('span');
383
+ // 设置表头名称
384
+ span.innerText = column.label;
385
+ span.style.whiteSpace = 'nowrap';
386
+ span.style.width = 'auto';
387
+ // 临时插入 document
388
+ document.body.appendChild(span);
389
+ // 重点:获取 span 最小宽度,设置当前列,注意这里加了 10,字段较多时还是有挤压,且渲染后的 div 内左右 padding 都是 5,所以 +10 。(可能还有边距/边框等值,需要根据实际情况加上)
390
+ column.minWidth = span.getBoundingClientRect().width + 10;
391
+ this.tableColumnWith = column.minWidth
392
+ // 移除 document 中临时的 span
393
+ document.body.removeChild(span);
394
+ return h('span', column.label);
395
+ }
395
396
  }
396
397
  }
397
398
  </script>
@@ -1,46 +1,46 @@
1
1
  <template>
2
2
  <div style="width: 100%" class="ct-searchtable" ref="searchTable"
3
- :style="{ 'margin-top': isLayout ? '0' : '', padding: isLayout ? '0' : '' }">
3
+ :style="{ 'margin-top': isLayout ? '0' : '', padding: isLayout ? '0' : '' }">
4
4
  <ct-tableStats ref="tableStats" class="ct-search-table-list-header" v-if="!isLoading && model && searchStatsApi"
5
- :api="searchStatsApi" @searchStats="searchStats" @setTableHeight="setTableHeight"
6
- :searchModel="model.searchModel">
5
+ :api="searchStatsApi" @searchStats="searchStats" @setTableHeight="setTableHeight"
6
+ :searchModel="model.searchModel">
7
7
  </ct-tableStats>
8
8
 
9
9
  <ct-tabletoolbar ref="toolbar" v-if="!isLoading && model && model.buttons" :buttons="model.buttons"
10
- :key="model.toolbarKey" @click="toolbarClickHandler($event)" @importComplete="importComplete"
11
- :optionApi="model.optionApi" :searchModel="model.searchModel">
10
+ :key="model.toolbarKey" @click="toolbarClickHandler($event)" @importComplete="importComplete"
11
+ :optionApi="model.optionApi" :searchModel="model.searchModel">
12
12
  </ct-tabletoolbar>
13
13
 
14
14
  <ct-tabletip ref="listHeader" class="ct-search-table-list-header ct-search-table-tag" :tip="model.listHeader"
15
- v-if="!isLoading && model"></ct-tabletip>
15
+ v-if="!isLoading && model"></ct-tabletip>
16
16
 
17
17
  <div v-loading="tableLoading" v-if="!isLoading && model"
18
- :style="{ height: '0px', top: model.tableHeight * 0.55 + 'px' }"></div>
18
+ :style="{ height: '0px', top: model.tableHeight * 0.55 + 'px' }"></div>
19
19
  <div v-loading="operationLoading"></div>
20
20
 
21
21
  <div class="ct-tableParent" ref="tableParent" v-bind="model.attrs" v-if="!isLoading && model"
22
- :style="{ height: from == 'form' ? '100%' : model.tableHeight + 'px', 'border-bottom': isLayout ? 'none' : '', 'border-top': isLayout ? 'none' : '', }"
23
- @scroll="scrollHandle($event)" :v-focus="model.flagFocus" @keydown.up="rowKeyDownHandle($event, 0)"
24
- @keydown.down="rowKeyDownHandle($event, 1)" tabindex="-1">
22
+ :style="{ height: from == 'form' ? '100%' : model.tableHeight + 'px', 'border-bottom': isLayout ? 'none' : '', 'border-top': isLayout ? 'none' : '', }"
23
+ @scroll="scrollHandle($event)" :v-focus="model.flagFocus" @keydown.up="rowKeyDownHandle($event, 0)"
24
+ @keydown.down="rowKeyDownHandle($event, 1)" tabindex="-1">
25
25
  <div class="ct-table-content" v-if="!isLayout">
26
26
  <table border="0" cellpadding="0" cellspacing="0"
27
- :class="['ct-table', model.attrs.size ? 'ct-table-' + model.attrs.size : '',]">
27
+ :class="['ct-table', model.attrs.size ? 'ct-table-' + model.attrs.size : '',]">
28
28
  <!--表头-->
29
29
  <thead ref="tableHead" class="right-no-fixation-th">
30
30
  <tr class="ct-tr" ref="headTr" v-for="(columns, columnsIndex) in model.columnsArr" :key="columnsIndex">
31
31
  <th v-if="model.isMulti && columnsIndex === 0" ref="headLeftThs"
32
- class="ct-td left-fixation-th checkbox-td" :class="[model.tdClass]">
32
+ class="ct-td left-fixation-th checkbox-td" :class="[model.tdClass]">
33
33
  <label class="el-checkbox">
34
34
  <span class="el-checkbox__input" :class="model.selectAllType">
35
35
  <span class="el-checkbox__inner"></span>
36
36
  <input type="checkbox" @click="selectAll($event)" v-model="model.selectAll"
37
- class="el-checkbox__original checkbox-td-1" aria-hidden="false" />
37
+ class="el-checkbox__original checkbox-td-1" aria-hidden="false" />
38
38
  </span>
39
39
  </label>
40
40
  </th>
41
41
  <th :ref="column.fixed ? column.fixed === 'left' ? 'headLeftThs' : 'headRightThs' : 'headThs'"
42
- v-for="(column, colIndex) in columns" :key="colIndex" v-if="column.show" class="ct-td ct-searchtable-th"
43
- :rowspan="column.rowspan" :colspan="column.colspan" :class="[colHasWidth[colIndex], column.sortAction, model.tdClass,
42
+ v-for="(column, colIndex) in columns" :key="colIndex" v-if="column.show" class="ct-td ct-searchtable-th"
43
+ :rowspan="column.rowspan" :colspan="column.colspan" :class="[colHasWidth[colIndex], column.sortAction, model.tdClass,
44
44
  colIndex === leftShadow ? 'shadowLeft' : null,
45
45
  colIndex === rightShadow ? 'shadowRight' : null,
46
46
  column.fixed === 'left' ? 'left-fixation-th' : null,
@@ -48,42 +48,42 @@
48
48
  column.width === undefined ? 'ct-table-auto' : null,
49
49
  typeof column.fixed === 'undefined' ? 'right-no-fixation-th' : null,
50
50
  ]" @mousemove="thMouseMoveHandle($event)" @mousedown="thMouseDownHandle($event, colIndex)"
51
- v-bind="column.attrs">
51
+ v-bind="column.attrs">
52
52
  <span>{{ column.name }}</span>
53
53
  <span class="caret-wrapper" v-if="column.sort" @click="toSort($event, column)"
54
- @contextmenu.prevent="clearSort($event, column)">
54
+ @contextmenu.prevent="clearSort($event, column)">
55
55
  <i class="sort-caret ascending" @click.left="toSort($event, column, 'asc')"
56
- @contextmenu.prevent="clearSort($event, column)"></i>
56
+ @contextmenu.prevent="clearSort($event, column)"></i>
57
57
  <i class="sort-caret descending" @click.left="toSort($event, column, 'desc')"
58
- @contextmenu.prevent="clearSort($event, column)"></i>
58
+ @contextmenu.prevent="clearSort($event, column)"></i>
59
59
  </span>
60
60
  </th>
61
61
 
62
62
  <!--<th v-if="model.rowRouter.length > 0" class="ct-td tdFiexd" :class="[-1 === rightShadow?'shadowRight':null]" :style="{'min-width':'20px','transform':'translate('+scrollRight+'px, '+scrollTop+'px)'}">
63
- 操作
64
- </th>-->
63
+ 操作
64
+ </th>-->
65
65
  </tr>
66
66
  </thead>
67
67
  <!--表体-->
68
68
  <tbody>
69
69
  <!--可视区域的行数据-->
70
70
  <tr v-for="(row, rowindex) in model.listData" :key="rowindex"
71
- v-if="pageRowMin <= rowindex && rowindex <= pageRowMax" :ref="'rows.' + rowindex"
72
- @click="rowClickHandle($event, rowindex)" class="ct-tr" :style="row.$style">
71
+ v-if="pageRowMin <= rowindex && rowindex <= pageRowMax" :ref="'rows.' + rowindex"
72
+ @click="rowClickHandle($event, rowindex)" class="ct-tr" :style="row.$style">
73
73
  <td v-if="model.isMulti" class="ct-td tdFiexd left-fixation checkbox-td" :class="[model.tdClass]"
74
- align="center">
74
+ align="center">
75
75
  <label v-if="!model.rightMulti || $common.getDataOfUpperLower(row, model.rightMulti) == 1"
76
- class="el-checkbox is-checked">
76
+ class="el-checkbox is-checked">
77
77
  <span class="el-checkbox__input" :class="rowCheckClass(row)">
78
78
  <span class="el-checkbox__inner"></span>
79
79
  <input type="checkbox" v-model="row.$select" @change="selectOne($event)"
80
- class="el-checkbox__original checkbox-td-1" />
80
+ class="el-checkbox__original checkbox-td-1" />
81
81
  </span>
82
82
  </label>
83
83
  </td>
84
84
  <td :ref="column.fixed ? column.fixed === 'left' ? 'headLeftTds' : 'headRightTds' : null"
85
- v-for="(column, colIndex) in model.dataFieldcolumns" :key="colIndex" v-if="tdShow(column, row)"
86
- :rowspan="tdRowspan(column, row)" class="ct-td" :class="[
85
+ v-for="(column, colIndex) in model.dataFieldcolumns" :key="colIndex" v-if="tdShow(column, row)"
86
+ :rowspan="tdRowspan(column, row)" class="ct-td" :class="[
87
87
  colHasWidth[colIndex],
88
88
  model.tdClass,
89
89
  colIndex === leftShadow ? 'shadowLeft' : null,
@@ -94,21 +94,21 @@
94
94
  ]" v-bind="column.attrs">
95
95
  <!--操作列-->
96
96
  <div v-if="column.id === 'operation'" class="div_allinline"
97
- :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'">
97
+ :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'">
98
98
  <ct-tablecurrency v-for="(router, rowRouterIndex) in getRowRouterShow(row)" :key="rowRouterIndex"
99
- :ref="'router' + router.id + rowindex" v-if="!router.rightField || row[router.rightField] == 1"
100
- :isOperationalColumn="true" :rowindex="rowindex" :router="router" :colValue="router.label"
101
- :rowData="row" @click="rolRouterClickHandler">
99
+ :ref="'router' + router.id + rowindex" v-if="!router.rightField || row[router.rightField] == 1"
100
+ :isOperationalColumn="true" :rowindex="rowindex" :router="router" :colValue="router.label"
101
+ :rowData="row" @click="rolRouterClickHandler">
102
102
  </ct-tablecurrency>
103
103
  <el-popover v-if="getRowRouterDisplay(row).length > 0" :ref="'popover' + rowindex"
104
- :append-to-table="option.appendId ? option.appendId : ''" class="Stats-popover"
105
- popper-class="el-popover1" :placement="option.placement ? option.placement : 'left'"
106
- :trigger="option.trigger ? option.trigger : ''">
104
+ :append-to-table="option.appendId ? option.appendId : ''" class="Stats-popover"
105
+ popper-class="el-popover1" :placement="option.placement ? option.placement : 'left'"
106
+ :trigger="option.trigger ? option.trigger : ''">
107
107
  <div class="tab-list" style="border-bottom: none">
108
108
  <ct-tablecurrency v-for="(router, rowRouterIndex) in getRowRouterDisplay(row)"
109
- :key="rowRouterIndex" v-if="!router.rightField || row[router.rightField] == 1"
110
- :isOperationalColumn="true" :isShowImg="false" :rowindex="rowindex" :router="router"
111
- :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
109
+ :key="rowRouterIndex" v-if="!router.rightField || row[router.rightField] == 1"
110
+ :isOperationalColumn="true" :isShowImg="false" :rowindex="rowindex" :router="router"
111
+ :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
112
112
  </ct-tablecurrency>
113
113
  </div>
114
114
  <span :slot="getRowRouterDisplay(row).length > 0 ? 'reference' : ''" class="icon-more"></span>
@@ -116,32 +116,32 @@
116
116
  </div>
117
117
 
118
118
  <ct-tablecurrency v-else-if="column.id === 'voice'" :isShowVoice="true" :router="column.router"
119
- :colValue="column.router.label" :rowindex="rowindex" :rowData="row" @click="rolRouterClickHandler"
120
- :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'">
119
+ :colValue="column.router.label" :rowindex="rowindex" :rowData="row" @click="rolRouterClickHandler"
120
+ :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'">
121
121
  </ct-tablecurrency>
122
122
 
123
123
  <!--可点击的列-->
124
124
  <ct-tablecurrency v-else-if="column.router" :ref="'router' + column.router.id + rowindex"
125
- :rowindex="rowindex" :align="column.attrs.align"
126
- :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :router="column.router"
127
- :colValue="row[column.id]" :rowData="row" @click="rolRouterClickHandler">
125
+ :rowindex="rowindex" :align="column.attrs.align"
126
+ :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :router="column.router"
127
+ :colValue="row[column.id]" :rowData="row" @click="rolRouterClickHandler">
128
128
  </ct-tablecurrency>
129
129
 
130
130
  <!--正常的列-->
131
131
  <div v-else-if="column.flagHtml" v-html="row[column.id]"
132
- :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :style="column.style ? column.style : ''">
132
+ :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :style="column.style ? column.style : ''">
133
133
  </div>
134
134
  <div v-else-if="typeof column.template === 'undefined'"
135
- :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :style="column.style ? column.style : ''">
135
+ :class="column.autoRowHeight ? 'lineFeedCell' : 'cell'" :style="column.style ? column.style : ''">
136
136
  {{ $common.getDataOfUpperLower(row, column.id) }}
137
137
  </div>
138
138
 
139
139
  <!--模版列(启用)-->
140
140
  <!--<component v-else :is="column.template(row).component" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :vmodel="column.template(row)" :style="{'width': column.width + 'px'}">
141
- <template slot="value">
142
- {{row[column.id]}}
143
- </template>
144
- </component>-->
141
+ <template slot="value">
142
+ {{row[column.id]}}
143
+ </template>
144
+ </component>-->
145
145
  </td>
146
146
  </tr>
147
147
  <!--适配滚动条-->
@@ -152,22 +152,25 @@
152
152
  <div v-else>
153
153
  <div v-for="(row, rowindex) in model.listData" :key="rowindex">
154
154
  <ct-layout :ref="'layout' + rowindex" :vmodel="row" :cellLayout="model.cellLayout" :key="tableComplate"
155
- :rowindex="rowindex" :actionRouter="model.actionRouter" @click="rolRouterCellClickHandler">
155
+ :rowindex="rowindex" :actionRouter="model.actionRouter" @click="rolRouterCellClickHandler">
156
156
  </ct-layout>
157
157
  </div>
158
158
  </div>
159
159
  </div>
160
160
 
161
161
  <ct-tabletip ref="listFooter" class="ct-search-table-list-footer" :tip="model.listFooter"
162
- v-if="!isLoading && !isLayout && model"></ct-tabletip>
162
+ v-if="!isLoading && !isLayout && model"></ct-tabletip>
163
163
  <ct-tabletip ref="footer" class="ct-search-table-footer" :tip="model.footer"
164
- v-if="!isLoading && !isLayout && model"></ct-tabletip>
164
+ v-if="!isLoading && !isLayout && model"></ct-tabletip>
165
165
  <div ref="popupButton" v-if="flagPopupSearchlist"
166
- style="margin-top: 10px;width: 100%;display: inline-block;height: 30px;margin-bottom: 10px;">
167
- <el-button size="mini" @click="popupClickHandler()" class="max-search-btn" style="float:right;" type="primary">确认
166
+ style="margin-top: 10px;width: 100%;display: inline-block;height: 30px;margin-bottom: 10px;">
167
+ <el-button size="mini" @click="popupClickHandler()" class="max-search-btn" style="float:right;" type="primary">
168
+ 确认
168
169
  </el-button>
169
170
  </div>
170
171
  <div v-if="isLoading && searchLoading" v-loading="isLoading" style="top: 30px"></div>
172
+ <iframe :src="downloadUrl" style="height:0px;width:0px">
173
+ </iframe>
171
174
  </div>
172
175
  </template>
173
176
  <script>
@@ -246,6 +249,8 @@ export default {
246
249
  trigger: "hover", //触发方式,传值可查看Popper UI组件trigger属性
247
250
  placement: "right-start", //方向,传值可查看Popper UI组件placement属性
248
251
  },
252
+ downloadUrl:""
253
+
249
254
  };
250
255
  },
251
256
  activated() {
@@ -973,8 +978,12 @@ export default {
973
978
  }
974
979
  else {
975
980
  if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
976
- var tempwindow = window.open('about:blank');
977
- tempwindow.location = field.action;
981
+ if (field.action.indexOf("?") > -1) {
982
+ self.downloadUrl = field.action + "&" + Math.random();
983
+ }
984
+ else {
985
+ self.downloadUrl = field.action + "?" + Math.random();
986
+ }
978
987
  // document.body.addEventListener('click', function() {
979
988
  // window.open(field.action, "_blank");
980
989
  // });
@@ -983,8 +992,12 @@ export default {
983
992
  field.doAction(submitData, (data) => {
984
993
  if (data.content) {
985
994
  if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
986
- var tempwindow = window.open('about:blank');
987
- tempwindow.location = data.content;
995
+ if (data.content.indexOf("?") > -1) {
996
+ self.downloadUrl = data.content + "&" + Math.random();
997
+ }
998
+ else {
999
+ self.downloadUrl = data.content + "?" + Math.random();
1000
+ }
988
1001
  // document.body.addEventListener('click', function() {
989
1002
  // window.open(data.content, "_blank");
990
1003
  // });
@@ -32,7 +32,7 @@
32
32
  </el-menu>
33
33
  </div>
34
34
  </el-aside>
35
- <el-main ref="displayArea">
35
+ <el-main ref="displayArea" v-loading="downloadLoading" element-loading-spinner="el-icon-loading" :element-loading-custom-class="'cloading'">
36
36
  <div style="position: relative; width: 100%"
37
37
  :style="{ height: displayAreaHeight - 78 + 'px' }"
38
38
  v-if="resultObject">
@@ -141,17 +141,27 @@
141
141
  @click="zoom(-0.2)">
142
142
  </a>
143
143
  </template>
144
- <a v-if="itemFile.rightDownload"
145
- :href="resultObject.replace(/\/preview$/,'/download')" target="_blank"
144
+ <!--<a v-if="itemFile.rightDownload"
145
+ :href="getDownloadUrl(resultObject)" target="_blank"
146
+ class="magnify-btn el-icon-download"
147
+ title="下载"
148
+ :download="(itemFile.mediaLabelName || itemFile.fileName)"
149
+ @click="handDownload(resultObject)"
150
+ ></a>-->
151
+ <a href="javascript:void(0)"
146
152
  class="magnify-btn el-icon-download"
147
153
  title="下载"
148
- :download="(itemFile.mediaLabelName || itemFile.fileName)"></a>
154
+ @click="handDownload(resultObject)"></a>
155
+
156
+
149
157
  </div>
150
158
  </div>
151
159
  </template>
152
160
  </div>
153
161
  </el-main>
154
162
  </el-container>
163
+ <iframe :src="downloadUrl" style="height:0px;width:0px">
164
+ </iframe>
155
165
  </div>
156
166
  </template>
157
167
 
@@ -188,6 +198,8 @@
188
198
  displayAreabtm: 0,
189
199
  displayArealeft: 0,
190
200
  displayAreaHeight: 0,
201
+ downloadUrl: "",
202
+ downloadLoading: false
191
203
  };
192
204
  },
193
205
  created() {
@@ -225,6 +237,31 @@
225
237
  }
226
238
  },
227
239
  methods: {
240
+ getDownloadUrl(url) {
241
+ if (/\/viewer\//.test(url)) {
242
+ return url.replace(/\/viewer\//, '/download/');
243
+ }
244
+ else if (/\/preview$/.test(url)) {
245
+ return url.replace(/\/preview$/, '/download');
246
+ }
247
+ else {
248
+ return url;
249
+ }
250
+ },
251
+ handDownload(url) {
252
+ let self = this;
253
+ self.downloadLoading = true;
254
+ if (url.indexOf("?") > -1) {
255
+ self.downloadUrl = self.getDownloadUrl(url) + "&" + Math.random();
256
+ }
257
+ else {
258
+ self.downloadUrl = self.getDownloadUrl(url) + "?" + Math.random();
259
+ }
260
+ setTimeout(function () {
261
+ self.downloadLoading = false;
262
+ }, 1000);
263
+
264
+ },
228
265
  handleMouse(e) {
229
266
  e.preventDefault();
230
267
  },
@@ -437,4 +474,8 @@
437
474
  .viewerMenu .el-submenu__title .el-submenu__icon-arrow {
438
475
  display: inline-block;
439
476
  }
477
+ .cloading {
478
+ font-size: 50px;
479
+ }
480
+
440
481
  </style>
@@ -43,7 +43,7 @@ const box = function (source, fileSourceList, router, optionApi) {
43
43
  if (!fileSourceList) {
44
44
  return 0;
45
45
  }
46
- let fileList = fileSourceList.filter(item=>{
46
+ let fileList = fileSourceList.filter(item => {
47
47
  return item.flagDeleted != true
48
48
  })
49
49
  return fileList.length;
@@ -62,7 +62,7 @@ const box = function (source, fileSourceList, router, optionApi) {
62
62
  },
63
63
  optionModel: {
64
64
  options: [],
65
- isInit:false,
65
+ isInit: false,
66
66
  optionAttrs: {
67
67
  value: 'code',
68
68
  label: 'name'
@@ -71,7 +71,7 @@ const box = function (source, fileSourceList, router, optionApi) {
71
71
  //简单分类
72
72
  getOptions(callBack) {
73
73
  var self = this;
74
- if(!source.paramName1){
74
+ if (!source.paramName1) {
75
75
  return false;
76
76
  }
77
77
  if (self.optionModel.isInit) {
@@ -114,7 +114,7 @@ const box = function (source, fileSourceList, router, optionApi) {
114
114
  component: 'ct-form',
115
115
  attrs: {
116
116
  api: source.paramAction1,//source.xx
117
- showTitle:false,
117
+ showTitle: false,
118
118
  apiParam: file.mediaFormData,
119
119
  width: router.pageWidth + 'px',
120
120
  height: router.pageHeight + 'px',
@@ -181,7 +181,7 @@ const box = function (source, fileSourceList, router, optionApi) {
181
181
  },
182
182
  get flagDefault() {
183
183
  return fileSource.flagDefault;
184
- },
184
+ },
185
185
  get rightDel() {
186
186
  return fileSource.rightDel;
187
187
  },
@@ -243,7 +243,7 @@ const box = function (source, fileSourceList, router, optionApi) {
243
243
  Vue.set(file, "mediaUrl", data.mediaUrl);
244
244
  Vue.set(file, "fileName", data.fileName);
245
245
  Vue.set(file, "flagDefault", data.flagDefault);
246
- Vue.set(file, "mediaTypeID", data.mediaTypeID);
246
+ Vue.set(file, "mediaTypeID", data.mediaTypeID);
247
247
  Vue.set(file, "flagDeleted", data.flagDeleted);
248
248
  Vue.set(file, "actionType", data.actionType);
249
249
  Vue.set(file, "rightDel", data.rightDel);
@@ -260,18 +260,40 @@ const box = function (source, fileSourceList, router, optionApi) {
260
260
  }
261
261
  else {
262
262
  for (let i = 0; i < fileList.length; i++) {
263
- if (fileList[i].uid === file.uid) {
263
+ if (fileList[i].uid === file.uid) {
264
264
  fileList.splice(i, 1);
265
265
  }
266
266
  }
267
267
  Vue.prototype.$message.error(res.rtnMsg);
268
268
  }
269
269
  },
270
+ addfileItem(file) {
271
+ let awaitfile = {
272
+ "url": "",
273
+ "source": {},
274
+ "mediaUrl": "",
275
+ "fileName": "",
276
+ "flagDefault": "",
277
+ "mediaTypeID": "",
278
+ "flagDeleted": "",
279
+ "actionType": "",
280
+ "rightDel": "",
281
+ "rightEdit": "",
282
+ "rightDownload": "",
283
+ "mediaLabelID": "",
284
+ "mediaLabelName": "",
285
+ "fileExtension": "",
286
+ "progressFlag": true,
287
+ "loadProgress": 0,
288
+ "uid": file.uid,
289
+ }
290
+ rtn.fileList.push(awaitfile);
291
+ },
292
+
270
293
  setByPieces(res, Progress, file) {
271
294
  if (res.rtnCode === Enum.ReturnCode.Successful) {
272
295
  //下面的方式绑定,会有一些问题 todo 不强与页面关联
273
-
274
-
296
+ var data = {};
275
297
  if (res.content.finished == 1) {
276
298
  //下面的方式绑定,会有一些问题 todo 不强与页面关联
277
299
  fileSourceList.push(res.content.media);
@@ -279,6 +301,24 @@ const box = function (source, fileSourceList, router, optionApi) {
279
301
  data = rtn.getFileData(res.content.media);
280
302
  data.progressFlag = false;
281
303
  data.loadProgress = 100;
304
+
305
+ Vue.set(file, "url", data.url);
306
+ Vue.set(file, "source", data.source);
307
+ Vue.set(file, "mediaUrl", data.mediaUrl);
308
+ Vue.set(file, "fileName", data.fileName);
309
+ Vue.set(file, "flagDefault", data.flagDefault);
310
+ Vue.set(file, "mediaTypeID", data.mediaTypeID);
311
+ Vue.set(file, "flagDeleted", data.flagDeleted);
312
+ Vue.set(file, "actionType", data.actionType);
313
+ Vue.set(file, "rightDel", data.rightDel);
314
+ Vue.set(file, "rightEdit", data.rightEdit);
315
+ Vue.set(file, "rightDownload", data.rightDownload);
316
+ Vue.set(file, "mediaLabelID", data.mediaLabelID);
317
+ Vue.set(file, "mediaLabelName", data.mediaLabelName);
318
+ Vue.set(file, "fileExtension", data.fileExtension);
319
+
320
+ Vue.set(file, "progressFlag", data.progressFlag);
321
+ Vue.set(file, "loadProgress", data.loadProgress);
282
322
  }
283
323
  else {
284
324
  data.progressFlag = true;
@@ -287,25 +327,6 @@ const box = function (source, fileSourceList, router, optionApi) {
287
327
  let i = this.fileList.findIndex(v => v.uid === file.uid);
288
328
  if (i === -1) return;
289
329
 
290
- Vue.set(file, "url", data.url);
291
- Vue.set(file, "source", data.source);
292
- Vue.set(file, "mediaUrl", data.mediaUrl);
293
- Vue.set(file, "fileName", data.fileName);
294
- Vue.set(file, "flagDefault", data.flagDefault);
295
- Vue.set(file, "mediaTypeID", data.mediaTypeID);
296
- Vue.set(file, "flagDeleted", data.flagDeleted);
297
- Vue.set(file, "actionType", data.actionType);
298
- Vue.set(file, "rightDel", data.rightDel);
299
- Vue.set(file, "rightEdit", data.rightEdit);
300
- Vue.set(file, "rightDownload", data.rightDownload);
301
- Vue.set(file, "mediaLabelID", data.mediaLabelID);
302
- Vue.set(file, "mediaLabelName", data.mediaLabelName);
303
- Vue.set(file, "fileExtension", data.fileExtension);
304
-
305
- Vue.set(file, "progressFlag", false);
306
- Vue.set(file, "loadProgress", 100);
307
-
308
-
309
330
  Vue.set(rtn.fileList, i, {
310
331
  url: data.url,
311
332
  source: data.source,
@@ -9,6 +9,13 @@ async function postFile(api, data, callback) {
9
9
  }
10
10
  else if (xhr.readyState === 4 && (xhr.status === 0 || xhr.status >= 400)) {
11
11
  var rtn = xhr.responseText || xhr.statusText;
12
+ if (rtn == "") {
13
+ if (xhr.status === 0) {
14
+ rtn = "网络请求失败:" + api;
15
+ } else {
16
+ rtn = "status:" + xhr.status;
17
+ }
18
+ }
12
19
  callback(xhr, rtn);
13
20
  }
14
21
  }
@@ -17,7 +24,7 @@ async function postFile(api, data, callback) {
17
24
 
18
25
  //分片上传
19
26
  const uploadByPieces = async (url, { file }, callback, uploadOptions) => {
20
- var uploadData = { blockSize: 0.5 * 1024 * 1024, nextOffSet: 0 };
27
+ var uploadData = { blockSize: 1 * 218 * 1024, nextOffSet: 0 };
21
28
  // 获取当前chunk数据
22
29
  const getChunkInfo = (file, data) => {
23
30
  let start = data.nextOffSet;
@@ -4,6 +4,8 @@
4
4
  <el-progress type="circle" :percentage="percentage"></el-progress>
5
5
  <span class="progressMsg">{{ message }}</span>
6
6
  </div>
7
+ <iframe :src="downloadUrl" style="height:0px;width:0px">
8
+ </iframe>
7
9
  </div>
8
10
  </template>
9
11
  <script>
@@ -23,6 +25,7 @@
23
25
  message: '',
24
26
  percentage: 0,
25
27
  isDestroy: false,
28
+ downloadUrl:"",
26
29
  };
27
30
  },
28
31
  methods: {
@@ -59,8 +62,12 @@
59
62
  this.percentage = data.percentage;
60
63
  if (data.flagFinished) {
61
64
  if(this.progressType=='export' && data.content){
62
- var tempwindow=window.open('about:blank');
63
- tempwindow.location=data.content;
65
+ if (data.content.indexOf("?") > -1) {
66
+ self.downloadUrl = data.content + "&" + Math.random();
67
+ }
68
+ else {
69
+ self.downloadUrl = data.content + "?" + Math.random();
70
+ }
64
71
  // document.body.addEventListener('click', function() {
65
72
  // window.open(data.content, "_blank");
66
73
  // });
package/src/main.js CHANGED
@@ -13,7 +13,7 @@ Vue.use(ElementUI, { size: 'mini'});
13
13
  Vue.config.productionTip = false;
14
14
  Vue.use(centaline, {
15
15
  baseUrl: "http://10.88.22.46:7070/v1/form/router",
16
- // baseUrl: "http://10.25.10.67:9999/v1/form/router",
16
+ // baseUrl: "http://10.25.10.63:9999/v1/form/router",
17
17
  // baseUrl: "http://10.88.22.42:9999/v1/form/router",
18
18
  // baseUrl: "http://10.88.22.39:8080/api/",
19
19
  // baseUrl: "http://tjcptest.centaline.com.cn/",
@@ -43,14 +43,14 @@ Vue.use(centaline, {
43
43
  getRequestHeaders: function () {
44
44
  return {
45
45
  oldToken: '854e91e2-3a5e-42af-a522-c51a0f5c09bc',
46
- token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjEOgkAQRe8yNZMwMDszSycLNh6CuGFJsDICicZ4dzVCR-8rXvGa_58wLREq0BXc0UbnV3BHGx0ReyVp8eA1IAuXaBQMA0vgY9OWoW4gg3S_QkUi6p0WuWYwnudfMM3tG5Yp3U7p8Y9zl3n8zBIPYs4bRjcocuEMPYkh5cZ9ZNeXHOH1BgAA__8.J4WTk1z7IsB5k_3a-fvnnjm6AUgGBRi7Y631pFLVCPo',
46
+ token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjrsOgkAQRf9laiZhdseZWTpdsPEjCMiaYGV4JBrjv6sROnpPcYrT3PuEcW6hAF3ADa3UYQE3tFITcVCSCvdBI7KwR6NoGFkiH8vKx0MJGaT7DQoSMXJBXcigb6ZfyNn7b5jHNJzS4x_nrlP_mc29mjXiselEkHeiaMyKnbizo0toJRm83gAAAP__.78xofT8L8z7miXVcEL3cQjrfiX6nuUdXUZV2ZUahFt8',
47
47
 
48
48
  originalRequestURL: 'http://10.88.22.67:8080',
49
49
  EstateInfo: '{"estateId":"FAF029E8-EC28-4297-83CF-B8FFD826DB91","estateName":"AABBCC"}',
50
50
  estateId: '20210729104021C49F04B55C50F6AF58',
51
51
 
52
- authObject: '{"currentEstate":{},"platform":1,"OSVersion":"","clientVersion":"","machineCode":""}',
53
- Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjcyYzkxMzRlLTc5ODItNDFiYi04NDZjLWRhNmE0YTAwNGUzZSJ9.Dqw228vC10bapkK7Rnz_REvV_1x3igpsmFVHfeSIMFPHkMSpeh6py61NJ7HtkYnTTrSeRr2IjXvH9EoHLH3T3Q',
52
+ authObject: '{"currentEstate":{"estateId":"2209201708108B8F50AB530A49EAA858","estateName":"U%E7%89%88%E6%B5%8B%E8%AF%95%E6%A5%BC%E7%9B%98%E7%82%B9%E4%BD%8D"},"platform":1,"OSVersion":"","clientVersion":"","machineCode":""}',
53
+ Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImViNGU3NDFlLTYwZjEtNGVlMC04YTZlLWU5NjMwYjcyODU0YyJ9.8MyYlz55w4tL8iRmqQyMrq8DbvYSYkf2h8O5ei8UPghAqX3eQzfH233_D9yzU_qFeesjrw_hh8iq3e8J43CEXg',
54
54
  };
55
55
  },
56
56
  // 请求完成事件,可判断是否登录过期执行响应操作