V0.1
This commit is contained in:
commit
866d6ecb72
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal 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
3
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["Vue.volar"]
|
||||
}
|
||||
5
README.md
Normal file
5
README.md
Normal 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
13
index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="src/assets/logo.png" />
|
||||
<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.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1824
package-lock.json
generated
Normal file
1824
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "ipbs_v_server_web",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.9",
|
||||
"element-plus": "^2.9.3",
|
||||
"nprogress": "^0.2.0",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arco-design/web-vue": "^2.56.3",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"vite": "^6.1.0"
|
||||
}
|
||||
}
|
||||
1
public/vite.svg
Normal file
1
public/vite.svg
Normal 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 |
43
router/router.js
Normal file
43
router/router.js
Normal file
@ -0,0 +1,43 @@
|
||||
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'
|
||||
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'// nprogress样式文件
|
||||
|
||||
import UI_1 from "../src/components/Aside/UI_1.vue";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/UI_1',
|
||||
component: UI_1
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
// history: createWebHistory(import.meta.env.BASE_URL),
|
||||
history:createWebHashHistory(),
|
||||
routes,
|
||||
});
|
||||
|
||||
//当路由开始跳转时
|
||||
router.beforeEach((to, from , next) => {
|
||||
// 开启进度条
|
||||
NProgress.start();
|
||||
// 这个一定要加,没有next()页面不会跳转的。这部分还不清楚的去翻一下官网就明白了
|
||||
next();
|
||||
});
|
||||
//当路由跳转结束后
|
||||
router.afterEach(() => {
|
||||
// 关闭进度条
|
||||
NProgress.done()
|
||||
});
|
||||
|
||||
NProgress.configure({
|
||||
easing: 'ease', // 动画方式
|
||||
speed: 500, // 递增进度条的速度
|
||||
showSpinner: false, // 是否显示加载ico
|
||||
trickleSpeed: 200, // 自动递增间隔
|
||||
minimum: 0.3 // 初始化时的最小百分比
|
||||
})
|
||||
|
||||
|
||||
export default router
|
||||
19
src/App.vue
Normal file
19
src/App.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div class="MainBox">
|
||||
<Home/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Home from "./components/Main/Home.vue";
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.MainBox{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
BIN
src/assets/User.jpeg
Normal file
BIN
src/assets/User.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
78
src/components/Aside/UI_1.vue
Normal file
78
src/components/Aside/UI_1.vue
Normal file
@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<div class="form-container">
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form-item label="许可证激活时长">
|
||||
<el-row style="width: 100%;">
|
||||
<el-input type="number" v-model="form.Duration" style="width: 55%;" :min="1" :disabled="form.region === 4"/>
|
||||
<el-select v-model="form.region" placeholder="请选择时间单位" style="width: 20%;">
|
||||
<el-option label="天" :value="1"></el-option>
|
||||
<el-option label="月" :value="2"></el-option>
|
||||
<el-option label="年" :value="3"></el-option>
|
||||
<el-option label="永久" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标机器序列号">
|
||||
<el-input v-model="form.target" style="width: 80%;" type="textarea" rows="3"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="许可证激活码">
|
||||
<el-input type="textarea" v-model="DataDB.data" style="width: 80%;" rows="15"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSubmit">生成激活码</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive, ref} from 'vue'
|
||||
import {Api, RequestPost} from "../JS/RequestAPI.js";
|
||||
import {ElMessage} from "element-plus";
|
||||
const form = reactive({
|
||||
Duration: 1,
|
||||
region: 2,
|
||||
target: '',
|
||||
Minutes:0,
|
||||
EffectiveD:5,
|
||||
});
|
||||
const DataDB = reactive({
|
||||
data: '',
|
||||
})
|
||||
function handleSubmit() {
|
||||
if(form.region === 1){
|
||||
form.Minutes = form.Duration * 24;
|
||||
}
|
||||
else if(form.region === 2){
|
||||
form.Minutes = form.Duration * 24 * 30;
|
||||
}
|
||||
else if(form.region === 3){
|
||||
form.Minutes = form.Duration * 24 * 30 * 12;
|
||||
}
|
||||
console.log(form);
|
||||
RequestPost(Api.GetALicense,form,(res)=>{
|
||||
const data = res.data;
|
||||
if(data !== "NO"){
|
||||
DataDB.data = data.target;
|
||||
ElMessage.success('生成成功!');
|
||||
}
|
||||
else {
|
||||
ElMessage.error('生成失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
height: 100vh; /* 使容器高度占满整个视口 */
|
||||
}
|
||||
|
||||
.el-form {
|
||||
max-width: 500px; /* 设置表单的最大宽度 */
|
||||
width: 100%; /* 使表单宽度自适应 */
|
||||
}
|
||||
</style>
|
||||
13
src/components/JS/RequestAPI.js
Normal file
13
src/components/JS/RequestAPI.js
Normal file
@ -0,0 +1,13 @@
|
||||
import axios from "axios";
|
||||
import {reactive, ref} from "vue";
|
||||
const RootURL = '/api';// /api
|
||||
export const Api = reactive({
|
||||
GetALicense: ref(RootURL + '/ActivationCode'),
|
||||
})
|
||||
export function RequestPost(url, data,call){
|
||||
axios.post(url,data).then(res=>{
|
||||
call(res);
|
||||
}).catch(err=>{
|
||||
console.error(err);
|
||||
})
|
||||
}
|
||||
45
src/components/Main/Home.vue
Normal file
45
src/components/Main/Home.vue
Normal file
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<el-menu
|
||||
class="el-menu-demo"
|
||||
mode="horizontal"
|
||||
:ellipsis="false"
|
||||
@select="handleSelect"
|
||||
style="height: 80px;"
|
||||
>
|
||||
<el-menu-item index="0">
|
||||
<img
|
||||
style="width: 100px"
|
||||
:src="logo"
|
||||
alt="Element logo"
|
||||
/>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<div style="height: calc(100vh - 80px)">
|
||||
<el-scrollbar>
|
||||
<router-view></router-view>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import logo from '/src/assets/logo.png';
|
||||
import {onMounted} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
const router = useRouter();
|
||||
onMounted(()=>{
|
||||
router.push('/UI_1');
|
||||
})
|
||||
function handleSelect(key, keyPath){
|
||||
// console.log(key, keyPath);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
</style>
|
||||
13
src/main.js
Normal file
13
src/main.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { createApp } from 'vue'
|
||||
import ArcoVue from '@arco-design/web-vue';
|
||||
import App from './App.vue';
|
||||
import '@arco-design/web-vue/dist/arco.css';
|
||||
import router from "../router/router.js";
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(ArcoVue);
|
||||
app.use(router);
|
||||
app.use(ElementPlus)
|
||||
app.mount('#app');
|
||||
79
src/style.css
Normal file
79
src/style.css
Normal file
@ -0,0 +1,79 @@
|
||||
:root {
|
||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
|
||||
color-scheme: light dark;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
background-color: #242424;
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: 500;
|
||||
color: #646cff;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
a:hover {
|
||||
color: #535bf2;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3.2em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
background-color: #1a1a1a;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.25s;
|
||||
}
|
||||
button:hover {
|
||||
border-color: #646cff;
|
||||
}
|
||||
button:focus,
|
||||
button:focus-visible {
|
||||
outline: 4px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
color: #213547;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
a:hover {
|
||||
color: #747bff;
|
||||
}
|
||||
button {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
}
|
||||
23
vite.config.js
Normal file
23
vite.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 5174,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8888/',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
},
|
||||
'/sock': {
|
||||
target: 'ws://192.168.1.24:8888/',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/sock/, '')
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [vue()],
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user