初始化

This commit is contained in:
li875147827 2024-02-01 17:11:16 +08:00
commit 5ce3985136
191 changed files with 12045 additions and 0 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[*.{ts,js,vue,css}]
indent_size = 2

5
.env Normal file
View File

@ -0,0 +1,5 @@
# 打包路径 根据项目不同按需配置
VITE_BASE_URL = /
VITE_IS_REQUEST_PROXY = true
VITE_API_URL = https://service-bv448zsw-1257786608.gz.apigw.tencentcs.com
VITE_API_URL_PREFIX = /api

5
.env.development Normal file
View File

@ -0,0 +1,5 @@
# 打包路径
VITE_BASE_URL = /
VITE_IS_REQUEST_PROXY = true
VITE_API_URL = https://service-exndqyuk-1257786608.gz.apigw.tencentcs.com
VITE_API_URL_PREFIX = /api

5
.env.site Normal file
View File

@ -0,0 +1,5 @@
# 打包路径 根据项目不同按需配置
VITE_BASE_URL = https://static.tdesign.tencent.com/starter/vue-next/
VITE_IS_REQUEST_PROXY = true
VITE_API_URL = https://service-bv448zsw-1257786608.gz.apigw.tencentcs.com
VITE_API_URL_PREFIX = /api

5
.env.test Normal file
View File

@ -0,0 +1,5 @@
# 打包路径 根据项目不同按需配置
VITE_BASE_URL = /
VITE_IS_REQUEST_PROXY = true
VITE_API_URL = https://service-exndqyuk-1257786608.gz.apigw.tencentcs.com
VITE_API_URL_PREFIX = /api

14
.eslintignore Normal file
View File

@ -0,0 +1,14 @@
snapshot*
dist
lib
es
esm
node_modules
src/_common
static
cypress
script/test/cypress
_site
temp*
static/
!.prettierrc.js

112
.eslintrc Normal file
View File

@ -0,0 +1,112 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"eslint-config-airbnb-base",
"@vue/typescript/recommended",
"plugin:vue/vue3-recommended",
"plugin:vue-scoped-css/base",
"plugin:prettier/recommended"
],
"env": {
"browser": true,
"node": true,
"jest": true,
"es6": true
},
"globals": {
"defineProps": "readonly",
"defineEmits": "readonly"
},
"plugins": ["vue", "@typescript-eslint", "simple-import-sort"],
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module",
"allowImportExportEverywhere": true,
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"import/extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"rules": {
"no-console": "off",
"no-continue": "off",
"no-restricted-syntax": "off",
"no-plusplus": "off",
"no-param-reassign": "off",
"no-shadow": "off",
"guard-for-in": "off",
"import/extensions": "off",
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"import/first": "off", // https://github.com/vuejs/vue-eslint-parser/issues/58
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"vue/first-attribute-linebreak": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"class-methods-use-this": "off", // 因为AxiosCancel必须实例化而能静态化所以加的规则如果有办法解决可以取消
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
},
"overrides": [
{
"files": ["*.vue"],
"rules": {
"vue/component-name-in-template-casing": [2, "kebab-case"],
"vue/require-default-prop": 0,
"vue/multi-word-component-names": 0,
"vue/no-reserved-props": 0,
"vue/no-v-html": 0,
"vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }]
}
},
{
"files": ["*.ts", "*.tsx"], // https://github.com/typescript-eslint eslint-recommended
"rules": {
"constructor-super": "off", // ts(2335) & ts(2377)
"getter-return": "off", // ts(2378)
"no-const-assign": "off", // ts(2588)
"no-dupe-args": "off", // ts(2300)
"no-dupe-class-members": "off", // ts(2393) & ts(2300)
"no-dupe-keys": "off", // ts(1117)
"no-func-assign": "off", // ts(2539)
"no-import-assign": "off", // ts(2539) & ts(2540)
"no-new-symbol": "off", // ts(2588)
"no-obj-calls": "off", // ts(2349)
"no-redeclare": "off", // ts(2451)
"no-setter-return": "off", // ts(2408)
"no-this-before-super": "off", // ts(2376)
"no-undef": "off", // ts(2304)
"no-unreachable": "off", // ts(7027)
"no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358)
"no-var": "error", // ts transpiles let/const to var, so no need for vars any more
"prefer-const": "error", // ts provides better types with const
"prefer-rest-params": "error", // ts provides better types with rest args over arguments
"prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply
"valid-typeof": "off" // ts(2367)
}
}
]
}

6
.gitattributes vendored Normal file
View File

@ -0,0 +1,6 @@
*.ts text eol=lf
*.vue text eol=lf
*.tsx text eol=lf
*.jsx text eol=lf
*.html text eol=lf
*.json text eol=lf

View File

@ -0,0 +1,79 @@
name: 反馈 Bug
description: 通过 github 模板进行 Bug 反馈。
title: "[组件名称] 描述问题的标题"
body:
- type: markdown
attributes:
value: |
# 欢迎你的参与
tdesign-vue-next-starter 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区:<img width="80px" src="https://user-images.githubusercontent.com/15634204/157386871-bf84c2ea-a02f-4c1c-b6fd-577450cdbcf7.png" />
在发布一个 Issue 前,请确保:
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://github.com/Tencent/tdesign-vue-next-starter/blob/main/CHANGELOG.md) 和 [旧Issue列表](https://github.com/Tencent/tdesign-vue-next-starter/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。
- type: input
id: version
attributes:
label: tdesign-vue-next-starter 版本
description: 请检查在最新项目版本中能否重现此 issue。
placeholder: 请填写
validations:
required: true
- type: input
id: reproduce
attributes:
label: 重现链接
description: 请提供尽可能精简的 CodePen、CodeSandbox 或 GitHub 仓库的链接。请不要填无关链接,否则你的 Issue 将被关闭。
placeholder: 请填写
- type: textarea
id: reproduceSteps
attributes:
label: 重现步骤
description: 请清晰的描述重现该 Issue 的步骤,这能帮助我们快速定位问题。没有清晰重现步骤将不会被修复,标有 'need reproduction' 的 Issue 在 7 天内不提供相关步骤,将被关闭。
placeholder: 请填写
- type: textarea
id: expect
attributes:
label: 期望结果
placeholder: 请填写
- type: textarea
id: actual
attributes:
label: 实际结果
placeholder: 请填写
- type: input
id: frameworkVersion
attributes:
label: 框架版本
placeholder: Vue(3.2.0)
- type: input
id: browsersVersion
attributes:
label: 浏览器版本
placeholder: Chrome(8.213.231.123)
- type: input
id: systemVersion
attributes:
label: 系统版本
placeholder: MacOS(11.2.3)
- type: input
id: nodeVersion
attributes:
label: Node版本
placeholder: 请填写
- type: textarea
id: remarks
attributes:
label: 补充说明
description: 可以是遇到这个 bug 的业务场景、上下文等信息。
placeholder: 请填写

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 使用 issue-helper 新建
url: https://Tencent.github.io/tdesign/issue-helper/?lang=zh-CN&repo=Tencent/tdesign-vue-next-starter
about: 使用 https://Tencent.github.io/tdesign/issue-helper/ 创建 issue其中包含 bug 和 feature表单提交更加严格。

View File

@ -0,0 +1,30 @@
name: 反馈新功能
description: 通过 github 模板进行新功能反馈。
title: "[组件名称] 描述问题的标题"
body:
- type: markdown
attributes:
value: |
# 欢迎你的参与
tdesign-vue-next-starter 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区:<img width="80px" src="https://user-images.githubusercontent.com/15634204/157386871-bf84c2ea-a02f-4c1c-b6fd-577450cdbcf7.png" />
在发布一个 Issue 前,请确保:
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://github.com/Tencent/tdesign-vue-next-starter/blob/main/CHANGELOG.md) 和 [旧Issue列表](https://github.com/Tencent/tdesign-vue-next-starter/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。
- type: textarea
id: functionContent
attributes:
label: 这个功能解决了什么问题
description: 请详尽说明这个需求的用例和场景。最重要的是:解释清楚是怎样的用户体验需求催生了这个功能上的需求。我们将考虑添加在现有 API 无法轻松实现的功能。新功能的用例也应当足够常见。
placeholder: 请填写
validations:
required: true
- type: textarea
id: functionalExpectations
attributes:
label: 你建议的方案是什么
placeholder: 请填写
validations:
required: true

52
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,52 @@
<!--
首先,感谢你的贡献!😄
请阅读并遵循 [TDesign 贡献指南](https://github.com/Tencent/tdesign/blob/main/docs/contributing.md),填写以下 pull request 的信息。
PR 在维护者审核通过后会合并,谢谢!
-->
### 🤔 这个 PR 的性质是?
- [ ] 日常 bug 修复
- [ ] 新特性提交
- [ ] 文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] CI/CD 改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他
### 🔗 相关 Issue
<!--
1. 描述相关需求的来源,如相关的 issue 讨论链接。
-->
### 💡 需求背景和解决方案
<!--
1. 要解决的具体问题。
2. 列出最终的 API 实现和用法。
3. 涉及UI/交互变动需要有截图或 GIF。
-->
### 📝 更新日志
<!--
从用户角度描述具体变化,以及可能的 breaking change 和其他风险。
-->
- fix(组件名称): 处理问题或特性描述 ...
- [ ] 本条 PR 不需要纳入 Changelog
### ☑️ 请求合并前的自查清单
⚠️ 请自检并全部**勾选全部选项**。⚠️
- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] Changelog 已提供或无须提供

20
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,20 @@
# Basic dependabot.yml file with
# minimum configuration for two package managers
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "monthly"
# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
interval: "monthly"

View File

@ -0,0 +1,52 @@
# force copy from tencent/tdesign
name: Issue Add Assigness
on:
issues:
types: [opened, edited]
jobs:
mark-duplicate:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
issuesOpened: |
👋 @{{ author }},感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。
# https://docs.github.com/cn/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues
- uses: 94dreamer/issue-assignees@main
id: assignees
with:
project_name: ${{github.event.repository.name}}
issue_title: ${{github.event.issue.title}}
- run: echo ${{ steps.assignees.outputs.contributors }}
- name: Add assigness
if: steps.assignees.outputs.contributors != ''
uses: actions-cool/issues-helper@v3
with:
actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
assignees: ${{ steps.assignees.outputs.contributors }}
- run: |
contributors=${{ steps.assignees.outputs.contributors }}
contributorstring=${contributors//,/ @}
echo "::set-output name=string::@$contributorstring"
id: contributors
- name: 通知贡献者
if: steps.assignees.outputs.contributors != ''
uses: actions-cool/maintain-one-comment@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
♥️ 有劳 ${{ steps.contributors.outputs.string }} 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @${{ github.event.issue.user.login }} 。
<!-- AUTO_ASSIGENEES_NOTIFY_HOOK -->
number: ${{ github.event.issue.number }}
body-include: "<!-- AUTO_ASSIGENEES_NOTIFY_HOOK -->"

View File

@ -0,0 +1,22 @@
# force copy from tencent/tdesign
name: Issue Help wanted
on:
issues:
types:
- labeled
jobs:
add-comment:
if: github.event.label.name == 'help wanted'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: |
任何人都可以处理此问题。
**请务必在您的 `pull request` 中引用此问题。** :sparkles:
感谢你的贡献! :sparkles:
reactions: heart

View File

@ -0,0 +1,19 @@
# force copy from tencent/tdesign
# 当在 issue 的 comment 回复类似 `Duplicate of #111` 这样的话issue 将被自动打上 重复提交标签 并且 cloese
name: Issue Mark Duplicate
on:
issue_comment:
types: [created, edited]
jobs:
mark-duplicate:
runs-on: ubuntu-latest
steps:
- name: mark-duplicate
uses: actions-cool/issues-helper@v2
with:
actions: "mark-duplicate"
token: ${{ secrets.GITHUB_TOKEN }}
duplicate-labels: "duplicate"
close-issue: true

21
.github/workflows/issue-reply.temp.yml vendored Normal file
View File

@ -0,0 +1,21 @@
# force copy from tencent/tdesign
# 当被打上 Need Reproduce 标签时候,自动提示需要重现实例
name: ISSUE_REPLY
on:
issues:
types: [labeled]
jobs:
issue-reply:
runs-on: ubuntu-latest
steps:
- name: Need Reproduce
if: github.event.label.name == 'Need Reproduce'
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://codesandbox.io/) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

View File

@ -0,0 +1,17 @@
# force copy from tencent/tdesign
name: Issue Add Assigness
on:
issues:
types: [opened, reopened]
jobs:
mark-duplicate:
runs-on: ubuntu-latest
steps:
# https://docs.github.com/cn/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues
- uses: 94dreamer/create-report@main
with:
wxhook: ${{ secrets.WX_HOOK_URL }}
token: ${{ secrets.GITHUB_TOKEN }}
type: 'issue'

View File

@ -0,0 +1,12 @@
# force copy from tencent/tdesign
name: pr-spell-check
on: [pull_request]
jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check spelling
uses: crate-ci/typos@master

15
.github/workflows/preview-publish.yml vendored Normal file
View File

@ -0,0 +1,15 @@
# 文件名建议统一为 preview-publish
# 应用 preview.yml 的 demo
name: PREVIEW_PUBLISH
on:
workflow_run:
workflows: ["MAIN_PULL_REQUEST"]
types:
- completed
jobs:
call-preview:
uses: Tencent/tdesign/.github/workflows/preview.yml@main
secrets:
TDESIGN_SURGE_TOKEN: ${{ secrets.TDESIGN_SURGE_TOKEN }}

14
.github/workflows/pull-request.yml vendored Normal file
View File

@ -0,0 +1,14 @@
# 文件名建议统一为 pull-request.yml
# 应用 test-build.yml 的 demo
name: MAIN_PULL_REQUEST
on:
pull_request:
branches: [develop, main, site]
types: [opened, synchronize, reopened]
jobs:
call-test-build:
uses: Tencent/tdesign/.github/workflows/test-build.yml@main
# install lint

28
.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
node_modules
.DS_Store
# build files
es/
lib/
dist/
typings/
_site
package
tmp*
temp*
coverage
test-report.html
.idea/
yarn-error.log
*.zip
.history
.stylelintcache
.env.local
.env.*.local
# lock文件 请根据自身项目或团队需求选择具体的包管理工具 并移除具体的ignore的lock文件
yarn.lock
package-lock.json
pnpm-lock.yaml

8
.husky/commit-msg Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
if [[ "$OS" == "Windows_NT" ]]; then
npx.cmd --no-install commitlint -e $GIT_PARAMS
else
npx --no-install commitlint -e $GIT_PARAMS
fi

8
.husky/pre-commit Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
if [[ "$OS" == "Windows_NT" ]]; then
npx.cmd lint-staged
else
npx lint-staged
fi

10
.husky/prepare-commit-msg Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
[[ "$(uname -a)" = *"MINGW64"* ]] && exit 0
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"
if [[ "$OS" == "Windows_NT" ]]; then
exec < /dev/tty && npx.cmd git-cz --hook || true
else
exec < /dev/tty && npx git-cz --hook || true
fi

3
.npmrc Normal file
View File

@ -0,0 +1,3 @@
shamefully-hoist = true
hoist = true
engine-strict =true

39
.prettierrc.js Normal file
View File

@ -0,0 +1,39 @@
module.exports = {
// 一行最多 120 字符..
printWidth: 120,
// 使用 2 个空格缩进
tabWidth: 2,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾需要有分号
semi: true,
// 使用单引号
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// jsx 不使用单引号,而使用双引号
jsxSingleQuote: false,
// 末尾需要有逗号
trailingComma: 'all',
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
jsxBracketSameLine: false,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// vue 文件中的 script 和 style 内不用缩进
vueIndentScriptAndStyle: false,
// 换行符使用 lf
endOfLine: 'lf',
};

8
.stylelintignore Normal file
View File

@ -0,0 +1,8 @@
# .stylelintignore
# 旧的不需打包的样式库
*.min.css
# 其他类型文件
*.js
*.jpg
*.woff

3
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint"]
}

36
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,36 @@
{
"files.eol":"\n",
"editor.tabSize": 2,
"eslint.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"],
"[vue]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"cSpell.words": [
"tdesign",
"tvision",
"echarts",
"nprogress",
"commitlint",
"stylelint",
"pinia",
"qrcode"
],
}

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 TDesign
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

117
README-zh_CN.md Normal file
View File

