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> <template>
<div> <div>
<el-menu <el-menu class="sidebar-el-menu"
class="sidebar-el-menu" :default-active="onRoutes"
:default-active="onRoutes" background-color="#324157"
background-color="#324157" text-color="#bfcbd9"
text-color="#bfcbd9" active-text-color="#9278FF"
active-text-color="#9278FF" unique-opened
unique-opened mode="horizontal"
mode="horizontal" router
router @select="handleSelect">
@select="handleSelect" <template v-for="item in menus">
> <template v-if="item.subs">
<template v-for="item in menus"> <el-submenu :index="item.index"
<template v-if="item.subs"> :key="item.index">
<el-submenu :index="item.index" :key="item.index"> <template slot="title">
<template slot="title"> <i :class="item.icon"></i>
<i :class="item.icon"></i> <span slot="title">{{ item.title }}</span>
<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>
</template> </template>
</el-menu> <template v-for="subItem in item.subs">
</div> <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> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes' import addRoutes from '@/libs/route/addRoutes'
export default { export default {
data() { data () {
return { return {
menuList: [ menuList: [
{ {
icon: 'el-icon-school', icon: 'el-icon-school',
index: '/customer', index: '/customer',
title: '客户管理' title: '客户管理'
}, },
{ {
icon: 'el-icon-user', icon: 'el-icon-user',
index: '/user', index: '/user',
title: '用户管理' title: '用户管理'
}, },
{ {
icon: 'el-icon-shopping-bag-2', icon: 'el-icon-shopping-bag-2',
index: '/order', index: '/order',
title: '订单管理' title: '订单管理'
}, },
{ {
icon: 'el-icon-document-checked', icon: 'el-icon-document-checked',
index: '/curriculum', index: '/curriculum',
title: '课程管理' title: '课程管理'
}, },
{ {
icon: 'el-icon-notebook-2', icon: 'el-icon-notebook-2',
index: '/data', index: '/data',
title: '数据管理' title: '数据管理'
}, },
{ {
icon: 'el-icon-tickets', icon: 'el-icon-tickets',
index: '/match', index: '/match',
title: '大赛管理' 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)
}, },
initMenu() { {
if (Setting.dynamicRoute) { icon: 'el-icon-takeaway-box',
const routes = this.$store.state.routes index: '/theoreticalCourse',
const menus = [] title: '理论课程'
this.menuList.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
})
this.menus = menus
} else {
this.menus = this.menuList
}
}, },
// {
getPer() { icon: 'el-icon-box',
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => { index: '/information',
const routes = res.permissionMenu[0].children title: '资讯管理'
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-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> </script>

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

@ -60,7 +60,8 @@
:label="item.schoolName" :label="item.schoolName"
:value="item.schoolId"></el-option> :value="item.schoolId"></el-option>
</el-select> </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> @click="addCustomer"></i>
</div> </div>
</el-form-item> </el-form-item>
@ -864,7 +865,7 @@ export default {
data.map((e, i) => { data.map((e, i) => {
e.id = i e.id = i
const list = e.startAndEndTimeList const list = e.startAndEndTimeList
if (list) { if (list && list.length) {
let connect = true // let connect = true //
list.map((n, i) => { list.map((n, i) => {
// //

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

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

Loading…
Cancel
Save