cloud-web-corejs 1.0.54-dev.5 → 1.0.54-dev.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,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.5",
4
+ "version": "1.0.54-dev.6",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -0,0 +1,458 @@
1
+ import XEUtils from 'xe-utils'
2
+ import GlobalConfig from 'vxe-table/lib/v-x-e-table/src/conf'
3
+ import VxeModal from 'vxe-table/lib/modal/src/modal'
4
+ import VxeInput from 'vxe-table/lib/input/src/input'
5
+ import VxeCheckbox from 'vxe-table/lib/checkbox/src/checkbox'
6
+ import VxeSelect from 'vxe-table/lib/select/src/select'
7
+ import VxeOption from 'vxe-table/lib/select/src/option'
8
+ import UtilTools from 'vxe-table/lib/tools/utils'
9
+
10
+ export default {
11
+ name: 'VxeExportPanel',
12
+ props: {
13
+ defaultOptions: Object,
14
+ storeData: Object
15
+ },
16
+ components: {
17
+ VxeModal,
18
+ VxeInput,
19
+ VxeCheckbox,
20
+ VxeSelect,
21
+ VxeOption
22
+ },
23
+ data () {
24
+ return {
25
+ isAll: false,
26
+ isIndeterminate: false,
27
+ loading: false
28
+ }
29
+ },
30
+ computed: {
31
+ vSize () {
32
+ return this.size || this.$parent.size || this.$parent.vSize
33
+ },
34
+ checkedAll () {
35
+ return this.storeData.columns.every(column => column.checked)
36
+ },
37
+ showSheet () {
38
+ return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1
39
+ },
40
+ supportMerge () {
41
+ const { storeData, defaultOptions } = this
42
+ return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1)
43
+ },
44
+ supportStyle () {
45
+ const { defaultOptions } = this
46
+ return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1
47
+ }
48
+ },
49
+ render (h) {
50
+ const { _e, checkedAll, isAll, isIndeterminate, showSheet, supportMerge, supportStyle, defaultOptions, storeData } = this
51
+ const { hasTree, hasMerge, isPrint, hasColgroup } = storeData
52
+ const { isHeader } = defaultOptions
53
+ const cols = []
54
+ XEUtils.eachTree(storeData.columns, column => {
55
+ const colTitle = UtilTools.formatText(column.getTitle(), 1)
56
+ const isColGroup = column.children && column.children.length
57
+ cols.push(
58
+ h('li', {
59
+ class: ['vxe-export--panel-column-option', `level--${column.level}`, {
60
+ 'is--group': isColGroup,
61
+ 'is--checked': column.checked,
62
+ 'is--indeterminate': column.halfChecked,
63
+ 'is--disabled': column.disabled
64
+ }],
65
+ attrs: {
66
+ title: colTitle
67
+ },
68
+ on: {
69
+ click: () => {
70
+ if (!column.disabled) {
71
+ this.changeOption(column)
72
+ }
73
+ }
74
+ }
75
+ }, [
76
+ h('span', {
77
+ class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
78
+ }),
79
+ h('span', {
80
+ class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
81
+ }),
82
+ h('span', {
83
+ class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
84
+ }),
85
+ h('span', {
86
+ class: 'vxe-checkbox--label'
87
+ }, colTitle)
88
+ ])
89
+ )
90
+ })
91
+ return h('vxe-modal', {
92
+ res: 'modal',
93
+ props: {
94
+ value: storeData.visible,
95
+ title: GlobalConfig.i18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
96
+ width: 660,
97
+ mask: true,
98
+ lockView: true,
99
+ showFooter: false,
100
+ escClosable: true,
101
+ maskClosable: true,
102
+ loading: this.loading
103
+ },
104
+ on: {
105
+ input (value) {
106
+ storeData.visible = value
107
+ },
108
+ show: this.showEvent
109
+ }
110
+ }, [
111
+ h('div', {
112
+ class: 'vxe-export--panel'
113
+ }, [
114
+ h('table', {
115
+ attrs: {
116
+ cellspacing: 0,
117
+ cellpadding: 0,
118
+ border: 0
119
+ }
120
+ }, [
121
+ h('tbody', [
122
+ [
123
+ isPrint ? _e() : h('tr', [
124
+ h('td', GlobalConfig.i18n('vxe.export.expName')),
125
+ h('td', [
126
+ h('vxe-input', {
127
+ ref: 'filename',
128
+ props: {
129
+ value: defaultOptions.filename,
130
+ type: 'text',
131
+ clearable: true,
132
+ placeholder: GlobalConfig.i18n('vxe.export.expNamePlaceholder')
133
+ },
134
+ on: {
135
+ modelValue (value) {
136
+ defaultOptions.filename = value
137
+ }
138
+ }
139
+ })
140
+ ])
141
+ ]),
142
+ isPrint ? _e() : h('tr', [
143
+ h('td', GlobalConfig.i18n('vxe.export.expType')),
144
+ h('td', [
145
+ h('vxe-select', {
146
+ props: {
147
+ value: defaultOptions.type
148
+ },
149
+ on: {
150
+ input (value) {
151
+ defaultOptions.type = value
152
+ }
153
+ }
154
+ }, storeData.typeList.map(item => {
155
+ return h('vxe-option', {
156
+ props: {
157
+ value: item.value,
158
+ label: GlobalConfig.i18n(item.label)
159
+ }
160
+ })
161
+ }))
162
+ ])
163
+ ]),
164
+ isPrint || showSheet ? h('tr', [
165
+ h('td', GlobalConfig.i18n('vxe.export.expSheetName')),
166
+ h('td', [
167
+ h('vxe-input', {
168
+ ref: 'sheetname',
169
+ props: {
170
+ value: defaultOptions.sheetName,
171
+ type: 'text',
172
+ clearable: true,
173
+ placeholder: GlobalConfig.i18n('vxe.export.expSheetNamePlaceholder')
174
+ },
175
+ on: {
176
+ modelValue (value) {
177
+ defaultOptions.sheetName = value
178
+ }
179
+ }
180
+ })
181
+ ])
182
+ ]) : _e(),
183
+ h('tr', [
184
+ h('td', GlobalConfig.i18n('vxe.export.expMode')),
185
+ h('td', [
186
+ h('vxe-select', {
187
+ props: {
188
+ value: defaultOptions.mode
189
+ },
190
+ on: {
191
+ input (value) {
192
+ defaultOptions.mode = value
193
+ }
194
+ }
195
+ }, storeData.modeList.map(item => {
196
+ return h('vxe-option', {
197
+ props: {
198
+ value: item.value,
199
+ label: GlobalConfig.i18n(item.label)
200
+ }
201
+ })
202
+ }))
203
+ ])
204
+ ]),
205
+ h('tr', [
206
+ h('td', [GlobalConfig.i18n('vxe.export.expColumn')]),
207
+ h('td', [
208
+ h('div', {
209
+ class: 'vxe-export--panel-column'
210
+ }, [
211
+ h('ul', {
212
+ class: 'vxe-export--panel-column-header'
213
+ }, [
214
+ h('li', {
215
+ class: ['vxe-export--panel-column-option', {
216
+ 'is--checked': isAll,
217
+ 'is--indeterminate': isIndeterminate
218
+ }],
219
+ attrs: {
220
+ title: GlobalConfig.i18n('vxe.table.allTitle')
221
+ },
222
+ on: {
223
+ click: this.allColumnEvent
224
+ }
225
+ }, [
226
+ h('span', {
227
+ class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
228
+ }),
229
+ h('span', {
230
+ class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
231
+ }),
232
+ h('span', {
233
+ class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
234
+ }),
235
+ h('span', {
236
+ class: 'vxe-checkbox--label'
237
+ }, GlobalConfig.i18n('vxe.export.expCurrentColumn'))
238
+ ])
239
+ ]),
240
+ h('ul', {
241
+ class: 'vxe-export--panel-column-body'
242
+ }, cols)
243
+ ])
244
+ ])
245
+ ]),
246
+ h('tr', [
247
+ h('td', GlobalConfig.i18n('vxe.export.expOpts')),
248
+ h('td', [
249
+ h('div', {
250
+ class: 'vxe-export--panel-option-row'
251
+ }, [
252
+ h('vxe-checkbox', {
253
+ props: {
254
+ value: isHeader,
255
+ title: GlobalConfig.i18n('vxe.export.expHeaderTitle'),
256
+ content: GlobalConfig.i18n('vxe.export.expOptHeader')
257
+ },
258
+ on: {
259
+ input (value) {
260
+ defaultOptions.isHeader = value
261
+ }
262
+ }
263
+ }),
264
+ h('vxe-checkbox', {
265
+ props: {
266
+ value: defaultOptions.isFooter,
267
+ disabled: !storeData.hasFooter,
268
+ title: GlobalConfig.i18n('vxe.export.expFooterTitle'),
269
+ content: GlobalConfig.i18n('vxe.export.expOptFooter')
270
+ },
271
+ on: {
272
+ input (value) {
273
+ defaultOptions.isFooter = value
274
+ }
275
+ }
276
+ }),
277
+ h('vxe-checkbox', {
278
+ props: {
279
+ value: defaultOptions.original,
280
+ title: GlobalConfig.i18n('vxe.export.expOriginalTitle'),
281
+ content: GlobalConfig.i18n('vxe.export.expOptOriginal')
282
+ },
283
+ on: {
284
+ input (value) {
285
+ defaultOptions.original = value
286
+ }
287
+ }
288
+ })
289
+ ]),
290
+ h('div', {
291
+ class: 'vxe-export--panel-option-row'
292
+ }, [
293
+ h('vxe-checkbox', {
294
+ props: {
295
+ value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
296
+ disabled: !isHeader || !hasColgroup || !supportMerge,
297
+ title: GlobalConfig.i18n('vxe.export.expColgroupTitle'),
298
+ content: GlobalConfig.i18n('vxe.export.expOptColgroup')
299
+ },
300
+ on: {
301
+ input (value) {
302
+ defaultOptions.isColgroup = value
303
+ }
304
+ }
305
+ }),
306
+ h('vxe-checkbox', {
307
+ props: {
308
+ value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
309
+ disabled: !hasMerge || !supportMerge || !checkedAll,
310
+ title: GlobalConfig.i18n('vxe.export.expMergeTitle'),
311
+ content: GlobalConfig.i18n('vxe.export.expOptMerge')
312
+ },
313
+ on: {
314
+ input (value) {
315
+ defaultOptions.isMerge = value
316
+ }
317
+ }
318
+ }),
319
+ isPrint ? _e() : h('vxe-checkbox', {
320
+ props: {
321
+ value: supportStyle ? defaultOptions.useStyle : false,
322
+ disabled: !supportStyle,
323
+ title: GlobalConfig.i18n('vxe.export.expUseStyleTitle'),
324
+ content: GlobalConfig.i18n('vxe.export.expOptUseStyle')
325
+ },
326
+ on: {
327
+ input (value) {
328
+ defaultOptions.useStyle = value
329
+ }
330
+ }
331
+ }),
332
+ h('vxe-checkbox', {
333
+ props: {
334
+ value: hasTree ? defaultOptions.isAllExpand : false,
335
+ disabled: !hasTree,
336
+ title: GlobalConfig.i18n('vxe.export.expAllExpandTitle'),
337
+ content: GlobalConfig.i18n('vxe.export.expOptAllExpand')
338
+ },
339
+ on: {
340
+ input (value) {
341
+ defaultOptions.isAllExpand = value
342
+ }
343
+ }
344
+ })
345
+ ])
346
+ ])
347
+ ])
348
+ ]
349
+ ])
350
+ ]),
351
+ h('div', {
352
+ class: 'vxe-export--panel-btns'
353
+ }, [
354
+ h('vxe-button', {
355
+ props: {
356
+ content: GlobalConfig.i18n('vxe.export.expCancel')
357
+ },
358
+ on: {
359
+ click: this.cancelEvent
360
+ }
361
+ }),
362
+ h('vxe-button', {
363
+ ref: 'confirmBtn',
364
+ props: {
365
+ status: 'primary',
366
+ content: GlobalConfig.i18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
367
+ },
368
+ on: {
369
+ click: this.confirmEvent
370
+ }
371
+ })
372
+ ])
373
+ ])
374
+ ])
375
+ },
376
+ methods: {
377
+ changeOption (column) {
378
+ const isChecked = !column.checked
379
+ XEUtils.eachTree([column], (item) => {
380
+ item.checked = isChecked
381
+ item.halfChecked = false
382
+ })
383
+ this.handleOptionCheck(column)
384
+ this.checkStatus()
385
+ },
386
+ handleOptionCheck (column) {
387
+ const matchObj = XEUtils.findTree(this.storeData.columns, item => item === column)
388
+ if (matchObj && matchObj.parent) {
389
+ const { parent } = matchObj
390
+ if (parent.children && parent.children.length) {
391
+ parent.checked = parent.children.every(column => column.checked)
392
+ parent.halfChecked = !parent.checked && parent.children.some(column => column.checked || column.halfChecked)
393
+ this.handleOptionCheck(parent)
394
+ }
395
+ }
396
+ },
397
+ checkStatus () {
398
+ const columns = this.storeData.columns
399
+ this.isAll = columns.every(column => column.disabled || column.checked)
400
+ this.isIndeterminate = !this.isAll && columns.some(column => !column.disabled && (column.checked || column.halfChecked))
401
+ },
402
+ allColumnEvent () {
403
+ const isAll = !this.isAll
404
+ XEUtils.eachTree(this.storeData.columns, column => {
405
+ if (!column.disabled) {
406
+ column.checked = isAll
407
+ column.halfChecked = false
408
+ }
409
+ })
410
+ this.isAll = isAll
411
+ this.checkStatus()
412
+ },
413
+ showEvent () {
414
+ this.$nextTick(() => {
415
+ const { $refs } = this
416
+ const targetElem = $refs.filename || $refs.sheetname || $refs.confirmBtn
417
+ if (targetElem) {
418
+ targetElem.focus()
419
+ }
420
+ })
421
+ this.checkStatus()
422
+ },
423
+ getExportOption () {
424
+ const { checkedAll, storeData, defaultOptions, supportMerge } = this
425
+ const { hasMerge, columns } = storeData
426
+ const expColumns = XEUtils.searchTree(columns, column => column.checked, { children: 'children', mapChildren: 'childNodes', original: true })
427
+ return Object.assign({}, defaultOptions, {
428
+ columns: expColumns,
429
+ isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
430
+ })
431
+ },
432
+ cancelEvent () {
433
+ this.storeData.visible = false
434
+ },
435
+ confirmEvent (evnt) {
436
+ if (this.storeData.isPrint) {
437
+ this.printEvent(evnt)
438
+ } else {
439
+ this.exportEvent(evnt)
440
+ }
441
+ },
442
+ printEvent () {
443
+ const $xetable = this.$parent
444
+ this.storeData.visible = false
445
+ $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()))
446
+ },
447
+ exportEvent () {
448
+ const $xetable = this.$parent
449
+ this.loading = true
450
+ $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(() => {
451
+ this.loading = false
452
+ this.storeData.visible = false
453
+ }).catch(() => {
454
+ this.loading = false
455
+ })
456
+ }
457
+ }
458
+ }
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <el-dialog
3
+ title="导出数据"
4
+ width="355px"
5
+ custom-class="dialog-style list-dialog"
6
+ :visible.sync="showDialog"
7
+ :append-to-body="true"
8
+ :modal-append-to-body="true"
9
+ :close-on-click-modal="false"
10
+ v-el-drag-dialog
11
+ v-el-dialog-center
12
+ @close="dialogClose"
13
+ >
14
+ <div class="cont">
15
+ <el-tree
16
+ :props="defaultProps"
17
+ :data="data"
18
+ show-checkbox
19
+ node-key="id"
20
+ ref="tree"
21
+ highlight-current
22
+ default-expand-all
23
+ :expand-on-click-node="true"
24
+ class="organization-tree"
25
+ icon-class="el-icon-arrow-right"
26
+ ></el-tree>
27
+ </div>
28
+ <span slot="footer" class="dialog-footer">
29
+ <el-button type="primary" plain class="button-sty" @click="dialogClose">
30
+ <i class="el-icon-close el-icon"></i>
31
+ 取 消
32
+ </el-button>
33
+ <el-button type="primary" @click="dialogConfirm" class="button-sty">
34
+ <i class="el-icon-check el-icon"></i>
35
+ 确 定
36
+ </el-button>
37
+ </span>
38
+ </el-dialog>
39
+ </template>
40
+ <script>
41
+ export default {
42
+ name: "exportFieldDialog",
43
+ prop
44
+ data(){
45
+ return {
46
+ showDialog:true,
47
+ data:[],
48
+ defaultProps: {
49
+ label: 'title', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
50
+ children: 'children'
51
+ },
52
+ }
53
+ },
54
+ methods:{
55
+ init(){
56
+
57
+ },
58
+ dialogClose(){
59
+ this.showDialog = false;
60
+ this.$emit('update:visiable', false);
61
+ },
62
+ dialogConfirm(){
63
+ this.dialogClose();
64
+ }
65
+ }
66
+ }
67
+ </script>
68
+
69
+
70
+
71
+ <style scoped>
72
+
73
+ </style>
@@ -192,7 +192,7 @@
192
192
  href="javascript:void(0);"
