chore: update UT snapshots of CodeGenerator

This commit is contained in:
LeoYuan 袁力皓 2022-12-14 14:21:55 +08:00 committed by eternalsky
parent 2bd40d7589
commit 9cb4f0bd79
110 changed files with 1078 additions and 1103 deletions

View File

@ -19,7 +19,7 @@ describe(testCaseBaseName, () => {
` `
<Greetings <Greetings
content={this._i18nText({ content={this._i18nText({
key: "greetings.hello", key: 'greetings.hello',
params: { name: this.state.name }, params: { name: this.state.name },
})} })}
/> />

View File

@ -27,7 +27,7 @@ describe(testCaseBaseName, () => {
}); });
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain(`import Foo from "example-package/lib/index.js";`); expect(generatedPageFileContent).toContain('import Foo from \'example-package/lib/index.js\';');
}); });
test('named import with no alias', async () => { test('named import with no alias', async () => {
@ -47,7 +47,7 @@ describe(testCaseBaseName, () => {
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain( expect(generatedPageFileContent).toContain(
`import { Foo } from "example-package/lib/index.js";`, 'import { Foo } from \'example-package/lib/index.js\';',
); );
}); });
@ -68,7 +68,7 @@ describe(testCaseBaseName, () => {
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain( expect(generatedPageFileContent).toContain(
`import { Bar as Foo } from "example-package/lib/index.js";`, 'import { Bar as Foo } from \'example-package/lib/index.js\';',
); );
}); });
@ -88,7 +88,7 @@ describe(testCaseBaseName, () => {
}); });
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain(`import Foo from "example-package/lib/index.js";`); expect(generatedPageFileContent).toContain('import Foo from \'example-package/lib/index.js\';');
}); });
test('default import with sub name and export name', async () => { test('default import with sub name and export name', async () => {
@ -107,9 +107,9 @@ describe(testCaseBaseName, () => {
}); });
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain(`import Bar from "example-package/lib/index.js";`); expect(generatedPageFileContent).toContain('import Bar from \'example-package/lib/index.js\';');
expect(generatedPageFileContent).toContain(`const Foo = Bar.Baz;`); expect(generatedPageFileContent).toContain('const Foo = Bar.Baz;');
}); });
test('default import with sub name without export name', async () => { test('default import with sub name without export name', async () => {
@ -129,10 +129,10 @@ describe(testCaseBaseName, () => {
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain( expect(generatedPageFileContent).toContain(
`import __$examplePackage_default from "example-package/lib/index.js";`, 'import __$examplePackage_default from \'example-package/lib/index.js\';',
); );
expect(generatedPageFileContent).toContain(`const Foo = __$examplePackage_default.Baz;`); expect(generatedPageFileContent).toContain('const Foo = __$examplePackage_default.Baz;');
}); });
test('named import with sub name', async () => { test('named import with sub name', async () => {
@ -152,10 +152,10 @@ describe(testCaseBaseName, () => {
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain( expect(generatedPageFileContent).toContain(
`import { Bar } from "example-package/lib/index.js";`, 'import { Bar } from \'example-package/lib/index.js\';',
); );
expect(generatedPageFileContent).toContain(`const Foo = Bar.Baz;`); expect(generatedPageFileContent).toContain('const Foo = Bar.Baz;');
}); });
test('default imports with different componentName', async () => { test('default imports with different componentName', async () => {
@ -187,11 +187,11 @@ describe(testCaseBaseName, () => {
}); });
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx'); const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
expect(generatedPageFileContent).toContain(`import Foo from "example-package";`); expect(generatedPageFileContent).toContain('import Foo from \'example-package\';');
expect(generatedPageFileContent).toContain(`import Baz from "example-package";`); expect(generatedPageFileContent).toContain('import Baz from \'example-package\';');
expect(generatedPageFileContent).not.toContain(`const Foo =`); expect(generatedPageFileContent).not.toContain('const Foo =');
expect(generatedPageFileContent).not.toContain(`const Baz =`); expect(generatedPageFileContent).not.toContain('const Baz =');
}); });
}); });

View File

@ -22,7 +22,7 @@ test(testCaseBaseName, async () => {
Button, Button,
Typography, Typography,
Tag, Tag,
} from "@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js";`); } from '@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js';`);
}); });
function exportProject(inputPath: string, outputPath: string) { function exportProject(inputPath: string, outputPath: string) {

View File

@ -19,15 +19,15 @@ test(testCaseBaseName, async () => {
// 里面有的数据源则应该生成对应的 dependencies // 里面有的数据源则应该生成对应的 dependencies
expect(generatedPackageJson.dependencies).toMatchObject({ expect(generatedPackageJson.dependencies).toMatchObject({
'@alilc/lowcode-datasource-engine': 'latest', '@alilc/lowcode-datasource-engine': '^1.0.0',
'@alilc/lowcode-datasource-fetch-handler': 'latest', '@alilc/lowcode-datasource-fetch-handler': '^1.0.0',
}); });
// 里面没有的,则不应该生成对应的 dependencies // 里面没有的,则不应该生成对应的 dependencies
expect(generatedPackageJson.dependencies).not.toMatchObject({ expect(generatedPackageJson.dependencies).not.toMatchObject({
'@alilc/lowcode-datasource-url-params-handler': 'latest', '@alilc/lowcode-datasource-url-params-handler': '^1.0.0',
'@alilc/lowcode-datasource-mtop-handler': 'latest', '@alilc/lowcode-datasource-mtop-handler': '^1.0.0',
'@alilc/lowcode-datasource-mopen-handler': 'latest', '@alilc/lowcode-datasource-mopen-handler': '^1.0.0',
}); });
}); });

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,9 +11,9 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-url-params-handler": "latest", "@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
"@alilc/lowcode-datasource-fetch-handler": "latest", "@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -253,6 +253,7 @@ class Home$$Page extends Component {
if (!response.success) { if (!response.success) {
throw new Error(response.message); throw new Error(response.message);
} }
return response.data; return response.data;
}, },
isInit: true, isInit: true,
@ -279,6 +280,7 @@ class Home$$Page extends Component {
if (!response.success) { if (!response.success) {
throw new Error(response.message); throw new Error(response.message);
} }
return response.data.result; return response.data.result;
}, },
isInit: true, isInit: true,

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,8 +11,8 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-url-params-handler": "latest", "@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,7 +11,7 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,8 +11,8 @@
"lint": "npm run eslint && npm run stylelint" "lint": "npm run eslint && npm run stylelint"
}, },
"dependencies": { "dependencies": {
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-http-handler": "latest", "@alilc/lowcode-datasource-http-handler": "^1.0.0",
"universal-env": "^3.2.0", "universal-env": "^3.2.0",
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"rax": "^1.1.0", "rax": "^1.1.0",

View File

@ -11,9 +11,9 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-url-params-handler": "latest", "@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
"@alilc/lowcode-datasource-fetch-handler": "latest", "@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
"@alifd/next": "1.19.18" "@alifd/next": "1.19.18"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,3 +1,3 @@
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" }; const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
export default __$$constants; export default __$$constants;

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,22 +1,22 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { Form, Input, NumberPicker, Select, Button } from "@alifd/next"; import { Form, Input, NumberPicker, Select, Button } from '@alifd/next';
import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from "@alilc/lowcode-datasource-url-params-handler"; import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from '@alilc/lowcode-datasource-url-params-handler';
import { createFetchHandler as __$$createFetchRequestHandler } from "@alilc/lowcode-datasource-fetch-handler"; import { createFetchHandler as __$$createFetchRequestHandler } from '@alilc/lowcode-datasource-fetch-handler';
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime"; import { create as __$$createDataSourceEngine } from '@alilc/lowcode-datasource-engine/runtime';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
class Test$$Page extends React.Component { class Test$$Page extends React.Component {
_context = this; _context = this;
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
__$$i18n._inject2(this); __$$i18n._inject2(this);
this.state = { text: "outter" }; this.state = { text: 'outter' };
} }
$ = (refName) => { $ = (refName) => {
@ -67,8 +67,8 @@ class Test$$Page extends React.Component {
return { return {
list: [ list: [
{ {
id: "urlParams", id: 'urlParams',
type: "urlParams", type: 'urlParams',
isInit: function () { isInit: function () {
return undefined; return undefined;
}, },
@ -77,12 +77,12 @@ class Test$$Page extends React.Component {
}, },
}, },
{ {
id: "user", id: 'user',
type: "fetch", type: 'fetch',
options: function () { options: function () {
return { return {
method: "GET", method: 'GET',
uri: "https://shs.xxx.com/mock/1458/demo/user", uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true, isSync: true,
}; };
}, },
@ -90,6 +90,7 @@ class Test$$Page extends React.Component {
if (!response.data.success) { if (!response.data.success) {
throw new Error(response.data.message); throw new Error(response.data.message);
} }
return response.data.data; return response.data.data;
}, },
isInit: function () { isInit: function () {
@ -97,12 +98,12 @@ class Test$$Page extends React.Component {
}, },
}, },
{ {
id: "orders", id: 'orders',
type: "fetch", type: 'fetch',
options: function () { options: function () {
return { return {
method: "GET", method: 'GET',
uri: "https://shs.xxx.com/mock/1458/demo/orders", uri: 'https://shs.xxx.com/mock/1458/demo/orders',
isSync: true, isSync: true,
}; };
}, },
@ -110,6 +111,7 @@ class Test$$Page extends React.Component {
if (!response.data.success) { if (!response.data.success) {
throw new Error(response.data.message); throw new Error(response.data.message);
} }
return response.data.data.result; return response.data.data.result;
}, },
isInit: function () { isInit: function () {
@ -118,7 +120,7 @@ class Test$$Page extends React.Component {
}, },
], ],
dataHandler: function (dataMap) { dataHandler: function (dataMap) {
console.info("All datasources loaded:", dataMap); console.info('All datasources loaded:', dataMap);
}, },
}; };
} }
@ -126,18 +128,18 @@ class Test$$Page extends React.Component {
componentDidMount() { componentDidMount() {
this._dataSourceEngine.reloadDataSource(); this._dataSourceEngine.reloadDataSource();
console.log("componentDidMount"); console.log('componentDidMount');
} }
render() { render() {
const __$$context = this._context || this; const __$$context = this._context || this;
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}> <div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
<Form <Form
labelCol={__$$eval(() => this.state.colNum)} labelCol={__$$eval(() => this.state.colNum)}
style={{}} style={{}}
ref={this._refsManager.linkRef("testForm")} ref={this._refsManager.linkRef('testForm')}
> >
<Form.Item label="姓名:" name="name" initValue="李雷"> <Form.Item label="姓名:" name="name" initValue="李雷">
<Input placeholder="请输入" size="medium" style={{ width: 320 }} /> <Input placeholder="请输入" size="medium" style={{ width: 320 }} />
@ -148,18 +150,18 @@ class Test$$Page extends React.Component {
<Form.Item label="职业:" name="profession"> <Form.Item label="职业:" name="profession">
<Select <Select
dataSource={[ dataSource={[
{ label: "教师", value: "t" }, { label: '教师', value: 't' },
{ label: "医生", value: "d" }, { label: '医生', value: 'd' },
{ label: "歌手", value: "s" }, { label: '歌手', value: 's' },
]} ]}
/> />
</Form.Item> </Form.Item>
<div style={{ textAlign: "center" }}> <div style={{ textAlign: 'center' }}>
<Button.Group> <Button.Group>
{__$$evalArray(() => ["a", "b", "c"]).map((item, index) => {__$$evalArray(() => ['a', 'b', 'c']).map((item, index) =>
((__$$context) => ((__$$context) =>
!!__$$eval(() => index >= 1) && ( !!__$$eval(() => index >= 1) && (
<Button type="primary" style={{ margin: "0 5px 0 5px" }}> <Button type="primary" style={{ margin: '0 5px 0 5px' }}>
{__$$eval(() => item)} {__$$eval(() => item)}
</Button> </Button>
))(__$$createChildContext(__$$context, { item, index })) ))(__$$createChildContext(__$$context, { item, index }))

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "/", path: '/',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,8 +11,8 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-url-params-handler": "latest", "@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
"@alilc/b6-page": "^0.1.0", "@alilc/b6-page": "^0.1.0",
"@alilc/b6-text": "^0.1.0", "@alilc/b6-text": "^0.1.0",
"@alilc/b6-compact-legao-builtin": "1.x", "@alilc/b6-compact-legao-builtin": "1.x",

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,22 +1,22 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { Page } from "@alilc/b6-page"; import { Page } from '@alilc/b6-page';
import { Text } from "@alilc/b6-text"; import { Text } from '@alilc/b6-text';
import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from "@alilc/lowcode-datasource-url-params-handler"; import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from '@alilc/lowcode-datasource-url-params-handler';
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime"; import { create as __$$createDataSourceEngine } from '@alilc/lowcode-datasource-engine/runtime';
import utils from "../../utils"; import utils from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
class Aaaa$$Page extends React.Component { class Aaaa$$Page extends React.Component {
_context = this; _context = this;
@ -60,12 +60,12 @@ class Aaaa$$Page extends React.Component {
return { return {
list: [ list: [
{ {
id: "urlParams", id: 'urlParams',
type: "urlParams", type: 'urlParams',
description: "URL参数", description: 'URL参数',
options: function () { options: function () {
return { return {
uri: "", uri: '',
}; };
}, },
isInit: function () { isInit: function () {

View File

@ -1,14 +1,14 @@
import Aaaa from "@/pages/Aaaa"; import Aaaa from '@/pages/Aaaa';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "/aaaa", path: '/aaaa',
component: Aaaa, component: Aaaa,
}, },
], ],

View File

@ -1,10 +1,10 @@
import legaoBuiltin from "@alilc/b6-compact-legao-builtin"; import legaoBuiltin from '@alilc/b6-compact-legao-builtin';
import { message, Modal as modal } from "antd"; import { message, Modal as modal } from 'antd';
import { mocks } from "@alilc/b6-util-mocks"; import { mocks } from '@alilc/b6-util-mocks';
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,7 +11,7 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alifd/next": "1.19.18" "@alifd/next": "1.19.18"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,3 +1,3 @@
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" }; const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
export default __$$constants; export default __$$constants;

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,18 +1,18 @@
const i18nConfig = { const i18nConfig = {
"zh-CN": { 'zh-CN': {
"i18n-jwg27yo4": "你好", 'i18n-jwg27yo4': '你好',
"i18n-jwg27yo3": "中国", 'i18n-jwg27yo3': '中国',
}, },
"en-US": { 'en-US': {
"i18n-jwg27yo4": "Hello", 'i18n-jwg27yo4': 'Hello',
"i18n-jwg27yo3": "China", 'i18n-jwg27yo3': 'China',
}, },
}; };
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -22,22 +22,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -58,7 +58,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -70,7 +70,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,16 +1,16 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { Form, Input, NumberPicker, Select, Button } from "@alifd/next"; import { Form, Input, NumberPicker, Select, Button } from '@alifd/next';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
class Test$$Page extends React.Component { class Test$$Page extends React.Component {
_context = this; _context = this;
@ -28,7 +28,7 @@ class Test$$Page extends React.Component {
__$$i18n._inject2(this); __$$i18n._inject2(this);
this.state = { text: "outter" }; this.state = { text: 'outter' };
} }
$ = (refName) => { $ = (refName) => {
@ -40,21 +40,21 @@ class Test$$Page extends React.Component {
}; };
componentDidMount() { componentDidMount() {
console.log("componentDidMount"); console.log('componentDidMount');
} }
render() { render() {
const __$$context = this._context || this; const __$$context = this._context || this;
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}> <div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
<Form <Form
labelCol={__$$eval(() => this.state.colNum)} labelCol={__$$eval(() => this.state.colNum)}
style={{}} style={{}}
ref={this._refsManager.linkRef("testForm")} ref={this._refsManager.linkRef('testForm')}
> >
<Form.Item <Form.Item
label={__$$eval(() => this.i18n("i18n-jwg27yo4"))} label={__$$eval(() => this.i18n('i18n-jwg27yo4'))}
name="name" name="name"
initValue="李雷" initValue="李雷"
> >
@ -66,24 +66,24 @@ class Test$$Page extends React.Component {
<Form.Item label="职业:" name="profession"> <Form.Item label="职业:" name="profession">
<Select <Select
dataSource={[ dataSource={[
{ label: "教师", value: "t" }, { label: '教师', value: 't' },
{ label: "医生", value: "d" }, { label: '医生', value: 'd' },
{ label: "歌手", value: "s" }, { label: '歌手', value: 's' },
]} ]}
/> />
</Form.Item> </Form.Item>
<div style={{ textAlign: "center" }}> <div style={{ textAlign: 'center' }}>
<Button.Group> <Button.Group>
<Button <Button
type="primary" type="primary"
style={{ margin: "0 5px 0 5px" }} style={{ margin: '0 5px 0 5px' }}
htmlType="submit" htmlType="submit"
> >
提交 提交
</Button> </Button>
<Button <Button
type="normal" type="normal"
style={{ margin: "0 5px 0 5px" }} style={{ margin: '0 5px 0 5px' }}
htmlType="reset" htmlType="reset"
> >
重置 重置

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "/", path: '/',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,7 +11,7 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alifd/next": "1.19.18" "@alifd/next": "1.19.18"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,3 +1,3 @@
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" }; const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
export default __$$constants; export default __$$constants;

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,18 +1,18 @@
const i18nConfig = { const i18nConfig = {
"zh-CN": { 'zh-CN': {
"i18n-jwg27yo4": "你好", 'i18n-jwg27yo4': '你好',
"i18n-jwg27yo3": "中国", 'i18n-jwg27yo3': '中国',
}, },
"en-US": { 'en-US': {
"i18n-jwg27yo4": "Hello", 'i18n-jwg27yo4': 'Hello',
"i18n-jwg27yo3": "China", 'i18n-jwg27yo3': 'China',
}, },
}; };
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -22,22 +22,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -58,7 +58,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -70,7 +70,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,6 +1,6 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import Super, { import Super, {
Button, Button,
@ -9,17 +9,17 @@ import Super, {
NumberPicker, NumberPicker,
Select, Select,
SearchTable as SearchTableExport, SearchTable as SearchTableExport,
} from "@alifd/next"; } from '@alifd/next';
import SuperOther from "@alifd/next"; import SuperOther from '@alifd/next';
import utils from "../../utils"; import utils from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
const SuperSub = Super.Sub; const SuperSub = Super.Sub;

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "/", path: '/',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,9 +11,9 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-fetch-handler": "latest", "@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
"@alife/container": "latest", "@alife/container": "^1.0.0",
"@alife/mc-assets-1935": "0.1.9" "@alife/mc-assets-1935": "0.1.9"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,27 +1,27 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { import {
Page as NextPage, Page as NextPage,
Block as NextBlock, Block as NextBlock,
P as NextP, P as NextP,
Text as NextText, Text as NextText,
} from "@alife/container/lib/index.js"; } from '@alife/container/lib/index.js';
import { AliSearchTable as AliSearchTableExport } from "@alife/mc-assets-1935/build/lowcode/index.js"; import { AliSearchTable as AliSearchTableExport } from '@alife/mc-assets-1935/build/lowcode/index.js';
import { createFetchHandler as __$$createFetchRequestHandler } from "@alilc/lowcode-datasource-fetch-handler"; import { createFetchHandler as __$$createFetchRequestHandler } from '@alilc/lowcode-datasource-fetch-handler';
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime"; import { create as __$$createDataSourceEngine } from '@alilc/lowcode-datasource-engine/runtime';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
const NextBlockCell = NextBlock.Cell; const NextBlockCell = NextBlock.Cell;
@ -57,7 +57,7 @@ class Test$$Page extends React.Component {
__$$i18n._inject2(this); __$$i18n._inject2(this);
this.state = { text: "outter", isShowDialog: false }; this.state = { text: 'outter', isShowDialog: false };
} }
$ = (refName) => { $ = (refName) => {
@ -73,28 +73,28 @@ class Test$$Page extends React.Component {
return { return {
list: [ list: [
{ {
type: "fetch", type: 'fetch',
isInit: function () { isInit: function () {
return true; return true;
}, },
options: function () { options: function () {
return { return {
params: {}, params: {},
method: "GET", method: 'GET',
isCors: true, isCors: true,
timeout: 5000, timeout: 5000,
headers: {}, headers: {},
uri: "https://mocks.xxx.com/mock/jjpin/user/list", uri: 'https://mocks.xxx.com/mock/jjpin/user/list',
}; };
}, },
id: "users", id: 'users',
}, },
], ],
}; };
} }
componentWillUnmount() { componentWillUnmount() {
console.log("will umount"); console.log('will umount');
} }
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
@ -102,7 +102,7 @@ class Test$$Page extends React.Component {
} }
testFunc() { testFunc() {
console.log("test func"); console.log('test func');
} }
onClick() { onClick() {
@ -118,13 +118,13 @@ class Test$$Page extends React.Component {
} }
onSearch(values) { onSearch(values) {
console.log("search form:", values); console.log('search form:', values);
console.log(this.dataSourceMap); console.log(this.dataSourceMap);
this.dataSourceMap["users"].load(values); this.dataSourceMap['users'].load(values);
} }
onClear() { onClear() {
console.log("form reset"); console.log('form reset');
this.setState({ this.setState({
isShowDialog: true, isShowDialog: true,
}); });
@ -137,7 +137,7 @@ class Test$$Page extends React.Component {
componentDidMount() { componentDidMount() {
this._dataSourceEngine.reloadDataSource(); this._dataSourceEngine.reloadDataSource();
console.log("did mount"); console.log('did mount');
} }
render() { render() {
@ -145,12 +145,12 @@ class Test$$Page extends React.Component {
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div <div
ref={this._refsManager.linkRef("outterView")} ref={this._refsManager.linkRef('outterView')}
style={{ height: "100%" }} style={{ height: '100%' }}
> >
<NextPage <NextPage
columns={12} columns={12}
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }} placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
placeholder="页面主体内容拖拽Block布局组件到这里" placeholder="页面主体内容拖拽Block布局组件到这里"
header={ header={
<NextP <NextP
@ -165,13 +165,13 @@ class Test$$Page extends React.Component {
</NextP> </NextP>
} }
headerTest={[]} headerTest={[]}
headerProps={{ background: "surface" }} headerProps={{ background: 'surface' }}
footer={null} footer={null}
minHeight="100vh" minHeight="100vh"
> >
<NextBlock <NextBlock
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
noPadding={false} noPadding={false}
noBorder={false} noBorder={false}
background="surface" background="surface"
@ -183,7 +183,7 @@ class Test$$Page extends React.Component {
title="" title=""
primaryKey="732" primaryKey="732"
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
colSpan={1} colSpan={1}
rowSpan={1} rowSpan={1}
> >
@ -199,13 +199,13 @@ class Test$$Page extends React.Component {
dataSource={__$$eval(() => this.state.users.data)} dataSource={__$$eval(() => this.state.users.data)}
rowKey="workid" rowKey="workid"
columns={[ columns={[
{ title: "花名", dataIndex: "cname" }, { title: '花名', dataIndex: 'cname' },
{ title: "user_id", dataIndex: "workid" }, { title: 'user_id', dataIndex: 'workid' },
{ title: "部门", dataIndex: "dep" }, { title: '部门', dataIndex: 'dep' },
]} ]}
searchItems={[ searchItems={[
{ label: "姓名", name: "cname" }, { label: '姓名', name: 'cname' },
{ label: "部门", name: "dep" }, { label: '部门', name: 'dep' },
]} ]}
onSearch={function () { onSearch={function () {
return this.onSearch.apply( return this.onSearch.apply(
@ -220,7 +220,7 @@ class Test$$Page extends React.Component {
); );
}.bind(this)} }.bind(this)}
pagination={{ pagination={{
defaultPageSize: "", defaultPageSize: '',
onPageChange: function () { onPageChange: function () {
return this.onPageChange.apply( return this.onPageChange.apply(
this, this,
@ -237,16 +237,16 @@ class Test$$Page extends React.Component {
<NextPage <NextPage
columns={12} columns={12}
headerDivider={true} headerDivider={true}
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }} placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
placeholder="页面主体内容拖拽Block布局组件到这里" placeholder="页面主体内容拖拽Block布局组件到这里"
header={null} header={null}
headerProps={{ background: "surface" }} headerProps={{ background: 'surface' }}
footer={null} footer={null}
minHeight="100vh" minHeight="100vh"
> >
<NextBlock <NextBlock
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
noPadding={false} noPadding={false}
noBorder={false} noBorder={false}
background="surface" background="surface"
@ -258,7 +258,7 @@ class Test$$Page extends React.Component {
title="" title=""
primaryKey="472" primaryKey="472"
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
colSpan={1} colSpan={1}
rowSpan={1} rowSpan={1}
/> />

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "", path: '',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -12,7 +12,7 @@
}, },
{ {
"package": "@alife/container", "package": "@alife/container",
"version": "latest", "version": "^1.0.0",
"exportName": "P", "exportName": "P",
"main": "lib/index.js", "main": "lib/index.js",
"destructuring": true, "destructuring": true,
@ -21,7 +21,7 @@
}, },
{ {
"package": "@alife/container", "package": "@alife/container",
"version": "latest", "version": "^1.0.0",
"exportName": "Block", "exportName": "Block",
"main": "lib/index.js", "main": "lib/index.js",
"destructuring": true, "destructuring": true,
@ -30,7 +30,7 @@
}, },
{ {
"package": "@alife/container", "package": "@alife/container",
"version": "latest", "version": "^1.0.0",
"exportName": "Block", "exportName": "Block",
"main": "lib/index.js", "main": "lib/index.js",
"destructuring": true, "destructuring": true,
@ -39,7 +39,7 @@
}, },
{ {
"package": "@alife/container", "package": "@alife/container",
"version": "latest", "version": "^1.0.0",
"exportName": "Text", "exportName": "Text",
"main": "lib/index.js", "main": "lib/index.js",
"destructuring": true, "destructuring": true,
@ -48,7 +48,7 @@
}, },
{ {
"package": "@alife/container", "package": "@alife/container",
"version": "latest", "version": "^1.0.0",
"exportName": "Page", "exportName": "Page",
"main": "lib/index.js", "main": "lib/index.js",
"destructuring": true, "destructuring": true,

View File

@ -11,7 +11,7 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"undefined": "*", "undefined": "*",
"@alife/container": "0.3.7", "@alife/container": "0.3.7",
"@alilc/antd-lowcode": "0.5.4", "@alilc/antd-lowcode": "0.5.4",

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,12 +1,12 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { import {
Page as NextPage, Page as NextPage,
Block as NextBlock, Block as NextBlock,
P as NextP, P as NextP,
} from "@alife/container/lib/index.js"; } from '@alife/container/lib/index.js';
import { import {
Card, Card,
@ -18,17 +18,17 @@ import {
Form, Form,
InputNumber, InputNumber,
Input, Input,
} from "@alilc/antd-lowcode/dist/antd-lowcode.esm.js"; } from '@alilc/antd-lowcode/dist/antd-lowcode.esm.js';
import { AliAutoSearchTable } from "@alife/mc-assets-1935/build/lowcode/index.js"; import { AliAutoSearchTable } from '@alife/mc-assets-1935/build/lowcode/index.js';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
const NextBlockCell = NextBlock.Cell; const NextBlockCell = NextBlock.Cell;
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
__$$i18n._inject2(this); __$$i18n._inject2(this);
this.state = { this.state = {
name: "nongzhou", name: 'nongzhou',
gateways: [], gateways: [],
selectedGateway: null, selectedGateway: null,
records: [], records: [],
@ -102,23 +102,23 @@ class Test$$Page extends React.Component {
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div <div
ref={this._refsManager.linkRef("outterView")} ref={this._refsManager.linkRef('outterView')}
style={{ height: "100%" }} style={{ height: '100%' }}
> >
<NextPage <NextPage
columns={12} columns={12}
headerDivider={true} headerDivider={true}
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }} placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
placeholder="页面主体内容拖拽Block布局组件到这里" placeholder="页面主体内容拖拽Block布局组件到这里"
header={null} header={null}
headerProps={{ background: "surface" }} headerProps={{ background: 'surface' }}
footer={null} footer={null}
minHeight="100vh" minHeight="100vh"
style={{ cursor: "pointer" }} style={{ cursor: 'pointer' }}
> >
<NextBlock <NextBlock
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
noPadding={false} noPadding={false}
noBorder={false} noBorder={false}
background="surface" background="surface"
@ -130,7 +130,7 @@ class Test$$Page extends React.Component {
<NextBlockCell <NextBlockCell
title="" title=""
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
layoutmode="O" layoutmode="O"
childTotalColumns={12} childTotalColumns={12}
isAutoContainer={true} isAutoContainer={true}
@ -151,16 +151,16 @@ class Test$$Page extends React.Component {
<Typography.Text>所在网关</Typography.Text> <Typography.Text>所在网关</Typography.Text>
<Select <Select
style={{ style={{
marginTop: "16px", marginTop: '16px',
marginRight: "16px", marginRight: '16px',
marginBottom: "16px", marginBottom: '16px',
marginLeft: "16px", marginLeft: '16px',
width: "400px", width: '400px',
display: "inline-block", display: 'inline-block',
}} }}
options={__$$eval(() => this.state.gateways)} options={__$$eval(() => this.state.gateways)}
mode="single" mode="single"
defaultValue={["auto-edd-uniproxy"]} defaultValue={['auto-edd-uniproxy']}
labelInValue={true} labelInValue={true}
showSearch={true} showSearch={true}
allowClear={false} allowClear={false}
@ -171,23 +171,23 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onChange", name: 'onChange',
relatedEventName: "onChange", relatedEventName: 'onChange',
}, },
], ],
eventList: [ eventList: [
{ name: "onBlur", disabled: false }, { name: 'onBlur', disabled: false },
{ name: "onChange", disabled: true }, { name: 'onChange', disabled: true },
{ name: "onDeselect", disabled: false }, { name: 'onDeselect', disabled: false },
{ name: "onFocus", disabled: false }, { name: 'onFocus', disabled: false },
{ name: "onInputKeyDown", disabled: false }, { name: 'onInputKeyDown', disabled: false },
{ name: "onMouseEnter", disabled: false }, { name: 'onMouseEnter', disabled: false },
{ name: "onMouseLeave", disabled: false }, { name: 'onMouseLeave', disabled: false },
{ name: "onPopupScroll", disabled: false }, { name: 'onPopupScroll', disabled: false },
{ name: "onSearch", disabled: false }, { name: 'onSearch', disabled: false },
{ name: "onSelect", disabled: false }, { name: 'onSelect', disabled: false },
{ name: "onDropdownVisibleChange", disabled: false }, { name: 'onDropdownVisibleChange', disabled: false },
], ],
}} }}
onChange={function () { onChange={function () {
@ -201,19 +201,19 @@ class Test$$Page extends React.Component {
<Button <Button
type="primary" type="primary"
style={{ style={{
display: "block", display: 'block',
marginTop: "20px", marginTop: '20px',
marginBottom: "20px", marginBottom: '20px',
}} }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onCreateOrder", relatedEventName: 'onCreateOrder',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onCreateOrder.apply( this.onCreateOrder.apply(
@ -231,14 +231,14 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onCancel", name: 'onCancel',
relatedEventName: "onCancelModal", relatedEventName: 'onCancelModal',
}, },
], ],
eventList: [ eventList: [
{ name: "onCancel", disabled: true }, { name: 'onCancel', disabled: true },
{ name: "onOk", disabled: false }, { name: 'onOk', disabled: false },
], ],
}} }}
onCancel={function () { onCancel={function () {
@ -262,16 +262,16 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onFinish", name: 'onFinish',
relatedEventName: "onConfirmCreateOrder", relatedEventName: 'onConfirmCreateOrder',
}, },
], ],
eventList: [ eventList: [
{ name: "onFinish", disabled: true }, { name: 'onFinish', disabled: true },
{ name: "onFinishFailed", disabled: false }, { name: 'onFinishFailed', disabled: false },
{ name: "onFieldsChange", disabled: false }, { name: 'onFieldsChange', disabled: false },
{ name: "onValuesChange", disabled: false }, { name: 'onValuesChange', disabled: false },
], ],
}} }}
> >
@ -287,10 +287,10 @@ class Test$$Page extends React.Component {
<Form.Item <Form.Item
wrapperCol={{ offset: 6 }} wrapperCol={{ offset: 6 }}
style={{ style={{
flexDirection: "row", flexDirection: 'row',
alignItems: "flex-end", alignItems: 'flex-end',
justifyContent: "center", justifyContent: 'center',
display: "flex", display: 'flex',
}} }}
labelAlign="right" labelAlign="right"
> >
@ -302,12 +302,12 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onCancelModal", relatedEventName: 'onCancelModal',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onCancelModal.apply( this.onCancelModal.apply(
@ -326,27 +326,27 @@ class Test$$Page extends React.Component {
dataSource={__$$eval(() => this.state.records)} dataSource={__$$eval(() => this.state.records)}
columns={[ columns={[
{ {
title: "发布名称", title: '发布名称',
dataIndex: "order_name", dataIndex: 'order_name',
key: "name", key: 'name',
}, },
{ {
title: "类型", title: '类型',
dataIndex: "order_type_desc", dataIndex: 'order_type_desc',
key: "age", key: 'age',
}, },
{ {
title: "发布状态", title: '发布状态',
dataIndex: "order_status_desc", dataIndex: 'order_status_desc',
key: "address", key: 'address',
}, },
{ title: "发布人", dataIndex: "creator_name" }, { title: '发布人', dataIndex: 'creator_name' },
{ title: "当前批次/总批次", dataIndex: "cur_batch_no" }, { title: '当前批次/总批次', dataIndex: 'cur_batch_no' },
{ {
title: "发布机器/总机器", title: '发布机器/总机器',
dataIndex: "pubblish_ip_finish_num", dataIndex: 'pubblish_ip_finish_num',
}, },
{ title: "发布时间", dataIndex: "publish_id" }, { title: '发布时间', dataIndex: 'publish_id' },
]} ]}
actions={__$$eval(() => this.actions || [])} actions={__$$eval(() => this.actions || [])}
getActions={function () { getActions={function () {

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "", path: '',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,9 +11,9 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-url-params-handler": "latest", "@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
"@alilc/lowcode-datasource-fetch-handler": "latest", "@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
"@alifd/next": "1.19.18" "@alifd/next": "1.19.18"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,3 +1,3 @@
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" }; const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
export default __$$constants; export default __$$constants;

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,22 +1,22 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { Form, Input, NumberPicker, Select, Button } from "@alifd/next"; import { Form, Input, NumberPicker, Select, Button } from '@alifd/next';
import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from "@alilc/lowcode-datasource-url-params-handler"; import { createUrlParamsHandler as __$$createUrlParamsRequestHandler } from '@alilc/lowcode-datasource-url-params-handler';
import { createFetchHandler as __$$createFetchRequestHandler } from "@alilc/lowcode-datasource-fetch-handler"; import { createFetchHandler as __$$createFetchRequestHandler } from '@alilc/lowcode-datasource-fetch-handler';
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime"; import { create as __$$createDataSourceEngine } from '@alilc/lowcode-datasource-engine/runtime';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
class Test$$Page extends React.Component { class Test$$Page extends React.Component {
_context = this; _context = this;
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
__$$i18n._inject2(this); __$$i18n._inject2(this);
this.state = { text: "outter" }; this.state = { text: 'outter' };
} }
$ = (refName) => { $ = (refName) => {
@ -67,8 +67,8 @@ class Test$$Page extends React.Component {
return { return {
list: [ list: [
{ {
id: "urlParams", id: 'urlParams',
type: "urlParams", type: 'urlParams',
isInit: function () { isInit: function () {
return undefined; return undefined;
}, },
@ -77,12 +77,12 @@ class Test$$Page extends React.Component {
}, },
}, },
{ {
id: "user", id: 'user',
type: "fetch", type: 'fetch',
options: function () { options: function () {
return { return {
method: "GET", method: 'GET',
uri: "https://shs.xxx.com/mock/1458/demo/user", uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true, isSync: true,
}; };
}, },
@ -90,6 +90,7 @@ class Test$$Page extends React.Component {
if (!response.data.success) { if (!response.data.success) {
throw new Error(response.data.message); throw new Error(response.data.message);
} }
return response.data.data; return response.data.data;
}, },
isInit: function () { isInit: function () {
@ -97,12 +98,12 @@ class Test$$Page extends React.Component {
}, },
}, },
{ {
id: "orders", id: 'orders',
type: "fetch", type: 'fetch',
options: function () { options: function () {
return { return {
method: "GET", method: 'GET',
uri: "https://shs.xxx.com/mock/1458/demo/orders", uri: 'https://shs.xxx.com/mock/1458/demo/orders',
isSync: true, isSync: true,
}; };
}, },
@ -110,6 +111,7 @@ class Test$$Page extends React.Component {
if (!response.data.success) { if (!response.data.success) {
throw new Error(response.data.message); throw new Error(response.data.message);
} }
return response.data.data.result; return response.data.data.result;
}, },
isInit: function () { isInit: function () {
@ -118,7 +120,7 @@ class Test$$Page extends React.Component {
}, },
], ],
dataHandler: function (dataMap) { dataHandler: function (dataMap) {
console.info("All datasources loaded:", dataMap); console.info('All datasources loaded:', dataMap);
}, },
}; };
} }
@ -126,18 +128,18 @@ class Test$$Page extends React.Component {
componentDidMount() { componentDidMount() {
this._dataSourceEngine.reloadDataSource(); this._dataSourceEngine.reloadDataSource();
console.log("componentDidMount"); console.log('componentDidMount');
} }
render() { render() {
const __$$context = this._context || this; const __$$context = this._context || this;
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}> <div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
<Form <Form
labelCol={__$$eval(() => this.state.colNum)} labelCol={__$$eval(() => this.state.colNum)}
style={{}} style={{}}
ref={this._refsManager.linkRef("testForm")} ref={this._refsManager.linkRef('testForm')}
> >
<Form.Item label="姓名:" name="name" initValue="李雷"> <Form.Item label="姓名:" name="name" initValue="李雷">
<Input placeholder="请输入" size="medium" style={{ width: 320 }} /> <Input placeholder="请输入" size="medium" style={{ width: 320 }} />
@ -148,18 +150,18 @@ class Test$$Page extends React.Component {
<Form.Item label="职业:" name="profession"> <Form.Item label="职业:" name="profession">
<Select <Select
dataSource={[ dataSource={[
{ label: "教师", value: "t" }, { label: '教师', value: 't' },
{ label: "医生", value: "d" }, { label: '医生', value: 'd' },
{ label: "歌手", value: "s" }, { label: '歌手', value: 's' },
]} ]}
/> />
</Form.Item> </Form.Item>
<div style={{ textAlign: "center" }}> <div style={{ textAlign: 'center' }}>
<Button.Group> <Button.Group>
{__$$evalArray(() => ["a", "b", "c"]).map((item, index) => {__$$evalArray(() => ['a', 'b', 'c']).map((item, index) =>
((__$$context) => ((__$$context) =>
!!false && ( !!false && (
<Button type="primary" style={{ margin: "0 5px 0 5px" }}> <Button type="primary" style={{ margin: '0 5px 0 5px' }}>
{__$$eval(() => item)} {__$$eval(() => item)}
</Button> </Button>
))(__$$createChildContext(__$$context, { item, index })) ))(__$$createChildContext(__$$context, { item, index }))

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "/", path: '/',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,7 +11,7 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"undefined": "*", "undefined": "*",
"@alilc/antd-lowcode": "0.8.0", "@alilc/antd-lowcode": "0.8.0",
"@alife/container": "0.3.7" "@alife/container": "0.3.7"

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,6 +1,6 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { import {
Modal, Modal,
@ -12,22 +12,22 @@ import {
DatePicker, DatePicker,
InputNumber, InputNumber,
Button, Button,
} from "@alilc/antd-lowcode/dist/antd-lowcode.esm.js"; } from '@alilc/antd-lowcode/dist/antd-lowcode.esm.js';
import { import {
Text as NextText, Text as NextText,
Page as NextPage, Page as NextPage,
Block as NextBlock, Block as NextBlock,
P as NextP, P as NextP,
} from "@alife/container/lib/index.js"; } from '@alife/container/lib/index.js';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
const NextBlockCell = NextBlock.Cell; const NextBlockCell = NextBlock.Cell;
@ -52,9 +52,9 @@ class Test$$Page extends React.Component {
currentStep: 0, currentStep: 0,
isModifyDialogVisible: false, isModifyDialogVisible: false,
isModifyStatus: false, isModifyStatus: false,
secondCommitText: "完成并提交", secondCommitText: '完成并提交',
thirdAuditText: "审核中", thirdAuditText: '审核中',
thirdButtonText: "修改", thirdButtonText: '修改',
customerProjectInfo: { customerProjectInfo: {
id: null, id: null,
systemProjectName: null, systemProjectName: null,
@ -75,28 +75,28 @@ class Test$$Page extends React.Component {
status: null, status: null,
}, },
versionLinesArray: [ versionLinesArray: [
{ label: "AmapAuto 485", value: 1 }, { label: 'AmapAuto 485', value: 1 },
{ label: "AmapAuto 505", value: 2 }, { label: 'AmapAuto 505', value: 2 },
], ],
projectModalsArray: [ projectModalsArray: [
{ label: "车机", value: 1 }, { label: '车机', value: 1 },
{ label: "车镜", value: 2 }, { label: '车镜', value: 2 },
{ label: "记录仪", value: 3 }, { label: '记录仪', value: 3 },
{ label: "其他", value: 4 }, { label: '其他', value: 4 },
], ],
osVersionsArray: [ osVersionsArray: [
{ label: "安卓5", value: 1 }, { label: '安卓5', value: 1 },
{ label: "安卓6", value: 2 }, { label: '安卓6', value: 2 },
{ label: "安卓7", value: 3 }, { label: '安卓7', value: 3 },
{ label: "安卓8", value: 4 }, { label: '安卓8', value: 4 },
{ label: "安卓9", value: 5 }, { label: '安卓9', value: 5 },
{ label: "安卓10", value: 6 }, { label: '安卓10', value: 6 },
], ],
instructionsArray: [ instructionsArray: [
{ label: "ARM64-V8", value: "ARM64-V8" }, { label: 'ARM64-V8', value: 'ARM64-V8' },
{ label: "ARM32-V7", value: "ARM32-V7" }, { label: 'ARM32-V7', value: 'ARM32-V7' },
{ label: "X86", value: "X86" }, { label: 'X86', value: 'X86' },
{ label: "X64", value: "X64" }, { label: 'X64', value: 'X64' },
], ],
}; };
} }
@ -151,7 +151,6 @@ class Test$$Page extends React.Component {
onOkModifyDialogThird() { onOkModifyDialogThird() {
// //
this.setState({ this.setState({
currentStep: 0, currentStep: 0,
isModifyDialogVisible: false, isModifyDialogVisible: false,
@ -160,7 +159,6 @@ class Test$$Page extends React.Component {
onCancelModifyDialogThird() { onCancelModifyDialogThird() {
// //
this.setState({ this.setState({
isModifyDialogVisible: false, isModifyDialogVisible: false,
}); });
@ -177,17 +175,17 @@ class Test$$Page extends React.Component {
onClickFirstBack() { onClickFirstBack() {
// //
this.$router.push("/myProjectList"); this.$router.push('/myProjectList');
} }
onClickSecondBack() { onClickSecondBack() {
// //
this.$router.push("/myProjectList"); this.$router.push('/myProjectList');
} }
onClickThirdBack() { onClickThirdBack() {
// //
this.$router.push("/myProjectList"); this.$router.push('/myProjectList');
} }
onValuesChange(_, values) { onValuesChange(_, values) {
@ -206,8 +204,8 @@ class Test$$Page extends React.Component {
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div <div
ref={this._refsManager.linkRef("outterView")} ref={this._refsManager.linkRef('outterView')}
style={{ height: "100%" }} style={{ height: '100%' }}
> >
<Modal <Modal
title="是否修改" title="是否修改"
@ -222,19 +220,19 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onOk", name: 'onOk',
relatedEventName: "onOkModifyDialogThird", relatedEventName: 'onOkModifyDialogThird',
}, },
{ {
type: "componentEvent", type: 'componentEvent',
name: "onCancel", name: 'onCancel',
relatedEventName: "onCancelModifyDialogThird", relatedEventName: 'onCancelModifyDialogThird',
}, },
], ],
eventList: [ eventList: [
{ name: "onCancel", disabled: true }, { name: 'onCancel', disabled: true },
{ name: "onOk", disabled: true }, { name: 'onOk', disabled: true },
], ],
}} }}
onOk={function () { onOk={function () {
@ -253,11 +251,11 @@ class Test$$Page extends React.Component {
<NextText <NextText
type="inherit" type="inherit"
style={{ style={{
fontStyle: "normal", fontStyle: 'normal',
textAlign: "left", textAlign: 'left',
display: "block", display: 'block',
fontFamily: "arial, helvetica, microsoft yahei", fontFamily: 'arial, helvetica, microsoft yahei',
fontWeight: "normal", fontWeight: 'normal',
}} }}
> >
修改将撤回此前填写的信息 修改将撤回此前填写的信息
@ -266,17 +264,17 @@ class Test$$Page extends React.Component {
<NextPage <NextPage
columns={12} columns={12}
headerDivider={true} headerDivider={true}
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }} placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
placeholder="页面主体内容拖拽Block布局组件到这里" placeholder="页面主体内容拖拽Block布局组件到这里"
header={null} header={null}
headerProps={{ background: "surface" }} headerProps={{ background: 'surface' }}
footer={null} footer={null}
minHeight="100vh" minHeight="100vh"
style={{}} style={{}}
> >
<NextBlock <NextBlock
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
noPadding={false} noPadding={false}
noBorder={false} noBorder={false}
background="surface" background="surface"
@ -288,7 +286,7 @@ class Test$$Page extends React.Component {
<NextBlockCell <NextBlockCell
title="" title=""
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
layoutmode="O" layoutmode="O"
childTotalColumns={12} childTotalColumns={12}
isAutoContainer={true} isAutoContainer={true}
@ -302,7 +300,7 @@ class Test$$Page extends React.Component {
textSpacing={true} textSpacing={true}
align="left" align="left"
flex={true} flex={true}
style={{ marginBottom: "24px" }} style={{ marginBottom: '24px' }}
> >
<Steps current={__$$eval(() => this.state.currentStep)}> <Steps current={__$$eval(() => this.state.currentStep)}>
<Steps.Step title="版本申请" description="" /> <Steps.Step title="版本申请" description="" />
@ -319,7 +317,7 @@ class Test$$Page extends React.Component {
align="left" align="left"
full={true} full={true}
flex={true} flex={true}
style={{ display: "flex", justifyContent: "center" }} style={{ display: 'flex', justifyContent: 'center' }}
> >
<Form <Form
labelCol={{ span: 10 }} labelCol={{ span: 10 }}
@ -332,30 +330,30 @@ class Test$$Page extends React.Component {
}.bind(this)} }.bind(this)}
name="basic" name="basic"
style={{ style={{
display: "flex", display: 'flex',
flexDirection: "column", flexDirection: 'column',
width: "600px", width: '600px',
justifyContent: "center", justifyContent: 'center',
}} }}
layout="vertical" layout="vertical"
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onFinish", name: 'onFinish',
relatedEventName: "onFinishFirst", relatedEventName: 'onFinishFirst',
}, },
{ {
type: "componentEvent", type: 'componentEvent',
name: "onValuesChange", name: 'onValuesChange',
relatedEventName: "onValuesChange", relatedEventName: 'onValuesChange',
}, },
], ],
eventList: [ eventList: [
{ name: "onFinish", disabled: true }, { name: 'onFinish', disabled: true },
{ name: "onFinishFailed", disabled: false }, { name: 'onFinishFailed', disabled: false },
{ name: "onFieldsChange", disabled: false }, { name: 'onFieldsChange', disabled: false },
{ name: "onValuesChange", disabled: true }, { name: 'onValuesChange', disabled: true },
], ],
}} }}
initialValues={__$$eval( initialValues={__$$eval(
@ -371,13 +369,13 @@ class Test$$Page extends React.Component {
{!!false && ( {!!false && (
<Form.Item <Form.Item
label="" label=""
style={{ width: "600px" }} style={{ width: '600px' }}
colon={false} colon={false}
name="id" name="id"
> >
<Input <Input
placeholder="" placeholder=""
style={{ width: "600px" }} style={{ width: '600px' }}
bordered={false} bordered={false}
disabled={true} disabled={true}
/> />
@ -390,20 +388,20 @@ class Test$$Page extends React.Component {
labelAlign="left" labelAlign="left"
colon={false} colon={false}
required={true} required={true}
style={{ flexDirection: "column", width: "600px" }} style={{ flexDirection: 'column', width: '600px' }}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请选择版本类型", message: '请选择版本类型',
}} }}
> >
<Checkbox.Group <Checkbox.Group
options={[ options={[
{ label: "基础版本", value: "3" }, { label: '基础版本', value: '3' },
{ label: "AR导航", value: "1" }, { label: 'AR导航', value: '1' },
{ label: "货车导航", value: "2" }, { label: '货车导航', value: '2' },
{ label: "UI定制", value: "4", disabled: false }, { label: 'UI定制', value: '4', disabled: false },
]} ]}
style={{ width: "600px" }} style={{ width: '600px' }}
disabled={__$$eval( disabled={__$$eval(
() => () =>
this.state.customerProjectInfo.id > 0 && this.state.customerProjectInfo.id > 0 &&
@ -416,13 +414,13 @@ class Test$$Page extends React.Component {
labelAlign="left" labelAlign="left"
colon={false} colon={false}
required={true} required={true}
style={{ width: "600px" }} style={{ width: '600px' }}
name="versionLine" name="versionLine"
requiredobj={{ required: true, message: "请选择版本线" }} requiredobj={{ required: true, message: '请选择版本线' }}
extra="" extra=""
> >
<Select <Select
style={{ width: "600px" }} style={{ width: '600px' }}
options={__$$eval(() => this.state.versionLinesArray)} options={__$$eval(() => this.state.versionLinesArray)}
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -436,27 +434,27 @@ class Test$$Page extends React.Component {
label="项目名称" label="项目名称"
colon={false} colon={false}
required={true} required={true}
style={{ display: "flex" }} style={{ display: 'flex' }}
labelAlign="left" labelAlign="left"
extra="" extra=""
name="systemProjectName" name="systemProjectName"
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请按格式填写项目名称", message: '请按格式填写项目名称',
}} }}
typeobj={{ typeobj={{
type: "string", type: 'string',
message: message:
"请输入项目名称,格式:公司简称-产品名称-版本类型", '请输入项目名称,格式:公司简称-产品名称-版本类型',
}} }}
lenobj={{ lenobj={{
max: 100, max: 100,
message: "项目名称不能超过100个字符", message: '项目名称不能超过100个字符',
}} }}
> >
<Input <Input
placeholder="公司简称-产品名称-版本类型" placeholder="公司简称-产品名称-版本类型"
style={{ width: "600px" }} style={{ width: '600px' }}
disabled={__$$eval( disabled={__$$eval(
() => () =>
this.state.customerProjectInfo.id > 0 && this.state.customerProjectInfo.id > 0 &&
@ -466,18 +464,18 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="预期交付时间" label="预期交付时间"
style={{ width: "600px" }} style={{ width: '600px' }}
colon={false} colon={false}
required={true} required={true}
name="expectedTime" name="expectedTime"
labelAlign="left" labelAlign="left"
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请填写预期交付时间", message: '请填写预期交付时间',
}} }}
> >
<DatePicker <DatePicker
style={{ width: "600px" }} style={{ width: '600px' }}
disabled={__$$eval( disabled={__$$eval(
() => () =>
this.state.customerProjectInfo.id > 0 && this.state.customerProjectInfo.id > 0 &&
@ -487,11 +485,11 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="预期出货量" label="预期出货量"
style={{ width: "600px" }} style={{ width: '600px' }}
required={true} required={true}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请填写预期出货量", message: '请填写预期出货量',
}} }}
name="expectedNum" name="expectedNum"
labelAlign="left" labelAlign="left"
@ -499,7 +497,7 @@ class Test$$Page extends React.Component {
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="单位(台)使用该版本的机器数量+预计出货量,请如实填写" placeholder="单位(台)使用该版本的机器数量+预计出货量,请如实填写"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -511,28 +509,28 @@ class Test$$Page extends React.Component {
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
wrapperCol={{ offset: "" }} wrapperCol={{ offset: '' }}
style={{ style={{
flexDirection: "row", flexDirection: 'row',
alignItems: "baseline", alignItems: 'baseline',
justifyContent: "space-between", justifyContent: 'space-between',
width: "600px", width: '600px',
display: "block", display: 'block',
}} }}
labelAlign="left" labelAlign="left"
colon={false} colon={false}
> >
<Button <Button
style={{ margin: "0px" }} style={{ margin: '0px' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickFirstBack", relatedEventName: 'onClickFirstBack',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickFirstBack.apply( this.onClickFirstBack.apply(
@ -547,12 +545,12 @@ class Test$$Page extends React.Component {
type="primary" type="primary"
htmlType="submit" htmlType="submit"
style={{ style={{
boxShadow: "rgba(31, 56, 88, 0.2) 0px 0px 0px 0px", boxShadow: 'rgba(31, 56, 88, 0.2) 0px 0px 0px 0px',
float: "right", float: 'right',
}} }}
__events={{ __events={{
eventDataList: [], eventDataList: [],
eventList: [{ name: "onClick", disabled: false }], eventList: [{ name: 'onClick', disabled: false }],
}} }}
> >
下一步 下一步
@ -570,7 +568,7 @@ class Test$$Page extends React.Component {
align="left" align="left"
full={true} full={true}
flex={true} flex={true}
style={{ display: "flex", justifyContent: "center" }} style={{ display: 'flex', justifyContent: 'center' }}
> >
<Form <Form
labelCol={{ span: 10 }} labelCol={{ span: 10 }}
@ -583,31 +581,31 @@ class Test$$Page extends React.Component {
}.bind(this)} }.bind(this)}
name="basic" name="basic"
style={{ style={{
display: "flex", display: 'flex',
flexDirection: "column", flexDirection: 'column',
width: "600px", width: '600px',
justifyContent: "center", justifyContent: 'center',
height: "800px", height: '800px',
}} }}
layout="vertical" layout="vertical"
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onFinish", name: 'onFinish',
relatedEventName: "onFinishSecond", relatedEventName: 'onFinishSecond',
}, },
{ {
type: "componentEvent", type: 'componentEvent',
name: "onValuesChange", name: 'onValuesChange',
relatedEventName: "onValuesChange", relatedEventName: 'onValuesChange',
}, },
], ],
eventList: [ eventList: [
{ name: "onFinish", disabled: true }, { name: 'onFinish', disabled: true },
{ name: "onFinishFailed", disabled: false }, { name: 'onFinishFailed', disabled: false },
{ name: "onFieldsChange", disabled: false }, { name: 'onFieldsChange', disabled: false },
{ name: "onValuesChange", disabled: true }, { name: 'onValuesChange', disabled: true },
], ],
}} }}
initialValues={__$$eval( initialValues={__$$eval(
@ -625,15 +623,15 @@ class Test$$Page extends React.Component {
labelAlign="left" labelAlign="left"
colon={false} colon={false}
required={true} required={true}
style={{ width: "600px" }} style={{ width: '600px' }}
name="projectModal" name="projectModal"
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请选择设备类型", message: '请选择设备类型',
}} }}
> >
<Select <Select
style={{ width: "600px" }} style={{ width: '600px' }}
options={__$$eval(() => this.state.projectModalsArray)} options={__$$eval(() => this.state.projectModalsArray)}
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -645,19 +643,19 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="屏幕分辨率宽" label="屏幕分辨率宽"
style={{ width: "600px" }} style={{ width: '600px' }}
name="displayWidth" name="displayWidth"
colon={false} colon={false}
required={true} required={true}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请输入屏幕分辨率宽", message: '请输入屏幕分辨率宽',
}} }}
labelAlign="left" labelAlign="left"
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="例如1280" placeholder="例如1280"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -669,19 +667,19 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="屏幕分辨率高" label="屏幕分辨率高"
style={{ width: "600px" }} style={{ width: '600px' }}
labelAlign="left" labelAlign="left"
colon={false} colon={false}
name="displayHeight" name="displayHeight"
required={true} required={true}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请输入屏幕分辨率高", message: '请输入屏幕分辨率高',
}} }}
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="例如720" placeholder="例如720"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -693,19 +691,19 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="屏幕尺寸inch" label="屏幕尺寸inch"
style={{ width: "600px" }} style={{ width: '600px' }}
name="displayInch" name="displayInch"
labelAlign="left" labelAlign="left"
required={true} required={true}
colon={false} colon={false}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请输入屏幕尺寸", message: '请输入屏幕尺寸',
}} }}
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="请输入尺寸" placeholder="请输入尺寸"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -717,7 +715,7 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="屏幕DPI" label="屏幕DPI"
style={{ width: "600px" }} style={{ width: '600px' }}
labelAlign="left" labelAlign="left"
colon={false} colon={false}
required={false} required={false}
@ -725,7 +723,7 @@ class Test$$Page extends React.Component {
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="UI定制项目必填" placeholder="UI定制项目必填"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -739,19 +737,19 @@ class Test$$Page extends React.Component {
label="芯片名称" label="芯片名称"
colon={false} colon={false}
required={true} required={true}
style={{ display: "flex" }} style={{ display: 'flex' }}
labelAlign="left" labelAlign="left"
extra="" extra=""
name="mainSoc" name="mainSoc"
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请输入芯片名称", message: '请输入芯片名称',
}} }}
lenobj={{ max: 50, message: "芯片名称不能超过50个字符" }} lenobj={{ max: 50, message: '芯片名称不能超过50个字符' }}
> >
<Input <Input
placeholder="请输入芯片名称" placeholder="请输入芯片名称"
style={{ width: "600px" }} style={{ width: '600px' }}
disabled={__$$eval( disabled={__$$eval(
() => () =>
this.state.customerProjectInfo.id > 0 && this.state.customerProjectInfo.id > 0 &&
@ -761,11 +759,11 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="芯片核数" label="芯片核数"
style={{ width: "600px" }} style={{ width: '600px' }}
required={true} required={true}
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请输入芯片核数", message: '请输入芯片核数',
}} }}
name="cpuCoreNum" name="cpuCoreNum"
labelAlign="left" labelAlign="left"
@ -773,7 +771,7 @@ class Test$$Page extends React.Component {
> >
<InputNumber <InputNumber
value={3} value={3}
style={{ width: "600px" }} style={{ width: '600px' }}
placeholder="请输入芯片核数" placeholder="请输入芯片核数"
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -786,14 +784,14 @@ class Test$$Page extends React.Component {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="指令集" label="指令集"
style={{ width: "600px" }} style={{ width: '600px' }}
required={true} required={true}
requiredobj={{ required: true, message: "请选择指令集" }} requiredobj={{ required: true, message: '请选择指令集' }}
name="instructions" name="instructions"
colon={false} colon={false}
> >
<Select <Select
style={{ width: "600px" }} style={{ width: '600px' }}
options={__$$eval(() => this.state.instructionsArray)} options={__$$eval(() => this.state.instructionsArray)}
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -807,15 +805,15 @@ class Test$$Page extends React.Component {
labelAlign="left" labelAlign="left"
colon={false} colon={false}
required={true} required={true}
style={{ width: "600px" }} style={{ width: '600px' }}
name="osVersion" name="osVersion"
requiredobj={{ requiredobj={{
required: true, required: true,
message: "请选择系统版本", message: '请选择系统版本',
}} }}
> >
<Select <Select
style={{ width: "600px" }} style={{ width: '600px' }}
options={__$$eval(() => this.state.osVersionsArray)} options={__$$eval(() => this.state.osVersionsArray)}
disabled={__$$eval( disabled={__$$eval(
() => () =>
@ -826,24 +824,24 @@ class Test$$Page extends React.Component {
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
wrapperCol={{ offset: "" }} wrapperCol={{ offset: '' }}
style={{ style={{
flexDirection: "row", flexDirection: 'row',
width: "600px", width: '600px',
display: "flex", display: 'flex',
}} }}
> >
<Button <Button
style={{ marginLeft: "0" }} style={{ marginLeft: '0' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickSecondBack", relatedEventName: 'onClickSecondBack',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickSecondBack.apply( this.onClickSecondBack.apply(
@ -857,7 +855,7 @@ class Test$$Page extends React.Component {
<Button <Button
type="primary" type="primary"
htmlType="submit" htmlType="submit"
style={{ float: "right", marginLeft: "20px" }} style={{ float: 'right', marginLeft: '20px' }}
loading={__$$eval( loading={__$$eval(
() => () =>
this.state.LOADING_ADD_OR_UPDATE_CUSTOMER_PROJECT this.state.LOADING_ADD_OR_UPDATE_CUSTOMER_PROJECT
@ -868,16 +866,16 @@ class Test$$Page extends React.Component {
<Button <Button
type="primary" type="primary"
htmlType="submit" htmlType="submit"
style={{ marginLeft: "0px", float: "right" }} style={{ marginLeft: '0px', float: 'right' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickPreSecond", relatedEventName: 'onClickPreSecond',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickPreSecond.apply( this.onClickPreSecond.apply(
@ -901,7 +899,7 @@ class Test$$Page extends React.Component {
align="left" align="left"
full={true} full={true}
flex={true} flex={true}
style={{ display: "flex", justifyContent: "center" }} style={{ display: 'flex', justifyContent: 'center' }}
> >
<Form <Form
labelCol={{ span: 10 }} labelCol={{ span: 10 }}
@ -914,25 +912,25 @@ class Test$$Page extends React.Component {
}.bind(this)} }.bind(this)}
name="basic" name="basic"
style={{ style={{
display: "flex", display: 'flex',
flexDirection: "column", flexDirection: 'column',
width: "600px", width: '600px',
justifyContent: "center", justifyContent: 'center',
}} }}
layout="vertical" layout="vertical"
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onFinishFailed", name: 'onFinishFailed',
relatedEventName: "onFinishFailed", relatedEventName: 'onFinishFailed',
}, },
], ],
eventList: [ eventList: [
{ name: "onFinish", disabled: false }, { name: 'onFinish', disabled: false },
{ name: "onFinishFailed", disabled: true }, { name: 'onFinishFailed', disabled: true },
{ name: "onFieldsChange", disabled: false }, { name: 'onFieldsChange', disabled: false },
{ name: "onValuesChange", disabled: false }, { name: 'onValuesChange', disabled: false },
], ],
}} }}
> >
@ -940,11 +938,11 @@ class Test$$Page extends React.Component {
<Steps <Steps
current={1} current={1}
style={{ style={{
width: "600px", width: '600px',
display: "flex", display: 'flex',
justifyContent: "space-around", justifyContent: 'space-around',
alignItems: "center", alignItems: 'center',
height: "300px", height: '300px',
}} }}
labelPlacement="horizontal" labelPlacement="horizontal"
direction="vertical" direction="vertical"
@ -952,35 +950,35 @@ class Test$$Page extends React.Component {
<Steps.Step <Steps.Step
title="提交完成" title="提交完成"
description="" description=""
style={{ width: "200px" }} style={{ width: '200px' }}
/> />
<Steps.Step <Steps.Step
title={__$$eval(() => this.state.thirdAuditText)} title={__$$eval(() => this.state.thirdAuditText)}
subTitle="" subTitle=""
description="" description=""
style={{ width: "200px" }} style={{ width: '200px' }}
/> />
</Steps> </Steps>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
wrapperCol={{ offset: "" }} wrapperCol={{ offset: '' }}
style={{ style={{
flexDirection: "row", flexDirection: 'row',
width: "600px", width: '600px',
display: "flex", display: 'flex',
}} }}
> >
<Button <Button
style={{ marginLeft: "0" }} style={{ marginLeft: '0' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickThirdBack", relatedEventName: 'onClickThirdBack',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickThirdBack.apply( this.onClickThirdBack.apply(
@ -994,16 +992,16 @@ class Test$$Page extends React.Component {
<Button <Button
type="primary" type="primary"
htmlType="submit" htmlType="submit"
style={{ float: "right", marginLeft: "20px" }} style={{ float: 'right', marginLeft: '20px' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickModifyThird", relatedEventName: 'onClickModifyThird',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickModifyThird.apply( this.onClickModifyThird.apply(
@ -1020,16 +1018,16 @@ class Test$$Page extends React.Component {
<Button <Button
type="primary" type="primary"
htmlType="submit" htmlType="submit"
style={{ marginLeft: "0px", float: "right" }} style={{ marginLeft: '0px', float: 'right' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onClickPreThird", relatedEventName: 'onClickPreThird',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onClickPreThird.apply( this.onClickPreThird.apply(

View File

@ -1,14 +1,14 @@
import Test from "@/pages/Test"; import Test from '@/pages/Test';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "", path: '',
component: Test, component: Test,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,8 +11,8 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-http-handler": "latest", "@alilc/lowcode-datasource-http-handler": "^1.0.0",
"@alilc/lowcode-components": "^1.0.0" "@alilc/lowcode-components": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,20 +1,20 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { Page, Table } from "@alilc/lowcode-components"; import { Page, Table } from '@alilc/lowcode-components';
import { createHttpHandler as __$$createHttpRequestHandler } from "@alilc/lowcode-datasource-http-handler"; import { createHttpHandler as __$$createHttpRequestHandler } from '@alilc/lowcode-datasource-http-handler';
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime"; import { create as __$$createDataSourceEngine } from '@alilc/lowcode-datasource-engine/runtime';
import utils from "../../utils"; import utils from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
class Example$$Page extends React.Component { class Example$$Page extends React.Component {
_context = this; _context = this;
@ -56,12 +56,12 @@ class Example$$Page extends React.Component {
return { return {
list: [ list: [
{ {
id: "userList", id: 'userList',
type: "http", type: 'http',
description: "用户列表", description: '用户列表',
options: function () { options: function () {
return { return {
uri: "https://api.example.com/user/list", uri: 'https://api.example.com/user/list',
}; };
}, },
isInit: function () { isInit: function () {
@ -82,10 +82,10 @@ class Example$$Page extends React.Component {
return ( return (
<div> <div>
<Table <Table
dataSource={__$$eval(() => this.dataSourceMap["userList"])} dataSource={__$$eval(() => this.dataSourceMap['userList'])}
columns={[ columns={[
{ dataIndex: "name", title: "姓名" }, { dataIndex: 'name', title: '姓名' },
{ dataIndex: "age", title: "年龄" }, { dataIndex: 'age', title: '年龄' },
]} ]}
/> />
</div> </div>

View File

@ -1,14 +1,14 @@
import Example from "@/pages/Example"; import Example from '@/pages/Example';
import BasicLayout from "@/layouts/BasicLayout"; import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [ children: [
{ {
path: "", path: '',
component: Example, component: Example,
}, },
], ],

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,8 +11,8 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"@alilc/lowcode-datasource-jsonp-handler": "latest", "@alilc/lowcode-datasource-jsonp-handler": "^1.0.0",
"@alifd/next": "1.19.18" "@alifd/next": "1.19.18"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,120 +0,0 @@
// : "__$$" 访
// react
import React from "react";
import { Switch } from "@alifd/next";
import { createJsonpHandler as __$$createJsonpRequestHandler } from "@alilc/lowcode-datasource-jsonp-handler";
import { create as __$$createDataSourceEngine } from "@alilc/lowcode-datasource-engine/runtime";
import utils from "../../utils";
import * as __$$i18n from "../../i18n";
import "./index.css";
class Index$$Page extends React.Component {
_context = this;
_dataSourceConfig = this._defineDataSourceConfig();
_dataSourceEngine = __$$createDataSourceEngine(this._dataSourceConfig, this, {
runtimeConfig: true,
requestHandlersMap: { jsonp: __$$createJsonpRequestHandler() },
});
get dataSourceMap() {
return this._dataSourceEngine.dataSourceMap || {};
}
reloadDataSource = async () => {
await this._dataSourceEngine.reloadDataSource();
};
constructor(props, context) {
super(props);
this.utils = utils;
__$$i18n._inject2(this);
this.state = {};
}
$ = () => null;
$$ = () => [];
_defineDataSourceConfig() {
const _this = this;
return {
list: [
{
id: "todos",
isInit: function () {
return true;
},
type: "jsonp",
options: function () {
return {
method: "GET",
uri: "https://a0ee9135-6a7f-4c0f-a215-f0f247ad907d.mock.pstmn.io",
};
},
dataHandler: function dataHandler(data) {
return data.data;
},
},
],
};
}
componentDidMount() {
this._dataSourceEngine.reloadDataSource();
}
render() {
const __$$context = this._context || this;
const { state } = __$$context;
return (
<div>
<div>
{__$$evalArray(() => this.dataSourceMap.todos.data).map(
(item, index) =>
((__$$context) => (
<div>
<Switch
checkedChildren="开"
unCheckedChildren="关"
checked={__$$eval(() => item.done)}
/>
</div>
))(__$$createChildContext(__$$context, { item, index }))
)}
</div>
</div>
);
}
}
export default Index$$Page;
function __$$eval(expr) {
try {
return expr();
} catch (error) {}
}
function __$$evalArray(expr) {
const res = __$$eval(expr);
return Array.isArray(res) ? res : [];
}
function __$$createChildContext(oldContext, ext) {
const childContext = {
...oldContext,
...ext,
};
childContext.__proto__ = oldContext;
return childContext;
}

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -0,0 +1,79 @@
// : "__$$" 访
// react
import React from 'react';
import { Switch } from '@alifd/next';
import utils from '../../utils';
import * as __$$i18n from '../../i18n';
import __$$constants from '../../constants';
import './index.css';
class $$Page extends React.Component {
_context = this;
get constants() {
return __$$constants || {};
}
constructor(props, context) {
super(props);
this.utils = utils;
__$$i18n._inject2(this);
this.state = {};
}
$ = () => null;
$$ = () => [];
componentDidMount() {}
render() {
const __$$context = this._context || this;
const { state } = __$$context;
return (
<div>
{__$$evalArray(() => this.dataSourceMap.todos.data).map((item, index) =>
((__$$context) => (
<div>
<Switch
checkedChildren="开"
unCheckedChildren="关"
checked={__$$eval(() => item.done)}
/>
</div>
))(__$$createChildContext(__$$context, { item, index }))
)}
</div>
);
}
}
export default $$Page;
function __$$eval(expr) {
try {
return expr();
} catch (error) {}
}
function __$$evalArray(expr) {
const res = __$$eval(expr);
return Array.isArray(res) ? res : [];
}
function __$$createChildContext(oldContext, ext) {
const childContext = {
...oldContext,
...ext,
};
childContext.__proto__ = oldContext;
return childContext;
}

View File

@ -1,10 +1,17 @@
import BasicLayout from "@/layouts/BasicLayout"; import $ from '@/pages/$';
import BasicLayout from '@/layouts/BasicLayout';
const routerConfig = [ const routerConfig = [
{ {
path: "/", path: '/',
component: BasicLayout, component: BasicLayout,
children: [], children: [
{
path: '',
component: $,
},
],
}, },
]; ];

View File

@ -1,4 +1,4 @@
import { createRef } from "react"; import { createRef } from 'react';
export class RefsManager { export class RefsManager {
constructor() { constructor() {

View File

@ -11,7 +11,7 @@
"intl-messageformat": "^9.3.6", "intl-messageformat": "^9.3.6",
"@ice/store": "^1.4.3", "@ice/store": "^1.4.3",
"@loadable/component": "^5.15.2", "@loadable/component": "^5.15.2",
"@alilc/lowcode-datasource-engine": "latest", "@alilc/lowcode-datasource-engine": "^1.0.0",
"undefined": "*", "undefined": "*",
"@alilc/antd-lowcode-materials": "0.9.4", "@alilc/antd-lowcode-materials": "0.9.4",
"@alife/mc-assets-1935": "0.1.42", "@alife/mc-assets-1935": "0.1.42",

View File

@ -1,11 +1,11 @@
import { createApp } from "ice"; import { createApp } from 'ice';
const appConfig = { const appConfig = {
app: { app: {
rootId: "app", rootId: 'app',
}, },
router: { router: {
type: "hash", type: 'hash',
}, },
}; };
createApp(appConfig); createApp(appConfig);

View File

@ -1,5 +1,5 @@
// 引入默认全局样式 // 引入默认全局样式
@import "@alifd/next/reset.scss"; @import '@alifd/next/reset.scss';
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,9 +1,9 @@
const i18nConfig = {}; const i18nConfig = {};
let locale = let locale =
typeof navigator === "object" && typeof navigator.language === "string" typeof navigator === 'object' && typeof navigator.language === 'string'
? navigator.language ? navigator.language
: "zh-CN"; : 'zh-CN';
const getLocale = () => locale; const getLocale = () => locale;
@ -13,22 +13,22 @@ const setLocale = (target) => {
const isEmptyVariables = (variables) => const isEmptyVariables = (variables) =>
(Array.isArray(variables) && variables.length === 0) || (Array.isArray(variables) && variables.length === 0) ||
(typeof variables === "object" && (typeof variables === 'object' &&
(!variables || Object.keys(variables).length === 0)); (!variables || Object.keys(variables).length === 0));
// 按低代码规范里面的要求进行变量替换 // 按低代码规范里面的要求进行变量替换
const format = (msg, variables) => const format = (msg, variables) =>
typeof msg === "string" typeof msg === 'string'
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "") ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
: msg; : msg;
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
const msg = const msg =
i18nConfig[locale]?.[id] ?? i18nConfig[locale]?.[id] ??
i18nConfig[locale.replace("-", "_")]?.[id] ?? i18nConfig[locale.replace('-', '_')]?.[id] ??
defaultMessage; defaultMessage;
if (msg == null) { if (msg == null) {
console.warn("[i18n]: unknown message id: %o (locale=%o)", id, locale); console.warn('[i18n]: unknown message id: %o (locale=%o)', id, locale);
return fallback === undefined ? `${id}` : fallback; return fallback === undefined ? `${id}` : fallback;
} }
@ -49,7 +49,7 @@ const _inject2 = (target) => {
}; };
target._i18nText = (t) => { target._i18nText = (t) => {
// 优先取直接传过来的语料 // 优先取直接传过来的语料
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")]; const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
if (localMsg != null) { if (localMsg != null) {
return format(localMsg, t.params); return format(localMsg, t.params);
} }
@ -61,7 +61,7 @@ const _inject2 = (target) => {
} }
// 兜底用 use 指定的或默认语言的 // 兜底用 use 指定的或默认语言的
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params); return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
}; };
// 注入到上下文中去 // 注入到上下文中去

View File

@ -1,6 +1,6 @@
// : "__$$" 访 // : "__$$" 访
// react // react
import React from "react"; import React from 'react';
import { import {
Modal, Modal,
@ -12,26 +12,26 @@ import {
ConfigProvider, ConfigProvider,
Tooltip, Tooltip,
Empty, Empty,
} from "@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js"; } from '@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js';
import { import {
AliAutoDiv, AliAutoDiv,
AliAutoSearchTable, AliAutoSearchTable,
} from "@alife/mc-assets-1935/build/lowcode/index.js"; } from '@alife/mc-assets-1935/build/lowcode/index.js';
import { import {
Page as NextPage, Page as NextPage,
Block as NextBlock, Block as NextBlock,
P as NextP, P as NextP,
} from "@alife/container/lib/index.js"; } from '@alife/container/lib/index.js';
import utils, { RefsManager } from "../../utils"; import utils, { RefsManager } from '../../utils';
import * as __$$i18n from "../../i18n"; import * as __$$i18n from '../../i18n';
import __$$constants from "../../constants"; import __$$constants from '../../constants';
import "./index.css"; import './index.css';
const AliAutoDivDefault = AliAutoDiv.default; const AliAutoDivDefault = AliAutoDiv.default;
@ -65,11 +65,12 @@ class Test$$Page extends React.Component {
}; };
this.__jp__init(); this.__jp__init();
this.statusDesc = { this.statusDesc = {
0: "失败", 0: '失败',
1: "成功", 1: '成功',
2: "构建中", 2: '构建中',
3: "构建超时", 3: '构建超时',
}; };
this.pageParams = {}; this.pageParams = {};
} }
@ -133,7 +134,7 @@ class Test$$Page extends React.Component {
} }
renderTime(time) { renderTime(time) {
return this.$utils.moment(time).format("YYYY-MM-DD HH:mm"); return this.$utils.moment(time).format('YYYY-MM-DD HH:mm');
} }
renderUserName(user) { renderUserName(user) {
@ -160,10 +161,11 @@ class Test$$Page extends React.Component {
formatResult(item) { formatResult(item) {
if (!item) { if (!item) {
return "暂无结果"; return '暂无结果';
} }
const { channel, plat, version, status } = item; const { channel, plat, version, status } = item;
return [channel, plat, version, status].join("-"); return [channel, plat, version, status].join('-');
} }
handleDownload() { handleDownload() {
@ -175,7 +177,7 @@ class Test$$Page extends React.Component {
} }
componentDidMount() { componentDidMount() {
this.$ds.resolve("PROJECTS", { this.$ds.resolve('PROJECTS', {
params: { params: {
size: 5000, size: 5000,
}, },
@ -192,8 +194,8 @@ class Test$$Page extends React.Component {
const { state } = __$$context; const { state } = __$$context;
return ( return (
<div <div
ref={this._refsManager.linkRef("outterView")} ref={this._refsManager.linkRef('outterView')}
style={{ height: "100%" }} style={{ height: '100%' }}
> >
<Modal <Modal
title="查看结果" title="查看结果"
@ -204,12 +206,12 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "onResultCancel", relatedEventName: 'onResultCancel',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.onResultCancel.apply( this.onResultCancel.apply(
@ -224,14 +226,14 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onCancel", name: 'onCancel',
relatedEventName: "onResultCancel", relatedEventName: 'onResultCancel',
}, },
], ],
eventList: [ eventList: [
{ name: "onCancel", disabled: true }, { name: 'onCancel', disabled: true },
{ name: "onOk", disabled: false }, { name: 'onOk', disabled: false },
], ],
}} }}
onCancel={function () { onCancel={function () {
@ -245,7 +247,7 @@ class Test$$Page extends React.Component {
> >
{__$$evalArray(() => this.state.results).map((item, index) => {__$$evalArray(() => this.state.results).map((item, index) =>
((__$$context) => ( ((__$$context) => (
<AliAutoDivDefault style={{ width: "100%" }}> <AliAutoDivDefault style={{ width: '100%' }}>
{!!__$$eval( {!!__$$eval(
() => () =>
__$$context.state.results && __$$context.state.results &&
@ -253,9 +255,9 @@ class Test$$Page extends React.Component {
) && ( ) && (
<AliAutoDivDefault <AliAutoDivDefault
style={{ style={{
width: "100%", width: '100%',
textAlign: "left", textAlign: 'left',
marginBottom: "10px", marginBottom: '10px',
}} }}
> >
<Button <Button
@ -264,12 +266,12 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "handleDownload", relatedEventName: 'handleDownload',
}, },
], ],
eventList: [{ name: "onClick", disabled: true }], eventList: [{ name: 'onClick', disabled: true }],
}} }}
onClick={function () { onClick={function () {
this.handleDownload.apply( this.handleDownload.apply(
@ -290,7 +292,7 @@ class Test$$Page extends React.Component {
href={__$$eval(() => item.download_link)} href={__$$eval(() => item.download_link)}
target="_blank" target="_blank"
> >
{" "} {' '}
- 点击下载 - 点击下载
</Typography.Link> </Typography.Link>
)} )}
@ -299,7 +301,7 @@ class Test$$Page extends React.Component {
href={__$$eval(() => item.release_notes)} href={__$$eval(() => item.release_notes)}
target="_blank" target="_blank"
> >
{" "} {' '}
- 跳转发布节点 - 跳转发布节点
</Typography.Link> </Typography.Link>
)} )}
@ -310,16 +312,16 @@ class Test$$Page extends React.Component {
<NextPage <NextPage
columns={12} columns={12}
headerDivider={true} headerDivider={true}
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }} placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
placeholder="页面主体内容拖拽Block布局组件到这里" placeholder="页面主体内容拖拽Block布局组件到这里"
header={null} header={null}
headerProps={{ background: "surface" }} headerProps={{ background: 'surface' }}
footer={null} footer={null}
minHeight="100vh" minHeight="100vh"
> >
<NextBlock <NextBlock
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
noPadding={false} noPadding={false}
noBorder={false} noBorder={false}
background="surface" background="surface"
@ -331,7 +333,7 @@ class Test$$Page extends React.Component {
<NextBlockCell <NextBlockCell
title="" title=""
prefix="next-" prefix="next-"
placeholderStyle={{ height: "100%" }} placeholderStyle={{ height: '100%' }}
layoutmode="O" layoutmode="O"
childTotalColumns={12} childTotalColumns={12}
isAutoContainer={true} isAutoContainer={true}
@ -361,22 +363,22 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onFinish", name: 'onFinish',
relatedEventName: "onFinish", relatedEventName: 'onFinish',
}, },
], ],
eventList: [ eventList: [
{ name: "onFinish", disabled: true }, { name: 'onFinish', disabled: true },
{ name: "onFinishFailed", disabled: false }, { name: 'onFinishFailed', disabled: false },
{ name: "onFieldsChange", disabled: false }, { name: 'onFieldsChange', disabled: false },
{ name: "onValuesChange", disabled: false }, { name: 'onValuesChange', disabled: false },
], ],
}} }}
> >
<Form.Item label="项目名称/渠道号" name="channel_id"> <Form.Item label="项目名称/渠道号" name="channel_id">
<Select <Select
style={{ width: "280px" }} style={{ width: '280px' }}
options={__$$eval(() => this.state.projects)} options={__$$eval(() => this.state.projects)}
showArrow={true} showArrow={true}
tokenSeparators={[]} tokenSeparators={[]}
@ -386,7 +388,7 @@ class Test$$Page extends React.Component {
<Form.Item label="版本号" name="buildId"> <Form.Item label="版本号" name="buildId">
<Input <Input
placeholder="请输入" placeholder="请输入"
style={{ width: "280px" }} style={{ width: '280px' }}
size="middle" size="middle"
/> />
</Form.Item> </Form.Item>
@ -394,15 +396,15 @@ class Test$$Page extends React.Component {
<Select <Select
style={{ width: 200 }} style={{ width: 200 }}
options={[ options={[
{ label: "A", value: "A" }, { label: 'A', value: 'A' },
{ label: "B", value: "B" }, { label: 'B', value: 'B' },
{ label: "C", value: "C" }, { label: 'C', value: 'C' },
]} ]}
showSearch={true} showSearch={true}
/> />
</Form.Item> </Form.Item>
<Form.Item label="ID" name="id"> <Form.Item label="ID" name="id">
<Input placeholder="请输入" style={{ width: "160px" }} /> <Input placeholder="请输入" style={{ width: '160px' }} />
</Form.Item> </Form.Item>
<Form.Item wrapperCol={{ offset: 6 }}> <Form.Item wrapperCol={{ offset: 6 }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
@ -434,23 +436,23 @@ class Test$$Page extends React.Component {
dataSource={__$$eval(() => this.state.pkgs)} dataSource={__$$eval(() => this.state.pkgs)}
columns={[ columns={[
{ {
title: "ID", title: 'ID',
dataIndex: "id", dataIndex: 'id',
key: "name", key: 'name',
width: 80, width: 80,
}, },
{ {
title: "渠道号", title: '渠道号',
dataIndex: "channels", dataIndex: 'channels',
key: "age", key: 'age',
width: 142, width: 142,
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => ((__$$context) =>
__$$evalArray(() => text.split(",")).map( __$$evalArray(() => text.split(',')).map(
(item, index) => (item, index) =>
((__$$context) => ( ((__$$context) => (
<Typography.Text <Typography.Text
style={{ display: "block" }} style={{ display: 'block' }}
> >
{__$$eval(() => item)} {__$$eval(() => item)}
</Typography.Text> </Typography.Text>
@ -469,9 +471,9 @@ class Test$$Page extends React.Component {
), ),
}, },
{ {
title: "版本号", title: '版本号',
dataIndex: "dic_version", dataIndex: 'dic_version',
key: "address", key: 'address',
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => ( ((__$$context) => (
<Tooltip <Tooltip
@ -480,14 +482,14 @@ class Test$$Page extends React.Component {
((__$$context) => ( ((__$$context) => (
<Typography.Text <Typography.Text
style={{ style={{
display: "block", display: 'block',
color: "#FFFFFF", color: '#FFFFFF',
}} }}
> >
{__$$eval( {__$$eval(
() => () =>
item.channelId + item.channelId +
" / " + ' / ' +
item.version item.version
)} )}
</Typography.Text> </Typography.Text>
@ -512,15 +514,15 @@ class Test$$Page extends React.Component {
), ),
width: 120, width: 120,
}, },
{ title: "构建Job", dataIndex: "job_name", width: 180 }, { title: '构建Job', dataIndex: 'job_name', width: 180 },
{ {
title: "构建类型", title: '构建类型',
dataIndex: "packaging_type", dataIndex: 'packaging_type',
width: 94, width: 94,
}, },
{ {
title: "构建状态", title: '构建状态',
dataIndex: "status", dataIndex: 'status',
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => [ ((__$$context) => [
<Typography.Text> <Typography.Text>
@ -531,7 +533,7 @@ class Test$$Page extends React.Component {
type="SyncOutlined" type="SyncOutlined"
size={16} size={16}
spin={true} spin={true}
style={{ marginLeft: "10px" }} style={{ marginLeft: '10px' }}
/> />
), ),
])( ])(
@ -544,8 +546,8 @@ class Test$$Page extends React.Component {
width: 100, width: 100,
}, },
{ {
title: "构建时间", title: '构建时间',
dataIndex: "start_time", dataIndex: 'start_time',
render: function () { render: function () {
return this.renderTime.apply( return this.renderTime.apply(
this, this,
@ -555,8 +557,8 @@ class Test$$Page extends React.Component {
width: 148, width: 148,
}, },
{ {
title: "构建人", title: '构建人',
dataIndex: "user", dataIndex: 'user',
render: function () { render: function () {
return this.renderUserName.apply( return this.renderUserName.apply(
this, this,
@ -566,8 +568,8 @@ class Test$$Page extends React.Component {
width: 80, width: 80,
}, },
{ {
title: "Jenkins 链接", title: 'Jenkins 链接',
dataIndex: "jenkins_link", dataIndex: 'jenkins_link',
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => [ ((__$$context) => [
!!__$$eval(() => text) && ( !!__$$eval(() => text) && (
@ -591,8 +593,8 @@ class Test$$Page extends React.Component {
width: 120, width: 120,
}, },
{ {
title: "测试平台链接", title: '测试平台链接',
dataIndex: "is_run_testing", dataIndex: 'is_run_testing',
width: 120, width: 120,
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => [ ((__$$context) => [
@ -615,26 +617,26 @@ class Test$$Page extends React.Component {
}) })
), ),
}, },
{ title: "触发源", dataIndex: "source", width: 120 }, { title: '触发源', dataIndex: 'source', width: 120 },
{ {
title: "详情", title: '详情',
dataIndex: "id", dataIndex: 'id',
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => ( ((__$$context) => (
<Button <Button
type="link" type="link"
size="small" size="small"
style={{ padding: "0px" }} style={{ padding: '0px' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "handleDetail", relatedEventName: 'handleDetail',
}, },
], ],
eventList: [ eventList: [
{ name: "onClick", disabled: true }, { name: 'onClick', disabled: true },
], ],
}} }}
onClick={function () { onClick={function () {
@ -656,28 +658,28 @@ class Test$$Page extends React.Component {
}) })
), ),
width: 80, width: 80,
fixed: "right", fixed: 'right',
}, },
{ {
title: "结果", title: '结果',
dataIndex: "id", dataIndex: 'id',
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => ( ((__$$context) => (
<Button <Button
type="link" type="link"
size="small" size="small"
style={{ padding: "0px" }} style={{ padding: '0px' }}
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "handleResult", relatedEventName: 'handleResult',
paramStr: "this.text", paramStr: 'this.text',
}, },
], ],
eventList: [ eventList: [
{ name: "onClick", disabled: true }, { name: 'onClick', disabled: true },
], ],
}} }}
onClick={function () { onClick={function () {
@ -701,11 +703,11 @@ class Test$$Page extends React.Component {
}) })
), ),
width: 80, width: 80,
fixed: "right", fixed: 'right',
}, },
{ {
title: "重新执行", title: '重新执行',
dataIndex: "id", dataIndex: 'id',
width: 92, width: 92,
render: (text, record, index) => render: (text, record, index) =>
((__$$context) => ( ((__$$context) => (
@ -718,11 +720,11 @@ class Test$$Page extends React.Component {
size={14} size={14}
color="#0593d3" color="#0593d3"
style={{ style={{
padding: "3px", padding: '3px',
border: "1px solid #0593d3", border: '1px solid #0593d3',
borderRadius: "14px", borderRadius: '14px',
cursor: "pointer", cursor: 'pointer',
height: "22px", height: '22px',
}} }}
spin={false} spin={false}
/> />
@ -731,13 +733,13 @@ class Test$$Page extends React.Component {
__events={{ __events={{
eventDataList: [ eventDataList: [
{ {
type: "componentEvent", type: 'componentEvent',
name: "onClick", name: 'onClick',
relatedEventName: "reload", relatedEventName: 'reload',
}, },
], ],
eventList: [ eventList: [
{ name: "onClick", disabled: true }, { name: 'onClick', disabled: true },
], ],
}} }}
onClick={function () { onClick={function () {
@ -756,7 +758,7 @@ class Test$$Page extends React.Component {
index, index,
}) })
), ),
fixed: "right", fixed: 'right',
}, },
]} ]}
actions={[]} actions={[]}

Some files were not shown because too many files have changed in this diff Show More