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.
- package/README.md +2 -0
- package/bin/index.js +20 -0
- package/package.json +42 -0
- package/src/commands/create.js +171 -0
- package/src/commands/mcp.js +157 -0
- package/src/mcp/CURSOR_SETUP.md +259 -0
- package/src/mcp/README.md +134 -0
- package/src/mcp/USAGE_EXAMPLES.md +181 -0
- package/src/mcp/get-cursor-config.js +58 -0
- package/src/mcp/package.json +23 -0
- package/src/mcp/pnpm-lock.yaml +2441 -0
- package/src/mcp/src/handlers.js +211 -0
- package/src/mcp/src/http-server.js +332 -0
- package/src/mcp/src/index.js +195 -0
- package/src/mcp/src/schemas.js +54 -0
- package/src/mcp/test-create-project.js +49 -0
- package/src/mcp/test-mcp.js +89 -0
- package/src/mcp/test-show-tree.js +66 -0
- package/src/template/Uni-app/README.md +19 -0
- package/src/template/Uni-app/babel.config.js +81 -0
- package/src/template/Uni-app/package.json +107 -0
- package/src/template/Uni-app/postcss.config.js +27 -0
- package/src/template/Uni-app/public/index.html +25 -0
- package/src/template/Uni-app/shims-uni.d.ts +11 -0
- package/src/template/Uni-app/shims-vue.d.ts +4 -0
- package/src/template/Uni-app/src/App.vue +17 -0
- package/src/template/Uni-app/src/main.js +12 -0
- package/src/template/Uni-app/src/manifest.json +75 -0
- package/src/template/Uni-app/src/pages/index/index.vue +49 -0
- package/src/template/Uni-app/src/pages.json +16 -0
- package/src/template/Uni-app/src/static/logo.png +0 -0
- package/src/template/Uni-app/src/uni.promisify.adaptor.js +13 -0
- package/src/template/Uni-app/src/uni.scss +76 -0
- package/src/template/Uni-app/yarn.lock +11466 -0
- package/src/template/Vue2/.editorconfig +14 -0
- package/src/template/Vue2/.env +2 -0
- package/src/template/Vue2/.env.development +2 -0
- package/src/template/Vue2/.env.site +2 -0
- package/src/template/Vue2/.prettierrc.js +39 -0
- package/src/template/Vue2/.stylelintignore +8 -0
- package/src/template/Vue2/README-zh_CN.md +115 -0
- package/src/template/Vue2/commitlint.config.js +1 -0
- package/src/template/Vue2/docs/docs-starter.png +0 -0
- package/src/template/Vue2/docs/docs-startup.png +0 -0
- package/src/template/Vue2/docs/docs-structure.png +0 -0
- package/src/template/Vue2/globals.d.ts +13 -0
- package/src/template/Vue2/index.html +27 -0
- package/src/template/Vue2/jsx.d.ts +13 -0
- package/src/template/Vue2/mock/index.ts +147 -0
- package/src/template/Vue2/package.json +91 -0
- package/src/template/Vue2/package.json.ejs +91 -0
- package/src/template/Vue2/public/favicon.ico +0 -0
- package/src/template/Vue2/shims-vue.d.ts +5 -0
- package/src/template/Vue2/src/App.vue +19 -0
- package/src/template/Vue2/src/assets/assets-login-bg-black.png +0 -0
- package/src/template/Vue2/src/assets/assets-login-bg-white.png +0 -0
- package/src/template/Vue2/src/assets/assets-logo-full.svg +39 -0
- package/src/template/Vue2/src/assets/assets-product-1.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-2.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-3.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-4.svg +5 -0
- package/src/template/Vue2/src/assets/assets-result-403.svg +32 -0
- package/src/template/Vue2/src/assets/assets-result-404.svg +36 -0
- package/src/template/Vue2/src/assets/assets-result-500.svg +32 -0
- package/src/template/Vue2/src/assets/assets-result-ie.svg +33 -0
- package/src/template/Vue2/src/assets/assets-result-maintenance.svg +49 -0
- package/src/template/Vue2/src/assets/assets-result-wifi.svg +23 -0
- package/src/template/Vue2/src/assets/assets-setting-auto.svg +13 -0
- package/src/template/Vue2/src/assets/assets-setting-dark.svg +5 -0
- package/src/template/Vue2/src/assets/assets-setting-light.svg +13 -0
- package/src/template/Vue2/src/assets/assets-t-logo.svg +41 -0
- package/src/template/Vue2/src/assets/assets-tencent-logo.png +0 -0
- package/src/template/Vue2/src/components/color/index.vue +35 -0
- package/src/template/Vue2/src/components/product-card/index.vue +121 -0
- package/src/template/Vue2/src/components/result/index.vue +118 -0
- package/src/template/Vue2/src/components/thumbnail/index.vue +49 -0
- package/src/template/Vue2/src/components/trend/index.vue +105 -0
- package/src/template/Vue2/src/config/color.ts +30 -0
- package/src/template/Vue2/src/config/global.ts +2 -0
- package/src/template/Vue2/src/config/host.ts +26 -0
- package/src/template/Vue2/src/config/style.ts +14 -0
- package/src/template/Vue2/src/constants/index.ts +46 -0
- package/src/template/Vue2/src/interface.ts +39 -0
- package/src/template/Vue2/src/layouts/blank.vue +12 -0
- package/src/template/Vue2/src/layouts/components/Breadcrumb.vue +39 -0
- package/src/template/Vue2/src/layouts/components/Content.vue +43 -0
- package/src/template/Vue2/src/layouts/components/Footer.vue +27 -0
- package/src/template/Vue2/src/layouts/components/Header.vue +321 -0
- package/src/template/Vue2/src/layouts/components/LayoutContent.vue +168 -0
- package/src/template/Vue2/src/layouts/components/LayoutHeader.vue +52 -0
- package/src/template/Vue2/src/layouts/components/LayoutSidebar.vue +51 -0
- package/src/template/Vue2/src/layouts/components/MenuContent.vue +108 -0
- package/src/template/Vue2/src/layouts/components/Notice.vue +221 -0
- package/src/template/Vue2/src/layouts/components/Search.vue +134 -0
- package/src/template/Vue2/src/layouts/components/SideNav.vue +150 -0
- package/src/template/Vue2/src/layouts/index.vue +100 -0
- package/src/template/Vue2/src/layouts/setting.vue +404 -0
- package/src/template/Vue2/src/main.js +9 -0
- package/src/template/Vue2/src/main.jsx +51 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/MiddleChart.vue +158 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/OutputOverview.vue +189 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/RankList.vue +111 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/TopPanel.vue +246 -0
- package/src/template/Vue2/src/pages/dashboard/base/index.ts +702 -0
- package/src/template/Vue2/src/pages/dashboard/base/index.vue +44 -0
- package/src/template/Vue2/src/pages/dashboard/detail/index.ts +267 -0
- package/src/template/Vue2/src/pages/dashboard/detail/index.vue +242 -0
- package/src/template/Vue2/src/pages/detail/advanced/components/Product.vue +167 -0
- package/src/template/Vue2/src/pages/detail/advanced/index.less +74 -0
- package/src/template/Vue2/src/pages/detail/advanced/index.vue +219 -0
- package/src/template/Vue2/src/pages/detail/base/index.less +105 -0
- package/src/template/Vue2/src/pages/detail/base/index.vue +46 -0
- package/src/template/Vue2/src/pages/detail/deploy/index.ts +204 -0
- package/src/template/Vue2/src/pages/detail/deploy/index.vue +224 -0
- package/src/template/Vue2/src/pages/detail/secondary/index.less +71 -0
- package/src/template/Vue2/src/pages/detail/secondary/index.vue +131 -0
- package/src/template/Vue2/src/pages/form/base/index.less +57 -0
- package/src/template/Vue2/src/pages/form/base/index.vue +254 -0
- package/src/template/Vue2/src/pages/form/step/index.less +37 -0
- package/src/template/Vue2/src/pages/form/step/index.vue +259 -0
- package/src/template/Vue2/src/pages/frame/doc/index.vue +86 -0
- package/src/template/Vue2/src/pages/frame/tdesign/index.vue +86 -0
- package/src/template/Vue2/src/pages/list/base/index.vue +267 -0
- package/src/template/Vue2/src/pages/list/card/index.vue +221 -0
- package/src/template/Vue2/src/pages/list/components/CommonTable.vue +313 -0
- package/src/template/Vue2/src/pages/list/filter/index.vue +15 -0
- package/src/template/Vue2/src/pages/list/tree/index.vue +174 -0
- package/src/template/Vue2/src/pages/login/components/components-header.vue +74 -0
- package/src/template/Vue2/src/pages/login/components/components-login.vue +154 -0
- package/src/template/Vue2/src/pages/login/components/components-register.vue +144 -0
- package/src/template/Vue2/src/pages/login/index.less +202 -0
- package/src/template/Vue2/src/pages/login/index.vue +53 -0
- package/src/template/Vue2/src/pages/nest-menu/Index.vue +10 -0
- package/src/template/Vue2/src/pages/result/403/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/404/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/500/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/browser-incompatible/index.vue +77 -0
- package/src/template/Vue2/src/pages/result/fail/index.vue +57 -0
- package/src/template/Vue2/src/pages/result/maintenance/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/network-error/index.vue +24 -0
- package/src/template/Vue2/src/pages/result/success/index.vue +59 -0
- package/src/template/Vue2/src/pages/user/index.less +148 -0
- package/src/template/Vue2/src/pages/user/index.ts +157 -0
- package/src/template/Vue2/src/pages/user/index.vue +204 -0
- package/src/template/Vue2/src/permission.js +56 -0
- package/src/template/Vue2/src/router/index.js +43 -0
- package/src/template/Vue2/src/router/modules/base.ts +29 -0
- package/src/template/Vue2/src/router/modules/components.ts +175 -0
- package/src/template/Vue2/src/router/modules/others.ts +55 -0
- package/src/template/Vue2/src/service/service-advance.ts +233 -0
- package/src/template/Vue2/src/service/service-base.ts +205 -0
- package/src/template/Vue2/src/service/service-detail-base.ts +84 -0
- package/src/template/Vue2/src/service/service-detail-deploy.ts +234 -0
- package/src/template/Vue2/src/service/service-detail.ts +57 -0
- package/src/template/Vue2/src/service/service-user.ts +64 -0
- package/src/template/Vue2/src/store/index.ts +22 -0
- package/src/template/Vue2/src/store/modules/notification.ts +90 -0
- package/src/template/Vue2/src/store/modules/permission.ts +66 -0
- package/src/template/Vue2/src/store/modules/setting.ts +122 -0
- package/src/template/Vue2/src/store/modules/tab-router.ts +83 -0
- package/src/template/Vue2/src/store/modules/user.ts +98 -0
- package/src/template/Vue2/src/style/font-family.less +6 -0
- package/src/template/Vue2/src/style/index.less +5 -0
- package/src/template/Vue2/src/style/layout.less +201 -0
- package/src/template/Vue2/src/style/reset.less +78 -0
- package/src/template/Vue2/src/style/variables.less +27 -0
- package/src/template/Vue2/src/utils/charts.ts +38 -0
- package/src/template/Vue2/src/utils/color.ts +118 -0
- package/src/template/Vue2/src/utils/date.ts +12 -0
- package/src/template/Vue2/src/utils/request.ts +60 -0
- package/src/template/Vue2/stylelint.config.js +5 -0
- package/src/template/Vue2/tsconfig.json +26 -0
- package/src/template/Vue2/vite.config.js +58 -0
- package/src/template/Vue3/package.json.ejs +8 -0
- package/src/template/Vue3/pages.json +10 -0
- package/src/template/Vue3/src/main.js +7 -0
- package/src/utils/copy.js +17 -0
- package/src/utils/eslint.js +205 -0
- package/src/utils/logo.js +18 -0
- package/src/utils/render.js +20 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-card :bordered="false">
|
|
3
|
+
<t-row>
|
|
4
|
+
<t-col :xs="12" :xl="9">
|
|
5
|
+
<t-card
|
|
6
|
+
:bordered="false"
|
|
7
|
+
title="出入库概览"
|
|
8
|
+
subtitle="(件)"
|
|
9
|
+
:class="{ 'dashboard-overview-card': true, 'overview-panel': true }"
|
|
10
|
+
>
|
|
11
|
+
<template #actions>
|
|
12
|
+
<t-date-range-picker
|
|
13
|
+
class="card-date-picker-container"
|
|
14
|
+
theme="primary"
|
|
15
|
+
mode="date"
|
|
16
|
+
:default-value="LAST_7_DAYS"
|
|
17
|
+
@change="onStokeDataChange"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<div
|
|
21
|
+
id="stokeContainer"
|
|
22
|
+
style="width: 100%; height: 351px"
|
|
23
|
+
ref="stokeContainer"
|
|
24
|
+
class="dashboard-chart-container"
|
|
25
|
+
></div>
|
|
26
|
+
</t-card>
|
|
27
|
+
</t-col>
|
|
28
|
+
<t-col :xs="12" :xl="3">
|
|
29
|
+
<t-card :bordered="false" :class="{ 'dashboard-overview-card': true, 'export-panel': true }">
|
|
30
|
+
<template #actions>
|
|
31
|
+
<t-button>导出数据</t-button>
|
|
32
|
+
</template>
|
|
33
|
+
<t-row>
|
|
34
|
+
<t-col :xs="6" :xl="12">
|
|
35
|
+
<t-card :bordered="false" subtitle="本月出库总计(件)" class="inner-card">
|
|
36
|
+
<div class="inner-card__content">
|
|
37
|
+
<div class="inner-card__content-title">1726</div>
|
|
38
|
+
<div class="inner-card__content-footer">
|
|
39
|
+
自从上周以来
|
|
40
|
+
<trend class="trend-tag" type="down" :is-reverse-color="false" describe="20.3%" />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</t-card>
|
|
44
|
+
</t-col>
|
|
45
|
+
<t-col :xs="6" :xl="12">
|
|
46
|
+
<t-card :bordered="false" subtitle="本月入库总计(件)" class="inner-card">
|
|
47
|
+
<div class="inner-card__content">
|
|
48
|
+
<div class="inner-card__content-title">226</div>
|
|
49
|
+
<div class="inner-card__content-footer">
|
|
50
|
+
自从上周以来
|
|
51
|
+
<trend class="trend-tag" type="down" :is-reverse-color="false" describe="20.3%" />
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</t-card>
|
|
55
|
+
</t-col>
|
|
56
|
+
</t-row>
|
|
57
|
+
</t-card>
|
|
58
|
+
</t-col>
|
|
59
|
+
</t-row>
|
|
60
|
+
</t-card>
|
|
61
|
+
</template>
|
|
62
|
+
<script>
|
|
63
|
+
import { TooltipComponent, LegendComponent, GridComponent } from 'echarts/components';
|
|
64
|
+
import { BarChart } from 'echarts/charts';
|
|
65
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
66
|
+
import * as echarts from 'echarts/core';
|
|
67
|
+
import { mapState } from 'vuex';
|
|
68
|
+
|
|
69
|
+
import { constructInitDataset } from '../index';
|
|
70
|
+
import { changeChartsTheme } from '@/utils/color';
|
|
71
|
+
import { LAST_7_DAYS } from '@/utils/date';
|
|
72
|
+
import Trend from '@/components/trend/index.vue';
|
|
73
|
+
|
|
74
|
+
import { PANE_LIST, SALE_TEND_LIST, BUY_TEND_LIST, SALE_COLUMNS, BUY_COLUMNS } from '@/service/service-base';
|
|
75
|
+
|
|
76
|
+
echarts.use([TooltipComponent, LegendComponent, GridComponent, BarChart, CanvasRenderer]);
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'Overview',
|
|
80
|
+
components: {
|
|
81
|
+
Trend,
|
|
82
|
+
},
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
panelList: PANE_LIST,
|
|
86
|
+
buyTendList: BUY_TEND_LIST,
|
|
87
|
+
saleTendList: SALE_TEND_LIST,
|
|
88
|
+
saleColumns: SALE_COLUMNS,
|
|
89
|
+
buyColumns: BUY_COLUMNS,
|
|
90
|
+
LAST_7_DAYS,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
computed: {
|
|
94
|
+
...mapState('setting', ['brandTheme', 'mode']), // 这里需要用到主题色和主题模式的全局配置
|
|
95
|
+
},
|
|
96
|
+
watch: {
|
|
97
|
+
brandTheme() {
|
|
98
|
+
changeChartsTheme([this.stokeChart]);
|
|
99
|
+
},
|
|
100
|
+
mode() {
|
|
101
|
+
[this.stokeChart].forEach((item) => {
|
|
102
|
+
item.dispose();
|
|
103
|
+
});
|
|
104
|
+
this.renderCharts();
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
mounted() {
|
|
108
|
+
this.$nextTick(() => {
|
|
109
|
+
this.updateContainer();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
window.addEventListener('resize', this.updateContainer, false);
|
|
113
|
+
this.renderCharts();
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
methods: {
|
|
117
|
+
/** 出入库概览日期更新 */
|
|
118
|
+
onStokeDataChange(checkedValues) {
|
|
119
|
+
const { chartColors } = this.$store.state.setting;
|
|
120
|
+
|
|
121
|
+
this.stokeChart.setOption(constructInitDataset({ dateTime: checkedValues, ...chartColors }));
|
|
122
|
+
},
|
|
123
|
+
updateContainer() {
|
|
124
|
+
this.stokeChart.resize({
|
|
125
|
+
// 根据父容器的大小设置大小
|
|
126
|
+
width: this.stokeContainer.clientWidth,
|
|
127
|
+
height: this.stokeContainer.clientHeight,
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
renderCharts() {
|
|
131
|
+
const { chartColors } = this.$store.state.setting;
|
|
132
|
+
// 出入库概览
|
|
133
|
+
if (!this.stokeContainer) this.stokeContainer = document.getElementById('stokeContainer');
|
|
134
|
+
|
|
135
|
+
this.stokeChart = echarts.init(this.stokeContainer);
|
|
136
|
+
this.stokeChart.setOption(constructInitDataset({ dateTime: LAST_7_DAYS, ...chartColors }));
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style lang="less" scoped>
|
|
143
|
+
@import '@/style/variables.less';
|
|
144
|
+
|
|
145
|
+
.dashboard-overview-card {
|
|
146
|
+
/deep/ .t-card__header {
|
|
147
|
+
padding-bottom: 24px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/deep/ .t-card__title {
|
|
151
|
+
font-size: 20px;
|
|
152
|
+
font-weight: 500;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&.overview-panel {
|
|
156
|
+
border-right: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.export-panel {
|
|
160
|
+
border-left: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.inner-card {
|
|
165
|
+
padding: 24px 0;
|
|
166
|
+
|
|
167
|
+
/deep/ .t-card__header {
|
|
168
|
+
padding-bottom: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&__content {
|
|
172
|
+
&-title {
|
|
173
|
+
font-size: 36px;
|
|
174
|
+
line-height: 44px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&-footer {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
line-height: 22px;
|
|
181
|
+
color: var(--td-text-color-placeholder);
|
|
182
|
+
|
|
183
|
+
.trend-tag {
|
|
184
|
+
margin-left: 4px;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
</style>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-row :gutter="[16, 16]">
|
|
3
|
+
<t-col :xs="12" :xl="6">
|
|
4
|
+
<t-card title="销售订单排名" class="dashboard-rank-card" :bordered="false">
|
|
5
|
+
<template #actions>
|
|
6
|
+
<t-radio-group default-value="dateVal">
|
|
7
|
+
<t-radio-button value="dateVal">本周</t-radio-button>
|
|
8
|
+
<t-radio-button value="monthVal">近三个月</t-radio-button>
|
|
9
|
+
</t-radio-group>
|
|
10
|
+
</template>
|
|
11
|
+
<t-table :data="saleTendList" :columns="saleColumns" rowKey="productName">
|
|
12
|
+
<template #index="{ rowIndex }">
|
|
13
|
+
<span :class="getRankClass(rowIndex)">
|
|
14
|
+
{{ rowIndex + 1 }}
|
|
15
|
+
</span>
|
|
16
|
+
</template>
|
|
17
|
+
<span slot="growUp" slot-scope="{ row }">
|
|
18
|
+
<trend :type="row.growUp > 0 ? 'up' : 'down'" :describe="Math.abs(row.growUp)" />
|
|
19
|
+
</span>
|
|
20
|
+
<template #operation="slotProps">
|
|
21
|
+
<a class="link" @click="rehandleClickOp(slotProps)">详情</a>
|
|
22
|
+
</template>
|
|
23
|
+
</t-table>
|
|
24
|
+
</t-card>
|
|
25
|
+
</t-col>
|
|
26
|
+
<t-col :xs="12" :xl="6">
|
|
27
|
+
<t-card title="采购订单排名" class="dashboard-rank-card" :bordered="false">
|
|
28
|
+
<template #actions>
|
|
29
|
+
<t-radio-group default-value="dateVal">
|
|
30
|
+
<t-radio-button value="dateVal">本周</t-radio-button>
|
|
31
|
+
<t-radio-button value="monthVal">近三个月</t-radio-button>
|
|
32
|
+
</t-radio-group>
|
|
33
|
+
</template>
|
|
34
|
+
<t-table :data="buyTendList" :columns="buyColumns" rowKey="productName">
|
|
35
|
+
<template #index="{ rowIndex }">
|
|
36
|
+
<span :class="getRankClass(rowIndex)">
|
|
37
|
+
{{ rowIndex + 1 }}
|
|
38
|
+
</span>
|
|
39
|
+
</template>
|
|
40
|
+
<span slot="growUp" slot-scope="{ row }">
|
|
41
|
+
<trend :type="row.growUp > 0 ? 'up' : 'down'" :describe="Math.abs(row.growUp)" />
|
|
42
|
+
</span>
|
|
43
|
+
<template #operation="slotProps">
|
|
44
|
+
<a class="link" @click="rehandleClickOp(slotProps)">详情</a>
|
|
45
|
+
</template>
|
|
46
|
+
</t-table>
|
|
47
|
+
</t-card>
|
|
48
|
+
</t-col>
|
|
49
|
+
</t-row>
|
|
50
|
+
</template>
|
|
51
|
+
<script>
|
|
52
|
+
import Trend from '@/components/trend/index.vue';
|
|
53
|
+
import { SALE_TEND_LIST, BUY_TEND_LIST, SALE_COLUMNS, BUY_COLUMNS } from '@/service/service-base';
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'RankList',
|
|
57
|
+
components: {
|
|
58
|
+
Trend,
|
|
59
|
+
},
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
buyTendList: BUY_TEND_LIST,
|
|
63
|
+
saleTendList: SALE_TEND_LIST,
|
|
64
|
+
saleColumns: SALE_COLUMNS,
|
|
65
|
+
buyColumns: BUY_COLUMNS,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
rehandleClickOp(val) {
|
|
70
|
+
console.log(val);
|
|
71
|
+
},
|
|
72
|
+
getRankClass(index) {
|
|
73
|
+
return ['dashboard-rank__cell', { 'dashboard-rank__cell--top': index < 3 }];
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="less" scoped>
|
|
80
|
+
@import '@/style/variables.less';
|
|
81
|
+
|
|
82
|
+
.dashboard-rank-card {
|
|
83
|
+
padding: 8px;
|
|
84
|
+
|
|
85
|
+
/deep/ .t-card__header {
|
|
86
|
+
padding-bottom: 24px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/deep/ .t-card__title {
|
|
90
|
+
font-size: 20px;
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dashboard-rank__cell {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
width: 24px;
|
|
98
|
+
height: 24px;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
color: white;
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
background-color: var(--td-gray-color-5);
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
font-weight: 700;
|
|
106
|
+
|
|
107
|
+
&--top {
|
|
108
|
+
background: var(--td-brand-color);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-row :gutter="[16, 16]">
|
|
3
|
+
<t-col :xs="6" :xl="3" v-for="(item, index) in panelList" :key="item.title">
|
|
4
|
+
<t-card
|
|
5
|
+
:bordered="false"
|
|
6
|
+
:title="item.title"
|
|
7
|
+
:style="{ height: '168px' }"
|
|
8
|
+
:class="{ 'dashboard-item': true, 'dashboard-item--main-color': index == 0 }"
|
|
9
|
+
>
|
|
10
|
+
<div class="dashboard-item-top">
|
|
11
|
+
<span :style="{ fontSize: `${resizeTime * 36}px` }">{{ item.number }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="dashboard-item-left">
|
|
14
|
+
<div
|
|
15
|
+
v-if="index === 0"
|
|
16
|
+
id="moneyContainer"
|
|
17
|
+
class="dashboard-chart-container"
|
|
18
|
+
:style="{ width: `${resizeTime * 120}px`, height: `${resizeTime * 66}px` }"
|
|
19
|
+
></div>
|
|
20
|
+
<div
|
|
21
|
+
v-else-if="index === 1"
|
|
22
|
+
id="refundContainer"
|
|
23
|
+
class="dashboard-chart-container"
|
|
24
|
+
:style="{ width: `${resizeTime * 120}px`, height: `${resizeTime * 42}px` }"
|
|
25
|
+
></div>
|
|
26
|
+
<span v-else-if="index === 2" :style="{ marginTop: `-24px` }">
|
|
27
|
+
<usergroup-icon />
|
|
28
|
+
</span>
|
|
29
|
+
<span v-else :style="{ marginTop: '-24px' }">
|
|
30
|
+
<file-icon />
|
|
31
|
+
</span>
|
|
32
|
+
</div>
|
|
33
|
+
<template #footer>
|
|
34
|
+
<div class="dashboard-item-bottom">
|
|
35
|
+
<div class="dashboard-item-block">
|
|
36
|
+
自从上周以来
|
|
37
|
+
<trend
|
|
38
|
+
class="dashboard-item-trend"
|
|
39
|
+
:type="item.upTrend ? 'up' : 'down'"
|
|
40
|
+
:is-reverse-color="index === 0"
|
|
41
|
+
:describe="item.upTrend || item.downTrend"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<chevron-right-icon />
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
</t-card>
|
|
48
|
+
</t-col>
|
|
49
|
+
</t-row>
|
|
50
|
+
</template>
|
|
51
|
+
<script>
|
|
52
|
+
import { LineChart, BarChart } from 'echarts/charts';
|
|
53
|
+
import * as echarts from 'echarts/core';
|
|
54
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
55
|
+
import { UsergroupIcon, FileIcon, ChevronRightIcon } from 'tdesign-icons-vue';
|
|
56
|
+
import { mapState } from 'vuex';
|
|
57
|
+
|
|
58
|
+
import Trend from '@/components/trend/index.vue';
|
|
59
|
+
|
|
60
|
+
import { constructInitDashboardDataset } from '../index';
|
|
61
|
+
import { changeChartsTheme } from '@/utils/color';
|
|
62
|
+
import { PANE_LIST } from '@/service/service-base';
|
|
63
|
+
|
|
64
|
+
echarts.use([LineChart, BarChart, CanvasRenderer]);
|
|
65
|
+
|
|
66
|
+
export default {
|
|
67
|
+
name: 'TopPanel',
|
|
68
|
+
components: {
|
|
69
|
+
Trend,
|
|
70
|
+
UsergroupIcon,
|
|
71
|
+
FileIcon,
|
|
72
|
+
ChevronRightIcon,
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
resizeTime: 1,
|
|
77
|
+
panelList: PANE_LIST,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
...mapState('setting', ['brandTheme', 'mode']), // 这里需要用到主题色和主题模式的全局配置
|
|
82
|
+
},
|
|
83
|
+
watch: {
|
|
84
|
+
brandTheme() {
|
|
85
|
+
changeChartsTheme([this.refundChart]);
|
|
86
|
+
},
|
|
87
|
+
mode() {
|
|
88
|
+
[this.moneyCharts, this.refundChart].forEach((item) => {
|
|
89
|
+
item.dispose();
|
|
90
|
+
});
|
|
91
|
+
this.renderCharts();
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
mounted() {
|
|
95
|
+
this.$nextTick(() => {
|
|
96
|
+
this.updateContainer();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
window.addEventListener('resize', this.updateContainer, false);
|
|
100
|
+
this.renderCharts();
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
methods: {
|
|
104
|
+
updateContainer() {
|
|
105
|
+
if (document.documentElement.clientWidth >= 1400 && document.documentElement.clientWidth < 1920) {
|
|
106
|
+
this.resizeTime = (document.documentElement.clientWidth / 2080).toFixed(2);
|
|
107
|
+
} else if (document.documentElement.clientWidth < 1080) {
|
|
108
|
+
this.resizeTime = (document.documentElement.clientWidth / 1080).toFixed(2);
|
|
109
|
+
} else {
|
|
110
|
+
this.resizeTime = 1;
|
|
111
|
+
}
|
|
112
|
+
this.moneyCharts.resize({
|
|
113
|
+
// 根据父容器的大小设置大小
|
|
114
|
+
width: `${this.resizeTime * 120}px`,
|
|
115
|
+
height: `${this.resizeTime * 66}px`,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
this.refundChart.resize({
|
|
119
|
+
// 根据父容器的大小设置大小
|
|
120
|
+
width: `${this.resizeTime * 120}px`,
|
|
121
|
+
height: `${this.resizeTime * 42}px`,
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
renderCharts() {
|
|
126
|
+
const { chartColors } = this.$store.state.setting;
|
|
127
|
+
// 收入汇总图
|
|
128
|
+
if (!this.moneyContainer) this.moneyContainer = document.getElementById('moneyContainer');
|
|
129
|
+
this.moneyCharts = echarts.init(this.moneyContainer);
|
|
130
|
+
this.moneyCharts.setOption(constructInitDashboardDataset('line'));
|
|
131
|
+
|
|
132
|
+
// 退款图
|
|
133
|
+
if (!this.refundContainer) this.refundContainer = document.getElementById('refundContainer');
|
|
134
|
+
this.refundChart = echarts.init(this.refundContainer);
|
|
135
|
+
this.refundChart.setOption(constructInitDashboardDataset('bar', chartColors));
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style lang="less" scoped>
|
|
142
|
+
@import '@/style/variables.less';
|
|
143
|
+
|
|
144
|
+
.dashboard-item {
|
|
145
|
+
padding: 8px;
|
|
146
|
+
|
|
147
|
+
/deep/ .t-card__footer {
|
|
148
|
+
padding-top: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/deep/ .t-card__title {
|
|
152
|
+
font-size: 14px;
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/deep/ .t-card__body {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
flex: 1;
|
|
161
|
+
position: relative;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:hover {
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&-top {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: row;
|
|
171
|
+
align-items: flex-start;
|
|
172
|
+
|
|
173
|
+
> span {
|
|
174
|
+
display: inline-block;
|
|
175
|
+
color: var(--td-text-color-primary);
|
|
176
|
+
font-size: 36px;
|
|
177
|
+
line-height: 44px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&-bottom {
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: row;
|
|
184
|
+
justify-content: space-between;
|
|
185
|
+
align-items: center;
|
|
186
|
+
|
|
187
|
+
> .t-icon {
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&-block {
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
justify-content: center;
|
|
196
|
+
line-height: 22px;
|
|
197
|
+
color: var(--td-text-color-placeholder);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&-trend {
|
|
201
|
+
margin-left: 8px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&-left {
|
|
205
|
+
position: absolute;
|
|
206
|
+
top: 0;
|
|
207
|
+
right: 32px;
|
|
208
|
+
|
|
209
|
+
> span {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: center;
|
|
213
|
+
width: 56px;
|
|
214
|
+
height: 56px;
|
|
215
|
+
background: var(--td-brand-color-1);
|
|
216
|
+
border-radius: 50%;
|
|
217
|
+
|
|
218
|
+
.t-icon {
|
|
219
|
+
font-size: 24px;
|
|
220
|
+
color: var(--td-brand-color);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// 针对第一个卡片需要反色处理
|
|
226
|
+
&--main-color {
|
|
227
|
+
background: var(--td-brand-color);
|
|
228
|
+
color: var(--td-text-color-primary);
|
|
229
|
+
|
|
230
|
+
/deep/ .t-card__title,
|
|
231
|
+
.dashboard-item-top span,
|
|
232
|
+
.dashboard-item-bottom {
|
|
233
|
+
color: var(--td-text-color-anti);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.dashboard-item-block {
|
|
237
|
+
color: var(--td-text-color-anti);
|
|
238
|
+
opacity: 0.6;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.dashboard-item-bottom {
|
|
242
|
+
color: var(--td-text-color-anti);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</style>
|