193
193
  class="a-link ico"
194
194
  v-if="!attachment.dirs && fileObjAuth.downloadAuth"
195
- @click="$commonFileUtil.downloadFile(attachment.domain + attachment.url, attachment.fileName)"
195
+ @click="downloadSingerFile(attachment)"
196
196
  >
197
197
  <el-tooltip effect="dark" content="下载" placement="top"
198
198
  popper-class="tooltip-skin">
@@ -353,7 +353,7 @@
353
353
  href="javascript:void(0);"
354
354
  class="a-link"
355
355
  v-if="fileObjAuth.downloadAuth == 1"
356
- @click="$commonFileUtil.downloadFile(row.domain + row.url,row.fileName)"
356
+ @click="downloadSingerFile(row)"
357
357
  >
358
358
  <el-tooltip :enterable="false" effect="dark" :content="$t2('下载','components.fileLibrary.download')"
359
359
  placement="top"
@@ -284,6 +284,19 @@ modules = {
284
284
  }
285
285
  }
286
286
  },
287
+ {
288
+ title: this.$t1('下载打水印 '),
289
+ field: 'downWatermarkAuth',
290
+ width: 150,
291
+ slots: {
292
+ default: ({row}) => {
293
+ return [
294
+ <el-switch v-model={row.downWatermarkAuth} active-value={1} inactive-value={0}
295
+ disabled={row._isParent}></el-switch>
296
+ ];
297
+ }
298
+ }
299
+ },
287
300
  {title: this.$t2('创建人', 'system.label.createBy'), field: 'createBy', width: 150},
