cloud-b2b 1.1.52 → 1.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/es/Area/Area.js +141 -0
  2. package/es/Card/Card.js +19 -0
  3. package/es/CodeInput/CodeInput.js +123 -0
  4. package/es/Control/Control.js +444 -0
  5. package/es/Control/event.js +43 -0
  6. package/es/Enhance/Dialogs.js +52 -0
  7. package/es/Enhance/Loading.js +131 -0
  8. package/{src → es}/Enhance/index.js +6 -8
  9. package/es/Header/Header.js +162 -0
  10. package/es/Header/Vertical.js +106 -0
  11. package/es/ImageView/ImageView.js +100 -0
  12. package/es/Indent/Indent.js +19 -0
  13. package/es/InpurCascader/InputCascader.js +108 -0
  14. package/es/InputEditor/InputEditor.js +173 -0
  15. package/es/InputSearch/InputSearch.js +266 -0
  16. package/es/InputSelect/InputSelect.js +160 -0
  17. package/es/InputTreeSelect/InputTreeSelect.js +121 -0
  18. package/es/InputWriting/InputWriting.js +85 -0
  19. package/es/Layout/Layout.js +201 -0
  20. package/es/LayoutLink/LayoutLink.js +73 -0
  21. package/es/Link/Link.js +85 -0
  22. package/es/Loading/Loading.js +13 -0
  23. package/es/Loading2/Loading2.js +9 -0
  24. package/es/ModalWithDrag/ModalWithDrag.js +29 -0
  25. package/{src → es}/ModalWithDrag/drag.js +116 -128
  26. package/es/NumberInput/NumberInput.js +200 -0
  27. package/es/Search/Search.js +497 -0
  28. package/es/Sidebar/Sidebar.js +144 -0
  29. package/es/Sidebar2/Sidebar.js +165 -0
  30. package/es/SuperForm/SuperForm.js +593 -0
  31. package/es/SuperForm2/SuperForm.js +687 -0
  32. package/es/SuperIcon/SuperIcon.js +27 -0
  33. package/es/SuperPagination/SuperPagination.js +109 -0
  34. package/es/SuperTab/SuperTab.js +107 -0
  35. package/es/SuperTab2/SuperTab2.js +145 -0
  36. package/es/SuperTable/DragSortRow.js +97 -0
  37. package/es/SuperTable/FilterDropDown.js +164 -0
  38. package/es/SuperTable/SuperTable.js +808 -0
  39. package/es/SuperTable/fixed.js +34 -0
  40. package/es/SuperTable2/SuperTable2.js +894 -0
  41. package/es/SuperTable2/SuperTableCell.js +198 -0
  42. package/es/SuperTable3/FilterDropDown.js +164 -0
  43. package/es/SuperTable3/SuperTable.js +665 -0
  44. package/es/SuperTable3/fixed.js +34 -0
  45. package/es/SuperToolbar/SuperToolbar.js +195 -0
  46. package/es/SuperUpload/SuperUpload.js +356 -0
  47. package/es/Title/Title.js +33 -0
  48. package/es/Viewer/ImageViews.js +258 -0
  49. package/es/Viewer/Viewer.js +122 -0
  50. package/es/WingBlank/WingBlank.js +16 -0
  51. package/es/helper.js +240 -0
  52. package/{src → es}/history.js +6 -6
  53. package/es/index.js +37 -0
  54. package/es/variables.js +6 -0
  55. package/lib/Area/Area.js +149 -0
  56. package/lib/Area/package.json +6 -0
  57. package/lib/Card/Card.js +27 -0
  58. package/lib/Card/package.json +6 -0
  59. package/lib/CodeInput/CodeInput.js +131 -0
  60. package/lib/CodeInput/package.json +6 -0
  61. package/lib/Control/Control.js +450 -0
  62. package/lib/Control/event.js +51 -0
  63. package/lib/Control/package.json +6 -0
  64. package/lib/Enhance/Dialogs.js +60 -0
  65. package/lib/Enhance/Loading.js +138 -0
  66. package/lib/Enhance/index.js +25 -0
  67. package/lib/Enhance/package.json +6 -0
  68. package/lib/Header/Header.js +169 -0
  69. package/lib/Header/Header.less +95 -0
  70. package/lib/Header/Vertical.js +114 -0
  71. package/lib/Header/Vertical.less +60 -0
  72. package/lib/Header/package.json +6 -0
  73. package/lib/ImageView/ImageView.js +108 -0
  74. package/lib/ImageView/ImageView.less +14 -0
  75. package/lib/ImageView/package.json +6 -0
  76. package/lib/Indent/Indent.js +27 -0
  77. package/lib/Indent/package.json +6 -0
  78. package/lib/InpurCascader/InputCascader.js +115 -0
  79. package/lib/InpurCascader/package.json +6 -0
  80. package/lib/InputEditor/InputEditor.js +181 -0
  81. package/lib/InputEditor/inputEditor.less +8 -0
  82. package/lib/InputEditor/package.json +6 -0
  83. package/lib/InputSearch/InputSearch.js +274 -0
  84. package/lib/InputSearch/package.json +6 -0
  85. package/lib/InputSelect/InputSelect.js +168 -0
  86. package/lib/InputSelect/package.json +6 -0
  87. package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
  88. package/lib/InputTreeSelect/package.json +6 -0
  89. package/lib/InputWriting/InputWriting.js +93 -0
  90. package/lib/InputWriting/package.json +6 -0
  91. package/lib/Layout/Layout.js +209 -0
  92. package/lib/Layout/Layout.less +28 -0
  93. package/lib/Layout/package.json +6 -0
  94. package/lib/LayoutLink/LayoutLink.js +86 -0
  95. package/lib/LayoutLink/LayoutLink.less +53 -0
  96. package/lib/LayoutLink/package.json +6 -0
  97. package/lib/Link/Link.js +93 -0
  98. package/lib/Link/package.json +6 -0
  99. package/lib/Loading/Loading.js +21 -0
  100. package/lib/Loading/Loading.less +13 -0
  101. package/lib/Loading/package.json +6 -0
  102. package/lib/Loading2/Loading2.js +17 -0
  103. package/lib/Loading2/Loading2.less +19 -0
  104. package/lib/Loading2/package.json +6 -0
  105. package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
  106. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  107. package/lib/ModalWithDrag/drag.js +124 -0
  108. package/lib/ModalWithDrag/package.json +6 -0
  109. package/lib/NumberInput/NumberInput.js +208 -0
  110. package/lib/NumberInput/package.json +6 -0
  111. package/lib/Search/Search.js +510 -0
  112. package/lib/Search/Search.less +63 -0
  113. package/lib/Search/package.json +6 -0
  114. package/lib/Sidebar/Sidebar.js +152 -0
  115. package/lib/Sidebar/Sidebar.less +78 -0
  116. package/lib/Sidebar/package.json +6 -0
  117. package/lib/Sidebar2/Sidebar.js +173 -0
  118. package/lib/Sidebar2/Sidebar.less +153 -0
  119. package/lib/Sidebar2/package.json +6 -0
  120. package/lib/SuperForm/SuperForm.js +605 -0
  121. package/lib/SuperForm/SuperForm.less +52 -0
  122. package/lib/SuperForm/package.json +6 -0
  123. package/lib/SuperForm2/SuperForm.js +699 -0
  124. package/lib/SuperForm2/SuperForm.less +52 -0
  125. package/lib/SuperForm2/package.json +6 -0
  126. package/lib/SuperIcon/SuperIcon.js +35 -0
  127. package/lib/SuperIcon/package.json +6 -0
  128. package/lib/SuperPagination/SuperPagination.js +117 -0
  129. package/lib/SuperPagination/package.json +6 -0
  130. package/lib/SuperTab/SuperTab.js +115 -0
  131. package/lib/SuperTab/SuperTab.less +43 -0
  132. package/lib/SuperTab/package.json +6 -0
  133. package/lib/SuperTab2/SuperTab2.js +153 -0
  134. package/lib/SuperTab2/SuperTab2.less +18 -0
  135. package/lib/SuperTab2/package.json +6 -0
  136. package/lib/SuperTable/DragSortRow.js +105 -0
  137. package/lib/SuperTable/DragSortRow.less +17 -0
  138. package/lib/SuperTable/FilterDropDown.js +172 -0
  139. package/lib/SuperTable/FilterDropDown.less +30 -0
  140. package/lib/SuperTable/SuperTable.js +816 -0
  141. package/lib/SuperTable/SuperTable.less +132 -0
  142. package/lib/SuperTable/fixed.js +42 -0
  143. package/lib/SuperTable/package.json +6 -0
  144. package/lib/SuperTable2/SuperTable2.js +907 -0
  145. package/lib/SuperTable2/SuperTable2.less +118 -0
  146. package/lib/SuperTable2/SuperTableCell.js +203 -0
  147. package/lib/SuperTable2/package.json +6 -0
  148. package/lib/SuperTable3/FilterDropDown.js +172 -0
  149. package/lib/SuperTable3/FilterDropDown.less +29 -0
  150. package/lib/SuperTable3/SuperTable.js +673 -0
  151. package/lib/SuperTable3/SuperTable.less +99 -0
  152. package/lib/SuperTable3/fixed.js +42 -0
  153. package/lib/SuperTable3/package.json +6 -0
  154. package/lib/SuperToolbar/SuperToolbar.js +203 -0
  155. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  156. package/lib/SuperToolbar/package.json +6 -0
  157. package/lib/SuperUpload/SuperUpload.js +368 -0
  158. package/lib/SuperUpload/SuperUpload.less +28 -0
  159. package/lib/SuperUpload/package.json +6 -0
  160. package/lib/Title/Title.js +41 -0
  161. package/lib/Title/Title.less +35 -0
  162. package/lib/Title/package.json +6 -0
  163. package/lib/Viewer/ImageViews.js +266 -0
  164. package/lib/Viewer/Viewer.js +130 -0
  165. package/lib/Viewer/Viewer.less +67 -0
  166. package/lib/Viewer/imgView.less +59 -0
  167. package/lib/Viewer/package.json +7 -0
  168. package/lib/WingBlank/WingBlank.js +24 -0
  169. package/lib/WingBlank/WingBlank.less +12 -0
  170. package/lib/WingBlank/package.json +6 -0
  171. package/lib/adjust.less +89 -0
  172. package/lib/helper.js +246 -0
  173. package/lib/history.js +12 -0
  174. package/lib/index.js +271 -0
  175. package/lib/index.less +31 -0
  176. package/lib/style.less +30 -0
  177. package/lib/variables.js +14 -0
  178. package/lib/variables.less +73 -0
  179. package/package.json +22 -44
  180. package/src/Area/Area.js +0 -94
  181. package/src/Card/Card.js +0 -16
  182. package/src/CodeInput/CodeInput.js +0 -76
  183. package/src/Control/Control.js +0 -338
  184. package/src/Control/event.js +0 -45
  185. package/src/Enhance/Dialogs.js +0 -24
  186. package/src/Enhance/Loading.js +0 -83
  187. package/src/Header/Header.js +0 -149
  188. package/src/Header/Vertical.js +0 -74
  189. package/src/ImageView/ImageView.js +0 -62
  190. package/src/Indent/Indent.js +0 -12
  191. package/src/InpurCascader/InputCascader.js +0 -83
  192. package/src/InputEditor/InputEditor.js +0 -93
  193. package/src/InputSearch/InputSearch.js +0 -186
  194. package/src/InputSelect/InputSelect.js +0 -103
  195. package/src/InputTreeSelect/InputTreeSelect.js +0 -87
  196. package/src/InputWriting/InputWriting.js +0 -65
  197. package/src/Layout/Layout.js +0 -121
  198. package/src/LayoutLink/LayoutLink.js +0 -59
  199. package/src/Link/Link.js +0 -57
  200. package/src/Loading/Loading.js +0 -15
  201. package/src/Loading2/Loading2.js +0 -15
  202. package/src/ModalWithDrag/ModalWithDrag.js +0 -17
  203. package/src/NumberInput/NumberInput.js +0 -137
  204. package/src/Search/Search.js +0 -368
  205. package/src/Sidebar/Sidebar.js +0 -111
  206. package/src/Sidebar2/Sidebar.js +0 -143
  207. package/src/SuperForm/SuperForm.js +0 -516
  208. package/src/SuperForm2/SuperForm.js +0 -588
  209. package/src/SuperIcon/SuperIcon.js +0 -14
  210. package/src/SuperPagination/SuperPagination.js +0 -65
  211. package/src/SuperTab/SuperTab.js +0 -84
  212. package/src/SuperTab2/SuperTab2.js +0 -94
  213. package/src/SuperTable/DragSortRow.js +0 -62
  214. package/src/SuperTable/FilterDropDown.js +0 -111
  215. package/src/SuperTable/SuperTable.js +0 -590
  216. package/src/SuperTable/fixed.js +0 -34
  217. package/src/SuperTable2/SuperTable2.js +0 -600
  218. package/src/SuperTable2/SuperTableCell.js +0 -144
  219. package/src/SuperTable3/FilterDropDown.js +0 -111
  220. package/src/SuperTable3/SuperTable.js +0 -498
  221. package/src/SuperTable3/fixed.js +0 -34
  222. package/src/SuperToolbar/SuperToolbar.js +0 -128
  223. package/src/SuperUpload/SuperUpload.js +0 -137
  224. package/src/Title/Title.js +0 -18
  225. package/src/Viewer/ImageViews.js +0 -220
  226. package/src/Viewer/Viewer.js +0 -97
  227. package/src/WingBlank/WingBlank.js +0 -14
  228. package/src/helper.js +0 -185
  229. package/src/index.js +0 -38
  230. package/src/variables.js +0 -5
  231. package/test/index.html +0 -10
  232. package/test/test.js +0 -16
  233. package/test/test.less +0 -12
  234. package/test/webpack.config.js +0 -71
  235. package/tools/babel.config.js +0 -14
  236. package/tools/build.js +0 -70
  237. package/tools/publish.js +0 -9
  238. package/tools/util.js +0 -53
  239. /package/{src → es}/Area/package.json +0 -0
  240. /package/{src → es}/Card/package.json +0 -0
  241. /package/{src → es}/CodeInput/package.json +0 -0
  242. /package/{src → es}/Control/package.json +0 -0
  243. /package/{src → es}/Enhance/package.json +0 -0
  244. /package/{src → es}/Header/Header.less +0 -0
  245. /package/{src → es}/Header/Vertical.less +0 -0
  246. /package/{src → es}/Header/package.json +0 -0
  247. /package/{src → es}/ImageView/ImageView.less +0 -0
  248. /package/{src → es}/ImageView/package.json +0 -0
  249. /package/{src → es}/Indent/package.json +0 -0
  250. /package/{src → es}/InpurCascader/package.json +0 -0
  251. /package/{src → es}/InputEditor/inputEditor.less +0 -0
  252. /package/{src → es}/InputEditor/package.json +0 -0
  253. /package/{src → es}/InputSearch/package.json +0 -0
  254. /package/{src → es}/InputSelect/package.json +0 -0
  255. /package/{src → es}/InputTreeSelect/package.json +0 -0
  256. /package/{src → es}/InputWriting/package.json +0 -0
  257. /package/{src → es}/Layout/Layout.less +0 -0
  258. /package/{src → es}/Layout/package.json +0 -0
  259. /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
  260. /package/{src → es}/LayoutLink/package.json +0 -0
  261. /package/{src → es}/Link/package.json +0 -0
  262. /package/{src → es}/Loading/Loading.less +0 -0
  263. /package/{src → es}/Loading/package.json +0 -0
  264. /package/{src → es}/Loading2/Loading2.less +0 -0
  265. /package/{src → es}/Loading2/package.json +0 -0
  266. /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
  267. /package/{src → es}/ModalWithDrag/package.json +0 -0
  268. /package/{src → es}/NumberInput/package.json +0 -0
  269. /package/{src → es}/Search/Search.less +0 -0
  270. /package/{src → es}/Search/package.json +0 -0
  271. /package/{src → es}/Sidebar/Sidebar.less +0 -0
  272. /package/{src → es}/Sidebar/package.json +0 -0
  273. /package/{src → es}/Sidebar2/Sidebar.less +0 -0
  274. /package/{src → es}/Sidebar2/package.json +0 -0
  275. /package/{src → es}/SuperForm/SuperForm.less +0 -0
  276. /package/{src → es}/SuperForm/package.json +0 -0
  277. /package/{src → es}/SuperForm2/SuperForm.less +0 -0
  278. /package/{src → es}/SuperForm2/package.json +0 -0
  279. /package/{src → es}/SuperIcon/package.json +0 -0
  280. /package/{src → es}/SuperPagination/package.json +0 -0
  281. /package/{src → es}/SuperTab/SuperTab.less +0 -0
  282. /package/{src → es}/SuperTab/package.json +0 -0
  283. /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
  284. /package/{src → es}/SuperTab2/package.json +0 -0
  285. /package/{src → es}/SuperTable/DragSortRow.less +0 -0
  286. /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
  287. /package/{src → es}/SuperTable/SuperTable.less +0 -0
  288. /package/{src → es}/SuperTable/package.json +0 -0
  289. /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
  290. /package/{src → es}/SuperTable2/package.json +0 -0
  291. /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
  292. /package/{src → es}/SuperTable3/SuperTable.less +0 -0
  293. /package/{src → es}/SuperTable3/package.json +0 -0
  294. /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
  295. /package/{src → es}/SuperToolbar/package.json +0 -0
  296. /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
  297. /package/{src → es}/SuperUpload/package.json +0 -0
  298. /package/{src → es}/Title/Title.less +0 -0
  299. /package/{src → es}/Title/package.json +0 -0
  300. /package/{src → es}/Viewer/Viewer.less +0 -0
  301. /package/{src → es}/Viewer/imgView.less +0 -0
  302. /package/{src → es}/Viewer/package.json +0 -0
  303. /package/{src → es}/WingBlank/WingBlank.less +0 -0
  304. /package/{src → es}/WingBlank/package.json +0 -0
  305. /package/{src → es}/adjust.less +0 -0
  306. /package/{src → es}/style.less +0 -0
  307. /package/{src → es}/variables.less +0 -0
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Loading from '../Loading';
4
-
5
- const STATUS = [
6
- 'loadingWithInit', // 显示加载画面,并自动触发onInit事件,默认值
7
- 'loading', // 显示加载画面
8
- 'retry', // 显示重试画面
9
- 'retryForHome', // 显示重试画面(触发onInit时,home参数为true)
10
- 'page', // 显示正常的页面(表明页面状态已经初始化好)
11
- ];
12
-
13
- /**
14
- * status: [可选], 当前状态。默认为loadingWithInit
15
- * home: [可选],为true表明接受首页触发的事件。默认为false
16
- * onInit: [可选],原型为func(home),home为true表明初始化是来源首页
17
- * onRefreshForHome:[可选],检测到来至首页时会触发该事件,原型为func()
18
- */
19
- const Enhance = Component => class extends React.Component {
20
- static propTypes = {
21
- status: PropTypes.oneOf(STATUS),
22
- home: PropTypes.bool,
23
- onInit: PropTypes.func,
24
- onRefreshForHome: PropTypes.func
25
- };
26
-
27
- triggerEvent = () => {
28
- if (!global.isServer) {
29
- const {status='loadingWithInit', home, onInit, onRefreshForHome} = this.props;
30
- if (!home) {
31
- if (status === 'loadingWithInit') {
32
- onInit && onInit(false);
33
- }
34
- } else {
35
- const __home = global['__home'];
36
- global['__home'] && (global['__home'] = false);
37
- if (status === 'loadingWithInit') {
38
- onInit && onInit(__home);
39
- } else if (__home) {
40
- if (status === 'page') {
41
- onRefreshForHome && onRefreshForHome();
42
- } else if (status !== 'loading') {
43
- onInit && onInit(__home);
44
- }
45
- }
46
- }
47
- }
48
- };
49
-
50
- componentDidMount() {
51
- this.triggerEvent();
52
- }
53
-
54
- componentDidUpdate() {
55
- this.triggerEvent();
56
- }
57
-
58
- onRetry = () => {
59
- const {status, onInit} = this.props;
60
- onInit && onInit(status === 'retryForHome');
61
- };
62
-
63
- getPageProps = () => {
64
- const props = {...this.props};
65
- delete props.status;
66
- delete props.home;
67
- delete props.onInit;
68
- delete props.onRefreshForHome;
69
- return props;
70
- };
71
-
72
- render() {
73
- const {status} = this.props;
74
- if (status !== 'page') {
75
- const retry = status === 'retry' || status === 'retryForHome';
76
- return <Loading retry={retry} onRetry={this.onRetry}/>;
77
- } else {
78
- return <Component {...this.getPageProps()} />;
79
- }
80
- }
81
- };
82
-
83
- export default Enhance;
@@ -1,149 +0,0 @@
1
- import React from 'react';
2
- import {Badge, Avatar, Menu, Dropdown} from 'antd';
3
- import Link from '../Link';
4
- import SuperIcon from '../SuperIcon';
5
- import helper from '../helper';
6
- import Vertical from './Vertical';
7
- import variables from '../variables';
8
-
9
- const MenuItem = Menu.Item;
10
-
11
- class Header extends React.Component {
12
-
13
- static Vertical = Vertical;
14
-
15
- constructor(props) {
16
- super(props);
17
- if (props.selectUrl) {
18
- this.state = {[props.selectKey]: props.selectUrl};
19
- }
20
- }
21
-
22
- componentWillReceiveProps(props) {
23
- if (props.selectUrl) {
24
- this.setState({[props.selectKey]: props.selectUrl});
25
- }
26
- }
27
-
28
- toLogo = () => {
29
- const img = this.props.logoImg || '/logo.png';
30
- const props = this.getLinkProps('home', this.state['main'] || this.props.homeUrl || '/', {role: 'logo'});
31
- return <Link {...props}><img src={img} alt='logo'/></Link>;
32
- };
33
-
34
- toIcon = (type) => {
35
- const style = {fontSize: 18, verticalAlign: 'middle'};
36
- return <SuperIcon type={type} style={style} />;
37
- };
38
-
39
- getLinkProps = (key, url, props={}) => {
40
- return {
41
- ...props,
42
- to: url,
43
- 'data-role': 'block',
44
- 'data-active': this.props.selectKey === key ? 'true' : null
45
- };
46
- };
47
-
48
- toSetting = (settingUrl) => {
49
- if (settingUrl) {
50
- const props = this.getLinkProps('setting', this.state['setting'] || settingUrl);
51
- return <Link {...props}>{this.toIcon('pld-setting')}</Link>;
52
- } else {
53
- return null;
54
- }
55
- };
56
-
57
- toMessage = (messageUrl, count=0) => {
58
- if (messageUrl) {
59
- const props = this.getLinkProps('message', this.state['message'] || messageUrl);
60
- const msgProps = {
61
- overflowCount: 99,
62
- title: `您有${count}条未读消息`,
63
- count
64
- };
65
- return (
66
- <Link {...props}>
67
- <span role='message'>
68
- <Badge {...msgProps}>{this.toIcon('pld-xiaoxi')}</Badge>
69
- </span>
70
- </Link>
71
- );
72
- } else {
73
- return null;
74
- }
75
- };
76
-
77
- onMenuItemClick = ({key}) => {
78
- const {onMenuClick} = this.props;
79
- onMenuClick && onMenuClick(key);
80
- };
81
-
82
- menu = (hasImport) => {
83
- return (
84
- <Menu className={variables('Header').menu} onClick={this.onMenuItemClick}>
85
- <MenuItem key='person'>个人信息</MenuItem>
86
- {hasImport ? <MenuItem key='mode'>导入模板</MenuItem> : null}
87
- <MenuItem key='modify'>修改密码</MenuItem>
88
- </Menu>
89
- );
90
- };
91
-
92
- avatar = (hasImport) => {
93
- return (
94
- <Dropdown placement='bottomRight' overlay={this.menu(hasImport)}>
95
- <span data-role='avatar' style={{cursor: 'pointer'}}>
96
- {this.toIcon(this.props.userIcon)}
97
- </span>
98
- </Dropdown>
99
- );
100
- };
101
-
102
- toPerson = () => {
103
- const hasImport = this.props.hasImport || true;
104
- return (
105
- <div role='person'>
106
- <div/>
107
- {this.avatar(hasImport)}
108
- <span>{this.props.userName}</span>
109
- </div>
110
- );
111
- };
112
-
113
- toLogout = () => {
114
- const props = {
115
- to: this.props.loginUrl,
116
- 'data-role': 'block',
117
- onClick: this.props.onLogout()
118
- };
119
- return (
120
- <Link {...props}>
121
- {this.toIcon('logout')}
122
- <span>退出</span>
123
- </Link>
124
- );
125
- };
126
-
127
- toTail = () => {
128
- const {settingUrl,messageUrl,messageCount} = this.props;
129
- return (
130
- <span>
131
- {this.toSetting(settingUrl)}
132
- {this.toMessage(messageUrl,messageCount)}
133
- {this.toPerson()}
134
- {this.toLogout()}
135
- </span>
136
- );
137
- };
138
-
139
- render() {
140
- return (
141
- <header className={variables('Header')}>
142
- {this.toLogo()}
143
- {this.toTail()}
144
- </header>
145
- );
146
- }
147
- }
148
-
149
- export default Header;
@@ -1,74 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Link from '../Link';
4
- import SuperIcon from '../SuperIcon';
5
- import variables from '../variables';
6
-
7
- const ITEM_TYPE = {
8
- key: PropTypes.string.isRequired,
9
- href: PropTypes.string.isRequired,
10
- title: PropTypes.string.isRequired,
11
- icon: PropTypes.string.isRequired
12
- };
13
-
14
- /**
15
- * selectKey: 选中的key
16
- * url:url优先级高于item中的href
17
- */
18
- class Vertical extends React.Component {
19
- static propTypes = {
20
- selectKey: PropTypes.string,
21
- url: PropTypes.object,
22
- items: PropTypes.arrayOf(PropTypes.shape(ITEM_TYPE)),
23
- onSelectKey: PropTypes.func
24
- };
25
-
26
- state = {id: ''};
27
-
28
- isSelect = (item) => {
29
- return item.key === this.props.selectKey;
30
- };
31
-
32
- getUrl = (item) => {
33
- return this.props.url[item.key] || item.href;
34
- };
35
-
36
- onClick = (selectKey) => {
37
- this.props.onSelectKey && this.props.onSelectKey(selectKey);
38
- if (this.state.id) {
39
- clearTimeout(this.state.id);
40
- }
41
- this.setState({id: setTimeout(() => {
42
- this.setState({id: ''});
43
- }, 500)})
44
- };
45
-
46
- toItem = (item) => {
47
- if (!item.jumpOut) {
48
- return (
49
- <Link key={item.key} to={this.getUrl(item)} data-select={this.isSelect(item)} onClick={this.onClick.bind(null, item.key)}>
50
- <span><SuperIcon type={item.icon} /></span>
51
- <span>{item.title}</span>
52
- </Link>
53
- );
54
- } else {
55
- const props = {key: item.key, href: item.href, target: '_blank'};
56
- return (
57
- <a {...props}>
58
- <span><SuperIcon type={item.icon} /></span>
59
- <span>{item.title}</span>
60
- </a>
61
- );
62
- }
63
- };
64
-
65
- render() {
66
- return (
67
- <header className={variables('Vertical')} data-click={!!this.state.id}>
68
- {this.props.items.map(this.toItem)}
69
- </header>
70
- );
71
- }
72
- }
73
-
74
- export default Vertical;
@@ -1,62 +0,0 @@
1
- import React from 'react';
2
- import {ModalWithDrag, Title} from '../index';
3
- import { Empty } from 'antd';
4
- import variables from '../variables';
5
-
6
- class ImageView extends React.Component{
7
- constructor(props) {
8
- super(props);
9
- this.state = {
10
- previewVisible: false,
11
- index: 0,
12
- };
13
- }
14
- ClosePreview = () => {this.setState({ previewVisible: false })}
15
- showBigImg = () =>{
16
- const {imgList} = this.props;
17
- const {previewVisible,index} = this.state;
18
- const props = {
19
- width: 900,
20
- title: imgList[index].fileName,
21
- onCancel: this.ClosePreview,
22
- visible: previewVisible,
23
- maskClosable: true,
24
- footer: null
25
- };
26
- return (
27
- <ModalWithDrag {...props}>
28
- <img alt="example" style={{ width: '100%' }} src={imgList[index].fileUrl} />
29
- </ModalWithDrag>
30
- );
31
- }
32
-
33
- toSeeImg = (e) =>{
34
- if (this.props.toSeeImg) {
35
- this.props.toSeeImg(e);
36
- } else {
37
- this.myClick(e.index)
38
- }
39
- }
40
-
41
- myClick = (index) =>{
42
- this.setState({ previewVisible: true , index: index})
43
- }
44
-
45
- render (){
46
- const {imgList,title, toSeeImg} = this.props;
47
- return (
48
- <div className={variables('ImageView')}>
49
- {title ? <Title title={title}></Title> : null}
50
- {imgList.length === 0 ? (<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />) : imgList.map((item,index) =>{
51
- return (<div className={'imgBox'} key={index} onClick={() => this.toSeeImg({imgArr:imgList,index})}>
52
- <img src={item.fileUrl}/>
53
- <p>{item.fileName}</p>
54
- </div>)
55
- })}
56
- {toSeeImg ? null : this.showBigImg()}
57
- </div>
58
- )
59
- }
60
- }
61
-
62
- export default ImageView;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
-
3
- function Indent({children, style={}, ...props}) {
4
- Object.assign(style, {paddingLeft: 8, paddingRight: 8});
5
- return (
6
- <div style={style} {...props}>
7
- {children}
8
- </div>
9
- );
10
- }
11
-
12
- export default Indent;
@@ -1,83 +0,0 @@
1
- //级联选择input
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import { Cascader } from 'antd';
5
- import { getObjectExclude } from '../helper';
6
-
7
- const optionsType = {
8
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
9
- disabled: PropTypes.bool,
10
- children: PropTypes.array,
11
- title: PropTypes.string,
12
- isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
13
- }
14
-
15
-
16
- const PROPS = {
17
- options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
18
- value: PropTypes.array.isRequired,
19
- placeholder: PropTypes.string,
20
- onChange: PropTypes.func,
21
- loadData: PropTypes.func, //动态加载 ps:loadData 与 showSearch 无法一起使用
22
- showSearch: PropTypes.func
23
- }
24
-
25
- const PROPS_KEYS = Object.keys(PROPS);
26
- class InputCascader extends React.Component {
27
- static propTypes = PROPS;
28
-
29
- constructor(props) {
30
- super(props);
31
- }
32
-
33
- onChange = (value) => {
34
- const { onChange } = this.props;
35
- onChange && onChange(value)
36
- };
37
-
38
- loadData = selectedOptions => {
39
- const { onSearch } = this.props;
40
- onSearch && onSearch(selectedOptions[0])
41
- };
42
-
43
- getOptions = (options) => {
44
- return options.map(option => {
45
- let obj = { ...option, label: option.title};
46
- if(option.children && option.children.length > 0){
47
- obj.children = this.getOptions(option.children)
48
- }
49
- return obj;
50
- })
51
- }
52
-
53
- showSearch = (inputValue, path) => {
54
-
55
- };
56
-
57
- getProps = () => {
58
- const { options = [], placeholder, size,value,loadData,showSearch } = this.props;
59
- const props = Object.assign(getObjectExclude({}, PROPS_KEYS), {
60
- onChange: this.onChange,
61
- value: value,
62
- options: this.getOptions(options),
63
- changeOnSelect: true,
64
- placeholder: placeholder,
65
- size
66
- })
67
- //动态加载 ps:loadData 与 showSearch 无法一起使用
68
- if(loadData){
69
- props.loadData = this.loadData
70
- }else if(showSearch){
71
- props.showSearch = this.showSearch;
72
- }
73
- return props;
74
- };
75
-
76
- render() {
77
- return (
78
- <Cascader {...this.getProps()} />
79
- )
80
- }
81
- }
82
-
83
- export default InputCascader;
@@ -1,93 +0,0 @@
1
- import React from 'react';
2
- import variables from '../variables';
3
- import helper from "../helper";
4
-
5
- const defaultMenus = [
6
- 'head', // 标题
7
- 'bold', // 粗体
8
- 'fontSize', // 字号
9
- 'fontName', // 字体
10
- 'italic', // 斜体
11
- 'underline', // 下划线
12
- 'strikeThrough', // 删除线
13
- 'foreColor', // 文字颜色
14
- 'backColor', // 背景颜色
15
- 'link', // 插入链接
16
- 'list', // 列表
17
- 'justify', // 对齐方式
18
- 'quote', // 引用
19
- 'image', // 插入图片
20
- 'table', // 表格
21
- 'code', // 插入代码
22
- 'video', // 插入视频
23
- ];
24
-
25
- class InputEditor extends React.Component {
26
-
27
- componentDidMount() {
28
- const {inputKey,menus,color,showLinkImg = true,uploadImgShowBase64 = true,onChange,value, readonly, uploadVideoServer='/api/proxy/base-server-service/file/client/upload/document',} = this.props;
29
- if (!readonly) {
30
- const elem = this.refs[inputKey];
31
- this[inputKey] = new E(elem);
32
- //配置菜单
33
- menus && (this[inputKey].config.menus = menus);
34
- //配置颜色
35
- color && (this[inputKey].config.menus = color);
36
- //配置菜单
37
- this[inputKey].config.menus = defaultMenus;
38
- if(menus){
39
- this[inputKey].config.menus = menus
40
- }
41
- this[inputKey].config.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
42
- this[inputKey].config.showLinkImg = showLinkImg; //隐藏网络图片
43
- if (uploadVideoServer) {
44
- this[inputKey].config.uploadVideoServer = uploadVideoServer;
45
- this[inputKey].config.uploadVideoMaxSize = 1024 * 1024 * 100; // 100MB
46
- this[inputKey].config.uploadVideoAccept = ['mp4', 'webm', 'ogg']; // 支持的视频格式
47
- this[inputKey].config.uploadVideoName = 'file'; // form-data fieldName
48
- // 自定义视频插入回调
49
- this[inputKey].config.uploadVideoHooks = {
50
- customInsert: async (insertVideo, results) => {
51
- console.log(results)
52
- if (results.returnCode === 0 && results.result) {
53
- const URL_DOWNLOAD= '/api/standard/download'; // 点击下载
54
- const {returnCode, result, returnMsg} = await helper.fetchJson(`${URL_DOWNLOAD}/${results.result}`);
55
- if (returnCode !== 0) {
56
- return helper.showError(returnMsg);
57
- }
58
- const currentOrigin = window.location.origin; // 获取当前页面的协议+域名+端口
59
- const videoUrl = `${currentOrigin}/api/proxy/base-server-service/file/url/documents/open/${results.result}`;
60
- insertVideo(videoUrl);
61
- } else {
62
- alert('视频上传失败: ' + (results.message || '未知错误'));
63
- }
64
- },
65
- };
66
- }
67
- this[inputKey].config.onchange = html => {
68
- onChange && onChange(html);
69
- };
70
- //配置编辑区域的 z-index
71
- this[inputKey].config.zIndex = 0;
72
- this[inputKey].create();
73
- this[inputKey].txt.html(value)
74
- }
75
- }
76
-
77
- componentDidUpdate() {
78
- // const {inputKey,value='', readonly} = this.props;
79
- // !readonly && value && this[inputKey].txt.html(value); //支持清空操作
80
- }
81
-
82
- render() {
83
- const {inputKey, readonly, value} = this.props;
84
-
85
- return (
86
- <div className={variables('InputEditor')}>
87
- {readonly ? <div dangerouslySetInnerHTML = {{__html:`${value}`}}/> : <div ref={inputKey} />}
88
- </div>
89
- );
90
- }
91
- }
92
-
93
- export default InputEditor;