vue2-client 1.4.2 → 1.4.4
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/.env +15 -15
- package/.eslintrc.js +82 -82
- package/CHANGELOG.md +343 -339
- package/index.js +30 -30
- package/package.json +78 -78
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +113 -113
- package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -244
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +589 -543
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +777 -777
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +310 -310
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
- 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/PersonSetting/PersonSetting.vue +210 -210
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +354 -354
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +327 -327
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +274 -274
- package/src/base-client/components/common/XForm/XFormItem.vue +389 -389
- package/src/base-client/components/common/XFormTable/XFormTable.vue +543 -543
- package/src/base-client/components/common/XFormTable/index.md +96 -96
- package/src/base-client/components/common/XTable/XTable.vue +259 -259
- 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 +69 -69
- 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/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/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/replacer/resolve.config.js +67 -67
- package/src/layouts/AdminLayout.vue +174 -174
- package/src/layouts/header/AdminHeader.vue +104 -104
- package/src/layouts/header/HeaderNotice.vue +167 -167
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- 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/CreateQueryPage.vue +65 -65
- 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/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/queryParams/index.vue +43 -43
- package/src/router/async/config.async.js +27 -27
- package/src/router/async/router.map.js +2 -0
- 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/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/manage.js +8 -8
- package/src/services/api/restTools.js +24 -24
- package/src/store/mutation-types.js +2 -2
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +47 -47
- package/src/utils/colors.js +103 -103
- 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/request.js +225 -225
- package/src/utils/routerUtil.js +364 -364
- 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 +2 -2
|
@@ -1,259 +1,259 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-row :gutter="48">
|
|
4
|
-
<a-col>
|
|
5
|
-
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
6
|
-
<slot name="expand"></slot>
|
|
7
|
-
</span>
|
|
8
|
-
</a-col>
|
|
9
|
-
<a-col>
|
|
10
|
-
<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
|
|
11
|
-
<a-button-group>
|
|
12
|
-
<a-button @click="toggleIsFormShow">
|
|
13
|
-
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
14
|
-
</a-button>
|
|
15
|
-
<a-button @click="refresh(true)">
|
|
16
|
-
<a-icon :style="iconStyle" type="reload" />
|
|
17
|
-
</a-button>
|
|
18
|
-
<table-setting v-model="tableColumns" />
|
|
19
|
-
</a-button-group>
|
|
20
|
-
</span>
|
|
21
|
-
</a-col>
|
|
22
|
-
</a-row>
|
|
23
|
-
<s-table
|
|
24
|
-
ref="table"
|
|
25
|
-
:alert="true"
|
|
26
|
-
:columns="tableColumns"
|
|
27
|
-
:data="loadData"
|
|
28
|
-
:rowKey="rowKey"
|
|
29
|
-
:rowSelection="rowSelection"
|
|
30
|
-
:scroll="{ x: scrollXWidth, y: scrollYWidth }"
|
|
31
|
-
:showPagination="showPagination"
|
|
32
|
-
size="default"
|
|
33
|
-
>
|
|
34
|
-
<template
|
|
35
|
-
v-for="(item, index) in tableColumns"
|
|
36
|
-
:slot="item.dataIndex"
|
|
37
|
-
slot-scope="text, record">
|
|
38
|
-
<!-- 文本溢出省略(ellipsis) -->
|
|
39
|
-
<span v-if="item.slotType === 'ellipsis'" :key="index">
|
|
40
|
-
<ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
|
|
41
|
-
</span>
|
|
42
|
-
<!-- 徽标(badge) -->
|
|
43
|
-
<span v-else-if="item.slotType === 'badge'" :key="index">
|
|
44
|
-
<x-badge :badge-key="item.slotKeyMap" :value="text" />
|
|
45
|
-
</span>
|
|
46
|
-
<!-- 日期(date) -->
|
|
47
|
-
<span v-else-if="item.slotType === 'date'" :key="index">
|
|
48
|
-
{{ format(text,'yyyy-MM-dd') }}
|
|
49
|
-
</span>
|
|
50
|
-
<!-- 日期时间(datetime) -->
|
|
51
|
-
<span v-else-if="item.slotType === 'dateTime'" :key="index">
|
|
52
|
-
{{ format(text,'yyyy-MM-dd hh:mm:ss') }}
|
|
53
|
-
</span>
|
|
54
|
-
<!-- 操作列(action) -->
|
|
55
|
-
<span v-else-if="item.slotType === 'action'" :key="index">
|
|
56
|
-
<a @click="action(record)">{{ item.slotValue }}</a>
|
|
57
|
-
</span>
|
|
58
|
-
</template>
|
|
59
|
-
</s-table>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
<script>
|
|
63
|
-
import { Ellipsis, STable } from '@vue2-client/components'
|
|
64
|
-
import { formatDate } from '@vue2-client/utils/util'
|
|
65
|
-
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
66
|
-
import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
|
|
67
|
-
|
|
68
|
-
export default {
|
|
69
|
-
name: 'XTable',
|
|
70
|
-
components: {
|
|
71
|
-
TableSetting,
|
|
72
|
-
STable,
|
|
73
|
-
Ellipsis,
|
|
74
|
-
XBadge
|
|
75
|
-
},
|
|
76
|
-
data () {
|
|
77
|
-
return {
|
|
78
|
-
// 加载数据方法 必须为 Promise 对象
|
|
79
|
-
loadData: parameter => {
|
|
80
|
-
// 取到表格携带的表单参数
|
|
81
|
-
const requestParameters = Object.assign({}, parameter)
|
|
82
|
-
// 取到父组件传入的表单参数
|
|
83
|
-
const conditionParams = Object.assign(this.fixedQueryForm, this.form)
|
|
84
|
-
// 如果适用了综合筛选表单,则进行数据处理
|
|
85
|
-
if (conditionParams.rowIdName) {
|
|
86
|
-
const rowIdName = conditionParams.rowIdName
|
|
87
|
-
const rowIdValue = conditionParams.rowIdValue
|
|
88
|
-
delete conditionParams.rowIdName
|
|
89
|
-
delete conditionParams.rowIdValue
|
|
90
|
-
if (rowIdValue) {
|
|
91
|
-
conditionParams[rowIdName] = rowIdValue
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// 如果传了燃气公司字段,则进行数据处理
|
|
95
|
-
if (conditionParams.orgName) {
|
|
96
|
-
requestParameters.orgName = conditionParams.orgName
|
|
97
|
-
delete conditionParams.orgName
|
|
98
|
-
}
|
|
99
|
-
requestParameters.conditionParams = conditionParams
|
|
100
|
-
requestParameters.queryParamsName = this.queryParamsName
|
|
101
|
-
requestParameters.queryParams = this.queryParams
|
|
102
|
-
// 加载数据
|
|
103
|
-
return this.loadTableData(requestParameters)
|
|
104
|
-
},
|
|
105
|
-
rowKey: undefined,
|
|
106
|
-
scrollXWidth: 1600,
|
|
107
|
-
scrollYWidth: 437,
|
|
108
|
-
selectedRowKeys: [],
|
|
109
|
-
selectedRows: [],
|
|
110
|
-
// 数据列
|
|
111
|
-
tableColumns: this.jsonData,
|
|
112
|
-
// 是否显示展示列抽屉
|
|
113
|
-
visible: false,
|
|
114
|
-
loading: false,
|
|
115
|
-
dataSource: [],
|
|
116
|
-
// 图标样式
|
|
117
|
-
iconStyle: {
|
|
118
|
-
position: 'relative',
|
|
119
|
-
top: '1px'
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
watch: {
|
|
124
|
-
form (rel) {
|
|
125
|
-
this.form = rel
|
|
126
|
-
this.refresh(true)
|
|
127
|
-
},
|
|
128
|
-
jsonData () {
|
|
129
|
-
this.initTableParams()
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
props: {
|
|
133
|
-
jsonData: {
|
|
134
|
-
type: Array,
|
|
135
|
-
default: () => {
|
|
136
|
-
return []
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
queryParamsName: {
|
|
140
|
-
type: String,
|
|
141
|
-
default: () => {
|
|
142
|
-
return ''
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
// 查询参数对象, 用于没有对应查询配置文件名时
|
|
146
|
-
queryParams: {
|
|
147
|
-
type: Object,
|
|
148
|
-
default: null
|
|
149
|
-
},
|
|
150
|
-
form: {
|
|
151
|
-
type: Object,
|
|
152
|
-
default: () => {
|
|
153
|
-
return {}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
// 固定查询表单
|
|
157
|
-
fixedQueryForm: {
|
|
158
|
-
type: Object,
|
|
159
|
-
default: () => {
|
|
160
|
-
return {}
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
// 按钮
|
|
164
|
-
buttonState: {
|
|
165
|
-
type: Object,
|
|
166
|
-
default: () => {
|
|
167
|
-
return undefined
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
171
|
-
showPagination: {
|
|
172
|
-
type: Boolean,
|
|
173
|
-
default: true
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
computed: {
|
|
177
|
-
rowSelection () {
|
|
178
|
-
return {
|
|
179
|
-
selectedRowKeys: this.selectedRowKeys,
|
|
180
|
-
onChange: this.onSelectChange
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
mounted () {
|
|
185
|
-
this.initTableParams()
|
|
186
|
-
},
|
|
187
|
-
methods: {
|
|
188
|
-
badgeFilter (key, value) {
|
|
189
|
-
return this.$appdata.getParam(key, value)
|
|
190
|
-
},
|
|
191
|
-
initTableParams () {
|
|
192
|
-
let totalWidth = 0
|
|
193
|
-
this.rowKey = this.tableColumns[0].dataIndex
|
|
194
|
-
for (let i = 0; i < this.tableColumns.length; i++) {
|
|
195
|
-
const item = this.tableColumns[i]
|
|
196
|
-
if (item.dataIndex === 'action') {
|
|
197
|
-
item.fixed = 'right'
|
|
198
|
-
item.width = 70
|
|
199
|
-
}
|
|
200
|
-
if (item.width) {
|
|
201
|
-
totalWidth = totalWidth + item.width
|
|
202
|
-
} else {
|
|
203
|
-
totalWidth = totalWidth + 180
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
const width = document.documentElement.clientWidth
|
|
207
|
-
if (width >= 1600) {
|
|
208
|
-
this.scrollYWidth = 429
|
|
209
|
-
} else if (width >= 1200) {
|
|
210
|
-
this.scrollYWidth = 390
|
|
211
|
-
} else {
|
|
212
|
-
this.scrollYWidth = 343
|
|
213
|
-
}
|
|
214
|
-
// 横向滚动长度大于所有宽度,才能实现固定表头
|
|
215
|
-
this.scrollXWidth = totalWidth
|
|
216
|
-
},
|
|
217
|
-
loadTableData (requestParameters) {
|
|
218
|
-
let data = []
|
|
219
|
-
this.$emit('loadData', requestParameters, val => {
|
|
220
|
-
data = val
|
|
221
|
-
})
|
|
222
|
-
const _this = this
|
|
223
|
-
data.then(res => {
|
|
224
|
-
_this.dataSource = res.data
|
|
225
|
-
})
|
|
226
|
-
return data
|
|
227
|
-
},
|
|
228
|
-
action (record) {
|
|
229
|
-
this.$emit('action', record, record[this.jsonData[0].dataIndex])
|
|
230
|
-
},
|
|
231
|
-
onSelectChange (selectedRowKeys, selectedRows) {
|
|
232
|
-
this.selectedRowKeys = selectedRowKeys
|
|
233
|
-
this.selectedRows = selectedRows
|
|
234
|
-
this.$emit('selectRow', selectedRowKeys)
|
|
235
|
-
},
|
|
236
|
-
clearRowKeys () {
|
|
237
|
-
this.$refs.table.clearSelected()
|
|
238
|
-
},
|
|
239
|
-
/**
|
|
240
|
-
* 表格重新加载方法
|
|
241
|
-
* 如果参数为 true, 则强制刷新到第一页
|
|
242
|
-
*/
|
|
243
|
-
refresh (bool) {
|
|
244
|
-
this.$refs.table.refresh(bool)
|
|
245
|
-
},
|
|
246
|
-
format (date, format) {
|
|
247
|
-
return formatDate(date, format)
|
|
248
|
-
},
|
|
249
|
-
showDrawer () {
|
|
250
|
-
this.visible = true
|
|
251
|
-
},
|
|
252
|
-
toggleIsFormShow () {
|
|
253
|
-
this.$emit('toggleIsFormShow')
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
</script>
|
|
258
|
-
<style lang="less" scoped>
|
|
259
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-row :gutter="48">
|
|
4
|
+
<a-col>
|
|
5
|
+
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
6
|
+
<slot name="expand"></slot>
|
|
7
|
+
</span>
|
|
8
|
+
</a-col>
|
|
9
|
+
<a-col>
|
|
10
|
+
<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
|
|
11
|
+
<a-button-group>
|
|
12
|
+
<a-button @click="toggleIsFormShow">
|
|
13
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
14
|
+
</a-button>
|
|
15
|
+
<a-button @click="refresh(true)">
|
|
16
|
+
<a-icon :style="iconStyle" type="reload" />
|
|
17
|
+
</a-button>
|
|
18
|
+
<table-setting v-model="tableColumns" />
|
|
19
|
+
</a-button-group>
|
|
20
|
+
</span>
|
|
21
|
+
</a-col>
|
|
22
|
+
</a-row>
|
|
23
|
+
<s-table
|
|
24
|
+
ref="table"
|
|
25
|
+
:alert="true"
|
|
26
|
+
:columns="tableColumns"
|
|
27
|
+
:data="loadData"
|
|
28
|
+
:rowKey="rowKey"
|
|
29
|
+
:rowSelection="rowSelection"
|
|
30
|
+
:scroll="{ x: scrollXWidth, y: scrollYWidth }"
|
|
31
|
+
:showPagination="showPagination"
|
|
32
|
+
size="default"
|
|
33
|
+
>
|
|
34
|
+
<template
|
|
35
|
+
v-for="(item, index) in tableColumns"
|
|
36
|
+
:slot="item.dataIndex"
|
|
37
|
+
slot-scope="text, record">
|
|
38
|
+
<!-- 文本溢出省略(ellipsis) -->
|
|
39
|
+
<span v-if="item.slotType === 'ellipsis'" :key="index">
|
|
40
|
+
<ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
|
|
41
|
+
</span>
|
|
42
|
+
<!-- 徽标(badge) -->
|
|
43
|
+
<span v-else-if="item.slotType === 'badge'" :key="index">
|
|
44
|
+
<x-badge :badge-key="item.slotKeyMap" :value="text" />
|
|
45
|
+
</span>
|
|
46
|
+
<!-- 日期(date) -->
|
|
47
|
+
<span v-else-if="item.slotType === 'date'" :key="index">
|
|
48
|
+
{{ format(text,'yyyy-MM-dd') }}
|
|
49
|
+
</span>
|
|
50
|
+
<!-- 日期时间(datetime) -->
|
|
51
|
+
<span v-else-if="item.slotType === 'dateTime'" :key="index">
|
|
52
|
+
{{ format(text,'yyyy-MM-dd hh:mm:ss') }}
|
|
53
|
+
</span>
|
|
54
|
+
<!-- 操作列(action) -->
|
|
55
|
+
<span v-else-if="item.slotType === 'action'" :key="index">
|
|
56
|
+
<a @click="action(record)">{{ item.slotValue }}</a>
|
|
57
|
+
</span>
|
|
58
|
+
</template>
|
|
59
|
+
</s-table>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
<script>
|
|
63
|
+
import { Ellipsis, STable } from '@vue2-client/components'
|
|
64
|
+
import { formatDate } from '@vue2-client/utils/util'
|
|
65
|
+
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
66
|
+
import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
name: 'XTable',
|
|
70
|
+
components: {
|
|
71
|
+
TableSetting,
|
|
72
|
+
STable,
|
|
73
|
+
Ellipsis,
|
|
74
|
+
XBadge
|
|
75
|
+
},
|
|
76
|
+
data () {
|
|
77
|
+
return {
|
|
78
|
+
// 加载数据方法 必须为 Promise 对象
|
|
79
|
+
loadData: parameter => {
|
|
80
|
+
// 取到表格携带的表单参数
|
|
81
|
+
const requestParameters = Object.assign({}, parameter)
|
|
82
|
+
// 取到父组件传入的表单参数
|
|
83
|
+
const conditionParams = Object.assign(this.fixedQueryForm, this.form)
|
|
84
|
+
// 如果适用了综合筛选表单,则进行数据处理
|
|
85
|
+
if (conditionParams.rowIdName) {
|
|
86
|
+
const rowIdName = conditionParams.rowIdName
|
|
87
|
+
const rowIdValue = conditionParams.rowIdValue
|
|
88
|
+
delete conditionParams.rowIdName
|
|
89
|
+
delete conditionParams.rowIdValue
|
|
90
|
+
if (rowIdValue) {
|
|
91
|
+
conditionParams[rowIdName] = rowIdValue
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// 如果传了燃气公司字段,则进行数据处理
|
|
95
|
+
if (conditionParams.orgName) {
|
|
96
|
+
requestParameters.orgName = conditionParams.orgName
|
|
97
|
+
delete conditionParams.orgName
|
|
98
|
+
}
|
|
99
|
+
requestParameters.conditionParams = conditionParams
|
|
100
|
+
requestParameters.queryParamsName = this.queryParamsName
|
|
101
|
+
requestParameters.queryParams = this.queryParams
|
|
102
|
+
// 加载数据
|
|
103
|
+
return this.loadTableData(requestParameters)
|
|
104
|
+
},
|
|
105
|
+
rowKey: undefined,
|
|
106
|
+
scrollXWidth: 1600,
|
|
107
|
+
scrollYWidth: 437,
|
|
108
|
+
selectedRowKeys: [],
|
|
109
|
+
selectedRows: [],
|
|
110
|
+
// 数据列
|
|
111
|
+
tableColumns: this.jsonData,
|
|
112
|
+
// 是否显示展示列抽屉
|
|
113
|
+
visible: false,
|
|
114
|
+
loading: false,
|
|
115
|
+
dataSource: [],
|
|
116
|
+
// 图标样式
|
|
117
|
+
iconStyle: {
|
|
118
|
+
position: 'relative',
|
|
119
|
+
top: '1px'
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
watch: {
|
|
124
|
+
form (rel) {
|
|
125
|
+
this.form = rel
|
|
126
|
+
this.refresh(true)
|
|
127
|
+
},
|
|
128
|
+
jsonData () {
|
|
129
|
+
this.initTableParams()
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
props: {
|
|
133
|
+
jsonData: {
|
|
134
|
+
type: Array,
|
|
135
|
+
default: () => {
|
|
136
|
+
return []
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
queryParamsName: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: () => {
|
|
142
|
+
return ''
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
// 查询参数对象, 用于没有对应查询配置文件名时
|
|
146
|
+
queryParams: {
|
|
147
|
+
type: Object,
|
|
148
|
+
default: null
|
|
149
|
+
},
|
|
150
|
+
form: {
|
|
151
|
+
type: Object,
|
|
152
|
+
default: () => {
|
|
153
|
+
return {}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
// 固定查询表单
|
|
157
|
+
fixedQueryForm: {
|
|
158
|
+
type: Object,
|
|
159
|
+
default: () => {
|
|
160
|
+
return {}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
// 按钮
|
|
164
|
+
buttonState: {
|
|
165
|
+
type: Object,
|
|
166
|
+
default: () => {
|
|
167
|
+
return undefined
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
171
|
+
showPagination: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
computed: {
|
|
177
|
+
rowSelection () {
|
|
178
|
+
return {
|
|
179
|
+
selectedRowKeys: this.selectedRowKeys,
|
|
180
|
+
onChange: this.onSelectChange
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
mounted () {
|
|
185
|
+
this.initTableParams()
|
|
186
|
+
},
|
|
187
|
+
methods: {
|
|
188
|
+
badgeFilter (key, value) {
|
|
189
|
+
return this.$appdata.getParam(key, value)
|
|
190
|
+
},
|
|
191
|
+
initTableParams () {
|
|
192
|
+
let totalWidth = 0
|
|
193
|
+
this.rowKey = this.tableColumns[0].dataIndex
|
|
194
|
+
for (let i = 0; i < this.tableColumns.length; i++) {
|
|
195
|
+
const item = this.tableColumns[i]
|
|
196
|
+
if (item.dataIndex === 'action') {
|
|
197
|
+
item.fixed = 'right'
|
|
198
|
+
item.width = 70
|
|
199
|
+
}
|
|
200
|
+
if (item.width) {
|
|
201
|
+
totalWidth = totalWidth + item.width
|
|
202
|
+
} else {
|
|
203
|
+
totalWidth = totalWidth + 180
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const width = document.documentElement.clientWidth
|
|
207
|
+
if (width >= 1600) {
|
|
208
|
+
this.scrollYWidth = 429
|
|
209
|
+
} else if (width >= 1200) {
|
|
210
|
+
this.scrollYWidth = 390
|
|
211
|
+
} else {
|
|
212
|
+
this.scrollYWidth = 343
|
|
213
|
+
}
|
|
214
|
+
// 横向滚动长度大于所有宽度,才能实现固定表头
|
|
215
|
+
this.scrollXWidth = totalWidth
|
|
216
|
+
},
|
|
217
|
+
loadTableData (requestParameters) {
|
|
218
|
+
let data = []
|
|
219
|
+
this.$emit('loadData', requestParameters, val => {
|
|
220
|
+
data = val
|
|
221
|
+
})
|
|
222
|
+
const _this = this
|
|
223
|
+
data.then(res => {
|
|
224
|
+
_this.dataSource = res.data
|
|
225
|
+
})
|
|
226
|
+
return data
|
|
227
|
+
},
|
|
228
|
+
action (record) {
|
|
229
|
+
this.$emit('action', record, record[this.jsonData[0].dataIndex])
|
|
230
|
+
},
|
|
231
|
+
onSelectChange (selectedRowKeys, selectedRows) {
|
|
232
|
+
this.selectedRowKeys = selectedRowKeys
|
|
233
|
+
this.selectedRows = selectedRows
|
|
234
|
+
this.$emit('selectRow', selectedRowKeys)
|
|
235
|
+
},
|
|
236
|
+
clearRowKeys () {
|
|
237
|
+
this.$refs.table.clearSelected()
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* 表格重新加载方法
|
|
241
|
+
* 如果参数为 true, 则强制刷新到第一页
|
|
242
|
+
*/
|
|
243
|
+
refresh (bool) {
|
|
244
|
+
this.$refs.table.refresh(bool)
|
|
245
|
+
},
|
|
246
|
+
format (date, format) {
|
|
247
|
+
return formatDate(date, format)
|
|
248
|
+
},
|
|
249
|
+
showDrawer () {
|
|
250
|
+
this.visible = true
|
|
251
|
+
},
|
|
252
|
+
toggleIsFormShow () {
|
|
253
|
+
this.$emit('toggleIsFormShow')
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
</script>
|
|
258
|
+
<style lang="less" scoped>
|
|
259
|
+
</style>
|