diff --git a/.eslintrc b/.eslintrc index 34ec7c1..4c54be6 100644 --- a/.eslintrc +++ b/.eslintrc @@ -46,6 +46,20 @@ "import/prefer-default-export": "off", "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/explicit-module-boundary-types": "off" - } + "@typescript-eslint/explicit-module-boundary-types": "off", + "vue/first-attribute-linebreak": 0 + }, + "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, + + } + } + ] } \ No newline at end of file diff --git a/package.json b/package.json index f893557..f491d1f 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "tdesign-vue-next-starter", "version": "0.0.1", "scripts": { - "start:mock": "vite --open --mode mock", - "start": "vite --open --mode development", + "dev:mock": "vite --open --mode mock", + "dev": "vite --open --mode development", "build:test": "vite build --mode test", "build": "vue-tsc --noEmit && vite build --mode release", "preview": "vite preview", @@ -17,7 +17,7 @@ "echarts": "^5.2.1", "nprogress": "^0.2.0", "qrcode.vue": "^3.2.2", - "tdesign-vue-next": "^0.4.1", + "tdesign-vue-next": "^0.5.0", "vue": "^3.1.5", "vue-router": "^4.0.11", "vue3-clipboard": "^1.0.0", diff --git a/src/App.vue b/src/App.vue index f7d008e..ad8a584 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,4 +1,21 @@ - + - + diff --git a/src/assets/assets-t-logo.svg b/src/assets/assets-t-logo.svg new file mode 100644 index 0000000..61044ed --- /dev/null +++ b/src/assets/assets-t-logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/login-bg-black.png b/src/assets/login-bg-black.png new file mode 100644 index 0000000..4f7bfaa Binary files /dev/null and b/src/assets/login-bg-black.png differ diff --git a/src/assets/login-bg-white.png b/src/assets/login-bg-white.png new file mode 100644 index 0000000..af68aa2 Binary files /dev/null and b/src/assets/login-bg-white.png differ diff --git a/src/assets/logo-full.svg b/src/assets/logo-full.svg new file mode 100644 index 0000000..5bb515d --- /dev/null +++ b/src/assets/logo-full.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/dashboard/base/index.less b/src/pages/dashboard/base/index.less index 7c6b142..1d62a37 100644 --- a/src/pages/dashboard/base/index.less +++ b/src/pages/dashboard/base/index.less @@ -1,4 +1,4 @@ -@import '@/style/index'; +@import '@/style/variables.less'; .t-tabs__content { padding-top: @spacer-3; @@ -72,7 +72,7 @@ > span { display: inline-block; - color: black; + color: @text-color-primary; font-size: 36px; line-height: 44px; } @@ -110,7 +110,7 @@ /* 计量统计 */ .dashboard-bottom-left-top-count-chart { padding: 20px 24px; - background-color: white; + background-color: @bg-color-container; border-radius: @border-radius; width: 100%; min-width: 300px; @@ -120,7 +120,7 @@ /* 动态监测 */ .dashboard-bottom-left-top-monitor-chart { padding: 20px 24px; - background-color: white; + background-color: @bg-color-container; border-radius: @border-radius; margin-left: 16px; width: 100%; @@ -130,7 +130,7 @@ /* 出入库概览() */ .dashboard-bottom-left-bottom { - background-color: white; + background-color: @bg-color-container; padding: 20px 24px; border-radius: @border-radius; margin-top: 16px; @@ -145,7 +145,7 @@ /* 右边列表-实时热度趋势 */ .dashboard-bottom-right { padding: 20px 24px; - background-color: white; + background-color: @bg-color-container; border-radius: @border-radius; margin-left: 16px; width: 426px; @@ -307,23 +307,7 @@ border-radius: 3px; } -.card-container.main-color { - background: @brand-color; - color: @text-color-primary; - - .card-describe { - color: white; - } - - .dashboard-item-top span { - color: white; - } - - .dashboard-item-block { - color: rgb(255 255 255 / 55%); - } - - .dashboard-item-bottom { - color: white; - } +.inner-card { + padding-left: 0 !important; + padding-right: 0 !important; } diff --git a/src/pages/dashboard/base/index.vue b/src/pages/dashboard/base/index.vue index 6090334..edf4583 100644 --- a/src/pages/dashboard/base/index.vue +++ b/src/pages/dashboard/base/index.vue @@ -98,7 +98,7 @@ 季度 - + {{ rowIndex + 1 }} @@ -123,7 +123,7 @@ 季度 - + {{ rowIndex + 1 }} @@ -167,15 +167,14 @@ - - - - 导出数据 - - + + + 导出数据 + + - + 1726 @@ -191,7 +190,7 @@ - + 226 @@ -206,7 +205,7 @@ - + @@ -315,6 +314,32 @@ export default defineComponent({ }, }); - + + diff --git a/src/pages/dashboard/detail/index.less b/src/pages/dashboard/detail/index.less index c214df6..b9b11e6 100644 --- a/src/pages/dashboard/detail/index.less +++ b/src/pages/dashboard/detail/index.less @@ -34,14 +34,14 @@ h1 { font-size: 36px; - color: rgba(0,0,0,.90); + color: rgb(0 0 0 / 90%); font-weight: 500; padding-top: 8px; padding-bottom: 24px; span { font-size: 14px; - color: rgba(0,0,0,.30); + color: rgb(0 0 0 / 30%); padding-left: 8px; } } @@ -52,16 +52,15 @@ align-items: center; justify-content: space-between; font-size: 14px; - color: rgba(0,0,0,.40); + color: rgb(0 0 0 / 40%); text-align: left; line-height: 22px; - + > span { display: flex; } } } - .dashboard-detail-bottom-container { @@ -70,9 +69,8 @@ border-radius: @border-radius; margin-top: 16px; min-height: 400px; - } .trend-container { margin-left: 4px; -} \ No newline at end of file +} diff --git a/src/pages/dashboard/detail/index.vue b/src/pages/dashboard/detail/index.vue index dd9921e..84ae6b7 100644 --- a/src/pages/dashboard/detail/index.vue +++ b/src/pages/dashboard/detail/index.vue @@ -1,7 +1,7 @@ - + {{ item.title }} diff --git a/src/pages/form/base/index.less b/src/pages/form/base/index.less index cdcef6c..2ca6b24 100644 --- a/src/pages/form/base/index.less +++ b/src/pages/form/base/index.less @@ -1,4 +1,4 @@ -@import '@/style/index'; +@import '@/style/variables.less'; .t-tabs__content { padding-top: @spacer-3; @@ -52,26 +52,15 @@ } .form-basic-item { - // padding: 0 60px 0 160px; .form-basic-container-title { font-style: normal; font-weight: normal; font-size: 20px; line-height: 22px; - color: rgba(0, 0, 0, .9); + color: @text-color-primary; padding: 64px 0 32px 0; } - - // .t-size-m { - // width: 100% !important; - // min-width: 280px; - // } - - // .t-form-item__type { - // // width: 100% !important; - // min-width: 280px; - // } } .tdesign-pro-panel { @@ -84,7 +73,7 @@ .form-cretifier { font-size: 14px; - color: #000000; + color: @text-color-primary;; padding-top: 24px; padding-bottom: 130px; @@ -147,7 +136,7 @@ .form-submit-upload-span { font-size: 14px; line-height: 22px; - color: rgba(0, 0, 0, .4); + color: @text-color-placeholder; padding-top: 8px; display: inline-block; } diff --git a/src/pages/list/base/index.vue b/src/pages/list/base/index.vue index 3977f32..9e3a279 100644 --- a/src/pages/list/base/index.vue +++ b/src/pages/list/base/index.vue @@ -9,7 +9,7 @@ - + @@ -67,7 +67,7 @@ + + diff --git a/src/pages/login/components/Login.vue b/src/pages/login/components/Login.vue index 4becbb3..6224f71 100644 --- a/src/pages/login/components/Login.vue +++ b/src/pages/login/components/Login.vue @@ -1,5 +1,4 @@ - - 请使用微信扫一扫登录 - 刷新 + 请使用微信扫一扫登录 + 刷新 @@ -67,7 +66,7 @@ - + 登录 diff --git a/src/pages/login/components/Register.vue b/src/pages/login/components/Register.vue index 772f70b..aae82f6 100644 --- a/src/pages/login/components/Register.vue +++ b/src/pages/login/components/Register.vue @@ -9,13 +9,7 @@ > - + @@ -25,19 +19,11 @@ - - - + + + - + @@ -88,7 +74,7 @@ import { defineComponent, ref } from 'vue'; import { MessagePlugin } from 'tdesign-vue-next'; import { useCounter } from '@/utils/hooks'; -import { passwordValidator, getEmails } from '../helper'; +import { passwordValidator } from '../helper'; const INITIAL_DATA = { phone: '', @@ -100,7 +86,10 @@ const INITIAL_DATA = { const FORM_RULES = { phone: [{ required: true, message: '手机号必填', type: 'error' }], - email: [{ required: true, email: true, message: '邮箱必填', type: 'error' }], + email: [ + { required: true, message: '邮箱必填', type: 'error' }, + { email: true, message: '请输入正确的邮箱', type: 'warning' }, + ], password: [{ required: true, message: '密码必填', type: 'error' }, { validator: passwordValidator }], verifyCode: [{ required: true, message: '验证码必填', type: 'error' }], }; @@ -109,11 +98,6 @@ export default defineComponent({ setup(props, ctx) { const type = ref('phone'); const emailOptions = ref([]); - const remoteMethod = (search: string) => { - if (search && search.indexOf('@') === -1) { - emailOptions.value = getEmails(search); - } - }; const form = ref(); const formData = ref({ ...INITIAL_DATA }); @@ -146,7 +130,6 @@ export default defineComponent({ form, type, emailOptions, - remoteMethod, countDown, handleCounter, onSubmit, diff --git a/src/pages/login/helper.ts b/src/pages/login/helper.ts index 468c7e0..3dd3eb8 100644 --- a/src/pages/login/helper.ts +++ b/src/pages/login/helper.ts @@ -8,34 +8,6 @@ export const passwordValidator = (val) => { return { result: true }; }; -export const getEmails = (search) => [ - { - value: `${search}@qq.com`, - label: `${search}@qq.com`, - }, - { - value: `${search}@gmail.com`, - label: `${search}@gmail.com`, - }, - { - value: `${search}@126.com`, - label: `${search}@126.com`, - }, - { - value: `${search}@163.com`, - label: `${search}@163.com`, - }, - { - value: `${search}@21cn.com`, - label: `${search}@21cn.com`, - }, - { - value: `${search}@yahoo.com`, - label: `${search}@yahoo.com`, - }, -]; - export default { passwordValidator, - getEmails, }; diff --git a/src/pages/login/index.less b/src/pages/login/index.less index 99bfb27..2039aad 100644 --- a/src/pages/login/index.less +++ b/src/pages/login/index.less @@ -1,9 +1,22 @@ -@import '@/style/index'; +@import '@/style/variables.less'; + +&.light { + .login-wrapper { + background-color: white; + background-image: url('@/assets/login-bg-white.png'); + } +} + +&.dark { + .login-wrapper { + background-color: @bg-color-page; + background-image: url('@/assets/login-bg-black.png'); + } +} .login-wrapper { width: 100%; height: 100%; - background-image: url('https://tdesign.gtimg.com/pro-template/login-bg-img.jpg'); background-size: cover; background-position: 50%; position: relative; @@ -11,53 +24,73 @@ .login-container { position: absolute; - top: 28%; - left: 12%; + top: 14%; + left: 5%; min-height: 500px; line-height: 22px; } .title-container { .icon { - width: 290px; - height: 40px; + width: 56px; + margin-bottom: 32px; } - .side-title { - margin-top: 24.9px; + .title { + font-size: 36px; + line-height: 44px; + color: @text-color-primary; + margin-top: 4px; - .tip1, - .tip2 { + &.margin-no { + margin-top: 0; + } + } + + .sub-title { + margin-top: 16px; + + .tip { display: inline-block; margin-right: 8px; - } - - .tip1 { font-size: 14px; - color: rgb(0 0 0 / 60%); - } - .tip2 { - font-size: 14px; - color: @brand-color-8; - cursor: pointer; + &:first-child { + color: @text-color-secondary; + } + + &:last-child { + color: @text-color-primary; + cursor: pointer; + } } } } .item-container { width: 400px; - margin-top: 64px; + margin-top: 48px; &.login-qrcode { - margin-top: 34px; - .tip-container { width: 192px; + margin-bottom: 16px; + font-size: 14px; + display: flex; + justify-content: space-between; + + .tip { + color: @text-color-primary; + } .refresh { display: flex; align-items: center; + color: @brand-color; + + .t-icon { + font-size: 14px; + } &:hover { cursor: pointer; @@ -76,14 +109,6 @@ } } - &.register-phone { - margin-top: 64px; - - .t-select-popup-reference { - margin: 0; - } - } - .check-container { display: flex; align-items: center; @@ -98,7 +123,7 @@ } span { - color: @brand-color-8; + color: @brand-color; &:hover { cursor: pointer; @@ -106,26 +131,6 @@ } } - .tip-container { - margin-bottom: 16px; - - .tip1 { - font-size: 14px; - color: rgb(0 0 0 / 60%); - } - - .tip2 { - float: right; - font-size: 14px; - color: @brand-color-8; - - .t-icon { - height: 20px; - vertical-align: text-bottom; - } - } - } - .verification-code { display: flex; align-items: center; @@ -141,10 +146,14 @@ } } } + + .btn-container { + margin-top: 48px; + } } .switch-container { - margin-top: 66px; + margin-top: 24px; .tip { font-size: 14px; @@ -173,7 +182,7 @@ .check-container { font-size: 14px; - color: rgb(0 0 0 / 60%); + color: @text-color-secondary; .tip { float: right; diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index d07564c..0ce5af6 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -1,27 +1,32 @@ + + - - - - {{ type == 'register' ? '没有账号吗?' : '已有账号?' }} - - + + 登录到 + TDesign Starter + + {{ type == 'register' ? '已有账号?' : '没有账号吗?' }} + {{ type == 'register' ? '登录' : '注册新账号' }} - +
- {{ type == 'register' ? '没有账号吗?' : '已有账号?' }} -
+ +
{{ type == 'register' ? '已有账号?' : '没有账号吗?' }}
{{ type == 'register' ? '登录' : '注册新账号' }}