mp 上传组件 dialog 引入修复
This commit is contained in:
parent
822edcf639
commit
17f83945b3
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
declare const Empty: () => JSX.Element;
|
||||
export default Empty;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
declare const Empty: () => JSX.Element;
|
||||
export default Empty;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
interface QrCodeProps {
|
||||
id?: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function Web(props: {
|
||||
config: WebConfig;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function WechatMp(props: {
|
||||
config: WechatMpConfig;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function WechatPublic(props: {
|
||||
config: WechatPublicConfig;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Account(props: {
|
||||
account: Required<Config>['Account'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
cos: Required<Config>['Cos'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
live: Required<Config>['Live'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
map: Required<Config>['Map'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../types/Config';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { UploadFile } from 'antd';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from "oak-frontend-base";
|
||||
import { EntityDict } from "../../../general-app-domain";
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'address', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
import './web.less';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { MessageProps } from 'oak-frontend-base/lib/types/Message';
|
||||
export default function render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { AvatarSize } from 'antd/es/avatar/SizeContext';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'address', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'address', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'application', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'application', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from './../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'article', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'article', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'article', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import '@wangeditor/editor/dist/css/style.css';
|
||||
import { EntityDict } from './../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'domain', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'domain', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'mobile', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'area', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { Config } from '../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'platform', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'platform', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { Config } from '../../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { Config } from '../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'user', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(props: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'mobile', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,9 @@
|
|||
import Dialog from '../../miniprogram_npm/tdesign/dialog/index';
|
||||
export default Dialog;
|
||||
declare const Message: {
|
||||
info(options: Record<string, any>): any;
|
||||
success(options: Record<string, any>): any;
|
||||
warning(options: Record<string, any>): any;
|
||||
error(options: Record<string, any>): any;
|
||||
confirm(options: Record<string, any>): any;
|
||||
hide(context: any): void;
|
||||
};
|
||||
export default Message;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,54 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
// @ts-ignore
|
||||
var index_1 = tslib_1.__importDefault(require("../../miniprogram_npm/tdesign/dialog/index"));
|
||||
exports.default = index_1.default;
|
||||
var DialogType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
confirm: 'confirm',
|
||||
};
|
||||
function getInstance(context, selector) {
|
||||
if (selector === void 0) { selector = '#oak-dialog'; }
|
||||
var instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Dialog组件, 请检查selector是否正确'));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showDialog(options, type) {
|
||||
if (type === void 0) { type = DialogType.info; }
|
||||
var options2 = tslib_1.__assign({}, options);
|
||||
var context = options2.context;
|
||||
delete options.context;
|
||||
var instance = getInstance(context);
|
||||
instance.resetData(function () {
|
||||
instance.setData(Object.assign({ type: type }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
var Message = {
|
||||
info: function (options) {
|
||||
return showDialog(options, DialogType.info);
|
||||
},
|
||||
success: function (options) {
|
||||
return showDialog(options, DialogType.success);
|
||||
},
|
||||
warning: function (options) {
|
||||
return showDialog(options, DialogType.warning);
|
||||
},
|
||||
error: function (options) {
|
||||
return showDialog(options, DialogType.error);
|
||||
},
|
||||
confirm: function (options) {
|
||||
return showDialog(options, DialogType.confirm);
|
||||
},
|
||||
hide: function (context) {
|
||||
var instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.linHide();
|
||||
},
|
||||
};
|
||||
exports.default = Message;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ var MessageType = {
|
|||
error: 'error',
|
||||
};
|
||||
function getInstance(context, selector) {
|
||||
if (selector === void 0) { selector = '#t-message'; }
|
||||
if (selector === void 0) { selector = '#oak-message'; }
|
||||
var instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Message组件, 请检查selector是否正确'));
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<l-message />
|
||||
<l-message id="#oak-message" />
|
||||
|
|
@ -1,4 +1,54 @@
|
|||
// @ts-ignore
|
||||
import Dialog from '../../miniprogram_npm/tdesign/dialog/index';
|
||||
const DialogType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
confirm: 'confirm',
|
||||
};
|
||||
|
||||
export default Dialog;
|
||||
function getInstance(context: any, selector = '#oak-dialog') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(
|
||||
new Error('未找到Dialog组件, 请检查selector是否正确')
|
||||
);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showDialog(options: Record<string, any>, type = DialogType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ type }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
const Message = {
|
||||
info(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.info);
|
||||
},
|
||||
success(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.success);
|
||||
},
|
||||
warning(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.warning);
|
||||
},
|
||||
error(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.error);
|
||||
},
|
||||
confirm(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.confirm);
|
||||
},
|
||||
hide(context: any) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.linHide();
|
||||
},
|
||||
};
|
||||
|
||||
export default Message;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const MessageType = {
|
|||
error: 'error',
|
||||
};
|
||||
|
||||
function getInstance(context: any, selector = '#t-message') {
|
||||
function getInstance(context: any, selector = '#oak-message') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(
|
||||
|
|
|
|||
Loading…
Reference in New Issue