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,39 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// 一行最多 120 字符
|
|
3
|
+
printWidth: 120,
|
|
4
|
+
// 使用 2 个空格缩进
|
|
5
|
+
tabWidth: 2,
|
|
6
|
+
// 不使用缩进符,而使用空格
|
|
7
|
+
useTabs: false,
|
|
8
|
+
// 行尾需要有分号
|
|
9
|
+
semi: true,
|
|
10
|
+
// 使用单引号
|
|
11
|
+
singleQuote: true,
|
|
12
|
+
// 对象的 key 仅在必要时用引号
|
|
13
|
+
quoteProps: 'as-needed',
|
|
14
|
+
// jsx 不使用单引号,而使用双引号
|
|
15
|
+
jsxSingleQuote: false,
|
|
16
|
+
// 末尾需要有逗号
|
|
17
|
+
trailingComma: 'all',
|
|
18
|
+
// 大括号内的首尾需要空格
|
|
19
|
+
bracketSpacing: true,
|
|
20
|
+
// jsx 标签的反尖括号需要换行
|
|
21
|
+
jsxBracketSameLine: false,
|
|
22
|
+
// 箭头函数,只有一个参数的时候,也需要括号
|
|
23
|
+
arrowParens: 'always',
|
|
24
|
+
// 每个文件格式化的范围是文件的全部内容
|
|
25
|
+
rangeStart: 0,
|
|
26
|
+
rangeEnd: Infinity,
|
|
27
|
+
// 不需要写文件开头的 @prettier
|
|
28
|
+
requirePragma: false,
|
|
29
|
+
// 不需要自动在文件开头插入 @prettier
|
|
30
|
+
insertPragma: false,
|
|
31
|
+
// 使用默认的折行标准
|
|
32
|
+
proseWrap: 'preserve',
|
|
33
|
+
// 根据显示样式决定 html 要不要折行
|
|
34
|
+
htmlWhitespaceSensitivity: 'css',
|
|
35
|
+
// vue 文件中的 script 和 style 内不用缩进
|
|
36
|
+
vueIndentScriptAndStyle: false,
|
|
37
|
+
// 换行符使用 lf
|
|
38
|
+
endOfLine: 'lf',
|
|
39
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<p style="display:flex; justify-content: center">
|
|
2
|
+
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://tdesign.tencent.com/starter/vue/#/dashboard/base" target="_blank">
|
|
6
|
+
<img alt="TDesign Logo" width="200" src="https://tdesign.gtimg.com/starter/brand-logo.svg">
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatility"></a>
|
|
12
|
+
<a href="https://github.com/Tencent/tdesign-vue/blob/develop/LICENSE">
|
|
13
|
+
<img src="https://img.shields.io/npm/l/tdesign-vue.svg?sanitize=true" alt="License">
|
|
14
|
+
</a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
简体中文 | [English](./README.md)
|
|
18
|
+
|
|
19
|
+
### 项目简介
|
|
20
|
+
|
|
21
|
+
TDesign Vue Starter 是一个基于 tdesign-vue,使用 `Vue2`、`Vite`开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<a href="http://tdesign.tencent.com/starter/vue/">在线预览</a>
|
|
25
|
+
·
|
|
26
|
+
<a href="https://tdesign.tencent.com/starter/docs/vue/get-started">使用文档</a>
|
|
27
|
+
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<img src="docs/docs-starter.png">
|
|
31
|
+
|
|
32
|
+
### 特性
|
|
33
|
+
|
|
34
|
+
- 内置多种常用的中后台页面
|
|
35
|
+
- 完善的目录结构
|
|
36
|
+
- 完善的代码规范配置
|
|
37
|
+
- 支持暗黑模式
|
|
38
|
+
- 自定义主题颜色
|
|
39
|
+
- 多种空间布局
|
|
40
|
+
- 内置 Mock 数据方案
|
|
41
|
+
|
|
42
|
+
### 使用
|
|
43
|
+
|
|
44
|
+
> 通过 [tdesign-starter-cli](https://www.npmjs.com/package/tdesign-starter-cli) 初始化项目仓库
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
## 1、安装 tdesign-starter-cli
|
|
48
|
+
npm i tdesign-starter-cli@latest -g
|
|
49
|
+
|
|
50
|
+
## 2、创建项目
|
|
51
|
+
td-starter init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 开发
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
## 安装依赖
|
|
58
|
+
npm install
|
|
59
|
+
|
|
60
|
+
## 启动项目
|
|
61
|
+
npm run dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 构建
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
## 构建正式环境
|
|
68
|
+
npm run build
|
|
69
|
+
|
|
70
|
+
## 构建测试环境
|
|
71
|
+
npm run build:test
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 其他
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
## 预览构建产物
|
|
78
|
+
npm run preview
|
|
79
|
+
|
|
80
|
+
## 代码格式检查
|
|
81
|
+
npm run lint
|
|
82
|
+
|
|
83
|
+
## 代码格式检查与自动修复
|
|
84
|
+
npm run lint:fix
|
|
85
|
+
|
|
86
|
+
## style格式检查
|
|
87
|
+
npm run stylelint
|
|
88
|
+
|
|
89
|
+
## style格式检查与自动修复
|
|
90
|
+
npm run stylelint:fix
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 如何贡献
|
|
94
|
+
|
|
95
|
+
非常欢迎您的贡献!提交您的 [Issue](https://github.com/tencent/tdesign-vue-starter/issues/new/choose) 或者提交 [Pull Request](https://github.com/Tencent/tdesign-vue-starter/pulls)。
|
|
96
|
+
|
|
97
|
+
#### 贡献提交规范
|
|
98
|
+
|
|
99
|
+
- [Angular Convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)
|
|
100
|
+
- [Vue Style Guide](https://v3.vuejs.org/style-guide/#rule-categories)
|
|
101
|
+
|
|
102
|
+
### 兼容性
|
|
103
|
+
|
|
104
|
+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br> IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
|
|
105
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
106
|
+
| Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |
|
|
107
|
+
|
|
108
|
+
### 社区版本
|
|
109
|
+
|
|
110
|
+
基于 TDesign Vue 的 starter-kit 有多种社区版本,访问 [社区链接](https://tdesign.tencent.com/starter/docs/vue/community-link) 可以访问更多版本。
|
|
111
|
+
如果您也开发了 TDesign Starter 的社区版本,可以提交 Issue 或者直接给我们提Pull Request 😊。
|
|
112
|
+
|
|
113
|
+
### 开源协议
|
|
114
|
+
|
|
115
|
+
TDesign 遵循 [MIT 协议](https://github.com/Tencent/tdesign-vue-starter/LICENSE)。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { extends: ['@commitlint/config-conventional'] };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// 通用声明
|
|
2
|
+
declare type ClassName = { [className: string]: any } | ClassName[] | string;
|
|
3
|
+
|
|
4
|
+
declare interface ImportMeta {
|
|
5
|
+
env: {
|
|
6
|
+
MODE: 'mock' | 'development' | 'test' | 'release' | 'site';
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module '*.svg' {
|
|
11
|
+
const content: string;
|
|
12
|
+
export default content;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<script src="https://cdn-go.cn/aegis/aegis-sdk/latest/aegis.min.18.js"></script>
|
|
8
|
+
|
|
9
|
+
<title>TDesign Starter</title>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
14
|
+
<script language="javascript">
|
|
15
|
+
if (window.location.host === 'tdesign.tencent.com') {
|
|
16
|
+
const aegis = new Aegis({
|
|
17
|
+
id: 'rDISNMyXgqWDFPyHMB', // 项目ID,即上报key
|
|
18
|
+
reportAssetSpeed: true, // 静态资源测速
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
</body>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
window.global = window;
|
|
26
|
+
</script>
|
|
27
|
+
</html>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { MockMethod } from 'vite-plugin-mock';
|
|
2
|
+
import Mock from 'mockjs';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
url: '/api/get-purchase-list',
|
|
7
|
+
method: 'get',
|
|
8
|
+
response: () => ({
|
|
9
|
+
code: 0,
|
|
10
|
+
data: {
|
|
11
|
+
...Mock.mock({
|
|
12
|
+
'list|1-100': [
|
|
13
|
+
{
|
|
14
|
+
index: /S20201228115950[0-9][0-9][0-9]/,
|
|
15
|
+
pdName: 'Macbook',
|
|
16
|
+
pdNum: 'p_tmp_60a637cd0d',
|
|
17
|
+
'purchaseNum|1-100': 100,
|
|
18
|
+
adminName: '财务部111',
|
|
19
|
+
updateTime: '2020-05-20@date("HH:mm:ss")',
|
|
20
|
+
pdType: '电子产品',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
index: /S20201228115950[0-9][0-9][0-9]/,
|
|
24
|
+
pdName: 'Macbook',
|
|
25
|
+
pdNum: 'p_tmp_60a637cd0d',
|
|
26
|
+
'purchaseNum|1-100': 100,
|
|
27
|
+
adminName: '财务部',
|
|
28
|
+
updateTime: '2020-05-20@date("HH:mm:ss")',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
url: '/api/get-list',
|
|
37
|
+
method: 'get',
|
|
38
|
+
response: () => ({
|
|
39
|
+
code: 0,
|
|
40
|
+
data: {
|
|
41
|
+
...Mock.mock({
|
|
42
|
+
'list|1-100': [
|
|
43
|
+
{
|
|
44
|
+
'index|+1': 1,
|
|
45
|
+
'status|1': '@natural(0, 4)',
|
|
46
|
+
no: 'BH00@natural(01, 100)',
|
|
47
|
+
name: '@city()办公用品采购项目',
|
|
48
|
+
'paymentType|1': '@natural(0, 1)',
|
|
49
|
+
'contractType|1': '@natural(0, 2)',
|
|
50
|
+
updateTime: '2020-05-30 @date("HH:mm:ss")',
|
|
51
|
+
amount: '@natural(10, 500),000,000',
|
|
52
|
+
adminName: '@cname()',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
url: '/api/detail-basic',
|
|
61
|
+
method: 'get',
|
|
62
|
+
response: () => ({
|
|
63
|
+
code: 0,
|
|
64
|
+
data: {
|
|
65
|
+
...Mock.mock({
|
|
66
|
+
name: 'td_20023747',
|
|
67
|
+
loginType: 'Web',
|
|
68
|
+
currentRole: 'Admin',
|
|
69
|
+
rightsList: '通用权限',
|
|
70
|
+
userStatus: '启用',
|
|
71
|
+
language: '简体中文',
|
|
72
|
+
timeZone: '(GMT+08:00)中国时区—北京(Asia/Beijing)',
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
url: '/api/get-card-list',
|
|
79
|
+
method: 'get',
|
|
80
|
+
response: () => ({
|
|
81
|
+
code: 0,
|
|
82
|
+
data: {
|
|
83
|
+
...Mock.mock({
|
|
84
|
+
'list|48-50': [
|
|
85
|
+
{
|
|
86
|
+
'index|+1': 1,
|
|
87
|
+
isSetup: '@boolean',
|
|
88
|
+
'type|1': '@natural(1, 5)',
|
|
89
|
+
'banner|1': [
|
|
90
|
+
'https://tdesign.gtimg.com/starter/cloud-db.jpg',
|
|
91
|
+
'https://tdesign.gtimg.com/starter/cloud-server.jpg',
|
|
92
|
+
'https://tdesign.gtimg.com/starter/ssl.jpg',
|
|
93
|
+
'https://tdesign.gtimg.com/starter/t-sec.jpg',
|
|
94
|
+
'https://tdesign.gtimg.com/starter/face-recognition.jpg',
|
|
95
|
+
],
|
|
96
|
+
'name|1': ['人脸识别', 'SSL证书', 'CVM', '云数据库', 'T-Sec 云防火墙'],
|
|
97
|
+
'description|1': [
|
|
98
|
+
'基于腾讯优图强大的面部分析技术,提供包括人脸检测与分析、五官定位、人脸搜索、人脸比对、人脸',
|
|
99
|
+
'云硬盘为您提供用于CVM的持久性数据块级存储服务。云硬盘中的数据自动地可用区内以多副本冗',
|
|
100
|
+
'SSL证书又叫服务器证书,腾讯云为您提供证书的一站式服务,包括免费、付费证书的申请、管理及部',
|
|
101
|
+
'腾讯安全云防火墙产品,是腾讯云安全团队结合云原生的优势,自主研发的SaaS化防火墙产品,无需客无需客无需客无需客无需客无需客无需客',
|
|
102
|
+
'云数据库MySQL为用户提供安全可靠,性能卓越、易于维护的企业级云数据库服务。',
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
}),
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
url: '/api/get-project-list',
|
|
112
|
+
method: 'get',
|
|
113
|
+
response: () => ({
|
|
114
|
+
code: 0,
|
|
115
|
+
data: {
|
|
116
|
+
...Mock.mock({
|
|
117
|
+
'list|1-50': [
|
|
118
|
+
{
|
|
119
|
+
'index|+1': 1,
|
|
120
|
+
adminPhone: '+86 13587609955',
|
|
121
|
+
updateTime: '2020-05-30 @date("HH:mm:ss")',
|
|
122
|
+
'adminName|1': ['顾娟 ', '常刚', '郑洋'],
|
|
123
|
+
'name|1': [
|
|
124
|
+
'沧州市办公用品采购项目',
|
|
125
|
+
'红河哈尼族彝族自治州办公用品采购项目 ',
|
|
126
|
+
'铜川市办公用品采购项目',
|
|
127
|
+
'陇南市办公用品采购项目 ',
|
|
128
|
+
'六安市办公用品采购项目 ',
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
}),
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
url: '/api/post',
|
|
138
|
+
method: 'post',
|
|
139
|
+
timeout: 2000,
|
|
140
|
+
response: {
|
|
141
|
+
code: 0,
|
|
142
|
+
data: {
|
|
143
|
+
name: 'vben',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
] as MockMethod[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tdesign-vue-starter",
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev:mock": "vite --open --mode mock",
|
|
6
|
+
"dev": "vite --open --mode development",
|
|
7
|
+
"dev:linux": "vite --mode development",
|
|
8
|
+
"build:test": "vite build --mode test",
|
|
9
|
+
"build": "vite build --mode release",
|
|
10
|
+
"build:site": "vite build --mode site",
|
|
11
|
+
"site:preview": "npm run build && cp -r dist _site",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
|
|
14
|
+
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",
|
|
15
|
+
"stylelint": "stylelint src/**/*.{html,vue,sass,less}",
|
|
16
|
+
"stylelint:fix": "stylelint --cache --fix src/**/*.{html,vue,vss,sass,less}",
|
|
17
|
+
"prepare": "husky install",
|
|
18
|
+
"test": "echo \"no test specified,work in process\"",
|
|
19
|
+
"test:coverage": "echo \"no test:coverage specified,work in process\""
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"axios": "^1.1.3",
|
|
23
|
+
"dayjs": "^1.10.8",
|
|
24
|
+
"echarts": "5.1.2",
|
|
25
|
+
"lodash": "^4.17.21",
|
|
26
|
+
"nprogress": "^0.2.0",
|
|
27
|
+
"qrcode.vue": "^1.7.0",
|
|
28
|
+
"tdesign-icons-vue": "^0.1.6",
|
|
29
|
+
"tdesign-vue": "^1.3.0",
|
|
30
|
+
"tvision-color": "~1.5.0",
|
|
31
|
+
"typescript": "^4.2.4",
|
|
32
|
+
"vue": "~2.6.14",
|
|
33
|
+
"vue-clipboard2": "^0.3.1",
|
|
34
|
+
"vue-router": "^3.5.1",
|
|
35
|
+
"vuex": "^3.6.2",
|
|
36
|
+
"vuex-router-sync": "^5.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@commitlint/cli": "^17.0.3",
|
|
40
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
41
|
+
"@types/lodash": "^4.14.202",
|
|
42
|
+
"@types/vue-color": "^2.4.3",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
|
44
|
+
"@typescript-eslint/parser": "^4.19.0",
|
|
45
|
+
"commitizen": "^4.2.3",
|
|
46
|
+
"eslint": "^7.22.0",
|
|
47
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
48
|
+
"eslint-config-prettier": "^8.5.0",
|
|
49
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
50
|
+
"eslint-plugin-import": "^2.22.1",
|
|
51
|
+
"eslint-plugin-vue": "^7.8.0",
|
|
52
|
+
"husky": "^8.0.1",
|
|
53
|
+
"less": "^4.1.0",
|
|
54
|
+
"lint-staged": "^13.0.3",
|
|
55
|
+
"mockjs": "^1.1.0",
|
|
56
|
+
"prettier": "^2.6.0",
|
|
57
|
+
"stylelint": "~13.13.1",
|
|
58
|
+
"stylelint-config-prettier": "~9.0.3",
|
|
59
|
+
"stylelint-less": "1.0.5",
|
|
60
|
+
"stylelint-order": "~4.1.0",
|
|
61
|
+
"vite": "^4.1.4",
|
|
62
|
+
"vite-plugin-mock": "^2.3.0",
|
|
63
|
+
"vite-plugin-theme": "^0.8.1",
|
|
64
|
+
"vite-plugin-vue2": "^2.0.1",
|
|
65
|
+
"vite-plugin-vue2-svg": "~0.4.0",
|
|
66
|
+
"vue-template-compiler": "~2.6.14"
|
|
67
|
+
},
|
|
68
|
+
"config": {
|
|
69
|
+
"commitizen": {
|
|
70
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"husky": {
|
|
74
|
+
"hooks": {
|
|
75
|
+
"pre-commit": "lint-staged",
|
|
76
|
+
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
|
|
77
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"lint-staged": {
|
|
81
|
+
"*.{js,jsx,vue,ts,tsx}": [
|
|
82
|
+
"prettier --write",
|
|
83
|
+
"npm run lint:fix",
|
|
84
|
+
"git add ."
|
|
85
|
+
],
|
|
86
|
+
"*.{html,vue,vss,sass,less}": [
|
|
87
|
+
"npm run stylelint:fix",
|
|
88
|
+
"git add ."
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= projectName %>",
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev:mock": "vite --open --mode mock",
|
|
6
|
+
"dev": "vite --open --mode development",
|
|
7
|
+
"dev:linux": "vite --mode development",
|
|
8
|
+
"build:test": "vite build --mode test",
|
|
9
|
+
"build": "vite build --mode release",
|
|
10
|
+
"build:site": "vite build --mode site",
|
|
11
|
+
"site:preview": "npm run build && cp -r dist _site",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
|
|
14
|
+
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",
|
|
15
|
+
"stylelint": "stylelint src/**/*.{html,vue,sass,less}",
|
|
16
|
+
"stylelint:fix": "stylelint --cache --fix src/**/*.{html,vue,vss,sass,less}",
|
|
17
|
+
"prepare": "husky install",
|
|
18
|
+
"test": "echo \"no test specified,work in process\"",
|
|
19
|
+
"test:coverage": "echo \"no test:coverage specified,work in process\""
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"axios": "^1.1.3",
|
|
23
|
+
"dayjs": "^1.10.8",
|
|
24
|
+
"echarts": "5.1.2",
|
|
25
|
+
"lodash": "^4.17.21",
|
|
26
|
+
"nprogress": "^0.2.0",
|
|
27
|
+
"qrcode.vue": "^1.7.0",
|
|
28
|
+
"tdesign-icons-vue": "^0.1.6",
|
|
29
|
+
"tdesign-vue": "^1.3.0",
|
|
30
|
+
"tvision-color": "~1.5.0",
|
|
31
|
+
"typescript": "^4.2.4",
|
|
32
|
+
"vue": "~2.6.14",
|
|
33
|
+
"vue-clipboard2": "^0.3.1",
|
|
34
|
+
"vue-router": "^3.5.1",
|
|
35
|
+
"vuex": "^3.6.2",
|
|
36
|
+
"vuex-router-sync": "^5.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@commitlint/cli": "^17.0.3",
|
|
40
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
41
|
+
"@types/lodash": "^4.14.202",
|
|
42
|
+
"@types/vue-color": "^2.4.3",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
|
44
|
+
"@typescript-eslint/parser": "^4.19.0",
|
|
45
|
+
"commitizen": "^4.2.3",
|
|
46
|
+
"eslint": "^7.22.0",
|
|
47
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
48
|
+
"eslint-config-prettier": "^8.5.0",
|
|
49
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
50
|
+
"eslint-plugin-import": "^2.22.1",
|
|
51
|
+
"eslint-plugin-vue": "^7.8.0",
|
|
52
|
+
"husky": "^8.0.1",
|
|
53
|
+
"less": "^4.1.0",
|
|
54
|
+
"lint-staged": "^13.0.3",
|
|
55
|
+
"mockjs": "^1.1.0",
|
|
56
|
+
"prettier": "^2.6.0",
|
|
57
|
+
"stylelint": "~13.13.1",
|
|
58
|
+
"stylelint-config-prettier": "~9.0.3",
|
|
59
|
+
"stylelint-less": "1.0.5",
|
|
60
|
+
"stylelint-order": "~4.1.0",
|
|
61
|
+
"vite": "^4.1.4",
|
|
62
|
+
"vite-plugin-mock": "^2.3.0",
|
|
63
|
+
"vite-plugin-theme": "^0.8.1",
|
|
64
|
+
"vite-plugin-vue2": "^2.0.1",
|
|
65
|
+
"vite-plugin-vue2-svg": "~0.4.0",
|
|
66
|
+
"vue-template-compiler": "~2.6.14"
|
|
67
|
+
},
|
|
68
|
+
"config": {
|
|
69
|
+
"commitizen": {
|
|
70
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"husky": {
|
|
74
|
+
"hooks": {
|
|
75
|
+
"pre-commit": "lint-staged",
|
|
76
|
+
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
|
|
77
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"lint-staged": {
|
|
81
|
+
"*.{js,jsx,vue,ts,tsx}": [
|
|
82
|
+
"prettier --write",
|
|
83
|
+
"npm run lint:fix",
|
|
84
|
+
"git add ."
|
|
85
|
+
],
|
|
86
|
+
"*.{html,vue,vss,sass,less}": [
|
|
87
|
+
"npm run stylelint:fix",
|
|
88
|
+
"git add ."
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<router-view :class="[mode]" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import Vue from 'vue';
|
|
7
|
+
import config from '@/config/style';
|
|
8
|
+
|
|
9
|
+
export default Vue.extend({
|
|
10
|
+
computed: {
|
|
11
|
+
mode() {
|
|
12
|
+
return this.$store.getters['setting/mode'];
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
mounted() {
|
|
16
|
+
this.$store.dispatch('setting/changeTheme', { ...config });
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
Binary file
|
|
Binary file
|