Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev

This commit is contained in:
梁朝伟 2022-06-30 17:49:46 +08:00
commit 37f32b0ba5
14 changed files with 433 additions and 425 deletions

View File

@ -1,6 +1,6 @@
// index.ts // index.ts
OakPage({ export default OakPage({
path: 'address:list', path: 'address:list',
entity: 'address', entity: 'address',
projection: { projection: {
@ -23,21 +23,21 @@ OakPage({
}, },
isList: true, isList: true,
formData: async ({ data }) => ({ formData: async ({ data }) => ({
addresses: data.map( addresses: data.map((address) => ({
(address) => ({ name: address?.name!,
name: address?.name!, phone: address?.phone!,
phone: address?.phone!, districtName: address?.area?.name!,
districtName: address?.area?.name!, areaText:
areaText: address?.area && `${address?.area?.parent?.parent?.name}${address?.area?.parent?.name}${address?.area?.name}`, address?.area &&
detail: address?.detail, `${address?.area?.parent?.parent?.name}${address?.area?.parent?.name}${address?.area?.name}`,
}) detail: address?.detail,
), })),
}), }),
methods: { methods: {
goNewAddress() { goNewAddress() {
this.navigateTo({ this.navigateTo({
url: '../upsert/index', url: '../upsert/index',
}); });
} },
} },
}); });

View File

@ -1,5 +1,5 @@
OakPage({ export default OakPage({
path: 'address:upsert', path: 'address:upsert',
entity: 'address', entity: 'address',
projection: { projection: {
@ -28,12 +28,14 @@ OakPage({
// provinceName: address?.area?.parent.parent.name, // provinceName: address?.area?.parent.parent.name,
districtName: address?.area?.name!, districtName: address?.area?.name!,
area: address?.area, area: address?.area,
areaText: address?.area && `${address?.area?.parent?.parent?.name}${address?.area?.parent?.name}${address?.area?.name}`, areaText:
address?.area &&
`${address?.area?.parent?.parent?.name}${address?.area?.parent?.name}${address?.area?.name}`,
detail: address?.detail, detail: address?.detail,
}), }),
methods: { methods: {
setValue(input: any) { setValue(input: any) {
const { dataset, value} = this.resolveInput(input); const { dataset, value } = this.resolveInput(input);
this.setUpdateData(dataset!.attr, value); this.setUpdateData(dataset!.attr, value);
}, },
callAreaPicker() { callAreaPicker() {
@ -42,13 +44,13 @@ OakPage({
}); });
}, },
async confirm() { async confirm() {
await this.execute(this.props.oakId ? 'update': 'create'); await this.execute(this.props.oakId ? 'update' : 'create');
if (this.props.oakFrom === 'address:list') { if (this.props.oakFrom === 'address:list') {
this.navigateBack(); this.navigateBack();
} }
}, },
reset() { reset() {
this.resetUpdateData(); this.resetUpdateData();
} },
} },
}); });

View File

@ -1,6 +1,6 @@
import { composeFileUrl } from '../../../../src/utils/extraFile'; import { composeFileUrl } from '../../../../src/utils/extraFile';
OakPage({ export default OakPage({
path: 'mobile:me', path: 'mobile:me',
entity: 'mobile', entity: 'mobile',
isList: true, isList: true,
@ -19,13 +19,12 @@ OakPage({
}); });
try { try {
console.log(e.detail.code); console.log(e.detail.code);
} } catch (err) {
catch (err) {
console.error(err); console.error(err);
} }
this.setState({ this.setState({
refreshing: false, refreshing: false,
}); });
} },
} },
}); });

View File

@ -1,5 +1,5 @@
OakPage({ export default OakPage({
path: 'area:picker', path: 'area:picker',
entity: 'area', entity: 'area',
projection: { projection: {
@ -14,8 +14,8 @@ OakPage({
parent: { parent: {
level: 'country', level: 'country',
}, },
} },
} },
], ],
isList: true, isList: true,
formData: async ({ data: arealist }) => ({ formData: async ({ data: arealist }) => ({
@ -29,21 +29,22 @@ OakPage({
onItemClicked(input: any) { onItemClicked(input: any) {
// resolveInput里用的是target原来的代码用的是currentTarget可能有问题 // resolveInput里用的是target原来的代码用的是currentTarget可能有问题
const { dataset } = this.resolveInput(input); const { dataset } = this.resolveInput(input);
const item = (this.state.arealist!).find( const item = this.state.arealist!.find(
(ele) => ele?.id === dataset!.id (ele) => ele?.id === dataset!.id
); );
const { depth, id } = item!; const { depth, id } = item!;
if (depth !== this.props.depth) { if (depth !== this.props.depth) {
this.setFilters([{ this.setFilters([
filter: { {
parentId: id, filter: {
} parentId: id,
}]); },
} },
else { ]);
} else {
this.setForeignKey(id!); this.setForeignKey(id!);
} }
} },
} },
}); });

View File

@ -1,4 +1,4 @@
OakPage({ export default OakPage({
path: 'token:login', path: 'token:login',
entity: 'token', entity: 'token',
projection: { projection: {
@ -19,7 +19,7 @@ OakPage({
} }
return { return {
loggedIn: false, loggedIn: false,
} };
}, },
methods: { methods: {
async onLoginClicked(options: WechatMiniprogram.Touch) { async onLoginClicked(options: WechatMiniprogram.Touch) {
@ -30,6 +30,6 @@ OakPage({
onReturnClicked() { onReturnClicked() {
this.navigateBack(); this.navigateBack();
} },
} },
}); });

View File

@ -1,125 +1,123 @@
import { ROOT_ROLE_ID } from '../../../../src/constants'; import { ROOT_ROLE_ID } from '../../../../src/constants';
import { composeFileUrl } from '../../../../src/utils/extraFile'; import { composeFileUrl } from '../../../../src/utils/extraFile';
OakPage( export default OakPage({
{ path: 'token:me',
path: 'token:me', entity: 'token',
entity: 'token', isList: true,
isList: true, projection: {
projection: { id: 1,
userId: 1,
playerId: 1,
user: {
id: 1, id: 1,
userId: 1, nickname: 1,
playerId: 1, name: 1,
user: { extraFile$entity: {
id: 1, $entity: 'extraFile',
nickname: 1, data: {
name: 1, id: 1,
extraFile$entity: { tag1: 1,
$entity: 'extraFile', origin: 1,
data: { bucket: 1,
id: 1, objectId: 1,
tag1: 1, filename: 1,
origin: 1, extra1: 1,
bucket: 1, type: 1,
objectId: 1, entity: 1,
filename: 1, extension: 1,
extra1: 1,
type: 1,
entity: 1,
extension: 1,
},
filter: {
tag1: 'avatar',
},
indexFrom: 0,
count: 1,
}, },
mobile$user: { filter: {
$entity: 'mobile', tag1: 'avatar',
data: {
id: 1,
mobile: 1,
},
}, },
indexFrom: 0,
count: 1,
}, },
player: { mobile$user: {
id: 1, $entity: 'mobile',
userRole$user: { data: {
$entity: 'userRole', id: 1,
data: { mobile: 1,
id: 1,
userId: 1,
roleId: 1,
},
}, },
}, },
}, },
formData: async ({ data: [token] }) => { player: {
const user = token?.user; id: 1,
const player = token?.player; userRole$user: {
const avatarFile = $entity: 'userRole',
user && user.extraFile$entity && user.extraFile$entity[0]; data: {
const avatar = avatarFile && composeFileUrl(avatarFile); id: 1,
const nickname = user && user.nickname; userId: 1,
const mobileData = user && user.mobile$user && user.mobile$user[0]; roleId: 1,
const { mobile } = mobileData || {}; },
const mobileCount = user?.mobile$user?.length || 0; },
},
},
formData: async ({ data: [token] }) => {
const user = token?.user;
const player = token?.player;
const avatarFile =
user && user.extraFile$entity && user.extraFile$entity[0];
const avatar = avatarFile && composeFileUrl(avatarFile);
const nickname = user && user.nickname;
const mobileData = user && user.mobile$user && user.mobile$user[0];
const { mobile } = mobileData || {};
const mobileCount = user?.mobile$user?.length || 0;
const isLoggedIn = !!token; const isLoggedIn = !!token;
const isPlayingAnother = token && token.userId !== token.playerId; const isPlayingAnother = token && token.userId !== token.playerId;
const isRoot = const isRoot =
player?.userRole$user && player?.userRole$user &&
player.userRole$user[0].roleId === ROOT_ROLE_ID; player.userRole$user[0].roleId === ROOT_ROLE_ID;
return { return {
avatar, avatar,
nickname, nickname,
mobile, mobile,
mobileCount, mobileCount,
isLoggedIn, isLoggedIn,
isPlayingAnother, isPlayingAnother,
isRoot, isRoot,
}; };
},
data: {
refreshing: false,
},
methods: {
async onRefresh() {
this.setState({
refreshing: true,
});
try {
await this.features.token.syncUserInfoWechatMp();
} catch (err) {
console.error(err);
}
this.setState({
refreshing: false,
});
}, },
data: { async doLogin() {
refreshing: false, this.setState({
refreshing: true,
});
try {
await this.features.token.loginWechatMp();
} catch (err) {
console.error(err);
}
this.setState({
refreshing: false,
});
}, },
methods: { goMyMobile() {
async onRefresh() { this.navigateTo({
this.setState({ url: '../../mobile/me/index',
refreshing: true, });
});
try {
await this.features.token.syncUserInfoWechatMp();
} catch (err) {
console.error(err);
}
this.setState({
refreshing: false,
});
},
async doLogin() {
this.setState({
refreshing: true,
});
try {
await this.features.token.loginWechatMp();
} catch (err) {
console.error(err);
}
this.setState({
refreshing: false,
});
},
goMyMobile() {
this.navigateTo({
url: '../../mobile/me/index',
});
},
goUserManage() {
this.navigateTo({
url: '../../user/manage/index',
});
},
}, },
} goUserManage() {
); this.navigateTo({
url: '../../user/manage/index',
});
},
},
});

View File

@ -2,173 +2,171 @@
import { composeFileUrl } from "../../../../../src/utils/extraFile"; import { composeFileUrl } from "../../../../../src/utils/extraFile";
OakPage( export default OakPage({
{ path: 'user:manage:detail',
path: 'user:manage:detail', entity: 'user',
entity: 'user', projection: {
projection: { id: 1,
id: 1, nickname: 1,
nickname: 1, name: 1,
name: 1, userState: 1,
userState: 1, idState: 1,
idState: 1, extraFile$entity: {
extraFile$entity: { $entity: 'extraFile',
$entity: 'extraFile', data: {
data: { id: 1,
id: 1, tag1: 1,
tag1: 1, origin: 1,
origin: 1, bucket: 1,
bucket: 1, objectId: 1,
objectId: 1, filename: 1,
filename: 1, extra1: 1,
extra1: 1, type: 1,
type: 1, entity: 1,
entity: 1, extension: 1,
extension: 1,
},
filter: {
tag1: 'avatar',
},
indexFrom: 0,
count: 1,
}, },
mobile$user: { filter: {
$entity: 'mobile', tag1: 'avatar',
data: { },
id: 1, indexFrom: 0,
mobile: 1, count: 1,
}, },
mobile$user: {
$entity: 'mobile',
data: {
id: 1,
mobile: 1,
}, },
}, },
isList: false, },
formData: async ({ data: user }) => { isList: false,
const { formData: async ({ data: user }) => {
id, const {
nickname, id,
idState, nickname,
userState, idState,
name, userState,
mobile$user, name,
extraFile$entity, mobile$user,
} = user || {}; extraFile$entity,
const mobile = mobile$user && mobile$user[0]?.mobile; } = user || {};
const avatar = const mobile = mobile$user && mobile$user[0]?.mobile;
extraFile$entity && const avatar =
extraFile$entity[0] && extraFile$entity &&
composeFileUrl(extraFile$entity[0]); extraFile$entity[0] &&
return { composeFileUrl(extraFile$entity[0]);
id, return {
nickname, id,
name, nickname,
mobile, name,
avatar, mobile,
userState, avatar,
idState, userState,
}; idState,
}, };
actions: [ },
'accept', actions: [
'activate', 'accept',
'disable', 'activate',
'enable', 'disable',
'remove', 'enable',
'update', 'remove',
'verify', 'update',
'play', 'verify',
], 'play',
data: { ],
show: false, data: {
actionDescriptions: { show: false,
accept: { actionDescriptions: {
icon: { accept: {
name: 'pan_tool', icon: {
}, name: 'pan_tool',
label: '通过',
}, },
activate: { label: '通过',
icon: { },
name: 'check', activate: {
}, icon: {
label: '激活', name: 'check',
}, },
disable: { label: '激活',
icon: { },
name: 'flash_off', disable: {
}, icon: {
label: '禁用', name: 'flash_off',
}, },
enable: { label: '禁用',
icon: { },
name: 'flash_on', enable: {
}, icon: {
label: '启用', name: 'flash_on',
}, },
remove: { label: '启用',
icon: { },
name: 'clear', remove: {
}, icon: {
label: '删除', name: 'clear',
}, },
update: { label: '删除',
icon: { },
name: 'edit', update: {
}, icon: {
label: '更新', name: 'edit',
}, },
verify: { label: '更新',
icon: { },
name: 'how_to_reg', verify: {
}, icon: {
label: '验证', name: 'how_to_reg',
}, },
play: { label: '验证',
icon: { },
name: 'play_circle', play: {
}, icon: {
label: '切换', name: 'play_circle',
}, },
label: '切换',
}, },
}, },
methods: { },
openDrawer() { methods: {
this.setState({ openDrawer() {
show: true, this.setState({
}); show: true,
}, });
closeDrawer() { },
this.setState({ closeDrawer() {
show: false, this.setState({
}); show: false,
}, });
async onActionClick({ detail }: WechatMiniprogram.CustomEvent) { },
const { action } = detail; async onActionClick({ detail }: WechatMiniprogram.CustomEvent) {
switch (action) { const { action } = detail;
case 'update': { switch (action) {
this.navigateTo({ case 'update': {
url: '../upsert/index', this.navigateTo({
oakId: this.props.oakId, url: '../upsert/index',
}); oakId: this.props.oakId,
return;
}
case 'enable':
case 'disable':
case 'accept':
case 'verify':
case 'activate':
case 'play': {
await this.execute(action);
break;
}
default: {
console.error(`尚未实现的action: ${action}`);
}
}
if (action === 'play') {
this.navigateBack({
delta: 2,
}); });
return;
} }
}, case 'enable':
case 'disable':
case 'accept':
case 'verify':
case 'activate':
case 'play': {
await this.execute(action);
break;
}
default: {
console.error(`尚未实现的action: ${action}`);
}
}
if (action === 'play') {
this.navigateBack({
delta: 2,
});
}
}, },
} },
); });

View File

@ -2,87 +2,85 @@
import { composeFileUrl } from "../../../../src/utils/extraFile"; import { composeFileUrl } from "../../../../src/utils/extraFile";
OakPage( export default OakPage({
{ path: 'user:manage',
path: 'user:manage', entity: 'user',
entity: 'user', projection: {
projection: { id: 1,
id: 1, nickname: 1,
nickname: 1, name: 1,
name: 1, userState: 1,
userState: 1, extraFile$entity: {
extraFile$entity: { $entity: 'extraFile',
$entity: 'extraFile', data: {
data: { id: 1,
id: 1, tag1: 1,
tag1: 1, origin: 1,
origin: 1, bucket: 1,
bucket: 1, objectId: 1,
objectId: 1, filename: 1,
filename: 1, extra1: 1,
extra1: 1, type: 1,
type: 1, entity: 1,
entity: 1, extension: 1,
extension: 1,
},
filter: {
tag1: 'avatar',
},
indexFrom: 0,
count: 1,
}, },
mobile$user: { filter: {
$entity: 'mobile', tag1: 'avatar',
data: { },
id: 1, indexFrom: 0,
mobile: 1, count: 1,
}, },
mobile$user: {
$entity: 'mobile',
data: {
id: 1,
mobile: 1,
}, },
}, },
isList: true, },
formData: async ({ data: users }) => { isList: true,
const userData = users.map((user) => { formData: async ({ data: users }) => {
const { const userData = users.map((user) => {
id, const {
nickname, id,
userState, nickname,
name, userState,
mobile$user, name,
extraFile$entity, mobile$user,
} = user || {}; extraFile$entity,
const mobile = mobile$user && mobile$user[0]?.mobile; } = user || {};
const avatar = const mobile = mobile$user && mobile$user[0]?.mobile;
extraFile$entity && const avatar =
extraFile$entity[0] && extraFile$entity &&
composeFileUrl(extraFile$entity[0]); extraFile$entity[0] &&
return { composeFileUrl(extraFile$entity[0]);
id,
nickname,
name,
mobile,
avatar,
userState,
};
});
return { return {
userData, id,
nickname,
name,
mobile,
avatar,
userState,
}; };
});
return {
userData,
};
},
methods: {
goUserManageDetail(input: any) {
// resolveInput拿的是target原来代码拿的是currentTarget
const { dataset } = this.resolveInput(input);
const { id } = dataset!;
this.navigateTo({
url: 'detail/index',
oakId: id,
});
}, },
methods: { goNewUser() {
goUserManageDetail(input: any) { this.navigateTo({
// resolveInput拿的是target原来代码拿的是currentTarget url: 'upsert/index',
const { dataset } = this.resolveInput(input); });
const { id } = dataset!;
this.navigateTo({
url: 'detail/index',
oakId: id,
});
},
goNewUser() {
this.navigateTo({
url: 'upsert/index',
});
},
}, },
} },
); });

View File

@ -19,7 +19,7 @@ const IDCardTypeOptions = [
} }
]; ];
OakPage({ export default OakPage({
path: 'user:manage:upsert', path: 'user:manage:upsert',
entity: 'user', entity: 'user',
projection: { projection: {
@ -35,31 +35,31 @@ OakPage({
isList: false, isList: false,
formData: async ({ data: user }) => { formData: async ({ data: user }) => {
const { birth, gender, idCardType } = user || {}; const { birth, gender, idCardType } = user || {};
const birthText = birth && (new Date(birth)).toLocaleDateString(); const birthText = birth && new Date(birth).toLocaleDateString();
const GenderDict = { const GenderDict = {
male: '男', male: '男',
female: '女', female: '女',
}; };
const genderText = gender && GenderDict[gender]; const genderText = gender && GenderDict[gender];
const genderIndex = gender && GenderOptions.find( const genderIndex =
ele => ele.value === gender gender && GenderOptions.find((ele) => ele.value === gender);
);
const IdCardTypeDict = { const IdCardTypeDict = {
'ID-Card': '身份证', 'ID-Card': '身份证',
'passport': '护照', passport: '护照',
'Mainland-passport': '港澳通行证', 'Mainland-passport': '港澳通行证',
}; };
const idCardTypeText = idCardType && IdCardTypeDict[idCardType]; const idCardTypeText = idCardType && IdCardTypeDict[idCardType];
const idCardTypeIndex = idCardType && IDCardTypeOptions.find( const idCardTypeIndex =
ele => ele.value === gender idCardType && IDCardTypeOptions.find((ele) => ele.value === gender);
);
const now = new Date(); const now = new Date();
return Object.assign({}, user, { return Object.assign({}, user, {
birthText, birthText,
genderText, genderText,
idCardTypeText, idCardTypeText,
oldestBirthday: `${now.getFullYear() - 120}-01-01`, oldestBirthday: `${now.getFullYear() - 120}-01-01`,
today: `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`, today: `${now.getFullYear()}-${
now.getMonth() + 1
}-${now.getDate()}`,
genderIndex, genderIndex,
idCardTypeIndex, idCardTypeIndex,
}); });
@ -69,7 +69,7 @@ OakPage({
IDCardTypeOptions, IDCardTypeOptions,
}, },
methods: { methods: {
setValue(input:any) { setValue(input: any) {
const { dataset, value } = this.resolveInput(input); const { dataset, value } = this.resolveInput(input);
this.setUpdateData(dataset!.attr, value); this.setUpdateData(dataset!.attr, value);
}, },
@ -84,17 +84,23 @@ OakPage({
}, },
onGenderChange(input: any) { onGenderChange(input: any) {
const { value } = this.resolveInput(input); const { value } = this.resolveInput(input);
this.setUpdateData('gender', GenderOptions[value as unknown as number].value) this.setUpdateData(
'gender',
GenderOptions[value as unknown as number].value
);
}, },
onIdCardTypeChange(input: any) { onIdCardTypeChange(input: any) {
const { value } = this.resolveInput(input); const { value } = this.resolveInput(input);
this.setUpdateData('idCardType', IDCardTypeOptions[value as unknown as number].value) this.setUpdateData(
'idCardType',
IDCardTypeOptions[value as unknown as number].value
);
}, },
async confirm() { async confirm() {
await this.execute(this.props.oakId ? 'update': 'create'); await this.execute(this.props.oakId ? 'update' : 'create');
if (this.props.oakFrom === 'user:manage:list') { if (this.props.oakFrom === 'user:manage:list') {
this.navigateBack(); this.navigateBack();
} }
} },
} },
}); });

View File

@ -1,5 +1,5 @@
OakPage({ export default OakPage({
path: 'userEntityGrant:confirm', path: 'userEntityGrant:confirm',
entity: 'userEntityGrant', entity: 'userEntityGrant',
projection: { projection: {
@ -7,14 +7,14 @@ OakPage({
relation: 1, relation: 1,
}, },
isList: false, isList: false,
formData: async ({data: userEntityGrant}) => { formData: async ({ data: userEntityGrant }) => {
return { return {
relation: userEntityGrant?.relation, relation: userEntityGrant?.relation,
} };
}, },
methods: { methods: {
handleConfirm() { handleConfirm() {
this.execute('confirm'); this.execute('confirm');
} },
} },
}); });

View File

@ -1,5 +1,5 @@
OakPage({ export default OakPage({
path: 'userEntityGrant:detail', path: 'userEntityGrant:detail',
entity: 'userEntityGrant', entity: 'userEntityGrant',
projection: { projection: {
@ -17,7 +17,7 @@ OakPage({
id: 1, id: 1,
entity: 1, entity: 1,
entityId: 1, entityId: 1,
type: 1,//类型 type: 1, //类型
ticket: 1, ticket: 1,
url: 1, url: 1,
buffer: 1, buffer: 1,
@ -41,7 +41,8 @@ OakPage({
for (let i = 0; i < str.length; i++) { for (let i = 0; i < str.length; i++) {
buf2[i] = str.charCodeAt(i); buf2[i] = str.charCodeAt(i);
} }
qrCodeUrl = 'data:image/jpeg;base64,' + wx.arrayBufferToBase64(buf2); qrCodeUrl =
'data:image/jpeg;base64,' + wx.arrayBufferToBase64(buf2);
} }
return { return {
relation: userEntityGrant?.relation, relation: userEntityGrant?.relation,

View File

@ -1,7 +1,7 @@
import { EntityDict } from 'general-app-domain'; import { EntityDict } from 'general-app-domain';
import { DeduceCreateOperation, DeduceCreateSingleOperation, OakException, OakCongruentRowExists } from "oak-domain/lib/types"; import { DeduceCreateOperation, DeduceCreateSingleOperation, OakException, OakCongruentRowExists } from "oak-domain/lib/types";
OakPage({ export default OakPage({
path: 'userEntityGrant:upsert', path: 'userEntityGrant:upsert',
entity: 'userEntityGrant', entity: 'userEntityGrant',
@ -17,7 +17,7 @@ OakPage({
}, },
isList: false, isList: false,
formData: async ({ data: userEntityGrant }) => ({ formData: async ({ data: userEntityGrant }) => ({
...userEntityGrant ...userEntityGrant,
}), }),
properties: { properties: {
entity: String, entity: String,
@ -25,8 +25,7 @@ OakPage({
relations: String, relations: String,
type: String, type: String,
}, },
data: { data: {},
},
lifetimes: { lifetimes: {
ready() { ready() {
this.setUpdateData('entity', this.props.entity); this.setUpdateData('entity', this.props.entity);
@ -34,8 +33,8 @@ OakPage({
this.setUpdateData('type', this.props.type); this.setUpdateData('type', this.props.type);
this.setState({ this.setState({
relationArr: JSON.parse(this.props.relations), relationArr: JSON.parse(this.props.relations),
}) });
} },
}, },
methods: { methods: {
radioChange(input: any) { radioChange(input: any) {
@ -49,18 +48,24 @@ OakPage({
[OakCongruentRowExists.name] [OakCongruentRowExists.name]
); );
const { data } = result as DeduceCreateSingleOperation<EntityDict['userEntityGrant']['OpSchema']>; const { data } = result as DeduceCreateSingleOperation<
EntityDict['userEntityGrant']['OpSchema']
>;
const { id } = data; const { id } = data;
this.navigateTo({ this.navigateTo({
url: '../detail/index', url: '../detail/index',
oakId: id, oakId: id,
}); });
} } catch (error) {
catch (error) { if (
if ((<OakException>error).constructor.name === OakCongruentRowExists.name) { (<OakException>error).constructor.name ===
OakCongruentRowExists.name
) {
// 这里由于编译的问题用instanceof会不通过检查 // 这里由于编译的问题用instanceof会不通过检查
const data = (<OakCongruentRowExists<EntityDict, 'userEntityGrant'>>error).getData(); const data = (<
OakCongruentRowExists<EntityDict, 'userEntityGrant'>
>error).getData();
this.navigateTo({ this.navigateTo({
url: '../detail/index', url: '../detail/index',
oakId: data.id, oakId: data.id,
@ -68,5 +73,5 @@ OakPage({
} }
} }
}, },
} },
}); });

View File

@ -1,6 +1,6 @@
import { composeFileUrl } from '../../../../src/utils/extraFile'; import { composeFileUrl } from '../../../../src/utils/extraFile';
OakPage( export default OakPage(
{ {
path: 'userRelation:list', path: 'userRelation:list',
entity: 'user', entity: 'user',

View File

@ -1,7 +1,7 @@
import { expandUuidTo36Bytes } from 'oak-domain/lib/utils/uuid' import { expandUuidTo36Bytes } from 'oak-domain/lib/utils/uuid'
OakPage( export default OakPage(
{ {
path: 'wechatQrCode:scan', path: 'wechatQrCode:scan',
entity: 'wechatQrCode', entity: 'wechatQrCode',