vue2-client 1.7.12 → 1.7.14
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
CHANGED
package/package.json
CHANGED
|
@@ -2,46 +2,53 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
4
|
<div v-show="!loading">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<slot
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<slot
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<slot
|
|
36
|
-
|
|
37
|
-
<a-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<slot
|
|
43
|
-
|
|
44
|
-
|
|
5
|
+
<template v-if="!loadError">
|
|
6
|
+
<x-add-form
|
|
7
|
+
ref="xAddForm"
|
|
8
|
+
@onSubmit="onAddOrEditSubmit"
|
|
9
|
+
/>
|
|
10
|
+
<x-form
|
|
11
|
+
ref="xForm"
|
|
12
|
+
style="margin-bottom: 14px;"
|
|
13
|
+
@onSubmit="onSearchSubmit">
|
|
14
|
+
<slot name="formBtnExpand"></slot>
|
|
15
|
+
</x-form>
|
|
16
|
+
<x-table
|
|
17
|
+
ref="xTable"
|
|
18
|
+
:fixedQueryForm="fixedQueryForm"
|
|
19
|
+
:queryParamsName="queryParamsName"
|
|
20
|
+
:query-params-json="queryParamsJson"
|
|
21
|
+
:show-pagination="showPagination"
|
|
22
|
+
@add="add"
|
|
23
|
+
@edit="edit"
|
|
24
|
+
@afterDelete="afterDelete"
|
|
25
|
+
@action="action"
|
|
26
|
+
@selectRow="selectRow"
|
|
27
|
+
@afterQuery="afterQuery"
|
|
28
|
+
@tempTableEdit="tempTableEdit">
|
|
29
|
+
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
|
30
|
+
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
31
|
+
</template>
|
|
32
|
+
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
|
33
|
+
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
34
|
+
</template>
|
|
35
|
+
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
|
36
|
+
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
37
|
+
<a-button @click="toggleIsFormShow">
|
|
38
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
39
|
+
</a-button>
|
|
40
|
+
</template>
|
|
41
|
+
<!-- 底部插槽 -->
|
|
42
|
+
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
|
43
|
+
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
44
|
+
</template>
|
|
45
|
+
</x-table>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-else>
|
|
48
|
+
<a-empty>
|
|
49
|
+
<span slot="description"> 页面配置不存在,请联系系统管理员 </span>
|
|
50
|
+
</a-empty>
|
|
51
|
+
</template>
|
|
45
52
|
</div>
|
|
46
53
|
</div>
|
|
47
54
|
</template>
|
|
@@ -70,6 +77,7 @@ export default {
|
|
|
70
77
|
position: 'relative',
|
|
71
78
|
top: '1px'
|
|
72
79
|
},
|
|
80
|
+
loadError: false,
|
|
73
81
|
// 实际查询配置内容
|
|
74
82
|
realQueryConfig: {}
|
|
75
83
|
}
|
|
@@ -143,44 +151,51 @@ export default {
|
|
|
143
151
|
watch: {
|
|
144
152
|
logicParam: {
|
|
145
153
|
handler () {
|
|
146
|
-
this.
|
|
154
|
+
this.initConfig()
|
|
147
155
|
},
|
|
148
156
|
deep: true
|
|
149
157
|
},
|
|
150
158
|
queryParamsJson: {
|
|
151
159
|
handler () {
|
|
152
|
-
this.
|
|
160
|
+
this.initConfig()
|
|
153
161
|
},
|
|
154
162
|
deep: true
|
|
155
163
|
},
|
|
156
164
|
queryParamsName: {
|
|
157
165
|
handler () {
|
|
158
|
-
this.
|
|
166
|
+
this.initConfig()
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
},
|
|
162
170
|
created () {
|
|
163
|
-
|
|
164
|
-
this.getConfig()
|
|
165
|
-
} else if (this.queryParamsJson) {
|
|
166
|
-
this.getConfigBySource()
|
|
167
|
-
}
|
|
171
|
+
this.initConfig()
|
|
168
172
|
},
|
|
169
173
|
methods: {
|
|
170
|
-
|
|
174
|
+
initConfig () {
|
|
171
175
|
this.loading = true
|
|
176
|
+
this.loadError = false
|
|
177
|
+
if (this.queryParamsName) {
|
|
178
|
+
this.getConfig()
|
|
179
|
+
} else if (this.queryParamsJson) {
|
|
180
|
+
this.getConfigBySource()
|
|
181
|
+
} else if (this.logicName && this.logicParam) {
|
|
182
|
+
this.getColumnJsonByLogic()
|
|
183
|
+
} else {
|
|
184
|
+
this.loading = false
|
|
185
|
+
this.loadError = true
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
getConfig () {
|
|
172
189
|
getConfig(this.queryParamsName, this.serviceName, (res) => {
|
|
173
190
|
this.updateComponents(res)
|
|
174
191
|
})
|
|
175
192
|
},
|
|
176
193
|
getConfigBySource () {
|
|
177
|
-
this.loading = true
|
|
178
194
|
parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName).then(res => {
|
|
179
195
|
this.updateComponents(res, true)
|
|
180
196
|
})
|
|
181
197
|
},
|
|
182
198
|
getColumnJsonByLogic () {
|
|
183
|
-
this.loading = true
|
|
184
199
|
getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
|
|
185
200
|
this.updateComponents(res, true)
|
|
186
201
|
})
|
package/src/utils/indexedDB.js
CHANGED
|
@@ -92,7 +92,7 @@ export const indexedDB = {
|
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
94
|
},
|
|
95
|
-
getByWeb: function (key, url, params, callback,
|
|
95
|
+
getByWeb: function (key, url, params, callback, processFun) {
|
|
96
96
|
const self = this
|
|
97
97
|
self.openDB((res) => {
|
|
98
98
|
// 根据存储空间的键找到对应数据
|
|
@@ -105,10 +105,12 @@ export const indexedDB = {
|
|
|
105
105
|
const result = e.target.result
|
|
106
106
|
if (!result && url) {
|
|
107
107
|
post(url, params).then((res) => {
|
|
108
|
-
if (
|
|
109
|
-
res =
|
|
108
|
+
if (processFun) {
|
|
109
|
+
res = processFun(res)
|
|
110
|
+
}
|
|
111
|
+
if (process.env.NODE_ENV === 'production' || key !== 'webConfig') {
|
|
112
|
+
self.add(key, res)
|
|
110
113
|
}
|
|
111
|
-
self.add(key, res)
|
|
112
114
|
callback(res)
|
|
113
115
|
})
|
|
114
116
|
} else {
|