vue2-client 1.9.122 → 1.9.124

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": "vue2-client",
3
- "version": "1.9.122",
3
+ "version": "1.9.124",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -391,8 +391,8 @@ export default {
391
391
  Object.assign(this.fixedQueryForm, prefixedData)
392
392
  },
393
393
 
394
- importExcelOk () {
395
- this.$emit('importExcelOk')
394
+ importExcelOk (data) {
395
+ this.$emit('importExcelOk', data)
396
396
  },
397
397
  initConfig () {
398
398
  this.loading = true
@@ -41,7 +41,7 @@ export default {
41
41
  data () {
42
42
  return {
43
43
  // 查询配置文件名
44
- queryParamsName: 'ceshiCRUD',
44
+ queryParamsName: 'ChargeQueryCRUD',
45
45
  // 查询配置左侧tree
46
46
  // xTreeConfigName: 'addressType',
47
47
  // 新增表单固定值
@@ -144,9 +144,14 @@ export default {
144
144
  formData.append('userData', JSON.stringify(userData))
145
145
  importData(formData, this.serviceName, this.env === 'dev').then(res => {
146
146
  this.fileList = []
147
- this.$message.success(res.msg || res)
147
+ const msg = res.msg || '导入成功'
148
+ if (res?.successLen && !res?.msg) {
149
+ this.$message.success(`${msg},成功导入${res.successLen}条数据`)
150
+ } else {
151
+ this.$message.success(msg)
152
+ }
148
153
  this.open = false
149
- this.$emit('ok')
154
+ this.$emit('ok', res)
150
155
  }).catch(e => {
151
156
  this.$message.error(e)
152
157
  }).finally(() => {
@@ -9,6 +9,7 @@
9
9
  <XReportDesign
10
10
  @updateImg="updateImg"
11
11
  v-if="scanFinish"
12
+ id="printReady"
12
13
  :show-img-in-cell="showImgInCell"
13
14
  :img-prefix="imgPrefix"
14
15
  :use-oss-for-img="useOssForImg"
@@ -17,7 +18,6 @@
17
18
  :slot-config-name="type === 'display' ? undefined : activatedSlotName"
18
19
  :for-display="type === 'display'"
19
20
  ref="XReportDesign"
20
- id="printReady"
21
21
  :server-name="serverName"
22
22
  :show-title="showTitle"
23
23
  :no-padding="noPadding"
@@ -387,7 +387,8 @@ export default {
387
387
  // 打印
388
388
  printDocument () {
389
389
  // x-report
390
- const printContent = window.rawDocument.getElementById('printReady')
390
+ // const printContent = window.rawDocument.getElementById('printReady')
391
+ const printContent = window.document.getElementById('printReady')
391
392
  printElement(printContent)
392
393
  this.$message.success('操作成功!')
393
394
  },
@@ -15,9 +15,9 @@
15
15
  <div
16
16
  :class=" noPadding ? 'reportMainNoPadding' : 'reportMain'"
17
17
  :style="activatedConfig.width > 0 ? ('width:' + activatedConfig.width + 'px') : undefined">
18
- <!-- 大标题 -->
19
- <h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2>
20
- <!-- 小标题 / 介乎于标题与表格之间的内容 -->
18
+ <!-- 大标题
19
+ <h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2>-->
20
+ <!-- 小标题 / 介乎于标题与表格之间的内容
21
21
  <div class="subTitle" v-if="activatedConfig.subTitle">
22
22
  <div class="subTitleItems" v-for="(item, itemIndex) in activatedConfig.subTitle" :key="itemIndex">
23
23
  <template v-if="item.type === 'column'">
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  </template>
42
42
  </div>
43
- </div>
43
+ </div> -->
44
44
  <!-- 主体表格 -->
45
45
  <table class="reportTable" v-if="render" :style="activatedConfig.style ? activatedConfig.style : undefined">
46
46
  <tbody class="reportTable">
@@ -342,7 +342,7 @@ export default {
342
342
 
343
343
  .inputsDivItem {
344
344
  display: flex;
345
- align-items: center;
345
+ align-items: left;
346
346
  padding: 0 4px;
347
347
  white-space: nowrap;
348
348
 
@@ -361,7 +361,7 @@ export default {
361
361
  }
362
362
 
363
363
  .reportMainForDisplay {
364
- text-align: center;
364
+ text-align: left;
365
365
  margin: 10% auto;
366
366
  font-size: 16px;
367
367
  color: #000;
@@ -388,7 +388,7 @@ export default {
388
388
 
389
389
  .inputsDivItem {
390
390
  display: flex;
391
- align-items: center;
391
+ align-items: left;
392
392
  padding: 0 4px;
393
393
  white-space: nowrap;
394
394
 
@@ -407,7 +407,7 @@ export default {
407
407
  }
408
408
 
409
409
  .reportMainNoPadding {
410
- text-align: center;
410
+ text-align: left;
411
411
  margin: 0 auto;
412
412
  font-size: 16px;
413
413
  color: #000;
@@ -433,7 +433,7 @@ export default {
433
433
 
434
434
  .inputsDivItem {
435
435
  display: flex;
436
- align-items: center;
436
+ align-items: left;
437
437
  padding: 0 4px;
438
438
  white-space: nowrap;
439
439
 
@@ -538,42 +538,50 @@ export default {
538
538
  borderBottom: borderWidth + ' solid ' + color,
539
539
  padding: '4px, 2px'
540
540
  }
541
+
541
542
  let result = {}
543
+
544
+ // 先添加单元格通用样式
545
+ if (this.config.cellStyle) {
546
+ result = { ...result, ...this.config.cellStyle }
547
+ }
548
+
542
549
  // 如果表格也声明了样式,用表格样式将样式覆盖
543
550
  if (cell.style) {
544
551
  if (cell.noBorder) {
545
- result = { ...noBorder, ...cell.style }
552
+ result = { ...noBorder, ...cell.style, ...result }
546
553
  } else {
547
554
  if (this.noTopBorder) {
548
- result = { ...NoTopBorder, ...cell.style }
555
+ result = { ...NoTopBorder, ...cell.style, ...result }
549
556
  } else {
550
- result = { ...withBorder, ...cell.style }
557
+ result = { ...withBorder, ...cell.style, ...result }
551
558
  }
552
559
  }
560
+
553
561
  return result
554
562
  }
555
563
  // 如果表头声明了样式,则用其将基础样式覆盖
556
564
  if (cell.type === 'column') {
557
565
  if (this.config.labelStyle !== undefined) {
558
566
  if (cell.noBorder) {
559
- result = { ...noBorder, ...this.config.labelStyle }
567
+ result = { ...noBorder, ...this.config.labelStyle, ...result }
560
568
  } else {
561
569
  if (this.noTopBorder) {
562
- result = { ...NoTopBorder, ...this.config.labelStyle }
570
+ result = { ...NoTopBorder, ...this.config.labelStyle, ...result }
563
571
  } else {
564
- result = { ...withBorder, ...this.config.labelStyle }
572
+ result = { ...withBorder, ...this.config.labelStyle, ...result }
565
573
  }
566
574
  }
567
575
  return result
568
576
  }
569
577
  }
570
578
  if (cell.noBorder) {
571
- result = { ...noBorder }
579
+ result = { ...noBorder, ...result }
572
580
  } else {
573
581
  if (this.noTopBorder) {
574
- result = { ...NoTopBorder }
582
+ result = { ...NoTopBorder, ...result }
575
583
  } else {
576
- result = { ...withBorder }
584
+ result = { ...withBorder, ...result }
577
585
  }
578
586
  }
579
587
  return result
@@ -766,7 +774,6 @@ export default {
766
774
  return result
767
775
  },
768
776
  calculateTrStyle (key, config) {
769
- console.log('行样式配置', config.trStyle, key)
770
777
  // 初始化行样式
771
778
  let trStyle = {}
772
779
 
@@ -1,3 +1,3 @@
1
- import XReport from './XReport'
2
-
3
- export default XReport
1
+ import XReport from './XReport'
2
+
3
+ export default XReport
@@ -0,0 +1,193 @@
1
+ <script>
2
+ import { asyncRunTask, exportData } from '@vue2-client/services/api/common'
3
+ import { formatDate } from '@vue2-client/utils/util'
4
+ import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
5
+ import { Ellipsis } from '@vue2-client/components'
6
+
7
+ export default {
8
+ name: 'ExportExcel',
9
+ components: { Ellipsis },
10
+ data () {
11
+ return {
12
+ // 导出列选择
13
+ exportModalVisible: false,
14
+ exportType: false,
15
+ selectedExportColumns: [],
16
+ exportSelectedRows: false,
17
+ allColumnsSelected: false, // 新增的全选状态
18
+ }
19
+ },
20
+ inject: ['tableContext'],
21
+ methods: {
22
+ // 导出选中或本页数据
23
+ handleExport (type) {
24
+ this.exportType = type
25
+ this.exportModalVisible = true
26
+ // 组织默认选中的字段
27
+ this.selectedExportColumns = this.tableContext.tableColumns
28
+ .filter(column => column.slotType !== 'action' && column.defaultExport)
29
+ .map(column => column.dataIndex)
30
+ },
31
+ handleExportGen () {
32
+ const tHeader = this.tableContext.tableColumns
33
+ .filter(column => this.selectedExportColumns.includes(column.dataIndex))
34
+ .map(column => column.title)
35
+ const filterVal = this.tableContext.tableColumns
36
+ .filter(column => this.selectedExportColumns.includes(column.dataIndex))
37
+ .map(column => column.dataIndex)
38
+ if (this.exportType === 'curPage' || this.exportType === 'selected') {
39
+ this.handleExportCur(tHeader, filterVal, this.exportType === 'selected')
40
+ } else if (this.exportType === 'exportByQuery') {
41
+ this.handleExportByQuery(tHeader, filterVal)
42
+ } else if (this.exportType === 'exportByQueryASync') {
43
+ this.handleAsyncExportByQuery(tHeader, filterVal)
44
+ }
45
+ },
46
+ // 导出选中或本页数据
47
+ handleExportCur (tHeader, filterVal, isSelected) {
48
+ let exportData
49
+ if (isSelected) {
50
+ exportData = this.tableContext.selectedRows
51
+ } else {
52
+ exportData = this.tableContext.getTableData()
53
+ }
54
+ exportJson(tHeader, exportData.map(v => filterVal.map(j => v[j])), `${this.tableContext.title || ''}数据_${new Date().toLocaleString()}`)
55
+ },
56
+ // 导出符合条件的数据
57
+ handleExportByQuery (tHeader, tDataList) {
58
+ const that = this
59
+ const conditionParams = Object.assign(that.tableContext.form, that.tableContext.fixedQueryForm)
60
+ this.$confirm({
61
+ title: '是否确认导出?',
62
+ content: '此操作将导出当前条件下所有数据而非选中数据',
63
+ onOk () {
64
+ exportData({
65
+ queryParamsName: that.tableContext.queryParamsName,
66
+ queryParams: that.tableContext.queryParams,
67
+ tHeader: tHeader,
68
+ tDataList: tDataList,
69
+ form: conditionParams,
70
+ userId: that.tableContext.currUser.id
71
+ }, that.tableContext.serviceName).then(res => {
72
+ let value = res
73
+ if (that.tableContext.compatible === 'V4' || (Object.keys(res).length === 1 && Object.prototype.hasOwnProperty.call(res, 'value'))) {
74
+ value = res.value
75
+ }
76
+ that.closeModal()
77
+ window.open(value)
78
+ })
79
+ },
80
+ onCancel () {
81
+ }
82
+ })
83
+ },
84
+ handleAsyncExportByQuery (tHeader, tDataList) {
85
+ const that = this
86
+ const conditionParams = Object.assign(that.tableContext.form, that.tableContext.fixedQueryForm)
87
+ this.$confirm({
88
+ title: '是否确认导出?',
89
+ content: (h) => (
90
+ <div>
91
+ <p>此操作将导出当前条件下所有数据而非选中数据</p>
92
+ {/* eslint-disable-next-line no-return-assign */}
93
+ <a-input placeholder="请输入导出文件名" onChange={(e) => this.exportFileName = e.target.value}/>
94
+ </div>
95
+ ),
96
+ onOk: () => {
97
+ if (!this.exportFileName) {
98
+ this.$message.error('文件名不能为空')
99
+ // eslint-disable-next-line prefer-promise-reject-errors
100
+ return Promise.reject() // 阻止对话框关闭
101
+ }
102
+ // 在这里执行导出的逻辑,并使�� this.exportFileName 作为文件名
103
+ const queryData = {
104
+ queryParamsName: that.tableContext.queryParamsName,
105
+ queryParams: that.tableContext.queryParams,
106
+ form: conditionParams,
107
+ tHeader: tHeader,
108
+ tDataList: tDataList,
109
+ userId: that.tableContext.currUser.id
110
+ }
111
+ const date = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
112
+
113
+ asyncRunTask({
114
+ f_task_type: '导出',
115
+ f_task_class: 'com.af.v4.impl.CommonExportHandlerImpl',
116
+ f_user_id: that.tableContext.currUser.id,
117
+ // 导出条件
118
+ f_tag1: queryData,
119
+ // 导出文件名
120
+ f_tag2: this.exportFileName + '_' + that.tableContext.currUser.username,
121
+ // 执行数据源
122
+ f_tag3: process.env.VUE_APP_SYSTEM_NAME,
123
+ f_service_name: that.tableContext.serviceName || process.env.VUE_APP_SYSTEM_NAME,
124
+ f_task_name: `${this.exportFileName}_${that.tableContext.currUser.username}_${date}`
125
+ }, that.tableContext.serviceName)
126
+ .then(res => {
127
+ that.closeModal()
128
+ }).catch(error => {
129
+ // 失败时的处理
130
+ console.log('失败:', error)
131
+ })
132
+ },
133
+ onCancel () {
134
+ }
135
+ })
136
+ },
137
+ closeModal () {
138
+ this.exportModalVisible = false
139
+ },
140
+ // 新增的全选方法
141
+ handleSelectAllColumns (e) {
142
+ if (e.target.checked) {
143
+ this.selectedExportColumns = this.tableContext.tableColumns.map(column => column.dataIndex)
144
+ } else {
145
+ this.selectedExportColumns = []
146
+ }
147
+ }
148
+ }
149
+ }
150
+ </script>
151
+
152
+ <template>
153
+ <a-modal
154
+ title="选择导出列"
155
+ width="35vw"
156
+ v-model="exportModalVisible"
157
+ :destroy-on-close="true"
158
+ @ok="handleExportGen"
159
+ >
160
+ <a-row type="flex" justify="space-between" style="padding-left: 3rem">
161
+ <a-col :span="8" style="margin-top: 3px">
162
+ <a-checkbox
163
+ :checked="selectedExportColumns.length === tableContext.tableColumns.length"
164
+ @change="handleSelectAllColumns"
165
+ >
166
+ 全选
167
+ </a-checkbox>
168
+ </a-col>
169
+ </a-row>
170
+ <a-checkbox-group v-model="selectedExportColumns">
171
+ <a-row type="flex" justify="space-between" style="padding-left: 3rem">
172
+ <a-col
173
+ :span="8"
174
+ style="margin-top: 3px"
175
+ v-for="column in tableContext.tableColumns.filter(res => res.slotType !== 'action')"
176
+ :key="column.dataIndex">
177
+ <a-checkbox
178
+ :label="column.title"
179
+ :value="column.dataIndex"
180
+ >
181
+ <ellipsis :length="18" tooltip>
182
+ {{ column.title }}
183
+ </ellipsis>
184
+ </a-checkbox>
185
+ </a-col>
186
+ </a-row>
187
+ </a-checkbox-group>
188
+ </a-modal>
189
+ </template>
190
+
191
+ <style scoped lang="less">
192
+
193
+ </style>
@@ -62,12 +62,12 @@
62
62
  </a-button>
63
63
  <a-dropdown v-if="!buttonState || buttonState.export && buttonRendering('export')">
64
64
  <a-menu slot="overlay">
65
- <a-menu-item :disabled="selectedRowKeys.length === 0" key="1" @click="handleExport(true)"><a-icon
65
+ <a-menu-item :disabled="selectedRowKeys.length === 0" key="1" @click="handleExport('selected')"><a-icon
66
66
  :style="iconStyle"
67
67
  type="ordered-list"/>导出选中数据</a-menu-item>
68
- <a-menu-item key="2" @click="handleExport(false)"><a-icon :style="iconStyle" type="snippets"/>导出本页数据</a-menu-item>
69
- <a-menu-item key="3" @click="handleExportByQuery"><a-icon :style="iconStyle" type="download"/>导出所有符合条件的数据</a-menu-item>
70
- <!-- <a-menu-item key="4" @click="handleAsyncExportByQuery"><a-icon :style="iconStyle" type="download"/>异步导出所有符合条件的数据</a-menu-item>-->
68
+ <a-menu-item key="2" @click="handleExport('curPage')"><a-icon :style="iconStyle" type="snippets"/>导出本页数据</a-menu-item>
69
+ <a-menu-item key="3" @click="handleExport('exportByQuery')"><a-icon :style="iconStyle" type="download"/>导出所有符合条件的数据</a-menu-item>
70
+ <!-- <a-menu-item key="4" @click="handleExport('exportByQueryASync')"><a-icon :style="iconStyle" type="download"/>异步导出所有符合条件的数据</a-menu-item>-->
71
71
  </a-menu>
72
72
  <a-button>导出 <a-icon type="down" :style="iconStyle"/> </a-button>
73
73
  </a-dropdown>
@@ -302,6 +302,9 @@
302
302
  <slot name="importExcelSlot"></slot>
303
303
  </template>
304
304
  </x-import-excel>
305
+ <ExportExcel
306
+ ref="exportExcel"
307
+ />
305
308
  </div>
306
309
  </template>
307
310
  <script>
@@ -309,15 +312,12 @@ import { Ellipsis, STable } from '@vue2-client/components'
309
312
  import util, { formatDate, getChangedData, setDataByRealKey } from '@vue2-client/utils/util'
310
313
  import XBadge from '@vue2-client/base-client/components/common/XBadge'
311
314
  import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
312
- import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
313
315
  import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
314
316
  import {
315
- exportData,
316
317
  query,
317
318
  querySummary,
318
319
  queryWithResource,
319
320
  remove,
320
- asyncRunTask,
321
321
  getConfigByNameAsync,
322
322
  editRowSave,
323
323
  runLogic
@@ -331,10 +331,12 @@ import XDataCard from '@vue2-client/base-client/components/common/XDataCard/XDat
331
331
  import { getRealKeyData } from '@vue2-client/utils/formatter'
332
332
  import ReportTableHome from '../../../../pages/report/ReportTableHome.vue'
333
333
  import CustomFuncCel from '@vue2-client/base-client/components/common/XTable/CustomFuncCel.vue'
334
+ import ExportExcel from '@vue2-client/base-client/components/common/XTable/ExportExcel.vue'
334
335
 
335
336
  export default {
336
337
  name: 'XTable',
337
338
  components: {
339
+ ExportExcel,
338
340
  CustomFuncCel,
339
341
  XDataCard,
340
342
  TableSetting,
@@ -347,6 +349,11 @@ export default {
347
349
  ReportTableHome
348
350
  },
349
351
  inject: ['getSelf'],
352
+ provide () {
353
+ return {
354
+ tableContext: this
355
+ }
356
+ },
350
357
  data () {
351
358
  return {
352
359
  uniqueId: `x-table-${this._uid}`, // 使用 _uid 生成唯一 ID
@@ -474,7 +481,8 @@ export default {
474
481
  // 暂存行编辑前数据 用于比较哪些变化了才需要保存
475
482
  editRowBeforeData: [],
476
483
  // 是否简易模式
477
- simpleMode: false
484
+ simpleMode: false,
485
+ queryParams: {}
478
486
  }
479
487
  },
480
488
  props: {
@@ -603,9 +611,9 @@ export default {
603
611
  })
604
612
  }
605
613
  },
606
- importExcelOk () {
614
+ importExcelOk (data) {
607
615
  this.refresh(true)
608
- this.$emit('importExcelOk')
616
+ this.$emit('importExcelOk', data)
609
617
  },
610
618
  /**
611
619
  * 行选择事件
@@ -687,7 +695,6 @@ export default {
687
695
  cardModeConfig,
688
696
  summaryUpdate
689
697
  } = params
690
- console.log('我的table', createdQuery)
691
698
  this.showSummary = Object.keys(tableSummaryMap).length > 0
692
699
  if (this.showSummary) {
693
700
  Object.keys(tableSummaryMap).forEach(item => {
@@ -965,93 +972,8 @@ export default {
965
972
  const indexColumn = this.tableColumns.find(i => i?.slotType === 'index')
966
973
  return indexColumn ? indexColumn.dataIndex : this.tableColumns[0].dataIndex
967
974
  },
968
- // 导出选中或本页数据
969
- handleExport (isSelected) {
970
- const tHeader = this.tableColumns.filter(res => res.slotType !== 'action').map(res => res.title)
971
- const filterVal = this.tableColumns.filter(res => res.slotType !== 'action').map(res => res.dataIndex)
972
- let exportData
973
- if (isSelected) {
974
- exportData = this.selectedRows
975
- } else {
976
- exportData = this.$refs.table.localDataSource
977
- }
978
- exportJson(tHeader, exportData.map(v => filterVal.map(j => v[j])), this.title + `数据_${new Date().toLocaleString()}`)
979
- },
980
- // 导出符合条件的数据
981
- handleExportByQuery () {
982
- const that = this
983
- const conditionParams = Object.assign(that.form, that.fixedQueryForm)
984
- this.$confirm({
985
- title: '是否确认导出?',
986
- content: '此操作将导出当前条件下所有数据而非选中数据',
987
- onOk () {
988
- exportData({
989
- queryParamsName: that.queryParamsName,
990
- queryParams: that.queryParams,
991
- form: conditionParams,
992
- userId: that.currUser.id
993
- }, that.serviceName, that.env === 'dev').then(res => {
994
- let value = res
995
- if (that.compatible === 'V4' || (Object.keys(res).length === 1 && Object.prototype.hasOwnProperty.call(res, 'value'))) {
996
- value = res.value
997
- }
998
- // window.open('/res/excel/export/' + value)
999
- window.open(value)
1000
- })
1001
- },
1002
- onCancel () {
1003
- }
1004
- })
1005
- },
1006
- handleAsyncExportByQuery () {
1007
- const that = this
1008
- const conditionParams = Object.assign(that.form, that.fixedQueryForm)
1009
- this.$confirm({
1010
- title: '是否确认导出?',
1011
- content: (h) => (
1012
- <div>
1013
- <p>此操作将导出当前条件下所有数据而非选中数据</p>
1014
- {/* eslint-disable-next-line no-return-assign */}
1015
- <a-input placeholder="请输入导出文件名" onChange={(e) => this.exportFileName = e.target.value}/>
1016
- </div>
1017
- ),
1018
- onOk: () => {
1019
- if (!this.exportFileName) {
1020
- this.$message.error('文件名不能为空')
1021
- // eslint-disable-next-line prefer-promise-reject-errors
1022
- return Promise.reject() // 阻止对话框关闭
1023
- }
1024
- // 在这里执行导出的逻辑,并使用 this.exportFileName 作为文件名
1025
- const queryData = {
1026
- queryParamsName: that.queryParamsName,
1027
- queryParams: that.queryParams,
1028
- form: conditionParams,
1029
- userId: that.currUser.id
1030
- }
1031
- const date = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
1032
-
1033
- asyncRunTask({
1034
- f_task_type: '导出',
1035
- f_task_class: 'com.af.v4.impl.CommonExportHandlerImpl',
1036
- f_user_id: that.currUser.id,
1037
- // 导出条件
1038
- f_tag1: queryData,
1039
- // 导出文件名
1040
- f_tag2: this.exportFileName + '_' + that.currUser.username,
1041
- // 执行数据源
1042
- f_tag3: process.env.VUE_APP_SYSTEM_NAME,
1043
- f_service_name: that.serviceName || process.env.VUE_APP_SYSTEM_NAME,
1044
- f_task_name: `${this.exportFileName}_${that.currUser.username}_${date}`
1045
- }, that.serviceName, that.env === 'dev')
1046
- .then(res => {
1047
- }).catch(error => {
1048
- // 失败时的处理
1049
- console.log('失败:', error)
1050
- })
1051
- },
1052
- onCancel () {
1053
- }
1054
- })
975
+ handleExport (type) {
976
+ this.$refs.exportExcel.handleExport(type)
1055
977
  },
1056
978
  // 新增业务
1057
979
  add () {
package/src/main.js CHANGED
@@ -20,7 +20,6 @@ const router = new Router(routerOptions)
20
20
  Vue.$store = store
21
21
  Vue.$router = router
22
22
  Vue.$i18n = i18n
23
-
24
23
  // 绑定原型
25
24
  Vue.Modal = Modal
26
25
 
@@ -1,50 +1,50 @@
1
- <template>
2
- <div>
3
- <a-list v-show="!loading" size="small" :data-source="data">
4
- <a-list-item slot="renderItem" slot-scope="item">
5
- <div>
6
- <p><a @click="$emit('openFavorites', item.uuid)">{{ item.question }} </a></p>
7
- <p>{{ item.date }}</p>
8
- </div>
9
- <a class="delete_item">
10
- <a-icon type="close" @click="$emit('saveToFavorites', item.uuid)"/>
11
- </a>
12
- </a-list-item>
13
- </a-list>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import { indexedDB } from '@vue2-client/utils/indexedDB'
19
-
20
- export default {
21
- name: 'FavoriteList',
22
- data () {
23
- return {
24
- data: [],
25
- loading: false
26
- }
27
- },
28
- mounted () {
29
- this.loadData()
30
- },
31
- methods: {
32
- loadData () {
33
- indexedDB.getAll((data) => {
34
- const realData = data.filter(item => item.data && item.data.uuid)
35
- .map(item => item.data)
36
- this.data = realData
37
- })
38
- }
39
- }
40
- }
41
- </script>
42
- <style lang="less" scoped>
43
- .delete_item {
44
- margin-left: 8px;
45
- color: #333;
46
- }
47
- p {
48
- margin: 0
49
- }
50
- </style>
1
+ <template>
2
+ <div>
3
+ <a-list v-show="!loading" size="small" :data-source="data">
4
+ <a-list-item slot="renderItem" slot-scope="item">
5
+ <div>
6
+ <p><a @click="$emit('openFavorites', item.uuid)">{{ item.question }} </a></p>
7
+ <p>{{ item.date }}</p>
8
+ </div>
9
+ <a class="delete_item">
10
+ <a-icon type="close" @click="$emit('saveToFavorites', item.uuid)"/>
11
+ </a>
12
+ </a-list-item>
13
+ </a-list>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
19
+
20
+ export default {
21
+ name: 'FavoriteList',
22
+ data () {
23
+ return {
24
+ data: [],
25
+ loading: false
26
+ }
27
+ },
28
+ mounted () {
29
+ this.loadData()
30
+ },
31
+ methods: {
32
+ loadData () {
33
+ indexedDB.getAll((data) => {
34
+ const realData = data.filter(item => item.data && item.data.uuid)
35
+ .map(item => item.data)
36
+ this.data = realData
37
+ })
38
+ }
39
+ }
40
+ }
41
+ </script>
42
+ <style lang="less" scoped>
43
+ .delete_item {
44
+ margin-left: 8px;
45
+ color: #333;
46
+ }
47
+ p {
48
+ margin: 0
49
+ }
50
+ </style>
@@ -87,9 +87,9 @@ routerResource.example = {
87
87
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
88
88
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
89
89
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
90
- // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
90
+ component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
91
91
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
92
- component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
92
+ // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
93
93
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
94
94
  // component: () => import('@vue2-client/base-client/components/common/XConversation/XConversationDemo.vue'),
95
95
  // component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonDemo.vue'),
@@ -1,18 +1,18 @@
1
- import { post } from '@vue2-client/services/api/restTools'
2
-
3
- const entityApi = {
4
- // 根据ID查询数据
5
- getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
6
- return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
7
- },
8
- // 根据ID集合查询所有数据
9
- findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
10
- return post(`/api/${serviceName}/entity/query/${entityName}`, data)
11
- },
12
- // 查询实体的总数量
13
- getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
14
- return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
15
- }
16
- }
17
-
18
- export { entityApi }
1
+ import { post } from '@vue2-client/services/api/restTools'
2
+
3
+ const entityApi = {
4
+ // 根据ID查询数据
5
+ getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
6
+ return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
7
+ },
8
+ // 根据ID集合查询所有数据
9
+ findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
10
+ return post(`/api/${serviceName}/entity/query/${entityName}`, data)
11
+ },
12
+ // 查询实体的总数量
13
+ getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
14
+ return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
15
+ }
16
+ }
17
+
18
+ export { entityApi }
@@ -1,63 +1,63 @@
1
- // 工单专用api
2
- const workFlowViewApi = {
3
- // 查询:获取工作流基本数据
4
- getWorkFlowBasicInfo: '/logic/getWorkFlowBasicInfo',
5
- // 保存工作流流程定义
6
- saveWorkFlowWorkflowDefine: '/logic/saveWorkFlowWorkflowDefine',
7
- // 获取工作流流程定义
8
- getWorkFlowDefine: '/logic/getWorkFlowDefine',
9
- // 获取工作流当前步骤
10
- getWorkFlowCurrentSubState: '/logic/getWorkFlowCurrentSubState',
11
- // 保存用户每一步输入的表单内容
12
- saveWorkFlowStepFormData: '/logic/saveWorkFlowStepFormData',
13
- // 获取已经完成步骤的用户填写数据
14
- getWorkFlowCompletedStepData: '/logic/getWorkFlowCompletedStepData',
15
- // 改变工作流进度
16
- updateWorkFlowState: '/logic/updateWorkFlowState',
17
- // 完工确认后更改工作流状态
18
- afterWorkFlowFinalStepSubmit: '/logic/afterWorkFlowFinalStepSubmit',
19
- // 获取步骤留言和表单填写人姓名
20
- getStepNoteAndHandler: '/logic/getStepNoteAndHandler',
21
- // 更新步骤信息
22
- updateWorkFlowStepData: '/logic/updateWorkFlowStepData',
23
- // 保存工作流日志
24
- saveWorkFlowLog: '/logic/saveWorkFlowLog',
25
- // 获取工作流日志
26
- getWorkFlowLog: '/logic/getWorkFlowLog',
27
- // 获取员工任务详情信息
28
- getEmployeeTaskDetail: '/logic/getEmployeeTaskDetail',
29
- // 根据条件查询任务
30
- getWorkFlowListByCondition: '/logic/getWorkFlowListByCondition',
31
- // 根据流程名称获取所有步骤名称
32
- getWorkFlowStepNames: '/logic/getWorkFlowStepNames',
33
- // 获取工作流任务留言
34
- getWorkFlowLeaveMessage: '/logic/getWorkFlowLeaveMessage',
35
- // 更新任务完成时间
36
- updateWorkFlowCompleteTime: '/logic/updateWorkFlowCompleteTime',
37
- // 获取任务完成时间更改记录
38
- getWorkFlowCompleteTimeChange: '/logic/getWorkFlowCompleteTimeChange',
39
- // 修改工单
40
- updateWorkFlow: '/logic/updateWorkFlow',
41
- // 获取工作流流程图设计
42
- getWorkFlowPaintWorkFlowDefine: '/logic/getWorkFlowPaintWorkFlowDefine',
43
- // 简单添加字典项
44
- simpleInsertIntoDictionary: '/logic/simpleInsertIntoDictionary',
45
- // 删除工作流项目
46
- deleteWorkFlow: '/logic/deleteWorkFlow',
47
- // 获取流程分类数据
48
- getWorkFlowCategoryTree: '/logic/getWorkFlowCategoryTree',
49
- // 创建任务
50
- createWorkflowTask: '/logic/createWorkflowTask',
51
- // 获取部门选择框数据
52
- getDepartmentList: '/logic/getDepartmentList',
53
- // 获取人员任务汇总数据
54
- getEmployeeSummary: '/logic/getEmployeeSummary',
55
- // 获取逾期任务排行榜
56
- getOverdueRanking: '/logic/getOverdueRanking',
57
- // 根据人查询对应的t_workflow_step中字段f_workflow_id的数据组
58
- getWorkFlowStepWorkFlowId: '/logic/getWorkFlowStepWorkFlowId',
59
- // 表单提交到下一步
60
- submitToNextStep: '/logic/submitToNextStep'
61
- }
62
-
63
- export { workFlowViewApi }
1
+ // 工单专用api
2
+ const workFlowViewApi = {
3
+ // 查询:获取工作流基本数据
4
+ getWorkFlowBasicInfo: '/logic/getWorkFlowBasicInfo',
5
+ // 保存工作流流程定义
6
+ saveWorkFlowWorkflowDefine: '/logic/saveWorkFlowWorkflowDefine',
7
+ // 获取工作流流程定义
8
+ getWorkFlowDefine: '/logic/getWorkFlowDefine',
9
+ // 获取工作流当前步骤
10
+ getWorkFlowCurrentSubState: '/logic/getWorkFlowCurrentSubState',
11
+ // 保存用户每一步输入的表单内容
12
+ saveWorkFlowStepFormData: '/logic/saveWorkFlowStepFormData',
13
+ // 获取已经完成步骤的用户填写数据
14
+ getWorkFlowCompletedStepData: '/logic/getWorkFlowCompletedStepData',
15
+ // 改变工作流进度
16
+ updateWorkFlowState: '/logic/updateWorkFlowState',
17
+ // 完工确认后更改工作流状态
18
+ afterWorkFlowFinalStepSubmit: '/logic/afterWorkFlowFinalStepSubmit',
19
+ // 获取步骤留言和表单填写人姓名
20
+ getStepNoteAndHandler: '/logic/getStepNoteAndHandler',
21
+ // 更新步骤信息
22
+ updateWorkFlowStepData: '/logic/updateWorkFlowStepData',
23
+ // 保存工作流日志
24
+ saveWorkFlowLog: '/logic/saveWorkFlowLog',
25
+ // 获取工作流日志
26
+ getWorkFlowLog: '/logic/getWorkFlowLog',
27
+ // 获取员工任务详情信息
28
+ getEmployeeTaskDetail: '/logic/getEmployeeTaskDetail',
29
+ // 根据条件查询任务
30
+ getWorkFlowListByCondition: '/logic/getWorkFlowListByCondition',
31
+ // 根据流程名称获取所有步骤名称
32
+ getWorkFlowStepNames: '/logic/getWorkFlowStepNames',
33
+ // 获取工作流任务留言
34
+ getWorkFlowLeaveMessage: '/logic/getWorkFlowLeaveMessage',
35
+ // 更新任务完成时间
36
+ updateWorkFlowCompleteTime: '/logic/updateWorkFlowCompleteTime',
37
+ // 获取任务完成时间更改记录
38
+ getWorkFlowCompleteTimeChange: '/logic/getWorkFlowCompleteTimeChange',
39
+ // 修改工单
40
+ updateWorkFlow: '/logic/updateWorkFlow',
41
+ // 获取工作流流程图设计
42
+ getWorkFlowPaintWorkFlowDefine: '/logic/getWorkFlowPaintWorkFlowDefine',
43
+ // 简单添加字典项
44
+ simpleInsertIntoDictionary: '/logic/simpleInsertIntoDictionary',
45
+ // 删除工作流项目
46
+ deleteWorkFlow: '/logic/deleteWorkFlow',
47
+ // 获取流程分类数据
48
+ getWorkFlowCategoryTree: '/logic/getWorkFlowCategoryTree',
49
+ // 创建任务
50
+ createWorkflowTask: '/logic/createWorkflowTask',
51
+ // 获取部门选择框数据
52
+ getDepartmentList: '/logic/getDepartmentList',
53
+ // 获取人员任务汇总数据
54
+ getEmployeeSummary: '/logic/getEmployeeSummary',
55
+ // 获取逾期任务排行榜
56
+ getOverdueRanking: '/logic/getOverdueRanking',
57
+ // 根据人查询对应的t_workflow_step中字段f_workflow_id的数据组
58
+ getWorkFlowStepWorkFlowId: '/logic/getWorkFlowStepWorkFlowId',
59
+ // 表单提交到下一步
60
+ submitToNextStep: '/logic/submitToNextStep'
61
+ }
62
+
63
+ export { workFlowViewApi }
@@ -1,31 +1,31 @@
1
- /**
2
- * @description: createWaterMark.js 加水印功能
3
- */
4
- let waterMarkDOM
5
-
6
- const clearWaterMark = () => {
7
- if (waterMarkDOM) waterMarkDOM.remove()
8
- }
9
- /**
10
- * @description: 创建水印
11
- * @param waterMarkName 水印内容
12
- */
13
- export default function createWaterMark (waterMarkName) {
14
- clearWaterMark()
15
- if (!waterMarkName) {
16
- return
17
- }
18
- const width = window.parseInt(document.body.clientWidth)
19
- const canvasWidth = width / window.parseInt(width / 320)
20
- const fontFamily = window.getComputedStyle(document.body)['font-family']
21
- const fragment = document.createDocumentFragment()
22
- waterMarkDOM = document.createElement('div')
23
- waterMarkDOM.className = 'water-mark-wrap'
24
- let spanStr = ''
25
- for (let i = 0; i < 100; i++) {
26
- spanStr += `<span class="water-word" style=width:${canvasWidth}px;height:200px;font: ${fontFamily}>${waterMarkName}</span>`
27
- }
28
- waterMarkDOM.innerHTML = spanStr
29
- fragment.appendChild(waterMarkDOM)
30
- document.body.appendChild(fragment)
31
- }
1
+ /**
2
+ * @description: createWaterMark.js 加水印功能
3
+ */
4
+ let waterMarkDOM
5
+
6
+ const clearWaterMark = () => {
7
+ if (waterMarkDOM) waterMarkDOM.remove()
8
+ }
9
+ /**
10
+ * @description: 创建水印
11
+ * @param waterMarkName 水印内容
12
+ */
13
+ export default function createWaterMark (waterMarkName) {
14
+ clearWaterMark()
15
+ if (!waterMarkName) {
16
+ return
17
+ }
18
+ const width = window.parseInt(document.body.clientWidth)
19
+ const canvasWidth = width / window.parseInt(width / 320)
20
+ const fontFamily = window.getComputedStyle(document.body)['font-family']
21
+ const fragment = document.createDocumentFragment()
22
+ waterMarkDOM = document.createElement('div')
23
+ waterMarkDOM.className = 'water-mark-wrap'
24
+ let spanStr = ''
25
+ for (let i = 0; i < 100; i++) {
26
+ spanStr += `<span class="water-word" style=width:${canvasWidth}px;height:200px;font: ${fontFamily}>${waterMarkName}</span>`
27
+ }
28
+ waterMarkDOM.innerHTML = spanStr
29
+ fragment.appendChild(waterMarkDOM)
30
+ document.body.appendChild(fragment)
31
+ }