vue2-client 1.9.36 → 1.9.38
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 +1 -1
- package/src/base-client/components/common/XAddNativeForm/demo.vue +1 -1
- package/src/base-client/components/common/XForm/XFormItem.vue +1 -0
- package/src/base-client/components/common/XFormTable/demo.vue +5 -4
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1 -3
- package/src/router/async/router.map.js +2 -2
- package/src/services/v3Api.js +10 -9
- package/src/utils/indexedDB.js +37 -32
- package/test/v3Api.test.js +1881 -0
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: 'Demo',
|
|
7
7
|
components: { XAddNativeForm },
|
|
8
8
|
created () {
|
|
9
|
-
getConfigByNameAsync('
|
|
9
|
+
getConfigByNameAsync('orderRepairHandlerForm', 'af-revenue').then(res => {
|
|
10
10
|
this.$refs.xAddFrom.init(res)
|
|
11
11
|
})
|
|
12
12
|
},
|
|
@@ -959,6 +959,7 @@ export default {
|
|
|
959
959
|
// 仅获取最内层数据
|
|
960
960
|
searchToListOption(searchData, res => this.getDataCallback(res))
|
|
961
961
|
} else {
|
|
962
|
+
// 其他资源通用逻辑
|
|
962
963
|
searchToOption(searchData, res => this.getDataCallback(res))
|
|
963
964
|
}
|
|
964
965
|
} else if (this.attr.keyName.indexOf('config@') !== -1) {
|
|
@@ -25,14 +25,17 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script>
|
|
28
|
-
|
|
28
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
29
29
|
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
30
30
|
export default {
|
|
31
31
|
name: 'Demo',
|
|
32
|
+
components: {
|
|
33
|
+
XFormTable
|
|
34
|
+
},
|
|
32
35
|
data () {
|
|
33
36
|
return {
|
|
34
37
|
// 查询配置文件名
|
|
35
|
-
queryParamsName: '
|
|
38
|
+
queryParamsName: 'ChargeQueryCRUD',
|
|
36
39
|
// 查询配置左侧tree
|
|
37
40
|
// xTreeConfigName: 'addressType',
|
|
38
41
|
// 新增表单固定值
|
|
@@ -58,8 +61,6 @@ export default {
|
|
|
58
61
|
}
|
|
59
62
|
},
|
|
60
63
|
computed: {
|
|
61
|
-
...mapState('account', { currUser: 'user' }),
|
|
62
|
-
...mapState('setting', { isMobile: 'isMobile' })
|
|
63
64
|
},
|
|
64
65
|
}
|
|
65
66
|
</script>
|
|
@@ -113,9 +113,7 @@
|
|
|
113
113
|
</template>
|
|
114
114
|
</template>
|
|
115
115
|
</template>
|
|
116
|
-
<
|
|
117
|
-
<span :key="imgIndex" style="margin-right: 5%">{{ img.name }}</span>
|
|
118
|
-
</template>
|
|
116
|
+
<span v-else v-for="(img,imgIndex) in getDeepObject(configData.images, cell.dataIndex)" :key="imgIndex" style="margin-right: 5%">{{ img.name }}</span>
|
|
119
117
|
</template>
|
|
120
118
|
</a-col>
|
|
121
119
|
</template>
|
|
@@ -85,8 +85,8 @@ routerResource.example = {
|
|
|
85
85
|
name: '示例页面',
|
|
86
86
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
87
87
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
88
|
-
|
|
89
|
-
component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
88
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
89
|
+
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
90
90
|
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
92
92
|
meta: {
|
package/src/services/v3Api.js
CHANGED
|
@@ -3,6 +3,9 @@ import { runLogic } from '@vue2-client/services/api/common'
|
|
|
3
3
|
|
|
4
4
|
function getLeafNodes (nodes) {
|
|
5
5
|
let leaves = []
|
|
6
|
+
if (!(nodes instanceof Array)) {
|
|
7
|
+
nodes = [nodes]
|
|
8
|
+
}
|
|
6
9
|
nodes.forEach(node => {
|
|
7
10
|
if (node.children && node.children.length) {
|
|
8
11
|
leaves = leaves.concat(getLeafNodes(node.children))
|
|
@@ -46,19 +49,17 @@ function getResData (params, toCallback) {
|
|
|
46
49
|
export async function searchToOption (params, callback) {
|
|
47
50
|
function toCallback (res) {
|
|
48
51
|
if (res.length) {
|
|
49
|
-
if (res[0].children) {
|
|
50
|
-
if (res[0].children.
|
|
51
|
-
|
|
52
|
-
callback(transformData(res[0].children[0].children))
|
|
53
|
-
} else {
|
|
54
|
-
callback(transformData(res[0].children))
|
|
55
|
-
}
|
|
52
|
+
if (res[0].children && res[0].children.length) {
|
|
53
|
+
if (res[0].children[0].children) {
|
|
54
|
+
callback(transformData(res[0].children[0].children))
|
|
56
55
|
} else {
|
|
57
|
-
callback(res[0].children)
|
|
56
|
+
callback(transformData(res[0].children))
|
|
58
57
|
}
|
|
59
58
|
} else {
|
|
60
|
-
callback(res)
|
|
59
|
+
callback(res[0].children)
|
|
61
60
|
}
|
|
61
|
+
} else {
|
|
62
|
+
callback(res)
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
|
package/src/utils/indexedDB.js
CHANGED
|
@@ -178,41 +178,46 @@ export const indexedDB = {
|
|
|
178
178
|
// 创建一个新的 Promise
|
|
179
179
|
locks[key] = new Promise((resolve, reject) => {
|
|
180
180
|
const self = this
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
181
|
+
|
|
182
|
+
const handlePostRequest = () => {
|
|
183
|
+
post(url, params).then((res) => {
|
|
184
|
+
if (processFun) { res = processFun(res) }
|
|
185
|
+
if (process.env.NODE_ENV === 'production' || key !== 'webMobileConfig') { self.add(key, res) }
|
|
186
|
+
try {
|
|
187
|
+
callback(res)
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.error(e)
|
|
190
|
+
}
|
|
191
|
+
resolve()
|
|
192
|
+
}).catch((e) => {
|
|
193
|
+
if (process.env.NODE_ENV === 'production' && key !== 'webMobileConfig') { self.add(key, null) }
|
|
194
|
+
callback(null)
|
|
195
|
+
resolve()
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
try {
|
|
200
|
+
self.openDB((res) => {
|
|
201
|
+
const store = res.transaction('metaCache', 'readwrite').objectStore('metaCache')
|
|
202
|
+
const request = store.get(key)
|
|
203
|
+
request.onerror = function (e) {
|
|
204
|
+
reject(e)
|
|
205
|
+
}
|
|
206
|
+
request.onsuccess = function (e) {
|
|
207
|
+
const result = e.target.result
|
|
208
|
+
if (!result && url) {
|
|
209
|
+
handlePostRequest()
|
|
210
|
+
} else {
|
|
211
|
+
callback(result.data)
|
|
205
212
|
resolve()
|
|
206
|
-
}
|
|
207
|
-
} else {
|
|
208
|
-
callback(result.data)
|
|
209
|
-
// 解锁这个键
|
|
210
|
-
resolve()
|
|
213
|
+
}
|
|
211
214
|
}
|
|
212
|
-
}
|
|
213
|
-
})
|
|
215
|
+
})
|
|
216
|
+
} catch (e) {
|
|
217
|
+
console.error('indexDb数据库操作错误', e)
|
|
218
|
+
handlePostRequest()
|
|
219
|
+
}
|
|
214
220
|
}).finally(() => {
|
|
215
|
-
// 移除这个键的锁
|
|
216
221
|
delete locks[key]
|
|
217
222
|
})
|
|
218
223
|
},
|