platformList修改
This commit is contained in:
parent
a0b1148247
commit
7234e2c73f
|
|
@ -2,6 +2,7 @@ import { WebEnv, WechatMpEnv } from 'oak-domain/lib/types/Environment';
|
|||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Config } from '../types/Config';
|
||||
import { Style } from '../types/Style';
|
||||
import { MenuType } from '../types/WeChat';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { WechatPublicEventData, WechatMpEventData } from 'oak-external-sdk';
|
||||
|
|
@ -65,6 +66,11 @@ export type GeneralAspectDict<ED extends EntityDict, Cxt extends BackendRuntimeC
|
|||
entityId: string;
|
||||
config: Config;
|
||||
}, context: Cxt) => Promise<void>;
|
||||
updateStyle: (params: {
|
||||
entity: 'platform' | 'system' | 'application';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt) => Promise<void>;
|
||||
updateApplicationConfig: (params: {
|
||||
entity: 'application';
|
||||
entityId: string;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCa
|
|||
import { getInfoByUrl } from './extraFile';
|
||||
import { getApplication, signatureJsSDK, uploadWechatMedia } from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { updateStyle } from './style2';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
import { createWechatLogin } from './wechatLogin';
|
||||
import { unbindingWechat } from './wechatUser';
|
||||
|
|
@ -22,6 +23,7 @@ declare const aspectDict: {
|
|||
sendCaptcha: typeof sendCaptcha;
|
||||
getApplication: typeof getApplication;
|
||||
updateConfig: typeof updateConfig;
|
||||
updateStyle: typeof updateStyle;
|
||||
updateApplicationConfig: typeof updateApplicationConfig;
|
||||
getWechatMpUserPhoneNumber: typeof getWechatMpUserPhoneNumber;
|
||||
logout: typeof logout;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCa
|
|||
import { getInfoByUrl } from './extraFile';
|
||||
import { getApplication, signatureJsSDK, uploadWechatMedia, } from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { updateStyle } from './style2';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
import { createWechatLogin } from './wechatLogin';
|
||||
import { unbindingWechat } from './wechatUser';
|
||||
|
|
@ -22,6 +23,7 @@ const aspectDict = {
|
|||
sendCaptcha,
|
||||
getApplication,
|
||||
updateConfig,
|
||||
updateStyle,
|
||||
updateApplicationConfig,
|
||||
getWechatMpUserPhoneNumber,
|
||||
logout,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Style } from '../types/Style';
|
||||
export declare function updateStyle<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
entity: 'platform' | 'system';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt): Promise<void>;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||
export async function updateStyle(params, context) {
|
||||
const { entity, entityId, style } = params;
|
||||
await context.operate(entity, {
|
||||
id: generateNewId(),
|
||||
action: 'update',
|
||||
data: {
|
||||
style,
|
||||
},
|
||||
filter: {
|
||||
id: entityId,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Style } from '../types/Style';
|
||||
export declare function updateStyle<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
entity: 'platform' | 'system';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt): Promise<void>;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||
export async function updateStyle(params, context) {
|
||||
const { entity, entityId, style } = params;
|
||||
await context.operate(entity, {
|
||||
id: generateNewId(),
|
||||
action: 'update',
|
||||
data: {
|
||||
style,
|
||||
},
|
||||
filter: {
|
||||
id: entityId,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|||
import { Tabs } from 'antd';
|
||||
import ApplicationDetail from '../detail';
|
||||
import ConfigUpsert from '../../config/application';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import Styles from './web.pc.module.less';
|
||||
export default function Render(props) {
|
||||
const { id, config, oakFullpath, name, style } = props.data;
|
||||
|
|
@ -22,9 +22,7 @@ export default function Render(props) {
|
|||
{
|
||||
label: _jsx("div", { className: Styles.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: (_jsx(StyleUpsert, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: (_jsx(StyleUpsert, { style: style, entity: 'platform', entityId: id, name: name })),
|
||||
},
|
||||
] }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
/// <reference types="react" />
|
||||
import { Style } from '../../../../types/Style';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||
style: Style;
|
||||
entity: "system" | "application" | "platform";
|
||||
entityId: string;
|
||||
name: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
import { cloneDeep } from 'oak-domain/lib/utils/lodash';
|
||||
export default OakComponent({
|
||||
isList: false,
|
||||
properties: {
|
||||
style: {},
|
||||
entity: '',
|
||||
entityId: '',
|
||||
name: '',
|
||||
},
|
||||
data: {
|
||||
initialStyle: {},
|
||||
dirty: false,
|
||||
currentStyle: {},
|
||||
},
|
||||
// listeners: {
|
||||
// config(prev, next) {
|
||||
// if (prev.config !== next.config) {
|
||||
// const config2 = next.config || {};
|
||||
// this.setState({
|
||||
// initialConfig: config2,
|
||||
// dirty: false,
|
||||
// currentConfig: cloneDeep(config2),
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const { style } = this.props;
|
||||
this.setState({
|
||||
initialStyle: style,
|
||||
dirty: false,
|
||||
currentStyle: cloneDeep(style),
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setValue(newStyle) {
|
||||
const newStyle2 = cloneDeep(newStyle || {});
|
||||
this.setState({
|
||||
currentStyle: newStyle2,
|
||||
dirty: true,
|
||||
});
|
||||
},
|
||||
// cleanKey(path: string, key: string) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const obj = get(currentConfig, path);
|
||||
// const obj2 = omit(obj, [key]);
|
||||
// set(currentConfig, path, obj2);
|
||||
// const newConfig = cloneDeep(currentConfig);
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
// removeItem(path: string, index: number) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const array = get(currentConfig, path);
|
||||
// (array as any[]).splice(index, 1);
|
||||
// const newConfig = cloneDeep(currentConfig || {});
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
resetStyle() {
|
||||
const { initialStyle } = this.state;
|
||||
this.setState({
|
||||
dirty: false,
|
||||
currentStyle: cloneDeep(initialStyle),
|
||||
});
|
||||
},
|
||||
async updateStyle() {
|
||||
const { currentStyle } = this.state;
|
||||
const { entity, entityId } = this.props;
|
||||
await this.features.style2.updateStyle(entity, entityId, currentStyle);
|
||||
this.setMessage({
|
||||
content: '操作成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.setState({
|
||||
dirty: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
.container {
|
||||
background: var(--oak-bg-color-container);
|
||||
// box-shadow: 0 2px 3px #0000001a;
|
||||
// border-radius: 3px;
|
||||
padding: 30px 32px;
|
||||
}
|
||||
|
||||
.padding {
|
||||
background-color: var(--oak-bg-color-page);
|
||||
width: 100%;
|
||||
height: 77px;
|
||||
}
|
||||
|
||||
.ctrl {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
border: solid 0.4px;
|
||||
border-radius: 3px;
|
||||
border-color: var(--oak-border-color);
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
background-color: var(--oak-bg-color-container);
|
||||
width: calc(100vw - 138px);
|
||||
top: 85px;
|
||||
height: 55px;
|
||||
|
||||
text {
|
||||
color: var(--oak-text-color-secondary);
|
||||
|
||||
.weight {
|
||||
font-weight: bold;
|
||||
color: var(--oak-text-color-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contains {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { Style as StyleDef } from '../../../../types/Style';
|
||||
import { EntityDict } from '../../../../oak-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
entity: string;
|
||||
name: string;
|
||||
currentStyle: StyleDef;
|
||||
dirty: boolean;
|
||||
}, {
|
||||
resetStyle: () => void;
|
||||
updateStyle: () => void;
|
||||
setValue: (style: StyleDef) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { Button, Alert, Affix, Space, Typography } from 'antd';
|
||||
import Style from './web.module.less';
|
||||
import StyleUpsert from '../../style';
|
||||
export default function Render(props) {
|
||||
const { entity, currentStyle, dirty, name } = props.data;
|
||||
const { resetStyle, updateStyle, setValue, t } = props.methods;
|
||||
return (_jsxs(_Fragment, { children: [_jsx(Affix, { offsetTop: 64, children: _jsx(Alert, { message: _jsx("div", { children: _jsxs("text", { children: ["\u60A8\u6B63\u5728\u66F4\u65B0", _jsx(Typography.Text, { keyboard: true, className: Style.weight, children: entity }), "\u5BF9\u8C61", _jsx(Typography.Text, { keyboard: true, className: Style.weight, children: name }), "\u7684\u6837\u5F0F\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C"] }) }), type: "info", showIcon: true, action: _jsxs(Space, { children: [_jsx(Button, { disabled: !dirty, type: "primary", danger: true, onClick: () => resetStyle(), style: {
|
||||
marginRight: 10,
|
||||
}, children: t('common::reset') }), _jsx(Button, { disabled: !dirty, type: "primary", onClick: () => updateStyle(), children: t('common::action.confirm') })] }) }) }), _jsx("div", { className: Style.contains, children: _jsx(StyleUpsert, { value: currentStyle, onChange: (s) => {
|
||||
setValue(s);
|
||||
} }) })] }));
|
||||
}
|
||||
|
|
@ -112,5 +112,5 @@ function AmapAccount(props) {
|
|||
export default function Account(props) {
|
||||
const { account, setValue, removeItem } = props;
|
||||
const { tencent, qiniu, ali, amap } = account;
|
||||
return (_jsxs(Space, { direction: "vertical", size: "middle", style: { display: 'flex' }, children: [_jsx(Row, { children: _jsx(Card, { className: Styles.tips, children: "\u6BCF\u79CD\u4E91\u5382\u5546\u5747\u53EF\u914D\u7F6E\u591A\u4E2A\u5E10\u53F7\uFF0C\u76F8\u5E94\u7684\u670D\u52A1\u6240\u4F7F\u7528\u7684\u5E10\u53F7\u8BF7\u51C6\u786E\u5BF9\u5E94" }) }), _jsx(TencentAccount, { accounts: tencent || [], setValue: (path, value) => setValue(`tencent.${path}`, value), removeItem: (path, index) => removeItem(`tencent`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), _jsx(QiniuAccount, { accounts: qiniu || [], setValue: (path, value) => setValue(`qiniu.${path}`, value), removeItem: (path, index) => removeItem(`qiniu`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), _jsx(AliAccount, { accounts: ali || [], setValue: (path, value) => setValue(`ali.${path}`, value), removeItem: (path, index) => removeItem(`ali`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), _jsx(AmapAccount, { accounts: amap || [], setValue: (path, value) => setValue(`amap.${path}`, value), removeItem: (path, index) => removeItem(`amap`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) })] }));
|
||||
return (_jsxs(Space, { direction: "vertical", size: "middle", style: { display: 'flex' }, children: [_jsx(Row, { children: _jsx(Card, { className: Styles.tips, children: "\u6BCF\u79CD\u4E91\u5382\u5546\u5747\u53EF\u914D\u7F6E\u591A\u4E2A\u5E10\u53F7\uFF0C\u76F8\u5E94\u7684\u670D\u52A1\u6240\u4F7F\u7528\u7684\u5E10\u53F7\u8BF7\u51C6\u786E\u5BF9\u5E94" }) }), _jsx(TencentAccount, { accounts: tencent || [], setValue: (path, value) => setValue(`tencent.${path}`, value), removeItem: (path, index) => removeItem(`tencent`, index), addItem: (path, index) => setValue(`tencent.${index}`, {}) }), _jsx(QiniuAccount, { accounts: qiniu || [], setValue: (path, value) => setValue(`qiniu.${path}`, value), removeItem: (path, index) => removeItem(`qiniu`, index), addItem: (path, index) => setValue(`qiniu.${index}`, {}) }), _jsx(AliAccount, { accounts: ali || [], setValue: (path, value) => setValue(`ali.${path}`, value), removeItem: (path, index) => removeItem(`ali`, index), addItem: (path, index) => setValue(`ali.${index}`, {}) }), _jsx(AmapAccount, { accounts: amap || [], setValue: (path, value) => setValue(`amap.${path}`, value), removeItem: (path, index) => removeItem(`amap`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,16 +7,16 @@ function QiniuCos(props) {
|
|||
{
|
||||
key: '0',
|
||||
label: '配置项',
|
||||
children: (_jsxs(Form, { colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 }, children: [_jsx(Form.Item, { label: "accessKey", children: _jsx(_Fragment, { children: _jsx(Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: cos?.accessKey, onChange: (e) => setValue(`accessKey`, e.target.value) }) }) }), _jsx(Form.Item, { label: "uploadHost", children: _jsx(_Fragment, { children: _jsx(Input, { placeholder: "\u8BF7\u8F93\u5165uploadHost", type: "text", value: cos?.uploadHost, onChange: (e) => setValue(`uploadHost`, e.target.value) }) }) }), _jsx(Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
|
||||
children: (_jsxs(Form, { colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 }, children: [_jsx(Form.Item, { label: "accessKey", children: _jsx(_Fragment, { children: _jsx(Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: cos?.accessKey, onChange: (e) => setValue(`accessKey`, e.target.value) }) }) }), _jsx(Form.Item, { label: "uploadHost", children: _jsx(_Fragment, { children: _jsx(Input, { placeholder: "\u8BF7\u8F93\u5165uploadHost", type: "text", value: cos?.uploadHost, onChange: (e) => setValue(`uploadHost`, e.target.value) }) }) }), _jsx(Divider, { orientation: "left", className: Styles.title, children: "bucket\u914D\u7F6E" }), _jsx(Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
|
||||
// hideAdd={!(sms.length > 0)}
|
||||
onEdit: (targetKey, action) => {
|
||||
if (action === 'add') {
|
||||
setValue(`buckets.${cos.buckets.length}`, {});
|
||||
setValue(`buckets.${cos?.buckets?.length || 0}`, {});
|
||||
}
|
||||
else {
|
||||
removeItem('buckets', parseInt(targetKey, 10));
|
||||
}
|
||||
}, items: cos?.buckets.length > 0
|
||||
}, items: cos?.buckets?.length > 0
|
||||
? cos.buckets.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `bucket:${idx + 1}`,
|
||||
|
|
@ -33,9 +33,9 @@ function QiniuCos(props) {
|
|||
},
|
||||
] }) }) })] })),
|
||||
}))
|
||||
: [] }), _jsx(Form.Item, { label: "defaultBucket", children: _jsx(_Fragment, { children: _jsx(Select, { allowClear: true, style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9\u9ED8\u8BA4bucket", value: cos.defaultBucket, onChange: (value) => {
|
||||
: [] }), _jsx(Form.Item, { label: "defaultBucket", children: _jsx(_Fragment, { children: _jsx(Select, { allowClear: true, style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9\u9ED8\u8BA4bucket", value: cos?.defaultBucket, onChange: (value) => {
|
||||
setValue(`defaultBucket`, value);
|
||||
}, options: cos.buckets.map(ele => ({
|
||||
}, options: cos?.buckets?.map(ele => ({
|
||||
label: ele.name,
|
||||
value: ele.name
|
||||
})) }) }) })] })),
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ export default OakComponent({
|
|||
this.addItem(Object.assign({}, updateData, {
|
||||
extra1: null,
|
||||
}), undefined, async () => {
|
||||
console.log(updateData);
|
||||
await this.features.extraFile.upload(updateData, extra1);
|
||||
});
|
||||
if (avatar) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ export default OakComponent({
|
|||
uploadState: 1,
|
||||
},
|
||||
formData({ data: originalFiles, features }) {
|
||||
console.log(originalFiles);
|
||||
let files = originalFiles?.filter((ele) => !ele.$$deleteAt$$).sort((ele1, ele2) => ele1.sort - ele2.sort);
|
||||
if (this.props.tag1) {
|
||||
files = files?.filter((ele) => ele?.tag1 === this.props.tag1);
|
||||
|
|
@ -97,9 +96,7 @@ export default OakComponent({
|
|||
getUrl(extraFile) {
|
||||
const { fileList } = this.state;
|
||||
if (fileList[extraFile?.id]) {
|
||||
console.log(fileList[extraFile?.id]);
|
||||
const url = this.features.extraFile.getUrl(Object.assign({}, extraFile, { extra1: fileList[extraFile?.id] }));
|
||||
console.log(url);
|
||||
return url;
|
||||
}
|
||||
return this.features.extraFile.getUrl(extraFile);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|||
import { Tabs } from 'antd';
|
||||
import Styles from './web.pc.module.less';
|
||||
import ConfigUpsert from '../../config/upsert';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import PlatformDetail from '../detail';
|
||||
import PlatformSystem from '../system';
|
||||
export default function render(props) {
|
||||
|
|
@ -23,9 +23,7 @@ export default function render(props) {
|
|||
{
|
||||
label: _jsx("div", { className: Styles.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: (_jsx(StyleUpsert, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: (_jsx(StyleUpsert, { style: style, entity: 'platform', entityId: id, name: name })),
|
||||
},
|
||||
{
|
||||
label: _jsx("div", { className: Styles.tabLabel, children: t('system-list') }),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|||
import { Tabs } from 'antd';
|
||||
import SystemDetail from '../detail';
|
||||
import ConfigUpsert from '../../config/upsert';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import DomainList from '../../domain/list';
|
||||
import ApplicationList from '../application';
|
||||
import Styles from './web.pc.module.less';
|
||||
|
|
@ -24,9 +24,7 @@ export default function Render(props) {
|
|||
{
|
||||
label: _jsx("div", { className: Styles.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: (_jsx(StyleUpsert, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: (_jsx(StyleUpsert, { style: style, entity: 'system', entityId: id, name: name })),
|
||||
},
|
||||
{
|
||||
label: _jsx("div", { className: Styles.tabLabel, children: t('application-list') }),
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ export default function Render(props) {
|
|||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
console.log(config);
|
||||
if (config && config.button && config.button[0] && onlyOne) {
|
||||
setMenuName(config.button[0].name);
|
||||
setOnlyOne(false);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { ExtraFile } from './extraFile';
|
|||
import { ExtraFile2 } from './extraFile2';
|
||||
import { Application } from './application';
|
||||
import { Config } from './config';
|
||||
import { Style2 } from './style2';
|
||||
import { WeiXinJsSdk } from './weiXinJsSdk';
|
||||
import { WechatMenu } from './wechatMenu';
|
||||
import { WechatPublicTag } from './wechatPublicTag';
|
||||
|
|
@ -21,6 +22,7 @@ export type GeneralFeatures<ED extends EntityDict, Cxt extends BackendRuntimeCon
|
|||
extraFile2: ExtraFile2<ED, Cxt, FrontCxt, AD>;
|
||||
application: Application<ED, Cxt, FrontCxt, AD>;
|
||||
config: Config<ED, Cxt, FrontCxt, AD>;
|
||||
style2: Style2<ED, Cxt, FrontCxt, AD>;
|
||||
weiXinJsSdk: WeiXinJsSdk<ED, Cxt, FrontCxt, AD>;
|
||||
theme: Theme<ED, Cxt, FrontCxt, AD>;
|
||||
wechatMenu: WechatMenu<ED, Cxt, FrontCxt, AD>;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ExtraFile } from './extraFile';
|
|||
import { ExtraFile2 } from './extraFile2';
|
||||
import { Application } from './application';
|
||||
import { Config } from './config';
|
||||
import { Style2 } from './style2';
|
||||
import { WeiXinJsSdk } from './weiXinJsSdk';
|
||||
import { WechatMenu } from './wechatMenu';
|
||||
import { WechatPublicTag } from './wechatPublicTag';
|
||||
|
|
@ -16,6 +17,7 @@ export function initialize(basicFeatures, type, domain) {
|
|||
const extraFile = new ExtraFile(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const extraFile2 = new ExtraFile2(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const config = new Config(basicFeatures.cache);
|
||||
const style2 = new Style2(basicFeatures.cache);
|
||||
const weiXinJsSdk = new WeiXinJsSdk(basicFeatures.cache, basicFeatures.localStorage, basicFeatures.environment);
|
||||
const theme = new Theme(basicFeatures.cache, basicFeatures.localStorage);
|
||||
return {
|
||||
|
|
@ -24,6 +26,7 @@ export function initialize(basicFeatures, type, domain) {
|
|||
extraFile2,
|
||||
application,
|
||||
config,
|
||||
style2,
|
||||
weiXinJsSdk,
|
||||
theme,
|
||||
wechatMenu,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import AspectDict from '../aspects/AspectDict';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Cache } from 'oak-frontend-base/es/features/cache';
|
||||
import { Style as StyleDef } from '../types/Style';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { CommonAspectDict } from 'oak-common-aspect';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
export declare class Style<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>, AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>> extends Feature {
|
||||
private cache;
|
||||
constructor(cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>);
|
||||
updateStyle(entity: 'platform' | 'system' | 'application', entityId: string, style: StyleDef): Promise<void>;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
export class Style extends Feature {
|
||||
cache;
|
||||
constructor(cache) {
|
||||
super();
|
||||
this.cache = cache;
|
||||
}
|
||||
async updateStyle(entity, entityId, style) {
|
||||
await this.cache.exec('updateStyle', {
|
||||
entity,
|
||||
entityId,
|
||||
style,
|
||||
});
|
||||
this.publish();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import AspectDict from '../aspects/AspectDict';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Cache } from 'oak-frontend-base/es/features/cache';
|
||||
import { Style as StyleDef } from '../types/Style';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { CommonAspectDict } from 'oak-common-aspect';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
export declare class Style2<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>, AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>> extends Feature {
|
||||
private cache;
|
||||
constructor(cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>);
|
||||
updateStyle(entity: 'platform' | 'system' | 'application', entityId: string, style: StyleDef): Promise<void>;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
export class Style2 extends Feature {
|
||||
cache;
|
||||
constructor(cache) {
|
||||
super();
|
||||
this.cache = cache;
|
||||
}
|
||||
async updateStyle(entity, entityId, style) {
|
||||
await this.cache.exec('updateStyle', {
|
||||
entity,
|
||||
entityId,
|
||||
style,
|
||||
});
|
||||
this.publish();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ import { WebEnv, WechatMpEnv } from 'oak-domain/lib/types/Environment';
|
|||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Config } from '../types/Config';
|
||||
import { Style } from '../types/Style';
|
||||
import { MenuType } from '../types/WeChat';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { WechatPublicEventData, WechatMpEventData } from 'oak-external-sdk';
|
||||
|
|
@ -65,6 +66,11 @@ export type GeneralAspectDict<ED extends EntityDict, Cxt extends BackendRuntimeC
|
|||
entityId: string;
|
||||
config: Config;
|
||||
}, context: Cxt) => Promise<void>;
|
||||
updateStyle: (params: {
|
||||
entity: 'platform' | 'system' | 'application';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt) => Promise<void>;
|
||||
updateApplicationConfig: (params: {
|
||||
entity: 'application';
|
||||
entityId: string;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCa
|
|||
import { getInfoByUrl } from './extraFile';
|
||||
import { getApplication, signatureJsSDK, uploadWechatMedia } from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { updateStyle } from './style2';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
import { createWechatLogin } from './wechatLogin';
|
||||
import { unbindingWechat } from './wechatUser';
|
||||
|
|
@ -22,6 +23,7 @@ declare const aspectDict: {
|
|||
sendCaptcha: typeof sendCaptcha;
|
||||
getApplication: typeof getApplication;
|
||||
updateConfig: typeof updateConfig;
|
||||
updateStyle: typeof updateStyle;
|
||||
updateApplicationConfig: typeof updateApplicationConfig;
|
||||
getWechatMpUserPhoneNumber: typeof getWechatMpUserPhoneNumber;
|
||||
logout: typeof logout;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ const token_1 = require("./token");
|
|||
const extraFile_1 = require("./extraFile");
|
||||
const application_1 = require("./application");
|
||||
const config_1 = require("./config");
|
||||
const style2_1 = require("./style2");
|
||||
const user_1 = require("./user");
|
||||
const wechatLogin_1 = require("./wechatLogin");
|
||||
const wechatUser_1 = require("./wechatUser");
|
||||
|
|
@ -24,6 +25,7 @@ const aspectDict = {
|
|||
sendCaptcha: token_1.sendCaptcha,
|
||||
getApplication: application_1.getApplication,
|
||||
updateConfig: config_1.updateConfig,
|
||||
updateStyle: style2_1.updateStyle,
|
||||
updateApplicationConfig: config_1.updateApplicationConfig,
|
||||
getWechatMpUserPhoneNumber: token_1.getWechatMpUserPhoneNumber,
|
||||
logout: token_1.logout,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Style } from '../types/Style';
|
||||
export declare function updateStyle<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
entity: 'platform' | 'system';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt): Promise<void>;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updateStyle = void 0;
|
||||
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||
async function updateStyle(params, context) {
|
||||
const { entity, entityId, style } = params;
|
||||
await context.operate(entity, {
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
style,
|
||||
},
|
||||
filter: {
|
||||
id: entityId,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
exports.updateStyle = updateStyle;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Style } from '../types/Style';
|
||||
export declare function updateStyle<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
entity: 'platform' | 'system';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
}, context: Cxt): Promise<void>;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updateStyle = void 0;
|
||||
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||
async function updateStyle(params, context) {
|
||||
const { entity, entityId, style } = params;
|
||||
await context.operate(entity, {
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
style,
|
||||
},
|
||||
filter: {
|
||||
id: entityId,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
exports.updateStyle = updateStyle;
|
||||
|
|
@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|||
const antd_1 = require("antd");
|
||||
const detail_1 = tslib_1.__importDefault(require("../detail"));
|
||||
const application_1 = tslib_1.__importDefault(require("../../config/application"));
|
||||
const style_1 = tslib_1.__importDefault(require("../../config/style"));
|
||||
const platform_1 = tslib_1.__importDefault(require("../../config/style/platform"));
|
||||
const web_pc_module_less_1 = tslib_1.__importDefault(require("./web.pc.module.less"));
|
||||
function Render(props) {
|
||||
const { id, config, oakFullpath, name, style } = props.data;
|
||||
|
|
@ -25,9 +25,7 @@ function Render(props) {
|
|||
{
|
||||
label: (0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: ((0, jsx_runtime_1.jsx)(style_1.default, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: ((0, jsx_runtime_1.jsx)(platform_1.default, { style: style, entity: 'platform', entityId: id, name: name })),
|
||||
},
|
||||
] }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
/// <reference types="react" />
|
||||
import { Style } from '../../../../types/Style';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||
style: Style;
|
||||
entity: "system" | "application" | "platform";
|
||||
entityId: string;
|
||||
name: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
||||
exports.default = OakComponent({
|
||||
isList: false,
|
||||
properties: {
|
||||
style: {},
|
||||
entity: '',
|
||||
entityId: '',
|
||||
name: '',
|
||||
},
|
||||
data: {
|
||||
initialStyle: {},
|
||||
dirty: false,
|
||||
currentStyle: {},
|
||||
},
|
||||
// listeners: {
|
||||
// config(prev, next) {
|
||||
// if (prev.config !== next.config) {
|
||||
// const config2 = next.config || {};
|
||||
// this.setState({
|
||||
// initialConfig: config2,
|
||||
// dirty: false,
|
||||
// currentConfig: cloneDeep(config2),
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const { style } = this.props;
|
||||
this.setState({
|
||||
initialStyle: style,
|
||||
dirty: false,
|
||||
currentStyle: (0, lodash_1.cloneDeep)(style),
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setValue(newStyle) {
|
||||
const newStyle2 = (0, lodash_1.cloneDeep)(newStyle || {});
|
||||
this.setState({
|
||||
currentStyle: newStyle2,
|
||||
dirty: true,
|
||||
});
|
||||
},
|
||||
// cleanKey(path: string, key: string) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const obj = get(currentConfig, path);
|
||||
// const obj2 = omit(obj, [key]);
|
||||
// set(currentConfig, path, obj2);
|
||||
// const newConfig = cloneDeep(currentConfig);
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
// removeItem(path: string, index: number) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const array = get(currentConfig, path);
|
||||
// (array as any[]).splice(index, 1);
|
||||
// const newConfig = cloneDeep(currentConfig || {});
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
resetStyle() {
|
||||
const { initialStyle } = this.state;
|
||||
this.setState({
|
||||
dirty: false,
|
||||
currentStyle: (0, lodash_1.cloneDeep)(initialStyle),
|
||||
});
|
||||
},
|
||||
async updateStyle() {
|
||||
const { currentStyle } = this.state;
|
||||
const { entity, entityId } = this.props;
|
||||
await this.features.style2.updateStyle(entity, entityId, currentStyle);
|
||||
this.setMessage({
|
||||
content: '操作成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.setState({
|
||||
dirty: false,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
.container {
|
||||
background: var(--oak-bg-color-container);
|
||||
// box-shadow: 0 2px 3px #0000001a;
|
||||
// border-radius: 3px;
|
||||
padding: 30px 32px;
|
||||
}
|
||||
|
||||
.padding {
|
||||
background-color: var(--oak-bg-color-page);
|
||||
width: 100%;
|
||||
height: 77px;
|
||||
}
|
||||
|
||||
.ctrl {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
border: solid 0.4px;
|
||||
border-radius: 3px;
|
||||
border-color: var(--oak-border-color);
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
background-color: var(--oak-bg-color-container);
|
||||
width: calc(100vw - 138px);
|
||||
top: 85px;
|
||||
height: 55px;
|
||||
|
||||
text {
|
||||
color: var(--oak-text-color-secondary);
|
||||
|
||||
.weight {
|
||||
font-weight: bold;
|
||||
color: var(--oak-text-color-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contains {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { Style as StyleDef } from '../../../../types/Style';
|
||||
import { EntityDict } from '../../../../oak-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
entity: string;
|
||||
name: string;
|
||||
currentStyle: StyleDef;
|
||||
dirty: boolean;
|
||||
}, {
|
||||
resetStyle: () => void;
|
||||
updateStyle: () => void;
|
||||
setValue: (style: StyleDef) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const antd_1 = require("antd");
|
||||
const web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
const style_1 = tslib_1.__importDefault(require("../../style"));
|
||||
function Render(props) {
|
||||
const { entity, currentStyle, dirty, name } = props.data;
|
||||
const { resetStyle, updateStyle, setValue, t } = props.methods;
|
||||
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Affix, { offsetTop: 64, children: (0, jsx_runtime_1.jsx)(antd_1.Alert, { message: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("text", { children: ["\u60A8\u6B63\u5728\u66F4\u65B0", (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, { keyboard: true, className: web_module_less_1.default.weight, children: entity }), "\u5BF9\u8C61", (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, { keyboard: true, className: web_module_less_1.default.weight, children: name }), "\u7684\u6837\u5F0F\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C"] }) }), type: "info", showIcon: true, action: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, { disabled: !dirty, type: "primary", danger: true, onClick: () => resetStyle(), style: {
|
||||
marginRight: 10,
|
||||
}, children: t('common::reset') }), (0, jsx_runtime_1.jsx)(antd_1.Button, { disabled: !dirty, type: "primary", onClick: () => updateStyle(), children: t('common::action.confirm') })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.contains, children: (0, jsx_runtime_1.jsx)(style_1.default, { value: currentStyle, onChange: (s) => {
|
||||
setValue(s);
|
||||
} }) })] }));
|
||||
}
|
||||
exports.default = Render;
|
||||
|
|
@ -115,6 +115,6 @@ function AmapAccount(props) {
|
|||
function Account(props) {
|
||||
const { account, setValue, removeItem } = props;
|
||||
const { tencent, qiniu, ali, amap } = account;
|
||||
return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", size: "middle", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, { className: web_module_less_1.default.tips, children: "\u6BCF\u79CD\u4E91\u5382\u5546\u5747\u53EF\u914D\u7F6E\u591A\u4E2A\u5E10\u53F7\uFF0C\u76F8\u5E94\u7684\u670D\u52A1\u6240\u4F7F\u7528\u7684\u5E10\u53F7\u8BF7\u51C6\u786E\u5BF9\u5E94" }) }), (0, jsx_runtime_1.jsx)(TencentAccount, { accounts: tencent || [], setValue: (path, value) => setValue(`tencent.${path}`, value), removeItem: (path, index) => removeItem(`tencent`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), (0, jsx_runtime_1.jsx)(QiniuAccount, { accounts: qiniu || [], setValue: (path, value) => setValue(`qiniu.${path}`, value), removeItem: (path, index) => removeItem(`qiniu`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), (0, jsx_runtime_1.jsx)(AliAccount, { accounts: ali || [], setValue: (path, value) => setValue(`ali.${path}`, value), removeItem: (path, index) => removeItem(`ali`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) }), (0, jsx_runtime_1.jsx)(AmapAccount, { accounts: amap || [], setValue: (path, value) => setValue(`amap.${path}`, value), removeItem: (path, index) => removeItem(`amap`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) })] }));
|
||||
return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", size: "middle", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, { className: web_module_less_1.default.tips, children: "\u6BCF\u79CD\u4E91\u5382\u5546\u5747\u53EF\u914D\u7F6E\u591A\u4E2A\u5E10\u53F7\uFF0C\u76F8\u5E94\u7684\u670D\u52A1\u6240\u4F7F\u7528\u7684\u5E10\u53F7\u8BF7\u51C6\u786E\u5BF9\u5E94" }) }), (0, jsx_runtime_1.jsx)(TencentAccount, { accounts: tencent || [], setValue: (path, value) => setValue(`tencent.${path}`, value), removeItem: (path, index) => removeItem(`tencent`, index), addItem: (path, index) => setValue(`tencent.${index}`, {}) }), (0, jsx_runtime_1.jsx)(QiniuAccount, { accounts: qiniu || [], setValue: (path, value) => setValue(`qiniu.${path}`, value), removeItem: (path, index) => removeItem(`qiniu`, index), addItem: (path, index) => setValue(`qiniu.${index}`, {}) }), (0, jsx_runtime_1.jsx)(AliAccount, { accounts: ali || [], setValue: (path, value) => setValue(`ali.${path}`, value), removeItem: (path, index) => removeItem(`ali`, index), addItem: (path, index) => setValue(`ali.${index}`, {}) }), (0, jsx_runtime_1.jsx)(AmapAccount, { accounts: amap || [], setValue: (path, value) => setValue(`amap.${path}`, value), removeItem: (path, index) => removeItem(`amap`, index), addItem: (path, index) => setValue(`amap.${index}`, {}) })] }));
|
||||
}
|
||||
exports.default = Account;
|
||||
|
|
|
|||
|
|
@ -10,16 +10,16 @@ function QiniuCos(props) {
|
|||
{
|
||||
key: '0',
|
||||
label: '配置项',
|
||||
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, { colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 }, children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "accessKey", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: cos?.accessKey, onChange: (e) => setValue(`accessKey`, e.target.value) }) }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "uploadHost", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165uploadHost", type: "text", value: cos?.uploadHost, onChange: (e) => setValue(`uploadHost`, e.target.value) }) }) }), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
|
||||
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, { colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 }, children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "accessKey", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: cos?.accessKey, onChange: (e) => setValue(`accessKey`, e.target.value) }) }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "uploadHost", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165uploadHost", type: "text", value: cos?.uploadHost, onChange: (e) => setValue(`uploadHost`, e.target.value) }) }) }), (0, jsx_runtime_1.jsx)(antd_1.Divider, { orientation: "left", className: web_module_less_1.default.title, children: "bucket\u914D\u7F6E" }), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
|
||||
// hideAdd={!(sms.length > 0)}
|
||||
onEdit: (targetKey, action) => {
|
||||
if (action === 'add') {
|
||||
setValue(`buckets.${cos.buckets.length}`, {});
|
||||
setValue(`buckets.${cos?.buckets?.length || 0}`, {});
|
||||
}
|
||||
else {
|
||||
removeItem('buckets', parseInt(targetKey, 10));
|
||||
}
|
||||
}, items: cos?.buckets.length > 0
|
||||
}, items: cos?.buckets?.length > 0
|
||||
? cos.buckets.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `bucket:${idx + 1}`,
|
||||
|
|
@ -36,9 +36,9 @@ function QiniuCos(props) {
|
|||
},
|
||||
] }) }) })] })),
|
||||
}))
|
||||
: [] }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "defaultBucket", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Select, { allowClear: true, style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9\u9ED8\u8BA4bucket", value: cos.defaultBucket, onChange: (value) => {
|
||||
: [] }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: "defaultBucket", children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Select, { allowClear: true, style: { width: '100%' }, placeholder: "\u8BF7\u9009\u62E9\u9ED8\u8BA4bucket", value: cos?.defaultBucket, onChange: (value) => {
|
||||
setValue(`defaultBucket`, value);
|
||||
}, options: cos.buckets.map(ele => ({
|
||||
}, options: cos?.buckets?.map(ele => ({
|
||||
label: ele.name,
|
||||
value: ele.name
|
||||
})) }) }) })] })),
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ exports.default = OakComponent({
|
|||
this.addItem(Object.assign({}, updateData, {
|
||||
extra1: null,
|
||||
}), undefined, async () => {
|
||||
console.log(updateData);
|
||||
await this.features.extraFile.upload(updateData, extra1);
|
||||
});
|
||||
if (avatar) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ exports.default = OakComponent({
|
|||
uploadState: 1,
|
||||
},
|
||||
formData({ data: originalFiles, features }) {
|
||||
console.log(originalFiles);
|
||||
let files = originalFiles?.filter((ele) => !ele.$$deleteAt$$).sort((ele1, ele2) => ele1.sort - ele2.sort);
|
||||
if (this.props.tag1) {
|
||||
files = files?.filter((ele) => ele?.tag1 === this.props.tag1);
|
||||
|
|
@ -100,9 +99,7 @@ exports.default = OakComponent({
|
|||
getUrl(extraFile) {
|
||||
const { fileList } = this.state;
|
||||
if (fileList[extraFile?.id]) {
|
||||
console.log(fileList[extraFile?.id]);
|
||||
const url = this.features.extraFile.getUrl(Object.assign({}, extraFile, { extra1: fileList[extraFile?.id] }));
|
||||
console.log(url);
|
||||
return url;
|
||||
}
|
||||
return this.features.extraFile.getUrl(extraFile);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|||
const antd_1 = require("antd");
|
||||
const web_pc_module_less_1 = tslib_1.__importDefault(require("./web.pc.module.less"));
|
||||
const upsert_1 = tslib_1.__importDefault(require("../../config/upsert"));
|
||||
const style_1 = tslib_1.__importDefault(require("../../config/style"));
|
||||
const platform_1 = tslib_1.__importDefault(require("../../config/style/platform"));
|
||||
const detail_1 = tslib_1.__importDefault(require("../detail"));
|
||||
const system_1 = tslib_1.__importDefault(require("../system"));
|
||||
function render(props) {
|
||||
|
|
@ -26,9 +26,7 @@ function render(props) {
|
|||
{
|
||||
label: (0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: ((0, jsx_runtime_1.jsx)(style_1.default, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: ((0, jsx_runtime_1.jsx)(platform_1.default, { style: style, entity: 'platform', entityId: id, name: name })),
|
||||
},
|
||||
{
|
||||
label: (0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.tabLabel, children: t('system-list') }),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|||
const antd_1 = require("antd");
|
||||
const detail_1 = tslib_1.__importDefault(require("../detail"));
|
||||
const upsert_1 = tslib_1.__importDefault(require("../../config/upsert"));
|
||||
const style_1 = tslib_1.__importDefault(require("../../config/style"));
|
||||
const platform_1 = tslib_1.__importDefault(require("../../config/style/platform"));
|
||||
const list_1 = tslib_1.__importDefault(require("../../domain/list"));
|
||||
const application_1 = tslib_1.__importDefault(require("../application"));
|
||||
const web_pc_module_less_1 = tslib_1.__importDefault(require("./web.pc.module.less"));
|
||||
|
|
@ -27,9 +27,7 @@ function Render(props) {
|
|||
{
|
||||
label: (0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.tabLabel, children: t('style') }),
|
||||
key: 'style',
|
||||
children: ((0, jsx_runtime_1.jsx)(style_1.default, { value: style, onChange: (s) => {
|
||||
update({ style: s });
|
||||
} })),
|
||||
children: ((0, jsx_runtime_1.jsx)(platform_1.default, { style: style, entity: 'system', entityId: id, name: name })),
|
||||
},
|
||||
{
|
||||
label: (0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.tabLabel, children: t('application-list') }),
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ function Render(props) {
|
|||
}
|
||||
};
|
||||
(0, react_1.useEffect)(() => {
|
||||
console.log(config);
|
||||
if (config && config.button && config.button[0] && onlyOne) {
|
||||
setMenuName(config.button[0].name);
|
||||
setOnlyOne(false);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { ExtraFile } from './extraFile';
|
|||
import { ExtraFile2 } from './extraFile2';
|
||||
import { Application } from './application';
|
||||
import { Config } from './config';
|
||||
import { Style2 } from './style2';
|
||||
import { WeiXinJsSdk } from './weiXinJsSdk';
|
||||
import { WechatMenu } from './wechatMenu';
|
||||
import { WechatPublicTag } from './wechatPublicTag';
|
||||
|
|
@ -21,6 +22,7 @@ export type GeneralFeatures<ED extends EntityDict, Cxt extends BackendRuntimeCon
|
|||
extraFile2: ExtraFile2<ED, Cxt, FrontCxt, AD>;
|
||||
application: Application<ED, Cxt, FrontCxt, AD>;
|
||||
config: Config<ED, Cxt, FrontCxt, AD>;
|
||||
style2: Style2<ED, Cxt, FrontCxt, AD>;
|
||||
weiXinJsSdk: WeiXinJsSdk<ED, Cxt, FrontCxt, AD>;
|
||||
theme: Theme<ED, Cxt, FrontCxt, AD>;
|
||||
wechatMenu: WechatMenu<ED, Cxt, FrontCxt, AD>;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const extraFile_1 = require("./extraFile");
|
|||
const extraFile2_1 = require("./extraFile2");
|
||||
const application_1 = require("./application");
|
||||
const config_1 = require("./config");
|
||||
const style2_1 = require("./style2");
|
||||
const weiXinJsSdk_1 = require("./weiXinJsSdk");
|
||||
const wechatMenu_1 = require("./wechatMenu");
|
||||
const wechatPublicTag_1 = require("./wechatPublicTag");
|
||||
|
|
@ -20,6 +21,7 @@ function initialize(basicFeatures, type, domain) {
|
|||
const extraFile = new extraFile_1.ExtraFile(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const extraFile2 = new extraFile2_1.ExtraFile2(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const config = new config_1.Config(basicFeatures.cache);
|
||||
const style2 = new style2_1.Style2(basicFeatures.cache);
|
||||
const weiXinJsSdk = new weiXinJsSdk_1.WeiXinJsSdk(basicFeatures.cache, basicFeatures.localStorage, basicFeatures.environment);
|
||||
const theme = new theme_1.default(basicFeatures.cache, basicFeatures.localStorage);
|
||||
return {
|
||||
|
|
@ -28,6 +30,7 @@ function initialize(basicFeatures, type, domain) {
|
|||
extraFile2,
|
||||
application,
|
||||
config,
|
||||
style2,
|
||||
weiXinJsSdk,
|
||||
theme,
|
||||
wechatMenu,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import AspectDict from '../aspects/AspectDict';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Cache } from 'oak-frontend-base/es/features/cache';
|
||||
import { Style as StyleDef } from '../types/Style';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { CommonAspectDict } from 'oak-common-aspect';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
export declare class Style<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>, AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>> extends Feature {
|
||||
private cache;
|
||||
constructor(cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>);
|
||||
updateStyle(entity: 'platform' | 'system' | 'application', entityId: string, style: StyleDef): Promise<void>;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Style = void 0;
|
||||
const oak_frontend_base_1 = require("oak-frontend-base");
|
||||
class Style extends oak_frontend_base_1.Feature {
|
||||
cache;
|
||||
constructor(cache) {
|
||||
super();
|
||||
this.cache = cache;
|
||||
}
|
||||
async updateStyle(entity, entityId, style) {
|
||||
await this.cache.exec('updateStyle', {
|
||||
entity,
|
||||
entityId,
|
||||
style,
|
||||
});
|
||||
this.publish();
|
||||
}
|
||||
}
|
||||
exports.Style = Style;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import AspectDict from '../aspects/AspectDict';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Cache } from 'oak-frontend-base/es/features/cache';
|
||||
import { Style as StyleDef } from '../types/Style';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { CommonAspectDict } from 'oak-common-aspect';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
export declare class Style2<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>, AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>> extends Feature {
|
||||
private cache;
|
||||
constructor(cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>);
|
||||
updateStyle(entity: 'platform' | 'system' | 'application', entityId: string, style: StyleDef): Promise<void>;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Style2 = void 0;
|
||||
const oak_frontend_base_1 = require("oak-frontend-base");
|
||||
class Style2 extends oak_frontend_base_1.Feature {
|
||||
cache;
|
||||
constructor(cache) {
|
||||
super();
|
||||
this.cache = cache;
|
||||
}
|
||||
async updateStyle(entity, entityId, style) {
|
||||
await this.cache.exec('updateStyle', {
|
||||
entity,
|
||||
entityId,
|
||||
style,
|
||||
});
|
||||
this.publish();
|
||||
}
|
||||
}
|
||||
exports.Style2 = Style2;
|
||||
|
|
@ -2,6 +2,7 @@ import { WebEnv, WechatMpEnv } from 'oak-domain/lib/types/Environment';
|
|||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Config, Origin } from '../types/Config';
|
||||
import { Style } from '../types/Style';
|
||||
import { MediaType, MenuType } from '../types/WeChat';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { MediaVideoDescription } from '../types/WeChat'
|
||||
|
|
@ -109,6 +110,14 @@ export type GeneralAspectDict<
|
|||
},
|
||||
context: Cxt
|
||||
) => Promise<void>;
|
||||
updateStyle: (
|
||||
params: {
|
||||
entity: 'platform' | 'system' | 'application';
|
||||
entityId: string;
|
||||
style: Style;
|
||||
},
|
||||
context: Cxt
|
||||
) => Promise<void>;
|
||||
updateApplicationConfig: (
|
||||
params: {
|
||||
entity: 'application';
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import {
|
|||
uploadWechatMedia,
|
||||
} from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { updateStyle } from './style2';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
import { createWechatLogin } from './wechatLogin';
|
||||
import { unbindingWechat } from './wechatUser';
|
||||
|
|
@ -55,6 +56,7 @@ const aspectDict = {
|
|||
sendCaptcha,
|
||||
getApplication,
|
||||
updateConfig,
|
||||
updateStyle,
|
||||
updateApplicationConfig,
|
||||
getWechatMpUserPhoneNumber,
|
||||
logout,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Style } from '../types/Style';
|
||||
|
||||
export async function updateStyle<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
entity: 'platform' | 'system',
|
||||
entityId: string,
|
||||
style: Style
|
||||
}, context: Cxt) {
|
||||
const { entity, entityId, style } = params;
|
||||
await context.operate(entity, {
|
||||
id: generateNewId(),
|
||||
action: 'update',
|
||||
data: {
|
||||
style,
|
||||
},
|
||||
filter: {
|
||||
id: entityId,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import { Tabs } from 'antd';
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import ApplicationDetail from '../detail';
|
||||
import ConfigUpsert from '../../config/application';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { Style } from '../../../types/Style';
|
||||
import Styles from './web.pc.module.less';
|
||||
|
|
@ -51,10 +51,10 @@ export default function Render(props: WebComponentProps<EntityDict, 'application
|
|||
key: 'style',
|
||||
children: (
|
||||
<StyleUpsert
|
||||
value={style}
|
||||
onChange={(s) => {
|
||||
update({ style: s });
|
||||
}}
|
||||
style={style}
|
||||
entity={'platform'}
|
||||
entityId={id}
|
||||
name={name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { Space, Form, Input, Button, Tooltip, Tabs, ColorPicker } from 'antd';
|
||||
import { Space, Form, Input, Button, Tooltip, Tabs, ColorPicker, Affix, Alert, Typography } from 'antd';
|
||||
import { ClearOutlined } from '@ant-design/icons'
|
||||
import { Style as StyleType, ColorType } from '../../../types/Style';
|
||||
import { set, get } from 'oak-domain/lib/utils/lodash';
|
||||
|
|
@ -62,7 +62,7 @@ export default function Render(props: StyleProps) {
|
|||
return (
|
||||
<div>
|
||||
<Tabs
|
||||
onChange={() => {}}
|
||||
onChange={() => { }}
|
||||
type="card"
|
||||
items={[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,99 @@
|
|||
import { cloneDeep, set, get, omit } from 'oak-domain/lib/utils/lodash';
|
||||
import { Style } from '../../../../types/Style';
|
||||
|
||||
export default OakComponent({
|
||||
isList: false,
|
||||
properties: {
|
||||
style: {} as Style,
|
||||
entity: '' as 'system' | 'platform' | 'application',
|
||||
entityId: '',
|
||||
name: '',
|
||||
},
|
||||
data: {
|
||||
initialStyle: {} as Style,
|
||||
dirty: false,
|
||||
currentStyle: {} as Style,
|
||||
},
|
||||
// listeners: {
|
||||
// config(prev, next) {
|
||||
// if (prev.config !== next.config) {
|
||||
// const config2 = next.config || {};
|
||||
// this.setState({
|
||||
// initialConfig: config2,
|
||||
// dirty: false,
|
||||
// currentConfig: cloneDeep(config2),
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const { style } = this.props;
|
||||
this.setState({
|
||||
initialStyle: style,
|
||||
dirty: false,
|
||||
currentStyle: cloneDeep(style),
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setValue(newStyle: Style) {
|
||||
const newStyle2 = cloneDeep(newStyle || {});
|
||||
this.setState({
|
||||
currentStyle: newStyle2,
|
||||
dirty: true,
|
||||
});
|
||||
},
|
||||
|
||||
// cleanKey(path: string, key: string) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const obj = get(currentConfig, path);
|
||||
// const obj2 = omit(obj, [key]);
|
||||
// set(currentConfig, path, obj2);
|
||||
// const newConfig = cloneDeep(currentConfig);
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
|
||||
// removeItem(path: string, index: number) {
|
||||
// const { currentConfig } = this.state;
|
||||
// const array = get(currentConfig, path);
|
||||
// (array as any[]).splice(index, 1);
|
||||
// const newConfig = cloneDeep(currentConfig || {});
|
||||
// this.setState({
|
||||
// currentConfig: newConfig,
|
||||
// dirty: true,
|
||||
// });
|
||||
// },
|
||||
|
||||
resetStyle() {
|
||||
const { initialStyle } = this.state;
|
||||
this.setState({
|
||||
dirty: false,
|
||||
currentStyle: cloneDeep(initialStyle),
|
||||
});
|
||||
},
|
||||
|
||||
async updateStyle() {
|
||||
const { currentStyle } = this.state;
|
||||
const { entity, entityId } = this.props;
|
||||
|
||||
await this.features.style2.updateStyle(
|
||||
entity!,
|
||||
entityId!,
|
||||
currentStyle,
|
||||
);
|
||||
this.setMessage({
|
||||
content: '操作成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.setState(
|
||||
{
|
||||
dirty: false,
|
||||
}
|
||||
)
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
.container {
|
||||
background: var(--oak-bg-color-container);
|
||||
// box-shadow: 0 2px 3px #0000001a;
|
||||
// border-radius: 3px;
|
||||
padding: 30px 32px;
|
||||
}
|
||||
|
||||
.padding {
|
||||
background-color: var(--oak-bg-color-page);
|
||||
width: 100%;
|
||||
height: 77px;
|
||||
}
|
||||
|
||||
.ctrl {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
border: solid 0.4px;
|
||||
border-radius: 3px;
|
||||
border-color: var(--oak-border-color);
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
background-color: var(--oak-bg-color-container);
|
||||
width: calc(100vw - 138px);
|
||||
top: 85px;
|
||||
height: 55px;
|
||||
|
||||
text {
|
||||
color: var(--oak-text-color-secondary);
|
||||
|
||||
.weight {
|
||||
font-weight: bold;
|
||||
color: var(--oak-text-color-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contains {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
import React from 'react';
|
||||
import { Tabs, Button, Alert, Affix, Space, Typography } from 'antd';
|
||||
import Style from './web.module.less';
|
||||
|
||||
import { Style as StyleDef } from '../../../../types/Style';
|
||||
|
||||
import { EntityDict } from '../../../../oak-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import StyleUpsert from '../../style';
|
||||
|
||||
export default function Render(
|
||||
props: WebComponentProps<
|
||||
EntityDict,
|
||||
'user',
|
||||
false,
|
||||
{
|
||||
entity: string;
|
||||
name: string;
|
||||
currentStyle: StyleDef;
|
||||
dirty: boolean;
|
||||
},
|
||||
{
|
||||
resetStyle: () => void;
|
||||
updateStyle: () => void;
|
||||
setValue: (style: StyleDef) => void;
|
||||
}
|
||||
>
|
||||
) {
|
||||
const { entity, currentStyle, dirty, name } = props.data;
|
||||
const { resetStyle, updateStyle, setValue, t } =
|
||||
props.methods;
|
||||
return (
|
||||
<>
|
||||
<Affix offsetTop={64}>
|
||||
<Alert
|
||||
message={
|
||||
<div>
|
||||
<text>
|
||||
您正在更新
|
||||
<Typography.Text
|
||||
keyboard
|
||||
className={Style.weight}
|
||||
>
|
||||
{entity}
|
||||
</Typography.Text>
|
||||
对象
|
||||
<Typography.Text
|
||||
keyboard
|
||||
className={Style.weight}
|
||||
>
|
||||
{name}
|
||||
</Typography.Text>
|
||||
的样式,请谨慎操作
|
||||
</text>
|
||||
</div>
|
||||
}
|
||||
type="info"
|
||||
showIcon
|
||||
action={
|
||||
<Space>
|
||||
<Button
|
||||
disabled={!dirty}
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => resetStyle()}
|
||||
style={{
|
||||
marginRight: 10,
|
||||
}}
|
||||
>
|
||||
{t('common::reset')}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={!dirty}
|
||||
type="primary"
|
||||
onClick={() => updateStyle()}
|
||||
>
|
||||
{t('common::action.confirm')}
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
</Affix>
|
||||
<div className={Style.contains}>
|
||||
<StyleUpsert
|
||||
value={currentStyle}
|
||||
onChange={(s) => {
|
||||
setValue(s)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -93,6 +93,9 @@ function QiniuCos(props: {
|
|||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Divider orientation="left" className={Styles.title}>
|
||||
bucket配置
|
||||
</Divider>
|
||||
<Tabs
|
||||
tabPosition={'top'}
|
||||
size={'middle'}
|
||||
|
|
@ -100,13 +103,13 @@ function QiniuCos(props: {
|
|||
// hideAdd={!(sms.length > 0)}
|
||||
onEdit={(targetKey: any, action: 'add' | 'remove') => {
|
||||
if (action === 'add') {
|
||||
setValue(`buckets.${cos.buckets.length}`, {});
|
||||
setValue(`buckets.${cos?.buckets?.length || 0}`, {});
|
||||
} else {
|
||||
removeItem('buckets', parseInt(targetKey, 10));
|
||||
}
|
||||
}}
|
||||
items={
|
||||
cos?.buckets.length > 0
|
||||
cos?.buckets?.length > 0
|
||||
? cos.buckets.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `bucket:${idx + 1}`,
|
||||
|
|
@ -186,6 +189,7 @@ function QiniuCos(props: {
|
|||
: []
|
||||
}
|
||||
/>
|
||||
|
||||
<Form.Item
|
||||
label="defaultBucket"
|
||||
//name="uploadHost"
|
||||
|
|
@ -195,11 +199,11 @@ function QiniuCos(props: {
|
|||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
placeholder="请选择默认bucket"
|
||||
value={cos.defaultBucket}
|
||||
value={cos?.defaultBucket}
|
||||
onChange={(value: string) => {
|
||||
setValue(`defaultBucket`, value);
|
||||
}}
|
||||
options={cos.buckets.map(
|
||||
options={cos?.buckets?.map(
|
||||
ele => ({
|
||||
label: ele.name,
|
||||
value: ele.name
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ export default OakComponent({
|
|||
this.addItem(Object.assign({}, updateData, {
|
||||
extra1: null,
|
||||
}), undefined, async () => {
|
||||
console.log(updateData);
|
||||
await this.features.extraFile.upload(
|
||||
updateData, extra1
|
||||
)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ export default OakComponent({
|
|||
uploadState: 1,
|
||||
},
|
||||
formData({ data: originalFiles, features }) {
|
||||
console.log(originalFiles);
|
||||
let files = (
|
||||
originalFiles as Array<EntityDict['extraFile']['OpSchema']>
|
||||
)?.filter((ele) => !ele.$$deleteAt$$).sort(
|
||||
|
|
@ -112,9 +111,7 @@ export default OakComponent({
|
|||
getUrl(extraFile: EntityDict['extraFile']['OpSchema']) {
|
||||
const { fileList } = this.state;
|
||||
if (fileList[extraFile?.id]) {
|
||||
console.log(fileList[extraFile?.id]);
|
||||
const url = this.features.extraFile.getUrl(Object.assign({}, extraFile, { extra1: fileList[extraFile?.id] }));
|
||||
console.log(url);
|
||||
return url;
|
||||
}
|
||||
return this.features.extraFile.getUrl(extraFile);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { WebComponentProps } from 'oak-frontend-base';
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import Styles from './web.pc.module.less';
|
||||
import ConfigUpsert from '../../config/upsert';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import PlatformDetail from '../detail';
|
||||
import PlatformSystem from '../system';
|
||||
import { Style } from '../../../types/Style';
|
||||
|
|
@ -52,10 +52,10 @@ export default function render(props: WebComponentProps<EntityDict, 'platform',
|
|||
key: 'style',
|
||||
children: (
|
||||
<StyleUpsert
|
||||
value={style}
|
||||
onChange={(s) => {
|
||||
update({ style: s });
|
||||
}}
|
||||
style={style}
|
||||
entity={'platform'}
|
||||
entityId={id}
|
||||
name={name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Tabs } from 'antd';
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import SystemDetail from '../detail';
|
||||
import ConfigUpsert from '../../config/upsert';
|
||||
import StyleUpsert from '../../config/style';
|
||||
import StyleUpsert from '../../config/style/platform';
|
||||
import DomainList from '../../domain/list';
|
||||
import ApplicationList from '../application';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
|
|
@ -54,10 +54,10 @@ export default function Render(props: WebComponentProps<EntityDict, 'system', fa
|
|||
key: 'style',
|
||||
children: (
|
||||
<StyleUpsert
|
||||
value={style}
|
||||
onChange={(s) => {
|
||||
update({ style: s });
|
||||
}}
|
||||
style={style}
|
||||
entity={'system'}
|
||||
entityId={id}
|
||||
name={name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -176,7 +176,6 @@ export default function Render(
|
|||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
console.log(config);
|
||||
if (config && config.button && config.button[0] && onlyOne) {
|
||||
setMenuName(config.button[0].name);
|
||||
setOnlyOne(false);
|
||||
|
|
@ -317,11 +316,11 @@ export default function Render(
|
|||
}
|
||||
}, [url]);
|
||||
return (
|
||||
<div className={Style.container} style={iState === 'fail' ? {border: '1px solid #FF5557'} : {}}>
|
||||
<div className={Style.container} style={iState === 'fail' ? { border: '1px solid #FF5557' } : {}}>
|
||||
{config &&
|
||||
config.button &&
|
||||
config.button.length > 0 &&
|
||||
(selectedBtn !== 0 || selectedSubBtn !== 0) ? (
|
||||
config.button &&
|
||||
config.button.length > 0 &&
|
||||
(selectedBtn !== 0 || selectedSubBtn !== 0) ? (
|
||||
<div className={Style.upsertMenu}>
|
||||
<div className={Style.content}>
|
||||
<div className={Style.title}>
|
||||
|
|
@ -333,11 +332,9 @@ export default function Render(
|
|||
colon={false}
|
||||
help={
|
||||
<div>
|
||||
<div>{`仅支持中英文和数字,字数不超过${
|
||||
selectedSubBtn !== 0 ? 8 : 4
|
||||
}个汉字或${
|
||||
selectedSubBtn !== 0 ? 16 : 8
|
||||
}个字母。`}</div>
|
||||
<div>{`仅支持中英文和数字,字数不超过${selectedSubBtn !== 0 ? 8 : 4
|
||||
}个汉字或${selectedSubBtn !== 0 ? 16 : 8
|
||||
}个字母。`}</div>
|
||||
{errorInfo && (
|
||||
<div style={{ color: '#fa5151' }}>
|
||||
{errorInfo}
|
||||
|
|
@ -387,7 +384,7 @@ export default function Render(
|
|||
{(config.button[currentIndex]?.sub_button?.length ===
|
||||
0 &&
|
||||
selectedSubBtn === 0) ||
|
||||
selectedSubBtn > 0 ? (
|
||||
selectedSubBtn > 0 ? (
|
||||
<>
|
||||
<Form.Item
|
||||
colon={false}
|
||||
|
|
@ -421,17 +418,17 @@ export default function Render(
|
|||
{decideMenuContentLabel(
|
||||
decidedMenuContent,
|
||||
type as
|
||||
| 'video'
|
||||
| 'image'
|
||||
| 'text'
|
||||
| 'news'
|
||||
| 'voice'
|
||||
| 'video'
|
||||
| 'image'
|
||||
| 'text'
|
||||
| 'news'
|
||||
| 'voice'
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
{!decidedMenuContent &&
|
||||
type !== 'text' ? (
|
||||
type !== 'text' ? (
|
||||
<div
|
||||
className={
|
||||
Style.menuContent
|
||||
|
|
@ -530,12 +527,12 @@ export default function Render(
|
|||
) {
|
||||
deleteMenuContent(
|
||||
selectedBtn -
|
||||
1
|
||||
1
|
||||
);
|
||||
} else {
|
||||
deleteMenuContent(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
currentIndex
|
||||
);
|
||||
}
|
||||
|
|
@ -608,12 +605,12 @@ export default function Render(
|
|||
) {
|
||||
deleteMenuContent(
|
||||
selectedBtn -
|
||||
1
|
||||
1
|
||||
);
|
||||
} else {
|
||||
deleteMenuContent(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
currentIndex
|
||||
);
|
||||
}
|
||||
|
|
@ -686,12 +683,12 @@ export default function Render(
|
|||
) {
|
||||
deleteMenuContent(
|
||||
selectedBtn -
|
||||
1
|
||||
1
|
||||
);
|
||||
} else {
|
||||
deleteMenuContent(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
currentIndex
|
||||
);
|
||||
}
|
||||
|
|
@ -758,12 +755,12 @@ export default function Render(
|
|||
) {
|
||||
deleteMenuContent(
|
||||
selectedBtn -
|
||||
1
|
||||
1
|
||||
);
|
||||
} else {
|
||||
deleteMenuContent(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
currentIndex
|
||||
);
|
||||
}
|
||||
|
|
@ -838,12 +835,12 @@ export default function Render(
|
|||
) {
|
||||
deleteMenuContent(
|
||||
selectedBtn -
|
||||
1
|
||||
1
|
||||
);
|
||||
} else {
|
||||
deleteMenuContent(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
currentIndex
|
||||
);
|
||||
}
|
||||
|
|
@ -885,7 +882,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -901,7 +898,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -917,7 +914,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -930,7 +927,7 @@ export default function Render(
|
|||
} else {
|
||||
setConfig(
|
||||
selectedBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'article_id',
|
||||
article_id:
|
||||
|
|
@ -949,7 +946,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -966,7 +963,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -983,7 +980,7 @@ export default function Render(
|
|||
) {
|
||||
setConfig(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'media_id',
|
||||
media_id:
|
||||
|
|
@ -997,7 +994,7 @@ export default function Render(
|
|||
} else {
|
||||
setConfig(
|
||||
selectedSubBtn -
|
||||
1,
|
||||
1,
|
||||
{
|
||||
type: 'article_id',
|
||||
article_id:
|
||||
|
|
@ -1037,10 +1034,10 @@ export default function Render(
|
|||
oakAutoUnmount={true}
|
||||
type={
|
||||
type as
|
||||
| 'news'
|
||||
| 'image'
|
||||
| 'video'
|
||||
| 'voice'
|
||||
| 'news'
|
||||
| 'image'
|
||||
| 'video'
|
||||
| 'voice'
|
||||
}
|
||||
getMenuContent={getMenuContent}
|
||||
applicationId={applicationId}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { ExtraFile } from './extraFile';
|
|||
import { ExtraFile2 } from './extraFile2';
|
||||
import { Application } from './application';
|
||||
import { Config } from './config';
|
||||
import { Style2 } from './style2';
|
||||
import { WeiXinJsSdk } from './weiXinJsSdk';
|
||||
import { WechatMenu } from './wechatMenu';
|
||||
import { WechatPublicTag } from './wechatPublicTag'
|
||||
|
|
@ -51,6 +52,7 @@ export function initialize<
|
|||
const extraFile = new ExtraFile<ED, Cxt, FrontCxt, AD>(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const extraFile2 = new ExtraFile2<ED, Cxt, FrontCxt, AD>(basicFeatures.cache, application, basicFeatures.locales);
|
||||
const config = new Config<ED, Cxt, FrontCxt, AD>(basicFeatures.cache);
|
||||
const style2 = new Style2<ED, Cxt, FrontCxt, AD>(basicFeatures.cache);
|
||||
const weiXinJsSdk = new WeiXinJsSdk<ED, Cxt, FrontCxt, AD>(
|
||||
basicFeatures.cache,
|
||||
basicFeatures.localStorage,
|
||||
|
|
@ -64,6 +66,7 @@ export function initialize<
|
|||
extraFile2,
|
||||
application,
|
||||
config,
|
||||
style2,
|
||||
weiXinJsSdk,
|
||||
theme,
|
||||
wechatMenu,
|
||||
|
|
@ -82,6 +85,7 @@ export type GeneralFeatures<
|
|||
extraFile2: ExtraFile2<ED, Cxt, FrontCxt, AD>;
|
||||
application: Application<ED, Cxt, FrontCxt, AD>;
|
||||
config: Config<ED, Cxt, FrontCxt, AD>;
|
||||
style2: Style2<ED, Cxt, FrontCxt, AD>;
|
||||
weiXinJsSdk: WeiXinJsSdk<ED, Cxt, FrontCxt, AD>;
|
||||
theme: Theme<ED, Cxt, FrontCxt, AD>;
|
||||
wechatMenu: WechatMenu<ED, Cxt, FrontCxt, AD>;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import AspectDict from '../aspects/AspectDict';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { Cache } from 'oak-frontend-base/es/features/cache';
|
||||
import { Style as StyleDef } from '../types/Style';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { CommonAspectDict } from 'oak-common-aspect';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
|
||||
export class Style2<
|
||||
ED extends EntityDict,
|
||||
Cxt extends BackendRuntimeContext<ED>,
|
||||
FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>,
|
||||
AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>
|
||||
> extends Feature {
|
||||
private cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>;
|
||||
|
||||
constructor(
|
||||
cache: Cache<ED, Cxt, FrontCxt, AD & CommonAspectDict<ED, Cxt>>
|
||||
) {
|
||||
super();
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
async updateStyle(
|
||||
entity: 'platform' | 'system' | 'application',
|
||||
entityId: string,
|
||||
style: StyleDef
|
||||
) {
|
||||
await this.cache.exec('updateStyle', {
|
||||
entity,
|
||||
entityId,
|
||||
style,
|
||||
});
|
||||
this.publish();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue