mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-26 03:48:12 +00:00
chore: update UT snapshots of CodeGenerator
This commit is contained in:
parent
2bd40d7589
commit
9cb4f0bd79
@ -19,7 +19,7 @@ describe(testCaseBaseName, () => {
|
||||
`
|
||||
<Greetings
|
||||
content={this._i18nText({
|
||||
key: "greetings.hello",
|
||||
key: 'greetings.hello',
|
||||
params: { name: this.state.name },
|
||||
})}
|
||||
/>
|
||||
|
||||
@ -27,7 +27,7 @@ describe(testCaseBaseName, () => {
|
||||
});
|
||||
|
||||
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 () => {
|
||||
@ -47,7 +47,7 @@ describe(testCaseBaseName, () => {
|
||||
|
||||
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
|
||||
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');
|
||||
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');
|
||||
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 () => {
|
||||
@ -107,9 +107,9 @@ describe(testCaseBaseName, () => {
|
||||
});
|
||||
|
||||
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 () => {
|
||||
@ -129,10 +129,10 @@ describe(testCaseBaseName, () => {
|
||||
|
||||
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
|
||||
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 () => {
|
||||
@ -152,10 +152,10 @@ describe(testCaseBaseName, () => {
|
||||
|
||||
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
|
||||
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 () => {
|
||||
@ -187,11 +187,11 @@ describe(testCaseBaseName, () => {
|
||||
});
|
||||
|
||||
const generatedPageFileContent = readOutputTextFile('demo-project/src/pages/Test/index.jsx');
|
||||
expect(generatedPageFileContent).toContain(`import Foo from "example-package";`);
|
||||
expect(generatedPageFileContent).toContain(`import Baz from "example-package";`);
|
||||
expect(generatedPageFileContent).toContain('import Foo from \'example-package\';');
|
||||
expect(generatedPageFileContent).toContain('import Baz from \'example-package\';');
|
||||
|
||||
expect(generatedPageFileContent).not.toContain(`const Foo =`);
|
||||
expect(generatedPageFileContent).not.toContain(`const Baz =`);
|
||||
expect(generatedPageFileContent).not.toContain('const Foo =');
|
||||
expect(generatedPageFileContent).not.toContain('const Baz =');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ test(testCaseBaseName, async () => {
|
||||
Button,
|
||||
Typography,
|
||||
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) {
|
||||
|
||||
@ -19,15 +19,15 @@ test(testCaseBaseName, async () => {
|
||||
|
||||
// 里面有的数据源则应该生成对应的 dependencies
|
||||
expect(generatedPackageJson.dependencies).toMatchObject({
|
||||
'@alilc/lowcode-datasource-engine': 'latest',
|
||||
'@alilc/lowcode-datasource-fetch-handler': 'latest',
|
||||
'@alilc/lowcode-datasource-engine': '^1.0.0',
|
||||
'@alilc/lowcode-datasource-fetch-handler': '^1.0.0',
|
||||
});
|
||||
|
||||
// 里面没有的,则不应该生成对应的 dependencies
|
||||
expect(generatedPackageJson.dependencies).not.toMatchObject({
|
||||
'@alilc/lowcode-datasource-url-params-handler': 'latest',
|
||||
'@alilc/lowcode-datasource-mtop-handler': 'latest',
|
||||
'@alilc/lowcode-datasource-mopen-handler': 'latest',
|
||||
'@alilc/lowcode-datasource-url-params-handler': '^1.0.0',
|
||||
'@alilc/lowcode-datasource-mtop-handler': '^1.0.0',
|
||||
'@alilc/lowcode-datasource-mopen-handler': '^1.0.0',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "latest",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -253,6 +253,7 @@ class Home$$Page extends Component {
|
||||
if (!response.success) {
|
||||
throw new Error(response.message);
|
||||
}
|
||||
|
||||
return response.data;
|
||||
},
|
||||
isInit: true,
|
||||
@ -279,6 +280,7 @@ class Home$$Page extends Component {
|
||||
if (!response.success) {
|
||||
throw new Error(response.message);
|
||||
}
|
||||
|
||||
return response.data.result;
|
||||
},
|
||||
isInit: true,
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
"lint": "npm run eslint && npm run stylelint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-http-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-http-handler": "^1.0.0",
|
||||
"universal-env": "^3.2.0",
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"rax": "^1.1.0",
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "latest",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
|
||||
"@alifd/next": "1.19.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" };
|
||||
const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
|
||||
|
||||
export default __$$constants;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外: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 {
|
||||
_context = this;
|
||||
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
|
||||
|
||||
__$$i18n._inject2(this);
|
||||
|
||||
this.state = { text: "outter" };
|
||||
this.state = { text: 'outter' };
|
||||
}
|
||||
|
||||
$ = (refName) => {
|
||||
@ -67,8 +67,8 @@ class Test$$Page extends React.Component {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: "urlParams",
|
||||
type: "urlParams",
|
||||
id: 'urlParams',
|
||||
type: 'urlParams',
|
||||
isInit: function () {
|
||||
return undefined;
|
||||
},
|
||||
@ -77,12 +77,12 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "user",
|
||||
type: "fetch",
|
||||
id: 'user',
|
||||
type: 'fetch',
|
||||
options: function () {
|
||||
return {
|
||||
method: "GET",
|
||||
uri: "https://shs.xxx.com/mock/1458/demo/user",
|
||||
method: 'GET',
|
||||
uri: 'https://shs.xxx.com/mock/1458/demo/user',
|
||||
isSync: true,
|
||||
};
|
||||
},
|
||||
@ -90,6 +90,7 @@ class Test$$Page extends React.Component {
|
||||
if (!response.data.success) {
|
||||
throw new Error(response.data.message);
|
||||
}
|
||||
|
||||
return response.data.data;
|
||||
},
|
||||
isInit: function () {
|
||||
@ -97,12 +98,12 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "orders",
|
||||
type: "fetch",
|
||||
id: 'orders',
|
||||
type: 'fetch',
|
||||
options: function () {
|
||||
return {
|
||||
method: "GET",
|
||||
uri: "https://shs.xxx.com/mock/1458/demo/orders",
|
||||
method: 'GET',
|
||||
uri: 'https://shs.xxx.com/mock/1458/demo/orders',
|
||||
isSync: true,
|
||||
};
|
||||
},
|
||||
@ -110,6 +111,7 @@ class Test$$Page extends React.Component {
|
||||
if (!response.data.success) {
|
||||
throw new Error(response.data.message);
|
||||
}
|
||||
|
||||
return response.data.data.result;
|
||||
},
|
||||
isInit: function () {
|
||||
@ -118,7 +120,7 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
],
|
||||
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() {
|
||||
this._dataSourceEngine.reloadDataSource();
|
||||
|
||||
console.log("componentDidMount");
|
||||
console.log('componentDidMount');
|
||||
}
|
||||
|
||||
render() {
|
||||
const __$$context = this._context || this;
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}>
|
||||
<div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
|
||||
<Form
|
||||
labelCol={__$$eval(() => this.state.colNum)}
|
||||
style={{}}
|
||||
ref={this._refsManager.linkRef("testForm")}
|
||||
ref={this._refsManager.linkRef('testForm')}
|
||||
>
|
||||
<Form.Item label="姓名:" name="name" initValue="李雷">
|
||||
<Input placeholder="请输入" size="medium" style={{ width: 320 }} />
|
||||
@ -148,18 +150,18 @@ class Test$$Page extends React.Component {
|
||||
<Form.Item label="职业:" name="profession">
|
||||
<Select
|
||||
dataSource={[
|
||||
{ label: "教师", value: "t" },
|
||||
{ label: "医生", value: "d" },
|
||||
{ label: "歌手", value: "s" },
|
||||
{ label: '教师', value: 't' },
|
||||
{ label: '医生', value: 'd' },
|
||||
{ label: '歌手', value: 's' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<Button.Group>
|
||||
{__$$evalArray(() => ["a", "b", "c"]).map((item, index) =>
|
||||
{__$$evalArray(() => ['a', 'b', 'c']).map((item, index) =>
|
||||
((__$$context) =>
|
||||
!!__$$eval(() => index >= 1) && (
|
||||
<Button type="primary" style={{ margin: "0 5px 0 5px" }}>
|
||||
<Button type="primary" style={{ margin: '0 5px 0 5px' }}>
|
||||
{__$$eval(() => item)}
|
||||
</Button>
|
||||
))(__$$createChildContext(__$$context, { item, index }))
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
|
||||
"@alilc/b6-page": "^0.1.0",
|
||||
"@alilc/b6-text": "^0.1.0",
|
||||
"@alilc/b6-compact-legao-builtin": "1.x",
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外: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 {
|
||||
_context = this;
|
||||
@ -60,12 +60,12 @@ class Aaaa$$Page extends React.Component {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: "urlParams",
|
||||
type: "urlParams",
|
||||
description: "URL参数",
|
||||
id: 'urlParams',
|
||||
type: 'urlParams',
|
||||
description: 'URL参数',
|
||||
options: function () {
|
||||
return {
|
||||
uri: "",
|
||||
uri: '',
|
||||
};
|
||||
},
|
||||
isInit: function () {
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "/aaaa",
|
||||
path: '/aaaa',
|
||||
component: Aaaa,
|
||||
},
|
||||
],
|
||||
|
||||
@ -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 {
|
||||
constructor() {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alifd/next": "1.19.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" };
|
||||
const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
|
||||
|
||||
export default __$$constants;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
const i18nConfig = {
|
||||
"zh-CN": {
|
||||
"i18n-jwg27yo4": "你好",
|
||||
"i18n-jwg27yo3": "中国",
|
||||
'zh-CN': {
|
||||
'i18n-jwg27yo4': '你好',
|
||||
'i18n-jwg27yo3': '中国',
|
||||
},
|
||||
"en-US": {
|
||||
"i18n-jwg27yo4": "Hello",
|
||||
"i18n-jwg27yo3": "China",
|
||||
'en-US': {
|
||||
'i18n-jwg27yo4': 'Hello',
|
||||
'i18n-jwg27yo3': 'China',
|
||||
},
|
||||
};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -22,22 +22,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -70,7 +70,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外: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 {
|
||||
_context = this;
|
||||
@ -28,7 +28,7 @@ class Test$$Page extends React.Component {
|
||||
|
||||
__$$i18n._inject2(this);
|
||||
|
||||
this.state = { text: "outter" };
|
||||
this.state = { text: 'outter' };
|
||||
}
|
||||
|
||||
$ = (refName) => {
|
||||
@ -40,21 +40,21 @@ class Test$$Page extends React.Component {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
console.log("componentDidMount");
|
||||
console.log('componentDidMount');
|
||||
}
|
||||
|
||||
render() {
|
||||
const __$$context = this._context || this;
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}>
|
||||
<div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
|
||||
<Form
|
||||
labelCol={__$$eval(() => this.state.colNum)}
|
||||
style={{}}
|
||||
ref={this._refsManager.linkRef("testForm")}
|
||||
ref={this._refsManager.linkRef('testForm')}
|
||||
>
|
||||
<Form.Item
|
||||
label={__$$eval(() => this.i18n("i18n-jwg27yo4"))}
|
||||
label={__$$eval(() => this.i18n('i18n-jwg27yo4'))}
|
||||
name="name"
|
||||
initValue="李雷"
|
||||
>
|
||||
@ -66,24 +66,24 @@ class Test$$Page extends React.Component {
|
||||
<Form.Item label="职业:" name="profession">
|
||||
<Select
|
||||
dataSource={[
|
||||
{ label: "教师", value: "t" },
|
||||
{ label: "医生", value: "d" },
|
||||
{ label: "歌手", value: "s" },
|
||||
{ label: '教师', value: 't' },
|
||||
{ label: '医生', value: 'd' },
|
||||
{ label: '歌手', value: 's' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<Button.Group>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ margin: "0 5px 0 5px" }}
|
||||
style={{ margin: '0 5px 0 5px' }}
|
||||
htmlType="submit"
|
||||
>
|
||||
提交
|
||||
</Button>
|
||||
<Button
|
||||
type="normal"
|
||||
style={{ margin: "0 5px 0 5px" }}
|
||||
style={{ margin: '0 5px 0 5px' }}
|
||||
htmlType="reset"
|
||||
>
|
||||
重置
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alifd/next": "1.19.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" };
|
||||
const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
|
||||
|
||||
export default __$$constants;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
const i18nConfig = {
|
||||
"zh-CN": {
|
||||
"i18n-jwg27yo4": "你好",
|
||||
"i18n-jwg27yo3": "中国",
|
||||
'zh-CN': {
|
||||
'i18n-jwg27yo4': '你好',
|
||||
'i18n-jwg27yo3': '中国',
|
||||
},
|
||||
"en-US": {
|
||||
"i18n-jwg27yo4": "Hello",
|
||||
"i18n-jwg27yo3": "China",
|
||||
'en-US': {
|
||||
'i18n-jwg27yo4': 'Hello',
|
||||
'i18n-jwg27yo3': 'China',
|
||||
},
|
||||
};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -22,22 +22,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -70,7 +70,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外:react 框架的导出名和各种组件名除外。
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
import Super, {
|
||||
Button,
|
||||
@ -9,17 +9,17 @@ import Super, {
|
||||
NumberPicker,
|
||||
Select,
|
||||
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;
|
||||
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "latest",
|
||||
"@alife/container": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
|
||||
"@alife/container": "^1.0.0",
|
||||
"@alife/mc-assets-1935": "0.1.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,27 +1,27 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外:react 框架的导出名和各种组件名除外。
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Page as NextPage,
|
||||
Block as NextBlock,
|
||||
P as NextP,
|
||||
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;
|
||||
|
||||
@ -57,7 +57,7 @@ class Test$$Page extends React.Component {
|
||||
|
||||
__$$i18n._inject2(this);
|
||||
|
||||
this.state = { text: "outter", isShowDialog: false };
|
||||
this.state = { text: 'outter', isShowDialog: false };
|
||||
}
|
||||
|
||||
$ = (refName) => {
|
||||
@ -73,28 +73,28 @@ class Test$$Page extends React.Component {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
type: "fetch",
|
||||
type: 'fetch',
|
||||
isInit: function () {
|
||||
return true;
|
||||
},
|
||||
options: function () {
|
||||
return {
|
||||
params: {},
|
||||
method: "GET",
|
||||
method: 'GET',
|
||||
isCors: true,
|
||||
timeout: 5000,
|
||||
headers: {},
|
||||
uri: "https://mocks.xxx.com/mock/jjpin/user/list",
|
||||
uri: 'https://mocks.xxx.com/mock/jjpin/user/list',
|
||||
};
|
||||
},
|
||||
id: "users",
|
||||
id: 'users',
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
console.log("will umount");
|
||||
console.log('will umount');
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||
@ -102,7 +102,7 @@ class Test$$Page extends React.Component {
|
||||
}
|
||||
|
||||
testFunc() {
|
||||
console.log("test func");
|
||||
console.log('test func');
|
||||
}
|
||||
|
||||
onClick() {
|
||||
@ -118,13 +118,13 @@ class Test$$Page extends React.Component {
|
||||
}
|
||||
|
||||
onSearch(values) {
|
||||
console.log("search form:", values);
|
||||
console.log('search form:', values);
|
||||
console.log(this.dataSourceMap);
|
||||
this.dataSourceMap["users"].load(values);
|
||||
this.dataSourceMap['users'].load(values);
|
||||
}
|
||||
|
||||
onClear() {
|
||||
console.log("form reset");
|
||||
console.log('form reset');
|
||||
this.setState({
|
||||
isShowDialog: true,
|
||||
});
|
||||
@ -137,7 +137,7 @@ class Test$$Page extends React.Component {
|
||||
componentDidMount() {
|
||||
this._dataSourceEngine.reloadDataSource();
|
||||
|
||||
console.log("did mount");
|
||||
console.log('did mount');
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -145,12 +145,12 @@ class Test$$Page extends React.Component {
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div
|
||||
ref={this._refsManager.linkRef("outterView")}
|
||||
style={{ height: "100%" }}
|
||||
ref={this._refsManager.linkRef('outterView')}
|
||||
style={{ height: '100%' }}
|
||||
>
|
||||
<NextPage
|
||||
columns={12}
|
||||
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }}
|
||||
placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
|
||||
placeholder="页面主体内容:拖拽Block布局组件到这里"
|
||||
header={
|
||||
<NextP
|
||||
@ -165,13 +165,13 @@ class Test$$Page extends React.Component {
|
||||
</NextP>
|
||||
}
|
||||
headerTest={[]}
|
||||
headerProps={{ background: "surface" }}
|
||||
headerProps={{ background: 'surface' }}
|
||||
footer={null}
|
||||
minHeight="100vh"
|
||||
>
|
||||
<NextBlock
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
noPadding={false}
|
||||
noBorder={false}
|
||||
background="surface"
|
||||
@ -183,7 +183,7 @@ class Test$$Page extends React.Component {
|
||||
title=""
|
||||
primaryKey="732"
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
colSpan={1}
|
||||
rowSpan={1}
|
||||
>
|
||||
@ -199,13 +199,13 @@ class Test$$Page extends React.Component {
|
||||
dataSource={__$$eval(() => this.state.users.data)}
|
||||
rowKey="workid"
|
||||
columns={[
|
||||
{ title: "花名", dataIndex: "cname" },
|
||||
{ title: "user_id", dataIndex: "workid" },
|
||||
{ title: "部门", dataIndex: "dep" },
|
||||
{ title: '花名', dataIndex: 'cname' },
|
||||
{ title: 'user_id', dataIndex: 'workid' },
|
||||
{ title: '部门', dataIndex: 'dep' },
|
||||
]}
|
||||
searchItems={[
|
||||
{ label: "姓名", name: "cname" },
|
||||
{ label: "部门", name: "dep" },
|
||||
{ label: '姓名', name: 'cname' },
|
||||
{ label: '部门', name: 'dep' },
|
||||
]}
|
||||
onSearch={function () {
|
||||
return this.onSearch.apply(
|
||||
@ -220,7 +220,7 @@ class Test$$Page extends React.Component {
|
||||
);
|
||||
}.bind(this)}
|
||||
pagination={{
|
||||
defaultPageSize: "",
|
||||
defaultPageSize: '',
|
||||
onPageChange: function () {
|
||||
return this.onPageChange.apply(
|
||||
this,
|
||||
@ -237,16 +237,16 @@ class Test$$Page extends React.Component {
|
||||
<NextPage
|
||||
columns={12}
|
||||
headerDivider={true}
|
||||
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }}
|
||||
placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
|
||||
placeholder="页面主体内容:拖拽Block布局组件到这里"
|
||||
header={null}
|
||||
headerProps={{ background: "surface" }}
|
||||
headerProps={{ background: 'surface' }}
|
||||
footer={null}
|
||||
minHeight="100vh"
|
||||
>
|
||||
<NextBlock
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
noPadding={false}
|
||||
noBorder={false}
|
||||
background="surface"
|
||||
@ -258,7 +258,7 @@ class Test$$Page extends React.Component {
|
||||
title=""
|
||||
primaryKey="472"
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
colSpan={1}
|
||||
rowSpan={1}
|
||||
/>
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
path: '',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"package": "@alife/container",
|
||||
"version": "latest",
|
||||
"version": "^1.0.0",
|
||||
"exportName": "P",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": true,
|
||||
@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"package": "@alife/container",
|
||||
"version": "latest",
|
||||
"version": "^1.0.0",
|
||||
"exportName": "Block",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": true,
|
||||
@ -30,7 +30,7 @@
|
||||
},
|
||||
{
|
||||
"package": "@alife/container",
|
||||
"version": "latest",
|
||||
"version": "^1.0.0",
|
||||
"exportName": "Block",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": true,
|
||||
@ -39,7 +39,7 @@
|
||||
},
|
||||
{
|
||||
"package": "@alife/container",
|
||||
"version": "latest",
|
||||
"version": "^1.0.0",
|
||||
"exportName": "Text",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": true,
|
||||
@ -48,7 +48,7 @@
|
||||
},
|
||||
{
|
||||
"package": "@alife/container",
|
||||
"version": "latest",
|
||||
"version": "^1.0.0",
|
||||
"exportName": "Page",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": true,
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"undefined": "*",
|
||||
"@alife/container": "0.3.7",
|
||||
"@alilc/antd-lowcode": "0.5.4",
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外:react 框架的导出名和各种组件名除外。
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Page as NextPage,
|
||||
Block as NextBlock,
|
||||
P as NextP,
|
||||
} from "@alife/container/lib/index.js";
|
||||
} from '@alife/container/lib/index.js';
|
||||
|
||||
import {
|
||||
Card,
|
||||
@ -18,17 +18,17 @@ import {
|
||||
Form,
|
||||
InputNumber,
|
||||
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;
|
||||
|
||||
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
|
||||
__$$i18n._inject2(this);
|
||||
|
||||
this.state = {
|
||||
name: "nongzhou",
|
||||
name: 'nongzhou',
|
||||
gateways: [],
|
||||
selectedGateway: null,
|
||||
records: [],
|
||||
@ -102,23 +102,23 @@ class Test$$Page extends React.Component {
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div
|
||||
ref={this._refsManager.linkRef("outterView")}
|
||||
style={{ height: "100%" }}
|
||||
ref={this._refsManager.linkRef('outterView')}
|
||||
style={{ height: '100%' }}
|
||||
>
|
||||
<NextPage
|
||||
columns={12}
|
||||
headerDivider={true}
|
||||
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }}
|
||||
placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
|
||||
placeholder="页面主体内容:拖拽Block布局组件到这里"
|
||||
header={null}
|
||||
headerProps={{ background: "surface" }}
|
||||
headerProps={{ background: 'surface' }}
|
||||
footer={null}
|
||||
minHeight="100vh"
|
||||
style={{ cursor: "pointer" }}
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
<NextBlock
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
noPadding={false}
|
||||
noBorder={false}
|
||||
background="surface"
|
||||
@ -130,7 +130,7 @@ class Test$$Page extends React.Component {
|
||||
<NextBlockCell
|
||||
title=""
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
layoutmode="O"
|
||||
childTotalColumns={12}
|
||||
isAutoContainer={true}
|
||||
@ -151,16 +151,16 @@ class Test$$Page extends React.Component {
|
||||
<Typography.Text>所在网关:</Typography.Text>
|
||||
<Select
|
||||
style={{
|
||||
marginTop: "16px",
|
||||
marginRight: "16px",
|
||||
marginBottom: "16px",
|
||||
marginLeft: "16px",
|
||||
width: "400px",
|
||||
display: "inline-block",
|
||||
marginTop: '16px',
|
||||
marginRight: '16px',
|
||||
marginBottom: '16px',
|
||||
marginLeft: '16px',
|
||||
width: '400px',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
options={__$$eval(() => this.state.gateways)}
|
||||
mode="single"
|
||||
defaultValue={["auto-edd-uniproxy"]}
|
||||
defaultValue={['auto-edd-uniproxy']}
|
||||
labelInValue={true}
|
||||
showSearch={true}
|
||||
allowClear={false}
|
||||
@ -171,23 +171,23 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onChange",
|
||||
relatedEventName: "onChange",
|
||||
type: 'componentEvent',
|
||||
name: 'onChange',
|
||||
relatedEventName: 'onChange',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onBlur", disabled: false },
|
||||
{ name: "onChange", disabled: true },
|
||||
{ name: "onDeselect", disabled: false },
|
||||
{ name: "onFocus", disabled: false },
|
||||
{ name: "onInputKeyDown", disabled: false },
|
||||
{ name: "onMouseEnter", disabled: false },
|
||||
{ name: "onMouseLeave", disabled: false },
|
||||
{ name: "onPopupScroll", disabled: false },
|
||||
{ name: "onSearch", disabled: false },
|
||||
{ name: "onSelect", disabled: false },
|
||||
{ name: "onDropdownVisibleChange", disabled: false },
|
||||
{ name: 'onBlur', disabled: false },
|
||||
{ name: 'onChange', disabled: true },
|
||||
{ name: 'onDeselect', disabled: false },
|
||||
{ name: 'onFocus', disabled: false },
|
||||
{ name: 'onInputKeyDown', disabled: false },
|
||||
{ name: 'onMouseEnter', disabled: false },
|
||||
{ name: 'onMouseLeave', disabled: false },
|
||||
{ name: 'onPopupScroll', disabled: false },
|
||||
{ name: 'onSearch', disabled: false },
|
||||
{ name: 'onSelect', disabled: false },
|
||||
{ name: 'onDropdownVisibleChange', disabled: false },
|
||||
],
|
||||
}}
|
||||
onChange={function () {
|
||||
@ -201,19 +201,19 @@ class Test$$Page extends React.Component {
|
||||
<Button
|
||||
type="primary"
|
||||
style={{
|
||||
display: "block",
|
||||
marginTop: "20px",
|
||||
marginBottom: "20px",
|
||||
display: 'block',
|
||||
marginTop: '20px',
|
||||
marginBottom: '20px',
|
||||
}}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onCreateOrder",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onCreateOrder',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onCreateOrder.apply(
|
||||
@ -231,14 +231,14 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onCancel",
|
||||
relatedEventName: "onCancelModal",
|
||||
type: 'componentEvent',
|
||||
name: 'onCancel',
|
||||
relatedEventName: 'onCancelModal',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onCancel", disabled: true },
|
||||
{ name: "onOk", disabled: false },
|
||||
{ name: 'onCancel', disabled: true },
|
||||
{ name: 'onOk', disabled: false },
|
||||
],
|
||||
}}
|
||||
onCancel={function () {
|
||||
@ -262,16 +262,16 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onFinish",
|
||||
relatedEventName: "onConfirmCreateOrder",
|
||||
type: 'componentEvent',
|
||||
name: 'onFinish',
|
||||
relatedEventName: 'onConfirmCreateOrder',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onFinish", disabled: true },
|
||||
{ name: "onFinishFailed", disabled: false },
|
||||
{ name: "onFieldsChange", disabled: false },
|
||||
{ name: "onValuesChange", disabled: false },
|
||||
{ name: 'onFinish', disabled: true },
|
||||
{ name: 'onFinishFailed', disabled: false },
|
||||
{ name: 'onFieldsChange', disabled: false },
|
||||
{ name: 'onValuesChange', disabled: false },
|
||||
],
|
||||
}}
|
||||
>
|
||||
@ -287,10 +287,10 @@ class Test$$Page extends React.Component {
|
||||
<Form.Item
|
||||
wrapperCol={{ offset: 6 }}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "flex-end",
|
||||
justifyContent: "center",
|
||||
display: "flex",
|
||||
flexDirection: 'row',
|
||||
alignItems: 'flex-end',
|
||||
justifyContent: 'center',
|
||||
display: 'flex',
|
||||
}}
|
||||
labelAlign="right"
|
||||
>
|
||||
@ -302,12 +302,12 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onCancelModal",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onCancelModal',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onCancelModal.apply(
|
||||
@ -326,27 +326,27 @@ class Test$$Page extends React.Component {
|
||||
dataSource={__$$eval(() => this.state.records)}
|
||||
columns={[
|
||||
{
|
||||
title: "发布名称",
|
||||
dataIndex: "order_name",
|
||||
key: "name",
|
||||
title: '发布名称',
|
||||
dataIndex: 'order_name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
dataIndex: "order_type_desc",
|
||||
key: "age",
|
||||
title: '类型',
|
||||
dataIndex: 'order_type_desc',
|
||||
key: 'age',
|
||||
},
|
||||
{
|
||||
title: "发布状态",
|
||||
dataIndex: "order_status_desc",
|
||||
key: "address",
|
||||
title: '发布状态',
|
||||
dataIndex: 'order_status_desc',
|
||||
key: 'address',
|
||||
},
|
||||
{ title: "发布人", dataIndex: "creator_name" },
|
||||
{ title: "当前批次/总批次", dataIndex: "cur_batch_no" },
|
||||
{ title: '发布人', dataIndex: 'creator_name' },
|
||||
{ title: '当前批次/总批次', dataIndex: 'cur_batch_no' },
|
||||
{
|
||||
title: "发布机器/总机器",
|
||||
dataIndex: "pubblish_ip_finish_num",
|
||||
title: '发布机器/总机器',
|
||||
dataIndex: 'pubblish_ip_finish_num',
|
||||
},
|
||||
{ title: "发布时间", dataIndex: "publish_id" },
|
||||
{ title: '发布时间', dataIndex: 'publish_id' },
|
||||
]}
|
||||
actions={__$$eval(() => this.actions || [])}
|
||||
getActions={function () {
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
path: '',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "latest",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-url-params-handler": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-fetch-handler": "^1.0.0",
|
||||
"@alifd/next": "1.19.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" };
|
||||
const __$$constants = { ENV: 'prod', DOMAIN: 'xxx.xxx.com' };
|
||||
|
||||
export default __$$constants;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外: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 {
|
||||
_context = this;
|
||||
@ -51,7 +51,7 @@ class Test$$Page extends React.Component {
|
||||
|
||||
__$$i18n._inject2(this);
|
||||
|
||||
this.state = { text: "outter" };
|
||||
this.state = { text: 'outter' };
|
||||
}
|
||||
|
||||
$ = (refName) => {
|
||||
@ -67,8 +67,8 @@ class Test$$Page extends React.Component {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: "urlParams",
|
||||
type: "urlParams",
|
||||
id: 'urlParams',
|
||||
type: 'urlParams',
|
||||
isInit: function () {
|
||||
return undefined;
|
||||
},
|
||||
@ -77,12 +77,12 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "user",
|
||||
type: "fetch",
|
||||
id: 'user',
|
||||
type: 'fetch',
|
||||
options: function () {
|
||||
return {
|
||||
method: "GET",
|
||||
uri: "https://shs.xxx.com/mock/1458/demo/user",
|
||||
method: 'GET',
|
||||
uri: 'https://shs.xxx.com/mock/1458/demo/user',
|
||||
isSync: true,
|
||||
};
|
||||
},
|
||||
@ -90,6 +90,7 @@ class Test$$Page extends React.Component {
|
||||
if (!response.data.success) {
|
||||
throw new Error(response.data.message);
|
||||
}
|
||||
|
||||
return response.data.data;
|
||||
},
|
||||
isInit: function () {
|
||||
@ -97,12 +98,12 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "orders",
|
||||
type: "fetch",
|
||||
id: 'orders',
|
||||
type: 'fetch',
|
||||
options: function () {
|
||||
return {
|
||||
method: "GET",
|
||||
uri: "https://shs.xxx.com/mock/1458/demo/orders",
|
||||
method: 'GET',
|
||||
uri: 'https://shs.xxx.com/mock/1458/demo/orders',
|
||||
isSync: true,
|
||||
};
|
||||
},
|
||||
@ -110,6 +111,7 @@ class Test$$Page extends React.Component {
|
||||
if (!response.data.success) {
|
||||
throw new Error(response.data.message);
|
||||
}
|
||||
|
||||
return response.data.data.result;
|
||||
},
|
||||
isInit: function () {
|
||||
@ -118,7 +120,7 @@ class Test$$Page extends React.Component {
|
||||
},
|
||||
],
|
||||
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() {
|
||||
this._dataSourceEngine.reloadDataSource();
|
||||
|
||||
console.log("componentDidMount");
|
||||
console.log('componentDidMount');
|
||||
}
|
||||
|
||||
render() {
|
||||
const __$$context = this._context || this;
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div ref={this._refsManager.linkRef("outterView")} autoLoading={true}>
|
||||
<div ref={this._refsManager.linkRef('outterView')} autoLoading={true}>
|
||||
<Form
|
||||
labelCol={__$$eval(() => this.state.colNum)}
|
||||
style={{}}
|
||||
ref={this._refsManager.linkRef("testForm")}
|
||||
ref={this._refsManager.linkRef('testForm')}
|
||||
>
|
||||
<Form.Item label="姓名:" name="name" initValue="李雷">
|
||||
<Input placeholder="请输入" size="medium" style={{ width: 320 }} />
|
||||
@ -148,18 +150,18 @@ class Test$$Page extends React.Component {
|
||||
<Form.Item label="职业:" name="profession">
|
||||
<Select
|
||||
dataSource={[
|
||||
{ label: "教师", value: "t" },
|
||||
{ label: "医生", value: "d" },
|
||||
{ label: "歌手", value: "s" },
|
||||
{ label: '教师', value: 't' },
|
||||
{ label: '医生', value: 'd' },
|
||||
{ label: '歌手', value: 's' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<Button.Group>
|
||||
{__$$evalArray(() => ["a", "b", "c"]).map((item, index) =>
|
||||
{__$$evalArray(() => ['a', 'b', 'c']).map((item, index) =>
|
||||
((__$$context) =>
|
||||
!!false && (
|
||||
<Button type="primary" style={{ margin: "0 5px 0 5px" }}>
|
||||
<Button type="primary" style={{ margin: '0 5px 0 5px' }}>
|
||||
{__$$eval(() => item)}
|
||||
</Button>
|
||||
))(__$$createChildContext(__$$context, { item, index }))
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"undefined": "*",
|
||||
"@alilc/antd-lowcode": "0.8.0",
|
||||
"@alife/container": "0.3.7"
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外:react 框架的导出名和各种组件名除外。
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Modal,
|
||||
@ -12,22 +12,22 @@ import {
|
||||
DatePicker,
|
||||
InputNumber,
|
||||
Button,
|
||||
} from "@alilc/antd-lowcode/dist/antd-lowcode.esm.js";
|
||||
} from '@alilc/antd-lowcode/dist/antd-lowcode.esm.js';
|
||||
|
||||
import {
|
||||
Text as NextText,
|
||||
Page as NextPage,
|
||||
Block as NextBlock,
|
||||
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;
|
||||
|
||||
@ -52,9 +52,9 @@ class Test$$Page extends React.Component {
|
||||
currentStep: 0,
|
||||
isModifyDialogVisible: false,
|
||||
isModifyStatus: false,
|
||||
secondCommitText: "完成并提交",
|
||||
thirdAuditText: "审核中",
|
||||
thirdButtonText: "修改",
|
||||
secondCommitText: '完成并提交',
|
||||
thirdAuditText: '审核中',
|
||||
thirdButtonText: '修改',
|
||||
customerProjectInfo: {
|
||||
id: null,
|
||||
systemProjectName: null,
|
||||
@ -75,28 +75,28 @@ class Test$$Page extends React.Component {
|
||||
status: null,
|
||||
},
|
||||
versionLinesArray: [
|
||||
{ label: "AmapAuto 485", value: 1 },
|
||||
{ label: "AmapAuto 505", value: 2 },
|
||||
{ label: 'AmapAuto 485', value: 1 },
|
||||
{ label: 'AmapAuto 505', value: 2 },
|
||||
],
|
||||
projectModalsArray: [
|
||||
{ label: "车机", value: 1 },
|
||||
{ label: "车镜", value: 2 },
|
||||
{ label: "记录仪", value: 3 },
|
||||
{ label: "其他", value: 4 },
|
||||
{ label: '车机', value: 1 },
|
||||
{ label: '车镜', value: 2 },
|
||||
{ label: '记录仪', value: 3 },
|
||||
{ label: '其他', value: 4 },
|
||||
],
|
||||
osVersionsArray: [
|
||||
{ label: "安卓5", value: 1 },
|
||||
{ label: "安卓6", value: 2 },
|
||||
{ label: "安卓7", value: 3 },
|
||||
{ label: "安卓8", value: 4 },
|
||||
{ label: "安卓9", value: 5 },
|
||||
{ label: "安卓10", value: 6 },
|
||||
{ label: '安卓5', value: 1 },
|
||||
{ label: '安卓6', value: 2 },
|
||||
{ label: '安卓7', value: 3 },
|
||||
{ label: '安卓8', value: 4 },
|
||||
{ label: '安卓9', value: 5 },
|
||||
{ label: '安卓10', value: 6 },
|
||||
],
|
||||
instructionsArray: [
|
||||
{ label: "ARM64-V8", value: "ARM64-V8" },
|
||||
{ label: "ARM32-V7", value: "ARM32-V7" },
|
||||
{ label: "X86", value: "X86" },
|
||||
{ label: "X64", value: "X64" },
|
||||
{ label: 'ARM64-V8', value: 'ARM64-V8' },
|
||||
{ label: 'ARM32-V7', value: 'ARM32-V7' },
|
||||
{ label: 'X86', value: 'X86' },
|
||||
{ label: 'X64', value: 'X64' },
|
||||
],
|
||||
};
|
||||
}
|
||||
@ -151,7 +151,6 @@ class Test$$Page extends React.Component {
|
||||
|
||||
onOkModifyDialogThird() {
|
||||
//第三步 修改 对话框 确定
|
||||
|
||||
this.setState({
|
||||
currentStep: 0,
|
||||
isModifyDialogVisible: false,
|
||||
@ -160,7 +159,6 @@ class Test$$Page extends React.Component {
|
||||
|
||||
onCancelModifyDialogThird() {
|
||||
//第三步 修改 对话框 取消
|
||||
|
||||
this.setState({
|
||||
isModifyDialogVisible: false,
|
||||
});
|
||||
@ -177,17 +175,17 @@ class Test$$Page extends React.Component {
|
||||
|
||||
onClickFirstBack() {
|
||||
// 第一步 返回按钮
|
||||
this.$router.push("/myProjectList");
|
||||
this.$router.push('/myProjectList');
|
||||
}
|
||||
|
||||
onClickSecondBack() {
|
||||
// 第二步 返回按钮
|
||||
this.$router.push("/myProjectList");
|
||||
this.$router.push('/myProjectList');
|
||||
}
|
||||
|
||||
onClickThirdBack() {
|
||||
// 第三步 返回按钮
|
||||
this.$router.push("/myProjectList");
|
||||
this.$router.push('/myProjectList');
|
||||
}
|
||||
|
||||
onValuesChange(_, values) {
|
||||
@ -206,8 +204,8 @@ class Test$$Page extends React.Component {
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div
|
||||
ref={this._refsManager.linkRef("outterView")}
|
||||
style={{ height: "100%" }}
|
||||
ref={this._refsManager.linkRef('outterView')}
|
||||
style={{ height: '100%' }}
|
||||
>
|
||||
<Modal
|
||||
title="是否修改"
|
||||
@ -222,19 +220,19 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onOk",
|
||||
relatedEventName: "onOkModifyDialogThird",
|
||||
type: 'componentEvent',
|
||||
name: 'onOk',
|
||||
relatedEventName: 'onOkModifyDialogThird',
|
||||
},
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onCancel",
|
||||
relatedEventName: "onCancelModifyDialogThird",
|
||||
type: 'componentEvent',
|
||||
name: 'onCancel',
|
||||
relatedEventName: 'onCancelModifyDialogThird',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onCancel", disabled: true },
|
||||
{ name: "onOk", disabled: true },
|
||||
{ name: 'onCancel', disabled: true },
|
||||
{ name: 'onOk', disabled: true },
|
||||
],
|
||||
}}
|
||||
onOk={function () {
|
||||
@ -253,11 +251,11 @@ class Test$$Page extends React.Component {
|
||||
<NextText
|
||||
type="inherit"
|
||||
style={{
|
||||
fontStyle: "normal",
|
||||
textAlign: "left",
|
||||
display: "block",
|
||||
fontFamily: "arial, helvetica, microsoft yahei",
|
||||
fontWeight: "normal",
|
||||
fontStyle: 'normal',
|
||||
textAlign: 'left',
|
||||
display: 'block',
|
||||
fontFamily: 'arial, helvetica, microsoft yahei',
|
||||
fontWeight: 'normal',
|
||||
}}
|
||||
>
|
||||
修改将撤回此前填写的信息
|
||||
@ -266,17 +264,17 @@ class Test$$Page extends React.Component {
|
||||
<NextPage
|
||||
columns={12}
|
||||
headerDivider={true}
|
||||
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }}
|
||||
placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
|
||||
placeholder="页面主体内容:拖拽Block布局组件到这里"
|
||||
header={null}
|
||||
headerProps={{ background: "surface" }}
|
||||
headerProps={{ background: 'surface' }}
|
||||
footer={null}
|
||||
minHeight="100vh"
|
||||
style={{}}
|
||||
>
|
||||
<NextBlock
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
noPadding={false}
|
||||
noBorder={false}
|
||||
background="surface"
|
||||
@ -288,7 +286,7 @@ class Test$$Page extends React.Component {
|
||||
<NextBlockCell
|
||||
title=""
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
layoutmode="O"
|
||||
childTotalColumns={12}
|
||||
isAutoContainer={true}
|
||||
@ -302,7 +300,7 @@ class Test$$Page extends React.Component {
|
||||
textSpacing={true}
|
||||
align="left"
|
||||
flex={true}
|
||||
style={{ marginBottom: "24px" }}
|
||||
style={{ marginBottom: '24px' }}
|
||||
>
|
||||
<Steps current={__$$eval(() => this.state.currentStep)}>
|
||||
<Steps.Step title="版本申请" description="" />
|
||||
@ -319,7 +317,7 @@ class Test$$Page extends React.Component {
|
||||
align="left"
|
||||
full={true}
|
||||
flex={true}
|
||||
style={{ display: "flex", justifyContent: "center" }}
|
||||
style={{ display: 'flex', justifyContent: 'center' }}
|
||||
>
|
||||
<Form
|
||||
labelCol={{ span: 10 }}
|
||||
@ -332,30 +330,30 @@ class Test$$Page extends React.Component {
|
||||
}.bind(this)}
|
||||
name="basic"
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "600px",
|
||||
justifyContent: "center",
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
width: '600px',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
layout="vertical"
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onFinish",
|
||||
relatedEventName: "onFinishFirst",
|
||||
type: 'componentEvent',
|
||||
name: 'onFinish',
|
||||
relatedEventName: 'onFinishFirst',
|
||||
},
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onValuesChange",
|
||||
relatedEventName: "onValuesChange",
|
||||
type: 'componentEvent',
|
||||
name: 'onValuesChange',
|
||||
relatedEventName: 'onValuesChange',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onFinish", disabled: true },
|
||||
{ name: "onFinishFailed", disabled: false },
|
||||
{ name: "onFieldsChange", disabled: false },
|
||||
{ name: "onValuesChange", disabled: true },
|
||||
{ name: 'onFinish', disabled: true },
|
||||
{ name: 'onFinishFailed', disabled: false },
|
||||
{ name: 'onFieldsChange', disabled: false },
|
||||
{ name: 'onValuesChange', disabled: true },
|
||||
],
|
||||
}}
|
||||
initialValues={__$$eval(
|
||||
@ -371,13 +369,13 @@ class Test$$Page extends React.Component {
|
||||
{!!false && (
|
||||
<Form.Item
|
||||
label=""
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
colon={false}
|
||||
name="id"
|
||||
>
|
||||
<Input
|
||||
placeholder=""
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
bordered={false}
|
||||
disabled={true}
|
||||
/>
|
||||
@ -390,20 +388,20 @@ class Test$$Page extends React.Component {
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ flexDirection: "column", width: "600px" }}
|
||||
style={{ flexDirection: 'column', width: '600px' }}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请选择版本类型",
|
||||
message: '请选择版本类型',
|
||||
}}
|
||||
>
|
||||
<Checkbox.Group
|
||||
options={[
|
||||
{ label: "基础版本", value: "3" },
|
||||
{ label: "AR导航", value: "1" },
|
||||
{ label: "货车导航", value: "2" },
|
||||
{ label: "UI定制", value: "4", disabled: false },
|
||||
{ label: '基础版本', value: '3' },
|
||||
{ label: 'AR导航', value: '1' },
|
||||
{ label: '货车导航', value: '2' },
|
||||
{ label: 'UI定制', value: '4', disabled: false },
|
||||
]}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
this.state.customerProjectInfo.id > 0 &&
|
||||
@ -416,13 +414,13 @@ class Test$$Page extends React.Component {
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
name="versionLine"
|
||||
requiredobj={{ required: true, message: "请选择版本线" }}
|
||||
requiredobj={{ required: true, message: '请选择版本线' }}
|
||||
extra=""
|
||||
>
|
||||
<Select
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
options={__$$eval(() => this.state.versionLinesArray)}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -436,27 +434,27 @@ class Test$$Page extends React.Component {
|
||||
label="项目名称"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ display: "flex" }}
|
||||
style={{ display: 'flex' }}
|
||||
labelAlign="left"
|
||||
extra=""
|
||||
name="systemProjectName"
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请按格式填写项目名称",
|
||||
message: '请按格式填写项目名称',
|
||||
}}
|
||||
typeobj={{
|
||||
type: "string",
|
||||
type: 'string',
|
||||
message:
|
||||
"请输入项目名称,格式:公司简称-产品名称-版本类型",
|
||||
'请输入项目名称,格式:公司简称-产品名称-版本类型',
|
||||
}}
|
||||
lenobj={{
|
||||
max: 100,
|
||||
message: "项目名称不能超过100个字符",
|
||||
message: '项目名称不能超过100个字符',
|
||||
}}
|
||||
>
|
||||
<Input
|
||||
placeholder="公司简称-产品名称-版本类型"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
this.state.customerProjectInfo.id > 0 &&
|
||||
@ -466,18 +464,18 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="预期交付时间"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
colon={false}
|
||||
required={true}
|
||||
name="expectedTime"
|
||||
labelAlign="left"
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请填写预期交付时间",
|
||||
message: '请填写预期交付时间',
|
||||
}}
|
||||
>
|
||||
<DatePicker
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
this.state.customerProjectInfo.id > 0 &&
|
||||
@ -487,11 +485,11 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="预期出货量"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
required={true}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请填写预期出货量",
|
||||
message: '请填写预期出货量',
|
||||
}}
|
||||
name="expectedNum"
|
||||
labelAlign="left"
|
||||
@ -499,7 +497,7 @@ class Test$$Page extends React.Component {
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="单位(台)使用该版本的机器数量+预计出货量,请如实填写"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -511,28 +509,28 @@ class Test$$Page extends React.Component {
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
wrapperCol={{ offset: "" }}
|
||||
wrapperCol={{ offset: '' }}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "baseline",
|
||||
justifyContent: "space-between",
|
||||
width: "600px",
|
||||
display: "block",
|
||||
flexDirection: 'row',
|
||||
alignItems: 'baseline',
|
||||
justifyContent: 'space-between',
|
||||
width: '600px',
|
||||
display: 'block',
|
||||
}}
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
>
|
||||
<Button
|
||||
style={{ margin: "0px" }}
|
||||
style={{ margin: '0px' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickFirstBack",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickFirstBack',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickFirstBack.apply(
|
||||
@ -547,12 +545,12 @@ class Test$$Page extends React.Component {
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{
|
||||
boxShadow: "rgba(31, 56, 88, 0.2) 0px 0px 0px 0px",
|
||||
float: "right",
|
||||
boxShadow: 'rgba(31, 56, 88, 0.2) 0px 0px 0px 0px',
|
||||
float: 'right',
|
||||
}}
|
||||
__events={{
|
||||
eventDataList: [],
|
||||
eventList: [{ name: "onClick", disabled: false }],
|
||||
eventList: [{ name: 'onClick', disabled: false }],
|
||||
}}
|
||||
>
|
||||
下一步
|
||||
@ -570,7 +568,7 @@ class Test$$Page extends React.Component {
|
||||
align="left"
|
||||
full={true}
|
||||
flex={true}
|
||||
style={{ display: "flex", justifyContent: "center" }}
|
||||
style={{ display: 'flex', justifyContent: 'center' }}
|
||||
>
|
||||
<Form
|
||||
labelCol={{ span: 10 }}
|
||||
@ -583,31 +581,31 @@ class Test$$Page extends React.Component {
|
||||
}.bind(this)}
|
||||
name="basic"
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "600px",
|
||||
justifyContent: "center",
|
||||
height: "800px",
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
width: '600px',
|
||||
justifyContent: 'center',
|
||||
height: '800px',
|
||||
}}
|
||||
layout="vertical"
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onFinish",
|
||||
relatedEventName: "onFinishSecond",
|
||||
type: 'componentEvent',
|
||||
name: 'onFinish',
|
||||
relatedEventName: 'onFinishSecond',
|
||||
},
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onValuesChange",
|
||||
relatedEventName: "onValuesChange",
|
||||
type: 'componentEvent',
|
||||
name: 'onValuesChange',
|
||||
relatedEventName: 'onValuesChange',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onFinish", disabled: true },
|
||||
{ name: "onFinishFailed", disabled: false },
|
||||
{ name: "onFieldsChange", disabled: false },
|
||||
{ name: "onValuesChange", disabled: true },
|
||||
{ name: 'onFinish', disabled: true },
|
||||
{ name: 'onFinishFailed', disabled: false },
|
||||
{ name: 'onFieldsChange', disabled: false },
|
||||
{ name: 'onValuesChange', disabled: true },
|
||||
],
|
||||
}}
|
||||
initialValues={__$$eval(
|
||||
@ -625,15 +623,15 @@ class Test$$Page extends React.Component {
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
name="projectModal"
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请选择设备类型",
|
||||
message: '请选择设备类型',
|
||||
}}
|
||||
>
|
||||
<Select
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
options={__$$eval(() => this.state.projectModalsArray)}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -645,19 +643,19 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="屏幕分辨率宽"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
name="displayWidth"
|
||||
colon={false}
|
||||
required={true}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请输入屏幕分辨率宽",
|
||||
message: '请输入屏幕分辨率宽',
|
||||
}}
|
||||
labelAlign="left"
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="例如1280"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -669,19 +667,19 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="屏幕分辨率高"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
name="displayHeight"
|
||||
required={true}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请输入屏幕分辨率高",
|
||||
message: '请输入屏幕分辨率高',
|
||||
}}
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="例如720"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -693,19 +691,19 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="屏幕尺寸(inch)"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
name="displayInch"
|
||||
labelAlign="left"
|
||||
required={true}
|
||||
colon={false}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请输入屏幕尺寸",
|
||||
message: '请输入屏幕尺寸',
|
||||
}}
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="请输入尺寸"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -717,7 +715,7 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="屏幕DPI"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
required={false}
|
||||
@ -725,7 +723,7 @@ class Test$$Page extends React.Component {
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="UI定制项目必填"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -739,19 +737,19 @@ class Test$$Page extends React.Component {
|
||||
label="芯片名称"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ display: "flex" }}
|
||||
style={{ display: 'flex' }}
|
||||
labelAlign="left"
|
||||
extra=""
|
||||
name="mainSoc"
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请输入芯片名称",
|
||||
message: '请输入芯片名称',
|
||||
}}
|
||||
lenobj={{ max: 50, message: "芯片名称不能超过50个字符" }}
|
||||
lenobj={{ max: 50, message: '芯片名称不能超过50个字符' }}
|
||||
>
|
||||
<Input
|
||||
placeholder="请输入芯片名称"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
this.state.customerProjectInfo.id > 0 &&
|
||||
@ -761,11 +759,11 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="芯片核数"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
required={true}
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请输入芯片核数",
|
||||
message: '请输入芯片核数',
|
||||
}}
|
||||
name="cpuCoreNum"
|
||||
labelAlign="left"
|
||||
@ -773,7 +771,7 @@ class Test$$Page extends React.Component {
|
||||
>
|
||||
<InputNumber
|
||||
value={3}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
placeholder="请输入芯片核数"
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -786,14 +784,14 @@ class Test$$Page extends React.Component {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="指令集"
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
required={true}
|
||||
requiredobj={{ required: true, message: "请选择指令集" }}
|
||||
requiredobj={{ required: true, message: '请选择指令集' }}
|
||||
name="instructions"
|
||||
colon={false}
|
||||
>
|
||||
<Select
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
options={__$$eval(() => this.state.instructionsArray)}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -807,15 +805,15 @@ class Test$$Page extends React.Component {
|
||||
labelAlign="left"
|
||||
colon={false}
|
||||
required={true}
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
name="osVersion"
|
||||
requiredobj={{
|
||||
required: true,
|
||||
message: "请选择系统版本",
|
||||
message: '请选择系统版本',
|
||||
}}
|
||||
>
|
||||
<Select
|
||||
style={{ width: "600px" }}
|
||||
style={{ width: '600px' }}
|
||||
options={__$$eval(() => this.state.osVersionsArray)}
|
||||
disabled={__$$eval(
|
||||
() =>
|
||||
@ -826,24 +824,24 @@ class Test$$Page extends React.Component {
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
wrapperCol={{ offset: "" }}
|
||||
wrapperCol={{ offset: '' }}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
width: "600px",
|
||||
display: "flex",
|
||||
flexDirection: 'row',
|
||||
width: '600px',
|
||||
display: 'flex',
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
style={{ marginLeft: "0" }}
|
||||
style={{ marginLeft: '0' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickSecondBack",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickSecondBack',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickSecondBack.apply(
|
||||
@ -857,7 +855,7 @@ class Test$$Page extends React.Component {
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{ float: "right", marginLeft: "20px" }}
|
||||
style={{ float: 'right', marginLeft: '20px' }}
|
||||
loading={__$$eval(
|
||||
() =>
|
||||
this.state.LOADING_ADD_OR_UPDATE_CUSTOMER_PROJECT
|
||||
@ -868,16 +866,16 @@ class Test$$Page extends React.Component {
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{ marginLeft: "0px", float: "right" }}
|
||||
style={{ marginLeft: '0px', float: 'right' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickPreSecond",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickPreSecond',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickPreSecond.apply(
|
||||
@ -901,7 +899,7 @@ class Test$$Page extends React.Component {
|
||||
align="left"
|
||||
full={true}
|
||||
flex={true}
|
||||
style={{ display: "flex", justifyContent: "center" }}
|
||||
style={{ display: 'flex', justifyContent: 'center' }}
|
||||
>
|
||||
<Form
|
||||
labelCol={{ span: 10 }}
|
||||
@ -914,25 +912,25 @@ class Test$$Page extends React.Component {
|
||||
}.bind(this)}
|
||||
name="basic"
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "600px",
|
||||
justifyContent: "center",
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
width: '600px',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
layout="vertical"
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onFinishFailed",
|
||||
relatedEventName: "onFinishFailed",
|
||||
type: 'componentEvent',
|
||||
name: 'onFinishFailed',
|
||||
relatedEventName: 'onFinishFailed',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onFinish", disabled: false },
|
||||
{ name: "onFinishFailed", disabled: true },
|
||||
{ name: "onFieldsChange", disabled: false },
|
||||
{ name: "onValuesChange", disabled: false },
|
||||
{ name: 'onFinish', disabled: false },
|
||||
{ name: 'onFinishFailed', disabled: true },
|
||||
{ name: 'onFieldsChange', disabled: false },
|
||||
{ name: 'onValuesChange', disabled: false },
|
||||
],
|
||||
}}
|
||||
>
|
||||
@ -940,11 +938,11 @@ class Test$$Page extends React.Component {
|
||||
<Steps
|
||||
current={1}
|
||||
style={{
|
||||
width: "600px",
|
||||
display: "flex",
|
||||
justifyContent: "space-around",
|
||||
alignItems: "center",
|
||||
height: "300px",
|
||||
width: '600px',
|
||||
display: 'flex',
|
||||
justifyContent: 'space-around',
|
||||
alignItems: 'center',
|
||||
height: '300px',
|
||||
}}
|
||||
labelPlacement="horizontal"
|
||||
direction="vertical"
|
||||
@ -952,35 +950,35 @@ class Test$$Page extends React.Component {
|
||||
<Steps.Step
|
||||
title="提交完成"
|
||||
description=""
|
||||
style={{ width: "200px" }}
|
||||
style={{ width: '200px' }}
|
||||
/>
|
||||
<Steps.Step
|
||||
title={__$$eval(() => this.state.thirdAuditText)}
|
||||
subTitle=""
|
||||
description=""
|
||||
style={{ width: "200px" }}
|
||||
style={{ width: '200px' }}
|
||||
/>
|
||||
</Steps>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
wrapperCol={{ offset: "" }}
|
||||
wrapperCol={{ offset: '' }}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
width: "600px",
|
||||
display: "flex",
|
||||
flexDirection: 'row',
|
||||
width: '600px',
|
||||
display: 'flex',
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
style={{ marginLeft: "0" }}
|
||||
style={{ marginLeft: '0' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickThirdBack",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickThirdBack',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickThirdBack.apply(
|
||||
@ -994,16 +992,16 @@ class Test$$Page extends React.Component {
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{ float: "right", marginLeft: "20px" }}
|
||||
style={{ float: 'right', marginLeft: '20px' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickModifyThird",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickModifyThird',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickModifyThird.apply(
|
||||
@ -1020,16 +1018,16 @@ class Test$$Page extends React.Component {
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{ marginLeft: "0px", float: "right" }}
|
||||
style={{ marginLeft: '0px', float: 'right' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onClickPreThird",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onClickPreThird',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onClickPreThird.apply(
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
path: '',
|
||||
component: Test,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-http-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-http-handler": "^1.0.0",
|
||||
"@alilc/lowcode-components": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外: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 {
|
||||
_context = this;
|
||||
@ -56,12 +56,12 @@ class Example$$Page extends React.Component {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: "userList",
|
||||
type: "http",
|
||||
description: "用户列表",
|
||||
id: 'userList',
|
||||
type: 'http',
|
||||
description: '用户列表',
|
||||
options: function () {
|
||||
return {
|
||||
uri: "https://api.example.com/user/list",
|
||||
uri: 'https://api.example.com/user/list',
|
||||
};
|
||||
},
|
||||
isInit: function () {
|
||||
@ -82,10 +82,10 @@ class Example$$Page extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
dataSource={__$$eval(() => this.dataSourceMap["userList"])}
|
||||
dataSource={__$$eval(() => this.dataSourceMap['userList'])}
|
||||
columns={[
|
||||
{ dataIndex: "name", title: "姓名" },
|
||||
{ dataIndex: "age", title: "年龄" },
|
||||
{ dataIndex: 'name', title: '姓名' },
|
||||
{ dataIndex: 'age', title: '年龄' },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -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 = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
path: '',
|
||||
component: Example,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-jsonp-handler": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"@alilc/lowcode-datasource-jsonp-handler": "^1.0.0",
|
||||
"@alifd/next": "1.19.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -1,10 +1,17 @@
|
||||
import BasicLayout from "@/layouts/BasicLayout";
|
||||
import $ from '@/pages/$';
|
||||
|
||||
import BasicLayout from '@/layouts/BasicLayout';
|
||||
|
||||
const routerConfig = [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: BasicLayout,
|
||||
children: [],
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: $,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef } from 'react';
|
||||
|
||||
export class RefsManager {
|
||||
constructor() {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"intl-messageformat": "^9.3.6",
|
||||
"@ice/store": "^1.4.3",
|
||||
"@loadable/component": "^5.15.2",
|
||||
"@alilc/lowcode-datasource-engine": "latest",
|
||||
"@alilc/lowcode-datasource-engine": "^1.0.0",
|
||||
"undefined": "*",
|
||||
"@alilc/antd-lowcode-materials": "0.9.4",
|
||||
"@alife/mc-assets-1935": "0.1.42",
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { createApp } from "ice";
|
||||
import { createApp } from 'ice';
|
||||
|
||||
const appConfig = {
|
||||
app: {
|
||||
rootId: "app",
|
||||
rootId: 'app',
|
||||
},
|
||||
router: {
|
||||
type: "hash",
|
||||
type: 'hash',
|
||||
},
|
||||
};
|
||||
createApp(appConfig);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 引入默认全局样式
|
||||
@import "@alifd/next/reset.scss";
|
||||
@import '@alifd/next/reset.scss';
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const i18nConfig = {};
|
||||
|
||||
let locale =
|
||||
typeof navigator === "object" && typeof navigator.language === "string"
|
||||
typeof navigator === 'object' && typeof navigator.language === 'string'
|
||||
? navigator.language
|
||||
: "zh-CN";
|
||||
: 'zh-CN';
|
||||
|
||||
const getLocale = () => locale;
|
||||
|
||||
@ -13,22 +13,22 @@ const setLocale = (target) => {
|
||||
|
||||
const isEmptyVariables = (variables) =>
|
||||
(Array.isArray(variables) && variables.length === 0) ||
|
||||
(typeof variables === "object" &&
|
||||
(typeof variables === 'object' &&
|
||||
(!variables || Object.keys(variables).length === 0));
|
||||
|
||||
// 按低代码规范里面的要求进行变量替换
|
||||
const format = (msg, variables) =>
|
||||
typeof msg === "string"
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? "")
|
||||
typeof msg === 'string'
|
||||
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
|
||||
: msg;
|
||||
|
||||
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
|
||||
const msg =
|
||||
i18nConfig[locale]?.[id] ??
|
||||
i18nConfig[locale.replace("-", "_")]?.[id] ??
|
||||
i18nConfig[locale.replace('-', '_')]?.[id] ??
|
||||
defaultMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const _inject2 = (target) => {
|
||||
};
|
||||
target._i18nText = (t) => {
|
||||
// 优先取直接传过来的语料
|
||||
const localMsg = t[locale] ?? t[String(locale).replace("-", "_")];
|
||||
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')];
|
||||
if (localMsg != null) {
|
||||
return format(localMsg, t.params);
|
||||
}
|
||||
@ -61,7 +61,7 @@ const _inject2 = (target) => {
|
||||
}
|
||||
|
||||
// 兜底用 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);
|
||||
};
|
||||
|
||||
// 注入到上下文中去
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// 注意: 出码引擎注入的临时变量默认都以 "__$$" 开头,禁止在搭建的代码中直接访问。
|
||||
// 例外:react 框架的导出名和各种组件名除外。
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Modal,
|
||||
@ -12,26 +12,26 @@ import {
|
||||
ConfigProvider,
|
||||
Tooltip,
|
||||
Empty,
|
||||
} from "@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js";
|
||||
} from '@alilc/antd-lowcode-materials/dist/antd-lowcode.esm.js';
|
||||
|
||||
import {
|
||||
AliAutoDiv,
|
||||
AliAutoSearchTable,
|
||||
} from "@alife/mc-assets-1935/build/lowcode/index.js";
|
||||
} from '@alife/mc-assets-1935/build/lowcode/index.js';
|
||||
|
||||
import {
|
||||
Page as NextPage,
|
||||
Block as NextBlock,
|
||||
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;
|
||||
|
||||
@ -65,11 +65,12 @@ class Test$$Page extends React.Component {
|
||||
};
|
||||
|
||||
this.__jp__init();
|
||||
|
||||
this.statusDesc = {
|
||||
0: "失败",
|
||||
1: "成功",
|
||||
2: "构建中",
|
||||
3: "构建超时",
|
||||
0: '失败',
|
||||
1: '成功',
|
||||
2: '构建中',
|
||||
3: '构建超时',
|
||||
};
|
||||
this.pageParams = {};
|
||||
}
|
||||
@ -133,7 +134,7 @@ class Test$$Page extends React.Component {
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -160,10 +161,11 @@ class Test$$Page extends React.Component {
|
||||
|
||||
formatResult(item) {
|
||||
if (!item) {
|
||||
return "暂无结果";
|
||||
return '暂无结果';
|
||||
}
|
||||
|
||||
const { channel, plat, version, status } = item;
|
||||
return [channel, plat, version, status].join("-");
|
||||
return [channel, plat, version, status].join('-');
|
||||
}
|
||||
|
||||
handleDownload() {
|
||||
@ -175,7 +177,7 @@ class Test$$Page extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.$ds.resolve("PROJECTS", {
|
||||
this.$ds.resolve('PROJECTS', {
|
||||
params: {
|
||||
size: 5000,
|
||||
},
|
||||
@ -192,8 +194,8 @@ class Test$$Page extends React.Component {
|
||||
const { state } = __$$context;
|
||||
return (
|
||||
<div
|
||||
ref={this._refsManager.linkRef("outterView")}
|
||||
style={{ height: "100%" }}
|
||||
ref={this._refsManager.linkRef('outterView')}
|
||||
style={{ height: '100%' }}
|
||||
>
|
||||
<Modal
|
||||
title="查看结果"
|
||||
@ -204,12 +206,12 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "onResultCancel",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'onResultCancel',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.onResultCancel.apply(
|
||||
@ -224,14 +226,14 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onCancel",
|
||||
relatedEventName: "onResultCancel",
|
||||
type: 'componentEvent',
|
||||
name: 'onCancel',
|
||||
relatedEventName: 'onResultCancel',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onCancel", disabled: true },
|
||||
{ name: "onOk", disabled: false },
|
||||
{ name: 'onCancel', disabled: true },
|
||||
{ name: 'onOk', disabled: false },
|
||||
],
|
||||
}}
|
||||
onCancel={function () {
|
||||
@ -245,7 +247,7 @@ class Test$$Page extends React.Component {
|
||||
>
|
||||
{__$$evalArray(() => this.state.results).map((item, index) =>
|
||||
((__$$context) => (
|
||||
<AliAutoDivDefault style={{ width: "100%" }}>
|
||||
<AliAutoDivDefault style={{ width: '100%' }}>
|
||||
{!!__$$eval(
|
||||
() =>
|
||||
__$$context.state.results &&
|
||||
@ -253,9 +255,9 @@ class Test$$Page extends React.Component {
|
||||
) && (
|
||||
<AliAutoDivDefault
|
||||
style={{
|
||||
width: "100%",
|
||||
textAlign: "left",
|
||||
marginBottom: "10px",
|
||||
width: '100%',
|
||||
textAlign: 'left',
|
||||
marginBottom: '10px',
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
@ -264,12 +266,12 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "handleDownload",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'handleDownload',
|
||||
},
|
||||
],
|
||||
eventList: [{ name: "onClick", disabled: true }],
|
||||
eventList: [{ name: 'onClick', disabled: true }],
|
||||
}}
|
||||
onClick={function () {
|
||||
this.handleDownload.apply(
|
||||
@ -290,7 +292,7 @@ class Test$$Page extends React.Component {
|
||||
href={__$$eval(() => item.download_link)}
|
||||
target="_blank"
|
||||
>
|
||||
{" "}
|
||||
{' '}
|
||||
- 点击下载
|
||||
</Typography.Link>
|
||||
)}
|
||||
@ -299,7 +301,7 @@ class Test$$Page extends React.Component {
|
||||
href={__$$eval(() => item.release_notes)}
|
||||
target="_blank"
|
||||
>
|
||||
{" "}
|
||||
{' '}
|
||||
- 跳转发布节点
|
||||
</Typography.Link>
|
||||
)}
|
||||
@ -310,16 +312,16 @@ class Test$$Page extends React.Component {
|
||||
<NextPage
|
||||
columns={12}
|
||||
headerDivider={true}
|
||||
placeholderStyle={{ gridRowEnd: "span 1", gridColumnEnd: "span 12" }}
|
||||
placeholderStyle={{ gridRowEnd: 'span 1', gridColumnEnd: 'span 12' }}
|
||||
placeholder="页面主体内容:拖拽Block布局组件到这里"
|
||||
header={null}
|
||||
headerProps={{ background: "surface" }}
|
||||
headerProps={{ background: 'surface' }}
|
||||
footer={null}
|
||||
minHeight="100vh"
|
||||
>
|
||||
<NextBlock
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
noPadding={false}
|
||||
noBorder={false}
|
||||
background="surface"
|
||||
@ -331,7 +333,7 @@ class Test$$Page extends React.Component {
|
||||
<NextBlockCell
|
||||
title=""
|
||||
prefix="next-"
|
||||
placeholderStyle={{ height: "100%" }}
|
||||
placeholderStyle={{ height: '100%' }}
|
||||
layoutmode="O"
|
||||
childTotalColumns={12}
|
||||
isAutoContainer={true}
|
||||
@ -361,22 +363,22 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onFinish",
|
||||
relatedEventName: "onFinish",
|
||||
type: 'componentEvent',
|
||||
name: 'onFinish',
|
||||
relatedEventName: 'onFinish',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onFinish", disabled: true },
|
||||
{ name: "onFinishFailed", disabled: false },
|
||||
{ name: "onFieldsChange", disabled: false },
|
||||
{ name: "onValuesChange", disabled: false },
|
||||
{ name: 'onFinish', disabled: true },
|
||||
{ name: 'onFinishFailed', disabled: false },
|
||||
{ name: 'onFieldsChange', disabled: false },
|
||||
{ name: 'onValuesChange', disabled: false },
|
||||
],
|
||||
}}
|
||||
>
|
||||
<Form.Item label="项目名称/渠道号" name="channel_id">
|
||||
<Select
|
||||
style={{ width: "280px" }}
|
||||
style={{ width: '280px' }}
|
||||
options={__$$eval(() => this.state.projects)}
|
||||
showArrow={true}
|
||||
tokenSeparators={[]}
|
||||
@ -386,7 +388,7 @@ class Test$$Page extends React.Component {
|
||||
<Form.Item label="版本号" name="buildId">
|
||||
<Input
|
||||
placeholder="请输入"
|
||||
style={{ width: "280px" }}
|
||||
style={{ width: '280px' }}
|
||||
size="middle"
|
||||
/>
|
||||
</Form.Item>
|
||||
@ -394,15 +396,15 @@ class Test$$Page extends React.Component {
|
||||
<Select
|
||||
style={{ width: 200 }}
|
||||
options={[
|
||||
{ label: "A", value: "A" },
|
||||
{ label: "B", value: "B" },
|
||||
{ label: "C", value: "C" },
|
||||
{ label: 'A', value: 'A' },
|
||||
{ label: 'B', value: 'B' },
|
||||
{ label: 'C', value: 'C' },
|
||||
]}
|
||||
showSearch={true}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="ID" name="id">
|
||||
<Input placeholder="请输入" style={{ width: "160px" }} />
|
||||
<Input placeholder="请输入" style={{ width: '160px' }} />
|
||||
</Form.Item>
|
||||
<Form.Item wrapperCol={{ offset: 6 }}>
|
||||
<Button type="primary" htmlType="submit">
|
||||
@ -434,23 +436,23 @@ class Test$$Page extends React.Component {
|
||||
dataSource={__$$eval(() => this.state.pkgs)}
|
||||
columns={[
|
||||
{
|
||||
title: "ID",
|
||||
dataIndex: "id",
|
||||
key: "name",
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
key: 'name',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: "渠道号",
|
||||
dataIndex: "channels",
|
||||
key: "age",
|
||||
title: '渠道号',
|
||||
dataIndex: 'channels',
|
||||
key: 'age',
|
||||
width: 142,
|
||||
render: (text, record, index) =>
|
||||
((__$$context) =>
|
||||
__$$evalArray(() => text.split(",")).map(
|
||||
__$$evalArray(() => text.split(',')).map(
|
||||
(item, index) =>
|
||||
((__$$context) => (
|
||||
<Typography.Text
|
||||
style={{ display: "block" }}
|
||||
style={{ display: 'block' }}
|
||||
>
|
||||
{__$$eval(() => item)}
|
||||
</Typography.Text>
|
||||
@ -469,9 +471,9 @@ class Test$$Page extends React.Component {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "版本号",
|
||||
dataIndex: "dic_version",
|
||||
key: "address",
|
||||
title: '版本号',
|
||||
dataIndex: 'dic_version',
|
||||
key: 'address',
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => (
|
||||
<Tooltip
|
||||
@ -480,14 +482,14 @@ class Test$$Page extends React.Component {
|
||||
((__$$context) => (
|
||||
<Typography.Text
|
||||
style={{
|
||||
display: "block",
|
||||
color: "#FFFFFF",
|
||||
display: 'block',
|
||||
color: '#FFFFFF',
|
||||
}}
|
||||
>
|
||||
{__$$eval(
|
||||
() =>
|
||||
item.channelId +
|
||||
" / " +
|
||||
' / ' +
|
||||
item.version
|
||||
)}
|
||||
</Typography.Text>
|
||||
@ -512,15 +514,15 @@ class Test$$Page extends React.Component {
|
||||
),
|
||||
width: 120,
|
||||
},
|
||||
{ title: "构建Job", dataIndex: "job_name", width: 180 },
|
||||
{ title: '构建Job', dataIndex: 'job_name', width: 180 },
|
||||
{
|
||||
title: "构建类型",
|
||||
dataIndex: "packaging_type",
|
||||
title: '构建类型',
|
||||
dataIndex: 'packaging_type',
|
||||
width: 94,
|
||||
},
|
||||
{
|
||||
title: "构建状态",
|
||||
dataIndex: "status",
|
||||
title: '构建状态',
|
||||
dataIndex: 'status',
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => [
|
||||
<Typography.Text>
|
||||
@ -531,7 +533,7 @@ class Test$$Page extends React.Component {
|
||||
type="SyncOutlined"
|
||||
size={16}
|
||||
spin={true}
|
||||
style={{ marginLeft: "10px" }}
|
||||
style={{ marginLeft: '10px' }}
|
||||
/>
|
||||
),
|
||||
])(
|
||||
@ -544,8 +546,8 @@ class Test$$Page extends React.Component {
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: "构建时间",
|
||||
dataIndex: "start_time",
|
||||
title: '构建时间',
|
||||
dataIndex: 'start_time',
|
||||
render: function () {
|
||||
return this.renderTime.apply(
|
||||
this,
|
||||
@ -555,8 +557,8 @@ class Test$$Page extends React.Component {
|
||||
width: 148,
|
||||
},
|
||||
{
|
||||
title: "构建人",
|
||||
dataIndex: "user",
|
||||
title: '构建人',
|
||||
dataIndex: 'user',
|
||||
render: function () {
|
||||
return this.renderUserName.apply(
|
||||
this,
|
||||
@ -566,8 +568,8 @@ class Test$$Page extends React.Component {
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: "Jenkins 链接",
|
||||
dataIndex: "jenkins_link",
|
||||
title: 'Jenkins 链接',
|
||||
dataIndex: 'jenkins_link',
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => [
|
||||
!!__$$eval(() => text) && (
|
||||
@ -591,8 +593,8 @@ class Test$$Page extends React.Component {
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: "测试平台链接",
|
||||
dataIndex: "is_run_testing",
|
||||
title: '测试平台链接',
|
||||
dataIndex: 'is_run_testing',
|
||||
width: 120,
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => [
|
||||
@ -615,26 +617,26 @@ class Test$$Page extends React.Component {
|
||||
})
|
||||
),
|
||||
},
|
||||
{ title: "触发源", dataIndex: "source", width: 120 },
|
||||
{ title: '触发源', dataIndex: 'source', width: 120 },
|
||||
{
|
||||
title: "详情",
|
||||
dataIndex: "id",
|
||||
title: '详情',
|
||||
dataIndex: 'id',
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
style={{ padding: "0px" }}
|
||||
style={{ padding: '0px' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "handleDetail",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'handleDetail',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onClick", disabled: true },
|
||||
{ name: 'onClick', disabled: true },
|
||||
],
|
||||
}}
|
||||
onClick={function () {
|
||||
@ -656,28 +658,28 @@ class Test$$Page extends React.Component {
|
||||
})
|
||||
),
|
||||
width: 80,
|
||||
fixed: "right",
|
||||
fixed: 'right',
|
||||
},
|
||||
{
|
||||
title: "结果",
|
||||
dataIndex: "id",
|
||||
title: '结果',
|
||||
dataIndex: 'id',
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
style={{ padding: "0px" }}
|
||||
style={{ padding: '0px' }}
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "handleResult",
|
||||
paramStr: "this.text",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'handleResult',
|
||||
paramStr: 'this.text',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onClick", disabled: true },
|
||||
{ name: 'onClick', disabled: true },
|
||||
],
|
||||
}}
|
||||
onClick={function () {
|
||||
@ -701,11 +703,11 @@ class Test$$Page extends React.Component {
|
||||
})
|
||||
),
|
||||
width: 80,
|
||||
fixed: "right",
|
||||
fixed: 'right',
|
||||
},
|
||||
{
|
||||
title: "重新执行",
|
||||
dataIndex: "id",
|
||||
title: '重新执行',
|
||||
dataIndex: 'id',
|
||||
width: 92,
|
||||
render: (text, record, index) =>
|
||||
((__$$context) => (
|
||||
@ -718,11 +720,11 @@ class Test$$Page extends React.Component {
|
||||
size={14}
|
||||
color="#0593d3"
|
||||
style={{
|
||||
padding: "3px",
|
||||
border: "1px solid #0593d3",
|
||||
borderRadius: "14px",
|
||||
cursor: "pointer",
|
||||
height: "22px",
|
||||
padding: '3px',
|
||||
border: '1px solid #0593d3',
|
||||
borderRadius: '14px',
|
||||
cursor: 'pointer',
|
||||
height: '22px',
|
||||
}}
|
||||
spin={false}
|
||||
/>
|
||||
@ -731,13 +733,13 @@ class Test$$Page extends React.Component {
|
||||
__events={{
|
||||
eventDataList: [
|
||||
{
|
||||
type: "componentEvent",
|
||||
name: "onClick",
|
||||
relatedEventName: "reload",
|
||||
type: 'componentEvent',
|
||||
name: 'onClick',
|
||||
relatedEventName: 'reload',
|
||||
},
|
||||
],
|
||||
eventList: [
|
||||
{ name: "onClick", disabled: true },
|
||||
{ name: 'onClick', disabled: true },
|
||||
],
|
||||
}}
|
||||
onClick={function () {
|
||||
@ -756,7 +758,7 @@ class Test$$Page extends React.Component {
|
||||
index,
|
||||
})
|
||||
),
|
||||
fixed: "right",
|
||||
fixed: 'right',
|
||||
},
|
||||
]}
|
||||
actions={[]}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user