neo-cmp-cli 1.13.16 → 1.13.18

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 (182) hide show
  1. package/README.md +2 -1
  2. package/dist/index2.js +1 -1
  3. package/dist/main2.js +1 -1
  4. package/dist/neo/env.js +1 -1
  5. package/dist/neo/neoLogin.js +1 -1
  6. package/dist/neo/pushCmp.js +1 -1
  7. package/dist/package.json.js +1 -1
  8. package/package.json +3 -2
  9. package/template/antd-custom-cmp-template/package.json +1 -1
  10. package/template/asset-manage-template/docs/README.md +1 -232
  11. package/template/asset-manage-template/package.json +2 -2
  12. package/template/echarts-custom-cmp-template/package.json +1 -1
  13. package/template/empty-custom-cmp-template/package.json +2 -2
  14. package/template/map-custom-cmp-template/package.json +1 -1
  15. package/template/neo-bi-cmps/neo.config.js +7 -1
  16. package/template/neo-bi-cmps/package.json +8 -7
  17. package/template/neo-bi-cmps/public/403.html +77 -0
  18. package/template/neo-bi-cmps/public/demo.html +2453 -0
  19. package/template/neo-bi-cmps/src/assets/icon/barChart.svg +1 -0
  20. package/template/neo-bi-cmps/src/assets/icon/card.svg +1 -0
  21. package/template/neo-bi-cmps/src/assets/icon/filter.svg +1 -0
  22. package/template/neo-bi-cmps/src/assets/icon/funnel.svg +1 -0
  23. package/template/neo-bi-cmps/src/assets/icon/tab.svg +1 -0
  24. package/template/neo-bi-cmps/src/components/filterBar__c/README.md +3 -14
  25. package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +29 -0
  26. package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +668 -146
  27. package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +26 -48
  28. package/template/neo-bi-cmps/src/components/filterBar__c/style.scss +46 -139
  29. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +11 -10
  30. package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +9 -16
  31. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +1 -1
  32. package/template/neo-bi-cmps/src/utils/common.ts +231 -0
  33. package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +268 -0
  34. package/template/neo-bi-cmps/src/utils/filterBar.ts +140 -0
  35. package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +341 -0
  36. package/template/{neo-h5-cmps/src/utils/queryObjectData.ts → neo-bi-cmps/src/utils/queryByCustomSQL.ts} +18 -13
  37. package/template/neo-bi-cmps/src/utils/requestDebounce.ts +22 -0
  38. package/template/neo-bi-cmps/src/utils/simpleTable.tsx +344 -0
  39. package/template/neo-bi-cmps/src/utils/stageSwitch.ts +15 -0
  40. package/template/neo-bi-cmps/src/utils/stageTimeChart.ts +90 -0
  41. package/template/neo-bi-cmps/src/utils/targetNumber.ts +12 -0
  42. package/template/neo-custom-cmp-template/docs/README.md +0 -231
  43. package/template/neo-custom-cmp-template/package.json +2 -2
  44. package/template/neo-h5-cmps/package.json +2 -2
  45. package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +1 -2
  46. package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +1 -1
  47. package/template/neo-h5-cmps/src/components/globalSearchInput__c/index.tsx +1 -1
  48. package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +1 -2
  49. package/template/neo-order-cmps/package.json +2 -2
  50. package/template/neo-pipeline-cmps/.prettierrc.js +12 -0
  51. package/template/neo-pipeline-cmps/@types/neo-ui-common.d.ts +36 -0
  52. package/template/neo-pipeline-cmps/README.md +99 -0
  53. package/template/neo-pipeline-cmps/commitlint.config.js +59 -0
  54. package/template/neo-pipeline-cmps/neo.config.js +135 -0
  55. package/template/neo-pipeline-cmps/package.json +66 -0
  56. package/template/neo-pipeline-cmps/public/403.html +77 -0
  57. package/template/neo-pipeline-cmps/public/css/base.css +283 -0
  58. package/template/neo-pipeline-cmps/public/demo.html +2453 -0
  59. package/template/neo-pipeline-cmps/public/scripts/app/bluebird.js +6679 -0
  60. package/template/neo-pipeline-cmps/public/template.html +13 -0
  61. package/template/neo-pipeline-cmps/src/assets/css/common.scss +127 -0
  62. package/template/neo-pipeline-cmps/src/assets/css/mixin.scss +47 -0
  63. package/template/neo-pipeline-cmps/src/assets/icon/barChart.svg +1 -0
  64. package/template/neo-pipeline-cmps/src/assets/icon/card.svg +1 -0
  65. package/template/neo-pipeline-cmps/src/assets/icon/filter.svg +1 -0
  66. package/template/neo-pipeline-cmps/src/assets/icon/funnel.svg +1 -0
  67. package/template/neo-pipeline-cmps/src/assets/icon/tab.svg +1 -0
  68. package/template/neo-pipeline-cmps/src/assets/img/AIBtn.gif +0 -0
  69. package/template/neo-pipeline-cmps/src/assets/img/NeoCRM.jpg +0 -0
  70. package/template/neo-pipeline-cmps/src/assets/img/aiLogo.png +0 -0
  71. package/template/neo-pipeline-cmps/src/assets/img/card-list.svg +1 -0
  72. package/template/neo-pipeline-cmps/src/assets/img/contact-form.svg +1 -0
  73. package/template/neo-pipeline-cmps/src/assets/img/custom-form.svg +1 -0
  74. package/template/neo-pipeline-cmps/src/assets/img/custom-widget.svg +1 -0
  75. package/template/neo-pipeline-cmps/src/assets/img/data-list.svg +1 -0
  76. package/template/neo-pipeline-cmps/src/assets/img/detail.svg +1 -0
  77. package/template/neo-pipeline-cmps/src/assets/img/favicon.png +0 -0
  78. package/template/neo-pipeline-cmps/src/assets/img/map.svg +1 -0
  79. package/template/neo-pipeline-cmps/src/assets/img/search.svg +1 -0
  80. package/template/neo-pipeline-cmps/src/assets/img/table.svg +1 -0
  81. package/template/neo-pipeline-cmps/src/components/filterBar__c/README.md +24 -0
  82. package/template/neo-pipeline-cmps/src/components/filterBar__c/common.scss +29 -0
  83. package/template/neo-pipeline-cmps/src/components/filterBar__c/index.tsx +731 -0
  84. package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +52 -0
  85. package/template/neo-pipeline-cmps/src/components/filterBar__c/style.scss +119 -0
  86. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/README.md +39 -0
  87. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +416 -0
  88. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +80 -0
  89. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/style.scss +83 -0
  90. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +470 -0
  91. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/model.ts +45 -0
  92. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/style.scss +137 -0
  93. package/template/neo-pipeline-cmps/src/components/simpleTable__c/README.md +89 -0
  94. package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +195 -0
  95. package/template/neo-pipeline-cmps/src/components/simpleTable__c/index.tsx +667 -0
  96. package/template/neo-pipeline-cmps/src/components/simpleTable__c/model.ts +124 -0
  97. package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +192 -0
  98. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/README.md +36 -0
  99. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/index.tsx +513 -0
  100. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +71 -0
  101. package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageSwitch__c/style.scss +4 -2
  102. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/README.md +37 -0
  103. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/index.tsx +455 -0
  104. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +106 -0
  105. package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageTimeChart__c/style.scss +3 -2
  106. package/template/neo-pipeline-cmps/src/utils/common.ts +229 -0
  107. package/template/neo-pipeline-cmps/src/utils/filter2chartFilter.ts +266 -0
  108. package/template/neo-pipeline-cmps/src/utils/filterBar.ts +140 -0
  109. package/template/neo-pipeline-cmps/src/utils/pipelineFunnel.ts +343 -0
  110. package/template/neo-pipeline-cmps/src/utils/queryByCustomSQL.ts +121 -0
  111. package/template/neo-pipeline-cmps/src/utils/requestDebounce.ts +22 -0
  112. package/template/neo-pipeline-cmps/src/utils/simpleTable.tsx +349 -0
  113. package/template/neo-pipeline-cmps/src/utils/stageSwitch.ts +15 -0
  114. package/template/neo-pipeline-cmps/src/utils/stageTimeChart.ts +90 -0
  115. package/template/neo-pipeline-cmps/src/utils/targetNumber.ts +12 -0
  116. package/template/neo-pipeline-cmps/tsconfig.json +40 -0
  117. package/template/neo-web-entity-grid/package.json +2 -2
  118. package/template/neo-web-form/package.json +2 -2
  119. package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +161 -41
  120. package/template/neo-web-form/src/components/batchAddTable__c/model.ts +4 -2
  121. package/template/react-custom-cmp-template/package.json +1 -1
  122. package/template/react-ts-custom-cmp-template/package.json +1 -1
  123. package/template/vue2-custom-cmp-template/package.json +1 -1
  124. package/template/asset-manage-template/src/utils/axiosFetcher.ts +0 -37
  125. package/template/asset-manage-template/src/utils/queryObjectData.ts +0 -112
  126. package/template/asset-manage-template/src/utils/xobjects.ts +0 -162
  127. package/template/neo-bi-cmps/.npmrc copy +0 -1
  128. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/README.md +0 -52
  129. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/index.tsx +0 -183
  130. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/model.ts +0 -90
  131. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/style.scss +0 -218
  132. package/template/neo-bi-cmps/src/components/forecastChart__c/README.md +0 -31
  133. package/template/neo-bi-cmps/src/components/forecastChart__c/index.tsx +0 -158
  134. package/template/neo-bi-cmps/src/components/forecastChart__c/model.ts +0 -40
  135. package/template/neo-bi-cmps/src/components/forecastChart__c/style.scss +0 -154
  136. package/template/neo-bi-cmps/src/components/forecastGrid__c/README.md +0 -36
  137. package/template/neo-bi-cmps/src/components/forecastGrid__c/index.tsx +0 -86
  138. package/template/neo-bi-cmps/src/components/forecastGrid__c/model.ts +0 -62
  139. package/template/neo-bi-cmps/src/components/forecastGrid__c/style.scss +0 -48
  140. package/template/neo-bi-cmps/src/components/gapCloser__c/README.md +0 -24
  141. package/template/neo-bi-cmps/src/components/gapCloser__c/index.tsx +0 -100
  142. package/template/neo-bi-cmps/src/components/gapCloser__c/model.ts +0 -46
  143. package/template/neo-bi-cmps/src/components/gapCloser__c/style.scss +0 -60
  144. package/template/neo-bi-cmps/src/components/kpiCards__c/README.md +0 -35
  145. package/template/neo-bi-cmps/src/components/kpiCards__c/index.tsx +0 -70
  146. package/template/neo-bi-cmps/src/components/kpiCards__c/model.ts +0 -50
  147. package/template/neo-bi-cmps/src/components/kpiCards__c/style.scss +0 -33
  148. package/template/neo-bi-cmps/src/components/oppList__c/README.md +0 -52
  149. package/template/neo-bi-cmps/src/components/oppList__c/index.tsx +0 -285
  150. package/template/neo-bi-cmps/src/components/oppList__c/model.ts +0 -86
  151. package/template/neo-bi-cmps/src/components/oppList__c/style.scss +0 -133
  152. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/README.md +0 -39
  153. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/index.tsx +0 -130
  154. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/model.ts +0 -66
  155. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/style.scss +0 -133
  156. package/template/neo-bi-cmps/src/components/stageSwitch__c/README.md +0 -36
  157. package/template/neo-bi-cmps/src/components/stageSwitch__c/index.tsx +0 -118
  158. package/template/neo-bi-cmps/src/components/stageSwitch__c/model.ts +0 -92
  159. package/template/neo-bi-cmps/src/components/stageTimeChart__c/README.md +0 -37
  160. package/template/neo-bi-cmps/src/components/stageTimeChart__c/index.tsx +0 -126
  161. package/template/neo-bi-cmps/src/components/stageTimeChart__c/model.ts +0 -57
  162. package/template/neo-bi-cmps/src/components/tabSwitch__c/README.md +0 -37
  163. package/template/neo-bi-cmps/src/components/tabSwitch__c/index.tsx +0 -80
  164. package/template/neo-bi-cmps/src/components/tabSwitch__c/model.ts +0 -45
  165. package/template/neo-bi-cmps/src/components/tabSwitch__c/style.scss +0 -37
  166. package/template/neo-bi-cmps/src/utils/axiosFetcher.ts +0 -37
  167. package/template/neo-bi-cmps/src/utils/queryObjectData.ts +0 -76
  168. package/template/neo-bi-cmps/src/utils/xobjects.ts +0 -162
  169. package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -37
  170. package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -112
  171. package/template/neo-custom-cmp-template/src/utils/xobjects.ts +0 -162
  172. package/template/neo-h5-cmps/src/utils/axiosFetcher.ts +0 -37
  173. package/template/neo-h5-cmps/src/utils/xobjects.ts +0 -167
  174. package/template/neo-order-cmps/src/utils/axiosFetcher.ts +0 -37
  175. package/template/neo-order-cmps/src/utils/queryObjectData.ts +0 -112
  176. package/template/neo-order-cmps/src/utils/xobjects.ts +0 -162
  177. package/template/neo-web-entity-grid/src/utils/axiosFetcher.ts +0 -37
  178. package/template/neo-web-entity-grid/src/utils/queryObjectData.ts +0 -112
  179. package/template/neo-web-entity-grid/src/utils/xobjects.ts +0 -167
  180. package/template/neo-web-form/src/utils/axiosFetcher.ts +0 -37
  181. package/template/neo-web-form/src/utils/queryObjectData.ts +0 -112
  182. package/template/neo-web-form/src/utils/xobjects.ts +0 -167
