neo-cmp-cli 1.1.7 → 1.1.9

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 (65) hide show
  1. package/package.json +1 -1
  2. package/src/cmpUtils/createCommonModulesCode.js +61 -0
  3. package/src/cmpUtils/getCmpPreview.js +3 -1
  4. package/src/module/index.js +15 -0
  5. package/src/module/main.js +35 -12
  6. package/src/module/neoInitByCopy.js +12 -0
  7. package/src/neo/neoRequire.js +14 -2
  8. package/src/template/antd-custom-cmp-template/.prettierrc.js +12 -0
  9. package/src/template/antd-custom-cmp-template/README.md +47 -0
  10. package/src/template/antd-custom-cmp-template/commitlint.config.js +59 -0
  11. package/src/template/antd-custom-cmp-template/neo.config.js +115 -0
  12. package/src/template/antd-custom-cmp-template/package.json +59 -0
  13. package/src/template/antd-custom-cmp-template/public/css/base.css +283 -0
  14. package/src/template/antd-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  15. package/src/template/antd-custom-cmp-template/public/template.html +13 -0
  16. package/src/template/antd-custom-cmp-template/src/assets/css/common.scss +127 -0
  17. package/src/template/antd-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  18. package/src/template/antd-custom-cmp-template/src/components/data-dashboard/README.md +39 -0
  19. package/src/template/antd-custom-cmp-template/src/components/data-dashboard/index.tsx +462 -0
  20. package/src/template/antd-custom-cmp-template/src/components/data-dashboard/model.ts +76 -0
  21. package/src/template/antd-custom-cmp-template/src/components/data-dashboard/style.scss +1667 -0
  22. package/src/template/antd-custom-cmp-template/src/components/info-card/index.tsx +72 -0
  23. package/src/template/antd-custom-cmp-template/src/components/info-card/model.ts +78 -0
  24. package/src/template/antd-custom-cmp-template/src/components/info-card/style.scss +105 -0
  25. package/src/template/antd-custom-cmp-template/tsconfig.json +68 -0
  26. package/src/template/echarts-custom-cmp-template/.prettierrc.js +12 -0
  27. package/src/template/echarts-custom-cmp-template/README.md +91 -0
  28. package/src/template/echarts-custom-cmp-template/commitlint.config.js +59 -0
  29. package/src/template/echarts-custom-cmp-template/neo.config.js +117 -0
  30. package/src/template/echarts-custom-cmp-template/package.json +60 -0
  31. package/src/template/echarts-custom-cmp-template/public/css/base.css +283 -0
  32. package/src/template/echarts-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  33. package/src/template/echarts-custom-cmp-template/public/template.html +13 -0
  34. package/src/template/echarts-custom-cmp-template/src/assets/css/common.scss +127 -0
  35. package/src/template/echarts-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  36. package/src/template/echarts-custom-cmp-template/src/components/chart-widget/README.md +186 -0
  37. package/src/template/echarts-custom-cmp-template/src/components/chart-widget/index.tsx +724 -0
  38. package/src/template/echarts-custom-cmp-template/src/components/chart-widget/model.ts +153 -0
  39. package/src/template/echarts-custom-cmp-template/src/components/chart-widget/style.scss +209 -0
  40. package/src/template/echarts-custom-cmp-template/src/components/info-card/index.tsx +69 -0
  41. package/src/template/echarts-custom-cmp-template/src/components/info-card/model.ts +78 -0
  42. package/src/template/echarts-custom-cmp-template/src/components/info-card/style.scss +105 -0
  43. package/src/template/echarts-custom-cmp-template/tsconfig.json +68 -0
  44. package/src/template/neo-custom-cmp-template/.prettierrc.js +12 -0
  45. package/src/template/neo-custom-cmp-template/README.md +47 -0
  46. package/src/template/neo-custom-cmp-template/commitlint.config.js +59 -0
  47. package/src/template/neo-custom-cmp-template/neo.config.js +109 -0
  48. package/src/template/neo-custom-cmp-template/package.json +60 -0
  49. package/src/template/neo-custom-cmp-template/public/css/base.css +283 -0
  50. package/src/template/neo-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  51. package/src/template/neo-custom-cmp-template/public/template.html +13 -0
  52. package/src/template/neo-custom-cmp-template/src/assets/css/common.scss +127 -0
  53. package/src/template/neo-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  54. package/src/template/neo-custom-cmp-template/src/components/info-card/index.tsx +69 -0
  55. package/src/template/neo-custom-cmp-template/src/components/info-card/model.ts +78 -0
  56. package/src/template/neo-custom-cmp-template/src/components/info-card/style.scss +105 -0
  57. package/src/template/neo-custom-cmp-template/src/components/neo-entity-grid/README.md +128 -0
  58. package/src/template/neo-custom-cmp-template/src/components/neo-entity-grid/index.tsx +295 -0
  59. package/src/template/neo-custom-cmp-template/src/components/neo-entity-grid/model.ts +94 -0
  60. package/src/template/neo-custom-cmp-template/src/components/neo-entity-grid/style.scss +127 -0
  61. package/src/template/neo-custom-cmp-template/tsconfig.json +68 -0
  62. package/src/template/react-custom-cmp-template/package.json +1 -1
  63. package/src/template/react-ts-custom-cmp-template/package.json +1 -2
  64. package/src/template/react-ts-custom-cmp-template/src/components/info-card/index.tsx +1 -4
  65. package/src/template/vue2-custom-cmp-template/package.json +1 -1
