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,313 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="list-common-table">
|
|
3
|
+
<t-form
|
|
4
|
+
ref="form"
|
|
5
|
+
:data="formData"
|
|
6
|
+
:label-width="80"
|
|
7
|
+
colon
|
|
8
|
+
@reset="onReset"
|
|
9
|
+
@submit="onSubmit"
|
|
10
|
+
:style="{ marginBottom: '8px' }"
|
|
11
|
+
>
|
|
12
|
+
<t-row>
|
|
13
|
+
<t-col :span="10">
|
|
14
|
+
<t-row :gutter="[16, 24]">
|
|
15
|
+
<t-col :flex="1">
|
|
16
|
+
<t-form-item label="合同名称" name="name">
|
|
17
|
+
<t-input
|
|
18
|
+
v-model="formData.name"
|
|
19
|
+
class="form-item-content"
|
|
20
|
+
type="search"
|
|
21
|
+
placeholder="请输入合同名称"
|
|
22
|
+
:style="{ minWidth: '134px' }"
|
|
23
|
+
/>
|
|
24
|
+
</t-form-item>
|
|
25
|
+
</t-col>
|
|
26
|
+
<t-col :flex="1">
|
|
27
|
+
<t-form-item label="合同状态" name="status">
|
|
28
|
+
<t-select
|
|
29
|
+
v-model="formData.status"
|
|
30
|
+
class="form-item-content`"
|
|
31
|
+
:options="CONTRACT_STATUS_OPTIONS"
|
|
32
|
+
placeholder="请选择合同状态"
|
|
33
|
+
/>
|
|
34
|
+
</t-form-item>
|
|
35
|
+
</t-col>
|
|
36
|
+
<t-col :flex="1">
|
|
37
|
+
<t-form-item label="合同编号" name="no">
|
|
38
|
+
<t-input
|
|
39
|
+
v-model="formData.no"
|
|
40
|
+
class="form-item-content"
|
|
41
|
+
placeholder="请输入合同编号"
|
|
42
|
+
:style="{ minWidth: '134px' }"
|
|
43
|
+
/>
|
|
44
|
+
</t-form-item>
|
|
45
|
+
</t-col>
|
|
46
|
+
<t-col :flex="1">
|
|
47
|
+
<t-form-item label="合同类型" name="type">
|
|
48
|
+
<t-select
|
|
49
|
+
v-model="formData.type"
|
|
50
|
+
class="form-item-content`"
|
|
51
|
+
:options="CONTRACT_TYPE_OPTIONS"
|
|
52
|
+
placeholder="请选择合同类型"
|
|
53
|
+
/>
|
|
54
|
+
</t-form-item>
|
|
55
|
+
</t-col>
|
|
56
|
+
</t-row>
|
|
57
|
+
</t-col>
|
|
58
|
+
|
|
59
|
+
<t-col :span="2" class="operation-container">
|
|
60
|
+
<t-button theme="primary" type="submit" :style="{ marginLeft: '8px' }"> 查询 </t-button>
|
|
61
|
+
<t-button type="reset" variant="base" theme="default"> 重置 </t-button>
|
|
62
|
+
</t-col>
|
|
63
|
+
</t-row>
|
|
64
|
+
</t-form>
|
|
65
|
+
<div class="table-container">
|
|
66
|
+
<t-table
|
|
67
|
+
:data="data"
|
|
68
|
+
:columns="columns"
|
|
69
|
+
:rowKey="rowKey"
|
|
70
|
+
:verticalAlign="verticalAlign"
|
|
71
|
+
:hover="hover"
|
|
72
|
+
:pagination="pagination"
|
|
73
|
+
@page-change="rehandlePageChange"
|
|
74
|
+
@change="rehandleChange"
|
|
75
|
+
:loading="dataLoading"
|
|
76
|
+
:headerAffixedTop="true"
|
|
77
|
+
:headerAffixProps="{ offsetTop, container: getContainer }"
|
|
78
|
+
>
|
|
79
|
+
<template #status="{ row }">
|
|
80
|
+
<t-tag v-if="row.status === CONTRACT_STATUS.FAIL" theme="danger" variant="light">审核失败</t-tag>
|
|
81
|
+
<t-tag v-if="row.status === CONTRACT_STATUS.AUDIT_PENDING" theme="warning" variant="light">待审核</t-tag>
|
|
82
|
+
<t-tag v-if="row.status === CONTRACT_STATUS.EXEC_PENDING" theme="warning" variant="light">待履行</t-tag>
|
|
83
|
+
<t-tag v-if="row.status === CONTRACT_STATUS.EXECUTING" theme="success" variant="light">履行中</t-tag>
|
|
84
|
+
<t-tag v-if="row.status === CONTRACT_STATUS.FINISH" theme="success" variant="light">已完成</t-tag>
|
|
85
|
+
</template>
|
|
86
|
+
<template #contractType="{ row }">
|
|
87
|
+
<p v-if="row.contractType === CONTRACT_TYPES.MAIN">审核失败</p>
|
|
88
|
+
<p v-if="row.contractType === CONTRACT_TYPES.SUB">待审核</p>
|
|
89
|
+
<p v-if="row.contractType === CONTRACT_TYPES.SUPPLEMENT">待履行</p>
|
|
90
|
+
</template>
|
|
91
|
+
<template #paymentType="{ row }">
|
|
92
|
+
<p v-if="row.paymentType === CONTRACT_PAYMENT_TYPES.PAYMENT" class="payment-col">
|
|
93
|
+
付款
|
|
94
|
+
<trend class="dashboard-item-trend" type="up" />
|
|
95
|
+
</p>
|
|
96
|
+
<p v-if="row.paymentType === CONTRACT_PAYMENT_TYPES.RECIPT" class="payment-col">
|
|
97
|
+
收款
|
|
98
|
+
<trend class="dashboard-item-trend" type="down" />
|
|
99
|
+
</p>
|
|
100
|
+
</template>
|
|
101
|
+
<template #op="slotProps">
|
|
102
|
+
<a class="t-button-link" @click="rehandleClickOp(slotProps)">管理</a>
|
|
103
|
+
<a class="t-button-link" @click="handleClickDelete(slotProps)">删除</a>
|
|
104
|
+
</template>
|
|
105
|
+
</t-table>
|
|
106
|
+
<t-dialog
|
|
107
|
+
header="确认删除当前所选合同?"
|
|
108
|
+
:body="confirmBody"
|
|
109
|
+
:visible.sync="confirmVisible"
|
|
110
|
+
@confirm="onConfirmDelete"
|
|
111
|
+
:onCancel="onCancel"
|
|
112
|
+
>
|
|
113
|
+
</t-dialog>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</template>
|
|
117
|
+
<script>
|
|
118
|
+
import { prefix } from '@/config/global';
|
|
119
|
+
import Trend from '@/components/trend/index.vue';
|
|
120
|
+
|
|
121
|
+
import {
|
|
122
|
+
CONTRACT_STATUS,
|
|
123
|
+
CONTRACT_STATUS_OPTIONS,
|
|
124
|
+
CONTRACT_TYPES,
|
|
125
|
+
CONTRACT_TYPE_OPTIONS,
|
|
126
|
+
CONTRACT_PAYMENT_TYPES,
|
|
127
|
+
} from '@/constants';
|
|
128
|
+
|
|
129
|
+
export default {
|
|
130
|
+
name: 'list-table',
|
|
131
|
+
components: {
|
|
132
|
+
Trend,
|
|
133
|
+
},
|
|
134
|
+
data() {
|
|
135
|
+
return {
|
|
136
|
+
CONTRACT_STATUS,
|
|
137
|
+
CONTRACT_STATUS_OPTIONS,
|
|
138
|
+
CONTRACT_TYPES,
|
|
139
|
+
CONTRACT_TYPE_OPTIONS,
|
|
140
|
+
CONTRACT_PAYMENT_TYPES,
|
|
141
|
+
prefix,
|
|
142
|
+
formData: {
|
|
143
|
+
name: '',
|
|
144
|
+
no: undefined,
|
|
145
|
+
status: undefined,
|
|
146
|
+
},
|
|
147
|
+
data: [],
|
|
148
|
+
dataLoading: false,
|
|
149
|
+
value: 'first',
|
|
150
|
+
columns: [
|
|
151
|
+
{
|
|
152
|
+
title: '合同名称',
|
|
153
|
+
fixed: 'left',
|
|
154
|
+
width: 200,
|
|
155
|
+
align: 'left',
|
|
156
|
+
ellipsis: true,
|
|
157
|
+
colKey: 'name',
|
|
158
|
+
},
|
|
159
|
+
{ title: '合同状态', colKey: 'status', width: 200, cell: { col: 'status' } },
|
|
160
|
+
{
|
|
161
|
+
title: '合同编号',
|
|
162
|
+
width: 200,
|
|
163
|
+
ellipsis: true,
|
|
164
|
+
colKey: 'no',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
title: '合同类型',
|
|
168
|
+
width: 200,
|
|
169
|
+
ellipsis: true,
|
|
170
|
+
colKey: 'contractType',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
title: '合同收付类型',
|
|
174
|
+
width: 200,
|
|
175
|
+
ellipsis: true,
|
|
176
|
+
colKey: 'paymentType',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
title: '合同金额 (元)',
|
|
180
|
+
width: 200,
|
|
181
|
+
ellipsis: true,
|
|
182
|
+
colKey: 'amount',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
align: 'left',
|
|
186
|
+
fixed: 'right',
|
|
187
|
+
width: 200,
|
|
188
|
+
colKey: 'op',
|
|
189
|
+
title: '操作',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
rowKey: 'index',
|
|
193
|
+
tableLayout: 'auto',
|
|
194
|
+
verticalAlign: 'top',
|
|
195
|
+
bordered: true,
|
|
196
|
+
hover: true,
|
|
197
|
+
rowClassName: (rowKey) => `${rowKey}-class`,
|
|
198
|
+
// 与pagination对齐
|
|
199
|
+
pagination: {
|
|
200
|
+
defaultPageSize: 20,
|
|
201
|
+
total: 100,
|
|
202
|
+
defaultCurrent: 1,
|
|
203
|
+
},
|
|
204
|
+
confirmVisible: false,
|
|
205
|
+
deleteIdx: -1,
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
computed: {
|
|
209
|
+
confirmBody() {
|
|
210
|
+
if (this.deleteIdx > -1) {
|
|
211
|
+
const { name } = this.data?.[this.deleteIdx];
|
|
212
|
+
return `删除后,${name}的所有合同信息将被清空,且无法恢复`;
|
|
213
|
+
}
|
|
214
|
+
return '';
|
|
215
|
+
},
|
|
216
|
+
offsetTop() {
|
|
217
|
+
return this.$store.state.setting.isUseTabsRouter ? 48 : 0;
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
mounted() {
|
|
221
|
+
this.dataLoading = true;
|
|
222
|
+
this.$request
|
|
223
|
+
.get('/api/get-list')
|
|
224
|
+
.then((res) => {
|
|
225
|
+
if (res.code === 0) {
|
|
226
|
+
const { list = [] } = res.data;
|
|
227
|
+
this.data = list;
|
|
228
|
+
this.pagination = {
|
|
229
|
+
...this.pagination,
|
|
230
|
+
total: list.length,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
.catch((e) => {
|
|
235
|
+
console.log(e);
|
|
236
|
+
})
|
|
237
|
+
.finally(() => {
|
|
238
|
+
this.dataLoading = false;
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
methods: {
|
|
242
|
+
getContainer() {
|
|
243
|
+
return document.querySelector('.tdesign-starter-layout');
|
|
244
|
+
},
|
|
245
|
+
onReset(data) {
|
|
246
|
+
console.log(data);
|
|
247
|
+
},
|
|
248
|
+
onSubmit(data) {
|
|
249
|
+
console.log(data);
|
|
250
|
+
},
|
|
251
|
+
rehandlePageChange(curr, pageInfo) {
|
|
252
|
+
console.log('分页变化', curr, pageInfo);
|
|
253
|
+
},
|
|
254
|
+
rehandleChange(changeParams, triggerAndData) {
|
|
255
|
+
console.log('统一Change', changeParams, triggerAndData);
|
|
256
|
+
},
|
|
257
|
+
rehandleClickOp({ text, row }) {
|
|
258
|
+
console.log(text, row);
|
|
259
|
+
},
|
|
260
|
+
handleClickDelete(row) {
|
|
261
|
+
this.deleteIdx = row.rowIndex;
|
|
262
|
+
this.confirmVisible = true;
|
|
263
|
+
},
|
|
264
|
+
onConfirmDelete() {
|
|
265
|
+
// 真实业务请发起请求
|
|
266
|
+
this.data.splice(this.deleteIdx, 1);
|
|
267
|
+
this.pagination.total = this.data.length;
|
|
268
|
+
this.confirmVisible = false;
|
|
269
|
+
this.$message.success('删除成功');
|
|
270
|
+
this.resetIdx();
|
|
271
|
+
},
|
|
272
|
+
onCancel() {
|
|
273
|
+
this.resetIdx();
|
|
274
|
+
},
|
|
275
|
+
resetIdx() {
|
|
276
|
+
this.deleteIdx = -1;
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
</script>
|
|
281
|
+
|
|
282
|
+
<style lang="less" scoped>
|
|
283
|
+
@import '@/style/variables.less';
|
|
284
|
+
|
|
285
|
+
.list-common-table {
|
|
286
|
+
background-color: var(--td-bg-color-container);
|
|
287
|
+
padding: 30px 32px;
|
|
288
|
+
border-radius: var(--td-radius-default);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.form-item-content {
|
|
292
|
+
width: 100%;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.operation-container {
|
|
296
|
+
display: flex;
|
|
297
|
+
justify-content: flex-end;
|
|
298
|
+
align-items: center;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.payment-col {
|
|
302
|
+
display: flex;
|
|
303
|
+
|
|
304
|
+
.trend-container {
|
|
305
|
+
display: flex;
|
|
306
|
+
align-items: center;
|
|
307
|
+
margin-left: 8px;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
.t-button + .t-button {
|
|
311
|
+
margin-left: var(--td-comp-margin-s);
|
|
312
|
+
}
|
|
313
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-card :bordered="false">
|
|
3
|
+
<common-table />
|
|
4
|
+
</t-card>
|
|
5
|
+
</template>
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import CommonTable from '../components/CommonTable.vue';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ListFilter',
|
|
11
|
+
components: {
|
|
12
|
+
CommonTable,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-card :bordered="false">
|
|
3
|
+
<div class="table-tree-container">
|
|
4
|
+
<div class="list-tree-wrapper">
|
|
5
|
+
<div class="list-tree-operator">
|
|
6
|
+
<t-input v-model="filterText" @input="onInput" placeholder="请输入关键词">
|
|
7
|
+
<search-icon slot="suffix-icon" size="20px" />
|
|
8
|
+
</t-input>
|
|
9
|
+
<t-tree :data="items" hover expand-on-click-node :default-expanded="expanded" :filter="filterByText" />
|
|
10
|
+
</div>
|
|
11
|
+
<div class="list-tree-content">
|
|
12
|
+
<common-table />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</t-card>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
import { SearchIcon } from 'tdesign-icons-vue';
|
|
20
|
+
import CommonTable from '../components/CommonTable.vue';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'ListTree',
|
|
24
|
+
components: {
|
|
25
|
+
SearchIcon,
|
|
26
|
+
CommonTable,
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
data: [],
|
|
31
|
+
filterText: '',
|
|
32
|
+
filterByText: null,
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
label: '一级操作',
|
|
36
|
+
value: '1',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: '二级操作',
|
|
40
|
+
value: '2',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
value: 'first',
|
|
44
|
+
expanded: ['0', '0-0', '0-1', '0-2', '0-3', '0-4'],
|
|
45
|
+
items: [
|
|
46
|
+
{
|
|
47
|
+
label: '深圳总部',
|
|
48
|
+
value: 0,
|
|
49
|
+
children: [
|
|
50
|
+
{
|
|
51
|
+
label: '总办',
|
|
52
|
+
value: '0-0',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '市场部',
|
|
56
|
+
value: '0-1',
|
|
57
|
+
children: [
|
|
58
|
+
{
|
|
59
|
+
label: '采购1组',
|
|
60
|
+
value: '0-1-0',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: '采购2组',
|
|
64
|
+
value: '0-1-1',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: '技术部',
|
|
70
|
+
value: '0-2',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: '北京总部',
|
|
76
|
+
value: 1,
|
|
77
|
+
children: [
|
|
78
|
+
{
|
|
79
|
+
label: '总办',
|
|
80
|
+
value: '1-0',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: '市场部',
|
|
84
|
+
value: '1-1',
|
|
85
|
+
children: [
|
|
86
|
+
{
|
|
87
|
+
label: '采购1组',
|
|
88
|
+
value: '1-1-0',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: '采购2组',
|
|
92
|
+
value: '1-1-1',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: '上海总部',
|
|
100
|
+
value: 2,
|
|
101
|
+
children: [
|
|
102
|
+
{
|
|
103
|
+
label: '市场部',
|
|
104
|
+
value: '2-0',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: '财务部',
|
|
108
|
+
value: '2-1',
|
|
109
|
+
children: [
|
|
110
|
+
{
|
|
111
|
+
label: '财务1组',
|
|
112
|
+
value: '2-1-0',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: '财务2组',
|
|
116
|
+
value: '2-1-1',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: '湖南',
|
|
124
|
+
value: 3,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: '湖北',
|
|
128
|
+
value: 4,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
methods: {
|
|
135
|
+
onInput() {
|
|
136
|
+
this.filterByText = (node) => {
|
|
137
|
+
const rs = node.label.indexOf(this.filterText) >= 0;
|
|
138
|
+
return rs;
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
rehandleClickOp({ text, row }) {
|
|
142
|
+
console.log(text, row);
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style lang="less" scoped>
|
|
149
|
+
@import '@/style/variables.less';
|
|
150
|
+
|
|
151
|
+
.table-tree-container {
|
|
152
|
+
background-color: var(--td-bg-color-container);
|
|
153
|
+
border-radius: var(--td-radius-default);
|
|
154
|
+
|
|
155
|
+
.t-tree {
|
|
156
|
+
margin-top: 24px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.list-tree-wrapper {
|
|
161
|
+
overflow-y: hidden;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.list-tree-operator {
|
|
165
|
+
width: 200px;
|
|
166
|
+
float: left;
|
|
167
|
+
padding: 30px 32px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.list-tree-content {
|
|
171
|
+
border-left: 1px solid var(--td-component-border);
|
|
172
|
+
overflow: auto;
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header class="login-header">
|
|
3
|
+
<logo-full-icon class="logo" />
|
|
4
|
+
<div class="operations-container">
|
|
5
|
+
<t-button theme="default" shape="square" variant="text" @click="navToGitHub">
|
|
6
|
+
<logo-github-icon class="icon" />
|
|
7
|
+
</t-button>
|
|
8
|
+
<t-button theme="default" shape="square" variant="text" @click="navToHelper">
|
|
9
|
+
<help-circle-icon class="icon" />
|
|
10
|
+
</t-button>
|
|
11
|
+
<t-button theme="default" shape="square" variant="text" @click="toggleSettingPanel">
|
|
12
|
+
<setting-icon class="icon" />
|
|
13
|
+
</t-button>
|
|
14
|
+
</div>
|
|
15
|
+
</header>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import LogoFullIcon from '@/assets/assets-logo-full.svg';
|
|
20
|
+
import { LogoGithubIcon, HelpCircleIcon, SettingIcon } from 'tdesign-icons-vue';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
components: { LogoFullIcon, LogoGithubIcon, HelpCircleIcon, SettingIcon },
|
|
24
|
+
methods: {
|
|
25
|
+
navToGitHub() {
|
|
26
|
+
window.open('https://github.com/Tencent/tdesign-vue-starter');
|
|
27
|
+
},
|
|
28
|
+
navToHelper() {
|
|
29
|
+
window.open('https://tdesign.tencent.com/starter/docs/get-started');
|
|
30
|
+
},
|
|
31
|
+
toggleSettingPanel() {
|
|
32
|
+
this.$store.commit('setting/toggleSettingPanel', true);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
<style lang="less" scoped>
|
|
38
|
+
@import '@/style/variables.less';
|
|
39
|
+
|
|
40
|
+
.login-header {
|
|
41
|
+
height: var(--td-comp-size-xxxl);
|
|
42
|
+
padding: 0 24px;
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
backdrop-filter: blur(5px);
|
|
47
|
+
color: var(--td-text-color-primary);
|
|
48
|
+
|
|
49
|
+
.logo {
|
|
50
|
+
width: 188px;
|
|
51
|
+
height: var(--td-comp-size-xxxl);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.operations-container {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
|
|
58
|
+
.t-button {
|
|
59
|
+
margin-left: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.icon {
|
|
63
|
+
height: 20px;
|
|
64
|
+
width: 20px;
|
|
65
|
+
padding: 6px;
|
|
66
|
+
box-sizing: content-box;
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|