288
301
  {title: this.$t2('创建时间', 'system.label.createDate'), field: 'createDate', width: 150},
289
302
  {title: this.$t2('更新人', 'system.label.modifyBy'), field: 'modifyBy', width: 150},
@@ -7,6 +7,7 @@ import shareDialog from "../shareDialog";
7
7
  import recycleBinDialog from "../recycleBinDialog";
8
8
  import videoDialog from "../../../components/video/dialog";
9
9
  import userDialog from "../../../views/user/user/dialog";
10
+ import {encode} from "js-base64";
10
11
 
11
12
  let modules;
12
13
  modules = {
@@ -1746,6 +1747,16 @@ modules = {
1746
1747
  } else {
1747
1748
  return customFileButton.visable;
1748
1749
  }
1750
+ },
1751
+ downloadSingerFile(attachment) {
1752
+ let fileObjAuth = this.fileObjAuth;
1753
+ if (attachment.dirs || !fileObjAuth.downloadAuth) return
1754
+ let url = attachment.domain + attachment.url;
1755
+ let loginAccount = this.$store.getters.loginAccount;
1756
+ if (fileObjAuth.downWatermarkAuth) {
1757
+ url += '?_w=' + encode(loginAccount)
1758
+ }
1759
+ this.$commonFileUtil.downloadFile(url, attachment.fileName)
1749
1760
  }
1750
1761
  },
1751
1762
  };
@@ -118,6 +118,8 @@ export default {
118
118
  },
119
119
  initSystemNoticeInfoDialog() {
120
120
  if (!settingConfig.systemNoticeAutoTip) return
121
+ let userFlag = this.$store.getters.userFlag
122
+ if (userFlag == 6 || userFlag == 7 || userFlag == 8) return;
121
123
  this.$http({
122
124
  url: USER_PREFIX + '/system_notice/listPage',
123
125
  data: {publish: true, important: true, readed: 0, size: 1},