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,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<t-back-top
|
|
4
|
+
container=".tdesign-starter-layout"
|
|
5
|
+
:visible-height="0"
|
|
6
|
+
style="position: absolute"
|
|
7
|
+
:offset="['24px', '80px']"
|
|
8
|
+
>
|
|
9
|
+
<t-icon name="backtop" size="20px" />
|
|
10
|
+
</t-back-top>
|
|
11
|
+
<!-- 顶部 card -->
|
|
12
|
+
<top-panel class="row-container" />
|
|
13
|
+
<!-- 中部图表 -->
|
|
14
|
+
<middle-chart class="row-container" />
|
|
15
|
+
<!-- 列表排名 -->
|
|
16
|
+
<rank-list class="row-container" />
|
|
17
|
+
<!-- 出入库概览 -->
|
|
18
|
+
<output-overview class="row-container" />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
import TopPanel from './components/TopPanel.vue';
|
|
23
|
+
import MiddleChart from './components/MiddleChart.vue';
|
|
24
|
+
import RankList from './components/RankList.vue';
|
|
25
|
+
import OutputOverview from './components/OutputOverview.vue';
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'DashboardBase',
|
|
29
|
+
components: {
|
|
30
|
+
TopPanel,
|
|
31
|
+
MiddleChart,
|
|
32
|
+
RankList,
|
|
33
|
+
OutputOverview,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
<style scoped lang="less">
|
|
38
|
+
.row-container {
|
|
39
|
+
margin-bottom: 16px;
|
|
40
|
+
}
|
|
41
|
+
/deep/ .t-card__body {
|
|
42
|
+
padding-top: 0;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { getChartListColor } from '@/utils/color';
|
|
3
|
+
import { getDateArray, getRandomArray } from '@/utils/charts';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 散点图数据
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @returns {any[]}
|
|
10
|
+
*/
|
|
11
|
+
export function getScatterDataSet({
|
|
12
|
+
dateTime = [],
|
|
13
|
+
placeholderColor,
|
|
14
|
+
borderColor,
|
|
15
|
+
}: { dateTime?: Array<string> } & Record<string, string>): any {
|
|
16
|
+
const divideNum = 40;
|
|
17
|
+
const timeArray = [];
|
|
18
|
+
const inArray = [];
|
|
19
|
+
const outArray = [];
|
|
20
|
+
for (let i = 0; i < divideNum; i++) {
|
|
21
|
+
// const [timeArray, inArray, outArray] = dataset;
|
|
22
|
+
if (dateTime.length > 0) {
|
|
23
|
+
const dateAbsTime: number = (new Date(dateTime[1]).getTime() - new Date(dateTime[0]).getTime()) / divideNum;
|
|
24
|
+
const endTime: number = new Date(dateTime[0]).getTime() + dateAbsTime * i;
|
|
25
|
+
timeArray.push(dayjs(endTime).format('MM-DD'));
|
|
26
|
+
} else {
|
|
27
|
+
timeArray.push(
|
|
28
|
+
dayjs()
|
|
29
|
+
.subtract(divideNum - i, 'day')
|
|
30
|
+
.format('MM-DD'),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
inArray.push(getRandomArray().toString());
|
|
35
|
+
outArray.push(getRandomArray().toString());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
color: getChartListColor(),
|
|
40
|
+
xAxis: {
|
|
41
|
+
data: timeArray,
|
|
42
|
+
axisLabel: {
|
|
43
|
+
color: placeholderColor,
|
|
44
|
+
},
|
|
45
|
+
splitLine: { show: false },
|
|
46
|
+
axisLine: {
|
|
47
|
+
lineStyle: {
|
|
48
|
+
color: borderColor,
|
|
49
|
+
width: 1,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
yAxis: {
|
|
54
|
+
type: 'value',
|
|
55
|
+
// splitLine: { show: false},
|
|
56
|
+
axisLabel: {
|
|
57
|
+
color: placeholderColor,
|
|
58
|
+
},
|
|
59
|
+
nameTextStyle: {
|
|
60
|
+
padding: [0, 0, 0, 60],
|
|
61
|
+
},
|
|
62
|
+
axisTick: {
|
|
63
|
+
show: false,
|
|
64
|
+
axisLine: {
|
|
65
|
+
show: false,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
axisLine: {
|
|
69
|
+
show: false,
|
|
70
|
+
},
|
|
71
|
+
splitLine: {
|
|
72
|
+
lineStyle: {
|
|
73
|
+
color: borderColor,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
tooltip: {
|
|
78
|
+
trigger: 'item',
|
|
79
|
+
},
|
|
80
|
+
grid: {
|
|
81
|
+
top: '5px',
|
|
82
|
+
left: '25px',
|
|
83
|
+
right: '5px',
|
|
84
|
+
bottom: '60px',
|
|
85
|
+
},
|
|
86
|
+
legend: {
|
|
87
|
+
left: 'center',
|
|
88
|
+
bottom: '0',
|
|
89
|
+
orient: 'horizontal', // legend 横向布局。
|
|
90
|
+
data: ['按摩仪', '咖啡机'],
|
|
91
|
+
itemHeight: 8,
|
|
92
|
+
itemWidth: 8,
|
|
93
|
+
textStyle: {
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
color: placeholderColor,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
series: [
|
|
99
|
+
{
|
|
100
|
+
name: '按摩仪',
|
|
101
|
+
symbolSize: 10,
|
|
102
|
+
data: outArray.reverse(),
|
|
103
|
+
type: 'scatter',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: '咖啡机',
|
|
107
|
+
symbolSize: 10,
|
|
108
|
+
data: inArray.concat(inArray.reverse()),
|
|
109
|
+
type: 'scatter',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** 折线图数据 */
|
|
116
|
+
export function getFolderLineDataSet({
|
|
117
|
+
dateTime = [],
|
|
118
|
+
placeholderColor,
|
|
119
|
+
borderColor,
|
|
120
|
+
}: { dateTime?: Array<string> } & Record<string, string>) {
|
|
121
|
+
let dateArray: Array<string> = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
|
|
122
|
+
if (dateTime.length > 0) {
|
|
123
|
+
const divideNum = 7;
|
|
124
|
+
dateArray = getDateArray(dateTime, divideNum);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
color: getChartListColor(),
|
|
128
|
+
grid: {
|
|
129
|
+
top: '5%',
|
|
130
|
+
right: '10px',
|
|
131
|
+
left: '30px',
|
|
132
|
+
bottom: '60px',
|
|
133
|
+
},
|
|
134
|
+
legend: {
|
|
135
|
+
left: 'center',
|
|
136
|
+
bottom: '0',
|
|
137
|
+
orient: 'horizontal', // legend 横向布局。
|
|
138
|
+
data: ['杯子', '茶叶', '蜂蜜', '面粉'],
|
|
139
|
+
textStyle: {
|
|
140
|
+
fontSize: 12,
|
|
141
|
+
color: placeholderColor,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
xAxis: {
|
|
145
|
+
type: 'category',
|
|
146
|
+
data: dateArray,
|
|
147
|
+
boundaryGap: false,
|
|
148
|
+
axisLabel: {
|
|
149
|
+
color: placeholderColor,
|
|
150
|
+
},
|
|
151
|
+
axisLine: {
|
|
152
|
+
lineStyle: {
|
|
153
|
+
color: borderColor,
|
|
154
|
+
width: 1,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
yAxis: {
|
|
159
|
+
type: 'value',
|
|
160
|
+
axisLabel: {
|
|
161
|
+
color: placeholderColor,
|
|
162
|
+
},
|
|
163
|
+
splitLine: {
|
|
164
|
+
lineStyle: {
|
|
165
|
+
color: borderColor,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
tooltip: {
|
|
170
|
+
trigger: 'item',
|
|
171
|
+
},
|
|
172
|
+
series: [
|
|
173
|
+
{
|
|
174
|
+
showSymbol: true,
|
|
175
|
+
symbol: 'circle',
|
|
176
|
+
symbolSize: 8,
|
|
177
|
+
name: '杯子',
|
|
178
|
+
stack: '总量',
|
|
179
|
+
data: [
|
|
180
|
+
getRandomArray(),
|
|
181
|
+
getRandomArray(),
|
|
182
|
+
getRandomArray(),
|
|
183
|
+
getRandomArray(),
|
|
184
|
+
getRandomArray(),
|
|
185
|
+
getRandomArray(),
|
|
186
|
+
getRandomArray(),
|
|
187
|
+
],
|
|
188
|
+
type: 'line',
|
|
189
|
+
itemStyle: {
|
|
190
|
+
normal: {
|
|
191
|
+
borderColor,
|
|
192
|
+
borderWidth: 1,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
showSymbol: true,
|
|
198
|
+
symbol: 'circle',
|
|
199
|
+
symbolSize: 8,
|
|
200
|
+
name: '茶叶',
|
|
201
|
+
stack: '总量',
|
|
202
|
+
data: [
|
|
203
|
+
getRandomArray(),
|
|
204
|
+
getRandomArray(),
|
|
205
|
+
getRandomArray(),
|
|
206
|
+
getRandomArray(),
|
|
207
|
+
getRandomArray(),
|
|
208
|
+
getRandomArray(),
|
|
209
|
+
getRandomArray(),
|
|
210
|
+
],
|
|
211
|
+
type: 'line',
|
|
212
|
+
itemStyle: {
|
|
213
|
+
normal: {
|
|
214
|
+
borderColor,
|
|
215
|
+
borderWidth: 1,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
showSymbol: true,
|
|
221
|
+
symbol: 'circle',
|
|
222
|
+
symbolSize: 8,
|
|
223
|
+
name: '蜂蜜',
|
|
224
|
+
stack: '总量',
|
|
225
|
+
data: [
|
|
226
|
+
getRandomArray(),
|
|
227
|
+
getRandomArray(),
|
|
228
|
+
getRandomArray(),
|
|
229
|
+
getRandomArray(),
|
|
230
|
+
getRandomArray(),
|
|
231
|
+
getRandomArray(),
|
|
232
|
+
getRandomArray(),
|
|
233
|
+
],
|
|
234
|
+
type: 'line',
|
|
235
|
+
itemStyle: {
|
|
236
|
+
normal: {
|
|
237
|
+
borderColor,
|
|
238
|
+
borderWidth: 1,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
showSymbol: true,
|
|
244
|
+
symbol: 'circle',
|
|
245
|
+
symbolSize: 8,
|
|
246
|
+
name: '面粉',
|
|
247
|
+
stack: '总量',
|
|
248
|
+
data: [
|
|
249
|
+
getRandomArray(),
|
|
250
|
+
getRandomArray(),
|
|
251
|
+
getRandomArray(),
|
|
252
|
+
getRandomArray(),
|
|
253
|
+
getRandomArray(),
|
|
254
|
+
getRandomArray(),
|
|
255
|
+
getRandomArray(),
|
|
256
|
+
],
|
|
257
|
+
type: 'line',
|
|
258
|
+
itemStyle: {
|
|
259
|
+
normal: {
|
|
260
|
+
borderColor,
|
|
261
|
+
borderWidth: 1,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
};
|
|
267
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dashboard-detail">
|
|
3
|
+
<t-card title="本月采购申请情况" class="dashboard-detail-card" :bordered="false">
|
|
4
|
+
<t-row :gutter="[16, 16]">
|
|
5
|
+
<t-col v-for="(item, index) in PANE_LIST_DATA" :key="index" :xs="6" :xl="3">
|
|
6
|
+
<t-card :class="['dashboard-list-card']" :description="item.title">
|
|
7
|
+
<div class="dashboard-list-card__number">{{ item.number }}</div>
|
|
8
|
+
<div class="dashboard-list-card__text">
|
|
9
|
+
<div class="dashboard-list-card__text-left">
|
|
10
|
+
环比
|
|
11
|
+
<trend class="icon" :type="item.upTrend ? 'up' : 'down'" :describe="item.upTrend || item.downTrend" />
|
|
12
|
+
</div>
|
|
13
|
+
<chevron-right-icon />
|
|
14
|
+
</div>
|
|
15
|
+
</t-card>
|
|
16
|
+
</t-col>
|
|
17
|
+
</t-row>
|
|
18
|
+
</t-card>
|
|
19
|
+
<t-row :gutter="[16, 16]" class="row-margin">
|
|
20
|
+
<t-col :xs="12" :xl="9">
|
|
21
|
+
<t-card :class="{ 'dashboard-detail-card': true }" title="采购商品申请趋势" subtitle="(件)" :bordered="false">
|
|
22
|
+
<template #actions>
|
|
23
|
+
<t-date-range-picker
|
|
24
|
+
style="width: 250px"
|
|
25
|
+
:default-value="LAST_7_DAYS"
|
|
26
|
+
theme="primary"
|
|
27
|
+
mode="date"
|
|
28
|
+
@change="onMaterialChange"
|
|
29
|
+
/>
|
|
30
|
+
</template>
|
|
31
|
+
<div id="lineContainer" ref="lineContainer" style="width: 100%; height: 410px"></div>
|
|
32
|
+
</t-card>
|
|
33
|
+
</t-col>
|
|
34
|
+
<t-col :xs="12" :xl="3">
|
|
35
|
+
<product-card
|
|
36
|
+
v-for="(item, index) in PRODUCT_LIST"
|
|
37
|
+
:key="index"
|
|
38
|
+
:product="item"
|
|
39
|
+
:class="{ 'row-margin': index !== 0 }"
|
|
40
|
+
/>
|
|
41
|
+
</t-col>
|
|
42
|
+
</t-row>
|
|
43
|
+
<t-card :class="{ 'dashboard-detail-card': true }" title="采购商品满意度分布" class="row-margin" :bordered="false">
|
|
44
|
+
<template #actions>
|
|
45
|
+
<t-date-range-picker
|
|
46
|
+
style="display: inline-block; margin-right: 8px; width: 250px"
|
|
47
|
+
:defaultValue="LAST_7_DAYS"
|
|
48
|
+
theme="primary"
|
|
49
|
+
mode="date"
|
|
50
|
+
@change="onSatisfyChange"
|
|
51
|
+
>
|
|
52
|
+
</t-date-range-picker>
|
|
53
|
+
<t-button>导出数据</t-button>
|
|
54
|
+
</template>
|
|
55
|
+
<div id="scatterContainer" style="width: 100%; height: 374px"></div>
|
|
56
|
+
</t-card>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<script lang="ts">
|
|
60
|
+
import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components';
|
|
61
|
+
import { LineChart, ScatterChart } from 'echarts/charts';
|
|
62
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
63
|
+
import * as echarts from 'echarts/core';
|
|
64
|
+
import { mapState } from 'vuex';
|
|
65
|
+
import { ChevronRightIcon } from 'tdesign-icons-vue';
|
|
66
|
+
|
|
67
|
+
import Trend from '@/components/trend/index.vue';
|
|
68
|
+
import ProductCard from '@/components/product-card/index.vue';
|
|
69
|
+
|
|
70
|
+
import { LAST_7_DAYS } from '@/utils/date';
|
|
71
|
+
import { changeChartsTheme } from '@/utils/color';
|
|
72
|
+
|
|
73
|
+
import { PANE_LIST_DATA, PRODUCT_LIST } from '@/service/service-detail';
|
|
74
|
+
import { getFolderLineDataSet, getScatterDataSet } from './index';
|
|
75
|
+
|
|
76
|
+
echarts.use([GridComponent, LegendComponent, TooltipComponent, LineChart, ScatterChart, CanvasRenderer]);
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'DashboardDetail',
|
|
80
|
+
components: { Trend, ProductCard, ChevronRightIcon },
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
PANE_LIST_DATA,
|
|
84
|
+
PRODUCT_LIST,
|
|
85
|
+
dashboardBase: '',
|
|
86
|
+
lineContainer: '',
|
|
87
|
+
scatterContainer: '',
|
|
88
|
+
lineChart: '',
|
|
89
|
+
scatterChart: '',
|
|
90
|
+
productList: [
|
|
91
|
+
{
|
|
92
|
+
description: 'SSL证书又叫服务器证书,腾讯云为您提供证书的一站式服务,包括免费、付费证书的申请、管理及部',
|
|
93
|
+
index: 1,
|
|
94
|
+
isSetup: true,
|
|
95
|
+
name: 'SSL证书',
|
|
96
|
+
type: 4,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
LAST_7_DAYS,
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
computed: {
|
|
103
|
+
...mapState('setting', ['brandTheme', 'mode']),
|
|
104
|
+
},
|
|
105
|
+
watch: {
|
|
106
|
+
brandTheme() {
|
|
107
|
+
changeChartsTheme([this.lineChart, this.scatterChart]);
|
|
108
|
+
},
|
|
109
|
+
mode() {
|
|
110
|
+
this.renderCharts();
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
mounted() {
|
|
114
|
+
this.$nextTick(() => {
|
|
115
|
+
this.updateContainer();
|
|
116
|
+
});
|
|
117
|
+
this.renderCharts();
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
/** 采购商品满意度选择 */
|
|
121
|
+
onSatisfyChange(value: string) {
|
|
122
|
+
const { chartColors } = this.$store.state.setting;
|
|
123
|
+
|
|
124
|
+
this.scatterChart.setOption(getScatterDataSet({ dateTime: value, ...chartColors }));
|
|
125
|
+
},
|
|
126
|
+
/** 采购商品申请趋势选择 */
|
|
127
|
+
onMaterialChange(value: string) {
|
|
128
|
+
const { chartColors } = this.$store.state.setting;
|
|
129
|
+
|
|
130
|
+
this.lineChart.setOption(getFolderLineDataSet({ dateTime: value, ...chartColors }));
|
|
131
|
+
},
|
|
132
|
+
updateContainer() {
|
|
133
|
+
this.lineChart.resize?.({
|
|
134
|
+
width: this.lineContainer.clientWidth,
|
|
135
|
+
height: this.lineContainer.clientHeight,
|
|
136
|
+
});
|
|
137
|
+
this.scatterChart.resize?.({
|
|
138
|
+
width: this.scatterContainer.clientWidth,
|
|
139
|
+
height: this.scatterContainer.clientHeight,
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
renderCharts() {
|
|
143
|
+
const { chartColors } = this.$store.state.setting;
|
|
144
|
+
|
|
145
|
+
if (!this.lineContainer) {
|
|
146
|
+
this.lineContainer = document.getElementById('lineContainer');
|
|
147
|
+
}
|
|
148
|
+
this.lineChart = echarts.init(this.lineContainer);
|
|
149
|
+
this.lineChart.setOption(getFolderLineDataSet({ ...chartColors }));
|
|
150
|
+
|
|
151
|
+
window.addEventListener('resize', this.updateContainer, false);
|
|
152
|
+
|
|
153
|
+
if (!this.scatterContainer) {
|
|
154
|
+
this.scatterContainer = document.getElementById('scatterContainer');
|
|
155
|
+
}
|
|
156
|
+
this.scatterChart = echarts.init(this.scatterContainer);
|
|
157
|
+
this.scatterChart.setOption(getScatterDataSet({ ...chartColors }));
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
</script>
|
|
162
|
+
<style lang="less" scoped>
|
|
163
|
+
@import '@/style/variables.less';
|
|
164
|
+
|
|
165
|
+
.row-margin {
|
|
166
|
+
margin-top: 16px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 统一增加8px;
|
|
170
|
+
.dashboard-detail-card {
|
|
171
|
+
padding: 8px;
|
|
172
|
+
|
|
173
|
+
/deep/ .t-card__title {
|
|
174
|
+
font-size: 20px;
|
|
175
|
+
font-weight: 500;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/deep/ .t-card__actions {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.dashboard-list-card {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
flex: 1;
|
|
188
|
+
height: 170px;
|
|
189
|
+
padding: 8px;
|
|
190
|
+
|
|
191
|
+
/deep/ .t-card__header {
|
|
192
|
+
padding-bottom: 8px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/deep/ .t-card__body {
|
|
196
|
+
flex: 1;
|
|
197
|
+
display: flex;
|
|
198
|
+
padding-top: 0;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
justify-content: space-between;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&.dark {
|
|
204
|
+
&:hover {
|
|
205
|
+
background: var(--td-gray-color-14);
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&.light {
|
|
211
|
+
&:hover {
|
|
212
|
+
background: var(--td-gray-color-14);
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&__number {
|
|
218
|
+
font-size: 36px;
|
|
219
|
+
line-height: 44px;
|
|
220
|
+
color: var(--td-text-color-primary);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&__text {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: row;
|
|
226
|
+
align-items: center;
|
|
227
|
+
justify-content: space-between;
|
|
228
|
+
font-size: 14px;
|
|
229
|
+
color: var(--td-text-color-placeholder);
|
|
230
|
+
text-align: left;
|
|
231
|
+
line-height: 18px;
|
|
232
|
+
|
|
233
|
+
&-left {
|
|
234
|
+
display: flex;
|
|
235
|
+
|
|
236
|
+
.icon {
|
|
237
|
+
margin: 0 8px;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
</style>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="operator-block operator-gap">
|
|
3
|
+
<div class="operator-content">
|
|
4
|
+
<div class="operator-title">
|
|
5
|
+
<cart-icon class="operator-title-icon" />
|
|
6
|
+
<h1>{{ data.name }}</h1>
|
|
7
|
+
<div class="operator-title-subtitle">
|
|
8
|
+
{{ data.subtitle }}
|
|
9
|
+
</div>
|
|
10
|
+
<div class="operator-title-tags">
|
|
11
|
+
<t-tag class="operator-title-tag" theme="success" size="small">
|
|
12
|
+
{{ data.size }}
|
|
13
|
+
</t-tag>
|
|
14
|
+
<t-tag class="operator-title-tag" size="small">
|
|
15
|
+
{{ data.cpu }}
|
|
16
|
+
</t-tag>
|
|
17
|
+
<t-tag class="operator-title-tag" size="small">
|
|
18
|
+
{{ data.memory }}
|
|
19
|
+
</t-tag>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="operator-item">
|
|
23
|
+
<span class="operator-item-info">{{ data.info }}</span>
|
|
24
|
+
<chevron-right-icon class="operator-item-icon" size="small" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="operator-footer">
|
|
28
|
+
<span class="operator-footer-percentage">{{ data.use }} / {{ data.stock }}(台)</span>
|
|
29
|
+
<t-progress
|
|
30
|
+
class="operator-progress"
|
|
31
|
+
theme="line"
|
|
32
|
+
:percentage="(data.use / data.stock) * 100"
|
|
33
|
+
:label="false"
|
|
34
|
+
:color="data.use / data.stock < 0.5 ? '#E24D59' : ''"
|
|
35
|
+
:track-color="data.use / data.stock < 0.5 ? 'var(--td-error-color-1)' : 'var(--td-brand-color-1)'"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts">
|
|
42
|
+
import Vue from 'vue';
|
|
43
|
+
import { ChevronRightIcon, CartIcon } from 'tdesign-icons-vue';
|
|
44
|
+
|
|
45
|
+
export default Vue.extend({
|
|
46
|
+
components: {
|
|
47
|
+
ChevronRightIcon,
|
|
48
|
+
CartIcon,
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
data: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => ({}),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="less" scoped>
|
|
60
|
+
@import '@/style/variables.less';
|
|
61
|
+
|
|
62
|
+
.operator-gap {
|
|
63
|
+
margin-left: 20px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.operator-block {
|
|
67
|
+
position: relative;
|
|
68
|
+
background-color: var(--td-bg-color-container);
|
|
69
|
+
border: 1px solid var(--td-component-border);
|
|
70
|
+
border-radius: 3px;
|
|
71
|
+
|
|
72
|
+
.operator-content {
|
|
73
|
+
padding: 20px 32px 24px 32px;
|
|
74
|
+
height: 256px;
|
|
75
|
+
|
|
76
|
+
.operator-title-icon {
|
|
77
|
+
background: var(--td-brand-color-1);
|
|
78
|
+
color: var(--td-brand-color);
|
|
79
|
+
font-size: 56px;
|
|
80
|
+
padding: 14px;
|
|
81
|
+
border-radius: 100%;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.operator-title {
|
|
85
|
+
margin-bottom: 25px;
|
|
86
|
+
position: relative;
|
|
87
|
+
|
|
88
|
+
h1 {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
font-weight: 500;
|
|
91
|
+
font-size: 24px;
|
|
92
|
+
color: var(--td-text-color-primary);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&-subtitle {
|
|
96
|
+
display: block;
|
|
97
|
+
font-weight: 400;
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
width: 60%;
|
|
100
|
+
color: var(--td-text-color-placeholder);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-tag {
|
|
104
|
+
margin-right: 4px;
|
|
105
|
+
margin-top: 8px;
|
|
106
|
+
margin-left: unset;
|
|
107
|
+
border: unset;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&-icon {
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 0px;
|
|
113
|
+
right: 0px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
svg {
|
|
117
|
+
circle {
|
|
118
|
+
fill: var(--td-brand-color-2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
path {
|
|
122
|
+
fill: var(--td-brand-color);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.operator-item {
|
|
128
|
+
position: relative;
|
|
129
|
+
padding-top: 8px;
|
|
130
|
+
padding-bottom: 8px;
|
|
131
|
+
|
|
132
|
+
&-info {
|
|
133
|
+
display: inline-block;
|
|
134
|
+
width: 60%;
|
|
135
|
+
text-align: left;
|
|
136
|
+
font-size: 14px;
|
|
137
|
+
color: var(--td-text-color-placeholder);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&-icon {
|
|
141
|
+
position: absolute;
|
|
142
|
+
bottom: 8px;
|
|
143
|
+
right: 0;
|
|
144
|
+
color: var(--td-text-color-disabled);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.operator-footer {
|
|
150
|
+
position: absolute;
|
|
151
|
+
width: 100%;
|
|
152
|
+
bottom: 0px;
|
|
153
|
+
left: 0;
|
|
154
|
+
|
|
155
|
+
.t-progress--thin {
|
|
156
|
+
display: unset;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&-percentage {
|
|
160
|
+
position: absolute;
|
|
161
|
+
bottom: 15px;
|
|
162
|
+
right: 32px;
|
|
163
|
+
color: var(--td-text-color-placeholder);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
</style>
|