From a19239549a75b41c31cb791d17bd46a1fe596800 Mon Sep 17 00:00:00 2001 From: wenjiarui Date: Tue, 23 Jan 2024 19:43:06 +0800 Subject: [PATCH] build --- es/aspects/wechatQrCode.js | 38 ++++---- es/checkers/index.d.ts | 2 +- es/components/application/panel/web.pc.js | 4 +- es/components/common/qrCode/index.js | 10 +-- .../config/application/wechatMp/index.js | 4 +- es/components/extraFile/commit/index.d.ts | 12 ++- es/components/extraFile/commit/index.js | 63 ++++++------- es/components/extraFile/commit/web.d.ts | 2 +- es/components/paper/list/web.js | 58 ++++++------ es/components/parasite/detail/web.js | 6 +- es/components/parasite/list/web.d.ts | 2 +- es/components/parasite/list/web.js | 4 +- .../platform/panel/web.pc.module.less | 2 +- es/components/subwayLine/list/web.js | 90 +++++-------------- .../userEntityGrant/claim/ubPicker/index.d.ts | 4 +- .../userEntityGrant/upsert/index.d.ts | 4 +- .../byUserEntityGrant/locales/zh_CN.json | 4 +- .../upsert/byUserEntityGrant/web.js | 2 +- .../upsert/byUserEntityGrant/web.pc.js | 8 +- .../upsert/onUser/userRelation/web.js | 25 ++---- .../upsert/onUser/userRelation/web.pc.js | 27 ++---- es/components/userRelation/upsert/web.js | 12 +-- es/components/userRelation/upsert/web.pc.js | 12 +-- es/components/wechatLogin/qrCode/index.d.ts | 2 +- es/components/wechatQrCode/scan/index.d.ts | 1 + es/components/wechatQrCode/scan/index.js | 14 ++- es/data/i18n.js | 4 +- es/entities/UserEntityGrant.js | 8 +- es/entities/WechatQrCode.js | 10 +-- es/triggers/index.d.ts | 2 +- es/triggers/wechatQrCode.js | 14 +-- lib/aspects/wechatQrCode.js | 38 ++++---- lib/checkers/index.d.ts | 2 +- lib/data/i18n.js | 4 +- lib/entities/UserEntityGrant.js | 8 +- lib/entities/WechatQrCode.js | 10 +-- lib/triggers/index.d.ts | 2 +- lib/triggers/wechatQrCode.js | 14 +-- 38 files changed, 232 insertions(+), 296 deletions(-) diff --git a/es/aspects/wechatQrCode.js b/es/aspects/wechatQrCode.js index 210eb6afe..c23ee582a 100644 --- a/es/aspects/wechatQrCode.js +++ b/es/aspects/wechatQrCode.js @@ -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', { diff --git a/es/checkers/index.d.ts b/es/checkers/index.d.ts index 46b6c8266..1c141fe16 100644 --- a/es/checkers/index.d.ts +++ b/es/checkers/index.d.ts @@ -1,2 +1,2 @@ -declare const checkers: (import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker)[]; +declare const checkers: (import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker | import("oak-domain").Checker)[]; export default checkers; diff --git a/es/components/application/panel/web.pc.js b/es/components/application/panel/web.pc.js index 94ea52a70..51c0c57c5 100644 --- a/es/components/application/panel/web.pc.js +++ b/es/components/application/panel/web.pc.js @@ -60,9 +60,9 @@ export default function Render(props) { children: (), }); } - if (id && oakFullpath) { + if (id) { return ( { setTabKey(key); - }} items={items} style={{ height: 520 }}/>); + }} items={items} style={{ minHeight: 520 }}/>); } } diff --git a/es/components/common/qrCode/index.js b/es/components/common/qrCode/index.js index 6b648e52b..45edd242d 100644 --- a/es/components/common/qrCode/index.js +++ b/es/components/common/qrCode/index.js @@ -19,10 +19,8 @@ function QrCode(props) { const expiresAtStr = dayjs(expiresAt).format('YYYY年MM月DD日 HH:mm'); V = ( 该二维码 - {diff} - 天内( {expiresAtStr} - 前)有效,失效请重新生成 + 前有效 ); } else { @@ -30,14 +28,14 @@ function QrCode(props) { const expiresAtStr = dayjs(expiresAt).format('HH:mm'); if (diff2 > 0) { V = ( - 该二维码1天内( + 该二维码 {expiresAtStr} - 前)有效,失效请重新生成 + 前有效 ); } else { V = ( - 该二维码已失效,请重新生成 + 该二维码已失效 ); } } diff --git a/es/components/config/application/wechatMp/index.js b/es/components/config/application/wechatMp/index.js index 3bfc0db7b..b0dacea34 100644 --- a/es/components/config/application/wechatMp/index.js +++ b/es/components/config/application/wechatMp/index.js @@ -29,9 +29,9 @@ export default function WechatMp(props) { setValue(`originalId`, e.target.value)}/> - + <> - setValue(`qrCodePrefix`, e.target.value)}/> + setValue(`qrCodePrefix`, e.target.value)}/> diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 67260c266..06e1ca361 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -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: ) => unknown) | undefined; - type?: "button" | "submit" | "reset" | undefined; + type?: "submit" | "reset" | "button" | undefined; shape?: "default" | "rounded" | "rectangular" | undefined; children?: import("react").ReactNode; - } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseUp" | "onMouseDown" | "onTouchStart" | "onTouchEnd"> & { + } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & { className?: string | undefined; style?: (import("react").CSSProperties & Partial>) | undefined; tabIndex?: number | undefined; } & import("react").AriaAttributes) | undefined; afterCommit?: AfterCommit; beforeCommit?: BeforeCommit; - messageProps?: MessageProps | boolean | undefined, }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/commit/index.js b/es/components/extraFile/commit/index.js index abb8d9913..82808385e 100644 --- a/es/components/extraFile/commit/index.js +++ b/es/components/extraFile/commit/index.js @@ -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); diff --git a/es/components/extraFile/commit/web.d.ts b/es/components/extraFile/commit/web.d.ts index d2f485574..fc36f0a05 100644 --- a/es/components/extraFile/commit/web.d.ts +++ b/es/components/extraFile/commit/web.d.ts @@ -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 -
- - - - - - - - { + {t('action.add')} + + + + + { searchValueChange(e.target.value); }} suffix={} onPressEnter={(e) => { searchConfirm(); }}/> - - + + - { return ( - {t(`book:v.iState.${value}`)} - ); + {t(`book:v.iState.${value}`)} + ); }, }, { @@ -65,17 +62,17 @@ export default function render(props) { align: 'center', render: (value, record, index) => { return ( - - + - + - ); + 删除 + + ); }, fixed: 'right', }, @@ -107,6 +104,5 @@ export default function render(props) { setCurrentPage(current); }, }}/> - - ); + ); } diff --git a/es/components/parasite/detail/web.js b/es/components/parasite/detail/web.js index 5de9f90b1..8b31ca206 100644 --- a/es/components/parasite/detail/web.js +++ b/es/components/parasite/detail/web.js @@ -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) { }}>
- + }}> + diff --git a/es/components/parasite/list/web.d.ts b/es/components/parasite/list/web.d.ts index e237dc7dd..741823403 100644 --- a/es/components/parasite/list/web.d.ts +++ b/es/components/parasite/list/web.d.ts @@ -4,7 +4,7 @@ import { EntityDict } from '../../../oak-app-domain'; export default function render(props: WebComponentProps[]; + list: RowWithActions[]; }, { cancel: () => void; getQrCode: () => Promise; diff --git a/es/components/parasite/list/web.js b/es/components/parasite/list/web.js index badb90457..be06dd86a 100644 --- a/es/components/parasite/list/web.js +++ b/es/components/parasite/list/web.js @@ -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, diff --git a/es/components/platform/panel/web.pc.module.less b/es/components/platform/panel/web.pc.module.less index 07d2e2cea..bb24882e6 100644 --- a/es/components/platform/panel/web.pc.module.less +++ b/es/components/platform/panel/web.pc.module.less @@ -3,7 +3,7 @@ height: 100%; .tabLabel { - writing-mode: vertical-rl; + // writing-mode: vertical-rl; letter-spacing: .2rem; } } \ No newline at end of file diff --git a/es/components/subwayLine/list/web.js b/es/components/subwayLine/list/web.js index 6fc9b1109..508b7d09a 100644 --- a/es/components/subwayLine/list/web.js +++ b/es/components/subwayLine/list/web.js @@ -11,57 +11,33 @@ export default function Render(props) { const [openStation, setStation] = useState(false); const [subwayId, setSubwayId] = useState(''); const [stationId, setStationId] = useState(''); - return ( - <> + return (<>
城市: - +
- { - return ( - + { + return (
{nodeData.title} - {!nodeData.isLeaf ? ( - - ) : ( - ) : ( - )} + )} {/* {!nodeData.isLeaf && (