Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
37f32b0ba5
|
|
@ -1,6 +1,6 @@
|
|||
// index.ts
|
||||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'address:list',
|
||||
entity: 'address',
|
||||
projection: {
|
||||
|
|
@ -23,21 +23,21 @@ OakPage({
|
|||
},
|
||||
isList: true,
|
||||
formData: async ({ data }) => ({
|
||||
addresses: data.map(
|
||||
(address) => ({
|
||||
addresses: data.map((address) => ({
|
||||
name: address?.name!,
|
||||
phone: address?.phone!,
|
||||
districtName: address?.area?.name!,
|
||||
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,
|
||||
})
|
||||
),
|
||||
})),
|
||||
}),
|
||||
methods: {
|
||||
goNewAddress() {
|
||||
this.navigateTo({
|
||||
url: '../upsert/index',
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'address:upsert',
|
||||
entity: 'address',
|
||||
projection: {
|
||||
|
|
@ -28,7 +28,9 @@ OakPage({
|
|||
// provinceName: address?.area?.parent.parent.name,
|
||||
districtName: address?.area?.name!,
|
||||
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,
|
||||
}),
|
||||
methods: {
|
||||
|
|
@ -49,6 +51,6 @@ OakPage({
|
|||
},
|
||||
reset() {
|
||||
this.resetUpdateData();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { composeFileUrl } from '../../../../src/utils/extraFile';
|
||||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'mobile:me',
|
||||
entity: 'mobile',
|
||||
isList: true,
|
||||
|
|
@ -19,13 +19,12 @@ OakPage({
|
|||
});
|
||||
try {
|
||||
console.log(e.detail.code);
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
this.setState({
|
||||
refreshing: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'area:picker',
|
||||
entity: 'area',
|
||||
projection: {
|
||||
|
|
@ -14,8 +14,8 @@ OakPage({
|
|||
parent: {
|
||||
level: 'country',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
isList: true,
|
||||
formData: async ({ data: arealist }) => ({
|
||||
|
|
@ -29,21 +29,22 @@ OakPage({
|
|||
onItemClicked(input: any) {
|
||||
// resolveInput里用的是target,原来的代码用的是currentTarget,可能有问题
|
||||
const { dataset } = this.resolveInput(input);
|
||||
const item = (this.state.arealist!).find(
|
||||
const item = this.state.arealist!.find(
|
||||
(ele) => ele?.id === dataset!.id
|
||||
);
|
||||
|
||||
const { depth, id } = item!;
|
||||
if (depth !== this.props.depth) {
|
||||
this.setFilters([{
|
||||
this.setFilters([
|
||||
{
|
||||
filter: {
|
||||
parentId: id,
|
||||
}
|
||||
}]);
|
||||
}
|
||||
else {
|
||||
},
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
this.setForeignKey(id!);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'token:login',
|
||||
entity: 'token',
|
||||
projection: {
|
||||
|
|
@ -19,7 +19,7 @@ OakPage({
|
|||
}
|
||||
return {
|
||||
loggedIn: false,
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async onLoginClicked(options: WechatMiniprogram.Touch) {
|
||||
|
|
@ -30,6 +30,6 @@ OakPage({
|
|||
|
||||
onReturnClicked() {
|
||||
this.navigateBack();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import { ROOT_ROLE_ID } from '../../../../src/constants';
|
||||
import { composeFileUrl } from '../../../../src/utils/extraFile';
|
||||
|
||||
OakPage(
|
||||
{
|
||||
export default OakPage({
|
||||
path: 'token:me',
|
||||
entity: 'token',
|
||||
isList: true,
|
||||
|
|
@ -121,5 +120,4 @@ OakPage(
|
|||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
import { composeFileUrl } from "../../../../../src/utils/extraFile";
|
||||
|
||||
OakPage(
|
||||
{
|
||||
export default OakPage({
|
||||
path: 'user:manage:detail',
|
||||
entity: 'user',
|
||||
projection: {
|
||||
|
|
@ -170,5 +169,4 @@ OakPage(
|
|||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
import { composeFileUrl } from "../../../../src/utils/extraFile";
|
||||
|
||||
OakPage(
|
||||
{
|
||||
export default OakPage({
|
||||
path: 'user:manage',
|
||||
entity: 'user',
|
||||
projection: {
|
||||
|
|
@ -84,5 +83,4 @@ OakPage(
|
|||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
@ -19,7 +19,7 @@ const IDCardTypeOptions = [
|
|||
}
|
||||
];
|
||||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'user:manage:upsert',
|
||||
entity: 'user',
|
||||
projection: {
|
||||
|
|
@ -35,31 +35,31 @@ OakPage({
|
|||
isList: false,
|
||||
formData: async ({ data: user }) => {
|
||||
const { birth, gender, idCardType } = user || {};
|
||||
const birthText = birth && (new Date(birth)).toLocaleDateString();
|
||||
const birthText = birth && new Date(birth).toLocaleDateString();
|
||||
const GenderDict = {
|
||||
male: '男',
|
||||
female: '女',
|
||||
};
|
||||
const genderText = gender && GenderDict[gender];
|
||||
const genderIndex = gender && GenderOptions.find(
|
||||
ele => ele.value === gender
|
||||
);
|
||||
const genderIndex =
|
||||
gender && GenderOptions.find((ele) => ele.value === gender);
|
||||
const IdCardTypeDict = {
|
||||
'ID-Card': '身份证',
|
||||
'passport': '护照',
|
||||
passport: '护照',
|
||||
'Mainland-passport': '港澳通行证',
|
||||
};
|
||||
const idCardTypeText = idCardType && IdCardTypeDict[idCardType];
|
||||
const idCardTypeIndex = idCardType && IDCardTypeOptions.find(
|
||||
ele => ele.value === gender
|
||||
);
|
||||
const idCardTypeIndex =
|
||||
idCardType && IDCardTypeOptions.find((ele) => ele.value === gender);
|
||||
const now = new Date();
|
||||
return Object.assign({}, user, {
|
||||
birthText,
|
||||
genderText,
|
||||
idCardTypeText,
|
||||
oldestBirthday: `${now.getFullYear() - 120}-01-01`,
|
||||
today: `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`,
|
||||
today: `${now.getFullYear()}-${
|
||||
now.getMonth() + 1
|
||||
}-${now.getDate()}`,
|
||||
genderIndex,
|
||||
idCardTypeIndex,
|
||||
});
|
||||
|
|
@ -84,17 +84,23 @@ OakPage({
|
|||
},
|
||||
onGenderChange(input: any) {
|
||||
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) {
|
||||
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() {
|
||||
await this.execute(this.props.oakId ? 'update' : 'create');
|
||||
if (this.props.oakFrom === 'user:manage:list') {
|
||||
this.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'userEntityGrant:confirm',
|
||||
entity: 'userEntityGrant',
|
||||
projection: {
|
||||
|
|
@ -10,11 +10,11 @@ OakPage({
|
|||
formData: async ({ data: userEntityGrant }) => {
|
||||
return {
|
||||
relation: userEntityGrant?.relation,
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
this.execute('confirm');
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'userEntityGrant:detail',
|
||||
entity: 'userEntityGrant',
|
||||
projection: {
|
||||
|
|
@ -41,7 +41,8 @@ OakPage({
|
|||
for (let i = 0; i < str.length; i++) {
|
||||
buf2[i] = str.charCodeAt(i);
|
||||
}
|
||||
qrCodeUrl = 'data:image/jpeg;base64,' + wx.arrayBufferToBase64(buf2);
|
||||
qrCodeUrl =
|
||||
'data:image/jpeg;base64,' + wx.arrayBufferToBase64(buf2);
|
||||
}
|
||||
return {
|
||||
relation: userEntityGrant?.relation,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { EntityDict } from 'general-app-domain';
|
||||
import { DeduceCreateOperation, DeduceCreateSingleOperation, OakException, OakCongruentRowExists } from "oak-domain/lib/types";
|
||||
|
||||
OakPage({
|
||||
export default OakPage({
|
||||
path: 'userEntityGrant:upsert',
|
||||
entity: 'userEntityGrant',
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ OakPage({
|
|||
},
|
||||
isList: false,
|
||||
formData: async ({ data: userEntityGrant }) => ({
|
||||
...userEntityGrant
|
||||
...userEntityGrant,
|
||||
}),
|
||||
properties: {
|
||||
entity: String,
|
||||
|
|
@ -25,8 +25,7 @@ OakPage({
|
|||
relations: String,
|
||||
type: String,
|
||||
},
|
||||
data: {
|
||||
},
|
||||
data: {},
|
||||
lifetimes: {
|
||||
ready() {
|
||||
this.setUpdateData('entity', this.props.entity);
|
||||
|
|
@ -34,8 +33,8 @@ OakPage({
|
|||
this.setUpdateData('type', this.props.type);
|
||||
this.setState({
|
||||
relationArr: JSON.parse(this.props.relations),
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
radioChange(input: any) {
|
||||
|
|
@ -49,18 +48,24 @@ OakPage({
|
|||
[OakCongruentRowExists.name]
|
||||
);
|
||||
|
||||
const { data } = result as DeduceCreateSingleOperation<EntityDict['userEntityGrant']['OpSchema']>;
|
||||
const { data } = result as DeduceCreateSingleOperation<
|
||||
EntityDict['userEntityGrant']['OpSchema']
|
||||
>;
|
||||
const { id } = data;
|
||||
|
||||
this.navigateTo({
|
||||
url: '../detail/index',
|
||||
oakId: id,
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
if ((<OakException>error).constructor.name === OakCongruentRowExists.name) {
|
||||
} catch (error) {
|
||||
if (
|
||||
(<OakException>error).constructor.name ===
|
||||
OakCongruentRowExists.name
|
||||
) {
|
||||
// 这里由于编译的问题,用instanceof会不通过检查
|
||||
const data = (<OakCongruentRowExists<EntityDict, 'userEntityGrant'>>error).getData();
|
||||
const data = (<
|
||||
OakCongruentRowExists<EntityDict, 'userEntityGrant'>
|
||||
>error).getData();
|
||||
this.navigateTo({
|
||||
url: '../detail/index',
|
||||
oakId: data.id,
|
||||
|
|
@ -68,5 +73,5 @@ OakPage({
|
|||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { composeFileUrl } from '../../../../src/utils/extraFile';
|
||||
|
||||
OakPage(
|
||||
export default OakPage(
|
||||
{
|
||||
path: 'userRelation:list',
|
||||
entity: 'user',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { expandUuidTo36Bytes } from 'oak-domain/lib/utils/uuid'
|
||||
|
||||
|
||||
OakPage(
|
||||
export default OakPage(
|
||||
{
|
||||
path: 'wechatQrCode:scan',
|
||||
entity: 'wechatQrCode',
|
||||
|
|
|
|||
Loading…
Reference in New Issue