@@ -0,0 +1,153 @@
1
+ /**
2
+ * @file 图表组件对接编辑器的描述文件
3
+ */
4
+ export class ChartWidgetModel {
5
+ /**
6
+ * cmpType 为自定义组件名称,用于标识组件的唯一性
7
+ * 在构建时根据当前组件目录名称自动生成
8
+ */
9
+ // cmpType: string = 'chart-widget';
10
+
11
+ // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
12
+ label: string = '酷炫图表组件';
13
+
14
+ // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
15
+ description: string =
16
+ '支持多种图表类型切换的专业图表组件,支持丰富的配置选项';
17
+
18
+ // 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
19
+ tags: string[] = ['自定义组件'];
20
+
21
+ // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
22
+ iconSrc: string = 'https://custom-widgets.bj.bcebos.com/chart.svg';
23
+
24
+ // 初次插入页面的默认属性数据
25
+ defaultComProps = {
26
+ chartType: 'line',
27
+ title: '销售趋势分析',
28
+ subtitle: '2025年数据统计',
29
+ width: 800,
30
+ height: 400,
31
+ theme: 'default',
32
+ showLegend: true,
33
+ showTooltip: true,
34
+ showDataZoom: false,
35
+ showGrid: true,
36
+ backgroundColor: 'transparent',
37
+ textColor: '#333',
38
+ mockData: {
39
+ xAxis: ['1月', '2月', '3月', '4月', '5月', '6月'],
40
+ series: [
41
+ {
42
+ name: '销售额',
43
+ data: [120, 200, 150, 80, 70, 110],
44
+ },
45
+ ],
46
+ },
47
+ dataConfig: {
48
+ enableMock: true,
49
+ dataSource: 'mock',
50
+ },
51
+ };
52
+
53
+ // 设计器端预览时展示的默认数据
54
+ previewComProps = {
55
+ label: '酷炫图表组件',
56
+ chartType: 'bar',
57
+ title: '预览图表',
58
+ width: 400,
59
+ height: 300,
60
+ };
61
+
62
+ /**
63
+ * 组件面板配置,用于生成编辑器右侧属性配置面板内容
64
+ * 使用 JSON AMIS 表单配置
65
+ */
66
+ propsSchema = [
67
+ {
68
+ type: 'select',
69
+ name: 'chartType',
70
+ label: '图表类型',
71
+ value: 'line',
72
+ options: [
73
+ { label: '折线图', value: 'line' },
74
+ { label: '柱状图', value: 'bar' },
75
+ { label: '饼图', value: 'pie' },
76
+ { label: '散点图', value: 'scatter' },
77
+ { label: '雷达图', value: 'radar' },
78
+ { label: '仪表盘', value: 'gauge' },
79
+ { label: '漏斗图', value: 'funnel' },
80
+ { label: '桑基图', value: 'sankey' },
81
+ ],
82
+ clearable: false,
83
+ },
84
+ {
85
+ type: 'text',
86
+ name: 'title',
87
+ label: '主标题',
88
+ value: '销售趋势分析',
89
+ placeholder: '请输入图表标题',
90
+ },
91
+ {
92
+ type: 'text',
93
+ name: 'subtitle',
94
+ label: '副标题',
95
+ value: '2025年数据统计',
96
+ placeholder: '请输入图表副标题',
97
+ },
98
+ {
99
+ type: 'number',
100
+ name: 'width',
101
+ label: '宽度',
102
+ value: 800,
103
+ min: 200,
104
+ max: 2000,
105
+ step: 10,
106
+ },
107
+ {
108
+ type: 'number',
109
+ name: 'height',
110
+ label: '高度',
111
+ value: 400,
112
+ min: 200,
113
+ max: 1000,
114
+ step: 10,
115
+ },
116
+ /*
117
+ // 注释掉未生效的配置项
118
+ {
119
+ type: 'color',
120
+ name: 'backgroundColor',
121
+ label: '背景颜色',
122
+ value: 'transparent',
123
+ },
124
+ {
125
+ type: 'color',
126
+ name: 'textColor',
127
+ label: '文字颜色',
128
+ value: '#333',
129
+ },
130
+ */
131
+ {
132
+ type: 'switch',
133
+ name: 'showLegend',
134
+ label: '显示图例',
135
+ value: true,
136
+ },
137
+ {
138
+ type: 'switch',
139
+ name: 'showTooltip',
140
+ label: '显示提示框',
141
+ value: true,
142
+ }
143
+ ];
144
+
145
+ // 支持 函数式写法:propsSchemaCreator,com 为组件实例。优先级比 propsSchema 高
146
+ /*
147
+ propsSchemaCreator = (com: any) => {
148
+ return [];
149
+ };
150
+ */
151
+ }
152
+
153
+ export default ChartWidgetModel;
@@ -0,0 +1,209 @@
1
+ .chart-widget-container {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
6
+ border-radius: 12px;
7
+ padding: 20px;
8
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
9
+ backdrop-filter: blur(10px);
10
+ border: 1px solid rgba(255, 255, 255, 0.2);
11
+ overflow: hidden;
12
+
13
+ &::before {
14
+ content: '';
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ right: 0;
19
+ bottom: 0;
20
+ background: linear-gradient(45deg,
21
+ rgba(255, 255, 255, 0.1) 0%,
22
+ rgba(255, 255, 255, 0.05) 50%,
23
+ rgba(255, 255, 255, 0.1) 100%);
24
+ pointer-events: none;
25
+ }
26
+
27
+ .user-info {
28
+ position: absolute;
29
+ top: 10px;
30
+ right: 20px;
31
+ z-index: 10;
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: flex-end;
35
+ gap: 4px;
36
+
37
+ .user-name,
38
+ .tenant-name {
39
+ background: rgba(255, 255, 255, 0.9);
40
+ color: #333;
41
+ padding: 4px 8px;
42
+ border-radius: 12px;
43
+ font-size: 12px;
44
+ font-weight: 500;
45
+ backdrop-filter: blur(10px);
46
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
47
+ }
48
+
49
+ .user-name {
50
+ background: linear-gradient(135deg, #667eea, #764ba2);
51
+ color: white;
52
+ }
53
+ }
54
+
55
+ .chart-container {
56
+ position: relative;
57
+ margin: 0 auto;
58
+ z-index: 1;
59
+ background: rgba(255, 255, 255, 0.95);
60
+ border-radius: 8px;
61
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
62
+ backdrop-filter: blur(10px);
63
+ border: 1px solid rgba(255, 255, 255, 0.3);
64
+ overflow: hidden;
65
+ transition: all 0.3s ease;
66
+
67
+ &:hover {
68
+ transform: translateY(-2px);
69
+ box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
70
+ }
71
+
72
+ // ECharts 容器样式增强
73
+ .echarts-for-react {
74
+ width: 100% !important;
75
+ height: 100% !important;
76
+ }
77
+ }
78
+
79
+ // 响应式设计
80
+ @media (max-width: 768px) {
81
+ padding: 15px;
82
+
83
+ .user-info {
84
+ top: 8px;
85
+ right: 15px;
86
+
87
+ .user-name,
88
+ .tenant-name {
89
+ font-size: 11px;
90
+ padding: 3px 6px;
91
+ }
92
+ }
93
+ }
94
+
95
+ // 深色主题适配
96
+ &.dark-theme {
97
+ background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
98
+
99
+ .chart-container {
100
+ background: rgba(44, 62, 80, 0.95);
101
+ border-color: rgba(255, 255, 255, 0.1);
102
+ }
103
+ }
104
+
105
+ // 动画效果
106
+ &.loading {
107
+ .chart-container {
108
+ position: relative;
109
+
110
+ &::after {
111
+ content: '';
112
+ position: absolute;
113
+ top: 50%;
114
+ left: 50%;
115
+ width: 40px;
116
+ height: 40px;
117
+ margin: -20px 0 0 -20px;
118
+ border: 3px solid #f3f3f3;
119
+ border-top: 3px solid #667eea;
120
+ border-radius: 50%;
121
+ animation: spin 1s linear infinite;
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ @keyframes spin {
128
+ 0% { transform: rotate(0deg); }
129
+ 100% { transform: rotate(360deg); }
130
+ }
131
+
132
+ // 图表类型特定样式
133
+ .chart-widget-container {
134
+ &.line-chart {
135
+ .chart-container {
136
+ background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
137
+ }
138
+ }
139
+
140
+ &.bar-chart {
141
+ .chart-container {
142
+ background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
143
+ }
144
+ }
145
+
146
+ &.pie-chart {
147
+ .chart-container {
148
+ background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
149
+ }
150
+ }
151
+
152
+ &.scatter-chart {
153
+ .chart-container {
154
+ background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
155
+ }
156
+ }
157
+
158
+ &.radar-chart {
159
+ .chart-container {
160
+ background: linear-gradient(135deg, rgba(0, 150, 136, 0.1), rgba(0, 188, 212, 0.1));
161
+ }
162
+ }
163
+
164
+ &.gauge-chart {
165
+ .chart-container {
166
+ background: linear-gradient(135deg, rgba(255, 87, 34, 0.1), rgba(255, 152, 0, 0.1));
167
+ }
168
+ }
169
+
170
+ &.funnel-chart {
171
+ .chart-container {
172
+ background: linear-gradient(135deg, rgba(63, 81, 181, 0.1), rgba(103, 58, 183, 0.1));
173
+ }
174
+ }
175
+
176
+ &.sankey-chart {
177
+ .chart-container {
178
+ background: linear-gradient(135deg, rgba(121, 85, 72, 0.1), rgba(96, 125, 139, 0.1));
179
+ }
180
+ }
181
+ }
182
+
183
+ // 全局图表样式覆盖
184
+ .chart-widget-container {
185
+ .chart-container {
186
+ // 确保 ECharts 图表在容器内正确显示
187
+ canvas {
188
+ border-radius: 8px;
189
+ }
190
+
191
+ // 图表标题样式
192
+ .echarts-title {
193
+ font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
194
+ font-weight: 600;
195
+ }
196
+
197
+ // 图例样式
198
+ .echarts-legend {
199
+ font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
200
+ }
201
+
202
+ // 工具提示样式
203
+ .echarts-tooltip {
204
+ font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
205
+ border-radius: 8px;
206
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
207
+ }
208
+ }
209
+ }
@@ -0,0 +1,69 @@
1
+ import * as React from 'react';
2
+ import './style.scss'; // 组件内容样式
3
+
4
+ interface InfoCardProps {
5
+ title: string;
6
+ backgroundImage: string;
7
+ imgCount: number;
8
+ commentCount: number;
9
+ data?: any;
10
+ }
11
+
12
+ export default class InfoCard extends React.PureComponent<InfoCardProps> {
13
+ constructor(props: InfoCardProps) {
14
+ super(props);
15
+ this.agreeDataFormat = this.agreeDataFormat.bind(this);
16
+ }
17
+
18
+ agreeDataFormat(agreeData: number) {
19
+ if (agreeData && agreeData <= 9999) {
20
+ return agreeData;
21
+ }
22
+ if (agreeData && agreeData > 9999) {
23
+ return `${Math.floor(agreeData / 1000) / 10}w`;
24
+ }
25
+ return '';
26
+ }
27
+
28
+ render() {
29
+ const { title, backgroundImage, imgCount, commentCount } = this.props;
30
+ console.log('当前自定义组件:', this.props, this);
31
+ const curAmisData = this.props.data || {};
32
+
33
+ const userInfo = curAmisData.__NeoCurrentUser;
34
+ const systemInfo = curAmisData.__NeoSystemInfo || {};
35
+
36
+ const curBackgroundImage =
37
+ backgroundImage || 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg';
38
+ return (
39
+ <div className="info-card-container">
40
+ <div className="news-title">
41
+ {title ||
42
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。'}
43
+ {systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
44
+ </div>
45
+ <div className="item-imgbox">
46
+ {userInfo && userInfo.icon && (
47
+ <div className="user-info-box">
48
+ <img src={userInfo.icon} className="user-icon" />
49
+ <span className="user-name">{userInfo.name}</span>
50
+ </div>
51
+ )}
52
+ <div
53
+ className="news-img"
54
+ style={{ backgroundImage: `url(${curBackgroundImage})` }}
55
+ ></div>
56
+ {imgCount > 0 && <div className="img-count">{imgCount}</div>}
57
+ </div>
58
+ <div className="news-info">
59
+ <div className="left media-mark">NeoCRM · 低代码平台</div>
60
+ {commentCount && commentCount > 0 && (
61
+ <div className="cmt-num right">
62
+ {this.agreeDataFormat(commentCount)}评
63
+ </div>
64
+ )}
65
+ </div>
66
+ </div>
67
+ );
68
+ }
69
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @file 自定义组件对接编辑器的描述文件
3
+ */
4
+ export class InfoCardModel {
5
+ /**
6
+ * cmpType 为自定义组件名称,用于标识组件的唯一性
7
+ * 在构建时根据当前组件目录名称自动生成
8
+ */
9
+ // cmpType: string = 'info-card';
10
+
11
+ // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
12
+ label: string = '信息卡片';
13
+
14
+ // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
15
+ description: string = '信息展示卡片';
16
+
17
+ // 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
18
+ tags: string[] = ['自定义组件'];
19
+
20
+ // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
21
+ iconSrc: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
22
+ // iconSrc = 'https://neo-widgets.bj.bcebos.com/favicon.png';
23
+
24
+ // 初次插入页面的默认属性数据
25
+ defaultComProps = {
26
+ title:
27
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
28
+ label: '信息卡片',
29
+ backgroundImage: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
30
+ imgCount: 3,
31
+ commentCount: 2025,
32
+ };
33
+
34
+ // 设计器端预览时展示的默认数据
35
+ previewComProps = {
36
+ label: '信息卡片',
37
+ };
38
+
39
+ /**
40
+ * 组件面板配置,用于生成编辑器右侧属性配置面板内容
41
+ */
42
+ propsSchema = [
43
+ {
44
+ type: 'textarea',
45
+ name: 'title',
46
+ label: '卡片title',
47
+ value:
48
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
49
+ },
50
+ {
51
+ type: 'text',
52
+ name: 'backgroundImage',
53
+ label: '展示图片',
54
+ value: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
55
+ },
56
+ {
57
+ type: 'number',
58
+ name: 'imgCount',
59
+ label: '图片数量',
60
+ value: 3,
61
+ },
62
+ {
63
+ type: 'number',
64
+ name: 'commentCount',
65
+ label: '评论数',
66
+ value: 2025,
67
+ },
68
+ ];
69
+
70
+ // 支持 函数式写法:propsSchemaCreator,com 为组件实例。优先级比 propsSchema 高
71
+ /*
72
+ propsSchemaCreator = (com: any) => {
73
+ return [];
74
+ };
75
+ */
76
+ }
77
+
78
+ export default InfoCardModel;
@@ -0,0 +1,105 @@
1
+ :root {
2
+ --padding-bottom: 12px;
3
+ }
4
+
5
+ .info-card-container {
6
+ position: relative;
7
+ box-sizing: border-box;
8
+
9
+ /* border-bottom: 1px solid #ececec; */
10
+ margin: 6px 12px;
11
+ padding: 6px var(--padding-bottom);
12
+ background-color: #fff;
13
+
14
+ .news-title {
15
+ padding: 6px 0;
16
+ font-family: PingFangSC-Regular;
17
+ font-size: 16px;
18
+ line-height: 22px;
19
+ color: #5f5e5e;
20
+ }
21
+
22
+ .item-imgbox {
23
+ position: relative;
24
+ height: 395px;
25
+ background: #f0f0f0;
26
+ cursor: pointer;
27
+ box-sizing: border-box;
28
+ text-align: center;
29
+ overflow: hidden;
30
+
31
+ .news-img {
32
+ width: 100%;
33
+ height: 100%;
34
+ box-sizing: border-box;
35
+ background-size: contain;
36
+ }
37
+
38
+ .img-count {
39
+ position: absolute;
40
+ top: 0;
41
+ right: 0;
42
+ padding: 6px 8px;
43
+ color: #fff;
44
+ min-width: 60px;
45
+ text-align: center;
46
+ line-height: 1.2;
47
+ background: rgb(0 0 0 / 40%);
48
+ font-size: 25px;
49
+ box-sizing: border-box;
50
+ overflow: hidden;
51
+ }
52
+
53
+ .user-info-box {
54
+ position: absolute;
55
+ top: 10px;
56
+ left: 10px;
57
+ width: 100px;
58
+ min-height: 100px;
59
+ padding: 6px 8px;
60
+ color: #fff;
61
+ min-width: 60px;
62
+ text-align: center;
63
+ line-height: 1.2;
64
+ background: rgb(0 0 0 / 40%);
65
+ font-size: 25px;
66
+ box-sizing: border-box;
67
+ overflow: hidden;
68
+ display: flex;
69
+ flex-direction: column;
70
+ align-items: center;
71
+ justify-content: center;
72
+
73
+ .user-icon {
74
+ width: 64px;
75
+ height: 64px;
76
+ border-radius: 50%;
77
+ }
78
+
79
+ .user-name {
80
+ font-size: 16px;
81
+ font-weight: 600;
82
+ margin-top: 10px;
83
+ }
84
+ }
85
+ }
86
+
87
+ .news-info {
88
+ font-family: PingFangSC-Light;
89
+ height: 28px;
90
+ box-sizing: border-box;
91
+ display: flex;
92
+ justify-content: space-between;
93
+ align-items: center;
94
+ }
95
+
96
+ .media-mark,
97
+ .cmt-num {
98
+ display: inline-block;
99
+ height: 28px;
100
+ line-height: 28px;
101
+ font-family: PingFangSC-Light;
102
+ font-size: 18px;
103
+ color: #828282;
104
+ }
105
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "compilerOptions": {
3
+ "experimentalDecorators": true,
4
+ /* Basic Options */
5
+ "target": "esnext",
6
+ /* 指定编译之后的版本: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
7
+ "module": "esnext" /* 指定要使用的模板标准: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
8
+ // "lib": [], /* Specify library files to be included in the compilation. */
9
+ "allowJs": false /* 指定是否允许编译JS文件,默认false,即不编译JS文件. */,
10
+ // "checkJs": true, /* 指定是否检查和报告JS文件中的错误,默认false */
11
+ "jsx": "react" /* 指定jsx代码用于的开发环境:'preserve','react-native', or 'react'. */,
12
+ "declaration": false /* 指定是否在编译的时候生成相的d.ts声明文件 */,
13
+ // "declarationMap": true, /* 指定编译时是否生成.map文件 */
14
+ // "sourceMap": true, /* 指定编译时是否生成.map文件 */
15
+ // "outFile": "./", /* 指定输出文件合并为一个文件 */
16
+ // "outDir": "dist", /* 指定输出文件夹,值为一个文件夹路径字符串,输出的文件都将放置在这个文件夹*/
17
+ // "rootDir": "src", /* 指定编译文件的根目录,编译器会在根目录查找入口文件 */
18
+ // "composite": true, /* 是否编译构建引用项目 */
19
+ // "removeComments": true, /* 指定是否将编译后的文件注释删掉,设为true的话即删除注释,默认为false */
20
+ "noEmit": false /* 不生成编译文件 */,
21
+ "importHelpers": true /* 指定是否引入tslib里的复制工具函数,默认为false */,
22
+ // "downlevelIteration": true, /* 当target为"ES5"或"ES3"时,为"for-of" "spread"和"destructuring"中的迭代器提供完全支持 */
23
+ "isolatedModules": false /* 指定是否将每个文件作为单独的模块,默认为true */,
24
+
25
+ /* Strict Type-Checking Options */
26
+ "strict": false /* 指定是否启动所有类型检查 */,
27
+ "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
28
+ "strictNullChecks": true /* Enable strict null checks. */,
29
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
30
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31
+ "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
32
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
33
+
34
+ /* Additional Checks */
35
+ "noUnusedLocals": false /* Report errors on unused locals. */,
36
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
37
+ "noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
38
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39
+
40
+ /* Module Resolution Options */
41
+ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
42
+ "baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
43
+ "paths": {
44
+ "@": ["./src"]
45
+ } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
46
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
47
+ /* 指定声明文件或文件夹的路径列表,如果指定了此项,则只有在这里列出的声明文件才会被加载 */
48
+ "typeRoots": ["./@types", "./node_modules/@types"],
49
+ // "types": [], /* 指定需要包含的模块,只有在这里列出的模块的声明文件才会被加载 */
50
+ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
51
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
52
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
53
+
54
+ /* Source Map Options */
55
+ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
56
+ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
57
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
58
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
59
+
60
+ /* Experimental Options */
61
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
62
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
63
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
64
+ // "suppressImplicitAnyIndexErrors": true /* Suppress --noImplicitAny errors for indexing objects lacking index signatures. See issue #1232 for more details. */
65
+ },
66
+ "include": ["src", "test"],
67
+ "exclude": ["node_modules"]
68
+ }
@@ -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
+ };