build
This commit is contained in:
parent
6209a692d2
commit
a19239549a
|
|
@ -12,7 +12,7 @@ import { shrinkUuidTo32Bytes } from 'oak-domain/lib/utils/uuid';
|
|||
* @returns
|
||||
*/
|
||||
export async function createWechatQrCode(options, context) {
|
||||
const { entity, entityId, tag, permanent = false, props, type: qrCodeType } = options;
|
||||
const { entity, entityId, tag, permanent = false, props, type: qrCodeType, } = options;
|
||||
const applicationId = context.getApplicationId();
|
||||
assert(applicationId);
|
||||
const [system] = await context.select('system', {
|
||||
|
|
@ -32,7 +32,7 @@ export async function createWechatQrCode(options, context) {
|
|||
filter: {
|
||||
application$system: {
|
||||
id: applicationId,
|
||||
}
|
||||
},
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
|
|
@ -46,17 +46,17 @@ export async function createWechatQrCode(options, context) {
|
|||
const id = generateNewId();
|
||||
if (qrCodeType) {
|
||||
switch (qrCodeType) {
|
||||
case 'wechatPublic':
|
||||
{
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self && self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号二维码,服务号未正确配置');
|
||||
}
|
||||
appId = self.id;
|
||||
appType = 'wechatPublic';
|
||||
break;
|
||||
case 'wechatPublic': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self &&
|
||||
self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号二维码,服务号未正确配置');
|
||||
}
|
||||
appId = self.id;
|
||||
appType = 'wechatPublic';
|
||||
break;
|
||||
}
|
||||
case 'wechatMpDomainUrl': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (!(self.type === 'wechatMp' &&
|
||||
|
|
@ -79,12 +79,14 @@ export async function createWechatQrCode(options, context) {
|
|||
}
|
||||
case 'wechatPublicForMp': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self && self.type === 'wechatPublic' &&
|
||||
if (!(self &&
|
||||
self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号-小程序二维码,服务号未正确配置');
|
||||
}
|
||||
const selfMp = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (!(selfMp && selfMp.config.appId &&
|
||||
if (!(selfMp &&
|
||||
selfMp.config.appId &&
|
||||
selfMp.config.appSecret)) {
|
||||
throw new Error('无法生成公众号-小程序二维码,小程序未正确配置');
|
||||
}
|
||||
|
|
@ -192,8 +194,8 @@ export async function createWechatQrCode(options, context) {
|
|||
expireSeconds: 2592000,
|
||||
});
|
||||
Object.assign(data, {
|
||||
ticket: result?.ticket,
|
||||
url: result?.url,
|
||||
ticket: result.ticket,
|
||||
url: result.url,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
@ -209,9 +211,7 @@ export async function createWechatQrCode(options, context) {
|
|||
id: generateNewId(),
|
||||
action: 'create',
|
||||
data,
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
export async function getMpUnlimitWxaCode(wechatQrCodeId, context) {
|
||||
const [wechatQrCode] = await context.select('wechatQrCode', {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const checkers: (import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt>)[];
|
||||
declare const checkers: (import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt>)[];
|
||||
export default checkers;
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ export default function Render(props) {
|
|||
children: (<TemplateList oakAutoUnmount={true} oakPath={`templateUpsert-wechatMp-ApplicationId:${id}`} applicationId={id}/>),
|
||||
});
|
||||
}
|
||||
if (id && oakFullpath) {
|
||||
if (id) {
|
||||
return (<Tabs tabPosition="left" onChange={(key) => {
|
||||
setTabKey(key);
|
||||
}} items={items} style={{ height: 520 }}/>);
|
||||
}} items={items} style={{ minHeight: 520 }}/>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,8 @@ function QrCode(props) {
|
|||
const expiresAtStr = dayjs(expiresAt).format('YYYY年MM月DD日 HH:mm');
|
||||
V = (<span className={`${prefixCls}-qrCodeBox-caption`}>
|
||||
该二维码
|
||||
<span>{diff}</span>
|
||||
天内(
|
||||
<span>{expiresAtStr}</span>
|
||||
前)有效,失效请重新生成
|
||||
前有效
|
||||
</span>);
|
||||
}
|
||||
else {
|
||||
|
|
@ -30,14 +28,14 @@ function QrCode(props) {
|
|||
const expiresAtStr = dayjs(expiresAt).format('HH:mm');
|
||||
if (diff2 > 0) {
|
||||
V = (<span className={`${prefixCls}-qrCodeBox_caption`}>
|
||||
该二维码1天内(
|
||||
该二维码
|
||||
<span>{expiresAtStr}</span>
|
||||
前)有效,失效请重新生成
|
||||
前有效
|
||||
</span>);
|
||||
}
|
||||
else {
|
||||
V = (<span className={`${prefixCls}-qrCodeBox_caption`}>
|
||||
该二维码已失效,请重新生成
|
||||
该二维码已失效
|
||||
</span>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ export default function WechatMp(props) {
|
|||
<Input placeholder="请输入原始ID" type="text" value={config?.originalId} onChange={(e) => setValue(`originalId`, e.target.value)}/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item label="qrCodePrefix">
|
||||
<Form.Item label="普通链接二维码规则" tooltip="扫普通链接二维码打开小程序,如原有二维码链接为 http://www.qq.com/a/123456 ,其中12345为uuid,则可配置规则 http://www.qq.com/a/ 。 请在输入框中填写 http://www.qq.com/a ,系统将在生成二维码时,在链接末尾加上'/'和uuid,从而实现扫码打开小程序的规则。">
|
||||
<>
|
||||
<Input placeholder="请输入qrCodePrefix" type="text" value={config?.qrCodePrefix} onChange={(e) => setValue(`qrCodePrefix`, e.target.value)}/>
|
||||
<Input placeholder="请输入普通链接二维码规则" type="text" value={config?.qrCodePrefix} onChange={(e) => setValue(`qrCodePrefix`, e.target.value)}/>
|
||||
</>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
|
||||
import { MessageProps } from 'oak-frontend-base/lib/types/Message';
|
||||
import { ButtonProps } from 'antd';
|
||||
import { ButtonProps as AmButtonProps } from 'antd-mobile';
|
||||
type AfterCommit = ((id?: string) => void) | undefined;
|
||||
|
|
@ -13,25 +12,24 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
|||
type?: ButtonProps['type'] | AmButtonProps['type'];
|
||||
executeText?: string | undefined;
|
||||
buttonProps?: (ButtonProps & {
|
||||
color?: "default" | "primary" | "success" | "warning" | "danger" | undefined;
|
||||
fill?: "none" | "solid" | "outline" | undefined;
|
||||
size?: "small" | "large" | "middle" | "mini" | undefined;
|
||||
color?: "default" | "success" | "primary" | "warning" | "danger" | undefined;
|
||||
fill?: "solid" | "outline" | "none" | undefined;
|
||||
size?: "small" | "mini" | "middle" | "large" | undefined;
|
||||
block?: boolean | undefined;
|
||||
loading?: boolean | "auto" | undefined;
|
||||
loadingText?: string | undefined;
|
||||
loadingIcon?: import("react").ReactNode;
|
||||
disabled?: boolean | undefined;
|
||||
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||
type?: "button" | "submit" | "reset" | undefined;
|
||||
type?: "submit" | "reset" | "button" | undefined;
|
||||
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||
children?: import("react").ReactNode;
|
||||
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseUp" | "onMouseDown" | "onTouchStart" | "onTouchEnd"> & {
|
||||
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & {
|
||||
className?: string | undefined;
|
||||
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
|
||||
tabIndex?: number | undefined;
|
||||
} & import("react").AriaAttributes) | undefined;
|
||||
afterCommit?: AfterCommit;
|
||||
beforeCommit?: BeforeCommit;
|
||||
messageProps?: MessageProps | boolean | undefined,
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ export default OakComponent({
|
|||
if (ele) {
|
||||
if (['failed', 'local'].includes(ele.state)) {
|
||||
state = ele.state;
|
||||
} else if (ele.state === 'uploading' && state === 'uploaded') {
|
||||
}
|
||||
else if (ele.state === 'uploading' && state === 'uploaded') {
|
||||
state = 'uploading';
|
||||
}
|
||||
}
|
||||
|
|
@ -50,12 +51,8 @@ export default OakComponent({
|
|||
},
|
||||
methods: {
|
||||
getEfIds() {
|
||||
const entity = this.features.runningTree.getEntity(
|
||||
this.state.oakFullpath
|
||||
);
|
||||
const operations = this.features.runningTree.getOperations(
|
||||
this.state.oakFullpath
|
||||
);
|
||||
const entity = this.features.runningTree.getEntity(this.state.oakFullpath);
|
||||
const operations = this.features.runningTree.getOperations(this.state.oakFullpath);
|
||||
const efIds = [];
|
||||
const getRecursive = (e, o) => {
|
||||
const { action, data } = o;
|
||||
|
|
@ -69,31 +66,28 @@ export default OakComponent({
|
|||
for (const attr in data) {
|
||||
const rel = this.features.cache.judgeRelation(e, attr);
|
||||
if (rel === 2) {
|
||||
assert(
|
||||
typeof data[attr] === 'object' &&
|
||||
!(data[attr] instanceof Array)
|
||||
);
|
||||
assert(typeof data[attr] === 'object' &&
|
||||
!(data[attr] instanceof Array));
|
||||
getRecursive(attr, data[attr]);
|
||||
} else if (typeof rel === 'string') {
|
||||
assert(
|
||||
typeof data[attr] === 'object' &&
|
||||
!(data[attr] instanceof Array)
|
||||
);
|
||||
}
|
||||
else if (typeof rel === 'string') {
|
||||
assert(typeof data[attr] === 'object' &&
|
||||
!(data[attr] instanceof Array));
|
||||
getRecursive(rel, data[attr]);
|
||||
} else if (rel instanceof Array) {
|
||||
}
|
||||
else if (rel instanceof Array) {
|
||||
const [e2] = rel;
|
||||
if (data[attr] instanceof Array) {
|
||||
data[attr].forEach((o2) => getRecursive(e2, o2));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
getRecursive(e2, data[attr]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (operations instanceof Array) {
|
||||
operations.forEach((ele) =>
|
||||
getRecursive(entity, ele.operation)
|
||||
);
|
||||
operations.forEach((ele) => getRecursive(entity, ele.operation));
|
||||
}
|
||||
return efIds;
|
||||
},
|
||||
|
|
@ -103,26 +97,20 @@ export default OakComponent({
|
|||
}
|
||||
const promises = [];
|
||||
const failureIds = [];
|
||||
const entity = this.features.runningTree.getEntity(
|
||||
this.state.oakFullpath
|
||||
);
|
||||
const entity = this.features.runningTree.getEntity(this.state.oakFullpath);
|
||||
ids.forEach((id) => {
|
||||
const fileState = this.features.extraFile.getFileState(id);
|
||||
if (fileState) {
|
||||
const { state } = fileState;
|
||||
if (['local', 'failed'].includes(state)) {
|
||||
promises.push(
|
||||
(async () => {
|
||||
try {
|
||||
await this.features.extraFile.upload(
|
||||
id,
|
||||
entity
|
||||
);
|
||||
} catch (err) {
|
||||
failureIds.push(id);
|
||||
}
|
||||
})()
|
||||
);
|
||||
promises.push((async () => {
|
||||
try {
|
||||
await this.features.extraFile.upload(id, entity);
|
||||
}
|
||||
catch (err) {
|
||||
failureIds.push(id);
|
||||
}
|
||||
})());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -159,7 +147,8 @@ export default OakComponent({
|
|||
if (afterCommit) {
|
||||
afterCommit(id);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
const { failureIds, currentId } = this.state;
|
||||
const id2 = currentId;
|
||||
assert(failureIds && failureIds.length > 0);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import React from 'react';
|
||||
import { ButtonProps } from 'antd-mobile';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { FileState } from '../../../features/extraFile';
|
||||
export default function render(props: WebComponentProps<EntityDict, any, true, {
|
||||
|
|
|
|||
|
|
@ -1,34 +1,31 @@
|
|||
import React from 'react';
|
||||
import { Table, Tag, Button, Modal, Space, Row, Col, Input, } from 'antd';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import Style from './web.module.less';
|
||||
import PageHeader from '../../common/pageHeader';
|
||||
export default function render(props) {
|
||||
const { pagination, articles = [], oakLoading, searchValue, title, showBack = false, } = props.data;
|
||||
const { pageSize, total, currentPage } = pagination || {};
|
||||
const { t, goUpsert, goDetailById, goUpsertById, searchConfirm, searchValueChange, setCurrentPage, setPageSize, onRemove, } = props.methods;
|
||||
return (<PageHeader title={title || '文章管理'} showBack={showBack}>
|
||||
<div className={Style.container}>
|
||||
<Row>
|
||||
<Col flex="auto">
|
||||
<Space>
|
||||
<Button type="primary" onClick={() => {
|
||||
return (<>
|
||||
<Row>
|
||||
<Col flex="auto">
|
||||
<Space>
|
||||
<Button type="primary" onClick={() => {
|
||||
goUpsert();
|
||||
}}>
|
||||
{t('action.add')}
|
||||
</Button>
|
||||
</Space>
|
||||
</Col>
|
||||
<Col flex="none">
|
||||
<Input placeholder="请输入标题" value={searchValue} allowClear onChange={(e) => {
|
||||
{t('action.add')}
|
||||
</Button>
|
||||
</Space>
|
||||
</Col>
|
||||
<Col flex="none">
|
||||
<Input placeholder="请输入标题" value={searchValue} allowClear onChange={(e) => {
|
||||
searchValueChange(e.target.value);
|
||||
}} suffix={<SearchOutlined />} onPressEnter={(e) => {
|
||||
searchConfirm();
|
||||
}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Table loading={oakLoading} dataSource={articles} rowKey="index" columns={[
|
||||
<Table loading={oakLoading} dataSource={articles} rowKey="index" columns={[
|
||||
{
|
||||
align: 'center',
|
||||
dataIndex: 'serial-number',
|
||||
|
|
@ -42,8 +39,8 @@ export default function render(props) {
|
|||
title: t('book:attr.iState'),
|
||||
render: (value, record, index) => {
|
||||
return (<Tag color="processing">
|
||||
{t(`book:v.iState.${value}`)}
|
||||
</Tag>);
|
||||
{t(`book:v.iState.${value}`)}
|
||||
</Tag>);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -65,17 +62,17 @@ export default function render(props) {
|
|||
align: 'center',
|
||||
render: (value, record, index) => {
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => {
|
||||
<Button type="link" onClick={() => {
|
||||
goDetailById(record.id);
|
||||
}}>
|
||||
详情
|
||||
</Button>
|
||||
<Button type="link" onClick={() => {
|
||||
详情
|
||||
</Button>
|
||||
<Button type="link" onClick={() => {
|
||||
goUpsertById(record.id);
|
||||
}}>
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => {
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => {
|
||||
const modal = Modal.confirm({
|
||||
title: '确认删除该文章吗?',
|
||||
content: '删除后,文章不可恢复',
|
||||
|
|
@ -90,9 +87,9 @@ export default function render(props) {
|
|||
},
|
||||
});
|
||||
}}>
|
||||
删除
|
||||
</Button>
|
||||
</Space>);
|
||||
删除
|
||||
</Button>
|
||||
</Space>);
|
||||
},
|
||||
fixed: 'right',
|
||||
},
|
||||
|
|
@ -107,6 +104,5 @@ export default function render(props) {
|
|||
setCurrentPage(current);
|
||||
},
|
||||
}}/>
|
||||
</div>
|
||||
</PageHeader>);
|
||||
</>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import QrCode from '../../../components/common/qrCode';
|
||||
import { Spin, Button, Space, Input, Tooltip,Alert } from 'antd';
|
||||
import { Spin, Button, Space, Input, Tooltip, Alert } from 'antd';
|
||||
import { CopyOutlined } from '@ant-design/icons';
|
||||
import copy from 'copy-to-clipboard';
|
||||
export default function Render(props) {
|
||||
|
|
@ -21,8 +21,8 @@ export default function Render(props) {
|
|||
}}>
|
||||
<div style={{
|
||||
maxWidth: 800
|
||||
}}>
|
||||
<Alert message="温馨提示:请扫描二维码或打开链接填写信息!" type="info" />
|
||||
}}>
|
||||
<Alert message="将二维码或下方链接发送给使用者" type="info"/>
|
||||
<QrCode url={url} expiresAt={expiresAt}/>
|
||||
|
||||
<Space.Compact block style={{ marginTop: 16 }}>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { EntityDict } from '../../../oak-app-domain';
|
|||
export default function render(props: WebComponentProps<EntityDict, 'parasite', true, {
|
||||
searchValue: string;
|
||||
nameLabel: string;
|
||||
list: RowWithActions<EntityDict, 'userEntityGrant'>[];
|
||||
list: RowWithActions<EntityDict, 'parasite'>[];
|
||||
}, {
|
||||
cancel: () => void;
|
||||
getQrCode: () => Promise<void>;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export default function render(props) {
|
|||
dataIndex: ['user', 'nickname'],
|
||||
title: nameLabel || '名称',
|
||||
render: (value, record, index) => {
|
||||
return value !== 'shadow_user' && value || '--';
|
||||
return (value !== 'shadow_user' && value) || '--';
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -93,7 +93,7 @@ export default function render(props) {
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '采集码',
|
||||
label: '详情',
|
||||
action: 'qrcode',
|
||||
show: record['#oakLegalActions']?.includes('qrcode'),
|
||||
// alerted: true,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
height: 100%;
|
||||
|
||||
.tabLabel {
|
||||
writing-mode: vertical-rl;
|
||||
// writing-mode: vertical-rl;
|
||||
letter-spacing: .2rem;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,57 +11,33 @@ export default function Render(props) {
|
|||
const [openStation, setStation] = useState(false);
|
||||
const [subwayId, setSubwayId] = useState('');
|
||||
const [stationId, setStationId] = useState('');
|
||||
return (
|
||||
<>
|
||||
return (<>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
城市:
|
||||
<Select
|
||||
placeholder={'选择城市'}
|
||||
value={areaId}
|
||||
onChange={(value) => {
|
||||
setAreaId(value);
|
||||
setFilterByAreaId(value);
|
||||
}}
|
||||
style={{ width: '20%' }}
|
||||
options={areaOptions}
|
||||
allowClear
|
||||
></Select>
|
||||
<Select placeholder={'选择城市'} value={areaId} onChange={(value) => {
|
||||
setAreaId(value);
|
||||
setFilterByAreaId(value);
|
||||
}} style={{ width: '20%' }} options={areaOptions} allowClear></Select>
|
||||
</div>
|
||||
<Tree
|
||||
className={Style.tree}
|
||||
blockNode={true}
|
||||
treeData={treeData}
|
||||
titleRender={(nodeData) => {
|
||||
return (
|
||||
<Row align="middle" style={{ flex: 1 }}>
|
||||
<Tree className={Style.tree} blockNode={true} treeData={treeData} titleRender={(nodeData) => {
|
||||
return (<Row align="middle" style={{ flex: 1 }}>
|
||||
<Col flex="auto">{nodeData.title}</Col>
|
||||
|
||||
<Col flex="none">
|
||||
<Space>
|
||||
{!nodeData.isLeaf ? (
|
||||
<Button
|
||||
onClick={() => {
|
||||
setSubwayId(nodeData.key);
|
||||
setSubway(true);
|
||||
}}
|
||||
>
|
||||
{!nodeData.isLeaf ? (<Button onClick={() => {
|
||||
setSubwayId(nodeData.key);
|
||||
setSubway(true);
|
||||
}}>
|
||||
编辑
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
onClick={() => {
|
||||
const index =
|
||||
nodeData.key.indexOf('/') +
|
||||
1;
|
||||
const temp =
|
||||
nodeData.key.substr(index);
|
||||
setStationId(temp);
|
||||
setStation(true);
|
||||
}}
|
||||
>
|
||||
</Button>) : (<Button onClick={() => {
|
||||
const index = nodeData.key.indexOf('/') + 1;
|
||||
const temp = nodeData.key.substr(index);
|
||||
setStationId(temp);
|
||||
setStation(true);
|
||||
}}>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
</Button>)}
|
||||
|
||||
{/* {!nodeData.isLeaf && (
|
||||
<Button
|
||||
|
|
@ -88,30 +64,10 @@ export default function Render(props) {
|
|||
)} */}
|
||||
</Space>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{openSubway && (
|
||||
<UpsertSubway
|
||||
onClose={() => setSubway(false)}
|
||||
openSubway={openSubway}
|
||||
oakId={subwayId}
|
||||
oakPath={`${oakFullpath}.${subwayId}`}
|
||||
oakAutoUnmount={true}
|
||||
/>
|
||||
)}
|
||||
</Row>);
|
||||
}}/>
|
||||
{openSubway && (<UpsertSubway onClose={() => setSubway(false)} openSubway={openSubway} oakId={subwayId} oakPath={`${oakFullpath}.${subwayId}`} oakAutoUnmount={true}/>)}
|
||||
|
||||
{openStation && (
|
||||
<UpsertStation
|
||||
onClose={() => setStation(false)}
|
||||
openStation={openStation}
|
||||
oakId={stationId}
|
||||
subwayId={subwayId}
|
||||
oakPath={`$subwayLine/upsertStation,${stationId}`}
|
||||
oakAutoUnmount={true}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
{openStation && (<UpsertStation onClose={() => setStation(false)} openStation={openStation} oakId={stationId} subwayId={subwayId} oakPath={`$subwayLine/upsertStation,${stationId}`} oakAutoUnmount={true}/>)}
|
||||
</>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|||
entity: keyof EntityDict;
|
||||
entityFilter: any;
|
||||
relationIds: string[];
|
||||
rule: "single" | "all" | "free";
|
||||
ruleOnRow: "single" | "all" | "free";
|
||||
rule: "all" | "single" | "free";
|
||||
ruleOnRow: "all" | "single" | "free";
|
||||
onPickRelations: (ids: string[]) => void;
|
||||
onPickRows: (ids: string[]) => void;
|
||||
pickedRowIds: string[] | undefined;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|||
claimUrl: string;
|
||||
qrCodeType: QrCodeType;
|
||||
multiple: boolean;
|
||||
rule: "single" | "all" | "free";
|
||||
ruleOnRow: "single" | "all" | "free";
|
||||
rule: "all" | "single" | "free";
|
||||
ruleOnRow: "all" | "single" | "free";
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
"chooseExpiresAt": "请选择有效时长",
|
||||
"expiresHelp": "支持分钟、小时选择",
|
||||
"helpRule": "当一次分享多个权限时,可规定单个用户(对多个权限)的认领规则",
|
||||
"helpMutiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待分享权限的用户使用微信扫描",
|
||||
"helpMultiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待认领权限的用户,让他们使用微信扫描。",
|
||||
"unit": {
|
||||
"hour": "小时",
|
||||
"minute": "分钟"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default function render(props) {
|
|||
</Space>
|
||||
</Radio.Group>
|
||||
</Form.Item>)}
|
||||
{type === 'grant' && (<Form.Item label={t('multiple')} required help={t('helpMutiple')}>
|
||||
{type === 'grant' && (<Form.Item label={t('multiple')} required help={t('helpMultiple')}>
|
||||
<Switch checked={multiple || false} onChange={(val) => update({ multiple: val })}/>
|
||||
</Form.Item>)}
|
||||
<Form.Item label={t('userEntityGrant:attr.expiresAt')} name="period" rules={[
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ export default function render(props) {
|
|||
}))}/>
|
||||
</Form.Item>
|
||||
{relationIds?.length > 1 && (<Form.Item label={t('userEntityGrant:attr.rule')} help={t('helpRule')}>
|
||||
<Radio.Group value={rule} onChange={({ target }) => update({ rule: target.value })} options={rules.map((ele) => ({
|
||||
<Radio.Group value={rule} onChange={({ target }) => update({
|
||||
rule: target.value,
|
||||
})} options={rules.map((ele) => ({
|
||||
value: ele,
|
||||
label: t(`userEntityGrant:v.rule.${ele}`)
|
||||
label: t(`userEntityGrant:v.rule.${ele}`),
|
||||
}))}/>
|
||||
</Form.Item>)}
|
||||
{type === 'grant' && (<Form.Item label={t('multiple')} required help={t('helpMutiple')}>
|
||||
{type === 'grant' && (<Form.Item label={t('multiple')} required help={t('helpMultiple')}>
|
||||
<Switch checked={multiple || false} onChange={(val) => update({ multiple: val })}/>
|
||||
</Form.Item>)}
|
||||
<Form.Item label={t('userEntityGrant:attr.expiresAt')} required
|
||||
|
|
|
|||
|
|
@ -3,22 +3,13 @@ import { Checkbox } from 'antd-mobile';
|
|||
export default function Render(props) {
|
||||
const { entity, relations2 } = props.data;
|
||||
const { t, onRelationChange } = props.methods;
|
||||
return (
|
||||
<>
|
||||
{relations2?.map(({ relation, isChecked }) => (
|
||||
<Checkbox
|
||||
key={`userRelation_${relation}`}
|
||||
style={{ marginRight: 20 }}
|
||||
checked={isChecked}
|
||||
onChange={(checked) => {
|
||||
onRelationChange(relation, checked);
|
||||
}}
|
||||
>
|
||||
return (<>
|
||||
{relations2?.map(({ relation, isChecked }) => (<Checkbox key={`userRelation_${relation}`} style={{ marginRight: 20 }} checked={isChecked} onChange={(checked) => {
|
||||
onRelationChange(relation, checked);
|
||||
}}>
|
||||
{relation.name
|
||||
? t(`${entity}:r.${relation.name}`)
|
||||
: relation.display}
|
||||
</Checkbox>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
? t(`${entity}:r.${relation.name}`)
|
||||
: relation.display}
|
||||
</Checkbox>))}
|
||||
</>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,23 +3,14 @@ import { Checkbox } from 'antd';
|
|||
export default function Render(props) {
|
||||
const { entity, relations2 } = props.data;
|
||||
const { t, onRelationChange } = props.methods;
|
||||
return (
|
||||
<>
|
||||
{relations2?.map(({ relation, isChecked }) => (
|
||||
<Checkbox
|
||||
key={`userRelation_${relation}`}
|
||||
checked={isChecked}
|
||||
value={relation}
|
||||
onChange={({ target }) => {
|
||||
const { checked } = target;
|
||||
onRelationChange(relation, checked);
|
||||
}}
|
||||
>
|
||||
return (<>
|
||||
{relations2?.map(({ relation, isChecked }) => (<Checkbox key={`userRelation_${relation}`} checked={isChecked} value={relation} onChange={({ target }) => {
|
||||
const { checked } = target;
|
||||
onRelationChange(relation, checked);
|
||||
}}>
|
||||
{relation.name
|
||||
? t(`${entity}:r.${relation.name}`)
|
||||
: relation.display}
|
||||
</Checkbox>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
? t(`${entity}:r.${relation.name}`)
|
||||
: relation.display}
|
||||
</Checkbox>))}
|
||||
</>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,24 +32,24 @@ export default function Render(props) {
|
|||
children: <div className={Style.container}>尚未实现</div>,
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
label: '二维码',
|
||||
key: 'item-2',
|
||||
children: (<ByMobile entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>),
|
||||
children: (<ByUserEntityGrant entity={entity} entityId={entityId} relations={relations} qrCodeType={qrCodeType} oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} claimUrl={claimUrl} rule={rule} ruleOnRow={ruleOnRow}/>),
|
||||
},
|
||||
{
|
||||
label: '二维码',
|
||||
label: '手机号',
|
||||
key: 'item-3',
|
||||
children: (<ByUserEntityGrant entity={entity} entityId={entityId} relations={relations} qrCodeType={qrCodeType} oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} claimUrl={claimUrl} rule={rule} ruleOnRow={ruleOnRow}/>),
|
||||
children: (<ByMobile entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>),
|
||||
},
|
||||
];
|
||||
const items2 = [];
|
||||
if (grantByEmail) {
|
||||
items2.push(items[0]);
|
||||
}
|
||||
if (grantByMobile) {
|
||||
if (grantByUserEntityGrant) {
|
||||
items2.push(items[1]);
|
||||
}
|
||||
if (grantByUserEntityGrant) {
|
||||
if (grantByMobile) {
|
||||
items2.push(items[2]);
|
||||
}
|
||||
SubPart = (<Tabs className={Style.tab}>
|
||||
|
|
|
|||
|
|
@ -32,24 +32,24 @@ export default function Render(props) {
|
|||
children: <div className={Style.container}>尚未实现</div>,
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
label: '二维码',
|
||||
key: 'item-2',
|
||||
children: (<ByMobile allowUpdateName={allowUpdateName} allowUpdateNickname={allowUpdateNickname} passwordRequire={passwordRequire} entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>),
|
||||
children: (<ByUserEntityGrant entity={entity} entityId={entityId} relations={relations} qrCodeType={qrCodeType} oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} claimUrl={claimUrl} rule={rule} ruleOnRow={ruleOnRow}/>),
|
||||
},
|
||||
{
|
||||
label: '二维码',
|
||||
label: '手机号',
|
||||
key: 'item-3',
|
||||
children: (<ByUserEntityGrant entity={entity} entityId={entityId} relations={relations} qrCodeType={qrCodeType} oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} claimUrl={claimUrl} rule={rule} ruleOnRow={ruleOnRow}/>),
|
||||
children: (<ByMobile allowUpdateName={allowUpdateName} allowUpdateNickname={allowUpdateNickname} passwordRequire={passwordRequire} entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>),
|
||||
},
|
||||
];
|
||||
const items2 = [];
|
||||
if (grantByEmail) {
|
||||
items2.push(items[0]);
|
||||
}
|
||||
if (grantByMobile) {
|
||||
if (grantByUserEntityGrant) {
|
||||
items2.push(items[1]);
|
||||
}
|
||||
if (grantByUserEntityGrant) {
|
||||
if (grantByMobile) {
|
||||
items2.push(items[2]);
|
||||
}
|
||||
SubPart = <Tabs items={items2}/>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
|
||||
type: "bind" | "login";
|
||||
type: "login" | "bind";
|
||||
url: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "wechatQrCode", true, {
|
||||
scene: string;
|
||||
q: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default OakComponent({
|
|||
isList: true,
|
||||
properties: {
|
||||
scene: '',
|
||||
q: '',
|
||||
},
|
||||
data: {
|
||||
loading: false,
|
||||
|
|
@ -35,8 +36,17 @@ export default OakComponent({
|
|||
filters: [
|
||||
{
|
||||
filter() {
|
||||
const scene = decodeURIComponent(this.props.scene);
|
||||
const uuid = scene && expandUuidTo36Bytes(scene);
|
||||
let uuid;
|
||||
if (this.props.scene) {
|
||||
// 小程序码扫码
|
||||
const scene = decodeURIComponent(this.props.scene);
|
||||
uuid = expandUuidTo36Bytes(scene);
|
||||
}
|
||||
else if (this.props.q) {
|
||||
// 普通链接二维码扫码
|
||||
const q = decodeURIComponent(this.props.q);
|
||||
uuid = expandUuidTo36Bytes(q);
|
||||
}
|
||||
return {
|
||||
id: uuid || 'illegal',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -360,8 +360,8 @@ const i18ns = [
|
|||
"chooseExpiresAt": "请选择有效时长",
|
||||
"expiresHelp": "支持分钟、小时选择",
|
||||
"helpRule": "当一次分享多个权限时,可规定单个用户(对多个权限)的认领规则",
|
||||
"helpMutiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待分享权限的用户使用微信扫描",
|
||||
"helpMultiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待认领权限的用户,让他们使用微信扫描。",
|
||||
"unit": {
|
||||
"hour": "小时",
|
||||
"minute": "分钟"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const entityDesc = {
|
|||
},
|
||||
qrCodeType: {
|
||||
webForWechatPublic: '网站引流到公众号',
|
||||
wechatMpDomainUrl: '小程序url码',
|
||||
wechatMpDomainUrl: '小程序普通链接二维码',
|
||||
wechatMpWxaCode: '小程序码',
|
||||
wechatPublic: '公众号关注码',
|
||||
wechatPublicForMp: '公众号回复小程序码',
|
||||
|
|
@ -40,12 +40,12 @@ const entityDesc = {
|
|||
rule: {
|
||||
single: '单选',
|
||||
all: '全选',
|
||||
free: '自由选择'
|
||||
free: '自由选择',
|
||||
},
|
||||
ruleOnRow: {
|
||||
single: '单选',
|
||||
all: '全选',
|
||||
free: '自由选择'
|
||||
free: '自由选择',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -59,7 +59,7 @@ const entityDesc = {
|
|||
},
|
||||
{
|
||||
name: 'expiresAt',
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ const entityDesc = {
|
|||
v: {
|
||||
type: {
|
||||
webForWechatPublic: '网站引流到公众号',
|
||||
wechatMpDomainUrl: '小程序url码',
|
||||
wechatMpDomainUrl: '小程序普通链接二维码',
|
||||
wechatMpWxaCode: '小程序码',
|
||||
wechatPublic: '公众号关注码',
|
||||
wechatPublicForMp: '公众号回复小程序码',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
indexes: [
|
||||
|
|
@ -41,7 +41,7 @@ const entityDesc = {
|
|||
},
|
||||
{
|
||||
name: 'tag',
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -63,6 +63,6 @@ const entityDesc = {
|
|||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
],
|
||||
};
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { assert } from 'oak-domain/lib/utils/assert';
|
|||
import { WechatSDK } from 'oak-external-sdk';
|
||||
const triggers = [
|
||||
{
|
||||
name: '当生成wechatQrCode时,调用外部接口完善数据',
|
||||
name: '当生成wechatQrCode时, 调用外部接口完善数据',
|
||||
entity: 'wechatQrCode',
|
||||
action: 'create',
|
||||
when: 'before',
|
||||
|
|
@ -114,7 +114,8 @@ const triggers = [
|
|||
appId = self.id;
|
||||
if (self.config.qrCodePrefix) {
|
||||
appType = 'wechatMpDomainUrl';
|
||||
url = `${self.config.qrCodePrefix}/${shrinkUuidTo32Bytes(id)}`;
|
||||
url = `${self.config
|
||||
.qrCodePrefix}/${shrinkUuidTo32Bytes(id)}`;
|
||||
}
|
||||
else {
|
||||
appType = 'wechatMpWxaCode';
|
||||
|
|
@ -132,9 +133,10 @@ const triggers = [
|
|||
const mpApp = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (mpApp) {
|
||||
appId = mpApp.id;
|
||||
if (mpApp.config.qrCodePrefix) {
|
||||
const mpConfig = mpApp.config;
|
||||
if (mpConfig?.qrCodePrefix) {
|
||||
appType = 'wechatMpDomainUrl';
|
||||
url = `${mpApp.config.qrCodePrefix}/${shrinkUuidTo32Bytes(id)}`;
|
||||
url = `${mpConfig.qrCodePrefix}/${shrinkUuidTo32Bytes(id)}`;
|
||||
}
|
||||
else {
|
||||
appType = 'wechatMpWxaCode';
|
||||
|
|
@ -190,8 +192,8 @@ const triggers = [
|
|||
expireSeconds: 2592000,
|
||||
});
|
||||
Object.assign(updateData, {
|
||||
ticket: result?.ticket,
|
||||
url: result?.url,
|
||||
ticket: result.ticket,
|
||||
url: result.url,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const uuid_2 = require("oak-domain/lib/utils/uuid");
|
|||
* @returns
|
||||
*/
|
||||
async function createWechatQrCode(options, context) {
|
||||
const { entity, entityId, tag, permanent = false, props, type: qrCodeType } = options;
|
||||
const { entity, entityId, tag, permanent = false, props, type: qrCodeType, } = options;
|
||||
const applicationId = context.getApplicationId();
|
||||
(0, assert_1.assert)(applicationId);
|
||||
const [system] = await context.select('system', {
|
||||
|
|
@ -35,7 +35,7 @@ async function createWechatQrCode(options, context) {
|
|||
filter: {
|
||||
application$system: {
|
||||
id: applicationId,
|
||||
}
|
||||
},
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
|
|
@ -49,17 +49,17 @@ async function createWechatQrCode(options, context) {
|
|||
const id = (0, uuid_1.generateNewId)();
|
||||
if (qrCodeType) {
|
||||
switch (qrCodeType) {
|
||||
case 'wechatPublic':
|
||||
{
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self && self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号二维码,服务号未正确配置');
|
||||
}
|
||||
appId = self.id;
|
||||
appType = 'wechatPublic';
|
||||
break;
|
||||
case 'wechatPublic': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self &&
|
||||
self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号二维码,服务号未正确配置');
|
||||
}
|
||||
appId = self.id;
|
||||
appType = 'wechatPublic';
|
||||
break;
|
||||
}
|
||||
case 'wechatMpDomainUrl': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (!(self.type === 'wechatMp' &&
|
||||
|
|
@ -82,12 +82,14 @@ async function createWechatQrCode(options, context) {
|
|||
}
|
||||
case 'wechatPublicForMp': {
|
||||
const self = applications.find((ele) => ele.type === 'wechatPublic');
|
||||
if (!(self && self.type === 'wechatPublic' &&
|
||||
if (!(self &&
|
||||
self.type === 'wechatPublic' &&
|
||||
self.config.isService)) {
|
||||
throw new Error('无法生成公众号-小程序二维码,服务号未正确配置');
|
||||
}
|
||||
const selfMp = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (!(selfMp && selfMp.config.appId &&
|
||||
if (!(selfMp &&
|
||||
selfMp.config.appId &&
|
||||
selfMp.config.appSecret)) {
|
||||
throw new Error('无法生成公众号-小程序二维码,小程序未正确配置');
|
||||
}
|
||||
|
|
@ -195,8 +197,8 @@ async function createWechatQrCode(options, context) {
|
|||
expireSeconds: 2592000,
|
||||
});
|
||||
Object.assign(data, {
|
||||
ticket: result?.ticket,
|
||||
url: result?.url,
|
||||
ticket: result.ticket,
|
||||
url: result.url,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
@ -212,9 +214,7 @@ async function createWechatQrCode(options, context) {
|
|||
id: (0, uuid_1.generateNewId)(),
|
||||
action: 'create',
|
||||
data,
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
exports.createWechatQrCode = createWechatQrCode;
|
||||
async function getMpUnlimitWxaCode(wechatQrCodeId, context) {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const checkers: (import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt>)[];
|
||||
declare const checkers: (import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt> | import("oak-domain").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt>)[];
|
||||
export default checkers;
|
||||
|
|
|
|||
|
|
@ -362,8 +362,8 @@ const i18ns = [
|
|||
"chooseExpiresAt": "请选择有效时长",
|
||||
"expiresHelp": "支持分钟、小时选择",
|
||||
"helpRule": "当一次分享多个权限时,可规定单个用户(对多个权限)的认领规则",
|
||||
"helpMutiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待分享权限的用户使用微信扫描",
|
||||
"helpMultiple": "是否允许多个用户来认领",
|
||||
"shareCode": "请将二维码发给待认领权限的用户,让他们使用微信扫描。",
|
||||
"unit": {
|
||||
"hour": "小时",
|
||||
"minute": "分钟"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const entityDesc = {
|
|||
},
|
||||
qrCodeType: {
|
||||
webForWechatPublic: '网站引流到公众号',
|
||||
wechatMpDomainUrl: '小程序url码',
|
||||
wechatMpDomainUrl: '小程序普通链接二维码',
|
||||
wechatMpWxaCode: '小程序码',
|
||||
wechatPublic: '公众号关注码',
|
||||
wechatPublicForMp: '公众号回复小程序码',
|
||||
|
|
@ -42,12 +42,12 @@ const entityDesc = {
|
|||
rule: {
|
||||
single: '单选',
|
||||
all: '全选',
|
||||
free: '自由选择'
|
||||
free: '自由选择',
|
||||
},
|
||||
ruleOnRow: {
|
||||
single: '单选',
|
||||
all: '全选',
|
||||
free: '自由选择'
|
||||
free: '自由选择',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -61,7 +61,7 @@ const entityDesc = {
|
|||
},
|
||||
{
|
||||
name: 'expiresAt',
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ const entityDesc = {
|
|||
v: {
|
||||
type: {
|
||||
webForWechatPublic: '网站引流到公众号',
|
||||
wechatMpDomainUrl: '小程序url码',
|
||||
wechatMpDomainUrl: '小程序普通链接二维码',
|
||||
wechatMpWxaCode: '小程序码',
|
||||
wechatPublic: '公众号关注码',
|
||||
wechatPublicForMp: '公众号回复小程序码',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
indexes: [
|
||||
|
|
@ -43,7 +43,7 @@ const entityDesc = {
|
|||
},
|
||||
{
|
||||
name: 'tag',
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -65,5 +65,5 @@ const entityDesc = {
|
|||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const assert_1 = require("oak-domain/lib/utils/assert");
|
|||
const oak_external_sdk_1 = require("oak-external-sdk");
|
||||
const triggers = [
|
||||
{
|
||||
name: '当生成wechatQrCode时,调用外部接口完善数据',
|
||||
name: '当生成wechatQrCode时, 调用外部接口完善数据',
|
||||
entity: 'wechatQrCode',
|
||||
action: 'create',
|
||||
when: 'before',
|
||||
|
|
@ -116,7 +116,8 @@ const triggers = [
|
|||
appId = self.id;
|
||||
if (self.config.qrCodePrefix) {
|
||||
appType = 'wechatMpDomainUrl';
|
||||
url = `${self.config.qrCodePrefix}/${(0, uuid_1.shrinkUuidTo32Bytes)(id)}`;
|
||||
url = `${self.config
|
||||
.qrCodePrefix}/${(0, uuid_1.shrinkUuidTo32Bytes)(id)}`;
|
||||
}
|
||||
else {
|
||||
appType = 'wechatMpWxaCode';
|
||||
|
|
@ -134,9 +135,10 @@ const triggers = [
|
|||
const mpApp = applications.find((ele) => ele.type === 'wechatMp');
|
||||
if (mpApp) {
|
||||
appId = mpApp.id;
|
||||
if (mpApp.config.qrCodePrefix) {
|
||||
const mpConfig = mpApp.config;
|
||||
if (mpConfig?.qrCodePrefix) {
|
||||
appType = 'wechatMpDomainUrl';
|
||||
url = `${mpApp.config.qrCodePrefix}/${(0, uuid_1.shrinkUuidTo32Bytes)(id)}`;
|
||||
url = `${mpConfig.qrCodePrefix}/${(0, uuid_1.shrinkUuidTo32Bytes)(id)}`;
|
||||
}
|
||||
else {
|
||||
appType = 'wechatMpWxaCode';
|
||||
|
|
@ -192,8 +194,8 @@ const triggers = [
|
|||
expireSeconds: 2592000,
|
||||
});
|
||||
Object.assign(updateData, {
|
||||
ticket: result?.ticket,
|
||||
url: result?.url,
|
||||
ticket: result.ticket,
|
||||
url: result.url,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue