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,74 @@
|
|
|
1
|
+
@import '../base/index.less';
|
|
2
|
+
|
|
3
|
+
.detail-advanced {
|
|
4
|
+
/deep/ .t-card {
|
|
5
|
+
padding: 8px;
|
|
6
|
+
}
|
|
7
|
+
/deep/ .t-card__title {
|
|
8
|
+
font-size: 20px;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.advanced-card {
|
|
13
|
+
margin-top: 0 !important;
|
|
14
|
+
|
|
15
|
+
.card-title-default {
|
|
16
|
+
margin-bottom: 12px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.product-block-container {
|
|
22
|
+
.t-col-xl-4 + .t-col-xl-4 {
|
|
23
|
+
@media (max-width: @screen-lg-max) {
|
|
24
|
+
.operator-gap {
|
|
25
|
+
margin: 16px 0 0 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.product-add {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 256px;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-items: center;
|
|
36
|
+
padding: 20px 10px 24px 20px;
|
|
37
|
+
border: dashed 1px var(--td-component-border);
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
|
|
40
|
+
.product-sub-icon {
|
|
41
|
+
background: var(--td-brand-color-1);
|
|
42
|
+
color: var(--td-brand-color);
|
|
43
|
+
font-size: 33px;
|
|
44
|
+
padding: 8px;
|
|
45
|
+
border-radius: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.product-sub {
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
color: var(--td-text-color-secondary);
|
|
51
|
+
margin: 0 auto;
|
|
52
|
+
text-align: center;
|
|
53
|
+
line-height: 22px;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: center;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
|
|
59
|
+
svg {
|
|
60
|
+
rect {
|
|
61
|
+
fill: var(--td-brand-color-1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
path {
|
|
65
|
+
fill: var(--td-brand-color);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
span {
|
|
71
|
+
padding-top: 12px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="detail-advanced">
|
|
3
|
+
<t-card title="基本信息" class="advanced-card" :bordered="false">
|
|
4
|
+
<div class="info-block">
|
|
5
|
+
<div v-for="(item, index) in baseInfoData" :key="index" class="info-item">
|
|
6
|
+
<h1>{{ item.name }}</h1>
|
|
7
|
+
<span
|
|
8
|
+
:class="{
|
|
9
|
+
['inProgress']: item.type && item.type.value === 'inProgress',
|
|
10
|
+
['pdf']: item.type && item.type.value === 'pdf',
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<i v-if="item.type && item.type.key === 'contractStatus'"></i>
|
|
14
|
+
{{ item.value }}
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</t-card>
|
|
19
|
+
|
|
20
|
+
<!-- 发票进度 -->
|
|
21
|
+
<t-card title="发票进度" class="container-base-margin-top" :bordered="false">
|
|
22
|
+
<t-row :class="prefix + '-operator-row row-padding'" justify="space-between">
|
|
23
|
+
<template>
|
|
24
|
+
<t-steps :current="updateCurrent">
|
|
25
|
+
<t-step-item title="申请提交" content="已于12月21日提交"></t-step-item>
|
|
26
|
+
<t-step-item title="电子发票" content="预计1~3个工作日"></t-step-item>
|
|
27
|
+
<t-step-item title="发票已邮寄" content="电子发票开出后7个工作日内联系"></t-step-item>
|
|
28
|
+
<t-step-item title="完成" content></t-step-item>
|
|
29
|
+
</t-steps>
|
|
30
|
+
</template>
|
|
31
|
+
</t-row>
|
|
32
|
+
</t-card>
|
|
33
|
+
|
|
34
|
+
<!-- 产品目录 -->
|
|
35
|
+
<t-card title="产品目录" class="container-base-margin-top" :bordered="false">
|
|
36
|
+
<template slot="option">
|
|
37
|
+
<t-radio-group default-value="dateVal" @change="onAlertChange">
|
|
38
|
+
<t-radio-button value="dateVal">季度</t-radio-button>
|
|
39
|
+
<t-radio-button value="monthVal">月份</t-radio-button>
|
|
40
|
+
</t-radio-group>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<t-row :gutter="16" class="product-block-container">
|
|
44
|
+
<t-col :xl="4">
|
|
45
|
+
<div class="product-add">
|
|
46
|
+
<div class="product-sub">
|
|
47
|
+
<add-icon class="product-sub-icon" />
|
|
48
|
+
<span>新增产品</span>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</t-col>
|
|
52
|
+
<t-col v-for="(item, index) in PRODUCT_LIST" :key="index" :xl="4">
|
|
53
|
+
<product :data="item" />
|
|
54
|
+
</t-col>
|
|
55
|
+
</t-row>
|
|
56
|
+
</t-card>
|
|
57
|
+
|
|
58
|
+
<!-- 产品采购明细 -->
|
|
59
|
+
<t-card title="产品采购明细" class="container-base-margin-top" :bordered="false">
|
|
60
|
+
<t-table
|
|
61
|
+
:columns="columns"
|
|
62
|
+
:data="data"
|
|
63
|
+
:pagination="pagination"
|
|
64
|
+
:hover="hover"
|
|
65
|
+
size="large"
|
|
66
|
+
row-key="index"
|
|
67
|
+
@sort-change="sortChange"
|
|
68
|
+
@change="rehandleChange"
|
|
69
|
+
>
|
|
70
|
+
<template #pdName="{ row }">
|
|
71
|
+
<span>
|
|
72
|
+
{{ row.pdName }}
|
|
73
|
+
<t-tag v-if="row.pdType" size="small">{{ row.pdType }}</t-tag>
|
|
74
|
+
</span>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<template #purchaseNum="{ row }">
|
|
78
|
+
<span>
|
|
79
|
+
{{ row.purchaseNum }}
|
|
80
|
+
<t-tag v-if="row.purchaseNum > 50" theme="danger" variant="light" size="small">超预算</t-tag>
|
|
81
|
+
</span>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<template #op="slotProps">
|
|
85
|
+
<a class="t-button-link" @click="listClick(slotProps)">管理</a>
|
|
86
|
+
<a class="t-button-link" @click="deleteClickOp(slotProps)">删除</a>
|
|
87
|
+
</template>
|
|
88
|
+
<order-descending-icon slot="op-column" />
|
|
89
|
+
</t-table>
|
|
90
|
+
</t-card>
|
|
91
|
+
|
|
92
|
+
<t-dialog header="基本信息" :visible.sync="visible" @confirm="onConfirm">
|
|
93
|
+
<div slot="body">
|
|
94
|
+
<div class="dialog-info-block">
|
|
95
|
+
<div v-for="(item, index) in baseInfoData" :key="index" class="info-item">
|
|
96
|
+
<h1>{{ item.name }}</h1>
|
|
97
|
+
<span
|
|
98
|
+
:class="{
|
|
99
|
+
['inProgress']: item.type && item.type.value === 'inProgress',
|
|
100
|
+
['pdf']: item.type && item.type.value === 'pdf',
|
|
101
|
+
}"
|
|
102
|
+
>
|
|
103
|
+
<i v-if="item.type && item.type.key === 'contractStatus'"></i>
|
|
104
|
+
{{ item.value }}
|
|
105
|
+
</span>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</t-dialog>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
<script lang="ts">
|
|
113
|
+
import { TableChangeContext, TableChangeData, TableSort } from 'tdesign-vue';
|
|
114
|
+
import { OrderDescendingIcon, AddIcon } from 'tdesign-icons-vue';
|
|
115
|
+
import { prefix } from '@/config/global';
|
|
116
|
+
import model from '@/service/service-advance';
|
|
117
|
+
import Product from './components/Product.vue';
|
|
118
|
+
|
|
119
|
+
const PRODUCT_LIST = [
|
|
120
|
+
{
|
|
121
|
+
name: 'MacBook Pro 2021',
|
|
122
|
+
subTitle: 'MacBook Pro 2021',
|
|
123
|
+
size: '13.3 英寸',
|
|
124
|
+
cpu: 'Apple M1',
|
|
125
|
+
memory: 'RAM 16GB',
|
|
126
|
+
info: '最高可选配 16GB 内存 · 最高可选配 2TB 存储设备 电池续航最长达 18 小时',
|
|
127
|
+
use: 1420,
|
|
128
|
+
stock: 1500,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'Surface Laptop Go',
|
|
132
|
+
subTitle: '微软(Microsoft Corporation)',
|
|
133
|
+
size: '12.4 英寸',
|
|
134
|
+
cpu: 'Core i7',
|
|
135
|
+
memory: 'RAM 16GB',
|
|
136
|
+
info: '常规使用 Surface,续航时间最长可达13小时 随时伴您工作',
|
|
137
|
+
use: 120,
|
|
138
|
+
stock: 2000,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
/** 高级详情 */
|
|
143
|
+
export default {
|
|
144
|
+
name: 'DetailAdvanced',
|
|
145
|
+
components: { Product, OrderDescendingIcon, AddIcon },
|
|
146
|
+
data() {
|
|
147
|
+
return {
|
|
148
|
+
data: [],
|
|
149
|
+
prefix,
|
|
150
|
+
updateCurrent: 0,
|
|
151
|
+
columns: model.getTableColumns(),
|
|
152
|
+
baseInfoData: model.getBaseInfoData(),
|
|
153
|
+
bordered: true,
|
|
154
|
+
hover: true,
|
|
155
|
+
visible: false,
|
|
156
|
+
pagination: {
|
|
157
|
+
defaultPageSize: 10,
|
|
158
|
+
total: 100,
|
|
159
|
+
defaultCurrent: 1,
|
|
160
|
+
pageSizeOptions: [],
|
|
161
|
+
},
|
|
162
|
+
PRODUCT_LIST,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
async mounted() {
|
|
166
|
+
// 模拟进度
|
|
167
|
+
setInterval(() => {
|
|
168
|
+
if (this.updateCurrent > 5) {
|
|
169
|
+
this.updateCurrent = -1;
|
|
170
|
+
}
|
|
171
|
+
this.updateCurrent += 1;
|
|
172
|
+
}, 2000);
|
|
173
|
+
|
|
174
|
+
this.$request
|
|
175
|
+
.get('/api/get-purchase-list')
|
|
176
|
+
.then((res: { code: number; data: Record<string, any> }) => {
|
|
177
|
+
if (res.code === 0) {
|
|
178
|
+
const { list = [] } = res.data;
|
|
179
|
+
this.data = list;
|
|
180
|
+
this.pagination = {
|
|
181
|
+
...this.pagination,
|
|
182
|
+
total: list.length,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
.catch((e: Error) => {
|
|
187
|
+
console.log(e);
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
methods: {
|
|
191
|
+
onAlertChange(val: string): void {
|
|
192
|
+
console.log(val);
|
|
193
|
+
},
|
|
194
|
+
sortChange(val: TableSort): void {
|
|
195
|
+
console.log(val);
|
|
196
|
+
},
|
|
197
|
+
rehandleChange(
|
|
198
|
+
changeParams: TableChangeData,
|
|
199
|
+
triggerAndData: TableChangeContext<Array<Record<string, string>>>,
|
|
200
|
+
): void {
|
|
201
|
+
console.log('统一Change', changeParams, triggerAndData);
|
|
202
|
+
},
|
|
203
|
+
listClick(e: any): void {
|
|
204
|
+
console.log(e);
|
|
205
|
+
this.visible = true;
|
|
206
|
+
},
|
|
207
|
+
deleteClickOp(e: any): void {
|
|
208
|
+
console.log(e, 'e');
|
|
209
|
+
this.data.splice(e.rowIndex, 1);
|
|
210
|
+
},
|
|
211
|
+
onConfirm(): void {
|
|
212
|
+
this.visible = false;
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
</script>
|
|
217
|
+
<style lang="less" scoped>
|
|
218
|
+
@import './index';
|
|
219
|
+
</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
@import '@/style/variables.less';
|
|
2
|
+
|
|
3
|
+
.detail-base {
|
|
4
|
+
/deep/ .t-card {
|
|
5
|
+
padding: 8px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/deep/ .t-card__title {
|
|
9
|
+
font-size: 20px;
|
|
10
|
+
font-weight: 500;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-info-steps {
|
|
14
|
+
padding-top: 12px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.info-block {
|
|
19
|
+
column-count: 2;
|
|
20
|
+
|
|
21
|
+
.info-item {
|
|
22
|
+
padding: 12px 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
color: var(--td-text-color-primary);
|
|
25
|
+
|
|
26
|
+
h1 {
|
|
27
|
+
width: 200px;
|
|
28
|
+
font: var(--td-font-body-medium);
|
|
29
|
+
color: var(--td-text-color-secondary);
|
|
30
|
+
font-weight: normal;
|
|
31
|
+
text-align: left;
|
|
32
|
+
|
|
33
|
+
@media (max-width: @screen-sm-max) {
|
|
34
|
+
width: 100px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
|
|
38
|
+
width: 120px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
span {
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
margin-left: 24px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
i {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
width: 8px;
|
|
52
|
+
height: 8px;
|
|
53
|
+
border-radius: var(--td-radius-circle);
|
|
54
|
+
background: var(--td-success-color-5);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.inProgress {
|
|
58
|
+
color: var(--td-success-color-5);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.pdf {
|
|
62
|
+
color: var(--td-brand-color);
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dialog-info-block {
|
|
72
|
+
.info-item {
|
|
73
|
+
padding: 12px 0;
|
|
74
|
+
display: flex;
|
|
75
|
+
|
|
76
|
+
h1 {
|
|
77
|
+
width: 84px;
|
|
78
|
+
font-family: PingFangSC-Regular;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
color: var(--td-text-color-secondary);
|
|
81
|
+
text-align: left;
|
|
82
|
+
line-height: 22px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
span {
|
|
86
|
+
margin-left: 24px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
i {
|
|
90
|
+
display: inline-block;
|
|
91
|
+
width: 8px;
|
|
92
|
+
height: 8px;
|
|
93
|
+
border-radius: var(--td-radius-circle);
|
|
94
|
+
background: var(--td-success-color-5);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.green {
|
|
98
|
+
color: var(--td-success-color-5);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.blue {
|
|
102
|
+
color: var(--td-brand-color);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="detail-base">
|
|
3
|
+
<t-card title="基本信息" :bordered="false">
|
|
4
|
+
<div class="info-block">
|
|
5
|
+
<div v-for="(item, index) in baseInfoData" :key="index" class="info-item">
|
|
6
|
+
<h1>{{ item.name }}</h1>
|
|
7
|
+
<span
|
|
8
|
+
:class="{
|
|
9
|
+
['inProgress']: item.type && item.type.value === 'inProgress',
|
|
10
|
+
['pdf']: item.type && item.type.value === 'pdf',
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<i v-if="item.type && item.type.key === 'contractStatus'" />
|
|
14
|
+
{{ item.value }}
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</t-card>
|
|
19
|
+
|
|
20
|
+
<t-card title="变更记录" class="container-base-margin-top" :bordered="false">
|
|
21
|
+
<t-steps class="detail-base-info-steps" layout="vertical" theme="dot" :current="1">
|
|
22
|
+
<t-step-item title="上传合同附件" content="这里是提示文字" />
|
|
23
|
+
<t-step-item title="修改合同金额" content="这里是提示文字" />
|
|
24
|
+
<t-step-item title="新建合同" content="2020-12-01 15:00:00 管理员-李川操作" />
|
|
25
|
+
</t-steps>
|
|
26
|
+
</t-card>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
<script>
|
|
30
|
+
import { prefix } from '@/config/global';
|
|
31
|
+
import model from '@/service/service-detail-base';
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: 'DetailBase',
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
prefix,
|
|
38
|
+
baseInfoData: model.getBaseInfoData(),
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
methods: {},
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
<style lang="less" scoped>
|
|
45
|
+
@import './index';
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { getChartListColor } from '@/utils/color';
|
|
2
|
+
import { getDateArray, getRandomArray } from '@/utils/charts';
|
|
3
|
+
|
|
4
|
+
export const lastYearList: Array<number> = [100, 120, 140, 160, 180, 200, 210];
|
|
5
|
+
|
|
6
|
+
/** 平滑图数据 */
|
|
7
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
8
|
+
export function getSmoothLineDataSet({
|
|
9
|
+
dateTime = [],
|
|
10
|
+
placeholderColor,
|
|
11
|
+
borderColor,
|
|
12
|
+
}: { dateTime?: Array<string> } & Record<string, string>) {
|
|
13
|
+
let dateArray: Array<string> = ['00:00', '02:00', '04:00', '06:00'];
|
|
14
|
+
if (dateTime.length > 0) {
|
|
15
|
+
const divideNum = 7;
|
|
16
|
+
dateArray = getDateArray(dateTime, divideNum);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
color: getChartListColor(),
|
|
21
|
+
tooltip: {
|
|
22
|
+
trigger: 'item',
|
|
23
|
+
},
|
|
24
|
+
grid: {
|
|
25
|
+
top: '10px',
|
|
26
|
+
left: '0',
|
|
27
|
+
right: '20px',
|
|
28
|
+
bottom: '36px',
|
|
29
|
+
containLabel: true,
|
|
30
|
+
},
|
|
31
|
+
xAxis: {
|
|
32
|
+
type: 'category',
|
|
33
|
+
data: dateArray,
|
|
34
|
+
boundaryGap: false,
|
|
35
|
+
axisLabel: {
|
|
36
|
+
color: placeholderColor,
|
|
37
|
+
},
|
|
38
|
+
axisLine: {
|
|
39
|
+
lineStyle: {
|
|
40
|
+
color: borderColor,
|
|
41
|
+
width: 1,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
yAxis: {
|
|
46
|
+
type: 'value',
|
|
47
|
+
axisLabel: {
|
|
48
|
+
color: placeholderColor,
|
|
49
|
+
},
|
|
50
|
+
splitLine: {
|
|
51
|
+
lineStyle: {
|
|
52
|
+
color: borderColor,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
legend: {
|
|
57
|
+
data: ['本月', '上月'],
|
|
58
|
+
icon: 'circle',
|
|
59
|
+
bottom: '0',
|
|
60
|
+
itemGap: 48,
|
|
61
|
+
itemHeight: 8,
|
|
62
|
+
itemWidth: 8,
|
|
63
|
+
textStyle: {
|
|
64
|
+
fontSize: 12,
|
|
65
|
+
color: placeholderColor,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
series: [
|
|
69
|
+
{
|
|
70
|
+
name: '上月',
|
|
71
|
+
data: [
|
|
72
|
+
getRandomArray(),
|
|
73
|
+
getRandomArray(),
|
|
74
|
+
getRandomArray(),
|
|
75
|
+
getRandomArray(),
|
|
76
|
+
getRandomArray(),
|
|
77
|
+
getRandomArray(),
|
|
78
|
+
getRandomArray(),
|
|
79
|
+
],
|
|
80
|
+
type: 'line',
|
|
81
|
+
smooth: true,
|
|
82
|
+
color: getChartListColor()[0],
|
|
83
|
+
showSymbol: true,
|
|
84
|
+
symbol: 'circle',
|
|
85
|
+
symbolSize: 8,
|
|
86
|
+
areaStyle: {
|
|
87
|
+
normal: {
|
|
88
|
+
opacity: 0.1,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: '本月',
|
|
94
|
+
data: [
|
|
95
|
+
getRandomArray(),
|
|
96
|
+
getRandomArray(),
|
|
97
|
+
getRandomArray(),
|
|
98
|
+
getRandomArray(),
|
|
99
|
+
getRandomArray(),
|
|
100
|
+
getRandomArray(),
|
|
101
|
+
getRandomArray(),
|
|
102
|
+
],
|
|
103
|
+
type: 'line',
|
|
104
|
+
smooth: true,
|
|
105
|
+
showSymbol: true,
|
|
106
|
+
symbol: 'circle',
|
|
107
|
+
symbolSize: 8,
|
|
108
|
+
color: getChartListColor()[1],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 柱状图数据结构
|
|
116
|
+
*
|
|
117
|
+
* @export
|
|
118
|
+
* @param {boolean} [isMonth=false]
|
|
119
|
+
* @returns {*}
|
|
120
|
+
*/
|
|
121
|
+
export function get2ColBarChartDataSet({
|
|
122
|
+
isMonth = false,
|
|
123
|
+
placeholderColor,
|
|
124
|
+
borderColor,
|
|
125
|
+
}: { isMonth?: boolean } & Record<string, string>) {
|
|
126
|
+
let lastYearListCopy = lastYearList.concat([]);
|
|
127
|
+
let thisYearListCopy = lastYearList.concat([]);
|
|
128
|
+
|
|
129
|
+
if (isMonth) {
|
|
130
|
+
lastYearListCopy = lastYearListCopy.reverse();
|
|
131
|
+
thisYearListCopy = thisYearListCopy.reverse();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
color: getChartListColor(),
|
|
136
|
+
tooltip: {
|
|
137
|
+
trigger: 'item',
|
|
138
|
+
},
|
|
139
|
+
grid: {
|
|
140
|
+
top: '10px',
|
|
141
|
+
left: '0',
|
|
142
|
+
right: '0',
|
|
143
|
+
bottom: '36px',
|
|
144
|
+
containLabel: true,
|
|
145
|
+
},
|
|
146
|
+
xAxis: [
|
|
147
|
+
{
|
|
148
|
+
type: 'category',
|
|
149
|
+
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
|
150
|
+
axisTick: {
|
|
151
|
+
alignWithLabel: true,
|
|
152
|
+
},
|
|
153
|
+
axisLabel: {
|
|
154
|
+
color: placeholderColor,
|
|
155
|
+
},
|
|
156
|
+
axisLine: {
|
|
157
|
+
lineStyle: {
|
|
158
|
+
color: borderColor,
|
|
159
|
+
width: 1,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
yAxis: [
|
|
165
|
+
{
|
|
166
|
+
type: 'value',
|
|
167
|
+
axisLabel: {
|
|
168
|
+
color: placeholderColor,
|
|
169
|
+
},
|
|
170
|
+
splitLine: {
|
|
171
|
+
lineStyle: {
|
|
172
|
+
color: borderColor,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
legend: {
|
|
178
|
+
data: ['去年', '今年'],
|
|
179
|
+
bottom: '0',
|
|
180
|
+
icon: 'rect',
|
|
181
|
+
itemGap: 48,
|
|
182
|
+
itemHeight: 4,
|
|
183
|
+
itemWidth: 12,
|
|
184
|
+
textStyle: {
|
|
185
|
+
fontSize: 12,
|
|
186
|
+
color: placeholderColor,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
series: [
|
|
190
|
+
{
|
|
191
|
+
name: '去年',
|
|
192
|
+
type: 'bar',
|
|
193
|
+
barWidth: '30%',
|
|
194
|
+
data: lastYearListCopy,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: '今年',
|
|
198
|
+
type: 'bar',
|
|
199
|
+
barWidth: '30%',
|
|
200
|
+
data: thisYearListCopy,
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
};
|
|
204
|
+
}
|