@ -0,0 +1,117 @@
<p style="display:flex; justify-content: center">
</p>
<p align="center">
<a href="https://tdesign.tencent.com/starter/vue-next/#/dashboard/base" target="_blank">
<img alt="TDesign Logo" width="200" src="https://tdesign.gtimg.com/starter/brand-logo.svg">
</a>
</p>
<p align="center">
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatility"></a>
<a href="https://github.com/Tencent/tdesign-vue-next/blob/develop/LICENSE">
<img src="https://img.shields.io/npm/l/tdesign-vue-next.svg?sanitize=true" alt="License">
</a>
</p>
简体中文 | [English](./README.md)
### 项目简介
TDesign Vue Next Starter 是一个基于 TDesign使用 `Vue3`、`Vite`、`Pinia`、`TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。
<p>
<a href="http://tdesign.tencent.com/starter/vue-next/">在线预览</a>
·
<a href="https://tdesign.tencent.com/starter/">使用文档</a>
</p>
<img src="docs/starter.png">
### 特性
- 内置多种常用的中后台页面
- 完善的目录结构
- 完善的代码规范配置
- 支持暗黑模式
- 自定义主题颜色
- 多种空间布局
- 内置 Mock 数据方案
### 使用
> 通过 `tdesign-starter-cli` 初始化项目仓库
```bash
## 1、安装 tdesign-starter-cli
npm i tdesign-starter-cli@latest -g
## 2、创建项目
td-starter init
```
### 开发
``` bash
## 安装依赖
npm install
## 启动项目
npm run dev
```
### 构建
```bash
## 构建正式环境
npm run build
## 构建测试环境
npm run build:test
```
### 其他
```bash
## 预览构建产物
npm run preview
## 代码格式检查
npm run lint
## 代码格式检查与自动修复
npm run lint:fix
## style格式检查
npm run stylelint
## style格式检查与自动修复
npm run stylelint:fix
```
### 如何贡献
非常欢迎您的贡献!提交您的 [Issue](https://github.com/tencent/tdesign-vue-next-starter/issues/new/choose) 或者提交 [Pull Request](https://github.com/Tencent/tdesign-vue-next-starter/pulls)。
#### 贡献提交规范
- [Angular Convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)
- [Vue Style Guide](https://v3.vuejs.org/style-guide/#rule-categories)
### 兼容性
| [<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 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |
### 社区版本
基于 TDesign Vue Next 的 starter-kit 有多种社区版本,访问 [社区链接](https://tdesign.tencent.com/starter/docs/vue-next/community-link) 可以访问更多版本。
如果您也开发了 TDesign Starter 的社区版本,可以提交 Issue 或者直接给我们提Pull Request 😊。
### 开源协议
TDesign 遵循 [MIT 协议](https://github.com/Tencent/tdesign-vue-next-starter/LICENSE)。

94
README.md Normal file
View File

@ -0,0 +1,94 @@
<p style="display:flex; justify-content: center">
</p>
<p align="center">
<a href="https://tdesign.tencent.com/starter/vue-next/#/dashboard/base" target="_blank">
<img alt="TDesign Logo" width="200" src="https://tdesign.gtimg.com/starter/brand-logo.svg">
</a>
</p>
<p align="center">
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatility"></a>
<a href="https://github.com/Tencent/tdesign-vue-next/blob/develop/LICENSE">
<img src="https://img.shields.io/npm/l/tdesign-vue-next.svg?sanitize=true" alt="License">
</a>
</p>
English | [简体中文](./README-zh_CN.md)
### Introduction
TDesign Vue Next Starter is a TDesign-based developed with `Vue 3`, `Vite`, `Pinia`, `TypeScript`. It can be customized theme configuration, and aims to provide project out-of-the-box, configuration-style middle and background projects.
<p>
<a href="http://tdesign.tencent.com/starter/vue-next/">Live Preview</a>
·
<a href="https://tdesign.tencent.com/starter/">Documentation</a>
</p>
<img src="docs/starter.png">
### Features
- Various provided pages for develop
- Complete directory structure for develop
- Code specification configuration
- Support dark mode
- Custom theme colors
- Various space layouts
- Mock data scheme
### Usage
> Initialize project with our CLI tool `tdesign-starter-cli`
```bash
## install tdesign-starter-cli
npm i tdesign-starter-cli@latest -g
## create project
td-starter init
```
### Develop
```bash
## install dependencies
npm install
## set up
npm run dev
```
### Build
```bash
## build
npm run build
## build for test
npm run build:test
```
### Contributing Guide
We welcome contributions to our project. Create your [Issue](https://github.com/tencent/tdesign-vue-next-starter/issues/new/choose) or Submit your [Pull Request](https://github.com/Tencent/tdesign-vue-next-starter/pulls).
#### Commit Specification
- [Angular Convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)
- [Vue Style Guide](https://v3.vuejs.org/style-guide/#rule-categories)
### Browser Support
| [<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 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |
### Community Versions
There are kinds of community versions of starter-kit based on TDesign Vue Next, visit [community-link](https://tdesign.tencent.com/starter/docs/vue-next/community-link) for more detail. If you developed a community versions of tdesign starter, please create a issue or submit a pull request to let us know 😊.
### License
The MIT License. Please see [the license file](LICENSE) for more information.

11
commitlint.config.js Normal file
View File

@ -0,0 +1,11 @@
// commit-lint config
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'types'],
],
},
};

BIN
docs/starter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

25
index.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TDesign Vue Next Starter</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script language="javascript">
if (window.location.host === 'tdesign.tencent.com') {
const aegis = new Aegis({
id: 'rDISNMyXgqWDFPyHMB', // 项目ID即上报key
reportAssetSpeed: true, // 静态资源测速
});
}
</script>
</body>
<script>
window.global = window;
</script>
</html>

368
mock/index.ts Normal file
View File

@ -0,0 +1,368 @@
import Mock from 'mockjs';
import { MockMethod } from 'vite-plugin-mock';
export default [
{
url: '/api/get-purchase-list',
method: 'get',
response: () => ({
code: 0,
data: {
...Mock.mock({
'list|1-100': [
{
index: /S20201228115950[0-9][0-9][0-9]/,
pdName: 'Macbook',
pdNum: 'p_tmp_60a637cd0d',
'purchaseNum|1-100': 100,
adminName: '财务部111',
updateTime: '2020-05-20@date("HH:mm:ss")',
pdType: '电子产品',
},
{
index: /S20201228115950[0-9][0-9][0-9]/,
pdName: 'Macbook',
pdNum: 'p_tmp_60a637cd0d',
'purchaseNum|1-100': 100,
adminName: '财务部',
updateTime: '2020-05-20@date("HH:mm:ss")',
},
],
}),
},
}),
},
{
url: '/api/get-list',
method: 'get',
response: () => ({
code: 0,
data: {
...Mock.mock({
'list|1-100': [
{
'index|+1': 1,
'status|1': '@natural(0, 4)',
no: 'BH00@natural(01, 100)',
name: '@city()办公用品采购项目',
'paymentType|1': '@natural(0, 1)',
'contractType|1': '@natural(0, 2)',
updateTime: '2020-05-30 @date("HH:mm:ss")',
amount: '@natural(10, 500),000,000',
adminName: '@cname()',
},
],
}),
},
}),
},
{
url: '/api/detail-basic',
method: 'get',
response: () => ({
code: 0,
data: {
...Mock.mock({
name: 'td_20023747',
loginType: 'Web',
currentRole: 'Admin',
rightsList: '通用权限',
userStatus: '启用',
language: '简体中文',
timeZone: '(GMT+08:00)中国时区—北京Asia/Beijing',
}),
},
}),
},
{
url: '/api/get-card-list',
method: 'get',
response: () => ({
code: 0,
data: {
...Mock.mock({
'list|48-50': [
{
'index|+1': 1,
isSetup: '@boolean',
'type|1': '@natural(1, 5)',
'banner|1': [
'https://tdesign.gtimg.com/starter/cloud-db.jpg',
'https://tdesign.gtimg.com/starter/cloud-server.jpg',
'https://tdesign.gtimg.com/starter/ssl.jpg',
'https://tdesign.gtimg.com/starter/t-sec.jpg',
'https://tdesign.gtimg.com/starter/face-recognition.jpg',
],
'name|1': ['人脸识别', 'SSL证书', 'CVM', '云数据库', 'T-Sec 云防火墙'],
'description|1': [
'基于腾讯优图强大的面部分析技术,提供包括人脸检测与分析、五官定位、人脸搜索、人脸比对、人脸',
'云硬盘为您提供用于CVM的持久性数据块级存储服务。云硬盘中的数据自动地可用区内以多副本冗',
'SSL证书又叫服务器证书腾讯云为您提供证书的一站式服务包括免费、付费证书的申请、管理及部',
'腾讯安全云防火墙产品是腾讯云安全团队结合云原生的优势自主研发的SaaS化防火墙产品无需客无需客无需客无需客无需客无需客无需客',
'云数据库MySQL为用户提供安全可靠性能卓越、易于维护的企业级云数据库服务。',
],
},
],
}),
},
}),
},
{
url: '/api/get-project-list',
method: 'get',
response: () => ({
code: 0,
data: {
...Mock.mock({
'list|1-50': [
{
'index|+1': 1,
adminPhone: '+86 13587609955',
updateTime: '2020-05-30 @date("HH:mm:ss")',
'adminName|1': ['顾娟 ', '常刚', '郑洋'],
'name|1': [
'沧州市办公用品采购项目',
'红河哈尼族彝族自治州办公用品采购项目 ',
'铜川市办公用品采购项目',
'陇南市办公用品采购项目 ',
'六安市办公用品采购项目 ',
],
},
],
}),
},
}),
},
{
url: '/api/post',
method: 'post',
timeout: 2000,
response: {
code: 0,
data: {
name: 'vben',
},
},
},
{
url: '/api/get-menu-list-i18n',
method: 'get',
timeout: 2000,
response: {
code: 0,
data: {
...Mock.mock({
list: [
{
path: '/list',
name: 'list',
component: 'LAYOUT',
redirect: '/list/base',
meta: {
title: {
zh_CN: '列表页',
en_US: 'List',
},
icon: 'view-list',
},
children: [
{
path: 'base',
name: 'ListBase',
component: '/list/base/index',
meta: {
title: {
zh_CN: '基础列表页',
en_US: 'Base List',
},
},
},
{
path: 'card',
name: 'ListCard',
component: '/list/card/index',
meta: {
title: {
zh_CN: '卡片列表页',
en_US: 'Card List',
},
},
},
{
path: 'filter',
name: 'ListFilter',
component: '/list/filter/index',
meta: {
title: {
zh_CN: '筛选列表页',
en_US: 'Filter List',
},
},
},
{
path: 'tree',
name: 'ListTree',
component: '/list/tree/index',
meta: {
title: {
zh_CN: '树状筛选列表页',
en_US: 'Tree List',
},
},
},
],
},
{
path: '/form',
name: 'form',
component: 'LAYOUT',
redirect: '/form/base',
meta: {
title: {
zh_CN: '表单页',
en_US: 'Form',
},
icon: 'edit-1',
},
children: [
{
path: 'base',
name: 'FormBase',
component: '/form/base/index',
meta: {
title: {
zh_CN: '基础表单页',
en_US: 'Base Form',
},
},
},
{
path: 'step',
name: 'FormStep',
component: '/form/step/index',
meta: {
title: {
zh_CN: '分步表单页',
en_US: 'Step Form',
},
},
},
],
},
{
path: '/detail',
name: 'detail',
component: 'LAYOUT',
redirect: '/detail/base',
meta: {
title: {
zh_CN: '详情页',
en_US: 'Detail',
},
icon: 'layers',
},
children: [
{
path: 'base',
name: 'DetailBase',
component: '/detail/base/index',
meta: {
title: {
zh_CN: '基础详情页',
en_US: 'Base Detail',
},
},
},
{
path: 'advanced',
name: 'DetailAdvanced',
component: '/detail/advanced/index',
meta: {
title: {
zh_CN: '多卡片详情页',
en_US: 'Card Detail',
},
},
},
{
path: 'deploy',
name: 'DetailDeploy',
component: '/detail/deploy/index',
meta: {
title: {
zh_CN: '数据详情页',
en_US: 'Data Detail',
},
},
},
{
path: 'secondary',
name: 'DetailSecondary',
component: '/detail/secondary/index',
meta: {
title: {
zh_CN: '二级详情页',
en_US: 'Secondary Detail',
},
},
},
],
},
{
path: '/frame',
name: 'Frame',
component: 'Layout',
redirect: '/frame/doc',
meta: {
icon: 'internet',
title: {
zh_CN: '外部页面',
en_US: 'External',
},
},
children: [
{
path: 'doc',
name: 'Doc',
component: 'IFrame',
meta: {
frameSrc: 'https://tdesign.tencent.com/starter/docs/vue-next/get-started',
title: {
zh_CN: '使用文档(内嵌)',
en_US: 'Documentation(IFrame)',
},
},
},
{
path: 'TDesign',
name: 'TDesign',
component: 'IFrame',
meta: {
frameSrc: 'https://tdesign.tencent.com/vue-next/getting-started',
title: {
zh_CN: 'TDesign 文档(内嵌)',
en_US: 'TDesign (IFrame)',
},
},
},
{
path: 'TDesign2',
name: 'TDesign2',
component: 'IFrame',
meta: {
frameSrc: 'https://tdesign.tencent.com/vue-next/getting-started',
frameBlank: true,
title: {
zh_CN: 'TDesign 文档(外链',
en_US: 'TDesign Doc(Link)',
},
},
},
],
},
],
}),
},
},
},
] as MockMethod[];

95
package.json Normal file
View File

@ -0,0 +1,95 @@
{
"name": "@tencent/tdesign-vue-next-starter",
"version": "0.9.0",
"scripts": {
"dev:mock": "vite --open --mode mock",
"dev": "vite --open --mode development",
"dev:linux": "vite --mode development",
"build:test": "vite build --mode test",
"build": "vue-tsc --noEmit && vite build --mode release",
"build:site": "vue-tsc --noEmit && vite build --mode site",
"preview": "vite preview",
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",
"stylelint": "stylelint src/**/*.{html,vue,sass,less}",
"stylelint:fix": "stylelint --fix src/**/*.{html,vue,css,sass,less}",
"prepare": "husky install",
"site:preview": "npm run build && cp -r dist _site",
"test": "echo \"no test specified,work in process\"",
"test:coverage": "echo \"no test:coverage specified,work in process\""
},
"dependencies": {
"@vueuse/core": "^10.6.1",
"axios": "^1.6.2",
"dayjs": "^1.11.10",
"echarts": "5.1.2",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"qrcode.vue": "^3.4.1",
"qs": "^6.11.2",
"tdesign-icons-vue-next": "^0.2.2",
"tdesign-vue-next": "^1.6.8",
"tvision-color": "^1.6.0",
"vue": "~3.3.8",
"vue-i18n": "^9.6.5",
"vue-router": "~4.2.4"
},
"devDependencies": {
"@commitlint/cli": "^18.4.1",
"@commitlint/config-conventional": "^18.4.0",
"@types/echarts": "^4.9.21",
"@types/lodash": "^4.14.201",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.10",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@vitejs/plugin-vue": "^4.4.1",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/compiler-sfc": "^3.3.8",
"@vue/eslint-config-typescript": "^12.0.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.53.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.18.1",
"eslint-plugin-vue-scoped-css": "^2.5.1",
"husky": "^8.0.3",
"less": "^4.2.0",
"lint-staged": "^15.1.0",
"mockjs": "^1.1.0",
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"prettier": "^3.1.0",
"stylelint": "~15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "~6.0.3",
"typescript": "~5.3.2",
"vite": "^4.5.0",
"vite-plugin-mock": "^3.0.0",
"vite-svg-loader": "^4.0.0",
"vue-tsc": "^1.8.22"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"lint-staged": {
"*.{js,jsx,vue,ts,tsx}": [
"prettier --write",
"npm run lint:fix"
],
"*.{html,vue,css,sass,less}": [
"npm run stylelint:fix"
]
},
"engines": {
"node": ">=16.0.0"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

24
src/App.vue Normal file
View File

@ -0,0 +1,24 @@
<template>
<t-config-provider :global-config="getComponentsLocale">
<router-view :key="locale" :class="[mode]" />
</t-config-provider>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { useLocale } from '@/locales/useLocale';
import { useSettingStore } from '@/store';
const store = useSettingStore();
const mode = computed(() => {
return store.displayMode;
});
const { getComponentsLocale, locale } = useLocale();
</script>
<style lang="less" scoped>
#nprogress .bar {
background: var(--td-brand-color) !important;
}
</style>

19
src/api/detail.ts Normal file
View File

@ -0,0 +1,19 @@
import type { ProjectListResult, PurchaseListResult } from '@/api/model/detailModel';
import { request } from '@/utils/request';
const Api = {
PurchaseList: '/get-purchase-list',
ProjectList: '/get-project-list',
};
export function getPurchaseList() {
return request.get<PurchaseListResult>({
url: Api.PurchaseList,
});
}
export function getProjectList() {
return request.get<ProjectListResult>({
url: Api.ProjectList,
});
}

19
src/api/list.ts Normal file
View File

@ -0,0 +1,19 @@
import type { CardListResult, ListResult } from '@/api/model/listModel';
import { request } from '@/utils/request';
const Api = {
BaseList: '/get-list',
CardList: '/get-card-list',
};
export function getList() {
return request.get<ListResult>({
url: Api.BaseList,
});
}
export function getCardList() {
return request.get<CardListResult>({
url: Api.CardList,
});
}

View File

@ -0,0 +1,23 @@
export interface PurchaseListResult {
list: Array<PurchaseInfo>;
}
export interface PurchaseInfo {
adminName: string;
index: string;
pdName: string;
pdNum: string;
pdType: string;
purchaseNum: number;
updateTime: Date;
}
export interface ProjectListResult {
list: Array<ProjectInfo>;
}
export interface ProjectInfo {
adminName: string;
adminPhone: string;
index: number;
name: string;
updateTime: Date;
}

View File

@ -0,0 +1,26 @@
export interface ListResult {
list: Array<ListModel>;
}
export interface ListModel {
adminName: string;
amount: string;
contractType: number;
index: number;
name: string;
no: string;
paymentType: number;
status: number;
updateTime: Date;
}
export interface CardListResult {
list: Array<CardList>;
}
export interface CardList {
banner: string;
description: string;
index: number;
isSetup: boolean;
name: string;
type: number;
}

View File

@ -0,0 +1,22 @@
import { defineComponent } from 'vue';
import { RouteMeta } from '@/types/interface';
export interface MenuListResult {
list: Array<RouteItem>;
}
export type Component<T = any> =
| ReturnType<typeof defineComponent>
| (() => Promise<typeof import('*.vue')>)
| (() => Promise<T>);
export interface RouteItem {
path: string;
name: string;
component?: Component | string;
components?: Component;
redirect?: string;
meta: RouteMeta;
children?: Array<RouteItem>;
}

12
src/api/permission.ts Normal file
View File

@ -0,0 +1,12 @@
import type { MenuListResult } from '@/api/model/permissionModel';
import { request } from '@/utils/request';
const Api = {
MenuList: '/get-menu-list-i18n',
};
export function getMenuList() {
return request.get<MenuListResult>({
url: Api.MenuList,
});
}

View File

@ -0,0 +1,6 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.9997 10.6904L58.2484 25.8451V48.1545L31.9997 63.3092L5.75098 48.1545V25.8451L31.9997 10.6904ZM9.75098 30.4639V45.8451L31.9997 58.6904L54.2484 45.8451V30.4639L31.9997 43.3092L9.75098 30.4639ZM52.2484 26.9998L40.6599 33.6904L31.9997 28.6904L23.3394 33.6904L11.751 26.9998L31.9997 15.3092L52.2484 26.9998ZM27.3394 35.9998L31.9997 38.6904L36.6599 35.9998L31.9997 33.3092L27.3394 35.9998Z" fill="currentcolor" fill-opacity="0.26"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 8V0H34V8H30Z" fill="currentcolor" fill-opacity="0.26"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.2676 10.7514L48.2676 3.82324L51.7317 5.82324L47.7317 12.7514L44.2676 10.7514Z" fill="currentcolor" fill-opacity="0.26"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.2676 12.7514L12.2676 5.82324L15.7317 3.82324L19.7317 10.7514L16.2676 12.7514Z" fill="currentcolor" fill-opacity="0.26"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

View File

@ -0,0 +1,39 @@
<svg width="1em" height="1em" viewBox="0 0 188 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M77.7301 8.34426H80.6699L78.3234 21.7922H75.3799L77.7301 8.34426Z" fill="currentcolor"/>
<path d="M78.5992 3.09961H81.6221L81.0742 6.12246H78.0513L78.5992 3.09961Z" fill="currentcolor"/>
<path d="M32.5765 6.46921H36.937L37.4131 3.82422H25.4615L24.9854 6.46921H29.3723L26.6706 21.7913H29.8559L32.5765 6.46921Z" fill="currentcolor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M51.4051 11.4275C51.5998 10.4187 51.7035 9.39434 51.7149 8.3669C51.7149 4.97375 50.007 3.8364 45.4765 3.84774H39.2381L36.083 21.8035H43.3908C48.1329 21.8035 49.8181 20.5906 50.8836 14.4504L51.4051 11.4275ZM45.0004 6.47006C47.5623 6.47006 48.5372 6.80258 48.5372 8.83922C48.5177 9.70444 48.4254 10.5665 48.2613 11.4162L47.7399 14.4391C47.0522 18.4481 46.3191 19.1585 42.7597 19.1585H39.7369L41.9473 6.47006H45.0004Z" fill="currentcolor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M63.863 10.8329C63.8629 11.1826 63.8313 11.5317 63.7685 11.8758L63.436 13.765C63.0582 15.8735 62.276 16.6103 60.3074 16.6103H55.0816L54.9607 17.3471C54.8956 17.6913 54.8564 18.0399 54.8436 18.39C54.8436 19.2175 55.2705 19.4102 56.6459 19.4102H61.4145L60.4396 21.8058H56.0754C52.9958 21.8058 51.9189 21.0199 51.9189 19.1004C51.9308 18.5439 51.9864 17.9893 52.0852 17.4416L53.011 12.1289C53.5777 8.85291 54.9531 8.19166 58.4407 8.19166H60.0542C62.5292 8.17654 63.863 8.83779 63.863 10.8329ZM60.9006 11.2599C60.9006 10.6893 60.5454 10.5457 59.4534 10.5457H57.7682C56.6762 10.5457 56.1547 10.6893 55.8789 12.1138L55.501 14.294H59.5327C59.6593 14.3151 59.7889 14.3081 59.9124 14.2735C60.036 14.239 60.1504 14.1778 60.2477 14.0942C60.345 14.0106 60.4228 13.9066 60.4755 13.7897C60.5283 13.6728 60.5547 13.5457 60.553 13.4174L60.8137 11.8758C60.8561 11.6728 60.8826 11.4669 60.893 11.2599H60.9006Z" fill="currentcolor"/>
<path d="M69.644 19.3964H64.0215L64.4485 21.8185H69.644C72.4477 21.8185 73.1543 21.486 73.5813 19.0186L73.842 17.5072C73.9744 16.8585 74.0527 16.2001 74.0762 15.5385C74.0762 14.1896 73.3885 13.7853 71.3028 13.7853H68.4575C67.9096 13.7853 67.7471 13.7361 67.7471 13.4301C67.754 13.2471 67.7768 13.065 67.8152 12.886L68.0079 11.8166C68.1741 10.8909 68.3366 10.7511 69.2624 10.7511H74.269L75.2627 8.35547H69.2624C66.5834 8.35547 65.873 8.6502 65.3969 11.3783L65.208 12.4477C65.073 13.0947 64.9933 13.752 64.9699 14.4125C64.9699 15.7652 65.6576 16.1695 67.7471 16.1695H70.4715C71.0194 16.1695 71.1856 16.2187 71.1856 16.5247C71.1769 16.7078 71.1529 16.8898 71.1139 17.0688L70.8985 18.3271C70.7322 19.2529 70.566 19.3964 69.644 19.3964Z" fill="currentcolor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M93.2642 13.8225C93.4341 12.9856 93.5377 12.1366 93.5741 11.2833C93.5741 9.00486 92.3158 8.17735 89.3194 8.16602H87.6833C83.7196 8.16602 82.843 9.03509 82.1553 12.8137L81.8001 14.7823C81.6298 15.6192 81.5262 16.4682 81.4902 17.3215C81.4902 19.5962 82.7372 20.4275 85.76 20.4275H89.1607L88.9945 21.3532C88.6393 23.439 88.2841 23.5826 86.4326 23.5826H81.5469L81.9739 26.0008H87.0976C89.8258 26.0008 91.2238 25.3585 91.7944 22.1354L93.2642 13.8225ZM90.3132 13.7961L89.5877 18.0432L86.4931 18.0318C84.9287 18.0318 84.43 17.8429 84.43 16.8227C84.475 16.1366 84.5697 15.4547 84.7133 14.7823L85.0723 12.8137C85.3784 11.0944 85.6618 10.5465 87.4641 10.5465H88.5335C90.0751 10.5465 90.5966 10.7392 90.5966 11.7557C90.5573 12.4423 90.4625 13.1247 90.3132 13.7961Z" fill="currentcolor"/>
<path d="M107.112 10.7615C107.059 11.7344 106.933 12.7019 106.735 13.6559L105.31 21.7911H102.37L103.818 13.6559C103.946 13.0334 104.026 12.4016 104.056 11.7666C104.056 10.9353 103.7 10.7691 102.586 10.7691H99.1208L97.2013 21.776H94.2578L96.6081 8.32812H103.13C106.183 8.34324 107.112 9.06872 107.112 10.7615Z" fill="currentcolor"/>
<path d="M112.333 21.9715H117.879C121.093 21.9715 122.473 21.5668 123.045 18.3532L123.473 15.9727C123.568 15.4728 123.783 14.0683 123.783 13.4017C123.783 11.6164 122.497 11.3307 120.474 11.3307H117.427C116.76 11.3307 116.427 11.2117 116.427 10.807C116.427 10.5928 116.498 10.1167 116.617 9.49773L116.903 8.02182C117.141 6.80777 117.332 6.56972 118.427 6.56972H124.211L125.306 3.95117H118.26C115.284 3.95117 114.356 4.61771 113.856 7.47431L113.404 9.99763C113.285 10.688 113.19 11.3069 113.19 11.8306C113.19 13.3303 113.832 14.0683 115.76 14.0683H119.307C120.164 14.0683 120.498 14.1159 120.498 14.6396C120.498 14.9015 120.45 15.4252 120.283 16.2583L120.045 17.4962C119.736 19.1625 119.498 19.3292 117.927 19.3292H111.856L112.333 21.9715Z" fill="currentcolor"/>
<path d="M130.124 10.8784H133.909L134.337 8.47411H130.552L131.266 4.47488H128.314L127.6 8.47411H125.815L125.41 10.8784H127.172L126.101 16.9487C125.958 17.7104 125.839 18.5436 125.839 19.1625C125.839 21.2574 127.172 21.9715 129.838 21.9715H131.576L132.599 19.5672H130.981C129.433 19.5672 128.838 19.5434 128.838 18.5912C128.838 18.2103 128.933 17.5914 129.052 16.9487L130.124 10.8784Z" fill="currentcolor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M136.155 8.47411H142.344C145.034 8.47411 146.081 9.21207 146.081 10.926C146.081 11.4973 145.915 12.4495 145.772 13.2589L144.248 21.9715H137.107C134.798 21.9715 134.084 21.1384 134.084 19.5672C134.084 18.9959 134.179 18.377 134.298 17.6628L134.441 16.8535C135.012 13.6636 136.059 13.4732 139.297 13.4732H142.868L142.939 13.0447C143.034 12.5448 143.106 12.1639 143.106 11.8306C143.106 11.1165 142.701 10.8784 141.344 10.8784H136.559L136.155 8.47411ZM137.059 18.8531C137.059 19.4244 137.297 19.5672 137.94 19.5672H141.796L142.463 15.7584H138.749C137.75 15.7584 137.512 15.9727 137.345 16.9487L137.154 18.0199C137.083 18.4008 137.059 18.6626 137.059 18.8531Z" fill="currentcolor"/>
<path d="M146.66 21.9715H149.636L151.231 12.9971C151.54 11.2117 151.897 10.926 153.611 10.926H155.778L156.801 8.47411H153.516C149.779 8.47411 148.922 9.14065 148.279 12.8304L146.66 21.9715Z" fill="currentcolor"/>
<path d="M165.098 10.8784H161.313L160.242 16.9487C160.123 17.5914 160.028 18.2103 160.028 18.5912C160.028 19.5434 160.623 19.5672 162.17 19.5672H163.789L162.765 21.9715H161.027C158.361 21.9715 157.028 21.2574 157.028 19.1625C157.028 18.5436 157.147 17.7104 157.29 16.9487L158.361 10.8784H156.6L157.004 8.47411H158.79L159.504 4.47488H162.456L161.742 8.47411H165.527L165.098 10.8784Z" fill="currentcolor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M173.343 8.30748H171.724C168.225 8.30748 166.844 8.97402 166.273 12.2591L165.345 17.5914C165.249 18.1627 165.178 18.7579 165.178 19.2578C165.178 21.186 166.273 21.9715 169.368 21.9715H173.748L174.724 19.5672H169.939C168.558 19.5672 168.13 19.3768 168.13 18.5436C168.13 18.2818 168.177 17.9009 168.249 17.4962L168.368 16.7582H173.605C175.581 16.7582 176.366 16.0203 176.747 13.9016L177.08 12.0211C177.152 11.6402 177.176 11.2593 177.176 10.9736C177.176 8.97402 175.843 8.30748 173.343 8.30748ZM174.129 12.0211L173.867 13.5684C173.772 14.1873 173.51 14.4492 172.843 14.4492H168.796L169.177 12.2591C169.439 10.8308 169.963 10.688 171.058 10.688H172.748C173.843 10.688 174.2 10.8308 174.2 11.4021C174.2 11.5688 174.176 11.7354 174.129 12.0211Z" fill="currentcolor"/>
<path d="M179.919 21.9715H176.943L178.562 12.8304C179.205 9.14065 180.062 8.47411 183.799 8.47411H187.084L186.06 10.926H183.894C182.18 10.926 181.823 11.2117 181.514 12.9971L179.919 21.9715Z" fill="currentcolor"/>
<path d="M5.21231 5.28999H0.481548C0.412498 5.29078 0.344103 5.27654 0.281107 5.24826C0.21811 5.21998 0.162019 5.17833 0.116725 5.12621C0.0714314 5.07408 0.0380182 5.01273 0.0188032 4.9464C-0.000411771 4.88008 -0.00496858 4.81036 0.00544886 4.7421L0.783833 0.377856C0.80328 0.271783 0.8593 0.175885 0.942146 0.106846C1.02499 0.0378082 1.12942 0 1.23726 0L6.14939 0L5.21231 5.28999Z" fill="#0064FF"/>
<path d="M8.52984 16.5117H3.22852L5.21226 5.29688H10.5136L8.52984 16.5117Z" fill="url(#paint0_linear_18110_34031)"/>
<path d="M7.20647 21.8093H2.85735C2.78839 21.8085 2.72041 21.7929 2.65803 21.7635C2.59565 21.7341 2.54035 21.6915 2.49589 21.6388C2.45142 21.5861 2.41884 21.5244 2.40036 21.458C2.38188 21.3916 2.37794 21.3219 2.38881 21.2538L3.23142 16.5117H8.52142L7.65235 21.4239C7.63472 21.53 7.58048 21.6267 7.49905 21.6971C7.41761 21.7675 7.3141 21.8072 7.20647 21.8093V21.8093Z" fill="#009BFF"/>
<path d="M20.0919 5.28999H5.21191L6.149 0H20.8476C20.9168 0.00013044 20.9851 0.0153276 21.0478 0.0445343C21.1105 0.0737409 21.166 0.116256 21.2106 0.169121C21.2552 0.221986 21.2878 0.283932 21.306 0.35065C21.3242 0.417368 21.3277 0.487255 21.3162 0.555449L20.5416 4.91213C20.5236 5.01823 20.4685 5.11448 20.3862 5.1837C20.3038 5.25293 20.1995 5.2906 20.0919 5.28999V5.28999Z" fill="url(#paint1_linear_18110_34031)"/>
<defs>
<linearGradient id="paint0_linear_18110_34031" x1="7.81543" y1="4.88815" x2="7.92589" y2="15.4398" gradientUnits="userSpaceOnUse">
<stop stop-color="#009BFF"/>
<stop offset="0.35" stop-color="#0081FE"/>
<stop offset="0.75" stop-color="#006AFD"/>
<stop offset="1" stop-color="#0062FD"/>
</linearGradient>
<linearGradient id="paint1_linear_18110_34031" x1="5.68577" y1="2.65136" x2="20.3785" y2="5.41299" gradientUnits="userSpaceOnUse">
<stop offset="0.03" stop-color="#E9FFFF"/>
<stop offset="0.17" stop-color="#C4FAC9"/>
<stop offset="0.33" stop-color="#A0F694"/>
<stop offset="0.48" stop-color="#82F269"/>
<stop offset="0.63" stop-color="#6AEF47"/>
<stop offset="0.76" stop-color="#5AED2F"/>
<stop offset="0.89" stop-color="#4FEB20"/>
<stop offset="1" stop-color="#4CEB1B"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -0,0 +1,7 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="49" height="49" rx="24.5" fill="#0052D9" stroke="none" />
<path
d="M23.9219 31H26.0859L22.0781 19.7266H19.8125L15.8125 31H17.8516L18.8203 28.1172H22.9688L23.9219 31ZM20.8359 21.875H20.9688L22.5 26.5234H19.2891L20.8359 21.875ZM30.6328 29.6172C29.7734 29.6172 29.1562 29.1875 29.1562 28.4688C29.1562 27.7734 29.6641 27.3828 30.75 27.3125L32.6797 27.1875V27.8672C32.6797 28.8594 31.8047 29.6172 30.6328 29.6172ZM30.0625 31.1406C31.1797 31.1406 32.1172 30.6562 32.5938 29.8281H32.7266V31H34.5938V25.1641C34.5938 23.3516 33.3594 22.2812 31.1641 22.2812C29.1328 22.2812 27.7188 23.2422 27.5625 24.75H29.3906C29.5703 24.1719 30.1797 23.8594 31.0703 23.8594C32.1172 23.8594 32.6797 24.3281 32.6797 25.1641V25.8828L30.4766 26.0156C28.3984 26.1406 27.2344 27.0312 27.2344 28.5781C27.2344 30.1406 28.4141 31.1406 30.0625 31.1406Z"
fill="white" />
</svg>

After

Width:  |  Height:  |  Size: 996 B

View File

@ -0,0 +1,7 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="49" height="49" rx="24.5" fill="#0594FA" stroke="none" />
<path
d="M20.6641 31C23.0703 31 24.5391 29.7734 24.5391 27.7969C24.5391 26.3281 23.4922 25.2344 21.9766 25.0938V24.9531C23.1094 24.7734 23.9844 23.7266 23.9844 22.5391C23.9844 20.8047 22.6953 19.7266 20.5547 19.7266H15.8438V31H20.6641ZM17.8594 21.3281H20.0625C21.2812 21.3281 21.9922 21.9062 21.9922 22.8984C21.9922 23.9141 21.2344 24.4688 19.8047 24.4688H17.8594V21.3281ZM17.8594 29.3984V25.9219H20.125C21.6641 25.9219 22.4766 26.5156 22.4766 27.6406C22.4766 28.7891 21.6875 29.3984 20.2031 29.3984H17.8594ZM31.2812 31.1406C33.4375 31.1406 34.7891 29.4453 34.7891 26.7266C34.7891 23.9922 33.4453 22.3125 31.2812 22.3125C30.1094 22.3125 29.125 22.8828 28.6797 23.8125H28.5469V19.1484H26.6094V31H28.4766V29.6484H28.6094C29.0938 30.5859 30.0859 31.1406 31.2812 31.1406ZM30.6719 23.9609C31.9922 23.9609 32.7969 25.0078 32.7969 26.7266C32.7969 28.4453 32 29.4922 30.6719 29.4922C29.3438 29.4922 28.5156 28.4297 28.5156 26.7266C28.5156 25.0234 29.3516 23.9609 30.6719 23.9609Z"
fill="white" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,7 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="49" height="49" rx="24.5" fill="#7587DB" stroke="none" />
<path
d="M21.1172 31.2812C23.7188 31.2812 25.625 29.7266 25.8906 27.4219H23.9062C23.6328 28.6875 22.5469 29.4844 21.1172 29.4844C19.1953 29.4844 18 27.9062 18 25.3594C18 22.8203 19.1953 21.2422 21.1094 21.2422C22.5312 21.2422 23.6172 22.1172 23.8984 23.4688H25.8828C25.6484 21.1172 23.6719 19.4453 21.1094 19.4453C17.9141 19.4453 15.9375 21.7031 15.9375 25.3672C15.9375 29.0156 17.9219 31.2812 21.1172 31.2812ZM35.3125 25.3281C35.1094 23.5312 33.7812 22.2812 31.5859 22.2812C29.0156 22.2812 27.5078 23.9297 27.5078 26.7031C27.5078 29.5156 29.0234 31.1719 31.5938 31.1719C33.7578 31.1719 35.1016 29.9688 35.3125 28.1797H33.4688C33.2656 29.0703 32.5938 29.5469 31.5859 29.5469C30.2656 29.5469 29.4688 28.5 29.4688 26.7031C29.4688 24.9297 30.2578 23.9062 31.5859 23.9062C32.6484 23.9062 33.2891 24.5 33.4688 25.3281H35.3125Z"
fill="white" />
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,7 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="49" height="49" rx="24.5" fill="#00A870" stroke="none" />
<path
d="M15.875 19.7266V31H20.1016C23.4766 31 25.4062 28.9297 25.4062 25.3125C25.4062 21.7734 23.4531 19.7266 20.1016 19.7266H15.875ZM17.8906 21.4688H19.8359C22.0469 21.4688 23.3516 22.8828 23.3516 25.3438C23.3516 27.8594 22.0781 29.2578 19.8359 29.2578H17.8906V21.4688ZM30.5938 31.1406C31.7812 31.1406 32.7656 30.5859 33.25 29.6484H33.3828V31H35.2578V19.1484H33.3203V23.8125H33.1875C32.7344 22.875 31.7656 22.3125 30.5938 22.3125C28.4375 22.3125 27.0781 24.0156 27.0781 26.7188C27.0781 29.4375 28.4297 31.1406 30.5938 31.1406ZM31.1953 23.9609C32.5234 23.9609 33.3438 25.0234 33.3438 26.7266C33.3438 28.4453 32.5312 29.4922 31.1953 29.4922C29.8672 29.4922 29.0625 28.4531 29.0625 26.7266C29.0625 25.0078 29.875 23.9609 31.1953 23.9609Z"
fill="white" />
</svg>

After

Width:  |  Height:  |  Size: 972 B

View File

@ -0,0 +1,32 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g mask="url(#mask0_17_619)">
<path d="M30 62H118V122H30V62Z" fill="#97A3B7" />
<g filter="url(#filter0_f_17_619)">
<rect x="12" y="84" width="80" height="60" fill="#E3E6EB" />
</g>
<g filter="url(#filter1_f_17_619)">
<rect x="80" y="54" width="80" height="60" fill="#E3E6EB" />
</g>
<rect x="46" y="105" width="32" height="2" fill="white" />
<rect x="46" y="98" width="32" height="2" fill="white" />
<rect x="46" y="88" width="16" height="2" fill="white" />
</g>
<path opacity="0.9" d="M63 20H151V30H63V20Z" fill="currentcolor" />
<mask id="mask1_17_619" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="63" y="30" width="88" height="50">
<path d="M63 30H151V80H63V30Z" fill="currentcolor" />
</mask>
<g mask="url(#mask1_17_619)">
<path d="M63 30H151V80H63V30Z" fill="currentcolor" />
<g opacity="0.3" filter="url(#filter2_f_17_619)">
<path d="M30 62H118V122H30V62Z" fill="#97A3B7" />
</g>
</g>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M95.6863 40.8577L105.964 51.1345C106.295 51.0466 106.642 50.9998 107 50.9998C109.213 50.9998 111 52.7865 111 54.9998C111 55.3574 110.953 55.7038 110.866 56.0333L121.142 66.3135L118.314 69.1419L113.716 64.5448C111.653 65.423 109.384 65.9089 107 65.9089C99.7273 65.9089 93.5164 61.3853 91 54.9998C92.1785 52.0093 94.1673 49.4271 96.6961 47.5268L92.8579 43.6861L95.6863 40.8577ZM99 54.9998C99 59.4158 102.584 62.9998 107 62.9998C108.483 62.9998 109.872 62.5957 111.063 61.8917L108.034 58.8657C107.704 58.9532 107.358 58.9998 107 58.9998C104.787 58.9998 103 57.2131 103 54.9998C103 54.6423 103.047 54.2958 103.134 53.9663L100.107 50.9389C99.4037 52.1295 99 53.5178 99 54.9998ZM107 44.0907C114.273 44.0907 120.484 48.6143 123 54.9998C122.071 57.3574 120.638 59.4612 118.834 61.1773L114.729 57.0717C114.906 56.4108 115 55.7162 115 54.9998C115 50.5838 111.416 46.9998 107 46.9998C106.284 46.9998 105.589 47.0941 104.928 47.2711L102.378 44.7205C103.848 44.3101 105.398 44.0907 107 44.0907Z"
fill="white" />
<rect x="68" y="24" width="2" height="2" fill="white" />
<rect x="74" y="24" width="2" height="2" fill="white" />
<rect x="80" y="24" width="66" height="2" fill="white" />
<path d="M157 53.9998L181.249 95.9998H132.751L157 53.9998Z" fill="white" stroke="black" />
<path d="M157 88.9998L157 70.9998" stroke="black" />
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,36 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g mask="url(#mask0_16559_24301)">
<path d="M30 62H118V122H30V62Z" fill="#97A3B7" />
<g filter="url(#filter0_f_16559_24301)">
<rect x="12" y="84" width="80" height="60" fill="#E3E6EB" />
</g>
<g filter="url(#filter1_f_16559_24301)">
<rect x="80" y="54" width="80" height="60" fill="#E3E6EB" />
</g>
<path d="M49 93L42 100L49 107" stroke="white" stroke-width="2" />
<path d="M69 107L76 100L69 93" stroke="white" stroke-width="2" />
<path d="M62.3647 87.4431L55.6355 112.557" stroke="white" stroke-width="2" />
</g>
<path opacity="0.9" d="M63 20H151V30H63V20Z" fill="currentcolor" />
<mask id="mask1_16559_24301" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="63" y="30" width="88" height="50">
<path d="M63 30H151V80H63V30Z" fill="currentcolor" />
</mask>
<g mask="url(#mask1_16559_24301)">
<path d="M63 30H151V80H63V30Z" fill="currentcolor" />
<g opacity="0.3" filter="url(#filter2_f_16559_24301)">
<path d="M30 62H118V122H30V62Z" fill="#97A3B7" />
</g>
</g>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M105.25 41C112.015 41 117.5 46.4845 117.5 53.25C117.5 55.6827 116.791 57.9498 115.568 59.8558L121 65.2877L117.288 69L111.856 63.5681C109.95 64.7909 107.683 65.5 105.25 65.5C98.4845 65.5 93 60.0155 93 53.25C93 46.4845 98.4845 41 105.25 41ZM105.25 44.5C100.418 44.5 96.5 48.4175 96.5 53.25C96.5 58.0825 100.418 62 105.25 62C110.082 62 114 58.0825 114 53.25C114 48.4175 110.082 44.5 105.25 44.5Z"
fill="white" />
<rect x="68" y="24" width="2" height="2" fill="white" />
<rect x="74" y="24" width="2" height="2" fill="white" />
<rect x="80" y="24" width="66" height="2" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd"
d="M153 56C140.85 56 131 65.8497 131 78C131 82.6039 132.414 86.8776 134.832 90.4102L127 98.5L139.495 95.3681C143.222 98.2709 147.909 100 153 100C165.15 100 175 90.1503 175 78C175 65.8497 165.15 56 153 56Z"
fill="white" />
<path
d="M131 78L131.5 78V78L131 78ZM134.832 90.4102L135.191 90.758L135.475 90.4647L135.245 90.1278L134.832 90.4102ZM127 98.5L126.641 98.1522L125.422 99.411L127.122 98.985L127 98.5ZM139.495 95.3681L139.802 94.9736L139.61 94.8238L139.373 94.8831L139.495 95.3681ZM153 100L153 100.5L153 100.5L153 100ZM175 78L174.5 78L174.5 78L175 78ZM131.5 78C131.5 66.1259 141.126 56.5 153 56.5V55.5C140.574 55.5 130.5 65.5736 130.5 78L131.5 78ZM135.245 90.1278C132.882 86.6757 131.5 82.5 131.5 78H130.5C130.5 82.7079 131.946 87.0794 134.419 90.6926L135.245 90.1278ZM134.473 90.0624L126.641 98.1522L127.359 98.8478L135.191 90.758L134.473 90.0624ZM127.122 98.985L139.616 95.8531L139.373 94.8831L126.878 98.015L127.122 98.985ZM153 99.5C148.024 99.5 143.445 97.8105 139.802 94.9736L139.187 95.7626C143 98.7314 147.794 100.5 153 100.5V99.5ZM174.5 78C174.5 89.8741 164.874 99.5 153 99.5L153 100.5C165.426 100.5 175.5 90.4264 175.5 78L174.5 78ZM153 56.5C164.874 56.5 174.5 66.1259 174.5 78H175.5C175.5 65.5736 165.426 55.5 153 55.5V56.5Z"
fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,52 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g mask="url(#mask0_16559_24251)">
<path d="M68 48L106.105 70V114L68 136L29.8949 114V70L68 48Z" fill="#97A3B7" />
<g filter="url(#filter0_f_16559_24251)">
<rect x="46.3911" y="92" width="80" height="60" fill="#E3E6EB" />
</g>
<g filter="url(#filter1_f_16559_24251)">
<rect y="23" width="80" height="60" fill="#E3E6EB" />
</g>
</g>
<mask id="mask1_16559_24251" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="80" y="9" width="78" height="88">
<path d="M119 9L157.105 31V75L119 97L80.8949 75V31L119 9Z" fill="currentcolor" />
</mask>
<g mask="url(#mask1_16559_24251)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M80.895 31V75L119 97L157.105 75V31L119 53L80.895 31Z"
fill="currentcolor" />
<path opacity="0.9" d="M119 -35L157.105 -13L157.105 31.5L119 53.5L80.8952 31.5L80.895 -13L119 -35Z"
fill="currentcolor" />
<g opacity="0.3" filter="url(#filter2_f_16559_24251)">
<path d="M68 48L106.105 70V114L68 136L29.8949 114V70L68 48Z" fill="#97A3B7" />
</g>
</g>
<path
d="M143 68.822L147.867 85.875L148 86.3405L148.469 86.2228L165.671 81.911L153.336 94.6522L152.999 95L153.336 95.3478L165.671 108.089L148.469 103.777L148 103.659L147.867 104.125L143 121.178L138.133 104.125L138 103.659L137.531 103.777L120.329 108.089L132.664 95.3478L133.001 95L132.664 94.6522L120.329 81.911L137.531 86.2228L138 86.3405L138.133 85.875L143 68.822Z"
fill="white" stroke="black" />
<path fill-rule="evenodd" clip-rule="evenodd"
d="M123.243 35.0821L126.071 33.4493L123.243 31.8164L120.414 33.4493L123.243 35.0821ZM119 32.6329L121.828 31L114.757 26.9179L111.929 28.5507L119 32.6329ZM127.485 35.8986C122.806 38.6001 115.194 38.6001 110.515 35.8986C105.835 33.197 105.835 28.803 110.515 26.1014C115.194 23.3999 122.806 23.3999 127.485 26.1014C132.165 28.803 132.165 33.197 127.485 35.8986ZM107.686 24.4686C101.438 28.0756 101.438 33.9244 107.686 37.5314C113.934 41.1384 124.066 41.1384 130.314 37.5314C136.562 33.9244 136.562 28.0756 130.314 24.4686C124.066 20.8616 113.934 20.8616 107.686 24.4686Z"
fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd"
d="M41.8989 86.2863L44.7272 87.9193L44.7275 94.4512L41.8992 92.8181L41.8989 86.2863ZM53.9194 93.2269L56.7477 94.86L56.7479 101.392L53.9196 99.7587L53.9194 93.2269ZM44.7281 107.515L41.8999 105.882L41.9 109.148L44.7283 110.781L44.7282 107.515L53.92 112.822L53.9201 116.088L56.7484 117.721L56.7483 114.455L53.9201 112.822L53.92 109.556L44.728 104.249L44.7281 107.515Z"
fill="white" />
<defs>
<filter id="filter0_f_16559_24251" x="-3.60889" y="42" width="180" height="160" filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="25" result="effect1_foregroundBlur_16559_24251" />
</filter>
<filter id="filter1_f_16559_24251" x="-50" y="-27" width="180" height="160" filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="25" result="effect1_foregroundBlur_16559_24251" />
</filter>
<filter id="filter2_f_16559_24251" x="23.895" y="42" width="88.21" height="100" filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="3" result="effect1_foregroundBlur_16559_24251" />
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,33 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g mask="url(#mask0_22_990)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M144.569 105.61L96.5692 133.322L48.5693 105.61V83.7121L96.569 55.9995L144.569 83.7122V105.61Z"
fill="#97A3B7" />
<g filter="url(#filter0_f_22_990)">
<rect x="-3" y="33.9995" width="80" height="60" fill="#E3E6EB" />
</g>
<g filter="url(#filter1_f_22_990)">
<rect x="97" y="97.9995" width="80" height="60" fill="#E3E6EB" />
</g>
</g>
<mask id="mask1_22_990" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="53" y="16" width="86" height="69">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M113.357 42.715L129.829 33.2059C128.859 32.4995 127.789 31.823 126.643 31.1615C121.268 28.0584 114.723 26.0153 107.758 25.023C103.549 19.4606 97.5775 16.1248 90.4344 16.1945C83.6788 16.2821 74.9482 21.9412 68.9271 30.5602C68.096 30.975 67.2847 31.4099 66.4949 31.8659C52.1168 40.1664 49.5542 52.6155 59.0218 61.9309C57.9871 56.1259 58.712 51.0657 62.1231 45.7161C62.0653 46.3482 61.9127 50.143 61.8906 50.7834C61.2209 69.6969 76.9107 84.8409 88.03 84.7113C96.4806 84.6119 103.595 79.6976 108.349 72.0797C114.563 70.8487 120.438 68.786 125.443 65.8968C138.919 58.1167 142.01 46.7146 134.547 37.629L117.948 47.2113C119.71 50.8655 117.997 55.034 112.87 57.9936C107.744 60.9532 100.523 61.9424 94.1928 60.9252C91.3499 60.4563 88.6706 59.5834 86.4524 58.3029L86.4042 58.275L113.357 42.715ZM78.6546 53.7727C72.5285 49.7965 72.9717 43.5469 79.8498 39.5762C86.7276 35.6056 97.5532 35.3496 104.441 38.8864L78.6546 53.7727ZM93.5561 18.1703C98.1657 18.1302 102.284 20.5752 105.496 24.7401C97.0486 23.8219 88.1122 24.4143 79.9732 26.5054C83.672 21.3809 88.444 18.2301 93.5561 18.1703ZM91.3238 81.6169C85.471 81.685 80.3525 77.691 76.9473 71.2848C85.7921 73.6267 95.8719 74.0599 105.374 72.6022C101.618 78.1222 96.6601 81.5531 91.3238 81.6169Z"
fill="currentcolor" />
</mask>
<g mask="url(#mask1_22_990)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M113.357 42.715L129.829 33.2059C128.859 32.4995 127.789 31.823 126.643 31.1615C121.268 28.0584 114.723 26.0153 107.758 25.023C103.549 19.4606 97.5775 16.1248 90.4344 16.1945C83.6788 16.2821 74.9482 21.9412 68.9271 30.5602C68.096 30.975 67.2847 31.4099 66.4949 31.8659C52.1168 40.1664 49.5542 52.6155 59.0218 61.9309C57.9871 56.1259 58.712 51.0657 62.1231 45.7161C62.0653 46.3482 61.9127 50.143 61.8906 50.7834C61.2209 69.6969 76.9107 84.8409 88.03 84.7113C96.4806 84.6119 103.595 79.6976 108.349 72.0797C114.563 70.8487 120.438 68.786 125.443 65.8968C138.919 58.1167 142.01 46.7146 134.547 37.629L117.948 47.2113C119.71 50.8655 117.997 55.034 112.87 57.9936C107.744 60.9532 100.523 61.9424 94.1928 60.9252C91.3499 60.4563 88.6706 59.5834 86.4524 58.3029L86.4042 58.275L113.357 42.715ZM78.6546 53.7727C72.5285 49.7965 72.9717 43.5469 79.8498 39.5762C86.7276 35.6056 97.5532 35.3496 104.441 38.8864L78.6546 53.7727ZM93.5561 18.1703C98.1657 18.1302 102.284 20.5752 105.496 24.7401C97.0486 23.8219 88.1122 24.4143 79.9732 26.5054C83.672 21.3809 88.444 18.2301 93.5561 18.1703ZM91.3238 81.6169C85.471 81.685 80.3525 77.691 76.9473 71.2848C85.7921 73.6267 95.8719 74.0599 105.374 72.6022C101.618 78.1222 96.6601 81.5531 91.3238 81.6169Z"
fill="currentcolor" />
<g opacity="0.3" filter="url(#filter2_f_22_990)">
<path d="M96.569 55.9995L144.569 83.7122V139.138L96.569 166.85L48.5692 139.138V83.7122L96.569 55.9995Z"
fill="#97A3B7" />
</g>
</g>
<ellipse cx="155" cy="78" rx="22" ry="22" transform="rotate(180 155 78)" fill="white" stroke="black" />
<path d="M155 83L155 65" stroke="black" />
<rect x="155" y="87" width="0.00390625" height="0.00390625" fill="#C4C4C4" stroke="black" stroke-width="2"
stroke-linejoin="round" />
<path d="M96.5693 112L96.5693 87.9995" stroke="white" stroke-width="2" />
<path d="M86.5693 97.9995L96.5693 87.9995L106.569 97.9995" stroke="white" stroke-width="2" />
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,49 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_216_313" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="80" y="9" width="78" height="88">
<path d="M119 9L157.105 31V75L119 97L80.8949 75V31L119 9Z" fill="currentColor"/>
</mask>
<g mask="url(#mask0_216_313)">
<path d="M119 9L157.105 31V75L119 97L80.8949 75V31L119 9Z" fill="currentColor"/>
<g opacity="0.3" filter="url(#filter0_f_216_313)">
<path d="M68 48L106.105 70V114L68 136L29.8949 114V70L68 48Z" fill="#97A3B7"/>
</g>
</g>
<mask id="mask1_216_313" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="29" y="48" width="78" height="88">
<path d="M68 48L106.105 70V114L68 136L29.8949 114V70L68 48Z" fill="#97A3B7"/>
</mask>
<g mask="url(#mask1_216_313)">
<path d="M68 48L106.105 70V114L68 136L29.8949 114V70L68 48Z" fill="#97A3B7"/>
<g filter="url(#filter1_f_216_313)">
<rect x="46.3906" y="92" width="80" height="60" fill="#E3E6EB"/>
</g>
<g filter="url(#filter2_f_216_313)">
<rect y="23" width="80" height="60" fill="#E3E6EB"/>
</g>
</g>
<path d="M41.8984 86.2866L44.7267 87.9197L44.727 94.4515L41.8987 92.8185L41.8984 86.2866Z" fill="white"/>
<path d="M53.9189 93.2273L56.7472 94.8603L56.7474 101.392L53.9191 99.7591L53.9189 93.2273Z" fill="white"/>
<path d="M44.7276 107.515L41.8994 105.882L41.8995 109.148L44.7278 110.781L44.7276 107.515L53.9195 112.823L53.9196 116.088L56.7479 117.721L56.7478 114.455L53.9195 112.823L53.9195 109.557L44.7275 104.249L44.7276 107.515Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M108.348 23.4792C106.188 25.9904 106.535 29.3829 109.395 31.5604C112.66 34.0461 117.963 34.007 121.24 31.4731C124.516 28.9392 124.526 24.8699 121.261 22.3841C118.401 20.2066 113.977 19.9666 110.721 21.6439L115.923 25.6047L113.55 27.4399L108.348 23.4792Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M120.865 33.0087L129.83 39.8346L132.203 37.9994L123.238 31.1735C122.917 31.521 122.554 31.8531 122.149 32.1657C121.745 32.4784 121.315 32.7594 120.865 33.0087ZM119.662 32.0932C120.123 31.8557 120.561 31.5798 120.967 31.2655C121.373 30.9513 121.73 30.6134 122.035 30.2579L122.035 30.2579C121.73 30.6134 121.373 30.9513 120.967 31.2655C120.561 31.5798 120.123 31.8557 119.662 32.0931L119.662 32.0932Z" fill="white"/>
<path d="M144 70L168.249 112H119.751L144 70Z" fill="white" stroke="#181818"/>
<path d="M144 100L144 82" stroke="#181818"/>
<path d="M144 105H144.004V105.004H144V105Z" stroke="#181818" stroke-width="2" stroke-linejoin="round"/>
<defs>
<filter id="filter0_f_216_313" x="23.8949" y="42" width="88.2102" height="100" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="3" result="effect1_foregroundBlur_216_313"/>
</filter>
<filter id="filter1_f_216_313" x="-3.60938" y="42" width="180" height="160" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="25" result="effect1_foregroundBlur_216_313"/>
</filter>
<filter id="filter2_f_216_313" x="-50" y="-27" width="180" height="160" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="25" result="effect1_foregroundBlur_216_313"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,23 @@
<svg width="200" height="140" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<g mask="url(#mask0_21_716)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M33 46.843L96.3214 119L159.643 46.843C142.742 31.9998 120.583 23 96.3214 23C72.0601 23 49.9009 31.9998 33 46.843Z"
fill="#97A3B7" />
<g filter="url(#filter0_f_21_716)">
<rect x="95" y="21" width="80" height="60" fill="#E3E6EB" />
</g>
<g filter="url(#filter1_f_21_716)">
<rect x="-7" y="43" width="80" height="60" fill="#E3E6EB" />
</g>
</g>
<path
d="M72.8122 63.6882L69.6548 66.8455L75.9009 73.0916C71.2469 75.1648 66.9663 77.925 63.188 81.2433L96.3213 119L108.234 105.425L114.647 111.837L117.804 108.68L80.4504 71.3261C80.4505 71.3261 80.4503 71.3261 80.4504 71.3261L72.8122 63.6882Z"
fill="currentcolor" />
<path
d="M129.455 81.2433L114.137 98.6982L85.3974 69.9585C88.9142 69.1786 92.5697 68.7674 96.3213 68.7674C109.016 68.7674 120.611 73.4766 129.455 81.2433Z"
fill="currentcolor" />
<path
d="M152 21.822L156.867 38.875L157 39.3405L157.469 39.2228L174.671 34.911L162.336 47.6522L161.999 48L162.336 48.3478L174.671 61.089L157.469 56.7772L157 56.6595L156.867 57.125L152 74.178L147.133 57.125L147 56.6595L146.531 56.7772L129.329 61.089L141.664 48.3478L142.001 48L141.664 47.6522L129.329 34.911L146.531 39.2228L147 39.3405L147.133 38.875L152 21.822Z"
fill="white" stroke="black" />
<path d="M101 31L90 42L101 53L93 61" stroke="white" stroke-width="2" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,13 @@
<svg width="88" height="48" viewBox="0 0 88 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0H88V48H0V0Z" fill="var(--td-component-border)"/>
<path d="M42.8627 14.0518V16.7601H44.4877V14.0518H42.8627Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.3488 23.9824C38.3488 21.0407 40.7335 18.656 43.6752 18.656C46.6168 18.656 49.0015 21.0407 49.0015 23.9824C49.0015 26.9241 46.6168 29.3088 43.6752 29.3088C40.7335 29.3088 38.3488 26.9241 38.3488 23.9824ZM43.6752 20.281C41.6309 20.281 39.9738 21.9382 39.9738 23.9824C39.9738 26.0266 41.6309 27.6838 43.6752 27.6838C45.7194 27.6838 47.3766 26.0266 47.3766 23.9824C47.3766 21.9382 45.7194 20.281 43.6752 20.281Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M52.208 26.781H49.5867L47.5262 33.48L49.0794 33.9577L49.5903 32.2968H52.2045L52.7154 33.9577L54.2686 33.48L52.208 26.781ZM51.7047 30.6718L51.0077 28.406H50.787L50.0901 30.6718H51.7047Z" fill="var(--td-text-color-primary)"/>
<path d="M48.2077 18.3009L50.1225 16.3861L51.2715 17.5351L49.3567 19.4499L48.2077 18.3009Z" fill="var(--td-text-color-primary)"/>
<path d="M53.6057 23.1699H50.8974V24.7949H53.6057V23.1699Z" fill="var(--td-text-color-primary)"/>
<path d="M44.4877 31.2045V33.9129H42.8627V31.2045H44.4877Z" fill="var(--td-text-color-primary)"/>
<path d="M37.2279 31.5786L39.1427 29.6638L37.9936 28.5147L36.0788 30.4295L37.2279 31.5786Z" fill="var(--td-text-color-primary)"/>
<path d="M36.453 24.7949H33.7446V23.1699H36.453V24.7949Z" fill="var(--td-text-color-primary)"/>
<path d="M36.0788 17.5351L37.9936 19.4499L39.1427 18.3009L37.2279 16.3861L36.0788 17.5351Z" fill="var(--td-text-color-primary)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,5 @@
<svg width="88" height="48" viewBox="0 0 88 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0H88V48H0V0Z" fill="#13161B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M52.5327 26.8699C52.0346 26.9554 51.5225 26.9999 51 26.9999C46.0294 26.9999 42 22.9705 42 17.9999C42 16.9964 42.1642 16.0313 42.4673 15.1299C38.2268 15.8574 35 19.5518 35 23.9999C35 28.9705 39.0294 32.9999 44 32.9999C47.9671 32.9999 51.3346 30.4332 52.5327 26.8699Z" fill="#949EAA"/>
</svg>

After

Width:  |  Height:  |  Size: 495 B

View File

@ -0,0 +1,13 @@
<svg width="88" height="48" viewBox="0 0 88 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="88" height="48" fill="var(--td-component-border)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.9999 20.583C42.1129 20.583 40.5832 22.1127 40.5832 23.9997C40.5832 25.8867 42.1129 27.4163 43.9999 27.4163C45.8869 27.4163 47.4166 25.8867 47.4166 23.9997C47.4166 22.1127 45.8869 20.583 43.9999 20.583ZM39.0832 23.9997C39.0832 21.2843 41.2845 19.083 43.9999 19.083C46.7153 19.083 48.9166 21.2843 48.9166 23.9997C48.9166 26.7151 46.7153 28.9163 43.9999 28.9163C41.2845 28.9163 39.0832 26.7151 39.0832 23.9997Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.2499 17.333V14.833H44.7499V17.333H43.2499Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.1838 18.7552L49.9513 16.9877L51.0119 18.0483L49.2444 19.8158L48.1838 18.7552Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M50.6666 23.2497H53.1666V24.7497H50.6666V23.2497Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M49.2444 28.1835L51.0119 29.951L49.9513 31.0117L48.1838 29.2442L49.2444 28.1835Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.7499 30.6663V33.1663H43.2499V30.6663H44.7499Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.8162 29.2442L38.0487 31.0117L36.988 29.951L38.7555 28.1835L39.8162 29.2442Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M37.3333 24.7497H34.8333V23.2497H37.3333V24.7497Z" fill="var(--td-text-color-primary)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.7555 19.8158L36.988 18.0483L38.0487 16.9877L39.8162 18.7552L38.7555 19.8158Z" fill="var(--td-text-color-primary)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,41 @@
<svg width="1em" height="1em" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2557_23660)">
<path d="M9.14038 8.25177H3.53919C3.45719 8.25173 3.37619 8.23372 3.30188 8.19901C3.22758 8.16431 3.16179 8.11375 3.10912 8.05089C3.05646 7.98803 3.01819 7.91439 2.99703 7.83516C2.97587 7.75593 2.97234 7.67303 2.98665 7.59228L3.87785 2.44561C3.90079 2.32052 3.96685 2.20742 4.06455 2.12601C4.16225 2.04459 4.2854 2.00001 4.41258 2.00001H10.2054L9.14038 8.25177Z" fill="url(#paint0_linear_2557_23660)"/>
<path d="M13.0301 21.4727H6.77832L9.11772 8.2473H15.3695L13.0301 21.4727Z" fill="url(#paint1_linear_2557_23660)"/>
<path d="M11.4707 27.7245H6.34183C6.26051 27.7236 6.18034 27.7051 6.10678 27.6704C6.03322 27.6358 5.96801 27.5856 5.91557 27.5235C5.86313 27.4613 5.82471 27.3886 5.80292 27.3102C5.78113 27.2319 5.77648 27.1497 5.78929 27.0694L6.78297 21.4861H13.0214L11.9965 27.2789C11.9738 27.4025 11.9091 27.5144 11.8132 27.5956C11.7174 27.6769 11.5963 27.7224 11.4707 27.7245Z" fill="url(#paint2_linear_2557_23660)"/>
<path d="M26.666 8.25176H9.14062L10.2457 2.01337H27.5795C27.6613 2.01417 27.7419 2.03268 27.8158 2.06763C27.8898 2.10258 27.9552 2.15313 28.0077 2.21581C28.0603 2.27849 28.0986 2.35179 28.12 2.43069C28.1415 2.50959 28.1456 2.59221 28.1321 2.67285L27.2186 7.81953C27.1941 7.94607 27.1246 8.0595 27.0231 8.13892C26.9216 8.21834 26.7948 8.25841 26.666 8.25176V8.25176Z" fill="url(#paint3_linear_2557_23660)"/>
</g>
<defs>
<linearGradient id="paint0_linear_2557_23660" x1="2.71742" y1="5.12812" x2="10.0624" y2="4.98122" gradientUnits="userSpaceOnUse">
<stop stop-color="#0062FF"/>
<stop offset="0.26" stop-color="#006AFF"/>
<stop offset="0.68" stop-color="#0081FF"/>
<stop offset="1" stop-color="#0097FF"/>
</linearGradient>
<linearGradient id="paint1_linear_2557_23660" x1="12.383" y1="7.62346" x2="9.12269" y2="22.0419" gradientUnits="userSpaceOnUse">
<stop stop-color="#0097FF"/>
<stop offset="0.32" stop-color="#0081FF"/>
<stop offset="0.74" stop-color="#006AFF"/>
<stop offset="1" stop-color="#0062FF"/>
</linearGradient>
<linearGradient id="paint2_linear_2557_23660" x1="5.63057" y1="27.3635" x2="12.8582" y2="21.4727" gradientUnits="userSpaceOnUse">
<stop stop-color="#009EFF"/>
<stop offset="0.31" stop-color="#00A3FF"/>
<stop offset="0.71" stop-color="#00B3FF"/>
<stop offset="1" stop-color="#00C3FF"/>
</linearGradient>
<linearGradient id="paint3_linear_2557_23660" x1="8.84911" y1="5.12811" x2="27.9399" y2="4.74629" gradientUnits="userSpaceOnUse">
<stop offset="0.03" stop-color="#ECFFFE"/>
<stop offset="0.19" stop-color="#AFF1D9"/>
<stop offset="0.34" stop-color="#79E5B9"/>
<stop offset="0.49" stop-color="#4EDB9F"/>
<stop offset="0.63" stop-color="#2CD48A"/>
<stop offset="0.77" stop-color="#14CE7C"/>
<stop offset="0.89" stop-color="#05CB73"/>
<stop offset="1" stop-color="#00CA70"/>
</linearGradient>
<clipPath id="clip0_2557_23660">
<rect width="25.1407" height="25.72" fill="white" transform="translate(2.97754 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,33 @@
<template>
<div :style="style" class="color-container" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { DEFAULT_COLOR_OPTIONS } from '@/config/color';
const panelColor =
'conic-gradient(from 90deg at 50% 50%, #FF0000 -19.41deg, #FF0000 18.76deg, #FF8A00 59.32deg, #FFE600 99.87deg, #14FF00 141.65deg, #00A3FF 177.72deg, #0500FF 220.23deg, #AD00FF 260.13deg, #FF00C7 300.69deg, #FF0000 340.59deg, #FF0000 378.76deg)';
const props = defineProps({
value: {
type: String,
},
});
const style = computed(() => {
const { value } = props;
return {
background: DEFAULT_COLOR_OPTIONS.indexOf(value) > -1 ? value : panelColor,
};
});
</script>
<style lang="less" scoped>
.color-container {
width: 24px;
height: 24px;
border-radius: var(--td-radius-circle);
display: inline-block;
}
</style>

View File

@ -0,0 +1,338 @@
<template>
<div class="list-common-table">
<t-form ref="form" :data="formData" :label-width="80" colon @reset="onReset" @submit="onSubmit">
<t-row>
<t-col :span="10">
<t-row :gutter="[24, 24]">
<t-col :span="4">
<t-form-item :label="$t('components.commonTable.contractName')" name="name">
<t-input
v-model="formData.name"
class="form-item-content"
type="search"
:placeholder="$t('components.commonTable.contractNamePlaceholder')"
:style="{ minWidth: '134px' }"
/>
</t-form-item>
</t-col>
<t-col :span="4">
<t-form-item :label="$t('components.commonTable.contractStatus')" name="status">
<t-select
v-model="formData.status"
class="form-item-content"
:options="CONTRACT_STATUS_OPTIONS"
:placeholder="$t('components.commonTable.contractStatusPlaceholder')"
clearable
/>
</t-form-item>
</t-col>
<t-col :span="4">
<t-form-item :label="$t('components.commonTable.contractNum')" name="no">
<t-input
v-model="formData.no"
class="form-item-content"
:placeholder="$t('components.commonTable.contractNumPlaceholder')"
:style="{ minWidth: '134px' }"
/>
</t-form-item>
</t-col>
<t-col :span="4">
<t-form-item :label="$t('components.commonTable.contractType')" name="type">
<t-select
v-model="formData.type"
style="display: inline-block"
class="form-item-content"
:options="CONTRACT_TYPE_OPTIONS"
:placeholder="$t('components.commonTable.contractTypePlaceholder')"
clearable
/>
</t-form-item>
</t-col>
</t-row>
</t-col>
<t-col :span="2" class="operation-container">
<t-button theme="primary" type="submit" :style="{ marginLeft: 'var(--td-comp-margin-s)' }">
{{ $t('components.commonTable.query') }}
</t-button>
<t-button type="reset" variant="base" theme="default"> {{ $t('components.commonTable.reset') }} </t-button>
</t-col>
</t-row>
</t-form>
<div class="table-container">
<t-table
:data="data"
:columns="COLUMNS"
:row-key="rowKey"
:vertical-align="verticalAlign"
:hover="hover"
:pagination="pagination"
:loading="dataLoading"
:header-affixed-top="headerAffixedTop"
@page-change="rehandlePageChange"
@change="rehandleChange"
>
<template #status="{ row }">
<t-tag v-if="row.status === CONTRACT_STATUS.FAIL" theme="danger" variant="light">
{{ $t('components.commonTable.contractStatusEnum.fail') }}
</t-tag>
<t-tag v-if="row.status === CONTRACT_STATUS.AUDIT_PENDING" theme="warning" variant="light">
{{ $t('components.commonTable.contractStatusEnum.audit') }}
</t-tag>
<t-tag v-if="row.status === CONTRACT_STATUS.EXEC_PENDING" theme="warning" variant="light">
{{ $t('components.commonTable.contractStatusEnum.pending') }}
</t-tag>
<t-tag v-if="row.status === CONTRACT_STATUS.EXECUTING" theme="success" variant="light">
{{ $t('components.commonTable.contractStatusEnum.executing') }}
</t-tag>
<t-tag v-if="row.status === CONTRACT_STATUS.FINISH" theme="success" variant="light">
{{ $t('components.commonTable.contractStatusEnum.finish') }}
</t-tag>
</template>
<template #contractType="{ row }">
<p v-if="row.contractType === CONTRACT_TYPES.MAIN">{{ $t('pages.listBase.contractStatusEnum.fail') }}</p>
<p v-if="row.contractType === CONTRACT_TYPES.SUB">{{ $t('pages.listBase.contractStatusEnum.audit') }}</p>
<p v-if="row.contractType === CONTRACT_TYPES.SUPPLEMENT">
{{ $t('pages.listBase.contractStatusEnum.pending') }}
</p>
</template>
<template #paymentType="{ row }">
<div v-if="row.paymentType === CONTRACT_PAYMENT_TYPES.PAYMENT" class="payment-col">
{{ $t('pages.listBase.pay') }}<trend class="dashboard-item-trend" type="up" />
</div>
<div v-if="row.paymentType === CONTRACT_PAYMENT_TYPES.RECEIPT" class="payment-col">
{{ $t('pages.listBase.receive') }}<trend class="dashboard-item-trend" type="down" />
</div>
</template>
<template #op="slotProps">
<t-space>
<t-link theme="primary" @click="handleClickDetail()"> {{ $t('pages.listBase.detail') }}</t-link>
<t-link theme="danger" @click="handleClickDelete(slotProps)"> {{ $t('pages.listBase.delete') }}</t-link>
</t-space>
</template>
</t-table>
<t-dialog
v-model:visible="confirmVisible"
header="确认删除当前所选合同?"
:body="confirmBody"
:on-cancel="onCancel"
@confirm="onConfirmDelete"
/>
</div>
</div>
</template>
<script setup lang="ts">
import { MessagePlugin, PageInfo, PrimaryTableCol, TableRowData } from 'tdesign-vue-next';
import { computed, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import { getList } from '@/api/list';
import Trend from '@/components/trend/index.vue';
import { prefix } from '@/config/global';
import { CONTRACT_PAYMENT_TYPES, CONTRACT_STATUS, CONTRACT_TYPES } from '@/constants';
import { t } from '@/locales';
import { useSettingStore } from '@/store';
interface FormData {
name: string;
no: string;
status?: number;
type: string;
}
const store = useSettingStore();
const router = useRouter();
const CONTRACT_STATUS_OPTIONS = [
{ value: CONTRACT_STATUS.FAIL, label: t('components.commonTable.contractStatusEnum.fail') },
{ value: CONTRACT_STATUS.AUDIT_PENDING, label: t('components.commonTable.contractStatusEnum.audit') },
{ value: CONTRACT_STATUS.EXEC_PENDING, label: t('components.commonTable.contractStatusEnum.pending') },
{ value: CONTRACT_STATUS.EXECUTING, label: t('components.commonTable.contractStatusEnum.executing') },
{ value: CONTRACT_STATUS.FINISH, label: t('components.commonTable.contractStatusEnum.finish') },
];
const CONTRACT_TYPE_OPTIONS = [
{ value: CONTRACT_TYPES.MAIN, label: t('components.commonTable.contractTypeEnum.main') },
{ value: CONTRACT_TYPES.SUB, label: t('components.commonTable.contractTypeEnum.sub') },
{ value: CONTRACT_TYPES.SUPPLEMENT, label: t('components.commonTable.contractTypeEnum.supplement') },
];
const COLUMNS: PrimaryTableCol[] = [
{
title: t('components.commonTable.contractName'),
fixed: 'left',
width: 280,
ellipsis: true,
align: 'left',
colKey: 'name',
},
{ title: t('components.commonTable.contractStatus'), colKey: 'status', width: 160 },
{
title: t('components.commonTable.contractNum'),
width: 160,
ellipsis: true,
colKey: 'no',
},
{
title: t('components.commonTable.contractType'),
width: 160,
ellipsis: true,
colKey: 'contractType',
},
{
title: t('components.commonTable.contractPayType'),
width: 160,
ellipsis: true,
colKey: 'paymentType',
},
{
title: t('components.commonTable.contractAmount'),
width: 160,
ellipsis: true,
colKey: 'amount',
},
{
align: 'left',
fixed: 'right',
width: 160,
colKey: 'op',
title: t('components.commonTable.operation'),
},
];
const searchForm = {
name: '',
no: '',
type: '',
};
const formData = ref<FormData>({ ...searchForm });
const rowKey = 'index';
const verticalAlign = 'top' as const;
const hover = true;
const pagination = ref({
defaultPageSize: 20,
total: 100,
defaultCurrent: 1,
});
const confirmVisible = ref(false);
const data = ref([]);
const dataLoading = ref(false);
const fetchData = async () => {
dataLoading.value = true;
try {
const { list } = await getList();
data.value = list;
pagination.value = {
...pagination.value,
total: list.length,
};
} catch (e) {
console.log(e);
} finally {
dataLoading.value = false;
}
};
const deleteIdx = ref(-1);
const confirmBody = computed(() => {
if (deleteIdx.value > -1) {
const { name } = data.value[deleteIdx.value];
return `删除后,${name}的所有合同信息将被清空,且无法恢复`;
}
return '';
});
const resetIdx = () => {
deleteIdx.value = -1;
};
const onConfirmDelete = () => {
//
data.value.splice(deleteIdx.value, 1);
pagination.value.total = data.value.length;
confirmVisible.value = false;
MessagePlugin.success('删除成功');
resetIdx();
};
const onCancel = () => {
resetIdx();
};
onMounted(() => {
fetchData();
});
const handleClickDelete = (slot: { row: { rowIndex: number } }) => {
deleteIdx.value = slot.row.rowIndex;
confirmVisible.value = true;
};
const onReset = (val: unknown) => {
console.log(val);
};
const handleClickDetail = () => {
router.push('/detail/base');
};
const onSubmit = (val: unknown) => {
console.log(val);
console.log(formData.value);
};
const rehandlePageChange = (pageInfo: PageInfo, newDataSource: TableRowData[]) => {
console.log('分页变化', pageInfo, newDataSource);
};
const rehandleChange = (changeParams: unknown, triggerAndData: unknown) => {
console.log('统一Change', changeParams, triggerAndData);
};
const headerAffixedTop = computed(
() =>
({
offsetTop: store.isUseTabsRouter ? 48 : 0,
container: `.${prefix}-layout`,
}) as any, // TO BE FIXED
);
</script>
<style lang="less" scoped>
.list-common-table {
background-color: var(--td-bg-color-container);
padding: var(--td-comp-paddingTB-xxl) var(--td-comp-paddingLR-xxl);
border-radius: var(--td-radius-medium);
.table-container {
margin-top: var(--td-comp-margin-xxl);
}
}
.form-item-content {
width: 100%;
}
.operation-container {
display: flex;
justify-content: flex-end;
align-items: center;
.expand {
.t-button__text {
display: flex;
align-items: center;
}
}
}
.payment-col {
display: flex;
.trend-container {
display: flex;
align-items: center;
margin-left: var(--td-comp-margin-s);
}
}
</style>

View File

@ -0,0 +1,122 @@
<template>
<t-card theme="poster2" :bordered="false">
<template #avatar>
<t-avatar size="56px">
<template #icon>
<shop-icon v-if="product.type === 1" />
<calendar-icon v-if="product.type === 2" />
<service-icon v-if="product.type === 3" />
<user-avatar-icon v-if="product.type === 4" />
<laptop-icon v-if="product.type === 5" />
</template>
</t-avatar>
</template>
<template #status>
<t-tag :theme="product.isSetup ? 'success' : 'default'" :disabled="!product.isSetup">{{
product.isSetup ? $t('components.isSetup.on') : $t('components.isSetup.off')
}}</t-tag>
</template>
<template #content>
<p class="list-card-item_detail--name">{{ product.name }}</p>
<p class="list-card-item_detail--desc">{{ product.description }}</p>
</template>
<template #footer>
<t-avatar-group cascading="left-up" :max="2">
<t-avatar>{{ typeMap[product.type - 1] }}</t-avatar>
<t-avatar
><template #icon>
<add-icon />
</template>
</t-avatar>
</t-avatar-group>
</template>
<template #actions>
<t-dropdown
:disabled="!product.isSetup"
trigger="click"
:options="[
{
content: $t('components.manage'),
value: 'manage',
onClick: () => handleClickManage(product),
},
{
content: $t('components.delete'),
value: 'delete',
onClick: () => handleClickDelete(product),
},
]"
>
<t-button theme="default" :disabled="!product.isSetup" shape="square" variant="text">
<more-icon />
</t-button>
</t-dropdown>
</template>
</t-card>
</template>
<script setup lang="ts">
import {
AddIcon,
CalendarIcon,
LaptopIcon,
MoreIcon,
ServiceIcon,
ShopIcon,
UserAvatarIcon,
} from 'tdesign-icons-vue-next';
import type { PropType } from 'vue';
export interface CardProductType {
type: number;
isSetup: boolean;
description: string;
name: string;
}
// eslint-disable-next-line
const props = defineProps({
product: {
type: Object as PropType<CardProductType>,
},
});
const emit = defineEmits(['manage-product', 'delete-item']);
const typeMap = ['A', 'B', 'C', 'D', 'E'];
const handleClickManage = (product: CardProductType) => {
emit('manage-product', product);
};
const handleClickDelete = (product: CardProductType) => {
emit('delete-item', product);
};
</script>
<style lang="less" scoped>
.list-card-item {
display: flex;
flex-direction: column;
cursor: pointer;
&_detail {
min-height: 140px;
&--name {
margin-bottom: var(--td-comp-margin-s);
font: var(--td-font-title-medium);
color: var(--td-text-color-primary);
}
&--desc {
color: var(--td-text-color-secondary);
font: var(--td-font-body-small);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
</style>

View File

@ -0,0 +1,98 @@
<template>
<div class="result-container">
<div class="result-bg-img">
<component :is="dynamicComponent"></component>
</div>
<div class="result-title">{{ title }}</div>
<div class="result-tip">{{ tip }}</div>
<slot />
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import Result403Icon from '@/assets/assets-result-403.svg?component';
import Result404Icon from '@/assets/assets-result-404.svg?component';
import Result500Icon from '@/assets/assets-result-500.svg?component';
import ResultIeIcon from '@/assets/assets-result-ie.svg?component';
import ResultMaintenanceIcon from '@/assets/assets-result-maintenance.svg?component';
import ResultWifiIcon from '@/assets/assets-result-wifi.svg?component';
const props = defineProps({
bgUrl: String,
title: String,
tip: String,
type: String,
});
const dynamicComponent = computed(() => {
switch (props.type) {
case '403':
return Result403Icon;
case '404':
return Result404Icon;
case '500':
return Result500Icon;
case 'ie':
return ResultIeIcon;
case 'wifi':
return ResultWifiIcon;
case 'maintenance':
return ResultMaintenanceIcon;
default:
return Result403Icon;
}
});
</script>
<style lang="less" scoped>
.result {
&-link {
color: var(--td-brand-color);
text-decoration: none;
cursor: pointer;
&:hover {
color: var(--td-brand-color);
}
&:active {
color: var(--td-brand-color);
}
&--active {
color: var(--td-brand-color);
}
&:focus {
text-decoration: none;
}
}
&-container {
min-height: 400px;
height: 75vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
&-bg-img {
width: 200px;
color: var(--td-brand-color);
}
&-title {
font: var(--td-font-title-large);
font-style: normal;
margin-top: var(--td-comp-margin-l);
color: var(--td-text-color-primary);
}
&-tip {
margin: var(--td-comp-margin-s) 0 var(--td-comp-margin-xxxl);
font: var(--td-font-body-medium);
color: var(--td-text-color-secondary);
}
}
</style>

View File

@ -0,0 +1,43 @@
<template>
<img :class="className" :src="url" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
const props = defineProps({
url: String,
type: {
type: String,
default: 'layout',
},
});
const className = computed(() => {
const { type } = props;
return [
'thumbnail-container',
{
'thumbnail-circle': type === 'circle',
'thumbnail-layout': type === 'layout',
},
];
});
</script>
<style lang="less" scoped>
@import '@/style/index.less';
.thumbnail {
&-container {
display: inline-block;
}
&-circle {
border-radius: var(--td-radius-circle);
}
&-layout {
width: 88px;
height: 48px;
}
}
</style>

View File

@ -0,0 +1,99 @@
<template>
<span :class="containerCls">
<span :class="iconCls">
<svg
v-if="type === 'down'"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M11.5 8L8 11.5L4.5 8" stroke="currentColor" stroke-width="1.5" />
<path d="M8 11L8 4" stroke="currentColor" stroke-width="1.5" />
</svg>
<svg v-else width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.5 8L8 4.5L11.5 8" stroke="currentColor" stroke-width="1.5" />
<path d="M8 5V12" stroke="currentColor" stroke-width="1.5" />
</svg>
</span>
<span>{{ describe }}</span>
</span>
</template>
<script setup lang="ts">
import { computed } from 'vue';
const props = defineProps({
type: String,
describe: [String, Number],
isReverseColor: {
type: Boolean,
default: false,
},
});
const containerCls = computed(() => {
const { isReverseColor, type } = props;
return [
'trend-container',
{
'trend-container__reverse': isReverseColor,
'trend-container__up': !isReverseColor && type === 'up',
'trend-container__down': !isReverseColor && type === 'down',
},
];
});
const iconCls = computed(() => ['trend-icon-container']);
</script>
<style lang="less" scoped>
.trend {
&-container {
&__up {
color: var(--td-error-color);
display: inline-flex;
align-items: center;
justify-content: center;
.trend-icon-container {
background: var(--td-error-color-2);
margin-right: 8px;
}
}
&__down {
color: var(--td-success-color);
display: inline-flex;
align-items: center;
justify-content: center;
.trend-icon-container {
background: var(--td-success-color-2);
margin-right: 8px;
}
}
&__reverse {
color: #fff;
display: inline-flex;
align-items: center;
justify-content: center;
.trend-icon-container {
background: var(--td-brand-color-5);
margin-right: 8px;
}
}
.trend-icon-container {
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
}
}
}
</style>

30
src/config/color.ts Normal file
View File

@ -0,0 +1,30 @@
export type TColorToken = Record<string, string>;
export type TColorSeries = Record<string, TColorToken>;
// TODO: 中性色暂时固定 待tvision-color生成带色彩倾向的中性色
export const LIGHT_CHART_COLORS = {
textColor: 'rgba(0, 0, 0, 0.9)',
placeholderColor: 'rgba(0, 0, 0, 0.35)',
borderColor: '#dcdcdc',
containerColor: '#fff',
};
export const DARK_CHART_COLORS = {
textColor: 'rgba(255, 255, 255, 0.9)',
placeholderColor: 'rgba(255, 255, 255, 0.35)',
borderColor: '#5e5e5e',
containerColor: '#242424',
};
export type TChartColor = typeof LIGHT_CHART_COLORS;
export const DEFAULT_COLOR_OPTIONS = [
'#0052D9',
'#0594FA',
'#00A870',
'#EBB105',
'#ED7B2F',
'#E34D59',
'#ED49B4',
'#834EC2',
];

1
src/config/global.ts Normal file
View File

@ -0,0 +1 @@
export const prefix = 'tdesign-starter';

14
src/config/style.ts Normal file
View File

@ -0,0 +1,14 @@
export default {
showFooter: true,
isSidebarCompact: false,
showBreadcrumb: false,
mode: 'light',
layout: 'side',
splitMenu: false,
isFooterAside: false,
isSidebarFixed: true,
isHeaderFixed: true,
isUseTabsRouter: false,
showHeader: true,
brandTheme: '#0052D9',
};

37
src/constants/index.ts Normal file
View File

@ -0,0 +1,37 @@
// 合同状态枚举
export const CONTRACT_STATUS = {
FAIL: 0,
AUDIT_PENDING: 1,
EXEC_PENDING: 2,
EXECUTING: 3,
FINISH: 4,
};
// 合同类型枚举
export const CONTRACT_TYPES = {
MAIN: 0,
SUB: 1,
SUPPLEMENT: 2,
};
// 合同收付类型枚举
export const CONTRACT_PAYMENT_TYPES = {
PAYMENT: 0,
RECEIPT: 1,
};
// 标签类型
type TagTheme = 'default' | 'success' | 'primary' | 'warning' | 'danger';
// 通知的优先级对应的标签类型
export const NOTIFICATION_TYPES: Map<string, TagTheme> = new Map([
['low', 'primary'],
['middle', 'warning'],
['high', 'danger'],
]);
// 通用请求头
export enum ContentTypeEnum {
Json = 'application/json;charset=UTF-8',
FormURLEncoded = 'application/x-www-form-urlencoded;charset=UTF-8',
FormData = 'multipart/form-data;charset=UTF-8',
}

View File

@ -0,0 +1,34 @@
import debounce from 'lodash/debounce';
import { onMounted, onUnmounted } from 'vue';
interface WindowSizeOptions {
immediate?: boolean;
}
interface Fn<T = any, R = T> {
(...arg: T[]): R;
}
export function useWindowSizeFn<T>(fn: Fn<T>, options?: WindowSizeOptions, wait = 150) {
const handleSize: () => void = debounce(fn, wait);
const start = () => {
if (options && options.immediate) {
fn();
}
window.addEventListener('resize', handleSize);
};
const stop = () => {
window.removeEventListener('resize', handleSize);
};
onMounted(() => {
start();
});
onUnmounted(() => {
stop();
});
return [start, stop];
}

60
src/hooks/index.ts Normal file
View File

@ -0,0 +1,60 @@
import * as echarts from 'echarts/core';
import { onMounted, onUnmounted, Ref, ref, ShallowRef, shallowRef } from 'vue';
/**
* eChart hook
* @param domId
*/
export const useChart = (domId: string): ShallowRef<echarts.ECharts> => {
let chartContainer: HTMLCanvasElement;
const selfChart = shallowRef<echarts.ECharts | any>();
const updateContainer = () => {
selfChart.value.resize({
width: chartContainer.clientWidth,
height: chartContainer.clientHeight,
});
};
onMounted(() => {
if (!chartContainer) {
chartContainer = document.getElementById(domId) as HTMLCanvasElement;
}
selfChart.value = echarts.init(chartContainer);
});
window.addEventListener('resize', updateContainer, false);
onUnmounted(() => {
window.removeEventListener('resize', updateContainer);
});
return selfChart;
};
/**
* counter utils
* @param duration
* @returns
*/
export const useCounter = (duration = 60): [Ref<number>, () => void] => {
let intervalTimer: ReturnType<typeof setInterval>;
onUnmounted(() => {
clearInterval(intervalTimer);
});
const countDown = ref(0);
return [
countDown,
() => {
countDown.value = duration;
intervalTimer = setInterval(() => {
if (countDown.value > 0) {
countDown.value -= 1;
} else {
clearInterval(intervalTimer);
countDown.value = 0;
}
}, 1000);
},
];
};

12
src/layouts/blank.vue Normal file
View File

@ -0,0 +1,12 @@
<template>
<div class="tdesign-wrapper">
<router-view />
</div>
</template>
<style lang="less" scoped>
.tdesign-wrapper {
height: 100vh;
display: flex;
flex-direction: column;
}
</style>

View File

@ -0,0 +1,52 @@
<template>
<t-breadcrumb :max-item-width="'150'" class="tdesign-breadcrumb">
<t-breadcrumbItem v-for="item in crumbs" :key="item.to" :to="item.to">
{{ item.title }}
</t-breadcrumbItem>
</t-breadcrumb>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useLocale } from '@/locales/useLocale';
import { RouteMeta } from '@/types/interface';
const { locale } = useLocale();
const crumbs = computed(() => {
const route = useRoute();
const pathArray = route.path.split('/');
pathArray.shift();
const breadcrumbs = pathArray.reduce((breadcrumbArray, path, idx) => {
// hiddenBreadcrumb
const meta = route.matched[idx]?.meta as RouteMeta;
if (meta?.hiddenBreadcrumb || Object.values(route.params).includes(path)) {
return breadcrumbArray;
}
let title = path;
if (meta?.title) {
if (typeof meta.title === 'string') {
title = meta.title;
} else {
title = meta.title[locale.value];
}
}
breadcrumbArray.push({
path,
to: breadcrumbArray[idx - 1] ? `/${breadcrumbArray[idx - 1].path}/${path}` : `/${path}`,
title,
});
return breadcrumbArray;
}, []);
return breadcrumbs;
});
</script>
<style scoped>
.tdesign-breadcrumb {
margin-bottom: 24px;
}
</style>

View File

@ -0,0 +1,61 @@
<template>
<router-view v-if="!isRefreshing" v-slot="{ Component }">
<transition name="fade" mode="out-in">
<keep-alive :include="aliveViews">
<component :is="Component" />
</keep-alive>
</transition>
</router-view>
<frame-page />
</template>
<script setup lang="ts">
import isBoolean from 'lodash/isBoolean';
import isUndefined from 'lodash/isUndefined';
import type { ComputedRef } from 'vue';
import { computed } from 'vue';
import FramePage from '@/layouts/frame/index.vue';
import { useTabsRouterStore } from '@/store';
// <suspense>使
// /page/1=> /page/2 使activeRouteFullPath key
// <suspense>
// <component :is="Component" :key="activeRouteFullPath" />
// </suspense>
// import { useRouter } from 'vue-router';
// const activeRouteFullPath = computed(() => {
// const router = useRouter();
// return router.currentRoute.value.fullPath;
// });
const aliveViews = computed(() => {
const tabsRouterStore = useTabsRouterStore();
const { tabRouters } = tabsRouterStore;
return tabRouters
.filter((route) => {
const keepAliveConfig = route.meta?.keepAlive;
const isRouteKeepAlive = isUndefined(keepAliveConfig) || (isBoolean(keepAliveConfig) && keepAliveConfig); // keepalive
return route.isAlive && isRouteKeepAlive;
})
.map((route) => route.name);
}) as ComputedRef<string[]>;
const isRefreshing = computed(() => {
const tabsRouterStore = useTabsRouterStore();
const { refreshing } = tabsRouterStore;
return refreshing;
});
</script>
<style lang="less" scoped>
.fade-leave-active,
.fade-enter-active {
transition: opacity @anim-duration-slow @anim-time-fn-easing;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>

View File

@ -0,0 +1,15 @@
<template>
<div :class="prefix + '-footer'">Copyright © 2021-{{ new Date().getFullYear() }} Tencent. All Rights Reserved</div>
</template>
<script setup lang="ts">
import { prefix } from '@/config/global';
</script>
<style lang="less" scoped>
.@{starter-prefix}-footer {
color: var(--td-text-color-placeholder);
line-height: 20px;
text-align: center;
}
</style>

View File

@ -0,0 +1,10 @@
<template>
<div></div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'FrameBlank',
});
</script>

View File

@ -0,0 +1,100 @@
<template>
<div :class="prefixCls" :style="getWrapStyle">
<t-loading :loading="loading" size="large" :style="getWrapStyle">
<iframe ref="frameRef" :src="frameSrc" :class="`${prefixCls}__main`" @load="hideLoading"></iframe>
</t-loading>
</div>
</template>
<script lang="ts" setup>
import debounce from 'lodash/debounce';
import { computed, CSSProperties, ref, unref, watch } from 'vue';
import { prefix } from '@/config/global';
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn';
import { useSettingStore } from '@/store';
defineProps({
frameSrc: String,
});
const loading = ref(true);
const heightRef = ref(window.innerHeight);
const frameRef = ref<HTMLFrameElement>();
const prefixCls = computed(() => [`${prefix}-iframe-page`]);
const settingStore = useSettingStore();
const getWrapStyle = computed((): CSSProperties => {
return {
height: `${heightRef.value}px`,
};
});
const computedStyle = getComputedStyle(document.documentElement);
const sizeXxxl = computedStyle.getPropertyValue('--td-comp-size-xxxl');
const paddingTBXxl = computedStyle.getPropertyValue('--td-comp-paddingTB-xxl');
function getOuterHeight(dom: Element) {
let height = dom.clientHeight;
const computedStyle = window.getComputedStyle(dom);
height += parseInt(computedStyle.marginTop, 10);
height += parseInt(computedStyle.marginBottom, 10);
height += parseInt(computedStyle.borderTopWidth, 10);
height += parseInt(computedStyle.borderBottomWidth, 10);
return height;
}
function calcHeight() {
const iframe = unref(frameRef);
if (!iframe) {
return;
}
let clientHeight = 0;
const { showFooter, isUseTabsRouter, showBreadcrumb } = settingStore;
const headerHeight = parseFloat(sizeXxxl);
const navDom = document.querySelector('.t-tabs__nav');
const navHeight = isUseTabsRouter ? getOuterHeight(navDom) : 0;
const breadcrumbDom = document.querySelector('.t-breadcrumb');
const breadcrumbHeight = showBreadcrumb ? getOuterHeight(breadcrumbDom) : 0;
const contentPadding = parseFloat(paddingTBXxl) * 2;
const footerDom = document.querySelector('.t-layout__footer');
const footerHeight = showFooter ? getOuterHeight(footerDom) : 0;
const top = headerHeight + navHeight + breadcrumbHeight + contentPadding + footerHeight + 2;
heightRef.value = window.innerHeight - top;
clientHeight = document.documentElement.clientHeight - top;
iframe.style.height = `${clientHeight}px`;
}
function hideLoading() {
loading.value = false;
calcHeight();
}
useWindowSizeFn(calcHeight, { immediate: true });
watch(
[() => settingStore.showFooter, () => settingStore.isUseTabsRouter, () => settingStore.showBreadcrumb],
debounce(calcHeight, 250),
);
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{starter-prefix}-iframe-page';
.@{prefix-cls} {
&__mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
&__main {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #fff;
border: 0;
box-sizing: border-box;
}
}
</style>

View File

@ -0,0 +1,327 @@
<template>
<div :class="layoutCls">
<t-head-menu :class="menuCls" :theme="menuTheme" expand-type="popup" :value="active">
<template #logo>
<span v-if="showLogo" class="header-logo-container" @click="handleNav('/dashboard/base')">
<logo-full class="t-logo" />
</span>
<div v-else class="header-operate-left">
<t-button theme="default" shape="square" variant="text" @click="changeCollapsed">
<t-icon class="collapsed-icon" name="view-list" />
</t-button>
<search :layout="layout" />
</div>
</template>
<template v-if="layout !== 'side'" #default>
<menu-content class="header-menu" :nav-data="menu" />
</template>
<template #operations>
<div class="operations-container">
<!-- 搜索框 -->
<search v-if="layout !== 'side'" :layout="layout" />
<!-- 全局通知 -->
<notice />
<t-tooltip placement="bottom" :content="$t('layout.header.code')">
<t-button theme="default" shape="square" variant="text" @click="navToGitHub">
<t-icon name="logo-github" />
</t-button>
</t-tooltip>
<t-tooltip placement="bottom" :content="$t('layout.header.help')">
<t-button theme="default" shape="square" variant="text" @click="navToHelper">
<t-icon name="help-circle" />
</t-button>
</t-tooltip>
<t-dropdown trigger="click">
<t-button theme="default" shape="square" variant="text">
<translate-icon />
</t-button>
<t-dropdown-menu>
<t-dropdown-item v-for="(lang, index) in langList" :key="index" :value="lang.value" @click="changeLang">{{
lang.content
}}</t-dropdown-item></t-dropdown-menu
>
</t-dropdown>
<t-dropdown :min-column-width="120" trigger="click">
<template #dropdown>
<t-dropdown-menu>
<t-dropdown-item class="operations-dropdown-container-item" @click="handleNav('/user/index')">
<user-circle-icon />{{ $t('layout.header.user') }}
</t-dropdown-item>
<t-dropdown-item class="operations-dropdown-container-item" @click="handleLogout">
<poweroff-icon />{{ $t('layout.header.signOut') }}
</t-dropdown-item>
</t-dropdown-menu>
</template>
<t-button class="header-user-btn" theme="default" variant="text">
<template #icon>
<t-icon class="header-user-avatar" name="user-circle" />
</template>
<div class="header-user-account">{{ user.userInfo.name }}</div>
<template #suffix><chevron-down-icon /></template>
</t-button>
</t-dropdown>
<t-tooltip placement="bottom" :content="$t('layout.header.setting')">
<t-button theme="default" shape="square" variant="text" @click="toggleSettingPanel">
<setting-icon />
</t-button>
</t-tooltip>
</div>
</template>
</t-head-menu>
</div>
</template>
<script setup lang="ts">
import { ChevronDownIcon, PoweroffIcon, SettingIcon, TranslateIcon, UserCircleIcon } from 'tdesign-icons-vue-next';
import type { PropType } from 'vue';
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import LogoFull from '@/assets/assets-logo-full.svg?component';
import { prefix } from '@/config/global';
import { langList } from '@/locales/index';
import { useLocale } from '@/locales/useLocale';
import { getActive } from '@/router';
import { useSettingStore, useUserStore } from '@/store';
import type { MenuRoute } from '@/types/interface';
import MenuContent from './MenuContent.vue';
import Notice from './Notice.vue';
import Search from './Search.vue';
const props = defineProps({
theme: {
type: String,
default: 'light',
},
layout: {
type: String,
default: 'top',
},
showLogo: {
type: Boolean,
default: true,
},
menu: {
type: Array as PropType<MenuRoute[]>,
default: () => [],
},
isFixed: {
type: Boolean,
default: false,
},
isCompact: {
type: Boolean,
default: false,
},
maxLevel: {
type: Number,
default: 3,
},
});
const router = useRouter();
const settingStore = useSettingStore();
const user = useUserStore();
const toggleSettingPanel = () => {
settingStore.updateConfig({
showSettingPanel: true,
});
};
const active = computed(() => getActive());
const layoutCls = computed(() => [`${prefix}-header-layout`]);
const menuCls = computed(() => {
const { isFixed, layout, isCompact } = props;
return [
{
[`${prefix}-header-menu`]: !isFixed,
[`${prefix}-header-menu-fixed`]: isFixed,
[`${prefix}-header-menu-fixed-side`]: layout === 'side' && isFixed,
[`${prefix}-header-menu-fixed-side-compact`]: layout === 'side' && isFixed && isCompact,
},
];
});
const menuTheme = computed(() => props.theme as 'light' | 'dark');
//
const { changeLocale } = useLocale();
const changeLang = ({ value: lang }: { value: string }) => {
changeLocale(lang);
};
const changeCollapsed = () => {
settingStore.updateConfig({
isSidebarCompact: !settingStore.isSidebarCompact,
});
};
const handleNav = (url: string) => {
router.push(url);
};
const handleLogout = () => {
router.push({
path: '/login',
query: { redirect: encodeURIComponent(router.currentRoute.value.fullPath) },
});
};
const navToGitHub = () => {
window.open('https://github.com/tencent/tdesign-vue-next-starter');
};
const navToHelper = () => {
window.open('http://tdesign.tencent.com/starter/docs/get-started');
};
</script>
<style lang="less" scoped>
.@{starter-prefix}-header {
&-menu-fixed {
position: fixed;
top: 0;
z-index: 1001;
:deep(.t-head-menu__inner) {
padding-right: var(--td-comp-margin-xl);
}
&-side {
left: 232px;
right: 0;
z-index: 10;
width: auto;
transition: all 0.3s;
&-compact {
left: 64px;
}
}
}
&-logo-container {
cursor: pointer;
display: inline-flex;
}
}
.header-menu {
flex: 1 1 1;
display: inline-flex;
:deep(.t-menu__item) {
min-width: unset;
}
}
.operations-container {
display: flex;
align-items: center;
.t-popup__reference {
display: flex;
align-items: center;
justify-content: center;
}
.t-button {
margin-left: var(--td-comp-margin-l);
}
}
.header-operate-left {
display: flex;
align-items: normal;
line-height: 0;
padding-left: var(--td-comp-margin-xl);
}
.header-logo-container {
width: 184px;
height: 26px;
display: flex;
margin-left: 24px;
color: var(--td-text-color-primary);
.t-logo {
width: 100%;
height: 100%;
&:hover {
cursor: pointer;
}
}
&:hover {
cursor: pointer;
}
}
.header-user-account {
display: inline-flex;
align-items: center;
color: var(--td-text-color-primary);
}
:deep(.t-head-menu__inner) {
border-bottom: 1px solid var(--td-component-stroke);
}
.t-menu--light {
.header-user-account {
color: var(--td-text-color-primary);
}
}
.t-menu--dark {
.t-head-menu__inner {
border-bottom: 1px solid var(--td-gray-color-10);
}
.header-user-account {
color: rgb(255 255 255 / 55%);
}
}
.operations-dropdown-container-item {
width: 100%;
display: flex;
align-items: center;
:deep(.t-dropdown__item-text) {
display: flex;
align-items: center;
}
.t-icon {
font-size: var(--td-comp-size-xxxs);
margin-right: var(--td-comp-margin-s);
}
:deep(.t-dropdown__item) {
width: 100%;
margin-bottom: 0;
}
&:last-child {
:deep(.t-dropdown__item) {
margin-bottom: 8px;
}
}
}
</style>
<!-- eslint-disable-next-line vue-scoped-css/enforce-style-type -->
<style lang="less">
.operations-dropdown-container-item {
.t-dropdown__item-text {
display: flex;
align-items: center;
}
}
</style>

View File

@ -0,0 +1,172 @@
<template>
<t-layout :class="`${prefix}-layout`">
<t-tabs
v-if="settingStore.isUseTabsRouter"
drag-sort
theme="card"
:class="`${prefix}-layout-tabs-nav`"
:value="$route.path"
:style="{ position: 'sticky', top: 0, width: '100%' }"
@change="handleChangeCurrentTab"
@remove="handleRemove"
@drag-sort="handleDragend"
>
<t-tab-panel
v-for="(routeItem, index) in tabRouters"
:key="`${routeItem.path}_${index}`"
:value="routeItem.path"
:removable="!routeItem.isHome"
:draggable="!routeItem.isHome"
>
<template #label>
<t-dropdown
trigger="context-menu"
:min-column-width="128"
:popup-props="{
overlayClassName: 'route-tabs-dropdown',
onVisibleChange: (visible: boolean, ctx: PopupVisibleChangeContext) =>
handleTabMenuClick(visible, ctx, routeItem.path),
visible: activeTabPath === routeItem.path,
}"
>
<template v-if="!routeItem.isHome">
{{ renderTitle(routeItem.title) }}
</template>
<t-icon v-else name="home" />
<template #dropdown>
<t-dropdown-menu>
<t-dropdown-item @click="() => handleRefresh(routeItem, index)">
<t-icon name="refresh" />
{{ $t('layout.tagTabs.refresh') }}
</t-dropdown-item>
<t-dropdown-item v-if="index > 1" @click="() => handleCloseAhead(routeItem.path, index)">
<t-icon name="arrow-left" />
{{ $t('layout.tagTabs.closeLeft') }}
</t-dropdown-item>
<t-dropdown-item
v-if="index < tabRouters.length - 1"
@click="() => handleCloseBehind(routeItem.path, index)"
>
<t-icon name="arrow-right" />
{{ $t('layout.tagTabs.closeRight') }}
</t-dropdown-item>
<t-dropdown-item v-if="tabRouters.length > 2" @click="() => handleCloseOther(routeItem.path, index)">
<t-icon name="close-circle" />
{{ $t('layout.tagTabs.closeOther') }}
</t-dropdown-item>
</t-dropdown-menu>
</template>
</t-dropdown>
</template>
</t-tab-panel>
</t-tabs>
<t-content :class="`${prefix}-content-layout`">
<l-breadcrumb v-if="settingStore.showBreadcrumb" />
<l-content />
</t-content>
<t-footer v-if="settingStore.showFooter" :class="`${prefix}-footer-layout`">
<l-footer />
</t-footer>
</t-layout>
</template>
<script setup lang="ts">
import type { PopupVisibleChangeContext } from 'tdesign-vue-next';
import { computed, nextTick, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { prefix } from '@/config/global';
import { useLocale } from '@/locales/useLocale';
import { useSettingStore, useTabsRouterStore } from '@/store';
import type { TRouterInfo, TTabRemoveOptions } from '@/types/interface';
import LBreadcrumb from './Breadcrumb.vue';
import LContent from './Content.vue';
import LFooter from './Footer.vue';
const route = useRoute();
const router = useRouter();
const settingStore = useSettingStore();
const tabsRouterStore = useTabsRouterStore();
const tabRouters = computed(() => tabsRouterStore.tabRouters.filter((route) => route.isAlive || route.isHome));
const activeTabPath = ref('');
const { locale } = useLocale();
const handleChangeCurrentTab = (path: string) => {
const { tabRouters } = tabsRouterStore;
const route = tabRouters.find((i) => i.path === path);
router.push({ path, query: route.query });
};
const handleRemove = (options: TTabRemoveOptions) => {
const { tabRouters } = tabsRouterStore;
const nextRouter = tabRouters[options.index + 1] || tabRouters[options.index - 1];
tabsRouterStore.subtractCurrentTabRouter({ path: options.value as string, routeIdx: options.index });
if ((options.value as string) === route.path) router.push({ path: nextRouter.path, query: nextRouter.query });
};
const renderTitle = (title: string | Record<string, string>) => {
if (typeof title === 'string') return title;
return title[locale.value];
};
const handleRefresh = (route: TRouterInfo, routeIdx: number) => {
tabsRouterStore.toggleTabRouterAlive(routeIdx);
nextTick(() => {
tabsRouterStore.toggleTabRouterAlive(routeIdx);
router.replace({ path: route.path, query: route.query });
});
activeTabPath.value = null;
};
const handleCloseAhead = (path: string, routeIdx: number) => {
tabsRouterStore.subtractTabRouterAhead({ path, routeIdx });
handleOperationEffect('ahead', routeIdx);
};
const handleCloseBehind = (path: string, routeIdx: number) => {
tabsRouterStore.subtractTabRouterBehind({ path, routeIdx });
handleOperationEffect('behind', routeIdx);
};
const handleCloseOther = (path: string, routeIdx: number) => {
tabsRouterStore.subtractTabRouterOther({ path, routeIdx });
handleOperationEffect('other', routeIdx);
};
//
const handleOperationEffect = (type: 'other' | 'ahead' | 'behind', routeIndex: number) => {
const currentPath = router.currentRoute.value.path;
const { tabRouters } = tabsRouterStore;
const currentIdx = tabRouters.findIndex((i) => i.path === currentPath);
//
//
const needRefreshRouter =
(type === 'other' && currentIdx !== routeIndex) ||
(type === 'ahead' && currentIdx < routeIndex) ||
(type === 'behind' && currentIdx === -1);
if (needRefreshRouter) {
const nextRouteIdx = type === 'behind' ? tabRouters.length - 1 : 1;
const nextRouter = tabRouters[nextRouteIdx];
router.push({ path: nextRouter.path, query: nextRouter.query });
}
activeTabPath.value = null;
};
const handleTabMenuClick = (visible: boolean, ctx: PopupVisibleChangeContext, path: string) => {
if (ctx.trigger === 'document') activeTabPath.value = null;
if (visible) activeTabPath.value = path;
};
const handleDragend = (options: { currentIndex: number; targetIndex: number }) => {
const { tabRouters } = tabsRouterStore;
[tabRouters[options.currentIndex], tabRouters[options.targetIndex]] = [
tabRouters[options.targetIndex],
tabRouters[options.currentIndex],
];
};
</script>

View File

@ -0,0 +1,36 @@
<template>
<l-header
v-if="settingStore.showHeader"
:show-logo="settingStore.showHeaderLogo"
:theme="settingStore.displayMode"
:layout="settingStore.layout"
:is-fixed="settingStore.isHeaderFixed"
:menu="headerMenu"
:is-compact="settingStore.isSidebarCompact"
/>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { usePermissionStore, useSettingStore } from '@/store';
import LHeader from './Header.vue';
const permissionStore = usePermissionStore();
const settingStore = useSettingStore();
const { routers: menuRouters } = storeToRefs(permissionStore);
const headerMenu = computed(() => {
if (settingStore.layout === 'mix') {
if (settingStore.splitMenu) {
return menuRouters.value.map((menu) => ({
...menu,
children: [],
}));
}
return [];
}
return menuRouters.value;
});
</script>

View File

@ -0,0 +1,40 @@
<template>
<l-side-nav
v-if="settingStore.showSidebar"
:show-logo="settingStore.showSidebarLogo"
:layout="settingStore.layout"
:is-fixed="settingStore.isSidebarFixed"
:menu="sideMenu"
:theme="settingStore.displayMode"
:is-compact="settingStore.isSidebarCompact"
/>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { usePermissionStore, useSettingStore } from '@/store';
import type { MenuRoute } from '@/types/interface';
import LSideNav from './SideNav.vue';
const route = useRoute();
const permissionStore = usePermissionStore();
const settingStore = useSettingStore();
const { routers: menuRouters } = storeToRefs(permissionStore);
const sideMenu = computed(() => {
const { layout, splitMenu } = settingStore;
let newMenuRouters = menuRouters.value as Array<MenuRoute>;
if (layout === 'mix' && splitMenu) {
newMenuRouters.forEach((menu) => {
if (route.path.indexOf(menu.path) === 0) {
newMenuRouters = menu.children.map((subMenu) => ({ ...subMenu, path: `${menu.path}/${subMenu.path}` }));
}
});
}
return newMenuRouters;
});
</script>

View File

@ -0,0 +1,112 @@
<template>
<div>
<template v-for="item in list" :key="item.path">
<template v-if="!item.children || !item.children.length || item.meta?.single">
<t-menu-item v-if="getHref(item)" :name="item.path" :value="getPath(item)" @click="openHref(getHref(item)[0])">
<template #icon>
<component :is="menuIcon(item)" class="t-icon"></component>
</template>
{{ renderMenuTitle(item.title) }}
</t-menu-item>
<t-menu-item v-else :name="item.path" :value="getPath(item)" :to="item.path">
<template #icon>
<component :is="menuIcon(item)" class="t-icon"></component>
</template>
{{ renderMenuTitle(item.title) }}
</t-menu-item>
</template>
<t-submenu v-else :name="item.path" :value="item.path" :title="renderMenuTitle(item.title)">
<template #icon>
<component :is="menuIcon(item)" class="t-icon"></component>
</template>
<menu-content v-if="item.children" :nav-data="item.children" />
</t-submenu>
</template>
</div>
</template>
<script setup lang="tsx">
import type { PropType } from 'vue';
import { computed } from 'vue';
import { useLocale } from '@/locales/useLocale';
import { getActive } from '@/router';
import type { MenuRoute } from '@/types/interface';
type ListItemType = MenuRoute & { icon?: string };
const props = defineProps({
navData: {
type: Array as PropType<MenuRoute[]>,
default: () => [],
},
});
const active = computed(() => getActive());
const { locale } = useLocale();
const list = computed(() => {
const { navData } = props;
return getMenuList(navData);
});
const menuIcon = (item: ListItemType) => {
if (typeof item.icon === 'string') return <t-icon name={item.icon} />;
const RenderIcon = item.icon;
return RenderIcon;
};
const renderMenuTitle = (title: string | Record<string, string>) => {
if (typeof title === 'string') return title;
return title[locale.value];
};
const getMenuList = (list: MenuRoute[], basePath?: string): ListItemType[] => {
if (!list || list.length === 0) {
return [];
}
// metaorderNo
list.sort((a, b) => {
return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0);
});
return list
.map((item) => {
const path = basePath && !item.path.includes(basePath) ? `${basePath}/${item.path}` : item.path;
return {
path,
title: item.meta?.title,
icon: item.meta?.icon,
children: getMenuList(item.children, path),
meta: item.meta,
redirect: item.redirect,
};
})
.filter((item) => item.meta && item.meta.hidden !== true);
};
const getHref = (item: MenuRoute) => {
const { frameSrc, frameBlank } = item.meta;
if (frameSrc && frameBlank) {
return frameSrc.match(/(http|https):\/\/([\w.]+\/?)\S*/);
}
return null;
};
const getPath = (item: ListItemType) => {
const activeLevel = active.value.split('/').length;
const pathLevel = item.path.split('/').length;
if (activeLevel > pathLevel && active.value.startsWith(item.path)) {
return active.value;
}
if (active.value === item.path) {
return active.value;
}
return item.meta?.single ? item.redirect : item.path;
};
const openHref = (url: string) => {
window.open(url);
};
</script>

View File

@ -0,0 +1,195 @@
<template>
<t-popup expand-animation placement="bottom-right" trigger="click">
<template #content>
<div class="header-msg">
<div class="header-msg-top">
<p>{{ $t('layout.notice.title') }}</p>
<t-button
v-if="unreadMsg.length > 0"
class="clear-btn"
variant="text"
theme="primary"
@click="setRead('all')"
>{{ $t('layout.notice.clear') }}</t-button
>
</div>
<t-list v-if="unreadMsg.length > 0" class="narrow-scrollbar" :split="false">
<t-list-item v-for="(item, index) in unreadMsg" :key="index">
<div>
<p class="msg-content">{{ item.content }}</p>
<p class="msg-type">{{ item.type }}</p>
</div>
<p class="msg-time">{{ item.date }}</p>
<template #action>
<t-button size="small" variant="outline" @click="setRead('radio', item)">
{{ $t('layout.notice.setRead') }}
</t-button>
</template>
</t-list-item>
</t-list>
<div v-else class="empty-list">
<img src="https://tdesign.gtimg.com/pro-template/personal/nothing.png" alt="空" />
<p>{{ $t('layout.notice.empty') }}</p>
</div>
<div v-if="unreadMsg.length > 0" class="header-msg-bottom">
<t-button class="header-msg-bottom-link" variant="text" theme="default" block @click="goDetail">{{
$t('layout.notice.viewAll')
}}</t-button>
</div>
</div>
</template>
<t-badge :count="unreadMsg.length" :offset="[4, 4]">
<t-button theme="default" shape="square" variant="text">
<t-icon name="mail" />
</t-button>
</t-badge>
</t-popup>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { useRouter } from 'vue-router';
import { useNotificationStore } from '@/store';
import type { NotificationItem } from '@/types/interface';
const router = useRouter();
const store = useNotificationStore();
const { msgData, unreadMsg } = storeToRefs(store);
const setRead = (type: string, item?: NotificationItem) => {
const changeMsg = msgData.value;
if (type === 'all') {
changeMsg.forEach((e) => {
e.status = false;
});
} else {
changeMsg.forEach((e) => {
if (e.id === item?.id) {
e.status = false;
}
});
}
store.setMsgData(changeMsg);
};
const goDetail = () => {
router.push('/detail/secondary');
};
</script>
<style lang="less" scoped>
.header-msg {
width: 400px;
// height: 440px;
margin: calc(0px - var(--td-comp-paddingTB-xs)) calc(0px - var(--td-comp-paddingLR-s));
.empty-list {
// height: calc(100% - 120px);
text-align: center;
padding: var(--td-comp-paddingTB-xxl) 0;
font: var(--td-font-body-medium);
color: var(--td-text-color-secondary);
img {
width: var(--td-comp-size-xxxxl);
}
p {
margin-top: var(--td-comp-margin-xs);
}
}
&-top {
position: relative;
font: var(--td-font-title-medium);
color: var(--td-text-color-primary);
text-align: left;
padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-xl) 0;
display: flex;
align-items: center;
justify-content: space-between;
.clear-btn {
right: calc(var(--td-comp-paddingTB-l) - var(--td-comp-paddingLR-xl));
}
}
&-bottom {
align-items: center;
display: flex;
justify-content: center;
padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
border-top: 1px solid var(--td-component-stroke);
&-link {
text-decoration: none;
cursor: pointer;
color: var(--td-text-color-placeholder);
}
}
.t-list {
height: calc(100% - 104px);
padding: var(--td-comp-margin-s) var(--td-comp-margin-s);
}
.t-list-item {
overflow: hidden;
width: 100%;
padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l);
border-radius: var(--td-radius-default);
font: var(--td-font-body-medium);
color: var(--td-text-color-primary);
cursor: pointer;
transition: background-color 0.2s linear;
&:hover {
background-color: var(--td-bg-color-container-hover);
.msg-content {
color: var(--td-brand-color);
}
.t-list-item__action {
button {
bottom: var(--td-comp-margin-l);
opacity: 1;
}
}
.msg-time {
bottom: -6px;
opacity: 0;
}
}
.msg-content {
margin-bottom: var(--td-comp-margin-s);
}
.msg-type {
color: var(--td-text-color-secondary);
}
.t-list-item__action {
button {
opacity: 0;
position: absolute;
right: var(--td-comp-margin-xxl);
bottom: -6px;
}
}
.msg-time {
transition: all 0.2s ease;
opacity: 1;
position: absolute;
right: var(--td-comp-margin-xxl);
bottom: var(--td-comp-margin-l);
color: var(--td-text-color-secondary);
}
}
}
</style>

View File

@ -0,0 +1,130 @@
<template>
<div v-if="layout === 'side'" class="header-menu-search">
<t-input
:class="['header-search', { 'hover-active': isSearchFocus }]"
:placeholder="$t('layout.searchPlaceholder')"
@blur="changeSearchFocus(false)"
@focus="changeSearchFocus(true)"
>
<template #prefix-icon>
<t-icon class="icon" name="search" size="16" />
</template>
</t-input>
</div>
<div v-else class="header-menu-search-left">
<t-button
:class="{ 'search-icon-hide': isSearchFocus }"
theme="default"
shape="square"
variant="text"
@click="changeSearchFocus(true)"
>
<t-icon name="search" />
</t-button>
<t-input
v-model="searchData"
:class="['header-search', { 'width-zero': !isSearchFocus }]"
placeholder="输入要搜索内容"
:autofocus="isSearchFocus"
@blur="changeSearchFocus(false)"
>
<template #prefix-icon>
<t-icon name="search" size="16" />
</template>
</t-input>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
defineProps({
layout: String,
});
const isSearchFocus = ref(false);
const searchData = ref('');
const changeSearchFocus = (value: boolean) => {
if (!value) {
searchData.value = '';
}
isSearchFocus.value = value;
};
</script>
<style lang="less" scoped>
.header-menu-search {
display: flex;
margin-left: 16px;
.hover-active {
background: var(--td-bg-color-secondarycontainer);
}
.t-icon {
color: var(--td-text-color-primary) !important;
}
.header-search {
:deep(.t-input) {
border: none;
outline: none;
box-shadow: none;
transition: background @anim-duration-base linear;
.t-input__inner {
transition: background @anim-duration-base linear;
background: none;
}
&:hover {
background: var(--td-bg-color-secondarycontainer);
.t-input__inner {
background: var(--td-bg-color-secondarycontainer);
}
}
}
}
}
.t-button {
margin: 0 8px;
transition: opacity @anim-duration-base @anim-time-fn-easing;
.t-icon {
font-size: 20px;
&.general {
margin-right: 16px;
}
}
}
.search-icon-hide {
opacity: 0;
}
.header-menu-search-left {
display: flex;
align-items: center;
.header-search {
width: 200px;
transition: width @anim-duration-base @anim-time-fn-easing;
:deep(.t-input) {
border: 0;
&:focus {
box-shadow: none;
}
}
&.width-zero {
width: 0;
opacity: 0;
}
}
}
</style>

View File

@ -0,0 +1,127 @@
<template>
<div :class="sideNavCls">
<t-menu :class="menuCls" :theme="theme" :value="active" :collapsed="collapsed" :default-expanded="defaultExpanded">
<template #logo>
<span v-if="showLogo" :class="`${prefix}-side-nav-logo-wrapper`" @click="goHome">
<component :is="getLogo()" :class="`${prefix}-side-nav-logo-${collapsed ? 't' : 'tdesign'}-logo`" />
</span>
</template>
<menu-content :nav-data="menu" />
<template #operations>
<span class="version-container"> {{ !collapsed ? 'TDesign Starter' : '' }} {{ pgk.version }} </span>
</template>
</t-menu>
<div :class="`${prefix}-side-nav-placeholder${collapsed ? '-hidden' : ''}`"></div>
</div>
</template>
<script setup lang="ts">
import union from 'lodash/union';
import type { PropType } from 'vue';
import { computed, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import AssetLogoFull from '@/assets/assets-logo-full.svg?component';
import AssetLogo from '@/assets/assets-t-logo.svg?component';
import { prefix } from '@/config/global';
import { getActive, getRoutesExpanded } from '@/router';
import { useSettingStore } from '@/store';
import type { MenuRoute } from '@/types/interface';
import pgk from '../../../package.json';
import MenuContent from './MenuContent.vue';
const MIN_POINT = 992 - 1;
const props = defineProps({
menu: {
type: Array as PropType<MenuRoute[]>,
default: () => [],
},
showLogo: {
type: Boolean as PropType<boolean>,
default: true,
},
isFixed: {
type: Boolean as PropType<boolean>,
default: true,
},
layout: {
type: String as PropType<string>,
default: '',
},
headerHeight: {
type: String as PropType<string>,
default: '64px',
},
theme: {
type: String as PropType<'light' | 'dark'>,
default: 'light',
},
isCompact: {
type: Boolean as PropType<boolean>,
default: false,
},
});
const collapsed = computed(() => useSettingStore().isSidebarCompact);
const active = computed(() => getActive());
const defaultExpanded = computed(() => {
const path = getActive();
const parentPath = path.substring(0, path.lastIndexOf('/'));
const expanded = getRoutesExpanded();
return union(expanded, parentPath === '' ? [] : [parentPath]);
});
const sideNavCls = computed(() => {
const { isCompact } = props;
return [
`${prefix}-sidebar-layout`,
{
[`${prefix}-sidebar-compact`]: isCompact,
},
];
});
const menuCls = computed(() => {
const { showLogo, isFixed, layout } = props;
return [
`${prefix}-side-nav`,
{
[`${prefix}-side-nav-no-logo`]: !showLogo,
[`${prefix}-side-nav-no-fixed`]: !isFixed,
[`${prefix}-side-nav-mix-fixed`]: layout === 'mix' && isFixed,
},
];
});
const router = useRouter();
const settingStore = useSettingStore();
const autoCollapsed = () => {
const isCompact = window.innerWidth <= MIN_POINT;
settingStore.updateConfig({
isSidebarCompact: isCompact,
});
};
onMounted(() => {
autoCollapsed();
window.onresize = () => {
autoCollapsed();
};
});
const goHome = () => {
router.push('/dashboard/base');
};
const getLogo = () => {
if (collapsed.value) return AssetLogo;
return AssetLogoFull;
};
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,25 @@
<template>
<div v-if="showFrame">
<template v-for="frame in getFramePages" :key="frame.path">
<frame-content v-if="hasRenderFrame(frame.name)" v-show="showIframe(frame)" :frame-src="frame.meta.frameSrc" />
</template>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, unref } from 'vue';
import FrameContent from '../components/FrameContent.vue';
import { useFrameKeepAlive } from './useFrameKeepAlive';
export default defineComponent({
name: 'FrameLayout',
components: { FrameContent },
setup() {
const { getFramePages, hasRenderFrame, showIframe } = useFrameKeepAlive();
const showFrame = computed(() => unref(getFramePages).length > 0);
return { getFramePages, hasRenderFrame, showIframe, showFrame };
},
});
</script>

View File

@ -0,0 +1,54 @@
import uniqBy from 'lodash/uniqBy';
import { computed, toRaw, unref } from 'vue';
import { useRouter } from 'vue-router';
import { useSettingStore, useTabsRouterStore } from '@/store';
import type { MenuRoute } from '@/types/interface';
export function useFrameKeepAlive() {
const router = useRouter();
const { currentRoute } = router;
const { isUseTabsRouter } = useSettingStore();
const tabStore = useTabsRouterStore();
const getFramePages = computed(() => {
const ret = getAllFramePages(toRaw(router.getRoutes()) as unknown as MenuRoute[]) || [];
return ret;
});
const getOpenTabList = computed((): string[] => {
return tabStore.tabRouters.reduce((prev: string[], next) => {
if (next.meta && Reflect.has(next.meta, 'frameSrc')) {
prev.push(next.name as string);
}
return prev;
}, []);
});
function getAllFramePages(routes: MenuRoute[]): MenuRoute[] {
let res: MenuRoute[] = [];
for (const route of routes) {
const { meta: { frameSrc, frameBlank } = {}, children } = route;
if (frameSrc && !frameBlank) {
res.push(route);
}
if (children && children.length) {
res.push(...getAllFramePages(children));
}
}
res = uniqBy(res, 'name');
return res;
}
function showIframe(item: MenuRoute) {
return item.name === unref(currentRoute).name;
}
function hasRenderFrame(name: string) {
if (!unref(isUseTabsRouter)) {
return router.currentRoute.value.name === name;
}
return unref(getOpenTabList).includes(name);
}
return { hasRenderFrame, getFramePages, showIframe, getAllFramePages };
}

75
src/layouts/index.vue Normal file
View File

@ -0,0 +1,75 @@
<template>
<div>
<template v-if="setting.layout.value === 'side'">
<t-layout key="side" :class="mainLayoutCls">
<t-aside><layout-side-nav /></t-aside>
<t-layout>
<t-header><layout-header /></t-header>
<t-content><layout-content /></t-content>
</t-layout>
</t-layout>
</template>
<template v-else>
<t-layout key="no-side">
<t-header><layout-header /> </t-header>
<t-layout :class="mainLayoutCls">
<layout-side-nav />
<layout-content />
</t-layout>
</t-layout>
</template>
<setting-com />
</div>
</template>
<script setup lang="ts">
import '@/style/layout.less';
import { storeToRefs } from 'pinia';
import { computed, onMounted, watch } from 'vue';
import { useRoute } from 'vue-router';
import { prefix } from '@/config/global';
import { useSettingStore, useTabsRouterStore } from '@/store';
import LayoutContent from './components/LayoutContent.vue';
import LayoutHeader from './components/LayoutHeader.vue';
import LayoutSideNav from './components/LayoutSideNav.vue';
import SettingCom from './setting.vue';
const route = useRoute();
const settingStore = useSettingStore();
const tabsRouterStore = useTabsRouterStore();
const setting = storeToRefs(settingStore);
const mainLayoutCls = computed(() => [
{
't-layout--with-sider': settingStore.showSidebar,
},
]);
const appendNewRoute = () => {
const {
path,
query,
meta: { title },
name,
} = route;
tabsRouterStore.appendTabRouterList({ path, query, title: title as string, name, isAlive: true, meta: route.meta });
};
onMounted(() => {
appendNewRoute();
});
watch(
() => route.path,
() => {
appendNewRoute();
document.querySelector(`.${prefix}-layout`).scrollTo({ top: 0, behavior: 'smooth' });
},
);
</script>
<style lang="less" scoped></style>

354
src/layouts/setting.vue Normal file
View File

@ -0,0 +1,354 @@
<template>
<t-drawer
v-model:visible="showSettingPanel"
size="408px"
:footer="false"
:header="$t('layout.setting.title')"
:close-btn="true"
class="setting-drawer-container"
@close-btn-click="handleCloseDrawer"
>
<div class="setting-container">
<t-form ref="form" :data="formData" label-align="left">
<div class="setting-group-title">{{ $t('layout.setting.theme.mode') }}</div>
<t-radio-group v-model="formData.mode">
<div v-for="(item, index) in MODE_OPTIONS" :key="index" class="setting-layout-drawer">
<div>
<t-radio-button :key="index" :value="item.type"
><component :is="getModeIcon(item.type)"
/></t-radio-button>
<p :style="{ textAlign: 'center', marginTop: '8px' }">{{ item.text }}</p>
</div>
</div>
</t-radio-group>
<div class="setting-group-title">{{ $t('layout.setting.theme.color') }}</div>
<t-radio-group v-model="formData.brandTheme">
<div v-for="(item, index) in DEFAULT_COLOR_OPTIONS" :key="index" class="setting-layout-drawer">
<t-radio-button :key="index" :value="item" class="setting-layout-color-group">
<color-container :value="item" />
</t-radio-button>
</div>
<div class="setting-layout-drawer">
<t-popup
destroy-on-close
expand-animation
placement="bottom-right"
trigger="click"
:visible="isColoPickerDisplay"
:overlay-style="{ padding: 0 }"
@visible-change="onPopupVisibleChange"
>
<template #content>
<t-color-picker-panel
:on-change="changeColor"
:color-modes="['monochrome']"
format="HEX"
:swatch-colors="[]"
/>
</template>
<t-radio-button :value="dynamicColor" class="setting-layout-color-group dynamic-color-btn">
<color-container :value="dynamicColor" />
</t-radio-button>
</t-popup>
</div>
</t-radio-group>
<div class="setting-group-title">{{ $t('layout.setting.navigationLayout') }}</div>
<t-radio-group v-model="formData.layout">
<div v-for="(item, index) in LAYOUT_OPTION" :key="index" class="setting-layout-drawer">
<t-radio-button :key="index" :value="item">
<thumbnail :src="getThumbnailUrl(item)" />
</t-radio-button>
</div>
</t-radio-group>
<t-form-item v-show="formData.layout === 'mix'" label="分割菜单(混合模式下有效)" name="splitMenu">
<t-switch v-model="formData.splitMenu" />
</t-form-item>
<t-form-item v-show="formData.layout === 'mix'" label="固定 Sidebar" name="isSidebarFixed">
<t-switch v-model="formData.isSidebarFixed" />
</t-form-item>
<div class="setting-group-title">{{ $t('layout.setting.element.title') }}</div>
<t-form-item
v-show="formData.layout === 'side'"
:label="$t('layout.setting.element.showHeader')"
name="showHeader"
>
<t-switch v-model="formData.showHeader" />
</t-form-item>
<t-form-item :label="$t('layout.setting.element.showBreadcrumb')" name="showBreadcrumb">
<t-switch v-model="formData.showBreadcrumb" />
</t-form-item>
<t-form-item :label="$t('layout.setting.element.showFooter')" name="showFooter">
<t-switch v-model="formData.showFooter" />
</t-form-item>
<t-form-item :label="$t('layout.setting.element.useTagTabs')" name="isUseTabsRouter">
<t-switch v-model="formData.isUseTabsRouter"></t-switch>
</t-form-item>
</t-form>
<div class="setting-info">
<p>{{ $t('layout.setting.tips') }}</p>
<t-button theme="primary" variant="text" @click="handleCopy">
{{ $t('layout.setting.copy.title') }}
</t-button>
</div>
</div>
</t-drawer>
</template>
<script setup lang="ts">
import { useClipboard } from '@vueuse/core';
import type { PopupVisibleChangeContext } from 'tdesign-vue-next';
import { MessagePlugin } from 'tdesign-vue-next';
import { computed, onMounted, ref, watchEffect } from 'vue';
import SettingAutoIcon from '@/assets/assets-setting-auto.svg';
import SettingDarkIcon from '@/assets/assets-setting-dark.svg';
import SettingLightIcon from '@/assets/assets-setting-light.svg';
import ColorContainer from '@/components/color/index.vue';
import Thumbnail from '@/components/thumbnail/index.vue';
import { DEFAULT_COLOR_OPTIONS } from '@/config/color';
import STYLE_CONFIG from '@/config/style';
import { t } from '@/locales';
import { useSettingStore } from '@/store';
const settingStore = useSettingStore();
const LAYOUT_OPTION = ['side', 'top', 'mix'];
const MODE_OPTIONS = [
{ type: 'light', text: t('layout.setting.theme.options.light') },
{ type: 'dark', text: t('layout.setting.theme.options.dark') },
{ type: 'auto', text: t('layout.setting.theme.options.auto') },
];
const initStyleConfig = () => {
const styleConfig = STYLE_CONFIG;
for (const key in styleConfig) {
if (Object.prototype.hasOwnProperty.call(styleConfig, key)) {
(styleConfig[key as keyof typeof STYLE_CONFIG] as any) = settingStore[key as keyof typeof STYLE_CONFIG];
}
}
return styleConfig;
};
const dynamicColor = computed(() => {
const isDynamic = DEFAULT_COLOR_OPTIONS.indexOf(formData.value.brandTheme) === -1;
return isDynamic ? formData.value.brandTheme : '';
});
const formData = ref({ ...initStyleConfig() });
const isColoPickerDisplay = ref(false);
const showSettingPanel = computed({
get() {
return settingStore.showSettingPanel;
},
set(newVal: boolean) {
settingStore.updateConfig({
showSettingPanel: newVal,
});
},
});
const changeColor = (hex: string) => {
formData.value.brandTheme = hex;
};
onMounted(() => {
document.querySelector('.dynamic-color-btn').addEventListener('click', () => {
isColoPickerDisplay.value = true;
});
});
const onPopupVisibleChange = (visible: boolean, context: PopupVisibleChangeContext) => {
if (!visible && context.trigger === 'document') {
isColoPickerDisplay.value = visible;
}
};
const handleCopy = () => {
const sourceText = JSON.stringify(formData.value, null, 4);
const { copy } = useClipboard({ source: sourceText });
copy()
.then(() => {
MessagePlugin.closeAll();
MessagePlugin.success('复制成功');
})
.catch(() => {
MessagePlugin.closeAll();
MessagePlugin.error('复制失败');
});
};
const getModeIcon = (mode: string) => {
if (mode === 'light') {
return SettingLightIcon;
}
if (mode === 'dark') {
return SettingDarkIcon;
}
return SettingAutoIcon;
};
const handleCloseDrawer = () => {
settingStore.updateConfig({
showSettingPanel: false,
});
};
const getThumbnailUrl = (name: string): string => {
return `https://tdesign.gtimg.com/tdesign-pro/setting/${name}.png`;
};
watchEffect(() => {
if (formData.value.brandTheme) settingStore.updateConfig(formData.value);
});
</script>
<!-- teleport导致drawer scoped样式问题无法生效 先规避下 -->
<!-- eslint-disable-next-line vue-scoped-css/enforce-style-type -->
<style lang="less">
.tdesign-setting {
z-index: 100;
position: fixed;
bottom: 200px;
right: 0;
height: 40px;
width: 40px;
border-radius: 20px 0 0 20px;
transition: all 0.3s;
.t-icon {
margin-left: 8px;
}
.tdesign-setting-text {
font-size: 12px;
display: none;
}
&:hover {
width: 96px;
.tdesign-setting-text {
display: inline-block;
}
}
}
.setting-layout-color-group {
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 50% !important;
padding: 6px !important;
border: 2px solid transparent !important;
> .t-radio-button__label {
display: inline-flex;
}
}
.tdesign-setting-close {
position: fixed;
bottom: 200px;
right: 300px;
}
.setting-group-title {
font-size: 14px;
line-height: 22px;
margin: 32px 0 24px;
text-align: left;
font-family: 'PingFang SC', var(--td-font-family);
font-style: normal;
font-weight: 500;
color: var(--td-text-color-primary);
}
.setting-link {
cursor: pointer;
color: var(--td-brand-color);
margin-bottom: 8px;
}
.setting-info {
position: absolute;
padding: 24px;
bottom: 0;
left: 0;
line-height: 20px;
font-size: 12px;
text-align: center;
color: var(--td-text-color-placeholder);
width: 100%;
background: var(--td-bg-color-container);
}
.setting-drawer-container {
.setting-container {
padding-bottom: 100px;
}
.t-radio-group.t-size-m {
min-height: 32px;
width: 100%;
justify-content: space-between;
align-items: center;
}
.t-radio-group.t-size-m .t-radio-button {
height: auto;
}
.setting-layout-drawer {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 16px;
.t-radio-button {
display: inline-flex;
max-height: 78px;
padding: 8px;
border-radius: var(--td-radius-default);
border: 2px solid var(--td-component-border);
> .t-radio-button__label {
display: inline-flex;
}
}
.t-is-checked {
border: 2px solid var(--td-brand-color) !important;
}
.t-form__controls-content {
justify-content: end;
}
}
.t-form__controls-content {
justify-content: end;
}
}
.setting-route-theme {
.t-form__label {
min-width: 310px !important;
color: var(--td-text-color-secondary);
}
}
.setting-color-theme {
.setting-layout-drawer {
.t-radio-button {
height: 32px;
}
&:last-child {
margin-right: 0;
}
}
}
</style>

