vue2-client 1.8.327 → 1.8.328

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.8.327",
3
+ "version": "1.8.328",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -30,6 +30,7 @@
30
30
  type="ordered-list"/>导出选中数据</a-menu-item>
31
31
  <a-menu-item key="2" @click="handleExport(false)"><a-icon :style="iconStyle" type="snippets"/>导出本页数据</a-menu-item>
32
32
  <a-menu-item key="3" @click="handleExportByQuery"><a-icon :style="iconStyle" type="download"/>导出所有符合条件的数据</a-menu-item>
33
+ <a-menu-item key="4" @click="handleAsyncExportByQuery"><a-icon :style="iconStyle" type="download"/>异步导出所有符合条件的数据</a-menu-item>
33
34
  </a-menu>
34
35
  <a-button>导出 <a-icon type="down" :style="iconStyle"/> </a-button>
35
36
  </a-dropdown>
@@ -159,7 +160,7 @@ import { formatDate } from '@vue2-client/utils/util'
159
160
  import XBadge from '@vue2-client/base-client/components/common/XBadge'
160
161
  import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
161
162
  import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
162
- import { exportData, query, querySummary, queryWithResource, remove } from '@vue2-client/services/api/common'
163
+ import { exportData, query, querySummary, queryWithResource, remove, asyncRunTask } from '@vue2-client/services/api/common'
163
164
  import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
164
165
  import { Modal } from 'ant-design-vue'
165
166
  import { post } from '@vue2-client/services/api'
@@ -565,6 +566,53 @@ export default {
565
566
  }
566
567
  })
567
568
  },
569
+ handleAsyncExportByQuery () {
570
+ const that = this
571
+ const conditionParams = Object.assign(that.form, that.fixedQueryForm)
572
+ this.$confirm({
573
+ title: '是否确认导出?',
574
+ content: (h) => (
575
+ <div>
576
+ <p>此操作将导出当前条件下所有数据而非选中数据</p>
577
+ <a-input
578
+ placeholder="请输入导出文件名"
579
+ onChange={(e) => this.exportFileName = e.target.value}
580
+ />
581
+ </div>
582
+ ),
583
+ onOk: () => {
584
+ if (!this.exportFileName) {
585
+ this.$message.error('文件名不能为空');
586
+ return Promise.reject(); // 阻止对话框关闭
587
+ }
588
+ // 在这里执行导出的逻辑,并使用 this.exportFileName 作为文件名
589
+ const queryData = {
590
+ queryParamsName: that.queryParamsName,
591
+ queryParams: that.queryParams,
592
+ form: conditionParams,
593
+ userId: that.currUser.id
594
+ }
595
+ const date = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
596
+
597
+ asyncRunTask({
598
+ f_task_type: 'commonExport',
599
+ f_task_class: 'com.af.v4.system.common.impl.CommonExportHandlerImpl',
600
+ f_user_id: that.currUser.id,
601
+ f_tag1: queryData,
602
+ f_tag2: this.exportFileName + '_' + that.currUser.username,
603
+ f_service_name: that.serviceName || process.env.VUE_APP_SYSTEM_NAME,
604
+ f_task_name: `${this.exportFileName}_${that.currUser.username}_${date}`
605
+ }, that.serviceName, that.env === 'dev')
606
+ .then(res => {
607
+ }).catch(error => {
608
+ // 失败时的处理
609
+ console.log('失败:', error);
610
+ });
611
+ },
612
+ onCancel () {
613
+ }
614
+ });
615
+ },
568
616
  // 新增业务
569
617
  add () {
570
618
  this.$emit('add')
@@ -41,6 +41,8 @@ const commonApi = {
41
41
  getColumnsJson: '/api/af-system/logic/getColumns',
42
42
  // v4文件删除
43
43
  deleteFile: 'resource/delete',
44
+ // 异步任务执行
45
+ asyncRunTask: 'logic/clientTaskSend'
44
46
  }
45
47
 
46
48
  /**
@@ -210,6 +212,18 @@ export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_
210
212
  return post(apiPre + serviceName + '/' + commonApi.importData, parameter, null)
211
213
  }
212
214
 
215
+ /**
216
+ * 异步导出
217
+ */
218
+ export function asyncRunTask(parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
219
+ debugger
220
+ let apiPre = '/api/'
221
+ if (isDev) {
222
+ apiPre = '/devApi/'
223
+ }
224
+ return post(apiPre + serviceName + '/' + commonApi.asyncRunTask, parameter, null)
225
+ }
226
+
213
227
  /**
214
228
  * 通用导出
215
229
  */