mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 10:38:16 +08:00
修复 schema.json 编译问题
This commit is contained in:
parent
d6bd8ab0e2
commit
7826903726
@ -5,20 +5,16 @@ set -e
|
||||
echo "building"
|
||||
node ./scripts/generate-search-data.js
|
||||
|
||||
npm run build-schemas
|
||||
|
||||
./node_modules/.bin/fis3 release gh-pages -c
|
||||
|
||||
# 拷贝一份兼容之前的访问路径
|
||||
cp -r gh-pages/zh-CN/docs/* gh-pages/docs/
|
||||
|
||||
cp ./schema.json ./gh-pages
|
||||
cp ./packages/amis/schema.json ./gh-pages
|
||||
|
||||
cp -r mock gh-pages/
|
||||
|
||||
sh build.sh
|
||||
|
||||
tar -zcvf sdk.tar.gz sdk
|
||||
tar -zcvf sdk.tar.gz packages/amis/sdk
|
||||
|
||||
mv sdk.tar.gz gh-pages/
|
||||
|
||||
|
@ -41,48 +41,48 @@
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="ang" ${
|
||||
theme !== 'ang' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/ang.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/ang.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="cxd" ${
|
||||
theme !== 'cxd' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/cxd.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/cxd.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="dark" ${
|
||||
theme !== 'dark' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/dark.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/dark.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="antd" ${
|
||||
theme !== 'antd' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/antd.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/antd.css')}" />`
|
||||
);
|
||||
} else {
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="ang" ${
|
||||
theme !== 'ang' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/ang-ie11.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/ang-ie11.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="cxd" ${
|
||||
theme !== 'cxd' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/cxd-ie11.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/cxd-ie11.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="dark" ${
|
||||
theme !== 'dark' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/dark-ie11.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/dark-ie11.css')}" />`
|
||||
);
|
||||
document.write(
|
||||
`<link rel="stylesheet" title="antd" ${
|
||||
theme !== 'antd' ? 'disabled' : ''
|
||||
} href="${__uri('amis-ui/lib/themes/antd-ie11.css')}" />`
|
||||
} href="${__uri('amis/lib/themes/antd-ie11.css')}" />`
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<!--ignore-->
|
||||
<link rel="stylesheet" href="amis-ui/lib/helper.css" />
|
||||
<link rel="stylesheet" href="amis/lib/helper.css" />
|
||||
<!--ignore-->
|
||||
</head>
|
||||
|
||||
|
@ -7,7 +7,8 @@ import {
|
||||
Schema,
|
||||
ActionObject,
|
||||
Payload,
|
||||
ClassName
|
||||
ClassName,
|
||||
BaseApiObject
|
||||
} from '../types';
|
||||
import {filter, evalExpression} from '../utils/tpl';
|
||||
import getExprProperties from '../utils/filter-schema';
|
||||
@ -85,12 +86,12 @@ export interface FormSchemaBase {
|
||||
/**
|
||||
* 用来初始化表单数据
|
||||
*/
|
||||
initApi?: Api;
|
||||
initApi?: string | BaseApiObject;
|
||||
|
||||
/**
|
||||
* Form 用来获取初始数据的 api,与initApi不同的是,会一直轮询请求该接口,直到返回 finished 属性为 true 才 结束。
|
||||
*/
|
||||
initAsyncApi?: Api;
|
||||
initAsyncApi?: string | BaseApiObject;
|
||||
|
||||
/**
|
||||
* 设置了initAsyncApi后,默认会从返回数据的data.finished来判断是否完成,也可以设置成其他的xxx,就会从data.xxx中获取
|
||||
@ -142,7 +143,7 @@ export interface FormSchemaBase {
|
||||
*
|
||||
* 详情:https://baidu.gitee.io/amis/docs/components/form/index#%E8%A1%A8%E5%8D%95%E6%8F%90%E4%BA%A4
|
||||
*/
|
||||
api?: Api;
|
||||
api?: string | BaseApiObject;
|
||||
|
||||
/**
|
||||
* Form 也可以配置 feedback。
|
||||
@ -152,7 +153,7 @@ export interface FormSchemaBase {
|
||||
/**
|
||||
* 设置此属性后,表单提交发送保存接口后,还会继续轮询请求该接口,直到返回 finished 属性为 true 才 结束。
|
||||
*/
|
||||
asyncApi?: Api;
|
||||
asyncApi?: string | BaseApiObject;
|
||||
|
||||
/**
|
||||
* 轮询请求的时间间隔,默认为 3秒。设置 asyncApi 才有效
|
||||
|
@ -23,6 +23,7 @@ import {FormHorizontal, FormSchemaBase} from './Form';
|
||||
import {
|
||||
Api,
|
||||
ApiObject,
|
||||
BaseApiObject,
|
||||
BaseSchemaWithoutType,
|
||||
ClassName,
|
||||
Schema
|
||||
@ -283,7 +284,7 @@ export interface FormBaseControl extends BaseSchemaWithoutType {
|
||||
/**
|
||||
* 远端校验表单项接口
|
||||
*/
|
||||
validateApi?: Api;
|
||||
validateApi?: string | BaseApiObject;
|
||||
}
|
||||
|
||||
export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Api} from 'amis-core';
|
||||
import {Api, BaseApiObject} from 'amis-core';
|
||||
|
||||
export type FieldTypes =
|
||||
| 'text'
|
||||
@ -153,14 +153,14 @@ interface SelectField extends BaseField {
|
||||
name: string;
|
||||
multiple?: boolean;
|
||||
options?: Array<any>;
|
||||
source?: Api;
|
||||
source?: string | BaseApiObject;
|
||||
searchable?: boolean;
|
||||
|
||||
/**
|
||||
* 自动完成 API,当输入部分文字的时候,会将这些文字通过 ${term} 可以取到,发送给接口。
|
||||
* 接口可以返回匹配到的选项,帮助用户输入。
|
||||
*/
|
||||
autoComplete?: Api;
|
||||
autoComplete?: string | BaseApiObject;
|
||||
}
|
||||
|
||||
interface BooleanField extends BaseField {
|
||||
|
@ -119,7 +119,11 @@ import {TabsTransferPickerControlSchema} from './renderers/Form/TabsTransferPick
|
||||
import {UserSelectControlSchema} from './renderers/Form/UserSelect';
|
||||
import {JSONSchemaEditorControlSchema} from './renderers/Form/JSONSchemaEditor';
|
||||
import {TableSchemaV2} from './renderers/Table-v2';
|
||||
import {BaseSchemaWithoutType} from 'amis-core';
|
||||
import {
|
||||
BaseSchemaWithoutType,
|
||||
SchemaClassName,
|
||||
SchemaExpression
|
||||
} from 'amis-core';
|
||||
import type {FormSchemaBase} from 'amis-core/lib/renderers/Form';
|
||||
|
||||
// 每加个类型,这补充一下。
|
||||
@ -477,43 +481,6 @@ export type SchemaCollection =
|
||||
| SchemaTpl
|
||||
| Array<SchemaObject | SchemaTpl>;
|
||||
|
||||
/**
|
||||
* 表达式,语法 `data.xxx > 5`。
|
||||
*/
|
||||
export type SchemaExpression = string;
|
||||
|
||||
/**
|
||||
* css类名,配置字符串,或者对象。
|
||||
*
|
||||
* className: "red"
|
||||
*
|
||||
* 用对象配置时意味着你能跟表达式一起搭配使用,如:
|
||||
*
|
||||
* className: {
|
||||
* "red": "data.progress > 80",
|
||||
* "blue": "data.progress > 60"
|
||||
* }
|
||||
*/
|
||||
export type SchemaClassName =
|
||||
| string
|
||||
| {
|
||||
[propName: string]: boolean | undefined | null | SchemaExpression;
|
||||
};
|
||||
|
||||
// /**
|
||||
// * css类名,配置字符串,或者对象。
|
||||
// *
|
||||
// * className: "red"
|
||||
// *
|
||||
// * 用对象配置时意味着你能跟表达式一起搭配使用,如:
|
||||
// *
|
||||
// * className: {
|
||||
// * "red": "data.progress > 80",
|
||||
// * "blue": "data.progress > 60"
|
||||
// * }
|
||||
// */
|
||||
// export type SchemaClassName = string;
|
||||
|
||||
export interface SchemaApiObject {
|
||||
/**
|
||||
* API 发送类型
|
||||
@ -893,3 +860,5 @@ export interface FormSchema extends FormSchemaBase, BaseSchema {
|
||||
*/
|
||||
body?: SchemaCollection;
|
||||
}
|
||||
|
||||
export {SchemaClassName, SchemaExpression};
|
||||
|
@ -13,7 +13,7 @@ import {getVariable, createObject} from 'amis-core';
|
||||
|
||||
export interface QuickFilterConfig {
|
||||
options: Array<any>;
|
||||
source: Api;
|
||||
// source: Api;
|
||||
multiple: boolean;
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type {ActionSchema} from './renderers/Action';
|
||||
import {SchemaApiObject} from './Schema';
|
||||
import {SchemaApi, SchemaApiObject} from './Schema';
|
||||
|
||||
export interface ApiObject extends SchemaApiObject {
|
||||
config?: {
|
||||
@ -115,8 +115,8 @@ export interface Action extends Button {
|
||||
| 'selectAll'
|
||||
| 'changeTabKey'
|
||||
| 'click';
|
||||
api?: Api;
|
||||
asyncApi?: Api;
|
||||
api?: SchemaApi;
|
||||
asyncApi?: SchemaApi;
|
||||
payload?: any;
|
||||
dialog?: SchemaNode;
|
||||
to?: string;
|
||||
|
Loading…
Reference in New Issue
Block a user