congmao-cli 1.0.0

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 (180) hide show
  1. package/README.md +2 -0
  2. package/bin/index.js +20 -0
  3. package/package.json +42 -0
  4. package/src/commands/create.js +171 -0
  5. package/src/commands/mcp.js +157 -0
  6. package/src/mcp/CURSOR_SETUP.md +259 -0
  7. package/src/mcp/README.md +134 -0
  8. package/src/mcp/USAGE_EXAMPLES.md +181 -0
  9. package/src/mcp/get-cursor-config.js +58 -0
  10. package/src/mcp/package.json +23 -0
  11. package/src/mcp/pnpm-lock.yaml +2441 -0
  12. package/src/mcp/src/handlers.js +211 -0
  13. package/src/mcp/src/http-server.js +332 -0
  14. package/src/mcp/src/index.js +195 -0
  15. package/src/mcp/src/schemas.js +54 -0
  16. package/src/mcp/test-create-project.js +49 -0
  17. package/src/mcp/test-mcp.js +89 -0
  18. package/src/mcp/test-show-tree.js +66 -0
  19. package/src/template/Uni-app/README.md +19 -0
  20. package/src/template/Uni-app/babel.config.js +81 -0
  21. package/src/template/Uni-app/package.json +107 -0
  22. package/src/template/Uni-app/postcss.config.js +27 -0
  23. package/src/template/Uni-app/public/index.html +25 -0
  24. package/src/template/Uni-app/shims-uni.d.ts +11 -0
  25. package/src/template/Uni-app/shims-vue.d.ts +4 -0
  26. package/src/template/Uni-app/src/App.vue +17 -0
  27. package/src/template/Uni-app/src/main.js +12 -0
  28. package/src/template/Uni-app/src/manifest.json +75 -0
  29. package/src/template/Uni-app/src/pages/index/index.vue +49 -0
  30. package/src/template/Uni-app/src/pages.json +16 -0
  31. package/src/template/Uni-app/src/static/logo.png +0 -0
  32. package/src/template/Uni-app/src/uni.promisify.adaptor.js +13 -0
  33. package/src/template/Uni-app/src/uni.scss +76 -0
  34. package/src/template/Uni-app/yarn.lock +11466 -0
  35. package/src/template/Vue2/.editorconfig +14 -0
  36. package/src/template/Vue2/.env +2 -0
  37. package/src/template/Vue2/.env.development +2 -0
  38. package/src/template/Vue2/.env.site +2 -0
  39. package/src/template/Vue2/.prettierrc.js +39 -0
  40. package/src/template/Vue2/.stylelintignore +8 -0
  41. package/src/template/Vue2/README-zh_CN.md +115 -0
  42. package/src/template/Vue2/commitlint.config.js +1 -0
  43. package/src/template/Vue2/docs/docs-starter.png +0 -0
  44. package/src/template/Vue2/docs/docs-startup.png +0 -0
  45. package/src/template/Vue2/docs/docs-structure.png +0 -0
  46. package/src/template/Vue2/globals.d.ts +13 -0
  47. package/src/template/Vue2/index.html +27 -0
  48. package/src/template/Vue2/jsx.d.ts +13 -0
  49. package/src/template/Vue2/mock/index.ts +147 -0
  50. package/src/template/Vue2/package.json +91 -0
  51. package/src/template/Vue2/package.json.ejs +91 -0
  52. package/src/template/Vue2/public/favicon.ico +0 -0
  53. package/src/template/Vue2/shims-vue.d.ts +5 -0
  54. package/src/template/Vue2/src/App.vue +19 -0
  55. package/src/template/Vue2/src/assets/assets-login-bg-black.png +0 -0
  56. package/src/template/Vue2/src/assets/assets-login-bg-white.png +0 -0
  57. package/src/template/Vue2/src/assets/assets-logo-full.svg +39 -0
  58. package/src/template/Vue2/src/assets/assets-product-1.svg +5 -0
  59. package/src/template/Vue2/src/assets/assets-product-2.svg +5 -0
  60. package/src/template/Vue2/src/assets/assets-product-3.svg +5 -0
  61. package/src/template/Vue2/src/assets/assets-product-4.svg +5 -0
  62. package/src/template/Vue2/src/assets/assets-result-403.svg +32 -0
  63. package/src/template/Vue2/src/assets/assets-result-404.svg +36 -0
  64. package/src/template/Vue2/src/assets/assets-result-500.svg +32 -0
  65. package/src/template/Vue2/src/assets/assets-result-ie.svg +33 -0
  66. package/src/template/Vue2/src/assets/assets-result-maintenance.svg +49 -0
  67. package/src/template/Vue2/src/assets/assets-result-wifi.svg +23 -0
  68. package/src/template/Vue2/src/assets/assets-setting-auto.svg +13 -0
  69. package/src/template/Vue2/src/assets/assets-setting-dark.svg +5 -0
  70. package/src/template/Vue2/src/assets/assets-setting-light.svg +13 -0
  71. package/src/template/Vue2/src/assets/assets-t-logo.svg +41 -0
  72. package/src/template/Vue2/src/assets/assets-tencent-logo.png +0 -0
  73. package/src/template/Vue2/src/components/color/index.vue +35 -0
  74. package/src/template/Vue2/src/components/product-card/index.vue +121 -0
  75. package/src/template/Vue2/src/components/result/index.vue +118 -0
  76. package/src/template/Vue2/src/components/thumbnail/index.vue +49 -0
  77. package/src/template/Vue2/src/components/trend/index.vue +105 -0
  78. package/src/template/Vue2/src/config/color.ts +30 -0
  79. package/src/template/Vue2/src/config/global.ts +2 -0
  80. package/src/template/Vue2/src/config/host.ts +26 -0
  81. package/src/template/Vue2/src/config/style.ts +14 -0
  82. package/src/template/Vue2/src/constants/index.ts +46 -0
  83. package/src/template/Vue2/src/interface.ts +39 -0
  84. package/src/template/Vue2/src/layouts/blank.vue +12 -0
  85. package/src/template/Vue2/src/layouts/components/Breadcrumb.vue +39 -0
  86. package/src/template/Vue2/src/layouts/components/Content.vue +43 -0
  87. package/src/template/Vue2/src/layouts/components/Footer.vue +27 -0
  88. package/src/template/Vue2/src/layouts/components/Header.vue +321 -0
  89. package/src/template/Vue2/src/layouts/components/LayoutContent.vue +168 -0
  90. package/src/template/Vue2/src/layouts/components/LayoutHeader.vue +52 -0
  91. package/src/template/Vue2/src/layouts/components/LayoutSidebar.vue +51 -0
  92. package/src/template/Vue2/src/layouts/components/MenuContent.vue +108 -0
  93. package/src/template/Vue2/src/layouts/components/Notice.vue +221 -0
  94. package/src/template/Vue2/src/layouts/components/Search.vue +134 -0
  95. package/src/template/Vue2/src/layouts/components/SideNav.vue +150 -0
  96. package/src/template/Vue2/src/layouts/index.vue +100 -0
  97. package/src/template/Vue2/src/layouts/setting.vue +404 -0
  98. package/src/template/Vue2/src/main.js +9 -0
  99. package/src/template/Vue2/src/main.jsx +51 -0
  100. package/src/template/Vue2/src/pages/dashboard/base/components/MiddleChart.vue +158 -0
  101. package/src/template/Vue2/src/pages/dashboard/base/components/OutputOverview.vue +189 -0
  102. package/src/template/Vue2/src/pages/dashboard/base/components/RankList.vue +111 -0
  103. package/src/template/Vue2/src/pages/dashboard/base/components/TopPanel.vue +246 -0
  104. package/src/template/Vue2/src/pages/dashboard/base/index.ts +702 -0
  105. package/src/template/Vue2/src/pages/dashboard/base/index.vue +44 -0
  106. package/src/template/Vue2/src/pages/dashboard/detail/index.ts +267 -0
  107. package/src/template/Vue2/src/pages/dashboard/detail/index.vue +242 -0
  108. package/src/template/Vue2/src/pages/detail/advanced/components/Product.vue +167 -0
  109. package/src/template/Vue2/src/pages/detail/advanced/index.less +74 -0
  110. package/src/template/Vue2/src/pages/detail/advanced/index.vue +219 -0
  111. package/src/template/Vue2/src/pages/detail/base/index.less +105 -0
  112. package/src/template/Vue2/src/pages/detail/base/index.vue +46 -0
  113. package/src/template/Vue2/src/pages/detail/deploy/index.ts +204 -0
  114. package/src/template/Vue2/src/pages/detail/deploy/index.vue +224 -0
  115. package/src/template/Vue2/src/pages/detail/secondary/index.less +71 -0
  116. package/src/template/Vue2/src/pages/detail/secondary/index.vue +131 -0
  117. package/src/template/Vue2/src/pages/form/base/index.less +57 -0
  118. package/src/template/Vue2/src/pages/form/base/index.vue +254 -0
  119. package/src/template/Vue2/src/pages/form/step/index.less +37 -0
  120. package/src/template/Vue2/src/pages/form/step/index.vue +259 -0
  121. package/src/template/Vue2/src/pages/frame/doc/index.vue +86 -0
  122. package/src/template/Vue2/src/pages/frame/tdesign/index.vue +86 -0
  123. package/src/template/Vue2/src/pages/list/base/index.vue +267 -0
  124. package/src/template/Vue2/src/pages/list/card/index.vue +221 -0
  125. package/src/template/Vue2/src/pages/list/components/CommonTable.vue +313 -0
  126. package/src/template/Vue2/src/pages/list/filter/index.vue +15 -0
  127. package/src/template/Vue2/src/pages/list/tree/index.vue +174 -0
  128. package/src/template/Vue2/src/pages/login/components/components-header.vue +74 -0
  129. package/src/template/Vue2/src/pages/login/components/components-login.vue +154 -0
  130. package/src/template/Vue2/src/pages/login/components/components-register.vue +144 -0
  131. package/src/template/Vue2/src/pages/login/index.less +202 -0
  132. package/src/template/Vue2/src/pages/login/index.vue +53 -0
  133. package/src/template/Vue2/src/pages/nest-menu/Index.vue +10 -0
  134. package/src/template/Vue2/src/pages/result/403/index.vue +14 -0
  135. package/src/template/Vue2/src/pages/result/404/index.vue +14 -0
  136. package/src/template/Vue2/src/pages/result/500/index.vue +14 -0
  137. package/src/template/Vue2/src/pages/result/browser-incompatible/index.vue +77 -0
  138. package/src/template/Vue2/src/pages/result/fail/index.vue +57 -0
  139. package/src/template/Vue2/src/pages/result/maintenance/index.vue +14 -0
  140. package/src/template/Vue2/src/pages/result/network-error/index.vue +24 -0
  141. package/src/template/Vue2/src/pages/result/success/index.vue +59 -0
  142. package/src/template/Vue2/src/pages/user/index.less +148 -0
  143. package/src/template/Vue2/src/pages/user/index.ts +157 -0
  144. package/src/template/Vue2/src/pages/user/index.vue +204 -0
  145. package/src/template/Vue2/src/permission.js +56 -0
  146. package/src/template/Vue2/src/router/index.js +43 -0
  147. package/src/template/Vue2/src/router/modules/base.ts +29 -0
  148. package/src/template/Vue2/src/router/modules/components.ts +175 -0
  149. package/src/template/Vue2/src/router/modules/others.ts +55 -0
  150. package/src/template/Vue2/src/service/service-advance.ts +233 -0
  151. package/src/template/Vue2/src/service/service-base.ts +205 -0
  152. package/src/template/Vue2/src/service/service-detail-base.ts +84 -0
  153. package/src/template/Vue2/src/service/service-detail-deploy.ts +234 -0
  154. package/src/template/Vue2/src/service/service-detail.ts +57 -0
  155. package/src/template/Vue2/src/service/service-user.ts +64 -0
  156. package/src/template/Vue2/src/store/index.ts +22 -0
  157. package/src/template/Vue2/src/store/modules/notification.ts +90 -0
  158. package/src/template/Vue2/src/store/modules/permission.ts +66 -0
  159. package/src/template/Vue2/src/store/modules/setting.ts +122 -0
  160. package/src/template/Vue2/src/store/modules/tab-router.ts +83 -0
  161. package/src/template/Vue2/src/store/modules/user.ts +98 -0
  162. package/src/template/Vue2/src/style/font-family.less +6 -0
  163. package/src/template/Vue2/src/style/index.less +5 -0
  164. package/src/template/Vue2/src/style/layout.less +201 -0
  165. package/src/template/Vue2/src/style/reset.less +78 -0
  166. package/src/template/Vue2/src/style/variables.less +27 -0
  167. package/src/template/Vue2/src/utils/charts.ts +38 -0
  168. package/src/template/Vue2/src/utils/color.ts +118 -0
  169. package/src/template/Vue2/src/utils/date.ts +12 -0
  170. package/src/template/Vue2/src/utils/request.ts +60 -0
  171. package/src/template/Vue2/stylelint.config.js +5 -0
  172. package/src/template/Vue2/tsconfig.json +26 -0
  173. package/src/template/Vue2/vite.config.js +58 -0
  174. package/src/template/Vue3/package.json.ejs +8 -0
  175. package/src/template/Vue3/pages.json +10 -0
  176. package/src/template/Vue3/src/main.js +7 -0
  177. package/src/utils/copy.js +17 -0
  178. package/src/utils/eslint.js +205 -0
  179. package/src/utils/logo.js +18 -0
  180. package/src/utils/render.js +20 -0
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div class="result-fail">
3
+ <error-circle-icon class="result-fail-icon" />
4
+ <div class="result-fail-title">创建失败</div>
5
+ <div class="result-fail-describe">抱歉,您的项目创建失败,企业微信联系检查创建者权限,或返回修改。</div>
6
+ <div>
7
+ <t-button @click="() => this.$router.push('/form/base')">返回修改</t-button>
8
+ <t-button theme="default" @click="() => this.$router.push('/form/base')">返回首页</t-button>
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import { ErrorCircleIcon } from 'tdesign-icons-vue';
15
+
16
+ export default {
17
+ name: 'ResultFail',
18
+ components: {
19
+ ErrorCircleIcon,
20
+ },
21
+ };
22
+ </script>
23
+
24
+ <style lang="less" scoped>
25
+ @import '@/style/variables.less';
26
+ .result-fail {
27
+ display: flex;
28
+ flex-direction: column;
29
+ justify-content: center;
30
+ align-items: center;
31
+ height: 75vh;
32
+
33
+ &-icon {
34
+ font-size: 72px;
35
+ color: var(--td-text-color-secondary);
36
+ }
37
+
38
+ &-title {
39
+ margin-top: 28px;
40
+ font-size: 20px;
41
+ color: var(--td-text-color-primary);
42
+ text-align: center;
43
+ line-height: 28px;
44
+ font-weight: 500;
45
+ }
46
+
47
+ &-describe {
48
+ margin: 8px 0 32px;
49
+ font-size: 14px;
50
+ color: var(--td-text-color-secondary);
51
+ line-height: 22px;
52
+ }
53
+ .t-button + .t-button {
54
+ margin-left: var(--td-comp-margin-s);
55
+ }
56
+ }
57
+ </style>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <result title="系统维护中" tip="系统维护中,请稍后再试" type="maintenance">
3
+ <t-button theme="default" @click="() => $router.push('/')">返回首页</t-button>
4
+ </result>
5
+ </template>
6
+
7
+ <script>
8
+ import result from '@/components/result/index.vue';
9
+
10
+ export default {
11
+ name: 'ResultMaintenance',
12
+ components: { result },
13
+ };
14
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <result title="网络异常" tip="网络异常,请稍后再试" type="wifi">
3
+ <div>
4
+ <t-button @click="() => $router.push('/')">重新加载</t-button>
5
+ <t-button theme="default" @click="() => $router.push('/')">返回首页</t-button>
6
+ </div>
7
+ </result>
8
+ </template>
9
+
10
+ <script>
11
+ import result from '@/components/result/index.vue';
12
+
13
+ export default {
14
+ name: 'ResultNetworkError',
15
+ components: { result },
16
+ };
17
+ </script>
18
+ <style lang="less" scoped>
19
+ @import '@/style/variables.less';
20
+
21
+ .t-button + .t-button {
22
+ margin-left: var(--td-comp-margin-s);
23
+ }
24
+ </style>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div class="result-success">
3
+ <check-circle-icon class="result-success-icon" />
4
+ <div class="result-success-title">项目已创建成功</div>
5
+ <div class="result-success-describe">可以联系负责人分发应用</div>
6
+ <div>
7
+ <t-button @click="() => this.$router.push('/form/base')">返回首页</t-button>
8
+ <t-button @click="() => this.$router.push('/detail/advanced')" theme="default">查看进度</t-button>
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import { CheckCircleIcon } from 'tdesign-icons-vue';
15
+
16
+ export default {
17
+ name: 'ResultSuccess',
18
+ components: {
19
+ CheckCircleIcon,
20
+ },
21
+ };
22
+ </script>
23
+
24
+ <style lang="less" scoped>
25
+ @import '@/style/variables.less';
26
+
27
+ .result-success {
28
+ display: flex;
29
+ flex-direction: column;
30
+ justify-content: center;
31
+ align-items: center;
32
+ height: 75vh;
33
+
34
+ &-icon {
35
+ font-size: 72px;
36
+ color: var(--td-success-color);
37
+ }
38
+
39
+ &-title {
40
+ margin-top: 28px;
41
+ font-size: 20px;
42
+ color: var(--td-text-color-primary);
43
+ text-align: center;
44
+ line-height: 28px;
45
+ font-weight: 500;
46
+ }
47
+
48
+ &-describe {
49
+ margin: 8px 0 32px;
50
+ font-size: 14px;
51
+ color: var(--td-text-color-secondary);
52
+ line-height: 22px;
53
+ }
54
+ }
55
+
56
+ .t-button + .t-button {
57
+ margin-left: var(--td-comp-margin-s);
58
+ }
59
+ </style>
@@ -0,0 +1,148 @@
1
+ @import '@/style/variables';
2
+
3
+ /deep/ .t-card__title {
4
+ font-size: 20px;
5
+ font-weight: 500;
6
+ }
7
+
8
+ .user-left-greeting {
9
+ padding: 28px 32px;
10
+ line-height: 28px;
11
+ font-size: 20px;
12
+ background: var(--td-bg-color-container);
13
+ color: var(--td-text-color-primary);
14
+ text-align: left;
15
+ border-radius: var(--td-radius-default);
16
+ display: flex;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+
20
+ .regular {
21
+ margin-right: 15px;
22
+ font-size: 14px;
23
+ }
24
+
25
+ .logo {
26
+ width: 180px;
27
+ }
28
+ }
29
+
30
+ .user-info-list {
31
+ margin-top: 16px;
32
+
33
+ .content {
34
+ width: 90%;
35
+ }
36
+
37
+ .contract {
38
+ width: 340px;
39
+ height: 88px;
40
+ border-radius: var(--td-radius-default);
41
+ margin: 8px 0;
42
+
43
+ &-title {
44
+ white-space: nowrap;
45
+ text-overflow: ellipsis;
46
+ overflow: hidden;
47
+ line-height: 24px;
48
+ margin: 20px 0 6px;
49
+ font-size: 14px;
50
+ color: var(--td-text-color-placeholder);
51
+ }
52
+
53
+ &-detail {
54
+ white-space: nowrap;
55
+ text-overflow: ellipsis;
56
+ overflow: hidden;
57
+ line-height: 40px;
58
+ font-size: 14px;
59
+ color: var(--td-text-color-secondary);
60
+ }
61
+ }
62
+
63
+ .contract:last-child {
64
+ margin-bottom: 0;
65
+ }
66
+ }
67
+
68
+ .user-intro {
69
+ padding: 32px 24px;
70
+ background: var(--td-brand-color);
71
+ border-radius: var(--td-radius-default);
72
+ color: var(--td-text-color-primary);
73
+
74
+ .name {
75
+ line-height: 37px;
76
+ font-size: 20px;
77
+ margin-top: 36px;
78
+ color: #fff;
79
+ }
80
+
81
+ .position {
82
+ line-height: 24px;
83
+ font-size: 14px;
84
+ margin-top: 8px;
85
+ color: #fff;
86
+ }
87
+
88
+ .user-info {
89
+ line-height: 24px;
90
+ font-size: 14px;
91
+ color: var(--td-text-color-primary);
92
+
93
+ .hiredate,
94
+ .del,
95
+ .mail {
96
+ display: flex;
97
+ }
98
+
99
+ .t-icon {
100
+ height: 24px;
101
+ margin-right: 8px;
102
+ }
103
+
104
+ .del {
105
+ margin: 16px 0;
106
+ }
107
+ }
108
+ }
109
+
110
+ .product-container {
111
+ margin-top: 16px;
112
+ border-radius: var(--td-radius-default);
113
+
114
+ .content {
115
+ width: 100%;
116
+ margin: 24px 0 12px;
117
+ }
118
+
119
+ .logo {
120
+ width: 48px;
121
+ }
122
+ }
123
+
124
+ .content-container {
125
+ margin-top: 16px;
126
+ background: var(--td-bg-color-container);
127
+ border-radius: var(--td-radius-default);
128
+ }
129
+
130
+ .user-team {
131
+ margin-top: 16px;
132
+
133
+ .t-list-item {
134
+ padding: 15px 0;
135
+
136
+ .t-list-item__meta-avatar {
137
+ height: 50px;
138
+ width: 50px;
139
+ margin: 0 24px 0 0;
140
+ }
141
+
142
+ .t-list-item__meta-description {
143
+ display: inline-block;
144
+ color: rgb(0 0 0 / 40%);
145
+ font-size: 14px;
146
+ }
147
+ }
148
+ }
@@ -0,0 +1,157 @@
1
+ import { getChartListColor } from '@/utils/color';
2
+ import { getDateArray, getRandomArray } from '@/utils/charts';
3
+
4
+ /** 折线图数据 */
5
+ // eslint-disable-next-line import/prefer-default-export
6
+ export function getFolderLineDataSet({
7
+ dateTime = [],
8
+ placeholderColor,
9
+ borderColor,
10
+ }: { dateTime?: Array<string> } & Record<string, string>) {
11
+ let dateArray: Array<string> = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
12
+ if (dateTime.length > 0) {
13
+ const divideNum = 7;
14
+ dateArray = getDateArray(dateTime, divideNum);
15
+ }
16
+ return {
17
+ color: getChartListColor(),
18
+ grid: {
19
+ top: '5%',
20
+ right: '10px',
21
+ left: '30px',
22
+ bottom: '60px',
23
+ },
24
+ legend: {
25
+ left: 'center',
26
+ bottom: '0',
27
+ orient: 'horizontal', // legend 横向布局。
28
+ data: ['杯子', '茶叶', '蜂蜜', '面粉'],
29
+ textStyle: {
30
+ fontSize: 12,
31
+ color: placeholderColor,
32
+ },
33
+ },
34
+ xAxis: {
35
+ type: 'category',
36
+ data: dateArray,
37
+ boundaryGap: false,
38
+ axisLabel: {
39
+ color: placeholderColor,
40
+ },
41
+ axisLine: {
42
+ lineStyle: {
43
+ color: borderColor,
44
+ width: 1,
45
+ },
46
+ },
47
+ },
48
+ yAxis: {
49
+ type: 'value',
50
+ axisLabel: {
51
+ color: placeholderColor,
52
+ },
53
+ splitLine: {
54
+ lineStyle: {
55
+ color: borderColor,
56
+ },
57
+ },
58
+ },
59
+ tooltip: {
60
+ trigger: 'item',
61
+ },
62
+ series: [
63
+ {
64
+ showSymbol: true,
65
+ symbol: 'circle',
66
+ symbolSize: 8,
67
+ name: '杯子',
68
+ stack: '总量',
69
+ data: [
70
+ getRandomArray(),
71
+ getRandomArray(),
72
+ getRandomArray(),
73
+ getRandomArray(),
74
+ getRandomArray(),
75
+ getRandomArray(),
76
+ getRandomArray(),
77
+ ],
78
+ type: 'line',
79
+ itemStyle: {
80
+ normal: {
81
+ borderColor,
82
+ borderWidth: 1,
83
+ },
84
+ },
85
+ },
86
+ {
87
+ showSymbol: true,
88
+ symbol: 'circle',
89
+ symbolSize: 8,
90
+ name: '茶叶',
91
+ stack: '总量',
92
+ data: [
93
+ getRandomArray(),
94
+ getRandomArray(),
95
+ getRandomArray(),
96
+ getRandomArray(),
97
+ getRandomArray(),
98
+ getRandomArray(),
99
+ getRandomArray(),
100
+ ],
101
+ type: 'line',
102
+ itemStyle: {
103
+ normal: {
104
+ borderColor,
105
+ borderWidth: 1,
106
+ },
107
+ },
108
+ },
109
+ {
110
+ showSymbol: true,
111
+ symbol: 'circle',
112
+ symbolSize: 8,
113
+ name: '蜂蜜',
114
+ stack: '总量',
115
+ data: [
116
+ getRandomArray(),
117
+ getRandomArray(),
118
+ getRandomArray(),
119
+ getRandomArray(),
120
+ getRandomArray(),
121
+ getRandomArray(),
122
+ getRandomArray(),
123
+ ],
124
+ type: 'line',
125
+ itemStyle: {
126
+ normal: {
127
+ borderColor,
128
+ borderWidth: 1,
129
+ },
130
+ },
131
+ },
132
+ {
133
+ showSymbol: true,
134
+ symbol: 'circle',
135
+ symbolSize: 8,
136
+ name: '面粉',
137
+ stack: '总量',
138
+ data: [
139
+ getRandomArray(),
140
+ getRandomArray(),
141
+ getRandomArray(),
142
+ getRandomArray(),
143
+ getRandomArray(),
144
+ getRandomArray(),
145
+ getRandomArray(),
146
+ ],
147
+ type: 'line',
148
+ itemStyle: {
149
+ normal: {
150
+ borderColor,
151
+ borderWidth: 1,
152
+ },
153
+ },
154
+ },
155
+ ],
156
+ };
157
+ }
@@ -0,0 +1,204 @@
1
+ <template>
2
+ <t-row :gutter="[16, 16]">
3
+ <t-col :flex="3">
4
+ <div class="user-left-greeting">
5
+ <div>
6
+ Hi,Image
7
+ <span class="regular"> 下午好,今天是你加入鹅厂的第 100 天~</span>
8
+ </div>
9
+ <img src="@/assets/assets-tencent-logo.png" class="logo" />
10
+ </div>
11
+
12
+ <t-card class="user-info-list" title="个人信息" :bordered="false">
13
+ <template #option>
14
+ <t-button theme="default" shape="square" variant="text">
15
+ <edit-icon size="18" />
16
+ </t-button>
17
+ </template>
18
+ <t-row class="content" justify="space-between">
19
+ <t-col v-for="(item, index) in USER_INFO_LIST" :key="index" class="contract" :span="item.span || 3">
20
+ <div class="contract-title">
21
+ {{ item.title }}
22
+ </div>
23
+ <div class="contract-detail">
24
+ {{ item.content }}
25
+ </div>
26
+ </t-col>
27
+ </t-row>
28
+ </t-card>
29
+
30
+ <t-card class="content-container" :bordered="false">
31
+ <t-tabs value="second">
32
+ <t-tab-panel value="first" label="内容列表">
33
+ <p>内容列表</p>
34
+ </t-tab-panel>
35
+ <t-tab-panel value="second" label="内容列表">
36
+ <t-card :bordered="false" title="主页访问数据" subtitle="(次)">
37
+ <template #options>
38
+ <t-date-rang-picker
39
+ class="card-date-picker-container"
40
+ :default-value="LAST_7_DAYS"
41
+ theme="primary"
42
+ mode="date"
43
+ @change="onLineChange"
44
+ />
45
+ </template>
46
+ <div id="lineContainer" style="width: 100%; height: 330px" />
47
+ </t-card>
48
+ </t-tab-panel>
49
+ <t-tab-panel value="third" label="内容列表">
50
+ <p>内容列表</p>
51
+ </t-tab-panel>
52
+ </t-tabs>
53
+ </t-card>
54
+ </t-col>
55
+
56
+ <t-col :flex="1">
57
+ <t-card class="user-intro" :bordered="false">
58
+ <t-avatar size="90px">T</t-avatar>
59
+ <div class="name">My Account</div>
60
+ <div class="position">XXG 港澳业务拓展组员工 直客销售</div>
61
+ </t-card>
62
+
63
+ <t-card title="团队成员" class="user-team" :bordered="false">
64
+ <template #option>
65
+ <t-button theme="default" shape="square" variant="text">
66
+ <edit-icon size="18" />
67
+ </t-button>
68
+ </template>
69
+ <t-list :split="false">
70
+ <t-list-item v-for="(item, index) in TEAM_MEMBERS" :key="index">
71
+ <t-list-item-meta :image="item.avatar" :title="item.title" :description="item.description" />
72
+ </t-list-item>
73
+ </t-list>
74
+ </t-card>
75
+
76
+ <t-card title="服务产品" class="product-container" :bordered="false">
77
+ <template #option>
78
+ <t-button theme="default" shape="square" variant="text">
79
+ <edit-icon size="18" />
80
+ </t-button>
81
+ </template>
82
+ <t-row class="content" :getters="16">
83
+ <t-col :span="3">
84
+ <product-a-icon />
85
+ </t-col>
86
+ <t-col :span="3">
87
+ <product-b-icon />
88
+ </t-col>
89
+ <t-col :span="3">
90
+ <product-c-icon />
91
+ </t-col>
92
+ <t-col :span="3">
93
+ <product-d-icon />
94
+ </t-col>
95
+ </t-row>
96
+ </t-card>
97
+ </t-col>
98
+ </t-row>
99
+ </template>
100
+ <script>
101
+ import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components';
102
+ import { LineChart } from 'echarts/charts';
103
+ import { CanvasRenderer } from 'echarts/renderers';
104
+ import * as echarts from 'echarts/core';
105
+ import { EditIcon } from 'tdesign-icons-vue';
106
+
107
+ import { mapState } from 'vuex';
108
+
109
+ import { getFolderLineDataSet } from './index';
110
+ import { changeChartsTheme } from '@/utils/color';
111
+ import { LAST_7_DAYS } from '@/utils/date';
112
+
113
+ import { USER_INFO_LIST, TEAM_MEMBERS, PRODUCT_LIST } from '@/service/service-user';
114
+ import ProductAIcon from '@/assets/assets-product-1.svg';
115
+ import ProductBIcon from '@/assets/assets-product-2.svg';
116
+ import ProductCIcon from '@/assets/assets-product-3.svg';
117
+ import ProductDIcon from '@/assets/assets-product-4.svg';
118
+
119
+ echarts.use([GridComponent, TooltipComponent, LineChart, CanvasRenderer, LegendComponent]);
120
+
121
+ export default {
122
+ name: 'UserIndex',
123
+
124
+ components: {
125
+ ProductAIcon,
126
+ ProductBIcon,
127
+ ProductCIcon,
128
+ ProductDIcon,
129
+ EditIcon,
130
+ },
131
+ data() {
132
+ return {
133
+ dashboardBase: '',
134
+ lineContainer: '',
135
+ lineChart: '',
136
+ LAST_7_DAYS,
137
+ USER_INFO_LIST,
138
+ TEAM_MEMBERS,
139
+ PRODUCT_LIST,
140
+ };
141
+ },
142
+ computed: {
143
+ ...mapState('setting', ['brandTheme', 'mode']),
144
+ },
145
+ watch: {
146
+ brandTheme() {
147
+ changeChartsTheme([this.lineChart]);
148
+ },
149
+ mode() {
150
+ this.renderCharts();
151
+ },
152
+ lineChart() {
153
+ this.updateContainer();
154
+ },
155
+ },
156
+ mounted() {
157
+ window.addEventListener('resize', this.updateContainer, false);
158
+ this.renderCharts();
159
+ this.$nextTick(() => {
160
+ this.updateContainer();
161
+ });
162
+ },
163
+ methods: {
164
+ /** 图表选择 */
165
+ onLineChange(value) {
166
+ this.lineChart.setOption(getFolderLineDataSet({ dateTime: value }));
167
+ },
168
+ updateContainer() {
169
+ this.lineChart.resize?.({
170
+ width: this.lineContainer.clientWidth,
171
+ height: this.lineContainer.clientHeight,
172
+ });
173
+ },
174
+ renderCharts() {
175
+ const { chartColors } = this.$store.state.setting;
176
+ if (!this.lineContainer) {
177
+ this.lineContainer = document.getElementById('lineContainer');
178
+ }
179
+ this.lineChart = echarts.init(this.lineContainer);
180
+ this.lineChart.setOption({
181
+ grid: {
182
+ x: 30, // 默认是80px
183
+ y: 30, // 默认是60px
184
+ x2: 10, // 默认80px
185
+ y2: 30, // 默认60px
186
+ },
187
+ ...getFolderLineDataSet({ ...chartColors }),
188
+ });
189
+ },
190
+ getIcon(type) {
191
+ const typeMap = {
192
+ a: ProductAIcon,
193
+ b: ProductBIcon,
194
+ c: ProductCIcon,
195
+ d: ProductDIcon,
196
+ };
197
+ return typeMap[type || 'a'];
198
+ },
199
+ },
200
+ };
201
+ </script>
202
+ <style lang="less" scoped>
203
+ @import url('./index.less');
204
+ </style>