neo-cmp-cli 1.8.1 → 1.8.3

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 (201) hide show
  1. package/README.md +91 -7
  2. package/bin/neo.js +1 -1
  3. package/package.json +6 -5
  4. package/src/{module/index.js → index.js} +14 -14
  5. package/src/{module/main.js → main.js} +18 -18
  6. package/src/module/neoInitByCopy.js +6 -6
  7. package/src/neo/webpack.mf.js +1 -1
  8. package/src/oss/publish2oss.js +1 -1
  9. package/src/utils/cmpUtils/createCmpByZip.js +7 -5
  10. package/src/utils/cmpUtils/pullCmp.js +1 -1
  11. package/src/utils/cmpUtils/pushCmp.js +9 -7
  12. package/src/utils/projectUtils/updatePublishLog.js +1 -1
  13. package/test/demo.js +1 -1
  14. package/test/demo3.js +1 -1
  15. package/test/neo.config.js +77 -0
  16. package/src/template/antd-custom-cmp-template/.prettierrc.js +0 -12
  17. package/src/template/antd-custom-cmp-template/README.md +0 -153
  18. package/src/template/antd-custom-cmp-template/commitlint.config.js +0 -59
  19. package/src/template/antd-custom-cmp-template/neo.config.js +0 -144
  20. package/src/template/antd-custom-cmp-template/package.json +0 -60
  21. package/src/template/antd-custom-cmp-template/public/css/base.css +0 -283
  22. package/src/template/antd-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  23. package/src/template/antd-custom-cmp-template/public/template.html +0 -13
  24. package/src/template/antd-custom-cmp-template/src/assets/css/common.scss +0 -127
  25. package/src/template/antd-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  26. package/src/template/antd-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  27. package/src/template/antd-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  28. package/src/template/antd-custom-cmp-template/src/assets/img/favicon.png +0 -0
  29. package/src/template/antd-custom-cmp-template/src/components/dataDashboard/README.md +0 -39
  30. package/src/template/antd-custom-cmp-template/src/components/dataDashboard/index.tsx +0 -462
  31. package/src/template/antd-custom-cmp-template/src/components/dataDashboard/model.ts +0 -75
  32. package/src/template/antd-custom-cmp-template/src/components/dataDashboard/style.scss +0 -1667
  33. package/src/template/antd-custom-cmp-template/src/components/infoCard/index.tsx +0 -87
  34. package/src/template/antd-custom-cmp-template/src/components/infoCard/model.ts +0 -80
  35. package/src/template/antd-custom-cmp-template/src/components/infoCard/style.scss +0 -105
  36. package/src/template/antd-custom-cmp-template/tsconfig.json +0 -68
  37. package/src/template/develop/neo-custom-cmp-template/.prettierrc.js +0 -12
  38. package/src/template/develop/neo-custom-cmp-template/README.md +0 -48
  39. package/src/template/develop/neo-custom-cmp-template/commitlint.config.js +0 -59
  40. package/src/template/develop/neo-custom-cmp-template/docs/README.md +0 -13
  41. package/src/template/develop/neo-custom-cmp-template/neo.config.js +0 -121
  42. package/src/template/develop/neo-custom-cmp-template/package.json +0 -63
  43. package/src/template/develop/neo-custom-cmp-template/public/css/base.css +0 -283
  44. package/src/template/develop/neo-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  45. package/src/template/develop/neo-custom-cmp-template/public/template.html +0 -13
  46. package/src/template/develop/neo-custom-cmp-template/src/assets/css/common.scss +0 -127
  47. package/src/template/develop/neo-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  48. package/src/template/develop/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  49. package/src/template/develop/neo-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  50. package/src/template/develop/neo-custom-cmp-template/src/assets/img/favicon.png +0 -0
  51. package/src/template/develop/neo-custom-cmp-template/src/assets/img/table.svg +0 -1
  52. package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +0 -65
  53. package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +0 -180
  54. package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +0 -50
  55. package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +0 -260
  56. package/src/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +0 -94
  57. package/src/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +0 -251
  58. package/src/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +0 -56
  59. package/src/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +0 -120
  60. package/src/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +0 -115
  61. package/src/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +0 -304
  62. package/src/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +0 -87
  63. package/src/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +0 -127
  64. package/src/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -29
  65. package/src/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -39
  66. package/src/template/develop/neo-custom-cmp-template/src/utils/xobjects.ts +0 -203
  67. package/src/template/develop/neo-custom-cmp-template/tsconfig.json +0 -68
  68. package/src/template/echarts-custom-cmp-template/.prettierrc.js +0 -12
  69. package/src/template/echarts-custom-cmp-template/README.md +0 -198
  70. package/src/template/echarts-custom-cmp-template/commitlint.config.js +0 -59
  71. package/src/template/echarts-custom-cmp-template/neo.config.js +0 -140
  72. package/src/template/echarts-custom-cmp-template/package.json +0 -61
  73. package/src/template/echarts-custom-cmp-template/public/css/base.css +0 -283
  74. package/src/template/echarts-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  75. package/src/template/echarts-custom-cmp-template/public/template.html +0 -13
  76. package/src/template/echarts-custom-cmp-template/src/assets/css/common.scss +0 -127
  77. package/src/template/echarts-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  78. package/src/template/echarts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  79. package/src/template/echarts-custom-cmp-template/src/assets/img/chart.svg +0 -1
  80. package/src/template/echarts-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  81. package/src/template/echarts-custom-cmp-template/src/assets/img/favicon.png +0 -0
  82. package/src/template/echarts-custom-cmp-template/src/components/chartWidget/README.md +0 -186
  83. package/src/template/echarts-custom-cmp-template/src/components/chartWidget/index.tsx +0 -724
  84. package/src/template/echarts-custom-cmp-template/src/components/chartWidget/model.ts +0 -151
  85. package/src/template/echarts-custom-cmp-template/src/components/chartWidget/style.scss +0 -209
  86. package/src/template/echarts-custom-cmp-template/src/components/mapWidget/README.md +0 -125
  87. package/src/template/echarts-custom-cmp-template/src/components/mapWidget/USAGE.md +0 -190
  88. package/src/template/echarts-custom-cmp-template/src/components/mapWidget/index.tsx +0 -385
  89. package/src/template/echarts-custom-cmp-template/src/components/mapWidget/model.ts +0 -107
  90. package/src/template/echarts-custom-cmp-template/src/components/mapWidget/style.scss +0 -192
  91. package/src/template/echarts-custom-cmp-template/src/utils/url.ts +0 -82
  92. package/src/template/echarts-custom-cmp-template/tsconfig.json +0 -68
  93. package/src/template/empty-cmp/index.tsx +0 -58
  94. package/src/template/empty-cmp/model.ts +0 -79
  95. package/src/template/empty-cmp/style.scss +0 -72
  96. package/src/template/empty-custom-cmp-template/.prettierrc.js +0 -12
  97. package/src/template/empty-custom-cmp-template/README.md +0 -154
  98. package/src/template/empty-custom-cmp-template/commitlint.config.js +0 -59
  99. package/src/template/empty-custom-cmp-template/neo.config.js +0 -138
  100. package/src/template/empty-custom-cmp-template/package.json +0 -58
  101. package/src/template/empty-custom-cmp-template/public/css/base.css +0 -283
  102. package/src/template/empty-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  103. package/src/template/empty-custom-cmp-template/public/template.html +0 -13
  104. package/src/template/empty-custom-cmp-template/src/assets/css/common.scss +0 -127
  105. package/src/template/empty-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  106. package/src/template/empty-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  107. package/src/template/empty-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  108. package/src/template/empty-custom-cmp-template/src/assets/img/favicon.png +0 -0
  109. package/src/template/empty-custom-cmp-template/src/assets/img/map.svg +0 -1
  110. package/src/template/empty-custom-cmp-template/src/components/README.md +0 -3
  111. package/src/template/empty-custom-cmp-template/tsconfig.json +0 -68
  112. package/src/template/neo-custom-cmp-template/.prettierrc.js +0 -12
  113. package/src/template/neo-custom-cmp-template/README.md +0 -155
  114. package/src/template/neo-custom-cmp-template/commitlint.config.js +0 -59
  115. package/src/template/neo-custom-cmp-template/docs/README.md +0 -244
  116. package/src/template/neo-custom-cmp-template/neo.config.js +0 -140
  117. package/src/template/neo-custom-cmp-template/package.json +0 -66
  118. package/src/template/neo-custom-cmp-template/public/css/base.css +0 -283
  119. package/src/template/neo-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  120. package/src/template/neo-custom-cmp-template/public/template.html +0 -13
  121. package/src/template/neo-custom-cmp-template/src/assets/css/common.scss +0 -127
  122. package/src/template/neo-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  123. package/src/template/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  124. package/src/template/neo-custom-cmp-template/src/assets/img/card-list.svg +0 -1
  125. package/src/template/neo-custom-cmp-template/src/assets/img/contact-form.svg +0 -1
  126. package/src/template/neo-custom-cmp-template/src/assets/img/custom-form.svg +0 -1
  127. package/src/template/neo-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  128. package/src/template/neo-custom-cmp-template/src/assets/img/data-list.svg +0 -1
  129. package/src/template/neo-custom-cmp-template/src/assets/img/detail.svg +0 -1
  130. package/src/template/neo-custom-cmp-template/src/assets/img/table.svg +0 -1
  131. package/src/template/neo-custom-cmp-template/src/components/entityCardList/README.md +0 -61
  132. package/src/template/neo-custom-cmp-template/src/components/entityCardList/index.tsx +0 -202
  133. package/src/template/neo-custom-cmp-template/src/components/entityCardList/model.ts +0 -74
  134. package/src/template/neo-custom-cmp-template/src/components/entityCardList/style.scss +0 -260
  135. package/src/template/neo-custom-cmp-template/src/components/entityDetail/README.md +0 -176
  136. package/src/template/neo-custom-cmp-template/src/components/entityDetail/index.tsx +0 -334
  137. package/src/template/neo-custom-cmp-template/src/components/entityDetail/model.ts +0 -123
  138. package/src/template/neo-custom-cmp-template/src/components/entityDetail/style.scss +0 -292
  139. package/src/template/neo-custom-cmp-template/src/components/entityForm/README.md +0 -176
  140. package/src/template/neo-custom-cmp-template/src/components/entityForm/index.tsx +0 -615
  141. package/src/template/neo-custom-cmp-template/src/components/entityForm/model.ts +0 -107
  142. package/src/template/neo-custom-cmp-template/src/components/entityForm/style.scss +0 -370
  143. package/src/template/neo-custom-cmp-template/src/components/entityTable/README.md +0 -92
  144. package/src/template/neo-custom-cmp-template/src/components/entityTable/index.tsx +0 -784
  145. package/src/template/neo-custom-cmp-template/src/components/entityTable/model.ts +0 -134
  146. package/src/template/neo-custom-cmp-template/src/components/entityTable/style.scss +0 -304
  147. package/src/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -37
  148. package/src/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -76
  149. package/src/template/neo-custom-cmp-template/src/utils/xobjects.ts +0 -162
  150. package/src/template/neo-custom-cmp-template/tsconfig.json +0 -49
  151. package/src/template/react-custom-cmp-template/.prettierrc.js +0 -12
  152. package/src/template/react-custom-cmp-template/README.md +0 -154
  153. package/src/template/react-custom-cmp-template/commitlint.config.js +0 -59
  154. package/src/template/react-custom-cmp-template/neo.config.js +0 -137
  155. package/src/template/react-custom-cmp-template/package.json +0 -57
  156. package/src/template/react-custom-cmp-template/public/css/base.css +0 -283
  157. package/src/template/react-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  158. package/src/template/react-custom-cmp-template/public/template.html +0 -13
  159. package/src/template/react-custom-cmp-template/src/assets/css/common.scss +0 -127
  160. package/src/template/react-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  161. package/src/template/react-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  162. package/src/template/react-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  163. package/src/template/react-custom-cmp-template/src/assets/img/favicon.png +0 -0
  164. package/src/template/react-custom-cmp-template/src/components/infoCard/index.jsx +0 -45
  165. package/src/template/react-custom-cmp-template/src/components/infoCard/model.js +0 -81
  166. package/src/template/react-custom-cmp-template/src/components/infoCard/style.scss +0 -67
  167. package/src/template/react-ts-custom-cmp-template/.prettierrc.js +0 -12
  168. package/src/template/react-ts-custom-cmp-template/README.md +0 -154
  169. package/src/template/react-ts-custom-cmp-template/commitlint.config.js +0 -59
  170. package/src/template/react-ts-custom-cmp-template/neo.config.js +0 -138
  171. package/src/template/react-ts-custom-cmp-template/package.json +0 -59
  172. package/src/template/react-ts-custom-cmp-template/public/css/base.css +0 -283
  173. package/src/template/react-ts-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  174. package/src/template/react-ts-custom-cmp-template/public/template.html +0 -13
  175. package/src/template/react-ts-custom-cmp-template/src/assets/css/common.scss +0 -127
  176. package/src/template/react-ts-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  177. package/src/template/react-ts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  178. package/src/template/react-ts-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  179. package/src/template/react-ts-custom-cmp-template/src/assets/img/favicon.png +0 -0
  180. package/src/template/react-ts-custom-cmp-template/src/assets/img/map.svg +0 -1
  181. package/src/template/react-ts-custom-cmp-template/src/components/listWidget/README.md +0 -2
  182. package/src/template/react-ts-custom-cmp-template/src/components/listWidget/index.tsx +0 -208
  183. package/src/template/react-ts-custom-cmp-template/src/components/listWidget/model.ts +0 -92
  184. package/src/template/react-ts-custom-cmp-template/src/components/listWidget/style.scss +0 -350
  185. package/src/template/react-ts-custom-cmp-template/tsconfig.json +0 -68
  186. package/src/template/vue2-custom-cmp-template/.prettierrc.js +0 -12
  187. package/src/template/vue2-custom-cmp-template/README.md +0 -154
  188. package/src/template/vue2-custom-cmp-template/commitlint.config.js +0 -59
  189. package/src/template/vue2-custom-cmp-template/neo.config.js +0 -146
  190. package/src/template/vue2-custom-cmp-template/package.json +0 -59
  191. package/src/template/vue2-custom-cmp-template/public/css/base.css +0 -283
  192. package/src/template/vue2-custom-cmp-template/public/scripts/app/bluebird.js +0 -6679
  193. package/src/template/vue2-custom-cmp-template/public/template.html +0 -13
  194. package/src/template/vue2-custom-cmp-template/src/assets/css/common.scss +0 -126
  195. package/src/template/vue2-custom-cmp-template/src/assets/css/mixin.scss +0 -47
  196. package/src/template/vue2-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  197. package/src/template/vue2-custom-cmp-template/src/assets/img/custom-widget.svg +0 -1
  198. package/src/template/vue2-custom-cmp-template/src/assets/img/favicon.png +0 -0
  199. package/src/template/vue2-custom-cmp-template/src/components/vueInfoCard/index.vue +0 -131
  200. package/src/template/vue2-custom-cmp-template/src/components/vueInfoCard/model.js +0 -81
  201. package/src/utils/getConfigObj.js +0 -18
