feat: tdesign首次提交

This commit is contained in:
caoqianming 2025-10-29 15:34:23 +08:00
commit bf8b5b672b
19 changed files with 1771 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

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

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XT_WEB_TD</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

37
jsconfig.json Normal file
View File

@ -0,0 +1,37 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"jsx": "preserve",
"jsxImportSource": "vue",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"lib": ["esnext", "dom"],
"types": ["vite/client"],
"noEmit": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
},
"allowJs": true,
"checkJs": false,
"noImplicitAny": false,
"strictFunctionTypes": false,
"strictBindCallApply": false,
"noImplicitThis": false,
"alwaysStrict": false
},
"include": [
"**/*.js",
"**/*.jsx",
"src/**/*.d.ts",
"src/**/*.jsx",
"src/**/*.vue",
"node_modules/tdesign-vue-next/global.d.ts"
],
"compileOnSave": false
}

1460
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "xt_web_td",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"tdesign-icons-vue-next": "^0.4.1",
"tdesign-vue-next": "^1.17.1",
"vue": "^3.5.22",
"vue-router": "^4.6.3"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.1",
"vite": "^7.1.7"
}
}

1
public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

6
src/App.vue Normal file
View File

@ -0,0 +1,6 @@
<script setup>
</script>
<template>
<router-view/>
</template>

0
src/api/index.js Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

1
src/assets/vue.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@ -0,0 +1,38 @@
<template>
<div>
<t-layout style="height: 100vh;width: 100vw;">
<t-aside>
<t-menu theme="light" default-value="item1" style="margin-right: 40px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
<t-menu-item value="item1"> 仪表盘 </t-menu-item>
<t-menu-item value="item2"> 资源列表 </t-menu-item>
<t-menu-item value="item3"> 根目录 </t-menu-item>
<t-menu-item value="item4" :disabled="true"> 调度平台 </t-menu-item>
<t-menu-item value="item5"> 精准监控 </t-menu-item>
<t-menu-item value="item6"> 消息区 </t-menu-item>
<t-menu-item value="item7"> 个人中心 </t-menu-item>
<t-menu-item value="item8"> 视频区 </t-menu-item>
<t-menu-item value="item9"> 资源编辑 </t-menu-item>
</t-menu>
</t-aside>
<t-layout>
<t-header>
<t-head-menu theme="light">
<template #operations>
<a href="javascript:;"><t-icon class="t-menu__operations-icon" name="search" /></a>
<a href="javascript:;"><t-icon class="t-menu__operations-icon" name="notification-filled" /></a>
<a href="javascript:;"><t-icon class="t-menu__operations-icon" name="home" /></a>
</template>
</t-head-menu>
</t-header>
<t-content>
</t-content>
</t-layout>
</t-layout>
</div>
</template>
<script setup lang="ts">
</script>

11
src/main.js Normal file
View File

@ -0,0 +1,11 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import TDesign from 'tdesign-vue-next';
import router from './router';
const app = createApp(App);
app.use(TDesign);
app.use(router);
app.mount('#app');

8
src/pages/home/index.vue Normal file
View File

@ -0,0 +1,8 @@
<template>
<div>
<h1>Home</h1>
<p>Home page content</p>
</div>
</template>
<script setup>
</script>

85
src/pages/login/index.vue Normal file
View File

