yujialong 1 year ago
parent 117dcd2537
commit 0c93095d1e
  1. 328
      src/components/Sidebar.vue
  2. 6
      src/components/img-upload/Cropper.vue
  3. 5
      src/views/customer/AddCustomer.vue
  4. 3
      src/views/parnerOperation/schemeSet.vue
  5. 10
      src/views/shop/addProduct/index.vue

@ -1,182 +1,176 @@
<template>
<div>
<el-menu
class="sidebar-el-menu"
:default-active="onRoutes"
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#9278FF"
unique-opened
mode="horizontal"
router
@select="handleSelect"
>
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu
v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index"
>
<template slot="title">{{ subItem.title }}</template>
<el-menu-item
v-for="(threeItem,i) in subItem.subs"
:key="i"
:index="threeItem.index"
>{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item
v-else
:index="subItem.index"
:key="subItem.index"
>{{ subItem.title }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
<div>
<el-menu class="sidebar-el-menu"
:default-active="onRoutes"
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#9278FF"
unique-opened
mode="horizontal"
router
@select="handleSelect">
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index"
:key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</template>
</el-menu>
</div>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index">
<template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs"
:key="i"
:index="threeItem.index">{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index"
:key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
export default {
data() {
return {
menuList: [
{
icon: 'el-icon-school',
index: '/customer',
title: '客户管理'
},
{
icon: 'el-icon-user',
index: '/user',
title: '用户管理'
},
{
icon: 'el-icon-shopping-bag-2',
index: '/order',
title: '订单管理'
},
{
icon: 'el-icon-document-checked',
index: '/curriculum',
title: '课程管理'
},
{
icon: 'el-icon-notebook-2',
index: '/data',
title: '数据管理'
},
{
icon: 'el-icon-tickets',
index: '/match',
title: '大赛管理'
},
{
icon: 'el-icon-takeaway-box',
index: '/theoreticalCourse',
title: '理论课程'
},
{
icon: 'el-icon-box',
index: '/information',
title: '资讯管理'
},
{
icon: 'el-icon-receiving',
index: '/configure',
title: '服务配置'
},
{
icon: 'el-icon-office-building',
index: '/system',
title: '系统配置'
},
{
icon: 'el-icon-s-check',
index: '/parner',
title: '合伙管理'
},
{
icon: 'el-icon-data-line',
index: '/parnerOperation',
title: '合伙运营'
},
{
icon: 'el-icon-s-shop',
index: '/shop',
title: '商城管理'
},
],
menus: [],
onRoutes: this.$route.path
};
},
watch:{
"$route.path":function(val){
this.menuList.map(e=>{
if(val.replace('/', '')===e.index){
this.handleSelect(val.replace('/', ''))
this.$forceUpdate();
}
})
}
},
mounted() {
sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar'))
sessionStorage.getItem('token') && this.getPer() //
},
methods:{
handleSelect(index){
this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '')
sessionStorage.setItem('sideBar',index)
data () {
return {
menuList: [
{
icon: 'el-icon-school',
index: '/customer',
title: '客户管理'
},
{
icon: 'el-icon-user',
index: '/user',
title: '用户管理'
},
{
icon: 'el-icon-shopping-bag-2',
index: '/order',
title: '订单管理'
},
{
icon: 'el-icon-document-checked',
index: '/curriculum',
title: '课程管理'
},
{
icon: 'el-icon-notebook-2',
index: '/data',
title: '数据管理'
},
{
icon: 'el-icon-tickets',
index: '/match',
title: '大赛管理'
},
initMenu() {
if (Setting.dynamicRoute) {
const routes = this.$store.state.routes
const menus = []
this.menuList.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
})
this.menus = menus
} else {
this.menus = this.menuList
}
{
icon: 'el-icon-takeaway-box',
index: '/theoreticalCourse',
title: '理论课程'
},
//
getPer() {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const routes = res.permissionMenu[0].children
addRoutes(routes)
this.initMenu()
this.$store.commit('setDataPer', res.dataPermissionList)
}).catch(err => {
if (err.status === 500) {
localStorage.removeItem('ms_username');
sessionStorage.clear()
location.reload()
}
})
{
icon: 'el-icon-box',
index: '/information',
title: '资讯管理'
},
{
icon: 'el-icon-receiving',
index: '/configure',
title: '服务配置'
},
{
icon: 'el-icon-office-building',
index: '/system',
title: '系统配置'
},
{
icon: 'el-icon-s-check',
index: '/parner',
title: '合伙管理'
},
{
icon: 'el-icon-data-line',
index: '/parnerOperation',
title: '合伙运营'
},
{
icon: 'el-icon-s-shop',
index: '/shop',
title: '商城管理'
},
],
menus: [],
onRoutes: this.$route.path
};
},
watch: {
"$route.path": function (val) {
this.menuList.map(e => {
if (val.replace('/', '') === e.index) {
this.handleSelect(val.replace('/', ''))
this.$forceUpdate();
}
})
}
},
mounted () {
// sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar'))
sessionStorage.getItem('token') && this.getPer() //
},
methods: {
handleSelect (index) {
this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '')
sessionStorage.setItem('sideBar', index)
},
initMenu () {
if (Setting.dynamicRoute) {
const routes = this.$store.state.routes
const menus = []
this.menuList.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
})
this.menus = menus
} else {
this.menus = this.menuList
}
},
//
getPer () {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const routes = res.permissionMenu[0].children
addRoutes(routes)
this.initMenu()
this.$store.commit('setDataPer', res.dataPermissionList)
}).catch(err => {
if (err.status === 500) {
localStorage.removeItem('ms_username');
sessionStorage.clear()
location.reload()
}
})
},
}
};
</script>

@ -92,7 +92,7 @@ export default {
previews: {}, //
option: {
img: '', // ()
size: 0.8, // (:1)
size: 1, // (:1)
full: true, // true (:false)
outputType: 'jpg', // (:jpg)
canMove: true, // (:true)
@ -125,7 +125,7 @@ export default {
},
updateImg (file) {
this.option.img = file.url
this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95
// this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95
},
realTime (data) {
//
@ -139,7 +139,7 @@ export default {
const that = this
if (type === 'blob') {
this.$refs.cropper.getCropBlob(data => {
compress(data, 0.8).then(res => {
compress(data, 1).then(res => {
that.$emit('upload', res)
})
})

@ -60,7 +60,8 @@
:label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
<i class="el-icon-circle-plus-outline plus-cus"
<i v-if="!isDetail"
class="el-icon-circle-plus-outline plus-cus"
@click="addCustomer"></i>
</div>
</el-form-item>
@ -864,7 +865,7 @@ export default {
data.map((e, i) => {
e.id = i
const list = e.startAndEndTimeList
if (list) {
if (list && list.length) {
let connect = true //
list.map((n, i) => {
//

@ -515,7 +515,7 @@ export default {
},
handleCurrentChange (val) {
this.page = val;
this.getData();
this.getProduct();
},
handleSelectionChange (val) {
console.log("🚀 ~ file: schemeSet.vue:516 ~ handleSelectionChange ~ val:", val)
@ -529,7 +529,6 @@ export default {
}).then(() => {
this.checkeds.splice(i, 1)
}).catch(() => { })
},
//
productSubmit () {

@ -283,6 +283,7 @@
:limit="1"
:action="api.fileupload"
:headers="headers"
:file-list="appletList"
name="file">
<img v-if="form.mall.appletIcon"
:src="form.mall.appletIcon"
@ -807,7 +808,8 @@ export default {
submiting: false,
pass: false,
updateTime: 0,
nameRepeat: false
nameRepeat: false,
appletList: []
};
},
watch: {
@ -864,6 +866,12 @@ export default {
if (e.typeIds && e.typeIds.length) e.typeIds = e.typeIds[0]
e.mall.interfaceDiagrams = e.mall.interfaceDiagram ? e.mall.interfaceDiagram.split(',') : []
e.mallAnnex.forEach(e => e.name = e.fileName)
if (e.mall.appletIcon) this.appletList = [
{
name: e.mall.appletIcon,
url: e.mall.appletIcon
}
]
this.form = e
this.getOp()
this.$nextTick(() => {

Loading…
Cancel
Save