userEntityGrant/claim
This commit is contained in:
parent
5ab4a332b8
commit
3ded7d897a
|
|
@ -46,11 +46,11 @@ export default OakComponent({
|
|||
data: {
|
||||
pickedRowIds: [],
|
||||
pickedRelationIds: [],
|
||||
onPickRelationsMp: (ids) => {
|
||||
this.onPickRelations(ids);
|
||||
onPickRelationsMp(ids) {
|
||||
(this).onPickRelations(ids);
|
||||
},
|
||||
onPickRowsMp: (ids) => {
|
||||
this.onPickRows(ids);
|
||||
onPickRowsMp(ids) {
|
||||
(this).onPickRows(ids);
|
||||
}
|
||||
},
|
||||
formData({ data }) {
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ export default OakComponent({
|
|||
},
|
||||
data: {
|
||||
relations: [],
|
||||
onPickRelationsMp: (val) => {
|
||||
onPickRelationsMp(val) {
|
||||
this.props.onPickRelations(val);
|
||||
},
|
||||
onPickRowsMp: (val) => {
|
||||
onPickRowsMp(val) {
|
||||
this.props.onPickRows(val);
|
||||
}
|
||||
},
|
||||
|
|
@ -74,6 +74,10 @@ export default OakComponent({
|
|||
label: this.t(`${entity}:r.${r.name}`),
|
||||
value: r.id,
|
||||
})),
|
||||
rowOption: data.map(ele => ({
|
||||
value: ele.id,
|
||||
label: (ele.name || ele.title || ele.id),
|
||||
})),
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,14 @@
|
|||
<block wx:else>
|
||||
<view class="info-title">
|
||||
{{t('pickRow', { entity: t(entity + ':name') })}}
|
||||
</view>
|
||||
</view>
|
||||
<check-list
|
||||
option="{{rowOption}}"
|
||||
value="{{pickedRowIds || []}}"
|
||||
multiple="{{rule !== 'single'}}"
|
||||
disabled="{{disablePickRow || disabled}}"
|
||||
onSelect="{{onPickRowsMp}}"
|
||||
/>
|
||||
</block>
|
||||
<view class="info-title">
|
||||
{{t('pickRelation.' + pickRelationRule)}}
|
||||
|
|
|
|||
|
|
@ -59,15 +59,21 @@ export default OakComponent({
|
|||
};
|
||||
},
|
||||
data: {
|
||||
pickedRowIds: [] as string[],
|
||||
pickedRelationIds: [] as string[],
|
||||
onPickRelationsMp: (ids: string[]) => {
|
||||
(this as any).onPickRelations(ids);
|
||||
pickedRowIds: [],
|
||||
pickedRelationIds: [],
|
||||
onPickRelationsMp(ids: string[]) {
|
||||
(this).onPickRelations(ids);
|
||||
},
|
||||
onPickRowsMp: (ids: string[]) => {
|
||||
(this as any).onPickRows(ids);
|
||||
onPickRowsMp(ids: string[]) {
|
||||
(this).onPickRows(ids);
|
||||
}
|
||||
},
|
||||
} as {
|
||||
pickedRowIds: string[];
|
||||
pickedRelationIds: string[];
|
||||
} & ThisType<{
|
||||
onPickRelations(ids: string[]): void;
|
||||
onPickRows(ids: string[]): void;
|
||||
}>,
|
||||
formData({ data }) {
|
||||
const userId = this.features.token.getUserId();
|
||||
const isGranter = userId === data?.granterId;
|
||||
|
|
|
|||
|
|
@ -51,14 +51,21 @@ export default OakComponent({
|
|||
pickedRelationIds: [] as string[] | undefined,
|
||||
},
|
||||
data: {
|
||||
relations: [] as EntityDict['relation']['OpSchema'][],
|
||||
onPickRelationsMp: (val: string[]) => {
|
||||
(this as any).props.onPickRelations!(val);
|
||||
relations: [],
|
||||
onPickRelationsMp(val: string[]) {
|
||||
this.props.onPickRelations(val);
|
||||
},
|
||||
onPickRowsMp: (val: string[]) => {
|
||||
(this as any).props.onPickRows!(val);
|
||||
onPickRowsMp(val: string[]) {
|
||||
this.props.onPickRows(val);
|
||||
}
|
||||
},
|
||||
} as {
|
||||
relations: EntityDict['relation']['OpSchema'][];
|
||||
} & ThisType<{
|
||||
props: {
|
||||
onPickRelations: (val: string[]) => void;
|
||||
onPickRows: (val: string[]) => void;
|
||||
}
|
||||
}>,
|
||||
formData({ data }) {
|
||||
if (data) {
|
||||
const { rule, ruleOnRow, relationIds, entity } = this.props;
|
||||
|
|
@ -79,6 +86,10 @@ export default OakComponent({
|
|||
value: r.id,
|
||||
})
|
||||
),
|
||||
rowOption: (data as any[]).map(ele => ({
|
||||
value: ele.id,
|
||||
label: (ele.name || ele.title || ele.id) as string,
|
||||
})),
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,14 @@
|
|||
<block wx:else>
|
||||
<view class="info-title">
|
||||
{{t('pickRow', { entity: t(entity + ':name') })}}
|
||||
</view>
|
||||
</view>
|
||||
<check-list
|
||||
option="{{rowOption}}"
|
||||
value="{{pickedRowIds || []}}"
|
||||
multiple="{{rule !== 'single'}}"
|
||||
disabled="{{disablePickRow || disabled}}"
|
||||
onSelect="{{onPickRowsMp}}"
|
||||
/>
|
||||
</block>
|
||||
<view class="info-title">
|
||||
{{t('pickRelation.' + pickRelationRule)}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue