feat: #20220802 yu
This commit is contained in:
parent
5f8697507a
commit
f9ddd2af62
3
resources/frontend/.browserslistrc
Normal file
3
resources/frontend/.browserslistrc
Normal file
@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
17
resources/frontend/.eslintrc.js
vendored
Normal file
17
resources/frontend/.eslintrc.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'plugin:vue/essential',
|
||||
'@vue/standard'
|
||||
],
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
||||
23
resources/frontend/.gitignore
vendored
Normal file
23
resources/frontend/.gitignore
vendored
Normal file
@ -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?
|
||||
24
resources/frontend/README.md
Normal file
24
resources/frontend/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# hello-world
|
||||
|
||||
## 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/).
|
||||
5
resources/frontend/babel.config.js
vendored
Normal file
5
resources/frontend/babel.config.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
13478
resources/frontend/package-lock.json
generated
Normal file
13478
resources/frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
resources/frontend/package.json
Normal file
49
resources/frontend/package.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "hello-world",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"echarts": "^5.3.2",
|
||||
"element-ui": "^2.15.8",
|
||||
"js-cookie": "^3.0.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-router": "^3.2.0",
|
||||
"vuex": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"lint-staged": "^9.5.0",
|
||||
"sass": "^1.26.5",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"gitHooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,vue}": [
|
||||
"vue-cli-service lint",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
resources/frontend/public/favicon.ico
Normal file
BIN
resources/frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
resources/frontend/public/index.html
Normal file
17
resources/frontend/public/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
19
resources/frontend/src/App.vue
Normal file
19
resources/frontend/src/App.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from '@/util/auth'
|
||||
export default {
|
||||
created () {
|
||||
if (!getToken()) {
|
||||
this.$router.push({ name: 'logo' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
10
resources/frontend/src/api/goods.js
vendored
Normal file
10
resources/frontend/src/api/goods.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import http from '@/util/http.js'
|
||||
|
||||
// 商品管理列表
|
||||
export function goods (data) {
|
||||
return http({
|
||||
url: '/api/goods',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
9
resources/frontend/src/api/menu.js
vendored
Normal file
9
resources/frontend/src/api/menu.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import http from '@/util/http.js'
|
||||
|
||||
// 商品管理列表
|
||||
export function getMenu () {
|
||||
return http({
|
||||
url: '/api/menus',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
109
resources/frontend/src/api/rankingData.js
vendored
Normal file
109
resources/frontend/src/api/rankingData.js
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* @Description: 排名
|
||||
* @Author: chenzhiwei (725551805@qq.com)
|
||||
* @Date: 2021-08-02 16:09:41
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-03-03 22:17:09
|
||||
* @FilePath: /glxt/src/api/rankingData.js
|
||||
*/
|
||||
|
||||
import http from '@/util/http.js'
|
||||
// export function rankingData(data) {
|
||||
// // 传递参数
|
||||
// return http({
|
||||
// url: "newh5app/api/mobile/v1/music/rank/16/",
|
||||
// method: "get",
|
||||
// params: data // 传递参数
|
||||
// });
|
||||
// }
|
||||
|
||||
export function postadd (params) {
|
||||
// 传递id
|
||||
return http({
|
||||
url: '/api/admin/auth/login', // 传递id
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 列表
|
||||
export function store_list (params) {
|
||||
return http({
|
||||
url: '/api/admin/shopGroups',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function storeDetail (params) {
|
||||
return http({
|
||||
url: '/storess/show',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
// 鲜花项目接口从这里开始
|
||||
// 商品种类列表
|
||||
export function goods_types (data) {
|
||||
return http({
|
||||
url: '/api/goods_types',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 商品种类列表删除
|
||||
export function Delgoods_types (id) {
|
||||
return http({
|
||||
url: `/api/goods_types/${id}`,
|
||||
method: 'delete',
|
||||
|
||||
})
|
||||
}
|
||||
// 新增种类
|
||||
export function Addgoods_types (data) {
|
||||
return http({
|
||||
url: `/api/goods_types/`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 编辑种类
|
||||
export function editGoods_types (id,data) {
|
||||
return http({
|
||||
url: `/api/goods_types/${id}`,
|
||||
method: 'patch',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 商品品牌列表
|
||||
export function Brand_goods_types (data) {
|
||||
return http({
|
||||
url: '/api/goods_brands',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 商品品牌列表删除
|
||||
export function DelBrand_goods_types (id) {
|
||||
return http({
|
||||
url: `/api/goods_brands/${id}`,
|
||||
method: 'delete',
|
||||
|
||||
})
|
||||
}
|
||||
// 新增品牌
|
||||
export function AddBrandgoods_types (data) {
|
||||
return http({
|
||||
url: '/api/goods_brands',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 编辑品牌
|
||||
export function editBrand_types(id,data) {
|
||||
return http({
|
||||
url: `/api/goods_brands/${id}`,
|
||||
method: 'patch',
|
||||
data
|
||||
})
|
||||
}
|
||||
BIN
resources/frontend/src/assets/logo.png
Normal file
BIN
resources/frontend/src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
152
resources/frontend/src/components/mapDrag/index.vue
Normal file
152
resources/frontend/src/components/mapDrag/index.vue
Normal file
@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="m-map">
|
||||
<div class="search" v-if="placeSearch">
|
||||
<div id="js-result" v-show="searchKey" class="result"></div>
|
||||
</div>
|
||||
<div id="js-container" class="map">正在加载数据 ...</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import remoteLoad from '@/util/remoteLoad.js'
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: '4c7f32be1ae23595dd423fbdf337df3f'
|
||||
}
|
||||
// import { MapKey } from './config'
|
||||
export default {
|
||||
name: 'MapDrag',
|
||||
props: {
|
||||
searchKey: {
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// searchKey: "",
|
||||
placeSearch: null,
|
||||
dragStatus: false,
|
||||
AMapUI: null,
|
||||
AMap: null,
|
||||
city: '',
|
||||
geolocation: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
searchKey () {
|
||||
if (this.searchKey === '') {
|
||||
this.placeSearch.clear()
|
||||
}
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
// 已载入高德地图API,则直接初始化地图
|
||||
if (window.AMap && window.AMapUI) {
|
||||
this.initMap()
|
||||
// 未载入高德地图API,则先载入API再初始化
|
||||
} else {
|
||||
await remoteLoad('https://webapi.amap.com/maps?v=2.0&key=4b083a38fc17ad7c5e3df667931e0cf0')
|
||||
await remoteLoad('https://webapi.amap.com/ui/1.1/main.js')
|
||||
this.initMap()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索
|
||||
handleSearch () {
|
||||
console.log(this.searchKey, '33333oooo')
|
||||
if (this.searchKey) {
|
||||
this.placeSearch.search(this.searchKey)
|
||||
}
|
||||
},
|
||||
// 实例化地图
|
||||
initMap () {
|
||||
// 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
|
||||
const AMapUI = (this.AMapUI = window.AMapUI)
|
||||
const AMap = (this.AMap = window.AMap)
|
||||
|
||||
const that = this
|
||||
|
||||
AMapUI.loadUI(['misc/PositionPicker'], (PositionPicker) => {
|
||||
const mapConfig = {
|
||||
zoom: 16
|
||||
}
|
||||
const map = new AMap.Map('js-container', mapConfig)
|
||||
// 获得当前定位的城市
|
||||
AMap.plugin('AMap.CitySearch', function () {
|
||||
const citySearch = new AMap.CitySearch()
|
||||
console.log('citySearch', citySearch)
|
||||
// 加载地图搜索插件
|
||||
AMap.plugin('AMap.PlaceSearch', () => {
|
||||
that.placeSearch = new AMap.PlaceSearch({
|
||||
pageSize: 5,
|
||||
pageIndex: 1,
|
||||
citylimit: false,
|
||||
map: map,
|
||||
panel: 'js-result'
|
||||
// city: that.city, // 设定搜索城市
|
||||
})
|
||||
AMap.Event.addListener(that.placeSearch, 'listElementClick', function (e) {
|
||||
that.$emit('listElementClick', e)
|
||||
})
|
||||
AMap.Event.addListener(that.placeSearch, 'markerClick', function (e) {
|
||||
that.$emit('listElementClick', e)
|
||||
})
|
||||
})
|
||||
// citySearch.getLocalCity(function (status, result) {
|
||||
// console.log('getLocalCity', status, result)
|
||||
// if (status === 'complete' && result.info === 'OK') {
|
||||
// // 查询成功,result即为当前所在城市信息
|
||||
// that.city = result.adcode
|
||||
// }
|
||||
// })
|
||||
})
|
||||
// 启用工具条
|
||||
AMap.plugin(['AMap.ToolBar', 'AMap.Scale', 'AMap.Geolocation'], function () {
|
||||
map.addControl(
|
||||
new AMap.ToolBar({
|
||||
position: 'RB'
|
||||
})
|
||||
)
|
||||
map.addControl(
|
||||
new AMap.Scale({
|
||||
position: 'LB'
|
||||
})
|
||||
)
|
||||
})
|
||||
// 创建地图拖拽
|
||||
const positionPicker = new PositionPicker({
|
||||
mode: 'dragMap', // 设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMap'
|
||||
map: map // 依赖地图对象
|
||||
})
|
||||
|
||||
// 启动拖放
|
||||
positionPicker.start()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.m-map {
|
||||
max-width: 700px;
|
||||
max-height: 462px;
|
||||
position: relative;
|
||||
}
|
||||
.m-map .map {
|
||||
min-width: 700px;
|
||||
min-height: 462px;
|
||||
}
|
||||
.m-map .search {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
width: 285px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.m-map .result {
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
12
resources/frontend/src/css/style.css
vendored
Normal file
12
resources/frontend/src/css/style.css
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
* {
|
||||
padding: 0 0;
|
||||
margin: 0 0;
|
||||
}
|
||||
body,html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
25
resources/frontend/src/main.js
vendored
Normal file
25
resources/frontend/src/main.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
import '@/css/style.css'
|
||||
import './router/index2'
|
||||
|
||||
|
||||
// import Router from 'vue-router'
|
||||
// const routerPush = Router.prototype.push
|
||||
// Router.prototype.push = function push(location) {
|
||||
// return routerPush.call(this, location).catch(error=> error)
|
||||
// }
|
||||
|
||||
Vue.use(ElementUI)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
12
resources/frontend/src/router/index.js
vendored
Normal file
12
resources/frontend/src/router/index.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const createRouter = () =>
|
||||
new VueRouter({
|
||||
scrollBehavior: () => ({ y: 0 })
|
||||
})
|
||||
|
||||
const router = createRouter()
|
||||
export default router
|
||||
77
resources/frontend/src/router/index1.js
vendored
Normal file
77
resources/frontend/src/router/index1.js
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: czw (725551805@qq.com)
|
||||
* @Date: 2022-02-25 10:40:17
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-03-01 20:29:32
|
||||
* @FilePath: /glxt/src/router/index1.js
|
||||
*/
|
||||
|
||||
const list = [
|
||||
{
|
||||
path: '/logo',
|
||||
name: 'logo',
|
||||
component: () => import('../views/logo.vue')
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('../views/index.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'GOODS_LIST',
|
||||
name: '商品列表',
|
||||
component: () => import('../views/yingyeting/yingyeting.vue')
|
||||
},
|
||||
{
|
||||
path: 'GOODS_TYPE',
|
||||
name: '商品种类',
|
||||
component: () => import('../views/home/home.vue')
|
||||
},
|
||||
{
|
||||
path: 'GOODS_BRAND',
|
||||
name: '商品品牌',
|
||||
component: () => import('../views/brand/brand.vue')
|
||||
},
|
||||
{
|
||||
path: 'SHOP_MANAGE',
|
||||
name: '店铺管理',
|
||||
component: () => import('../views/store/store.vue')
|
||||
},
|
||||
{
|
||||
path: 'USER_MANAGE',
|
||||
name: '用户管理',
|
||||
component: () => import('../views/users/users.vue')
|
||||
},
|
||||
{
|
||||
path: 'ROLE_MANAGE',
|
||||
name: '角色管理',
|
||||
component: () => import('../views/system/role.vue')
|
||||
},
|
||||
{
|
||||
path: 'PERMISSION_MANAGE',
|
||||
name: '权限管理',
|
||||
component: () => import('../views/system/authority.vue')
|
||||
},
|
||||
{
|
||||
path: 'SYSTEM_LOG',
|
||||
name: '商品记录',
|
||||
component: () => import('../views/shuju/shuju.vue')
|
||||
},
|
||||
{
|
||||
path: '/index/yingyeting/addgoods',
|
||||
name: '新建商品',
|
||||
component: () => import('../views/yingyeting/addgoods/addgoods.vue')
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: 'GOODS_LIST'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/index'
|
||||
}
|
||||
]
|
||||
|
||||
export default list
|
||||
18
resources/frontend/src/router/index2.js
vendored
Normal file
18
resources/frontend/src/router/index2.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: czw (725551805@qq.com)
|
||||
* @Date: 2022-02-25 10:40:25
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-02-25 12:18:31
|
||||
* @FilePath: /glxt/src/router/index2.js
|
||||
*/
|
||||
|
||||
import router from './index'
|
||||
import Home from './index1'
|
||||
// console.log(...Home);
|
||||
|
||||
Home.forEach(element => {
|
||||
router.addRoute(element) // 动态添加更多的路由规则
|
||||
})
|
||||
|
||||
// 菜单路由数据
|
||||
15
resources/frontend/src/store/index.js
vendored
Normal file
15
resources/frontend/src/store/index.js
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
},
|
||||
mutations: {
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
})
|
||||
13
resources/frontend/src/util/auth.js
vendored
Normal file
13
resources/frontend/src/util/auth.js
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
const TokenKey = 'admin_token'
|
||||
// 获取token
|
||||
export function getToken () {
|
||||
return localStorage.getItem(TokenKey)
|
||||
}
|
||||
// 设置token
|
||||
export function setToken (token) {
|
||||
return localStorage.setItem(TokenKey, token)
|
||||
}
|
||||
// 删除token
|
||||
export function removeToken () {
|
||||
return localStorage.removeItem(TokenKey)
|
||||
}
|
||||
82
resources/frontend/src/util/http.js
vendored
Normal file
82
resources/frontend/src/util/http.js
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* @Description: api请求
|
||||
* @Author: chenzhiwei (725551805@qq.com)
|
||||
* @Date: 2021-08-02 15:52:34
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-03-13 11:05:08
|
||||
* @FilePath: /glxt/src/util/http.js
|
||||
*/
|
||||
import axios from 'axios'
|
||||
import { getToken } from '@/util/auth'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { Message } from 'element-ui'
|
||||
import router from '@/router'
|
||||
var instance = axios.create({
|
||||
|
||||
timeout: 10000
|
||||
})
|
||||
|
||||
instance.interceptors.request.use(
|
||||
config => {
|
||||
// config.headers['content-type'] = 'application/json'
|
||||
|
||||
// config.headers['Shop-Id'] = localStorage.getItem('shopId') || 1
|
||||
|
||||
// 在发送请求之前做些什么
|
||||
// config.headers.Authorization = 'Bearer' + getToken() // 请求头
|
||||
// config.headers['content-type'] = 'application/json'
|
||||
config.headers.Authorization = 'Bearer ' + getToken() // 请求头
|
||||
NProgress.start()
|
||||
console.log(config, '1111') // for debug
|
||||
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
// 对请求错误做些什么
|
||||
console.log(error, '222222') // for debug
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
instance.interceptors.response.use(
|
||||
response => {
|
||||
NProgress.done()
|
||||
const res = response.status
|
||||
// 对响应数据做点什么
|
||||
console.log(response, '33333') // for debug
|
||||
if (res === 200 || res === 201) {
|
||||
return response
|
||||
} else {
|
||||
Message({
|
||||
message: 'Error',
|
||||
type: 'error'
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
error => {
|
||||
// 对响应错误做点什么
|
||||
|
||||
console.log(error, '44444') // for debug
|
||||
// if (error.response.status === 401) {
|
||||
// Message({
|
||||
// message: '账户登录过期,请重新登录',
|
||||
// type: 'error'
|
||||
|
||||
// })
|
||||
// router.push('/login')
|
||||
// } else {
|
||||
// Message({
|
||||
// message: error.response || 'Error',
|
||||
// type: 'error'
|
||||
|
||||
// })
|
||||
// }
|
||||
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default instance
|
||||
64
resources/frontend/src/util/remoteLoad.js
vendored
Normal file
64
resources/frontend/src/util/remoteLoad.js
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* @Author: 陈智伟 9459156+chen-kaitao@user.noreply.gitee.com
|
||||
* @Date: 2021-10-05 11:34:34
|
||||
* @LastEditors: 陈智伟 9459156+chen-kaitao@user.noreply.gitee.com
|
||||
* @LastEditTime: 2022-07-23 10:20:28
|
||||
* @FilePath: /glxt/src/util/remoteLoad.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
export default function remoteLoad (url, hasCallback) {
|
||||
return createScript(url)
|
||||
/**
|
||||
* 创建script
|
||||
* @param url
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function createScript (url) {
|
||||
const scriptElement = document.createElement('script')
|
||||
document.body.appendChild(scriptElement)
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
scriptElement.addEventListener(
|
||||
'load',
|
||||
(e) => {
|
||||
removeScript(scriptElement)
|
||||
if (!hasCallback) {
|
||||
resolve(e)
|
||||
}
|
||||
},
|
||||
false
|
||||
)
|
||||
|
||||
scriptElement.addEventListener(
|
||||
'error',
|
||||
(e) => {
|
||||
removeScript(scriptElement)
|
||||
reject(e)
|
||||
},
|
||||
false
|
||||
)
|
||||
|
||||
if (hasCallback) {
|
||||
window.____callback____ = function () {
|
||||
resolve()
|
||||
window.____callback____ = null
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (hasCallback) {
|
||||
url += '&callback=____callback____'
|
||||
}
|
||||
|
||||
scriptElement.src = url
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除script标签
|
||||
* @param scriptElement script dom
|
||||
*/
|
||||
function removeScript (scriptElement) {
|
||||
document.body.removeChild(scriptElement)
|
||||
}
|
||||
}
|
||||
199
resources/frontend/src/views/brand/brand.vue
Normal file
199
resources/frontend/src/views/brand/brand.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-button type="primary"
|
||||
@click="handAdd">新增</el-button>
|
||||
<el-table ref="multipleTable"
|
||||
:data="tableData"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="商品种类">
|
||||
</el-table-column>
|
||||
<el-table-column prop=""
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary"
|
||||
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
|
||||
<el-button type="danger"
|
||||
@click="handdel(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-pagination @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="per_page"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 新增种类对话框 -->
|
||||
<el-dialog title="新增种类"
|
||||
:visible.sync="dialogFormVisible">
|
||||
<el-form :model="form">
|
||||
<el-form-item label="商品种类"
|
||||
:label-width="formLabelWidth">
|
||||
<el-input v-model="form.kindName"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer"
|
||||
class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="addSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑 -->
|
||||
<el-dialog title="编辑"
|
||||
:visible.sync="dialogFormVisible1">
|
||||
<el-form :model="form1">
|
||||
<el-form-item label="编辑种类"
|
||||
:label-width="formLabelWidth1">
|
||||
<el-input v-model="form1.kindName1"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer"
|
||||
class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="EditSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
Brand_goods_types,
|
||||
DelBrand_goods_types,
|
||||
AddBrandgoods_types,
|
||||
editBrand_types,
|
||||
} from '../../api/rankingData'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: '', //每一项的id
|
||||
page: 1,
|
||||
per_page: 15,
|
||||
tableData: [],
|
||||
multipleSelection: [],
|
||||
currentPage4: 4,
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
kindName: '', //种类名
|
||||
},
|
||||
form1: {
|
||||
kindName1: '', //种类名
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
formLabelWidth1: '120px',
|
||||
newKind: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getGoods_types()
|
||||
},
|
||||
methods: {
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
},
|
||||
// 新增
|
||||
handAdd() {
|
||||
this.form.kindName = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 确认新增
|
||||
addSubmit() {
|
||||
var string
|
||||
string = this.form.kindName.replace(/\s/g, ',').split(',')
|
||||
console.log(string, 'lkkkk')
|
||||
AddBrandgoods_types({
|
||||
names: string,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功',
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 编辑
|
||||
handEdit(id, item) {
|
||||
this.id = id
|
||||
console.log('item', item)
|
||||
this.form1.kindName1 = item.name
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑确定按钮
|
||||
EditSubmit() {
|
||||
editBrand_types(this.id, {
|
||||
name: this.form1.kindName1,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '编辑成功',
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
// 删除
|
||||
handdel(id) {
|
||||
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
DelBrand_goods_types(id).then((res) => {
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除',
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取列表
|
||||
getGoods_types() {
|
||||
Brand_goods_types({
|
||||
page: this.page,
|
||||
per_page: this.per_page,
|
||||
}).then((res) => {
|
||||
console.log('res=>>>>>>>>', res)
|
||||
this.tableData = res.data.data
|
||||
this.total = res.data.data.length
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
206
resources/frontend/src/views/home/home.vue
Normal file
206
resources/frontend/src/views/home/home.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-button type="primary"
|
||||
@click="handAdd">新增</el-button>
|
||||
<el-table ref="multipleTable"
|
||||
:data="tableData"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="商品种类">
|
||||
</el-table-column>
|
||||
<el-table-column prop=""
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary"
|
||||
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
|
||||
<el-button type="danger"
|
||||
@click="handdel(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-pagination @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-size="per_page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
<!-- 新增种类对话框 -->
|
||||
<el-dialog title="新增"
|
||||
:visible.sync="dialogFormVisible">
|
||||
<el-form :model="form">
|
||||
<el-form-item label="商品种类"
|
||||
:label-width="formLabelWidth">
|
||||
<el-input v-model="form.kindName"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer"
|
||||
class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="addSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑 -->
|
||||
<el-dialog title="编辑"
|
||||
:visible.sync="dialogFormVisible1">
|
||||
<el-form :model="form1">
|
||||
<el-form-item label="编辑种类"
|
||||
:label-width="formLabelWidth1">
|
||||
<el-input v-model="form1.kindName1"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer"
|
||||
class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="EditSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
goods_types,
|
||||
Delgoods_types,
|
||||
Addgoods_types,
|
||||
editGoods_types,
|
||||
} from '../../api/rankingData'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: '', //每一项的id
|
||||
page: 1, //开始页
|
||||
per_page: 10, //一页多少数据
|
||||
total: 1,
|
||||
tableData: [],
|
||||
multipleSelection: [],
|
||||
currentPage4: 4,
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
kindName: '', //种类名
|
||||
},
|
||||
form1: {
|
||||
kindName1: '', //种类名
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
formLabelWidth1: '120px',
|
||||
newKind: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getGoods_types()
|
||||
},
|
||||
methods: {
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
this.per_page = val
|
||||
this.page = 1
|
||||
this.getGoods_types()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
this.page = val
|
||||
this.getGoods_types()
|
||||
},
|
||||
// 新增
|
||||
handAdd() {
|
||||
this.form.kindName = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 确认新增
|
||||
addSubmit() {
|
||||
var string
|
||||
string = this.form.kindName.replace(/\s/g, ',').split(',')
|
||||
console.log(string, 'lkkkk')
|
||||
Addgoods_types({
|
||||
names: string,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功',
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 编辑
|
||||
handEdit(id, item) {
|
||||
this.id = id
|
||||
console.log('item', item)
|
||||
this.form1.kindName1 = item.name
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑确定按钮
|
||||
EditSubmit() {
|
||||
editGoods_types(this.id, {
|
||||
name: this.form1.kindName1,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '编辑成功',
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
// 删除
|
||||
handdel(id) {
|
||||
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
Delgoods_types(id).then((res) => {
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除',
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取列表
|
||||
getGoods_types() {
|
||||
goods_types({
|
||||
page: this.page,
|
||||
per_page: this.per_page,
|
||||
}).then((res) => {
|
||||
console.log('res=>>>>>>>>', res)
|
||||
this.tableData = res.data.data
|
||||
this.total = res.data.data.length
|
||||
this.page = res.meta.current_page
|
||||
this.per_page = res.meta.per_page
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
40
resources/frontend/src/views/home/home/cesi.vue
Normal file
40
resources/frontend/src/views/home/home/cesi.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Author: czw (725551805@qq.com)
|
||||
* @Date: 2022-04-12 15:15:08
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-04-12 15:16:41
|
||||
* @FilePath: /glxt/src/views/home/home/cesi.vue
|
||||
-->
|
||||
<template>
|
||||
<div >
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 防止按钮多次提交
|
||||
preventRepeatClick () {
|
||||
this.isDisabled = true
|
||||
setTimeout(() => {
|
||||
this.isDisabled = false
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
221
resources/frontend/src/views/home/home/index.vue
Normal file
221
resources/frontend/src/views/home/home/index.vue
Normal file
@ -0,0 +1,221 @@
|
||||
<!--
|
||||
* @Description:头像上传组件
|
||||
* @Author: czw (725551805@qq.com)
|
||||
* @Date: 2022-03-03 18:50:30
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-03-14 09:14:24
|
||||
* @FilePath: /glxt/src/views/home/home/index.vue
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
name="image"
|
||||
:action="uploadAction"
|
||||
:headers="uploadHeaders"
|
||||
:on-preview="handleChange"
|
||||
:on-remove="beforeRemove"
|
||||
:on-success='good'
|
||||
:file-list="img"
|
||||
:limit="number"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-change="handleEditChange"
|
||||
accept=".png,.jpg"
|
||||
list-type="picture-card"
|
||||
:class="hideUploadEdit?'hide':''"
|
||||
:show-file-list='true'
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
|
||||
<div class="demo-image__preview" v-if='imageUrl'>
|
||||
<el-image
|
||||
class="hidden__el-image"
|
||||
ref="elImage"
|
||||
:src="imageUrl"
|
||||
:preview-src-list="previewSrcList"
|
||||
>
|
||||
</el-image>
|
||||
</div>
|
||||
{{list}}
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/util/auth'
|
||||
export default {
|
||||
name: '', // 页面名称
|
||||
components: {}, // 挂载组件
|
||||
props: {
|
||||
// 上传图片数量
|
||||
number: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
file: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
}, // 组件传值
|
||||
data () {
|
||||
return {
|
||||
hideUploadEdit: false, // 判断显示图片上传限制隐藏
|
||||
url: '/qiniuupload', // 请求接口
|
||||
imageUrl: '', // 图片展示
|
||||
previewSrcList: [], // 展示图片列表
|
||||
list: [], // 上传图片列表
|
||||
img: [] // 实际展示的图片
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 上传的地址
|
||||
uploadAction () {
|
||||
return 'https://dev.zonmind.com/home' + this.url
|
||||
},
|
||||
// 设置上传的请求头部
|
||||
uploadHeaders () {
|
||||
return {
|
||||
authorization: 'Bearer' + getToken()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}, // 计算机属性 类似与data概念
|
||||
watch: {
|
||||
file: {
|
||||
handler (val) {
|
||||
if (val) {
|
||||
console.log(val, 'ppp')
|
||||
var imges = []
|
||||
val.forEach((element) => {
|
||||
imges = element.url.split(',')
|
||||
this.list = imges
|
||||
})
|
||||
imges.forEach(element => {
|
||||
this.img.push({ url: this.computedGetPictureSrc(element) })
|
||||
})
|
||||
const previewSrcList = imges.map((ele) => {
|
||||
return this.computedGetPictureSrc(ele)
|
||||
})
|
||||
this.previewSrcList = previewSrcList
|
||||
if (val.length === this.number) {
|
||||
this.hideUploadEdit = true
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
|
||||
}, // 监控data中数据变化
|
||||
created () {}, // 生命周期-创建完成(可以访问当前this实例)
|
||||
mounted () {}, // 生命周期-挂载完成(可以访问DOM元素)
|
||||
methods: {
|
||||
computedGetPictureSrc (src) {
|
||||
return 'https://devcdn.zonmind.com' + src
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 判断显示图片上传限制隐藏
|
||||
* @param {*} file
|
||||
* @param {*} fileList
|
||||
* @return {*}
|
||||
* @Date: 2022-03-03 21:16:54
|
||||
*/
|
||||
handleEditChange (file, fileList) {
|
||||
if (fileList.length === this.number) {
|
||||
this.hideUploadEdit = true
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 上传成功
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-03 19:59:45
|
||||
*/
|
||||
good (file, fileList) {
|
||||
this.previewSrcList.push(fileList.url)
|
||||
file.data.forEach(element => {
|
||||
this.list.push(element.url)
|
||||
})
|
||||
|
||||
this.$emit('urlimg', this.list)
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 点击放大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-03 18:59:28
|
||||
*/
|
||||
handleChange (file) {
|
||||
this.imageUrl = file.url
|
||||
this.$nextTick(() => {
|
||||
this.$refs.elImage.clickHandler()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description:删除
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-03 18:59:40
|
||||
*/
|
||||
beforeRemove (file, fileList) {
|
||||
if (fileList.length === this.number) {
|
||||
this.hideUploadEdit = true
|
||||
} else {
|
||||
this.hideUploadEdit = false
|
||||
}
|
||||
if (file.response) {
|
||||
file.response.data.forEach(element => {
|
||||
for (var i = 0; i < this.list.length; i++) {
|
||||
if (element.url === this.list[i]) {
|
||||
this.list.splice(i, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log(file, 'iiii')
|
||||
for (var i = 0; i < this.list.length; i++) {
|
||||
if (file.url === this.computedGetPictureSrc(this.list[i])) {
|
||||
this.list.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description:自动删除
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-03 19:53:25
|
||||
*/
|
||||
handleBeforeUpload (file) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传头像图片大小不能超过 2MB!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
} // 挂载一些方法
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.demo-image__preview {
|
||||
height: 0;
|
||||
}
|
||||
.hidden__el-image {
|
||||
width: 0;
|
||||
height: 0;
|
||||
::v-deep .el-image__preview {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
375
resources/frontend/src/views/index.vue
Normal file
375
resources/frontend/src/views/index.vue
Normal file
@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-container>
|
||||
<el-container>
|
||||
<el-aside :class="show?'width':'width1'">
|
||||
<el-menu router
|
||||
background-color='#282c34'
|
||||
text-color='#fff'
|
||||
:default-active='$route.path'>
|
||||
<div v-for="item in menu"
|
||||
:key="item.id">
|
||||
<el-menu-item :index="item.code"
|
||||
v-if="!item.children">
|
||||
<span>{{item.name}}</span>
|
||||
</el-menu-item>
|
||||
<el-submenu v-else
|
||||
:index="item.code">
|
||||
<template slot="title">
|
||||
<span>{{item.name}}</span>
|
||||
</template>
|
||||
<el-menu-item :index="items.code"
|
||||
:key="items.id"
|
||||
v-for="items in item.children">{{items.name}}</el-menu-item>
|
||||
</el-submenu>
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<div class="head">
|
||||
<ul>
|
||||
<li>
|
||||
<div @click="add"
|
||||
class="add">
|
||||
<i class="el-icon-s-unfold"
|
||||
v-if="show"></i>
|
||||
<i class="el-icon-s-fold"
|
||||
v-else></i>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item v-for="(item , index) in titie"
|
||||
:key="index">{{item.name}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="token"
|
||||
@click="hanleLogout">
|
||||
退出
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="table"
|
||||
v-if="levelData.length">
|
||||
<ul>
|
||||
<li> <i class="el-icon-arrow-left"
|
||||
@click="hanlebottom"></i></li>
|
||||
<li>
|
||||
|
||||
<div class="Navigation"
|
||||
v-if="levelData.length"
|
||||
id="Navigation">
|
||||
<div id="top"></div>
|
||||
<div v-for="(item , index) in levelData"
|
||||
:key="index"
|
||||
class="tab">
|
||||
<span :class="head===item.name?'red':''"
|
||||
@click="handlerclick(item.path)">{{item.name}}</span>
|
||||
<div class="closure"
|
||||
:class="head===item.name?'red_1':''"
|
||||
@click="hanblDelete(index,item.name)">
|
||||
<i class="el-icon-close"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bottom"></div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li><i class="el-icon-arrow-right"
|
||||
@click="hanletop"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="box-card">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { removeToken } from '@/util/auth'
|
||||
import { getMenu } from '../api/menu.js'
|
||||
export default {
|
||||
mounted() {
|
||||
getMenu().then((res) => {
|
||||
this.menu = res.data.data
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [], // 侧边栏
|
||||
show: false, // 导航栏折叠
|
||||
levelData: [], // table导航栏
|
||||
titie: [], // 面包线
|
||||
head: '', // 路由name
|
||||
onindex: 0, // 索引
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// table构造
|
||||
$route: {
|
||||
handler: function (val) {
|
||||
console.log(val, 99999)
|
||||
this.titie = val.matched
|
||||
this.head = val.name
|
||||
this.levelData.push({ name: val.name, path: val.path })
|
||||
const newArr = []
|
||||
const obj = {}
|
||||
for (var i = 0; i < this.levelData.length; i++) {
|
||||
if (!obj[this.levelData[i].name]) {
|
||||
newArr.push(this.levelData[i])
|
||||
obj[this.levelData[i].name] = true
|
||||
}
|
||||
}
|
||||
|
||||
this.levelData = newArr
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 滚动条下一个
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-02 19:50:50
|
||||
*/
|
||||
next() {
|
||||
this.hanletop()
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 滚动最底部
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-02 19:51:03
|
||||
*/
|
||||
hanletop() {
|
||||
document.getElementById('bottom').scrollIntoView({ behavior: 'smooth' })
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 滚动最顶部
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-02 19:51:07
|
||||
*/
|
||||
hanlebottom() {
|
||||
document.getElementById('top').scrollIntoView({ behavior: 'smooth' })
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 退出登录
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-02 09:41:37
|
||||
*/
|
||||
hanleLogout() {
|
||||
removeToken()
|
||||
this.$router.push({ path: '/logo' })
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: table页跳转
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-01 22:27:27
|
||||
*/
|
||||
handlerclick(e) {
|
||||
if (this.$route.path !== e) {
|
||||
this.$router.push({ path: e })
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 导航栏折叠
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-01 22:25:47
|
||||
*/
|
||||
add() {
|
||||
this.show = !this.show
|
||||
},
|
||||
/**
|
||||
* @author: czw (725551805@qq.com)
|
||||
* @description: 删除
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-03-01 16:53:49
|
||||
*/
|
||||
hanblDelete(index, titie) {
|
||||
var list = this.levelData[index].name
|
||||
|
||||
this.onindex = index
|
||||
this.levelData.splice(this.onindex, 1)
|
||||
if (titie === this.head) {
|
||||
var item
|
||||
var name
|
||||
for (let i = 0; i < this.levelData.length; i++) {
|
||||
item = this.levelData[i].path
|
||||
name = this.levelData[i].name
|
||||
}
|
||||
if (this.levelData.length) {
|
||||
if (name !== list) {
|
||||
this.$router.push({ path: item })
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.table {
|
||||
background-color: #fff;
|
||||
ul {
|
||||
li {
|
||||
padding: 20px 10px;
|
||||
.Navigation {
|
||||
display: flex;
|
||||
span {
|
||||
padding: 5px 30px;
|
||||
border: 1px solid #dcdfe6;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.tab {
|
||||
margin-right: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #5470c6;
|
||||
border: 1px solid #5470c6;
|
||||
}
|
||||
.closure {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
background-color: #ddd;
|
||||
color: #000;
|
||||
border-radius: 50%;
|
||||
font-size: 12px;
|
||||
}
|
||||
.red_1 {
|
||||
background-color: #5470c6;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
li:nth-child(2) {
|
||||
overflow-x: auto;
|
||||
}
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
.width {
|
||||
transition: all 0.3s;
|
||||
opacity: 0;
|
||||
width: 0px !important;
|
||||
}
|
||||
.width1 {
|
||||
transition: all 0.3s;
|
||||
opacity: 1;
|
||||
width: 300px !important;
|
||||
}
|
||||
.el-container {
|
||||
height: 100vh;
|
||||
}
|
||||
.el-header {
|
||||
background-color: #b3c0d1;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.el-aside {
|
||||
background-color: #d3dce6;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-aside::-webkit-scrollbar {
|
||||
width: 8px; /*对垂直流动条有效*/
|
||||
}
|
||||
.el-aside::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(144, 147, 153, 0.3);
|
||||
border-radius: 20px;
|
||||
}
|
||||
.el-main {
|
||||
background-color: #f0f2f5;
|
||||
color: #333;
|
||||
padding: 0 0 !important;
|
||||
}
|
||||
.el-main::-webkit-scrollbar {
|
||||
width: 10px; /*对垂直流动条有效*/
|
||||
}
|
||||
.el-main::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(144, 147, 153, 0.3);
|
||||
}
|
||||
.box-card {
|
||||
background-color: #fff;
|
||||
min-height: calc(100vh - 200px);
|
||||
margin: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
.add {
|
||||
cursor: pointer;
|
||||
font-size: 25px;
|
||||
color: #606266;
|
||||
}
|
||||
.head {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #f6f6f6;
|
||||
box-shadow: 0 1px 4px rgb(0 21 41 / 8%);
|
||||
ul {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.right {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.token {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-aside {
|
||||
background: #282c34;
|
||||
box-shadow: 2px 0 6px rgb(0 21 41 / 35%);
|
||||
}
|
||||
::v-deep .el-menu {
|
||||
border: none;
|
||||
}
|
||||
.el-menu-item {
|
||||
margin: 0 20px 10px;
|
||||
}
|
||||
.el-menu-item:hover {
|
||||
outline: 0 !important;
|
||||
background: #5470c6 !important;
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
.el-menu-item.is-active {
|
||||
color: #fff !important;
|
||||
background: #5470c6 !important;
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
.el-menu-item-group__title {
|
||||
padding: 0 0 !important;
|
||||
}
|
||||
</style>
|
||||
74
resources/frontend/src/views/logo.vue
Normal file
74
resources/frontend/src/views/logo.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Author: czw (725551805@qq.com)
|
||||
* @Date: 2021-11-18 10:47:16
|
||||
* @LastEditors: czw (725551805@qq.com)
|
||||
* @LastEditTime: 2022-02-23 12:23:56
|
||||
* @FilePath: /glxt/src/views/logo.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="page">
|
||||
<el-form ref="form"
|
||||
:model="form"
|
||||
label-width="80px">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="form.add"
|
||||
autocomplete='on'
|
||||
type='text'></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码">
|
||||
<el-input v-model="form.app"
|
||||
autocomplete='on'
|
||||
type='password'></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码">
|
||||
<el-button type="primary"
|
||||
@click="onSubmit">登录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setToken } from '@/util/auth'
|
||||
import { postadd } from '@/api/rankingData'
|
||||
export default {
|
||||
name: '', // 页面名称
|
||||
components: {}, // 挂载组件
|
||||
props: {}, // 组件传值
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
add: '',
|
||||
app: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {}, // 计算机属性 类似与data概念
|
||||
watch: {}, // 监控data中数据变化
|
||||
created() {}, // 生命周期-创建完成(可以访问当前this实例)
|
||||
mounted() {}, // 生命周期-挂载完成(可以访问DOM元素)
|
||||
methods: {
|
||||
onSubmit() {
|
||||
const params = {
|
||||
username: this.form.add,
|
||||
password: this.form.app,
|
||||
}
|
||||
// postadd(params).then((res) => {
|
||||
// // if (res.data.code === 200) {
|
||||
|
||||
// // }
|
||||
setToken('w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm')
|
||||
// const token = res.data.access_token
|
||||
// setToken(token)
|
||||
// console.log(token, 'denglucheng')
|
||||
|
||||
// this.$router.push({ path: '/index' })
|
||||
// })
|
||||
this.$router.push({ path: '/index' })
|
||||
},
|
||||
}, // 挂载一些方法
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
164
resources/frontend/src/views/shuju/shuju.vue
Normal file
164
resources/frontend/src/views/shuju/shuju.vue
Normal file
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<div class="goods"
|
||||
style="margin:20px">
|
||||
<el-form ref="form"
|
||||
:inline="true"
|
||||
:model="form">
|
||||
<el-form-item label="查询类别:">
|
||||
<el-select v-model="form.name1"
|
||||
placeholder="全部">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作用户">
|
||||
<el-select v-model="form.name2"
|
||||
placeholder="输入操作用户">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作时间:">
|
||||
<el-date-picker v-model="value1"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="起"
|
||||
end-placeholder="止"
|
||||
align="right">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">查询</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
<el-card style="margin-top:30px"
|
||||
class="box-card">
|
||||
<div>
|
||||
<span></span>
|
||||
<span>历史记录</span>
|
||||
<span>(共800条)</span>
|
||||
<span>——玫瑰花</span>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
style="width: 100%">
|
||||
<el-table-column prop="date"
|
||||
label="序号"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="时间"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="类别">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="操作前">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="操作后">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="操作人">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
<el-pagination @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="currentPage4"
|
||||
:page-sizes="[100, 200, 300, 400]"
|
||||
:page-size="100"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="400">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: '选项1',
|
||||
label: '黄金糕',
|
||||
},
|
||||
{
|
||||
value: '选项2',
|
||||
label: '双皮奶',
|
||||
},
|
||||
{
|
||||
value: '选项3',
|
||||
label: '蚵仔煎',
|
||||
},
|
||||
{
|
||||
value: '选项4',
|
||||
label: '龙须面',
|
||||
},
|
||||
{
|
||||
value: '选项5',
|
||||
label: '北京烤鸭',
|
||||
},
|
||||
],
|
||||
tableData: [
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄',
|
||||
},
|
||||
],
|
||||
currentPage4: 4,
|
||||
form: {
|
||||
name1: '',
|
||||
name2: '',
|
||||
name3: '',
|
||||
name4: '',
|
||||
name5: '',
|
||||
name6: '',
|
||||
},
|
||||
input: '',
|
||||
value1: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
57
resources/frontend/src/views/store/store.vue
Normal file
57
resources/frontend/src/views/store/store.vue
Normal file
@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<el-table :data="tableData"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column prop="date"
|
||||
label="日期"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="姓名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="地址">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GlxtStore',
|
||||
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
22
resources/frontend/src/views/system/authority.vue
Normal file
22
resources/frontend/src/views/system/authority.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GlxtAuthority',
|
||||
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
22
resources/frontend/src/views/system/role.vue
Normal file
22
resources/frontend/src/views/system/role.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GlxtRole',
|
||||
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
22
resources/frontend/src/views/users/users.vue
Normal file
22
resources/frontend/src/views/users/users.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GlxtUsers',
|
||||
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
220
resources/frontend/src/views/yingyeting/addgoods/addgoods.vue
Normal file
220
resources/frontend/src/views/yingyeting/addgoods/addgoods.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<div class="goods"
|
||||
style="margin:20px">
|
||||
<div class="add-item-info"
|
||||
style="margin-bottom:10px;margin-left:52px">
|
||||
<span style="font-size:14px;">商品图片:</span>
|
||||
<el-upload class="upload"
|
||||
action="/api/admin/upload"
|
||||
list-type="picture-card"
|
||||
:on-success="uploadGalleryItem"
|
||||
:on-remove="removeGalleryItem"
|
||||
:file-list="gallery">
|
||||
<img v-if="imageUrl"
|
||||
:src="imageUrl"
|
||||
class="avatar">
|
||||
<i v-else
|
||||
class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</div>
|
||||
<el-form ref="form"
|
||||
:inline="true"
|
||||
:model="form">
|
||||
<div>
|
||||
<el-form-item label="商品名称:">
|
||||
<el-select v-model="form.name1"
|
||||
placeholder="商品名称">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品种类:">
|
||||
<el-select v-model="form.name2"
|
||||
placeholder="商品种类">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<el-select v-model="form.name3"
|
||||
placeholder="商品品牌">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-for="(item,i) in specifyList">
|
||||
<span style="margin-right:-15px">{{i+1}}.</span>
|
||||
<el-form-item label="商品规格:">
|
||||
<el-select v-model="specifyList[i].specify"
|
||||
placeholder="商品规格">
|
||||
<!-- <el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<span class="addto"
|
||||
@click="handleAdd()">+</span>
|
||||
<el-form-item label="商品编码:">
|
||||
<el-select v-model="specifyList[i].code"
|
||||
placeholder="商品编码">
|
||||
<!-- <el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品状态:">
|
||||
<el-select v-model="specifyList[i].state"
|
||||
placeholder="在售(默认)">
|
||||
<!-- <el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-form-item label="商品数量:">
|
||||
<el-select v-model="specifyList[i].number"
|
||||
placeholder="商品数量">
|
||||
<!-- <el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品成本:">
|
||||
<el-select v-model="specifyList[i].cost"
|
||||
placeholder="商品成本">
|
||||
<!-- <el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-button type="primary"
|
||||
@click="handleDelete(i)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-form-item>
|
||||
<el-button type="primary">保存</el-button>
|
||||
<el-button plain>取消</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
gallery: '',
|
||||
imageUrl: '',
|
||||
specifyList: [
|
||||
{
|
||||
specify: '',
|
||||
code: '',
|
||||
state: '',
|
||||
number: '',
|
||||
cost: '',
|
||||
},
|
||||
], // 规格列表
|
||||
form: {
|
||||
name1: '',
|
||||
name2: '',
|
||||
name3: '',
|
||||
name4: '',
|
||||
name5: '',
|
||||
name6: '',
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: '选项1',
|
||||
label: '黄金糕',
|
||||
},
|
||||
{
|
||||
value: '选项2',
|
||||
label: '双皮奶',
|
||||
},
|
||||
{
|
||||
value: '选项3',
|
||||
label: '蚵仔煎',
|
||||
},
|
||||
{
|
||||
value: '选项4',
|
||||
label: '龙须面',
|
||||
},
|
||||
{
|
||||
value: '选项5',
|
||||
label: '北京烤鸭',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 增加一个商品规格
|
||||
handleAdd() {
|
||||
this.specifyList.push({
|
||||
specify: '',
|
||||
code: '',
|
||||
state: '',
|
||||
number: '',
|
||||
cost: '',
|
||||
})
|
||||
},
|
||||
// 删除一个商品规格
|
||||
handleDelete(index) {
|
||||
this.specifyList.splice(index, 1)
|
||||
},
|
||||
uploadGalleryItem() {},
|
||||
removeGalleryItem() {},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-upload--picture-card {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-left: 60px;
|
||||
}
|
||||
.addto {
|
||||
display: inline-block;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background-color: blue;
|
||||
color: #fff;
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
}
|
||||
/* .btn {
|
||||
text-align: center;
|
||||
} */
|
||||
</style>
|
||||
363
resources/frontend/src/views/yingyeting/yingyeting.vue
Normal file
363
resources/frontend/src/views/yingyeting/yingyeting.vue
Normal file
@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<!-- 商品管理页面 -->
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<div class="goods"
|
||||
style="margin:20px">
|
||||
<el-form ref="form"
|
||||
:inline="true"
|
||||
:model="form">
|
||||
<el-form-item label="商品名称:">
|
||||
<el-select v-model="form.name1"
|
||||
placeholder="商品名称">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品种类:">
|
||||
<el-select v-model="form.name2"
|
||||
placeholder="商品种类">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品规格:">
|
||||
<el-select v-model="form.name3"
|
||||
placeholder="商品规格">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<el-select v-model="form.name4"
|
||||
placeholder="商品品牌">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品状态:">
|
||||
<el-select v-model="form.name5"
|
||||
placeholder="商品状态">
|
||||
<el-option v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间:">
|
||||
<el-date-picker v-model="value1"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">筛选</el-button>
|
||||
<el-button plain>重置筛选</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card1"
|
||||
style="margin-top:30px">
|
||||
<div>
|
||||
<!-- 表格头部操作 -->
|
||||
<div>
|
||||
<span>
|
||||
全部商品(共800条)
|
||||
</span>
|
||||
<div class="btn">
|
||||
<el-button type="primary"
|
||||
plain
|
||||
@click="addNewgoods">新建商品</el-button>
|
||||
<el-button type="primary"
|
||||
@click="update()"
|
||||
plain>上新</el-button>
|
||||
<el-button type="primary"
|
||||
plain>库存盘点</el-button>
|
||||
<el-button type="primary"
|
||||
plain>导入商品</el-button>
|
||||
<el-button type="primary"
|
||||
plain>表格导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
class="table"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template slot-scope="scope">{{ scope.row.date }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="品类">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
label="规格">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="品牌">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
sortable
|
||||
label="2天前库存">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
sortable
|
||||
label="1天前库存">
|
||||
</el-table-column>
|
||||
<el-table-column prop=""
|
||||
sortable
|
||||
label="今日到货">
|
||||
<template>
|
||||
<div v-if="isShow">
|
||||
<el-input v-model="input"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop=""
|
||||
sortable
|
||||
label="成本">
|
||||
<template>
|
||||
<div v-if="isShow">
|
||||
<el-input v-model="input"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
sortable
|
||||
label="参考售价">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
sortable
|
||||
label="总量">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
sortable
|
||||
label="预留量">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
sortable
|
||||
label="店铺订单">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
sortable
|
||||
label="损耗">
|
||||
<template>
|
||||
<div class="loss">66</div>
|
||||
<div class="detail">
|
||||
<div>损耗数量:<input /></div>
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio :label="3">备选项</el-radio>
|
||||
<el-radio :label="6">备选项</el-radio>
|
||||
<el-radio :label="9">备选项</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
sortable
|
||||
label="库存">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address"
|
||||
sortable
|
||||
label="库存盘点">
|
||||
<el-input v-model="input"></el-input>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
label="状态">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="text">修改</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="text">编辑</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="text">记录</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-button type="primary">确定</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-pagination @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="currentPage4"
|
||||
:page-sizes="[100, 200, 300, 400]"
|
||||
:page-size="100"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="400">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { goods } from '../../api/goods'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false, // 点击上新显示输入框
|
||||
options: [
|
||||
{
|
||||
value: '选项1',
|
||||
label: '黄金糕',
|
||||
},
|
||||
{
|
||||
value: '选项2',
|
||||
label: '双皮奶',
|
||||
},
|
||||
{
|
||||
value: '选项3',
|
||||
label: '蚵仔煎',
|
||||
},
|
||||
{
|
||||
value: '选项4',
|
||||
label: '龙须面',
|
||||
},
|
||||
{
|
||||
value: '选项5',
|
||||
label: '北京烤鸭',
|
||||
},
|
||||
],
|
||||
tableData: [
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-08',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-06',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
{
|
||||
date: '2016-05-07',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
},
|
||||
],
|
||||
form: {
|
||||
name1: '',
|
||||
name2: '',
|
||||
name3: '',
|
||||
name4: '',
|
||||
name5: '',
|
||||
name6: '',
|
||||
},
|
||||
input: '',
|
||||
value1: '',
|
||||
currentPage4: 4,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 点击上新
|
||||
update() {
|
||||
this.isShow = true
|
||||
console.log(this.isShow, 8888)
|
||||
},
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 新增商品
|
||||
addNewgoods() {
|
||||
this.$router.push({ path: '/index/yingyeting/addgoods' })
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
},
|
||||
// 商品列表
|
||||
getGoods() {
|
||||
goods().then((res) => {
|
||||
console.log('商品列表', res)
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getGoods()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.loss {
|
||||
position: relative;
|
||||
}
|
||||
.detail {
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 1px solid black;
|
||||
background: red;
|
||||
right: 0;
|
||||
}
|
||||
.goods {
|
||||
}
|
||||
.table {
|
||||
margin-top: 40px;
|
||||
}
|
||||
.btn {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
22
resources/frontend/vue.config.js
vendored
Normal file
22
resources/frontend/vue.config.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
module.exports = {
|
||||
lintOnSave: false,
|
||||
publicPath: './', // 配置打包之后的相对路径
|
||||
devServer: {
|
||||
open: true, // 设置浏览器自动打开项目
|
||||
port: 8080, // 开发服务器运行端口号
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
},
|
||||
proxy: { // 配置代理
|
||||
'/api': {
|
||||
// target: 'http://doc.ii090.com/mock/267/',
|
||||
target: 'http://erp.staging.miaoxuan66.cn',
|
||||
changeOrigin: true, // 开启代理
|
||||
pathRewrite: { // 重命名
|
||||
'^/api': 'api'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user