初步完成前端毛坯

ginkgo
vale Q 2 years ago
parent a6b8b3010c
commit 639c586687

@ -88,16 +88,6 @@ b. 开发人员经过两年半的专业学习,拥有一定的经验和扎实
<img src="assets/clip_image002.gif" alt="img" />
## 系统数据流图和数据字典
@ -154,3 +144,14 @@ b. 开发人员经过两年半的专业学习,拥有一定的经验和扎实
![image-20221006190511004](assets/image-20221006190511004.png)
# 项目进展
2022年10月7日完成前端界面基本框架
![image-20221007162000004](assets/image-20221007162000004.png)
![image-20221007162048559](assets/image-20221007162048559.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

23
web/.gitignore vendored

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,24 @@
# web
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

28056
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,45 @@
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.0.0",
"core-js": "^3.6.5",
"vue": "^3.0.0",
"vue-router": "^4.1.5",
"vuex": "^4.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.19",
"@vue/cli-plugin-eslint": "~4.5.19",
"@vue/cli-service": "~4.5.19",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>商品订货系统</title>
</head>
<body>
<noscript>
<strong>你的浏览器太低级了,赶紧换个牛逼的</strong>
</noscript>
<div id="app"></div>
</body>
</html>
<style>
*{
margin: 0;
padding: 0;
list-style: none;
}
</style>

@ -0,0 +1,26 @@
<template>
<NavBar></NavBar>
<router-view></router-view>
</template>
<script>
import NavBar from './components/NavBar.vue';
export default {
components: {
NavBar,
},
setup() {
}
}
</script>
<style>
body{
background-image: url("../src/assets/images/background.jpg");
background-size: cover;
width: 100%;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

@ -0,0 +1,23 @@
<template>
<div class="contentfield">
<div class="kongbai"></div>
<slot></slot>
</div>
</template>
<script>
</script>
<style scoped>
.contentfield{
background-color: rgba(7, 7, 7, 0.5);
height: 40vh;
width: 80vw;
margin-top: 20px;
margin-left: 10vw;
}
.contentfield .kongbai{
height: 10vh;
}
</style>

@ -0,0 +1,68 @@
<template>
<div class="allpage">
<div class="name item">名称</div>
<div class="current_quantity item">现有数量</div>
<div class="quantity_limit item">最低数量限制</div>
<div class="purchaser item">采购人</div>
<div class="purchase_time item">采购时间</div>
</div>
</template>
<script>
</script>
<style scoped>
.allpage{
justify-content: center;
align-items: center;
}
.allpage .item{
text-align:center;
line-height:5vh;
font-size: 20px;
}
.allpage .name{
margin-left: 0.3vw;
height: 5vh;
width: 10vw;
float: left;
border-width: 0.5px;
border-style: solid;
}
.allpage .current_quantity{
float: left;
border-width: 0.5px;
border-style: solid;
border-left: 0;
height: 5vh;
width: 10vw;
}
.allpage .quantity_limit{
float: left;
border-width: 0.5px;
border-style: solid;
border-left: 0;
height: 5vh;
width: 10vw;
}
.allpage .purchaser{
float: left;
border-width: 0.5px;
border-style: solid;
border-left: 0;
height: 5vh;
width: 10vw;
}
.allpage .purchase_time{
float: left;
border-width: 0.5px;
border-style: solid;
border-left: 0;
height: 5vh;
width: 10vw;
}
</style>

@ -0,0 +1,175 @@
<template>
<div class="container">
<div class="logo">
<img src="../assets/images/logo.png" alt="logo" />
</div>
<div class="motto">
<span class="motto-item"
v-for="(item, index) in motto"
:key="index"
v-show="n === index"
>
{{ item }}
</span>
</div>
<router-link to="/kucun/" @click="changeColor1" class="item1 item">库存</router-link>
<router-link to="/dinghuo/" @click="changeColor2" class="item2 item">订货</router-link>
<div class="avatar">
<img src="../assets/images/avatar.png" alt="avatar"/>
</div>
</div>
</template>
<script>
console.log("乘风好去,长空万里,直下看山河。\n斫去桂婆娑人道是、清光更多。\n -- 辛弃疾");
import { reactive} from "vue"
import { useStore } from 'vuex';
import { useRouter } from "vue-router";
export default {
setup(){
const store = useStore();
const router = useRouter();
const currentpage = router.currentRoute.value.name;
store.commit("updatecurrentpage", currentpage);
console.log(currentpage)
console.log("store: ", store.state.currentpage)
const theme1 = reactive({
color: 'rgb(141, 139, 139)'
});
const theme2 = reactive({
color: 'rgb(141, 139, 139)'
});
if (store.state.currentpage === "kucun_index"){
theme1.color = "white"
}
else if(store.state.currentpage === "dinghuo_index"){
theme2.color = "white"
}
const changeColor1 = ()=>{
theme1.color = "white"
theme2.color = "rgb(141, 139, 139)"
};
const changeColor2 = ()=>{
theme2.color="white"
theme1.color="rgb(141, 139, 139)"
};
return {
theme1,
theme2,
changeColor1,
changeColor2,
};
},
data() {
return {
motto: [
"我见青山多妩媚,料青山见我应如是。",
"不恨古人吾不见,恨古人不见吾狂耳。",
"我最怜君中宵舞,道“男儿到死心如铁”。看试手,补天裂。",
"吾庐小,在龙蛇影外,风雨声中。",
"乘风好去,长空万里,直下看山河。",
"斫去桂婆娑,人道是、清光更多。",
"鸿鹄一再高举,天地睹方圆。",
],
n: 0,
};
},
methods: {
go() {
//n
setInterval(() => {
this.n++;
if (this.n === this.motto.length) this.n = 0;
}, 6000);
},
},
mounted(){
this.go();
}
};
</script>
<style scoped>
.router-link-active{
text-decoration: none;
}
a {
text-decoration: none;
}
.container{
height: 10vh;
width: 100%;
background-color: rgba(34,34,34);
}
.container .logo{
float: left;
height: 5vh;
width: 5vh;
margin-left: 5vw;
margin-top: 2.5vh;
}
.container .logo img{
width: 100%;
height: 100%;
}
.container .motto{
color: white;
float: left;
width: 500px;
margin-left: 10vw;
margin-top: 3vh;
}
.container .item1{
cursor: pointer;
float: left;
margin-left: 5vw;
margin-top: 2vh;
color: v-bind('theme1.color');
font-size: 4vh;
}
.container .item2{
cursor: pointer;
float: left;
margin-left: 8vw;
margin-top: 2vh;
color: v-bind('theme2.color');;
font-size: 4vh;
}
.container .item:hover{
color: white;
}
.container .avatar{
margin-top: 1vh;
margin-right: 5vw;
float: right;
height: 8vh;
width: 8vh;
}
.container .avatar img{
width: 100%;
height: 100%;
}
</style>

@ -0,0 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
createApp(App).use(store).use(router).mount('#app')

@ -0,0 +1,46 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeIndexView from '../views/home/HomeIndexView'
import KucunIndexView from "../views/kucun/KucunIndexView.vue"
import DinghuoIndexView from "../views/dinghuo/DinghuoIndexView.vue"
import NotFound from '../views/error/NotFound'
const routes = [
{
path:"/",
name: 'home',
redirect:"/home/",
},
{
path: "/home/",
name: 'home_index',
component: HomeIndexView,
},
{
path: "/kucun/",
name: 'kucun_index',
component: KucunIndexView,
},
{
path: "/dinghuo/",
name: 'dinghuo_index',
component: DinghuoIndexView,
},
{
path: "/404/",
name: '404',
component: NotFound,
},
{
path:"/:catchAll(.*)",
redirect: "/404/"
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router

@ -0,0 +1,16 @@
import { createStore } from 'vuex'
export default createStore({
state: {
currentpage:"",
},
mutations: {
updatecurrentpage(state, currentpage){
state.currentpage = currentpage
}
},
actions: {
},
modules: {
}
})

@ -0,0 +1,39 @@
<template>
<div class="allpage">
<div class="err">订货系统还在施工当中</div>
</div>
</template>
<script>
import { useRouter } from "vue-router";
import { useStore } from 'vuex';
export default{
components: {
},
setup() {
const router = useRouter();
const store = useStore();
const currentpage = router.currentRoute.value.name;
store.commit("updatecurrentpage", currentpage);
console.log(currentpage)
console.log("store: ", store.state.currentpage)
}
}
</script>
<style scoped>
.allpage{
height: 60vh;
width: 100%;
}
.allpage .err{
font-size: 50px;
color: white;
margin-top: 20vh;
margin-left: 20vw;
}
</style>

@ -0,0 +1,27 @@
<template>
<ContentField>
<div class="err_infor">
404 not found
</div>
</ContentField>
</template>
<script>
import ContentField from '../../components/ContentField.vue'
export default {
components:{
ContentField
}
}
</script>
<style scoped>
.err_infor{
margin-left: 30%;
color: white;
font-size: 10vh;
}
</style>

@ -0,0 +1,17 @@
<template>
<div class="allpage">
项目运行成功
</div>
</template>
<script>
</script>
<style scoped>
.allpage{
height: 100%;
width: 100%;
}
</style>

@ -0,0 +1,44 @@
<template>
<div class="allpage">
<div class="platform">
<KuCunDan ></KuCunDan>
</div>
</div>
</template>
<script>
import KuCunDan from "../../components/KuCunDan.vue"
import { useRouter } from "vue-router";
import { useStore } from 'vuex';
export default{
components: {
KuCunDan
},
setup() {
const router = useRouter();
const store = useStore();
const currentpage = router.currentRoute.value.name;
store.commit("updatecurrentpage", currentpage);
console.log(currentpage)
console.log("store: ", store.state.currentpage)
}
}
</script>
<style scoped>
.allpage{
height: 60vh;
width: 100%;
}
.platform{
margin-left: 20vw;
height: 60vh;
width: 51vw;
background-color: rgba(118,234,211, 0.5);
margin-top: 10vh;
}
</style>
Loading…
Cancel
Save