vue2-client 1.6.48 → 1.6.49
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/CHANGELOG.md +625 -622
- package/index.js +30 -30
- package/package.json +81 -81
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +279 -279
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +180 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +513 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -336
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +6 -5
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +46 -46
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/login/Login.vue +369 -366
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +68 -68
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +9 -0
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
# XFormTable
|
|
2
|
-
|
|
3
|
-
动态查询控件,进一步整合了XTable和XForm
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## 何时使用
|
|
7
|
-
|
|
8
|
-
当需要一个通用的表单,表格一体化控件时
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
引用方式:
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
components: {
|
|
18
|
-
XFormTable
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## 代码演示
|
|
26
|
-
|
|
27
|
-
```html
|
|
28
|
-
<x-form-table
|
|
29
|
-
title="业务名称"
|
|
30
|
-
:queryParamsName="queryParamsName">
|
|
31
|
-
</x-form-table>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## API
|
|
35
|
-
|
|
36
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
37
|
-
|--------------------|-------------------------|---------|-------|
|
|
38
|
-
| title | 业务名称 | String | '' |
|
|
39
|
-
| queryParamsName | 查询配置JSON文件名 | String | null |
|
|
40
|
-
| queryParamsJson | 查询配置文件Json,用于查询配置生成器的预览 | Object | null |
|
|
41
|
-
| logicName | 通过logic获取表单表格配置 | String | null |
|
|
42
|
-
| logicParam | 执行logic传递的参数 | Object | null |
|
|
43
|
-
| fixedQueryForm | 固定查询表单,会和查询表单合并查询 | Object | {} |
|
|
44
|
-
| fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
|
|
45
|
-
| isExports | 是否显示导出按钮 | Boolean | true |
|
|
46
|
-
| viewMode | 是否为预览模式 | Boolean | false |
|
|
47
|
-
| getDataParams | 调用logic获取数据源的追加参数 | Object | - |
|
|
48
|
-
| @action | 表格详情列的单击事件 | event | - |
|
|
49
|
-
| @afterSubmit | 增改提交后的回调方法 | event | - |
|
|
50
|
-
| @afterDelete | 删除提交后的回调方法 | event | - |
|
|
51
|
-
| @afterSearchSubmit | 查询提交后的回调方法 | event | - |
|
|
52
|
-
| @afterQuery | 表格查询后的回调方法 | event | - |
|
|
53
|
-
| @selectRow | 选择表格列后的回调方法 | event | - |
|
|
54
|
-
## 例子1
|
|
55
|
-
----
|
|
56
|
-
(基础使用)
|
|
57
|
-
|
|
58
|
-
```vue
|
|
59
|
-
<template>
|
|
60
|
-
<x-form-table
|
|
61
|
-
:queryParamsName="queryParamsName"
|
|
62
|
-
@action="toDetail">
|
|
63
|
-
</x-form-table>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<script>
|
|
67
|
-
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
68
|
-
|
|
69
|
-
export default {
|
|
70
|
-
components: {
|
|
71
|
-
XFormTable
|
|
72
|
-
},
|
|
73
|
-
data () {
|
|
74
|
-
return {
|
|
75
|
-
// 查询配置文件名
|
|
76
|
-
queryParamsName: 'logQueryParams'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
toDetail (record, id) {
|
|
81
|
-
console.debug("您选择了项:"+ id)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
</script>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
注意事项
|
|
89
|
-
----
|
|
90
|
-
|
|
91
|
-
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
92
|
-
>
|
|
93
|
-
> 本组件已支持临时表的创建,当表名以##(两个井号)开头,则认为在创建临时表。
|
|
94
|
-
>
|
|
95
|
-
> 临时表会在连接断开时自动销毁
|
|
96
|
-
>
|
|
97
|
-
> 临时表仅做展示数据用,增,改,删,需要传入对应的自定义事件。自定义处理方式
|
|
1
|
+
# XFormTable
|
|
2
|
+
|
|
3
|
+
动态查询控件,进一步整合了XTable和XForm
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 何时使用
|
|
7
|
+
|
|
8
|
+
当需要一个通用的表单,表格一体化控件时
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
引用方式:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
components: {
|
|
18
|
+
XFormTable
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 代码演示
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<x-form-table
|
|
29
|
+
title="业务名称"
|
|
30
|
+
:queryParamsName="queryParamsName">
|
|
31
|
+
</x-form-table>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
37
|
+
|--------------------|-------------------------|---------|-------|
|
|
38
|
+
| title | 业务名称 | String | '' |
|
|
39
|
+
| queryParamsName | 查询配置JSON文件名 | String | null |
|
|
40
|
+
| queryParamsJson | 查询配置文件Json,用于查询配置生成器的预览 | Object | null |
|
|
41
|
+
| logicName | 通过logic获取表单表格配置 | String | null |
|
|
42
|
+
| logicParam | 执行logic传递的参数 | Object | null |
|
|
43
|
+
| fixedQueryForm | 固定查询表单,会和查询表单合并查询 | Object | {} |
|
|
44
|
+
| fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
|
|
45
|
+
| isExports | 是否显示导出按钮 | Boolean | true |
|
|
46
|
+
| viewMode | 是否为预览模式 | Boolean | false |
|
|
47
|
+
| getDataParams | 调用logic获取数据源的追加参数 | Object | - |
|
|
48
|
+
| @action | 表格详情列的单击事件 | event | - |
|
|
49
|
+
| @afterSubmit | 增改提交后的回调方法 | event | - |
|
|
50
|
+
| @afterDelete | 删除提交后的回调方法 | event | - |
|
|
51
|
+
| @afterSearchSubmit | 查询提交后的回调方法 | event | - |
|
|
52
|
+
| @afterQuery | 表格查询后的回调方法 | event | - |
|
|
53
|
+
| @selectRow | 选择表格列后的回调方法 | event | - |
|
|
54
|
+
## 例子1
|
|
55
|
+
----
|
|
56
|
+
(基础使用)
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<template>
|
|
60
|
+
<x-form-table
|
|
61
|
+
:queryParamsName="queryParamsName"
|
|
62
|
+
@action="toDetail">
|
|
63
|
+
</x-form-table>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
components: {
|
|
71
|
+
XFormTable
|
|
72
|
+
},
|
|
73
|
+
data () {
|
|
74
|
+
return {
|
|
75
|
+
// 查询配置文件名
|
|
76
|
+
queryParamsName: 'logQueryParams'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
toDetail (record, id) {
|
|
81
|
+
console.debug("您选择了项:"+ id)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
注意事项
|
|
89
|
+
----
|
|
90
|
+
|
|
91
|
+
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
92
|
+
>
|
|
93
|
+
> 本组件已支持临时表的创建,当表名以##(两个井号)开头,则认为在创建临时表。
|
|
94
|
+
>
|
|
95
|
+
> 临时表会在连接断开时自动销毁
|
|
96
|
+
>
|
|
97
|
+
> 临时表仅做展示数据用,增,改,删,需要传入对应的自定义事件。自定义处理方式
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-modal
|
|
3
|
-
title="数据导入"
|
|
4
|
-
:visible="open"
|
|
5
|
-
:zIndex="1001"
|
|
6
|
-
:confirm-loading="uploading"
|
|
7
|
-
@cancel="importExcelHandleCancel"
|
|
8
|
-
@ok="importExcelHandleChange"
|
|
9
|
-
>
|
|
10
|
-
<a-spin tip="上传中..." :spinning="uploading">
|
|
11
|
-
<a-upload-dragger
|
|
12
|
-
name="file"
|
|
13
|
-
accept=".xlsx, .xls"
|
|
14
|
-
:file-list="fileList"
|
|
15
|
-
:multiple="false"
|
|
16
|
-
:remove="handleRemove"
|
|
17
|
-
:before-upload="beforeUpload"
|
|
18
|
-
>
|
|
19
|
-
<p class="ant-upload-drag-icon">
|
|
20
|
-
<a-icon type="inbox" />
|
|
21
|
-
</p>
|
|
22
|
-
<p class="ant-upload-text">
|
|
23
|
-
请将文件拖拽到此处上传
|
|
24
|
-
</p>
|
|
25
|
-
<p class="ant-upload-hint">
|
|
26
|
-
支持单个上传,也可以点击后选择文件上传
|
|
27
|
-
</p>
|
|
28
|
-
</a-upload-dragger>
|
|
29
|
-
<a-divider/>
|
|
30
|
-
<a-checkbox @change="handleCheckedUpdateSupport" :checked="updateSupport !== 0">
|
|
31
|
-
是否更新已经存在的数据
|
|
32
|
-
</a-checkbox>
|
|
33
|
-
<a v-if="queryParamsName !== 'none'" @click="importTemplate">下载导入模板</a>
|
|
34
|
-
</a-spin>
|
|
35
|
-
</a-modal>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
|
|
40
|
-
import { importData, download } from '@vue2-client/services/api/common'
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'XImportExcel',
|
|
44
|
-
props: {
|
|
45
|
-
serviceName: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: 'af-system'
|
|
48
|
-
},
|
|
49
|
-
queryParamsName: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: 'none'
|
|
52
|
-
},
|
|
53
|
-
// 业务名称
|
|
54
|
-
title: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: ''
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
components: {
|
|
60
|
-
},
|
|
61
|
-
data () {
|
|
62
|
-
return {
|
|
63
|
-
open: false,
|
|
64
|
-
uploadStatus: '',
|
|
65
|
-
fileList: [],
|
|
66
|
-
// 是否禁用上传
|
|
67
|
-
uploading: false,
|
|
68
|
-
updateSupport: 0
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
filters: {
|
|
72
|
-
},
|
|
73
|
-
created () {
|
|
74
|
-
},
|
|
75
|
-
computed: {
|
|
76
|
-
},
|
|
77
|
-
watch: {
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
/** 导入excel窗体关闭 */
|
|
81
|
-
importExcelHandleCancel (e) {
|
|
82
|
-
this.open = false
|
|
83
|
-
this.fileList = []
|
|
84
|
-
// 关闭后刷新列表
|
|
85
|
-
this.$emit('ok')
|
|
86
|
-
},
|
|
87
|
-
/** 下载模板操作 */
|
|
88
|
-
importTemplate () {
|
|
89
|
-
const params = {
|
|
90
|
-
queryParamsName: this.queryParamsName,
|
|
91
|
-
type: 'template'
|
|
92
|
-
}
|
|
93
|
-
download(params, this.title + `数据模板_${new Date().toLocaleString()}.xlsx`, this.serviceName)
|
|
94
|
-
},
|
|
95
|
-
/** 导入excel窗体开启 */
|
|
96
|
-
importExcelHandleOpen (e) {
|
|
97
|
-
this.open = true
|
|
98
|
-
},
|
|
99
|
-
beforeUpload (file) {
|
|
100
|
-
this.fileList = [file]
|
|
101
|
-
return false
|
|
102
|
-
},
|
|
103
|
-
/** 导入excel */
|
|
104
|
-
importExcelHandleChange () {
|
|
105
|
-
const { fileList } = this
|
|
106
|
-
const formData = new FormData()
|
|
107
|
-
if (!fileList[0]) {
|
|
108
|
-
this.$message.warn('请选择需要上传的文件')
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
this.uploading = true
|
|
112
|
-
formData.append('file', fileList[0])
|
|
113
|
-
formData.append('updateSupport', this.updateSupport)
|
|
114
|
-
importData(formData).then(response => {
|
|
115
|
-
this.fileList = []
|
|
116
|
-
this.$message.success(response.msg)
|
|
117
|
-
this.open = false
|
|
118
|
-
this.$emit('ok')
|
|
119
|
-
}).finally(() => {
|
|
120
|
-
this.uploading = false
|
|
121
|
-
})
|
|
122
|
-
},
|
|
123
|
-
handleCheckedUpdateSupport () {
|
|
124
|
-
this.updateSupport = this.updateSupport === 0 ? 1 : 0
|
|
125
|
-
},
|
|
126
|
-
handleRemove () {
|
|
127
|
-
this.fileList = []
|
|
128
|
-
this.uploading = false
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<a-modal
|
|
3
|
+
title="数据导入"
|
|
4
|
+
:visible="open"
|
|
5
|
+
:zIndex="1001"
|
|
6
|
+
:confirm-loading="uploading"
|
|
7
|
+
@cancel="importExcelHandleCancel"
|
|
8
|
+
@ok="importExcelHandleChange"
|
|
9
|
+
>
|
|
10
|
+
<a-spin tip="上传中..." :spinning="uploading">
|
|
11
|
+
<a-upload-dragger
|
|
12
|
+
name="file"
|
|
13
|
+
accept=".xlsx, .xls"
|
|
14
|
+
:file-list="fileList"
|
|
15
|
+
:multiple="false"
|
|
16
|
+
:remove="handleRemove"
|
|
17
|
+
:before-upload="beforeUpload"
|
|
18
|
+
>
|
|
19
|
+
<p class="ant-upload-drag-icon">
|
|
20
|
+
<a-icon type="inbox" />
|
|
21
|
+
</p>
|
|
22
|
+
<p class="ant-upload-text">
|
|
23
|
+
请将文件拖拽到此处上传
|
|
24
|
+
</p>
|
|
25
|
+
<p class="ant-upload-hint">
|
|
26
|
+
支持单个上传,也可以点击后选择文件上传
|
|
27
|
+
</p>
|
|
28
|
+
</a-upload-dragger>
|
|
29
|
+
<a-divider/>
|
|
30
|
+
<a-checkbox @change="handleCheckedUpdateSupport" :checked="updateSupport !== 0">
|
|
31
|
+
是否更新已经存在的数据
|
|
32
|
+
</a-checkbox>
|
|
33
|
+
<a v-if="queryParamsName !== 'none'" @click="importTemplate">下载导入模板</a>
|
|
34
|
+
</a-spin>
|
|
35
|
+
</a-modal>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
|
|
40
|
+
import { importData, download } from '@vue2-client/services/api/common'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'XImportExcel',
|
|
44
|
+
props: {
|
|
45
|
+
serviceName: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'af-system'
|
|
48
|
+
},
|
|
49
|
+
queryParamsName: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'none'
|
|
52
|
+
},
|
|
53
|
+
// 业务名称
|
|
54
|
+
title: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
components: {
|
|
60
|
+
},
|
|
61
|
+
data () {
|
|
62
|
+
return {
|
|
63
|
+
open: false,
|
|
64
|
+
uploadStatus: '',
|
|
65
|
+
fileList: [],
|
|
66
|
+
// 是否禁用上传
|
|
67
|
+
uploading: false,
|
|
68
|
+
updateSupport: 0
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
filters: {
|
|
72
|
+
},
|
|
73
|
+
created () {
|
|
74
|
+
},
|
|
75
|
+
computed: {
|
|
76
|
+
},
|
|
77
|
+
watch: {
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
/** 导入excel窗体关闭 */
|
|
81
|
+
importExcelHandleCancel (e) {
|
|
82
|
+
this.open = false
|
|
83
|
+
this.fileList = []
|
|
84
|
+
// 关闭后刷新列表
|
|
85
|
+
this.$emit('ok')
|
|
86
|
+
},
|
|
87
|
+
/** 下载模板操作 */
|
|
88
|
+
importTemplate () {
|
|
89
|
+
const params = {
|
|
90
|
+
queryParamsName: this.queryParamsName,
|
|
91
|
+
type: 'template'
|
|
92
|
+
}
|
|
93
|
+
download(params, this.title + `数据模板_${new Date().toLocaleString()}.xlsx`, this.serviceName)
|
|
94
|
+
},
|
|
95
|
+
/** 导入excel窗体开启 */
|
|
96
|
+
importExcelHandleOpen (e) {
|
|
97
|
+
this.open = true
|
|
98
|
+
},
|
|
99
|
+
beforeUpload (file) {
|
|
100
|
+
this.fileList = [file]
|
|
101
|
+
return false
|
|
102
|
+
},
|
|
103
|
+
/** 导入excel */
|
|
104
|
+
importExcelHandleChange () {
|
|
105
|
+
const { fileList } = this
|
|
106
|
+
const formData = new FormData()
|
|
107
|
+
if (!fileList[0]) {
|
|
108
|
+
this.$message.warn('请选择需要上传的文件')
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
this.uploading = true
|
|
112
|
+
formData.append('file', fileList[0])
|
|
113
|
+
formData.append('updateSupport', this.updateSupport)
|
|
114
|
+
importData(formData).then(response => {
|
|
115
|
+
this.fileList = []
|
|
116
|
+
this.$message.success(response.msg)
|
|
117
|
+
this.open = false
|
|
118
|
+
this.$emit('ok')
|
|
119
|
+
}).finally(() => {
|
|
120
|
+
this.uploading = false
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
handleCheckedUpdateSupport () {
|
|
124
|
+
this.updateSupport = this.updateSupport === 0 ? 1 : 0
|
|
125
|
+
},
|
|
126
|
+
handleRemove () {
|
|
127
|
+
this.fileList = []
|
|
128
|
+
this.uploading = false
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
@@ -102,7 +102,7 @@ import { formatDate } from '@vue2-client/utils/util'
|
|
|
102
102
|
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
103
103
|
import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
|
|
104
104
|
import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
|
|
105
|
-
import {
|
|
105
|
+
import { exportData, query, queryWithResource, remove } from '@vue2-client/services/api/common'
|
|
106
106
|
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
107
107
|
import { Modal } from 'ant-design-vue'
|
|
108
108
|
import { post } from '@vue2-client/services/api'
|
|
@@ -346,12 +346,13 @@ export default {
|
|
|
346
346
|
title: '是否确认导出?',
|
|
347
347
|
content: '此操作将导出当前条件下所有数据而非选中数据',
|
|
348
348
|
onOk () {
|
|
349
|
-
|
|
349
|
+
exportData({
|
|
350
350
|
queryParamsName: that.queryParamsName,
|
|
351
351
|
queryParams: that.queryParams,
|
|
352
|
-
form: conditionParams
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
form: conditionParams
|
|
353
|
+
}, that.serviceName).then(res => {
|
|
354
|
+
window.open('/res/excel/export/' + res.value)
|
|
355
|
+
})
|
|
355
356
|
},
|
|
356
357
|
onCancel () {}
|
|
357
358
|
})
|