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,224 @@
1
+ <template>
2
+ <div class="detail-deploy">
3
+ <t-row :gutter="12">
4
+ <t-col :lg="6" :xs="12">
5
+ <t-card title="部署趋势" :bordered="false">
6
+ <div class="deploy-panel-left">
7
+ <div id="monitorContainer" style="width: 100%; height: 265px" />
8
+ </div>
9
+ </t-card>
10
+ </t-col>
11
+ <t-col :lg="6" :xs="12">
12
+ <t-card title="告警情况" :bordered="false">
13
+ <template #option>
14
+ <t-radio-group default-value="dateVal" @change="onAlertChange">
15
+ <t-radio-button value="dateVal"> 本周 </t-radio-button>
16
+ <t-radio-button value="monthVal"> 本月 </t-radio-button>
17
+ </t-radio-group>
18
+ </template>
19
+ <div id="dataContainer" style="width: 100%; height: 265px" />
20
+ </t-card>
21
+ </t-col>
22
+ </t-row>
23
+
24
+ <!-- 项目列表 -->
25
+ <t-card title="项目列表" class="container-base-margin-top" :bordered="false">
26
+ <t-table
27
+ :columns="columns"
28
+ :data="data"
29
+ :pagination="pagination"
30
+ :hover="hover"
31
+ rowKey="index"
32
+ @sort-change="sortChange"
33
+ @change="rehandleChange"
34
+ >
35
+ <template #op="slotProps">
36
+ <a class="t-button-link" @click="listClick(slotProps)">管理</a>
37
+ <a class="t-button-link" @click="deleteClickOp(slotProps)">删除</a>
38
+ </template>
39
+ <order-descending-icon slot="op-column" />
40
+ </t-table>
41
+ </t-card>
42
+ <t-dialog header="基本信息" :visible.sync="visible" @confirm="onConfirm">
43
+ <div slot="body">
44
+ <div class="dialog-info-block">
45
+ <div v-for="(item, index) in baseInfoData" :key="index" class="info-item">
46
+ <h1>{{ item.name }}</h1>
47
+ <span
48
+ :class="{
49
+ ['green']: item.type && item.type.value === 'green',
50
+ ['blue']: item.type && item.type.value === 'blue',
51
+ }"
52
+ >{{ item.value }}</span
53
+ >
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </t-dialog>
58
+ </div>
59
+ </template>
60
+ <script lang="ts">
61
+ import { TableSort } from 'tdesign-vue';
62
+ import { OrderDescendingIcon } from 'tdesign-icons-vue';
63
+ import * as echarts from 'echarts/core';
64
+ import { TitleComponent, ToolboxComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components';
65
+ import { BarChart, LineChart } from 'echarts/charts';
66
+ import { CanvasRenderer } from 'echarts/renderers';
67
+ import { mapState } from 'vuex';
68
+
69
+ import { getSmoothLineDataSet, get2ColBarChartDataSet } from './index';
70
+ import model from '@/service/service-detail-deploy';
71
+
72
+ echarts.use([
73
+ TitleComponent,
74
+ ToolboxComponent,
75
+ TooltipComponent,
76
+ GridComponent,
77
+ LegendComponent,
78
+ BarChart,
79
+ LineChart,
80
+ CanvasRenderer,
81
+ ]);
82
+
83
+ /** 部署配置 */
84
+ export default {
85
+ name: 'DetailDeploy',
86
+ components: {
87
+ OrderDescendingIcon,
88
+ },
89
+ data() {
90
+ return {
91
+ monitorContainer: '',
92
+ dataContainer: '',
93
+ dashboardBase: '',
94
+ formData: {},
95
+ data: [],
96
+ bordered: true,
97
+ hover: true,
98
+ pagination: {
99
+ defaultPageSize: 10,
100
+ total: 100,
101
+ defaultCurrent: 1,
102
+ pageSizeOptions: [],
103
+ },
104
+ baseInfoData: model.getBaseInfoData(),
105
+ columns: model.getTableColumns(),
106
+ visible: false,
107
+ areaChart: '',
108
+ timer: '',
109
+ columnChart: '',
110
+ };
111
+ },
112
+ computed: {
113
+ ...mapState('setting', ['brandTheme', 'mode']),
114
+ },
115
+ watch: {
116
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
117
+ brandTheme(val): void {
118
+ const { chartColors } = this.$store.state.setting;
119
+
120
+ this.areaChart.setOption(getSmoothLineDataSet({ ...chartColors }));
121
+ this.columnChart.setOption(get2ColBarChartDataSet({ ...chartColors }));
122
+ },
123
+ mode() {
124
+ this.renderCharts();
125
+ },
126
+ },
127
+ beforeDestroy(): void {
128
+ clearInterval(this.timer);
129
+ },
130
+
131
+ async mounted() {
132
+ this.$nextTick(() => {
133
+ this.updateContainer();
134
+ });
135
+
136
+ this.$request
137
+ .get('/api/get-project-list')
138
+ .then((res) => {
139
+ if (res.code === 0) {
140
+ const { list = [] } = res.data;
141
+ this.data = list;
142
+ this.pagination = {
143
+ ...this.pagination,
144
+ total: list.length,
145
+ };
146
+ }
147
+ })
148
+ .catch((e) => {
149
+ console.log(e);
150
+ });
151
+
152
+ window.addEventListener('resize', this.updateContainer, false);
153
+
154
+ this.renderCharts();
155
+ },
156
+ methods: {
157
+ onAlertChange(val: string): void {
158
+ // console.log(val);
159
+ const isMonth = val === 'monthVal';
160
+ const { chartColors } = this.$store.state.setting;
161
+
162
+ this.columnChart.setOption(get2ColBarChartDataSet({ isMonth, ...chartColors }));
163
+ },
164
+ updateContainer(): void {
165
+ this.areaChart.resize({
166
+ width: this.monitorContainer.clientWidth,
167
+ height: this.monitorContainer.clientHeight,
168
+ });
169
+ this.columnChart.resize({
170
+ width: this.dataContainer.clientWidth,
171
+ height: this.dataContainer.clientHeight,
172
+ });
173
+ },
174
+ sortChange(val: TableSort): void {
175
+ console.log(val);
176
+ },
177
+ rehandleChange(changeParams, triggerAndData): void {
178
+ console.log('统一Change', changeParams, triggerAndData);
179
+ },
180
+ listClick(e): void {
181
+ console.log(e);
182
+ this.visible = true;
183
+ },
184
+ deleteClickOp(e): void {
185
+ this.data.splice(e.rowIndex, 1);
186
+ },
187
+ onConfirm(): void {
188
+ this.visible = false;
189
+ },
190
+ renderCharts(): void {
191
+ const { chartColors } = this.$store.state.setting;
192
+
193
+ if (!this.monitorContainer) {
194
+ this.monitorContainer = document.getElementById('monitorContainer');
195
+ }
196
+ this.areaChart = echarts.init(this.monitorContainer);
197
+ this.areaChart.setOption(getSmoothLineDataSet({ ...chartColors }));
198
+
199
+ // 定时动态效果
200
+ this.timer = setInterval(() => {
201
+ this.areaChart.setOption(getSmoothLineDataSet({ ...chartColors }));
202
+ }, 3000);
203
+
204
+ if (!this.dataContainer) {
205
+ this.dataContainer = document.getElementById('dataContainer');
206
+ }
207
+ this.columnChart = echarts.init(this.dataContainer);
208
+ this.columnChart.setOption(get2ColBarChartDataSet({ ...chartColors }));
209
+ },
210
+ },
211
+ };
212
+ </script>
213
+ <style lang="less" scoped>
214
+ .detail-deploy {
215
+ /deep/ .t-card {
216
+ padding: 8px;
217
+ }
218
+
219
+ /deep/ .t-card__title {
220
+ font-size: 20px;
221
+ font-weight: 500;
222
+ }
223
+ }
224
+ </style>
@@ -0,0 +1,71 @@
1
+ @import '@/style/variables.less';
2
+
3
+ .secondary-notification {
4
+ background-color: var(--td-bg-color-container);
5
+ border-radius: var(--td-radius-default);
6
+ padding: var(--td-comp-paddingTB-xl) var(--td-comp-paddingTB-xxl);
7
+
8
+ .t-tabs__content {
9
+ padding-top: 0;
10
+ }
11
+ }
12
+
13
+ .secondary-msg-list {
14
+ height: 70vh;
15
+
16
+ .t-list-item {
17
+ cursor: pointer;
18
+ padding: 13px 24px 13px 0;
19
+
20
+ &:hover {
21
+ background-color: var(--td-bg-color-container-hover);
22
+
23
+ .msg-date {
24
+ display: none;
25
+ }
26
+
27
+ .msg-action {
28
+ display: flex;
29
+ align-items: center;
30
+
31
+ &-icon {
32
+ display: flex;
33
+ align-items: center;
34
+ }
35
+ }
36
+ }
37
+
38
+ .t-tag.t-size-s {
39
+ margin-right: var(--td-comp-margin-s);
40
+ margin-left: 0;
41
+ }
42
+ }
43
+
44
+ .content {
45
+ color: var(--td-text-color-placeholder);
46
+ font: var(--td-font-body-medium);
47
+ text-align: left;
48
+ overflow: hidden;
49
+ text-overflow: ellipsis;
50
+ white-space: nowrap;
51
+ }
52
+
53
+ .unread {
54
+ color: var(--td-text-color-primary);
55
+ }
56
+
57
+ .msg-action {
58
+ display: none;
59
+
60
+ .set-read-icon {
61
+ margin-right: 24px;
62
+ }
63
+ }
64
+
65
+ &__empty-list {
66
+ min-height: 443px;
67
+ padding-top: 170px;
68
+ text-align: center;
69
+ color: var(--td-text-color-primary);
70
+ }
71
+ }
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <div>
3
+ <div class="secondary-notification">
4
+ <t-tabs v-model="tabValue">
5
+ <t-tab-panel v-for="(tab, tabIndex) in TAB_LIST" :key="tabIndex" :value="tab.value" :label="tab.label">
6
+ <t-list v-if="msgDataList.length > 0" class="secondary-msg-list" :split="true">
7
+ <t-list-item v-for="(item, index) in msgDataList" :key="index">
8
+ <p :class="['content', { unread: item.status }]" @click="setReadStatus(item)">
9
+ <t-tag size="small" :theme="NOTIFICATION_TYPES[item.quality]" variant="light">
10
+ {{ item.type }}
11
+ </t-tag>
12
+ {{ item.content }}
13
+ </p>
14
+ <template #action>
15
+ <span class="msg-date">{{ item.date }}</span>
16
+ <div class="msg-action">
17
+ <t-tooltip
18
+ class="set-read-icon"
19
+ :overlay-style="{ margin: '6px' }"
20
+ :content="item.status ? '设为已读' : '设为未读'"
21
+ >
22
+ <span class="msg-action-icon" @click="setReadStatus(item)">
23
+ <queue-icon v-if="!!item.status" size="16px" />
24
+ <chat-icon v-else />
25
+ </span>
26
+ </t-tooltip>
27
+ <t-tooltip content="删除通知" :overlay-style="{ margin: '6px' }">
28
+ <span @click="handleClickDeleteBtn(item)">
29
+ <delete-icon size="16px" />
30
+ </span>
31
+ </t-tooltip>
32
+ </div>
33
+ </template>
34
+ </t-list-item>
35
+ </t-list>
36
+ <div v-else class="secondary-msg-list__empty-list">
37
+ <img src="https://tdesign.gtimg.com/pro-template/personal/nothing.png" alt="空" />
38
+ <p>暂无通知</p>
39
+ </div>
40
+ </t-tab-panel>
41
+ </t-tabs>
42
+ </div>
43
+ <t-dialog
44
+ header="删除通知"
45
+ :body="`确认删除通知:${selectedItem && selectedItem.content}吗?`"
46
+ :visible.sync="visible"
47
+ :onConfirm="deleteMsg"
48
+ ></t-dialog>
49
+ </div>
50
+ </template>
51
+ <script lang="ts">
52
+ import { mapState, mapGetters } from 'vuex';
53
+ import { QueueIcon, DeleteIcon, ChatIcon } from 'tdesign-icons-vue';
54
+ import { prefix } from '@/config/global';
55
+ import { NOTIFICATION_TYPES } from '@/constants';
56
+ import { msgDataItem } from '@/store/modules/notification';
57
+
58
+ const TAB_LIST = [
59
+ {
60
+ label: '全部通知',
61
+ value: 'msgData',
62
+ },
63
+ {
64
+ label: '未读通知',
65
+ value: 'unreadMsg',
66
+ },
67
+ {
68
+ label: '已读通知',
69
+ value: 'readMsg',
70
+ },
71
+ ];
72
+
73
+ export default {
74
+ name: 'DetailSecondary',
75
+ components: {
76
+ QueueIcon,
77
+ DeleteIcon,
78
+ ChatIcon,
79
+ },
80
+ data() {
81
+ return {
82
+ NOTIFICATION_TYPES,
83
+ TAB_LIST,
84
+ prefix,
85
+ data: [],
86
+ tabValue: 'msgData',
87
+ visible: false,
88
+ selectedItem: undefined,
89
+ };
90
+ },
91
+ computed: {
92
+ ...mapState('notification', ['msgData']),
93
+ ...mapGetters('notification', ['unreadMsg', 'readMsg']),
94
+ msgDataList() {
95
+ if (this.tabValue === 'msgData') return this.msgData;
96
+ if (this.tabValue === 'unreadMsg') return this.unreadMsg;
97
+ if (this.tabValue === 'readMsg') return this.readMsg;
98
+ return [];
99
+ },
100
+ },
101
+ methods: {
102
+ handleClickDeleteBtn(item: msgDataItem): void {
103
+ this.visible = true;
104
+ this.selectedItem = item;
105
+ },
106
+ setReadStatus(item: msgDataItem): void {
107
+ const changeMsg = this.msgData;
108
+ changeMsg.forEach((e) => {
109
+ if (e.id === item.id) {
110
+ if (e.status) e.status = false;
111
+ }
112
+ });
113
+ this.$store.commit('notification/setMsgData', changeMsg);
114
+ },
115
+ deleteMsg(): void {
116
+ const item = this.selectedItem;
117
+ const changeMsg = this.msgData;
118
+ changeMsg.forEach((e, index) => {
119
+ if (e.id === item.id) {
120
+ changeMsg.splice(index, 1);
121
+ }
122
+ });
123
+ this.visible = false;
124
+ this.$store.commit('notification/setMsgData', changeMsg);
125
+ },
126
+ },
127
+ };
128
+ </script>
129
+ <style lang="less" scoped>
130
+ @import './index';
131
+ </style>
@@ -0,0 +1,57 @@
1
+ @import '@/style/variables.less';
2
+
3
+ .form-basic-container {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ background-color: var(--td-bg-color-container);
8
+ padding: 0 32px 134px;
9
+
10
+ @media (max-width: @screen-sm-max) {
11
+ padding: 0 32px 67px;
12
+
13
+ .form-basic-container-title {
14
+ margin: 32px 0 32px;
15
+ }
16
+ }
17
+
18
+ .form-basic-item {
19
+ width: 676px;
20
+
21
+ .form-basic-container-title {
22
+ font-size: 20px;
23
+ line-height: 24px;
24
+ color: var(--td-text-color-primary);
25
+ margin: var(--td-comp-size-xxxl) 0 32px;
26
+ }
27
+ }
28
+ }
29
+
30
+ .form-submit-container {
31
+ width: 100%;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ padding-top: 30px;
36
+ padding-bottom: 28px;
37
+ background-color: var(--td-bg-color-component);
38
+ border-bottom-left-radius: 3px;
39
+ border-bottom-right-radius: 3px;
40
+
41
+ .form-submit-sub {
42
+ width: 676px;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: space-between;
46
+
47
+ .form-submit-left {
48
+ .form-submit-upload-span {
49
+ font-size: 14px;
50
+ line-height: 22px;
51
+ color: var(--td-text-color-placeholder);
52
+ padding-top: 8px;
53
+ display: inline-block;
54
+ }
55
+ }
56
+ }
57
+ }