采集吗样式

This commit is contained in:
wenjiarui 2023-08-03 20:39:47 +08:00
parent dce60f4331
commit d531f6f218
5 changed files with 43 additions and 37 deletions

View File

@ -6,6 +6,4 @@ export default function Render(props: WebComponentProps<EntityDict, 'userEntityG
url: string;
expiresAt: number;
title?: string;
}, {
copy: (text: string) => void;
}>): import("react/jsx-runtime").JSX.Element;
}, {}>): import("react/jsx-runtime").JSX.Element;

View File

@ -5,24 +5,28 @@ var jsx_runtime_1 = require("react/jsx-runtime");
var qrCode_1 = tslib_1.__importDefault(require("../../../components/common/qrCode"));
var antd_1 = require("antd");
var icons_1 = require("@ant-design/icons");
var copy_to_clipboard_1 = tslib_1.__importDefault(require("copy-to-clipboard"));
function Render(props) {
var _a = props.data, url = _a.url, expiresAt = _a.expiresAt, oakLoading = _a.oakLoading;
var copy = props.methods.copy;
var setMessage = props.methods.setMessage;
return oakLoading ? ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: {
display: 'flex',
justifyContent: 'center',
padding: '48px',
} }, { children: (0, jsx_runtime_1.jsx)(antd_1.Spin, { size: "large" }) }))) : ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: {
} }, { children: (0, jsx_runtime_1.jsx)(antd_1.Spin, { size: "large" }) }))) : ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
padding: '48px',
} }, { children: [(0, jsx_runtime_1.jsx)(qrCode_1.default, { url: url, expiresAt: expiresAt }), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
} }, { children: [url, (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "text", icon: (0, jsx_runtime_1.jsx)(icons_1.CopyOutlined, {}), onClick: function () { return copy(url); } }, { children: "\u590D\u5236\u94FE\u63A5" }))] }))] })));
} }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: {
maxWidth: 800
} }, { children: [(0, jsx_runtime_1.jsx)(qrCode_1.default, { url: url, expiresAt: expiresAt }), (0, jsx_runtime_1.jsxs)(antd_1.Space.Compact, tslib_1.__assign({ block: true, style: { marginTop: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Input, { value: url, readOnly: true }), (0, jsx_runtime_1.jsx)(antd_1.Tooltip, tslib_1.__assign({ title: "\u590D\u5236\u94FE\u63A5" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ icon: (0, jsx_runtime_1.jsx)(icons_1.CopyOutlined, {}), onClick: function () {
(0, copy_to_clipboard_1.default)(url);
setMessage({
content: '复制链接成功',
type: 'success',
});
} }, { children: "\u590D\u5236\u94FE\u63A5" })) }))] }))] })) })));
}
exports.default = Render;

View File

@ -188,9 +188,7 @@ var triggers = [
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
case 4: return [4 /*yield*/, _g.apply(_f, _h.concat([(_k.id = _l.sent(),
_k.action = 'disable',
_k.data = {
expired: true,
},
_k.data = {},
_k.filter = {
ableState: 'enabled',
entity: 'parasite',

View File

@ -1,11 +1,12 @@
import React, { Component } from 'react';
import Style from './web.module.less';
import PageHeader from '../../../components/common/pageHeader';
import QrCode from '../../../components/common/qrCode';
import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain';
import { Spin, Button } from 'antd';
import { Spin, Button, Space, Input, Tooltip } from 'antd';
import { CopyOutlined } from '@ant-design/icons';
import copy from 'copy-to-clipboard';
export default function Render(
props: WebComponentProps<
EntityDict,
@ -18,13 +19,11 @@ export default function Render(
expiresAt: number;
title?: string;
},
{
copy: (text: string) => void;
}
{}
>
) {
const { url, expiresAt, oakLoading } = props.data;
const { copy } = props.methods;
const { setMessage } = props.methods;
return oakLoading ? (
<div
style={{
@ -36,6 +35,7 @@ export default function Render(
<Spin size="large" />
</div>
) : (
<div
style={{
display: 'flex',
@ -45,24 +45,31 @@ export default function Render(
padding: '48px',
}}
>
<QrCode url={url} expiresAt={expiresAt} />
<div
style={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}
<div style={{
maxWidth: 800
}}
>
{url}
<Button
type="text"
icon={<CopyOutlined />}
onClick={() => copy(url)}
>
</Button>
<QrCode url={url} expiresAt={expiresAt} />
<Space.Compact block style={{ marginTop: 16 }}>
<Input
value={url}
readOnly
/>
<Tooltip title="复制链接">
<Button icon={<CopyOutlined />} onClick={() => {
copy(url);
setMessage({
content: '复制链接成功',
type: 'success',
});
}}>
</Button>
</Tooltip>
</Space.Compact>
</div>
</div>
);
}

View File

@ -168,7 +168,6 @@ const triggers: Trigger<EntityDict, 'user', RuntimeCxt>[] = [
id: await generateNewIdAsync(),
action: 'disable',
data: {
expired: true,
},
filter: {
ableState: 'enabled',