@@ -1,134 +0,0 @@
1
- /**
2
- * @file XObject 表格组件对接编辑器的描述文件
3
- * @description 定义组件在 Neo 平台编辑器中的配置信息
4
- * @author Neo Custom Widget CLI
5
- * @version 1.0.0
6
- */
7
- export class EntityTableModel {
8
- /**
9
- * 组件类型标识
10
- * 用于标识组件的唯一性,在构建时根据当前组件目录名称自动生成
11
- * 注意:此字段在构建时会被自动替换,不需要手动设置
12
- */
13
- // cmpType: string = 'entityTable';
14
-
15
- /** 组件名称,用于设置在编辑器左侧组件面板中展示的名称 */
16
- label: string = '实体数据表格';
17
-
18
- /** 组件描述,用于设置在编辑器左侧组件面板中展示的描述 */
19
- description: string = '基于 XObject 的数据表格组件,支持增删改查操作';
20
-
21
- /** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
22
- // tags: string[] = ['自定义组件'];
23
-
24
- /** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
25
- iconSrc: string = 'https://custom-widgets.bj.bcebos.com/table.svg';
26
-
27
- /**
28
- * 用于设置组件支持的页面类型
29
- *
30
- * 当前 NeoCRM 平台存在的页面类型:
31
- * all: 1 全页面
32
- * indexPage: 2 首页
33
- * entityListPage: 3 实体列表页
34
- * entityFormPage: 4 实体表单页
35
- * entityDetailPage: 5 实体详情页
36
- * customPage: 6 自定义页面
37
- * bizPage: 7 业务页面
38
- */
39
- // targetPage: string[] = ['customPage'];
40
-
41
- /** 初次插入页面的默认属性数据 */
42
- defaultComProps = {
43
- title: '实体数据表格',
44
- showAddButton: true,
45
- showEditButton: true,
46
- showDeleteButton: true,
47
- xObjectDataApi: {
48
- xObjectApiKey: 'customContact__c',
49
- fields: ['name', 'phone__c'],
50
- },
51
- };
52
-
53
- /**
54
- * 组件属性配置模式
55
- * 支持静态配置:propsSchema,优先级比 propsSchemaCreator 低
56
- * 定义组件在编辑器中可配置的属性
57
- */
58
- propsSchema = [
59
- /*
60
- {
61
- type: 'select',
62
- name: 'custom',
63
- label: '实体类型',
64
- value: true,
65
- placeholder: '请选择要操作的实体类型',
66
- options: [
67
- {
68
- label: '标准实体',
69
- value: false,
70
- },
71
- {
72
- label: '自定义实体',
73
- value: true,
74
- },
75
- ],
76
- },
77
- {
78
- type: 'select',
79
- name: 'xObjectApiKey',
80
- label: '选择实体对象',
81
- source: {
82
- url: '/rest/metadata/v2.0/xobjects/filter?custom=${custom}&active=true',
83
- method: 'GET',
84
- adaptor: (resp: any) => {
85
- const entityList = resp.data?.data?.records || [];
86
- return {
87
- status: 0,
88
- data: {
89
- options: entityList.map((item: any) => ({
90
- label: item.label || item.name,
91
- value: item.apiKey || item.name,
92
- })),
93
- },
94
- };
95
- },
96
- },
97
- searchable: true,
98
- value: 'account',
99
- placeholder: '请选择要操作的实体对象',
100
- },
101
- */
102
- {
103
- type: 'xObjectDataApi', // 用于获取实体业务数据列表的配置项
104
- name: 'xObjectDataApi',
105
- label: '实体数据源',
106
- value: {
107
- xObjectApiKey: 'customContact__c',
108
- fields: ['name', 'phone__c'],
109
- },
110
- placeholder: '请选择实体数据源',
111
- custom: true,
112
- },
113
- {
114
- type: 'switch',
115
- name: 'showAddButton',
116
- label: '显示新增按钮',
117
- value: true,
118
- },
119
- {
120
- type: 'switch',
121
- name: 'showEditButton',
122
- label: '显示编辑按钮',
123
- value: true,
124
- },
125
- {
126
- type: 'switch',
127
- name: 'showDeleteButton',
128
- label: '显示删除按钮',
129
- value: true,
130
- },
131
- ];
132
- }
133
-
134
- export default EntityTableModel;
@@ -1,304 +0,0 @@
1
- .entity-table-container {
2
- .table-header {
3
- margin-bottom: 16px;
4
-
5
- .header-content {
6
- display: flex;
7
- justify-content: space-between;
8
- align-items: center;
9
- flex-wrap: wrap;
10
- gap: 12px;
11
-
12
- .header-title {
13
- margin: 0;
14
- font-size: 18px;
15
- font-weight: 600;
16
- color: #262626;
17
- flex: 1;
18
- min-width: 200px;
19
- }
20
-
21
- .ant-space {
22
- flex-shrink: 0;
23
- }
24
- }
25
- }
26
-
27
- .table-content {
28
- .ant-table {
29
- .ant-table-thead > tr > th {
30
- background-color: #fafafa;
31
- font-weight: 600;
32
- color: #262626;
33
- border-bottom: 1px solid #f0f0f0;
34
- }
35
-
36
- .ant-table-tbody > tr > td {
37
- border-bottom: 1px solid #f0f0f0;
38
- padding: 12px 16px;
39
- }
40
-
41
- .ant-table-tbody > tr:hover > td {
42
- background-color: #f5f5f5;
43
- }
44
-
45
- .ant-table-pagination {
46
- margin-top: 16px;
47
- text-align: right;
48
- }
49
- }
50
-
51
- .ant-empty {
52
- padding: 40px 0;
53
-
54
- .ant-empty-description {
55
- color: #8c8c8c;
56
- font-size: 14px;
57
- }
58
- }
59
-
60
- .error-container {
61
- text-align: center;
62
- padding: 40px 0;
63
-
64
- .retry-button {
65
- background: #1890ff;
66
- border: 1px solid #1890ff;
67
- color: #fff;
68
- padding: 6px 15px;
69
- border-radius: 4px;
70
- cursor: pointer;
71
- font-size: 14px;
72
- transition: all 0.3s;
73
-
74
- &:hover {
75
- background: #40a9ff;
76
- border-color: #40a9ff;
77
- }
78
- }
79
- }
80
- }
81
-
82
- .ant-modal {
83
- .ant-form {
84
- .ant-form-item {
85
- margin-bottom: 16px;
86
-
87
- .ant-form-item-label {
88
- padding-bottom: 4px;
89
-
90
- label {
91
- font-weight: 500;
92
- color: #262626;
93
- }
94
- }
95
-
96
- .ant-input,
97
- .ant-select-selector,
98
- .ant-input-number {
99
- border-radius: 4px;
100
- border: 1px solid #d9d9d9;
101
- transition: all 0.3s;
102
-
103
- &:hover {
104
- border-color: #40a9ff;
105
- }
106
-
107
- &:focus,
108
- &.ant-input-focused,
109
- &.ant-select-focused .ant-select-selector {
110
- border-color: #40a9ff;
111
- box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
112
- }
113
- }
114
-
115
- .ant-input-textarea {
116
- resize: vertical;
117
- min-height: 80px;
118
- }
119
- }
120
- }
121
- }
122
-
123
- .ant-btn {
124
- border-radius: 4px;
125
- font-weight: 500;
126
- transition: all 0.3s;
127
-
128
- &.ant-btn-primary {
129
- background: #1890ff;
130
- border-color: #1890ff;
131
-
132
- &:hover {
133
- background: #40a9ff;
134
- border-color: #40a9ff;
135
- }
136
-
137
- &:focus {
138
- background: #40a9ff;
139
- border-color: #40a9ff;
140
- }
141
- }
142
-
143
- &.ant-btn-link {
144
- padding: 4px 8px;
145
- height: auto;
146
- line-height: 1.5;
147
-
148
- &:hover {
149
- background-color: #f5f5f5;
150
- }
151
- }
152
-
153
- &.ant-btn-link.ant-btn-dangerous {
154
- color: #ff4d4f;
155
-
156
- &:hover {
157
- color: #ff7875;
158
- background-color: #fff2f0;
159
- }
160
- }
161
- }
162
-
163
- .ant-popconfirm {
164
- .ant-popover-inner-content {
165
- padding: 12px 16px;
166
- }
167
-
168
- .ant-popover-buttons {
169
- text-align: right;
170
- margin-top: 8px;
171
-
172
- .ant-btn {
173
- margin-left: 8px;
174
-
175
- &:first-child {
176
- margin-left: 0;
177
- }
178
- }
179
- }
180
- }
181
-
182
- .ant-spin {
183
- .ant-spin-dot {
184
- font-size: 20px;
185
- }
186
-
187
- .ant-spin-text {
188
- color: #8c8c8c;
189
- font-size: 14px;
190
- }
191
- }
192
-
193
- // 响应式设计
194
- @media (max-width: 768px) {
195
- .table-header {
196
- .header-content {
197
- flex-direction: column;
198
- align-items: flex-start;
199
-
200
- .header-title {
201
- margin-bottom: 8px;
202
- }
203
-
204
- .ant-space {
205
- width: 100%;
206
- justify-content: flex-end;
207
- }
208
- }
209
- }
210
-
211
- .table-content {
212
- .ant-table {
213
- .ant-table-thead > tr > th,
214
- .ant-table-tbody > tr > td {
215
- padding: 8px 12px;
216
- font-size: 13px;
217
- }
218
- }
219
- }
220
- }
221
-
222
- @media (max-width: 576px) {
223
- .table-header {
224
- .header-content {
225
- .header-title {
226
- font-size: 16px;
227
- }
228
- }
229
- }
230
-
231
- .table-content {
232
- .ant-table {
233
- .ant-table-thead > tr > th,
234
- .ant-table-tbody > tr > td {
235
- padding: 6px 8px;
236
- font-size: 12px;
237
- }
238
- }
239
-
240
- .ant-table-pagination {
241
- .ant-pagination-options {
242
- display: none;
243
- }
244
- }
245
- }
246
- }
247
- }
248
-
249
- // 全局样式覆盖
250
- .ant-card {
251
- border-radius: 6px;
252
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
253
-
254
- .ant-card-body {
255
- padding: 20px;
256
- }
257
- }
258
-
259
- .ant-modal {
260
- .ant-modal-header {
261
- border-bottom: 1px solid #f0f0f0;
262
- padding: 16px 24px;
263
-
264
- .ant-modal-title {
265
- font-size: 16px;
266
- font-weight: 600;
267
- color: #262626;
268
- }
269
- }
270
-
271
- .ant-modal-body {
272
- padding: 24px;
273
- }
274
-
275
- .ant-modal-footer {
276
- border-top: 1px solid #f0f0f0;
277
- padding: 12px 24px;
278
- text-align: right;
279
-
280
- .ant-btn {
281
- margin-left: 8px;
282
-
283
- &:first-child {
284
- margin-left: 0;
285
- }
286
- }
287
- }
288
- }
289
-
290
- .ant-modal-content {
291
- display: flex;
292
- flex-direction: column;
293
-
294
- .ant-modal-header,
295
- .ant-modal-footer {
296
- flex: 0;
297
- }
298
-
299
- .ant-modal-body {
300
- flex: 1;
301
- max-height: 500px;
302
- overflow-y: auto;
303
- }
304
- }
@@ -1,37 +0,0 @@
1
- import axios from 'axios'; // https://www.axios-http.cn/docs/intro
2
-
3
- // 创建基于 axios 的 fetcher 函数
4
- const axiosFetcher = async (options: any) => {
5
- try {
6
- const config = {
7
- ...options,
8
- method: options?.method || 'GET',
9
- data: options?.data || {},
10
- headers: {
11
- 'Content-Type': 'application/json',
12
- ...options?.headers,
13
- },
14
- timeout: options?.timeout || 30000,
15
- };
16
-
17
- if (config?.method === 'GET') {
18
- config.params = options?.data || {};
19
- }
20
-
21
- const response = await axios(config);
22
- return response?.data || {};
23
- } catch (error) {
24
- if (error.response) {
25
- // 请求成功发出且服务器也响应了状态码,但状态代码超出了 2xx 的范围
26
- console.error('接口请求报错 / 接口服务异常:', error.message);
27
- } else if (error.request) {
28
- // 请求已经成功发起,但没有收到响应
29
- console.error('接口请求报错 / 接口未正常响应:', error.message);
30
- } else {
31
- console.error('接口请求报错:', error, ',请求参数:', options);
32
- }
33
- throw error;
34
- }
35
- };
36
-
37
- export default axiosFetcher;
@@ -1,76 +0,0 @@
1
- import axiosFetcher from '$utils/axiosFetcher';
2
-
3
- /**
4
- * 这里存放通用查询类 Open API
5
- */
6
-
7
- // 获取业务对象数据列表
8
- export const queryXObjectData = async (options?: any) => {
9
- const apiUrl = '/rest/data/v2/query';
10
- const curOptions = options || {};
11
- const xObjectApiKey = curOptions.xObjectApiKey || '';
12
- const fields = curOptions.fields || [];
13
- const page = curOptions.page || 1;
14
- const pageSize = curOptions.pageSize || 10;
15
-
16
- // 自动添加 objectId 字段
17
- if (!fields.includes('id')) {
18
- fields.push('id');
19
- }
20
-
21
- // 计算分页偏移量
22
- const offset = (page - 1) * pageSize;
23
-
24
- // 构建 SQL 查询
25
- let querySql = `select ${fields.join(',')} from ${xObjectApiKey}`;
26
-
27
- // 添加排序条件(如果有的话)
28
- if (curOptions.orderBy) {
29
- querySql += ` order by ${curOptions.orderBy}`;
30
- }
31
-
32
- if (curOptions.page || curOptions.pageSize) {
33
- // 添加分页限制
34
- querySql += ` limit ${pageSize} offset ${offset}`;
35
- }
36
-
37
- try {
38
- const config = {
39
- url: apiUrl,
40
- method: 'GET',
41
- data: {
42
- q: querySql,
43
- },
44
- };
45
-
46
- const resultData = await axiosFetcher(config);
47
-
48
- if (resultData.code === 200) {
49
- const { records, totalSize } = resultData.result || {};
50
- return {
51
- status: true,
52
- code: resultData.code,
53
- msg: resultData.msg || '获取业务对象数据列表成功',
54
- totalSize,
55
- data: records || [],
56
- };
57
- }
58
-
59
- return {
60
- status: false,
61
- code: resultData.code,
62
- msg: resultData.msg || '获取业务对象数据列表失败',
63
- data: [],
64
- };
65
- } catch (error) {
66
- console.error('获取业务对象数据列表失败:', error);
67
-
68
- return {
69
- status: false,
70
- msg: error.msg || error.message || '获取业务对象数据列表失败',
71
- data: [],
72
- };
73
- }
74
- };
75
-
76
- export default queryXObjectData;
@@ -1,162 +0,0 @@
1
- import { message } from 'antd';
2
- import axiosFetcher from './axiosFetcher';
3
-
4
- // 获取业务类型列表
5
- export const getEntityTypeList = async (
6
- xObjectApiKey: string,
7
- options?: any,
8
- ) => {
9
- const curOptions = options || {};
10
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}/busiType`;
11
- try {
12
- const config = {
13
- ...curOptions,
14
- url: apiUrl,
15
- method: 'GET',
16
- };
17
-
18
- const result = await axiosFetcher(config);
19
- return result;
20
- } catch (error) {
21
- console.error('获取业务类型失败:', error);
22
- message.error('获取业务类型失败。');
23
- return {};
24
- }
25
- };
26
-
27
- // 获取对象列表
28
- export const getEntityList = async (options?: any) => {
29
- const curOptions = options || {};
30
- const custom = curOptions.custom || false; // 默认获取标准对象列表
31
- const active = curOptions.active || true; // 仅获取有权限的对象
32
- const apiUrl = `/rest/metadata/v2.0/xobjects/filter?custom=${custom}&active=${active}`;
33
- try {
34
- const config = {
35
- ...curOptions,
36
- url: apiUrl,
37
- method: 'GET',
38
- };
39
-
40
- const result = await axiosFetcher(config);
41
- return result;
42
- } catch (error) {
43
- console.error('获取对象列表失败:', error);
44
- message.error('获取对象列表失败。');
45
- return {};
46
- }
47
- };
48
-
49
- // 创建业务数据
50
- export const createXObject = async (xObjectApiKey: string, options: any) => {
51
- const curOptions = options || {};
52
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}`;
53
- const formData = curOptions.data || {};
54
- try {
55
- const config = {
56
- ...options,
57
- url: apiUrl,
58
- method: curOptions.method || 'GET',
59
- data: {
60
- data: formData,
61
- },
62
- };
63
-
64
- const result = await axiosFetcher(config);
65
- return result;
66
- } catch (error) {
67
- console.error('创建业务数据失败:', error);
68
- throw error;
69
- }
70
- };
71
-
72
- // 获取业务对象描述
73
- export const getXObjectDesc = async (xObjectApiKey: string, options?: any) => {
74
- const curOptions = options || {};
75
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}/description`;
76
- try {
77
- const config = {
78
- ...options,
79
- url: apiUrl,
80
- method: curOptions.method || 'GET',
81
- };
82
-
83
- const result = await axiosFetcher(config);
84
- return result;
85
- } catch (error) {
86
- console.error('获取业务对象描述:', error);
87
- throw error;
88
- }
89
- };
90
-
91
- // 更新业务数据
92
- export const updateXObject = async (
93
- xObjectApiKey: string,
94
- objectId: string,
95
- options: any,
96
- ) => {
97
- const curOptions = options || {};
98
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}/${objectId}`;
99
- const formData = curOptions.data || {};
100
- try {
101
- const config = {
102
- ...curOptions,
103
- url: apiUrl,
104
- method: curOptions.method || 'PATCH',
105
- data: {
106
- data: formData,
107
- },
108
- };
109
-
110
- const result = await axiosFetcher(config);
111
- return result;
112
- } catch (error) {
113
- console.error('更新业务数据失败:', error);
114
- throw error;
115
- }
116
- };
117
-
118
- // 获取业务数据信息
119
- export const getXObject = async (
120
- xObjectApiKey: string,
121
- objectId: string,
122
- options?: any,
123
- ) => {
124
- const curOptions = options || {};
125
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}/${objectId}`;
126
- try {
127
- const config = {
128
- ...curOptions,
129
- url: apiUrl,
130
- method: curOptions.method || 'GET',
131
- };
132
-
133
- const result = await axiosFetcher(config);
134
- return result;
135
- } catch (error) {
136
- console.error('获取业务数据信息失败:', error);
137
- throw error;
138
- }
139
- };
140
-
141
- // 删除业务数据
142
- export const deleteXObject = async (
143
- xObjectApiKey: string,
144
- objectId: string,
145
- options?: any,
146
- ) => {
147
- const curOptions = options || {};
148
- const apiUrl = `/rest/data/v2.0/xobjects/${xObjectApiKey}/${objectId}`;
149
- try {
150
- const config = {
151
- ...curOptions,
152
- url: apiUrl,
153
- method: curOptions.method || 'DELETE',
154
- };
155
-
156
- const result = await axiosFetcher(config);
157
- return result;
158
- } catch (error) {
159
- console.error('删除业务数据:', error);
160
- throw error;
161
- }
162
- };