vue2-client 1.8.184 → 1.8.186
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
|
@@ -456,10 +456,10 @@ export default {
|
|
|
456
456
|
this.getData({}, res => this.getDataCallback(res))
|
|
457
457
|
} if (this.attr.keyName && this.attr.keyName.indexOf('search@') !== -1) {
|
|
458
458
|
// `tool.getFullTree(this.getRights().where(row.getType()==$organization$))`
|
|
459
|
-
|
|
460
|
-
source: this.attr.keyName.substring(
|
|
459
|
+
searchToOption({
|
|
460
|
+
source: this.attr.keyName.substring(7),
|
|
461
461
|
userid: this.currUser.id
|
|
462
|
-
}))
|
|
462
|
+
}, res => this.getDataCallback(res))
|
|
463
463
|
} else if (this.attr.keyName && this.attr.keyName.indexOf('config@') !== -1) {
|
|
464
464
|
const configName = this.attr.keyName.substring(7)
|
|
465
465
|
getConfigByName(configName, this.serviceName, res => {
|
|
@@ -319,7 +319,7 @@ export default {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
if (!this.isTableTemp) {
|
|
322
|
-
result = query(Object.assign(requestParameters, { userId: this.currUser
|
|
322
|
+
result = query(Object.assign(requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
323
323
|
}
|
|
324
324
|
this.clearRowKeys()
|
|
325
325
|
this.$emit('afterQuery', result, requestParameters.conditionParams)
|
package/src/services/v3Api.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { METHOD, request } from '@vue2-client/utils/request'
|
|
2
2
|
|
|
3
|
-
export async function searchToOption (params) {
|
|
3
|
+
export async function searchToOption (params, callback) {
|
|
4
4
|
return search(params).then(res => {
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
label: item.name,
|
|
8
|
-
value: item.id
|
|
9
|
-
}
|
|
10
|
-
})
|
|
5
|
+
callback(transformData(res[0]?.children[0]?.children || []))
|
|
11
6
|
})
|
|
12
7
|
}
|
|
13
8
|
|
|
@@ -15,4 +10,15 @@ export async function search (params) {
|
|
|
15
10
|
return request('/rs/search', METHOD.POST, params)
|
|
16
11
|
}
|
|
17
12
|
|
|
13
|
+
function transformData (inputData) {
|
|
14
|
+
function transform (node) {
|
|
15
|
+
return {
|
|
16
|
+
label: node.name,
|
|
17
|
+
value: node.id,
|
|
18
|
+
children: node.children ? node.children.map(transform) : []
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return inputData.map(transform)
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
export default { searchToOption, search }
|