Skip to content

Commit

Permalink
feat: add bid save 基础逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zuo committed Mar 10, 2024
1 parent 4cc808d commit 1a49f2a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
12 changes: 6 additions & 6 deletions formily/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
"@typescript-eslint/adjacent-overload-signatures": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0,
"no-console": [
"error",
{
"allow": ["warn", "error", "info"]
}
],
// "no-console": [
// "error",
// {
// "allow": ["warn", "error", "info"]
// }
// ],
"prefer-const": 0,
"no-var": 1,
"prefer-rest-params": 0
Expand Down
10 changes: 10 additions & 0 deletions formily/antd/playground/service/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import {
import { message } from 'antd'

export const saveSchema = (designer: Engine) => {
let queryParams = Object.fromEntries(new URLSearchParams(location.search))
let { bid } = queryParams
if (!bid) {
message.warning('url 异常,缺少 id 参数')
return
}
let formilySchema = JSON.stringify(
transformToSchema(designer.getCurrentTree())
)
console.log('formily-schema', formilySchema)
localStorage.setItem(
'formily-schema',
JSON.stringify(transformToSchema(designer.getCurrentTree()))
Expand Down
8 changes: 7 additions & 1 deletion formily/antd/playground/template.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<!DOCTYPE html>
<head>
<title>Designable Playground</title>
<title>Formily低代码设计器</title>
<!-- href="http://cdn.zuo11.com/imgs/formily-icon.svg" -->
<link
rel="shortcut icon"
type="image/x-icon"
href="http://cdn.zuo11.com/imgs/avatar.jpg"
/>
<style>
html,
body {
Expand Down
10 changes: 5 additions & 5 deletions formily/antd/playground/widgets/ActionsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ export const ActionsWidget = observer(() => {
}, [])
return (
<Space style={{ marginRight: 10 }}>
<Button href="https://designable-fusion.formilyjs.org">
{/* <Button href="https://designable-fusion.formilyjs.org">
Alibaba Fusion
</Button>
</Button> */}
<Radio.Group
value={GlobalRegistry.getDesignerLanguage()}
optionType="button"
options={[
{ label: 'English', value: 'en-us' },
{ label: '简体中文', value: 'zh-cn' },
{ label: '한국어', value: 'ko-kr' },
// { label: '한국어', value: 'ko-kr' },
]}
onChange={(e) => {
GlobalRegistry.setDesignerLanguage(e.target.value)
}}
/>
<Button href="https://github.com/alibaba/designable" target="_blank">
{/* <Button href="https://github.com/alibaba/designable" target="_blank">
<GithubOutlined />
Github
</Button>
</Button> */}
<Button
onClick={() => {
saveSchema(designer)
Expand Down
12 changes: 6 additions & 6 deletions packages/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 1,
"no-console": [
"error",
{
"allow": ["warn", "error", "info"]
}
],
// "no-console": [
// "error",
// {
// "allow": ["warn", "error", "info"]
// }
// ],
"prefer-const": 0,
"no-var": 1,
"prefer-rest-params": 0
Expand Down

0 comments on commit 1a49f2a

Please sign in to comment.