67
src/locales/index.ts Normal file
View File

@ -0,0 +1,67 @@
import { useLocalStorage, usePreferredLanguages } from '@vueuse/core';
import { DropdownOption } from 'tdesign-vue-next';
import { computed } from 'vue';
import { createI18n } from 'vue-i18n';
// 导入语言文件
const langModules = import.meta.glob('./lang/*/index.ts', { eager: true });
const langModuleMap = new Map<string, Object>();
export const langCode: Array<string> = [];
export const localeConfigKey = 'tdesign-starter-locale';
// 获取浏览器默认语言环境
const languages = usePreferredLanguages();
// 生成语言模块列表
const generateLangModuleMap = () => {
const fullPaths = Object.keys(langModules);
fullPaths.forEach((fullPath) => {
const k = fullPath.replace('./lang', '');
const startIndex = 1;
const lastIndex = k.lastIndexOf('/');
const code = k.substring(startIndex, lastIndex);
langCode.push(code);
langModuleMap.set(code, langModules[fullPath]);
});
};
// 导出 Message
const importMessages = computed(() => {
generateLangModuleMap();
const message: Recordable = {};
langModuleMap.forEach((value: any, key) => {
message[key] = value.default;
});
return message;
});
export const i18n = createI18n({
legacy: false,
locale: useLocalStorage(localeConfigKey, 'zh_CN').value || languages.value[0] || 'zh_CN',
fallbackLocale: 'zh_CN',
messages: importMessages.value,
globalInjection: true,
});
export const langList = computed(() => {
if (langModuleMap.size === 0) generateLangModuleMap();
const list: DropdownOption[] = [];
langModuleMap.forEach((value: any, key) => {
list.push({
content: value.default.lang,
value: key,
});
});
return list;
});
// @ts-ignore
export const { t } = i18n.global;
export default i18n;

View File

@ -0,0 +1,37 @@
export default {
isSetup: {
on: 'Enabled',
off: 'Disabled',
},
manage: 'Manage',
delete: 'Delete',
commonTable: {
contractName: 'Name',
contractStatus: 'Status',
contractNum: 'Number',
contractType: 'Type',
contractPayType: 'Pay Type',
contractAmount: 'Amount',
contractNamePlaceholder: 'enter contract name',
contractStatusPlaceholder: 'enter contract status',
contractNumPlaceholder: 'enter contract number',
contractTypePlaceholder: 'enter contract type',
operation: 'Operation',
detail: 'detail',
delete: 'delete',
contractStatusEnum: {
fail: 'fail',
audit: 'audit',
executing: 'executing',
pending: 'pending',
finish: 'finish',
},
contractTypeEnum: {
main: 'main',
sub: 'sub',
supplement: 'supplement',
},
reset: 'reset',
query: 'query',
},
};

View File

@ -0,0 +1,54 @@
import merge from 'lodash/merge';
import componentsLocale from 'tdesign-vue-next/es/locale/en_US';
import components from './components';
import layout from './layout';
import pages from './pages';
export default {
lang: 'English',
layout,
pages,
components,
constants: {
contract: {
name: 'Name',
status: 'Status',
num: 'Number',
type: 'Type',
typePlaceholder: 'Please enter type',
payType: 'Pay Type',
amount: 'Amount',
amountPlaceholder: 'Please enter amount',
signDate: 'Sign Date',
effectiveDate: 'Effective Date',
endDate: 'End Date',
createDate: 'Create Date',
attachment: 'Attachment',
company: 'Company',
employee: 'Employee',
pay: 'pay',
receive: 'received',
remark: 'remark',
statusOptions: {
fail: 'Failure',
auditPending: 'Pending audit',
execPending: 'Pending performance',
executing: 'Successful',
finish: 'Finish',
},
typeOptions: {
main: 'Master contract',
sub: 'Subcontract',
supplement: 'Supplementary contract',
},
},
},
componentsLocale: merge({}, componentsLocale, {
// 可以在此处定义更多自定义配置,具体可配置内容参看 API 文档
// https://tdesign.tencent.com/vue-next/config?tab=api
// pagination: {
// jumpTo: 'xxx'
// },
}),
};