@@ -47,7 +47,7 @@
47
47
  "axios": "^1.7.0",
48
48
  "antd": "^4.9.4",
49
49
  "lodash": "^4.17.23",
50
- "neo-open-api": "^1.2.3"
50
+ "neo-open-api": "^1.2.7"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@commitlint/cli": "^18.0.0",
@@ -55,7 +55,7 @@
55
55
  "@types/react": "^16.9.11",
56
56
  "@types/react-dom": "^16.9.15",
57
57
  "@types/axios": "^0.14.0",
58
- "neo-cmp-cli": "^1.13.16",
58
+ "neo-cmp-cli": "^1.13.18",
59
59
  "husky": "^4.2.5",
60
60
  "lint-staged": "^10.2.9",
61
61
  "prettier": "^2.0.5"
@@ -39,7 +39,7 @@
39
39
  "axios": "^1.7.0",
40
40
  "antd-mobile": "^2.3.3",
41
41
  "lodash": "^4.17.23",
42
- "neo-open-api": "^1.2.3",
42
+ "neo-open-api": "^1.2.7",
43
43
  "tslib": "2.3.0"
44
44
  },
45
45
  "devDependencies": {
@@ -49,7 +49,7 @@
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
51
  "@types/axios": "^0.14.0",
52
- "neo-cmp-cli": "^1.13.16",
52
+ "neo-cmp-cli": "^1.13.17",
53
53
  "husky": "^4.2.5",
54
54
  "lint-staged": "^10.2.9",
55
55
  "prettier": "^2.0.5"
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
- import './style.scss'; // 组件内容样式
3
2
  // @ts-ignore
4
3
  import { NeoEntityList } from 'neo-ui-component-h5'; // neo h5 组件库
5
-
4
+ import './style.scss'; // 组件内容样式
6
5
  interface EntityListProps {
7
6
  entityApiKey: string;
8
7
  disableSearch?: boolean;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { Tabs } from 'antd-mobile';
3
- import './style.scss'; // 组件内容样式
4
3
  // @ts-ignore
5
4
  import { NeoEntityList } from 'neo-ui-component-h5'; // neo h5 组件库
5
+ import './style.scss'; // 组件内容样式
6
6
 
7
7
  interface EntityListTabsProps {
8
8
  entityApiKey?: string;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import './style.scss'; // 组件内容样式
3
2
  // @ts-ignore
4
3
  import { GlobalSearchInput } from 'neo-ui-component-h5'; // neo h5 组件库
4
+ import './style.scss'; // 组件内容样式
5
5
 
6
6
  interface GlobalSearchInputProps {
7
7
  placeholder?: string;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { BaseCmp } from 'neo-ui-common';
3
2
  // @ts-ignore
4
- import { NeoEvent } from 'neo-ui-common';
3
+ import { BaseCmp, NeoEvent } from 'neo-ui-common';
5
4
  import './style.scss'; // 组件内容样式
6
5
 
7
6
  interface openChatPageBtnProps {
@@ -39,7 +39,7 @@
39
39
  "axios": "^1.7.0",
40
40
  "antd": "^4.9.4",
41
41
  "lodash": "^4.17.23",
42
- "neo-open-api": "^1.2.3"
42
+ "neo-open-api": "^1.2.7"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^18.0.0",
@@ -47,7 +47,7 @@
47
47
  "@types/react": "^16.9.11",
48
48
  "@types/react-dom": "^16.9.15",
49
49
  "@types/axios": "^0.14.0",
50
- "neo-cmp-cli": "^1.13.16",
50
+ "neo-cmp-cli": "^1.13.17",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -0,0 +1,12 @@
1
+ /*
2
+ prettier 配置文件
3
+ 更多配置信息:https://prettier.io/docs/en/options.html
4
+ */
5
+ module.exports = {
6
+ semi: true, // Semicolons 分号,默认需要分号
7
+ tabWidth: 2, // 空格,默认 2,
8
+ useTabs: false,
9
+ singleQuote: true, // 单引号还是双引号,默认为false 双引号
10
+ trailingComma: 'all', // 逗号
11
+ jsxBracketSameLine: false, // 默认为false,Put the > of a multi-line JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).
12
+ };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * BaseCmpProps 基础组件属性接口
5
+ */
6
+ export interface BaseCmpProps {
7
+ [key: string]: any;
8
+ }
9
+
10
+ /**
11
+ * ScopedComponentType 作用域组件类型接口
12
+ */
13
+ export interface ScopedComponentType {
14
+ [key: string]: any;
15
+ }
16
+
17
+ /**
18
+ * BaseCmp 基础组件类
19
+ * 继承自 React.PureComponent,提供基础组件功能
20
+ */
21
+ export declare class BaseCmp<
22
+ T extends BaseCmpProps = BaseCmpProps,
23
+ S = any
24
+ > extends React.PureComponent<T, S> implements ScopedComponentType {
25
+ props: Readonly<T> & Readonly<{ children?: React.ReactNode }>;
26
+ state: Readonly<S>;
27
+ setState<K extends keyof S>(
28
+ state:
29
+ | ((prevState: Readonly<S>, props: Readonly<T>) => Pick<S, K> | S | null)
30
+ | (Pick<S, K> | S | null),
31
+ callback?: () => void
32
+ ): void;
33
+ forceUpdate(callback?: () => void): void;
34
+ render(): React.ReactNode;
35
+ }
36
+
@@ -0,0 +1,99 @@
1
+ ### 目录说明
2
+ - src: 自定义组件源码;
3
+ - src/assets: 存放组件静态资源,比如 css、img等;
4
+ - src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
5
+ - src/components/xxCmp/index: 自定义组件的内容文件;
6
+ - src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
7
+ - neo.config.js: neo-cmp-cli 配置文件。
8
+
9
+ ### 组件开发规范
10
+ - 存放在 src/components 目录下的自定义组件,默认 index 为自定义组件源码入口文件,model.[tj]s 为自定义组件的模型文件(对接页面设计器需要);
11
+ - 当 neo.config.js 中的 entry 为空或者不存在时,cli 将根据 src/components 目录下的自定义组件结构生成对应的 entry 配置(可在命令控制台查看生成的 entry 配置);
12
+ - 自定义组件中可用的配置项类型 请见 [当前可用表单项](https://github.com/wibetter/neo-register/blob/master/docs/FormItemType.md);
13
+ - 自定义组件最外层请设置一个唯一的 ClassName(比如 xx-cmpType-container),所有内容样式请放在该 ClassName 中,避免自定义组件样式相互干扰;
14
+ - 默认开启代码规范检测(含样式内容),如需关闭,请调整 neo.config.js 相关配置;
15
+ - 请使用 react 16 版本;
16
+ - 支持在自定义组件中使用 Open API,详细见[使用说明](https://www.npmjs.com/package/neo-open-api)。
17
+
18
+ ### 自定义组件注册器使用说明
19
+ - [neo-register 使用说明](https://www.npmjs.com/package/neo-register?activeTab=readme)
20
+ 备注:预览、调试(linkDebug)和构建发布时 cli 会自动创建对应的注册文件(含 neo-register 的使用),用户无需关注 neo-register。
21
+
22
+ ### 开发说明
23
+
24
+ 1. **安装依赖**
25
+ ```bash
26
+ $ npm i 或者 yarn
27
+ ```
28
+
29
+ 2. **linkDebug: 外链调试(在线上页面设计器端预览自定义组件)**
30
+ > linkDebug模式:用于在线上页面设计器中预览和调试自定义组件。
31
+ ```bash
32
+ $ npm run linkDebug
33
+ ```
34
+
35
+ 3. **发布到 NeoCRM 平台**
36
+ > 需要确保 package.json 中的 name 值唯一,version 值不重复。
37
+ ```bash
38
+ $ npm run pushCmp
39
+ ```
40
+
41
+ ### OAuth2 登录授权
42
+ 使用 `neo push cmp`、`neo pull cmp`、`neo delete cmp` 等命令与 NeoCRM 平台交互时,需要进行授权登录。
43
+
44
+ #### 使用步骤
45
+
46
+ 1. **登录 NeoCRM 平台**
47
+ ```bash
48
+ neo login
49
+ ```
50
+
51
+ 执行流程:
52
+ - 自动打开浏览器访问授权页面
53
+ - 在浏览器中输入 NeoCRM 账号密码进行登录(需选择对应的租户)
54
+ - 授权成功后自动跳转回本地(附带 code)
55
+ - cli 端 通过 code 获取 Token,并自动保存到项目的 `.neo-cli/token.json` 文件中
56
+
57
+ 2. **登出 NeoCRM 平台**
58
+ ```bash
59
+ neo logout
60
+ ```
61
+
62
+ 功能:清除本地保存的 token 文件,下次使用需要重新登录。
63
+
64
+ #### neo login 选择「自定义环境」时的授权配置示例
65
+
66
+ ```javascript
67
+ // neo.config.js
68
+ module.exports = {
69
+ neoConfig: {
70
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
71
+ // 登录授权 URL(用于获取 code)
72
+ loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
73
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
74
+ },
75
+ }
76
+ ```
77
+
78
+ #### Token 有效期
79
+
80
+ - **access_token**:默认有效期 2 小时
81
+ - **refresh_token**:默认有效期 30 天
82
+ - 系统会在 access_token 过期前 5 分钟自动刷新
83
+ - 如果 refresh_token 也过期,需要重新执行 `neo login`
84
+
85
+ #### 常见问题
86
+
87
+ **Q1: 浏览器无法自动打开怎么办?**
88
+ A: 命令行会输出授权 URL,手动复制到浏览器中打开即可。
89
+
90
+ **Q2: Token 刷新失败怎么办?**
91
+ A: 如果 refresh_token 也过期(默认 30 天),需要重新执行 `neo login`。同时检查网络连接是否正常。
92
+
93
+ **Q3: 授权登录后没有正常跳回 redirect_uri**
94
+ A: 可能被浏览器安装的插件影响,目前已知会影响授权登录的浏览器插件有:Neo UI Extension,请关闭插件后重试。
95
+
96
+ ---
97
+
98
+ ### 配置项说明(neo-cmp-cli)
99
+ [请查看neo-cmp-cli](https://www.npmjs.com/package/neo-cmp-cli)
@@ -0,0 +1,59 @@
1
+ /**
2
+ * https://www.npmjs.com/package/@commitlint/config-conventional\
3
+ *
4
+ * Git提交规范-配置文件
5
+ * Commit message 由Header、Body 和 Footer三个部分组成,其格式如下:
6
+ * <type>(<scope>): <subject>
7
+ * <BLANK LINE>
8
+ * <body>
9
+ * <BLANK LINE>
10
+ * <footer>
11
+ *
12
+ *【备注】
13
+ * type 用于说明 commit 的类别,常用下面 7 个标识:
14
+ * scope 用于说明当前功能点作用于哪个页面或者哪个功能模块;
15
+ * subject 用于简短的描述当前commit,不超过50个字符;
16
+ * body 用于填写对本次 commit 的详细描述,可以分成多行;
17
+ * footer 不兼容变动声明,或者关闭 Issue。
18
+ *
19
+ * 【type类型取值类型】
20
+ * feat:新功能(feature)
21
+ * fix:功能优化
22
+ * bug:修补bug
23
+ * docs:文档(documentation)
24
+ * style:格式(不影响代码运行的变动)
25
+ * refactor:重构(即不是新增功能,也不是修改bug的代码变动)
26
+ * test:增加测试
27
+ * chore:构建过程或辅助工具的变动
28
+ * build:影响构建系统或外部依赖项的更改(示例范围:gulp,broccoli,npm)
29
+ * ci:对 CI 配置文件和脚本的更改(示例范围:Travis,Circle,BrowserStack,SauceLabs)
30
+ * perf:改进性能的代码更改
31
+ *
32
+ */
33
+
34
+ module.exports = {
35
+ extends: ['@commitlint/config-conventional'],
36
+ rules: {
37
+ 'type-enum': [
38
+ 2,
39
+ 'always',
40
+ [
41
+ 'feat',
42
+ 'fix',
43
+ 'bug',
44
+ 'docs',
45
+ 'style',
46
+ 'refactor',
47
+ 'test',
48
+ 'chore',
49
+ 'perf',
50
+ 'build',
51
+ 'ci',
52
+ ],
53
+ ],
54
+ 'type-empty': [2, 'never'],
55
+ 'scope-empty': [1, 'never'],
56
+ 'subject-full-stop': [0, 'never'],
57
+ 'subject-case': [0, 'never'],
58
+ },
59
+ };
@@ -0,0 +1,135 @@
1
+ 'use strict';
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+
5
+ // 统一路径解析
6
+ function resolve(dir) {
7
+ return path.resolve(__dirname, dir);
8
+ }
9
+
10
+ // 包括生产和开发的环境配置信息
11
+ module.exports = {
12
+ settings: {
13
+ enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
14
+ enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
15
+ enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
16
+ enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
17
+ },
18
+ webpack: {
19
+ target: ['web', 'es5'], // 指定目标环境为 web 和 es5,确保兼容性
20
+ resolve: {
21
+ // webpack的resolve配置
22
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.umd.js', '.min.js', '.json'], // 用于配置webpack在尝试过程中用到的后缀列表
23
+ alias: {
24
+ '@': resolve('src'),
25
+ $assets: resolve('src/assets'),
26
+ $public: resolve('public'),
27
+ $utils: resolve('src/utils'),
28
+ },
29
+ },
30
+ // sassResources中的sass文件会自动注入每一个sass文件中
31
+ sassResources: [
32
+ resolve('./src/assets/css/common.scss'),
33
+ resolve('./src/assets/css/mixin.scss'),
34
+ ],
35
+ // createDeclaration: true, // 打包时是否创建ts声明文件
36
+ ignoreNodeModules: false, // 打包时是否忽略 node_modules
37
+ // allowList: [], // ignoreNodeModules为true时生效
38
+ // projectDir: ['src'],
39
+ // template: resolve('./public/template.html'), // 自定义html模板
40
+ // plugins: [],
41
+ // babelPlugins: [],
42
+ },
43
+ // 用于添加 Neo 共享依赖模块的配置信息
44
+ /*
45
+ neoCommonModule: {
46
+ // exports: ['xxModule'], // 数组写法,用于导出当前自定义组件中的第三方依赖模块
47
+ exports: { // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
48
+ 'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
49
+ },
50
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
51
+ // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
52
+ },
53
+ */
54
+ /*
55
+ // 示例2
56
+ neoCommonModule: {
57
+ // exports: ['xxModule'], // 数组写法,用于导出当前自定义组件中的第三方依赖模块
58
+ exports: { // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
59
+ 'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
60
+ },
61
+ remoteDeps: ['filterBar__c'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
62
+ externals: ['filterBar__c'], // 自定义组件中需要剔除的模块,仅支持数组写法
63
+ },
64
+ */
65
+ linkDebug: {
66
+ // 用于开启本地调试模式的相关配置信息
67
+ /*
68
+ 【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
69
+ entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
70
+ // 外链调试(在线上页面设计器端预览自定义组件)
71
+ index: [
72
+ './src/components/xxCmp/register.ts',
73
+ './src/components/xxCmp/model.ts',
74
+ ],
75
+ },
76
+ NODE_ENV: 'development',
77
+ port: 80, // 设置基础端口,如果被占用则自动寻找可用端口
78
+ closeHotReload: true, // 是否关闭热更新
79
+ assetsPublicPath: '/', // 设置静态资源的引用路径(根域名+路径)
80
+ assetsSubDirectory: '',
81
+ hostname: 'localhost',
82
+ proxyTable: {
83
+ '/apiTest': {
84
+ target: 'http://api-test.com.cn', // 不支持跨域的接口根地址
85
+ ws: true,
86
+ changeOrigin: true,
87
+ },
88
+ }
89
+ */
90
+ },
91
+ // 选择「自定义环境」时需要添加 NeoCRM 平台配置,可自定义对接的任何环境
92
+ neoConfig: {
93
+ // authType: 'oauth2', // 默认授权模式:OAuth2 授权码模式
94
+ neoBaseURL: 'https://crm-test.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
95
+ loginURL: 'https://login-test.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
96
+ tokenURL: 'https://login-test.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
97
+ },
98
+ pushCmp: {
99
+ // 用于构建并发布至 NeoCRM 的相关配置
100
+ // 备注:pushCmp 会服用量 build2lib 中的配置,执行 neo push cmp 时最好注释掉 build2lib 中的配置。
101
+ /*
102
+ 【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
103
+ NODE_ENV: 'production',
104
+ entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
105
+ InfoCardModel: './src/components/xxCmp/model.ts',
106
+ infoCard: './src/components/xxCmp/register.ts'
107
+ },
108
+ cssExtract: false, // 不额外提取css文件
109
+ assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
110
+ */
111
+ },
112
+ /*
113
+ build2lib: {
114
+ entry: {
115
+ targetNumber: './src/components/targetNumber__c/index.tsx',
116
+ customStyleConfig: './src/components/targetNumber__c/customStyleConfig',
117
+ },
118
+ output: {
119
+ filename: '[name].js',
120
+ },
121
+ removeNeoCommonModules: true, // 是否移除 Neo 共享的依赖模块,默认不移除
122
+ NODE_ENV: 'production', // development、production
123
+ libraryName: 'NeoBIComponent', // 构建第三方功能包时最后导出的引用变量名
124
+ assetsRoot: resolve('./lib'), // 打包后的文件绝对路径(物理路径)
125
+ assetsPublicPath: '/', // 设置静态资源的引用路径(根域名+路径)
126
+ assetsSubDirectory: '', // 资源引用二级路径
127
+ ignoreNodeModules: false,
128
+ // allowList: ['@babel/runtime', '@babel/runtime/helpers/inheritsLoose'],
129
+ productionSourceMap: false,
130
+ productionGzip: false,
131
+ productionGzipExtensions: ['js', 'css', 'json'],
132
+ bundleAnalyzerReport: false,
133
+ },
134
+ */
135
+ };
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "neo-pipeline-cmps",
3
+ "version": "1.0.9",
4
+ "description": "数值指标组件模板: 用于展示实体数据源中关键数值指标,支持从 XObject 实体对象获取动态数据。",
5
+ "framework": "react-ts",
6
+ "keywords": [
7
+ "react&ts技术栈",
8
+ "数值指标组件模板"
9
+ ],
10
+ "author": "wibetter",
11
+ "license": "MIT",
12
+ "scripts": {
13
+ "linkDebug": "neo linkDebug",
14
+ "neoLogin": "neo login",
15
+ "pushCmp": "neo push cmp",
16
+ "pullCmp": "neo pull cmp",
17
+ "deleteCmp": "neo delete cmp",
18
+ "build2lib": "neo build2lib",
19
+ "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
20
+ },
21
+ "files": [
22
+ "lib/*"
23
+ ],
24
+ "husky": {
25
+ "hooks": {
26
+ "pre-commit": "lint-staged",
27
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
28
+ }
29
+ },
30
+ "lint-staged": {
31
+ "src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}": [
32
+ "prettier --write"
33
+ ]
34
+ },
35
+ "dependencies": {
36
+ "antd": "^4.9.4",
37
+ "axios": "^1.7.0",
38
+ "echarts": "^5.6.0",
39
+ "lodash": "^4.17.21",
40
+ "moment": "^2.30.1",
41
+ "neo-open-api": "^1.2.7",
42
+ "neo-register": "^1.1.3",
43
+ "react": "^16.9.0",
44
+ "react-dom": "^16.9.0",
45
+ "tslib": "2.3.0"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/runtime": "^7.26.0",
49
+ "@commitlint/cli": "^8.3.5",
50
+ "@commitlint/config-conventional": "^9.1.1",
51
+ "@types/axios": "^0.14.0",
52
+ "@types/react": "^16.9.11",
53
+ "@types/react-dom": "^16.9.15",
54
+ "husky": "^4.2.5",
55
+ "lint-staged": "^10.2.9",
56
+ "neo-cmp-cli": "^1.13.17",
57
+ "prettier": "^2.0.5"
58
+ },
59
+ "overrides": {
60
+ "typescript": "<6"
61
+ },
62
+ "engines": {
63
+ "node": ">= 16.0.0",
64
+ "npm": ">= 8.0.0"
65
+ }
66
+ }
@@ -0,0 +1,77 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7
+ <title>WAF拦截页面</title>
8
+ <link rel="stylesheet" text="text/css"
9
+ href="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/403/main.css" />
10
+ <script type="text/javascript"
11
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/403/main.js"></script>
12
+ </head>
13
+ <script> function submitWafFeedback() { var uuid = document.getElementById("uuid").innerHTML; window.location.href = "https://api.waf.qq.com/waf-attack-feedback/" + uuid; } </script>
14
+
15
+ <body>
16
+ <div class="wrapper">
17
+ <div class="body">
18
+ <div class="top-block"><img class="error-icon"
19
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/403-icon.png"
20
+ alt="403" />
21
+ <div>
22
+ <div class="title-wrapper">
23
+ <p class="title">您的请求已中断</p>
24
+ </div>
25
+ <p class="desc">您提交的请求可能对网站造成威胁,无法访问</p>
26
+ </div>
27
+ </div>
28
+ <div class="content-block">
29
+ <div class="content-item">
30
+ <p class="title">可能原因</p>
31
+ <p class="desc">Web应用防护服务检测您当前访问存在Web安全风险或访问不合规</p><img class="link-img"
32
+ style="margin-top: 20px; margin-bottom: 32px"
33
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/403-link.svg" alt="" />
34
+ </div>
35
+ <div class="mobile-link-block">
36
+ <div class="link-item">
37
+ <div class="left">
38
+ <p class="title">Client</p>
39
+ <p class="desc">浏览器正常</p>
40
+ </div><img
41
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/success-status.svg"
42
+ alt="" />
43
+ </div>
44
+ <div class="link-item-divider"></div>
45
+ <div class="link-item">
46
+ <div class="left">
47
+ <p class="title">腾讯云WAF</p>
48
+ <p class="desc">访问拦截</p>
49
+ </div><img
50
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/error-status.svg"
51
+ alt="" />
52
+ </div>
53
+ <div class="link-item-divider"></div>
54
+ <div class="link-item">
55
+ <div class="left">
56
+ <p class="title">源站服务器</p>
57
+ <p class="desc">无法访问</p>
58
+ </div><img
59
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/check-status.svg"
60
+ alt="" />
61
+ </div>
62
+ </div>
63
+ <div class="content-item">
64
+ <p class="title">您可以做什么?</p>
65
+ <p class="desc">如有疑问,请点击提交反馈或联系网站安全运维中心反馈请求UUID</p>
66
+ <p class="uuid-wrapper"> 请求UUID:<span
67
+ id="uuid">88e031bb136547814ca0bcd2d5abc3d7-d184f4ad21127684d3c87ee4af57230c</span><img class="copy-icon"
68
+ onclick="copyToClipboard()"
69
+ src="https://domain-config-1256704386.cos.accelerate.myqcloud.com/block-pages/static/copy.svg" alt="" />
70
+ </p>
71
+ </div>
72
+ <div class="submit-btn" onclick="submitWafFeedback()">提交反馈</div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </body>
77
+ </html>