From acdad67ca7a4dc899b0f328dd1dedb0290158796 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 12:01:55 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=8F=91=E4=B8=AA=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb8e5d47..455f2647 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amis", - "version": "1.0.12", + "version": "1.0.13", "description": "一种MIS页面生成工具", "main": "lib/index.js", "scripts": { From 8837f921380eee79394bb4618b7bb432bdb68919 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 14:36:06 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20curd=20=20filter=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=90=8C=E6=AD=A5=E5=88=B0=E5=AD=90?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/factory.tsx | 1 + src/renderers/Card.tsx | 1 + src/store/list.ts | 10 ++++++++-- src/store/table.ts | 5 +++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/factory.tsx b/src/factory.tsx index 7cce0908..74c5490b 100644 --- a/src/factory.tsx +++ b/src/factory.tsx @@ -799,6 +799,7 @@ export function HocStoreFactory(renderer: { props.data.__super, false )) && + // nextProps.data.__super !== props.data.__super) && store.initData( createObject(nextProps.data.__super, { ...nextProps.data, diff --git a/src/renderers/Card.tsx b/src/renderers/Card.tsx index aff85b79..f9b2e25f 100644 --- a/src/renderers/Card.tsx +++ b/src/renderers/Card.tsx @@ -434,6 +434,7 @@ export class CardItemFieldRenderer extends TableCell { render() { let { + type, className, render, style, diff --git a/src/store/list.ts b/src/store/list.ts index f1cab522..94c8e4f2 100644 --- a/src/store/list.ts +++ b/src/store/list.ts @@ -9,7 +9,13 @@ import { import {iRendererStore} from './iRenderer'; import isEqual from 'lodash/isEqual'; import find from 'lodash/find'; -import {createObject, isObject, guid, immutableExtends} from '../utils/helper'; +import { + createObject, + isObject, + guid, + immutableExtends, + extendObject +} from '../utils/helper'; import {evalExpression} from '../utils/tpl'; export const Item = types @@ -41,7 +47,7 @@ export const Item = types get locals(): any { return createObject( - createObject((getParent(self, 2) as IListStore).data, { + extendObject((getParent(self, 2) as IListStore).data, { index: self.index }), self.data diff --git a/src/store/table.ts b/src/store/table.ts index 41c92d6a..3282c88f 100644 --- a/src/store/table.ts +++ b/src/store/table.ts @@ -22,7 +22,8 @@ import { flattenTree, eachTree, difference, - immutableExtends + immutableExtends, + extendObject } from '../utils/helper'; import {evalExpression} from '../utils/tpl'; @@ -128,7 +129,7 @@ export const Row = types get locals(): any { return createObject( - createObject((getParent(self, self.depth * 2) as ITableStore).data, { + extendObject((getParent(self, self.depth * 2) as ITableStore).data, { index: self.index }), self.data From f62a7a20d089d2c802c6b89ba9c5bed390a2e7c3 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 14:50:45 +0800 Subject: [PATCH 03/13] =?UTF-8?q?AsideNav=20=E7=9A=84=20itemArrow=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=20svg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/components/App.jsx | 6 +++++- scss/layout/_aside.scss | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/examples/components/App.jsx b/examples/components/App.jsx index 684b2cfa..aab2995a 100644 --- a/examples/components/App.jsx +++ b/examples/components/App.jsx @@ -1,9 +1,11 @@ import React from 'react'; import NotFound from '../../src/components/404'; +import NotFound from '../../src/components/404'; import Layout from '../../src/components/Layout'; import AsideNav from '../../src/components/AsideNav'; import {AlertComponent, ToastComponent} from '../../src/components/index'; import {mapTree} from '../../src/utils/helper'; +import {Icon} from '../../src/components/icons'; import '../../src/locale/en'; import { Router, @@ -668,7 +670,9 @@ export class App extends React.PureComponent { key="expand-toggle" className={cx('AsideNav-itemArrow')} onClick={e => toggleExpand(link, e)} - /> + > + + ); } diff --git a/scss/layout/_aside.scss b/scss/layout/_aside.scss index c1dc9dc7..1c11874f 100644 --- a/scss/layout/_aside.scss +++ b/scss/layout/_aside.scss @@ -24,7 +24,7 @@ line-height: px2rem(17px); margin-top: px2rem(2px); - &::before { + &:empty:before { content: ''; display: inline-block; transform-origin: center; @@ -36,10 +36,22 @@ background-repeat: no-repeat; } - .#{$ns}AsideNav-item.is-open > a > &::before { + .#{$ns}AsideNav-item.is-open > a > &:empty:before { transform: rotate(90deg); color: $Layout-asideLink-onActive-arrowColor; } + + > svg { + color: $Layout-asideLink-color; + width: px2rem(10px); + height: px2rem(10px); + transform-origin: center; + transition: transform 0.2s ease; + } + + .#{$ns}AsideNav-item.is-open > a > & > svg { + transform: rotate(90deg); + } } &-itemBadge { From ea52e58ceb3f9a4fea2e28c3d2a33cfea35ce6ce Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 15:40:40 +0800 Subject: [PATCH 04/13] =?UTF-8?q?CRUD=20=E4=B8=80=E6=AC=A1=E6=80=A7?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/CRUD.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index 747b8d95..4541bf32 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -630,6 +630,7 @@ export default class CRUD extends React.Component { this.search( dialogAction.__from ? {[pageField || 'page']: 1} : undefined, undefined, + true, true ); } else if ( @@ -757,7 +758,15 @@ export default class CRUD extends React.Component { evalExpression(stopAutoRefreshWhen, data) )) && (this.timer = setTimeout( - silentPolling ? this.silentSearch : this.search, + silentPolling + ? this.silentSearch.bind(this, undefined, undefined, true) + : this.search.bind( + this, + undefined, + undefined, + undefined, + true + ), Math.max(interval, 3000) )); return value; @@ -765,8 +774,8 @@ export default class CRUD extends React.Component { : source && store.initFromScope(data, source); } - silentSearch(values?: object) { - return this.search(values, true); + silentSearch(values?: object, clearSelection?: boolean, forceReload = false) { + return this.search(values, true, clearSelection, forceReload); } handleChangePage(page: number, perPage?: number) { From 21ef418438ddfac49fabb8f25336880b791749b7 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 15:44:37 +0800 Subject: [PATCH 05/13] =?UTF-8?q?CRUD=20=E4=B8=80=E6=AC=A1=E6=80=A7?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/CRUD.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index 4541bf32..7b12e9b2 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -359,7 +359,7 @@ export default class CRUD extends React.Component { redirect && !action.blank && env.jumpTo(redirect, action); action.reload ? this.reloadTarget(action.reload, data) - : this.search(undefined, undefined, true); + : this.search(undefined, undefined, true, true); }) .catch(() => {}); } else if ( From 2fa6874bace99e911c3035d78f5e84838c13a08f Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 15:57:12 +0800 Subject: [PATCH 06/13] fix https://github.com/baidu/amis/issues/692 --- src/components/InputBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/InputBox.tsx b/src/components/InputBox.tsx index 77069e09..84309345 100644 --- a/src/components/InputBox.tsx +++ b/src/components/InputBox.tsx @@ -6,7 +6,7 @@ import {Icon} from './icons'; export interface InputBoxProps extends ThemeProps, - Omit, 'prefix' | 'onChange'> { + Omit, 'prefix' | 'onChange'> { value?: string; onChange?: (value: string) => void; onClear?: (e: React.MouseEvent) => void; From 4b881d24f6e1e2e24ff455a8d7fdb89f7a3faf34 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 16:02:30 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 455f2647..d2d2159a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amis", - "version": "1.0.13", + "version": "1.0.14", "description": "一种MIS页面生成工具", "main": "lib/index.js", "scripts": { From 8e25149e2050e9ba8e44797dc4ab32916c543232 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 15 Jun 2020 20:27:26 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/icons/pencil.svg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/icons/pencil.svg b/src/icons/pencil.svg index 09e550c1..bf30ecd5 100644 --- a/src/icons/pencil.svg +++ b/src/icons/pencil.svg @@ -1,6 +1,7 @@ - - - + + + + From 10b4ce8e13146d8ce384232a132af46f13ee04d3 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 16 Jun 2020 11:15:36 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E5=99=A8=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/renderers/Form/File.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/renderers/Form/File.md b/docs/renderers/Form/File.md index eea796c4..e88a327c 100644 --- a/docs/renderers/Form/File.md +++ b/docs/renderers/Form/File.md @@ -34,3 +34,29 @@ ``` 如果不希望 File 控件接管上传,可以配置 `asBlob` 或者 `asBase64` 这两个属性(二选一),采用这种方式后,File 控件不再自己上传了,而是直接把文件数据作为表单项的值,文件内容会在 Form 表单提交的接口里面一起带上。 + +### 接口说明 + +开始之前请你先阅读[整体要求](../api.md)。 + +#### reciever + +用来自己实现文件接收 + +**发送:** + +POST 方式,内容体为 form-data/multipart 格式。文件的字段名为 file。 + +**响应:** + +常规返回格式如下: + +```json +{ + "status": 0, + "msg": "", + "data": { + "value": "一般为文件的下载地址" + } +} +``` From 7c39e92f9abbe1cba5fa2cb76d11200fe39779d0 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 16 Jun 2020 14:30:25 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/_variables.scss | 2 +- scss/components/_dropdown.scss | 4 ++++ scss/themes/cxd.scss | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scss/_variables.scss b/scss/_variables.scss index e96061d8..f67dd964 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -948,7 +948,7 @@ $DropDown-menuItem-paddingY: ( ) / 2 !default; $DropDown-menuItem-paddingX: $gap-sm !default; $DropDown-menuItem-onHover-color: inherit !default; -$DropDown-menuItem-onHover-bg: $Button--default-onHover-bg !default; +$DropDown-menuItem-onHover-bg: $ListMenu-item--onHover-bg !default; // Checks $Checkbox-gap: $gap-sm !default; diff --git a/scss/components/_dropdown.scss b/scss/components/_dropdown.scss index d2b59173..c2c346f8 100644 --- a/scss/components/_dropdown.scss +++ b/scss/components/_dropdown.scss @@ -85,4 +85,8 @@ border: none; box-shadow: none; } + + > .#{$ns}Button { + min-width: unset; + } } diff --git a/scss/themes/cxd.scss b/scss/themes/cxd.scss index aad7bce7..77a0ccf5 100644 --- a/scss/themes/cxd.scss +++ b/scss/themes/cxd.scss @@ -415,7 +415,7 @@ $Toast-border-width: px2rem(1px); $Toast-icon-width: px2rem(16px); $Toast-icon-height: px2rem(16px); $Toast-opacity: 1; -$Toast-title-display: inline-block; +$Toast-title-display: inline; // Toast color $Toast-color: $white; From 5aa1373c8967ae471bf18885d86812515984f4a9 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 16 Jun 2020 14:37:12 +0800 Subject: [PATCH 11/13] =?UTF-8?q?TinyMce=20=E7=89=88=E6=9C=AC=20options=20?= =?UTF-8?q?=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/RichText.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderers/Form/RichText.tsx b/src/renderers/Form/RichText.tsx index 733ca8bd..643b66c6 100644 --- a/src/renderers/Form/RichText.tsx +++ b/src/renderers/Form/RichText.tsx @@ -169,6 +169,7 @@ export default class RichTextControl extends React.Component< } else { const fetcher = props.env.fetcher; this.config = { + ...props.options, images_upload_url: props.reciever, images_upload_handler: async ( blobInfo: any, From a1969777a6ba22757608e0f00b43a9c76c723cf7 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 16 Jun 2020 15:14:59 +0800 Subject: [PATCH 12/13] =?UTF-8?q?Tinymce=20=E5=90=8E=E7=BB=AD=E7=9A=84=20v?= =?UTF-8?q?alue=20=E6=9B=B4=E6=96=B0=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tinymce.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Tinymce.tsx b/src/components/Tinymce.tsx index 4c09675b..c7538638 100644 --- a/src/components/Tinymce.tsx +++ b/src/components/Tinymce.tsx @@ -126,6 +126,17 @@ export default class TinymceEditor extends React.Component { tinymce.init(this.config); } + componentDidUpdate(prevProps: TinymceEditorProps) { + const props = this.props; + + if ( + props.model !== prevProps.model && + props.model !== this.currentContent + ) { + this.editor?.setContent(props.model || ''); + } + } + componentWillUnmount() { tinymce.remove(this.editor); } From a2e0f210c50deb8f376cc3e2a6f5ba03772060cb Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 16 Jun 2020 20:23:42 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/components/_pagination.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/scss/components/_pagination.scss b/scss/components/_pagination.scss index d95b012e..ace80db9 100644 --- a/scss/components/_pagination.scss +++ b/scss/components/_pagination.scss @@ -10,6 +10,7 @@ > a, > span { user-select: none; + cursor: pointer; position: relative; float: left; text-decoration: none;