View File

@ -0,0 +1,52 @@
export default {
header: {
code: 'Code Repository',
help: 'Document',
user: 'Profile',
signOut: 'Sign Out',
setting: 'Setting',
},
notice: {
title: 'Notification Center',
clear: 'Clear',
setRead: 'Set Read',
empty: 'Empty',
emptyNotice: 'No Notice',
viewAll: 'View All',
},
tagTabs: {
closeOther: 'close other',
closeLeft: 'close left',
closeRight: 'close right',
refresh: 'refresh',
},
searchPlaceholder: 'Enter search content',
setting: {
title: 'Setting',
theme: {
mode: 'Theme Mode',
color: 'Theme Color',
options: {
light: 'Light',
dark: 'Dark ',
auto: 'Follow System',
},
},
navigationLayout: 'Navigation Layout',
splitMenu: 'Split MenuOnly Mix mode',
fixedSidebar: 'Fixed Sidebar',
element: {
title: 'Element Switch',
showHeader: 'Show Header',
showBreadcrumb: 'Show Breadcrumb',
showFooter: 'Show Footer',
useTagTabs: 'Use Tag Tabs',
},
tips: 'Please copy and manually modify the configuration file: /src/config/style.ts',
copy: {
title: 'Copy',
success: 'copied',
fail: 'fail to copy',
},
},
};