@ -0,0 +1,85 @@
<template>
<div class="login-wrapper">
<div class="login-container">
<div class="title-container">
<h1>XT_WEB_TD</h1>
</div>
<t-form class="item-container" label-width="0" @submit="handleLogin">
<t-form-item>
<t-input v-model="formData.username" size="large">
<template #prefix-icon>
<t-icon name="user" />
</template>
</t-input>
</t-form-item>
<t-form-item>
<t-input type="password" v-model="password" size="large">
<template #prefix-icon>
<t-icon name="lock-on" />
</template>
</t-input>
</t-form-item>
<t-form-item>
<t-button block size="large" type="submit" @click="handleLogin" v-bind:loading="submitLoading">登录</t-button>
</t-form-item>
</t-form>
</div>
<footer class="copyright">Copyright @ 2021-2025 XT_WEB_TD. All Rights Reserved</footer>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const formData = ref({
username: "",
password: "",
});
const submitLoading = ref(false);
const handleLogin = () => {
submitLoading.value = true;
setTimeout(() => {
submitLoading.value = false;
router.push({ path: "/home" });
}, 300);
}
</script>
<style scoped>
.login-wrapper {
height: 100vh;
display: flex;
flex-direction: column;
background-size: cover;
background-position: 100%;
position: relative;
background-color: white;
background-image: url('@/assets/assets-login-bg-white.png');
}
.login-container {
position: absolute;
top: 22%;
left: 5%;
min-height: 500px;
}
.copyright {
font: var(--td-font-body-medium);
position: absolute;
left: 5%;
bottom: 64px;
color: var(--td-text-color-secondary);
}
@media (height <=700px) {
.copyright {
display: none;
}
}
.item-container {
width: 400px;
margin-top: var(--td-comp-margin-xxxxl);
}
</style>

34
src/router/index.js Normal file
View File

@ -0,0 +1,34 @@
import { createRouter, createWebHistory} from 'vue-router';
const routes = [
{ path: "/", redirect: "/login" },
{
path: "/login",
name: "Login",
component: () => import("@/pages/login/index.vue"),
},
{
path: "/",
component: () => import("@/components/layout/index.vue"),
name: "Layout",
children: [
{
path: "",
name: "工作台",
children: [
{
path: "home",
name: "主页",
component: () => import("@/pages/home/index.vue"),
},
],
}
],
},
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;

10
src/style.css Normal file
View File

@ -0,0 +1,10 @@
body {
margin: 0;
}
@font-face {
font-family: 'TencentSansW7';
src: url('data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAusAA4AAAAAEJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAALkAAAABwAAAAchqPqzUdERUYAAAtwAAAAHgAAAB4AKQAbT1MvMgAAAbgAAABZAAAAYGmceoNjbWFwAAACYAAAAJcAAAHsPmfPZmdhc3AAAAtkAAAADAAAAAwACAAbZ2x5ZgAAAywAAAW8AAAG/Ivn/ztoZWFkAAABRAAAADYAAAA2E+AL5GhoZWEAAAF8AAAAIAAAACQIawJ9aG10eAAAAhQAAABMAAAATCG/Auxsb2NhAAADAAAAACwAAAAsDjIQIm1heHAAAAGcAAAAGgAAACAAfgBDbmFtZQAACOgAAAIUAAAEm0zGvtJwb3N0AAAK/AAAAGYAAAB/4wuGdnByZXAAAAL4AAAACAAAAAhwAgESAAEAAAABB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NIbXVixtqeSXly6x3TRSJjPZVjc50qKyQ2ttaUpxObVUkW15xRtXD9rg8Hs3FxRr8ATJnl93jaY2BiAIP/zQxGDNiAKBAzMjAxMjG4MLgyuDN4MHgy+DD4MwQwhDGEM0QwxDAyM7IwsjKyMbKzl+ZlGhgYGHIlFhXllxdlpmeUgISM3AwcQbSJq6sziDY1cjQA0WZGhoYAgBwU3AAAAAEAAgAIAAr//wAPAAEAAAAMAAAAFgAAAAIAAQADABQAAQAEAAAAAgAAAAAAAAABAAAAANWkJwgAAAAA2Ac3gwAAAADY+IxB')
format('woff');
font-weight: normal;
font-style: normal;
}

14
vite.config.js Normal file
View File

@ -0,0 +1,14 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
// make `@` point to `/src` so imports like `@/assets/...` work in CSS and JS
'@': path.resolve(__dirname, 'src'),
},
},
})