Browse Source

推送

master
jongbowen 2 years ago
commit
680b0a449a
  1. 24
      .gitignore
  2. 3
      .vscode/extensions.json
  3. 18
      README.md
  4. 13
      index.html
  5. 1838
      package-lock.json
  6. 23
      package.json
  7. 1
      public/vite.svg
  8. 15
      src/App.vue
  9. 1
      src/assets/vue.svg
  10. 38
      src/components/HelloWorld.vue
  11. 5
      src/main.ts
  12. 48
      src/requset/index.ts
  13. 27
      src/requset/user.ts
  14. 16
      src/router/index.ts
  15. 381
      src/style.less
  16. 1
      src/vite-env.d.ts
  17. 19
      src/viwe/login.vue
  18. 25
      tsconfig.json
  19. 10
      tsconfig.node.json
  20. 7
      vite.config.ts

24
.gitignore vendored

@ -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

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

18
README.md

@ -0,0 +1,18 @@
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript 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.
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## Type Support For `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

13
index.html

@ -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>登录</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

1838
package-lock.json generated

File diff suppressed because it is too large Load Diff

23
package.json

@ -0,0 +1,23 @@
{
"name": "vite-project",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.47",
"vue-router": "^4.2.0",
"vuex": "^4.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"less": "^4.1.3",
"typescript": "^5.0.2",
"vite": "^4.3.2",
"vue-tsc": "^1.4.2"
}
}

1
public/vite.svg

@ -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

15
src/App.vue

@ -0,0 +1,15 @@
<template>
<router-view></router-view>
</template>
<style scoped>
</style>
<script lang="ts" setup>
</script>

1
src/assets/vue.svg

@ -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

38
src/components/HelloWorld.vue

@ -0,0 +1,38 @@
<script setup lang="ts">
import { ref } from 'vue'
defineProps<{ msg: string }>()
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Install
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>

5
src/main.ts

@ -0,0 +1,5 @@
import { createApp } from 'vue'
import './style.less'
import App from './App.vue'
import router from "./router/index";
createApp(App).use(router).mount('#app')

48
src/requset/index.ts

@ -0,0 +1,48 @@
import axios from "axios";
const token=sessionStorage.getItem("token")
const requst=axios.create({
baseURL:"http://121.36.37.70:8906/",
timeout: 60000, // 请求超时时间毫秒
withCredentials: true, // 异步请求携带cookie
headers: {
// 设置后端需要的传参类型
'Content-Type': 'application/json',
'Authorization': 'Bearer '+token,
'X-Requested-With': 'XMLHttpRequest',
},
})
// 添加请求拦截器
requst.interceptors.request.use(
function (config) {
// 在发送请求之前做些什么
return config
},
function (error) {
// 对请求错误做些什么
console.log(error)
return Promise.reject(error)
}
)
// 添加响应拦截器
requst.interceptors.response.use(
function (response) {
// console.log(response)
// 2xx 范围内的状态码都会触发该函数。
// 对响应数据做点什么
// dataAxios 是 axios 返回数据中的 data
const dataAxios = response.data
// 这个状态码是和后端约定的
const code = dataAxios.reset
return dataAxios
},
function (error) {
// 超出 2xx 范围的状态码都会触发该函数。
// 对响应错误做点什么
console.log(error)
return Promise.reject(error)
}
)
export default requst

27
src/requset/user.ts

@ -0,0 +1,27 @@
// 导入axios实例
import httpRequest from "./index";
// 定义接口的传参
interface UserInfoParam {
userNameOrEmailAddress: string;
password: string;
}
// 获取用户信息
export function apiGetToken(param: UserInfoParam) {
return httpRequest({
url: "/api/TokenAuth/Authenticate",
method: "post",
data: param,
});
}
export function apiGetUserInfo() {
return httpRequest({
url: "/api/services/app/Session/GetCurrentLoginInformations",
method: "get",
data: null,
});
}
export default apiGetUserInfo;
apiGetToken;

16
src/router/index.ts

@ -0,0 +1,16 @@
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
const routes: RouteRecordRaw[] = [
{
path: "/login",
name: "login",
component: () => import("../viwe/login.vue"),
},
];
const router = createRouter({
routes,
history: createWebHistory(),
});
export default router;

381
src/style.less