View File

@ -0,0 +1,62 @@
export default {
outputOverview: {
title: 'In/Out Overview',
subtitle: '(pieces)',
export: 'Export data',
month: {
input: 'Total in store this month',
output: 'Total out store this month',
},
since: 'Since last week',
},
rankList: {
title: 'Sales order ranking',
week: 'This week',
month: 'Latest 3 months',
info: 'Detail',
},
topPanel: {
card1: 'Total Revenue',
card2: 'Total Refund',
card3: 'Active User(s)',
card4: 'Generate Order(s)',
cardTips: 'since last week',
analysis: {
title: 'Analysis Data',
unit: 'ten thousand yuan',
series1: 'this month',
series2: 'last month',
channels: 'Sales Channels',
channel1: 'online',
channel2: 'shop',
channelTips: ' sales ratio',
},
},
saleColumns: {
index: 'Ranking',
productName: 'Customer',
growUp: 'Grow up',
count: 'Count',
operation: 'Operation',
},
buyColumns: {
index: 'Ranking',
productName: 'Supplier',
growUp: 'Grow up',
count: 'Count',
operation: 'Operation',
},
chart: {
week1: 'MON',
week2: 'TUE',
week3: 'WED',
week4: 'THU',
week5: 'FRI',
week6: 'SAT',
week7: 'SUN',
max: 'Max',
min: 'Min',
thisMonth: 'this month',
lastMonth: 'last month',
},
};

Some files were not shown because too many files have changed in this diff Show More