@ -0,0 +1,381 @@
html,
body {
width: 100%;
height: 100%;
margin: 0 auto;
padding: 0;
overflow: hidden;
font-family: synormal !important;
}
ul,
ol,
dl,
li,
dt,
dd,
p,
form,
input,
h1,
h2,
h3,
h4,
h5,
h6,
section,
article,
aside,
header,
footer,
nav,
figure,
time,
mark,
main,
canvas {
margin: 0;
padding: 0;
}
b,
strong,
i,
em,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 500;
font-style: normal;
}
img {
border: none;
}
a {
text-decoration: none;
color: #000;
}
ul,
ol,
li {
list-style: none;
// overflow-x: hidden;
}
.clearfn:after {
content: "";
clear: both;
display: block;
overflow: hidden;
height: 0;
visibility: hidden;
}
//root标签
app-root {
height: 100%;
}
h1 {
font-size: 16px;
}
//三维场景
.dropDown {
border: 1px solid #23D9FF;
background: linear-gradient(180deg, #000D21 0%, #006E85 100%);
li:hover {
background-color: transparent;
}
li {
text-align: center;
}
.ant-checkbox-wrapper {
color: #fff;
}
}
.dropDownPlan {
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);
box-shadow: 0px 0px 6px #2399FF;
li {
color: #fff;
}
}
//任务弹窗
.taskDialog {
.ant-modal-header,
.ant-modal-content {
background: radial-gradient(circle, #004988 0%, #00122D 100%);
}
.ant-modal-header,
.ant-modal-footer {
border: none;
}
.ant-modal-title,
.ant-form-item-label>label,
.ant-input {
color: #C4E2FC;
}
.ant-modal-footer .ant-btn:first-child {
color: #C4E2FC;
background: #000D21;
border: 1px solid #C4E2FC;
}
.ant-modal-footer .ant-btn:last-child {
color: #C4E2FC;
background: rgba(0, 129, 255, 0.6);
border: 1px solid #36A2FF;
}
.ant-input {
background: rgba(145, 204, 255, 0.41);
border: 1px solid #91CCFF;
}
textarea {
resize: none;
outline: none;
}
}
.baseInfoDialog {
height: 80%;
.ant-modal-footer {
padding: 0;
}
.ant-modal-body,
.ant-modal-content {
height: 100%;
background: radial-gradient(closest-side at 50% 55%, #004988 0%, #00122D 100%);
}
}
.videoDialog {
height: 80%;
.ant-modal-body,
.ant-modal-footer {
padding: 0;
}
.ant-modal-body,
.ant-modal-content {
height: 100%;
}
canvas {
width: 100%;
height: 100%;
border: none;
outline: none;
}
}
#embed-host {
input {
color: #000;
}
}
//bbl 内置color
#threeDimensional {
//可展开面板
#disposalPlan {
font-size: 15px;
.ant-collapse-header {
width: 100%;
height: 35px;
line-height: 35px;
color: #23D9FF;
padding: 0px;
background: rgba(35, 153, 255, 0.41);
border: 1px solid rgba(35, 217, 255, 0.4);
}
.ant-collapse {
background-color: transparent;
}
.ant-collapse-content {
background-color: transparent;
width: 100%
}
}
.ant-tree {
color: #C4E2FC;
}
//tree
.ant-tree,
.ant-tree-node-content-wrapper:hover,
.ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: transparent;
}
//tree
.ant-tree-node-content-wrapper {
width: 100%;
}
//tree
.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
color: #fff;
}
//select
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
border: none;
border-radius: 0px;
}
//select
.ant-collapse,
.ant-collapse-item,
.ant-collapse-header,
.ant-collapse-content {
border-radius: 0px;
border: none;
}
//可展开面板
.ant-collapse-content {
background: rgba(0, 59, 110, 0.9);
color: #fff;
}
//可展开面板
.ant-collapse-content-box {
padding: 0;
}
//可展开面板
.ant-collapse-header {
//可展开面板
// padding: 0 0 0 25px;
padding: 0;
padding-left: 5px;
height: 30px;
line-height: 28px;
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);
border: 1px solid rgba(35, 217, 255, 0.4);
color: #23D9FF;
.ant-collapse-arrow {
left: 5px;
}
//可展开面板
}
.ant-steps-dot .ant-steps-item-tail,
.ant-steps-dot.ant-steps-small .ant-steps-item-tail {
top: 15px;
}
//步骤条
//滚动条样式
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-thumb {
background-image: linear-gradient(#2495f8, #1c73c2, #02233f, );
}
::-webkit-scrollbar-track {
background-color: #0d4070;
}
}
#container {
flex: 1;
position: relative;
height: 46px;
overflow: hidden;
}
#list-wrapper {
position: relative;
}
ul {
list-style: none;
}
.info {
flex: 1;
display: flex;
height: 46px;
line-height: 46px;
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
.infoitem {
flex: 1;
display: flex;
align-items: center;
img {
width: 40px;
}
color: #fff;
}
.btn {
color: #36A2FF;
span {
cursor: pointer;
}
span:nth-child(1) {
margin-right: 24px;
}
span:nth-child(2) {
margin-right: 40px;
}
}
}
.spin {
background: rgb(134, 131, 131, 0.2);
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
left: 0;
top: 0;
}

1
src/vite-env.d.ts vendored

@ -0,0 +1 @@
/// <reference types="vite/client" />

19
src/viwe/login.vue

@ -0,0 +1,19 @@
<template>
<div class="box">
登录页
</div>
</template>
<script lang="ts" setup>
import { onMounted } from "vue";
onMounted(()=>{
})
</script>
<style lang="less" scoped>
.box {
color: black;
}
</style>

25
tsconfig.json

@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}

10
tsconfig.node.json

@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

7
vite.config.ts

@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
})
Loading…
Cancel
Save