提交 f7f3d217 authored 作者: lidongxu's avatar lidongxu

refactor(permission.js): 新增:勤策移动端内网页如果没有菜单,则给出提示

上级 c211ce90
import Cookies from 'js-cookie'
import { set } from 'nprogress';
const useAppStore = defineStore(
'app',
......@@ -12,7 +11,7 @@ const useAppStore = defineStore(
},
device: 'desktop',
size: Cookies.get('size') || 'default',
belongSys: Cookies.get('belongSys') || '链路中心',
belongSys: Cookies.get('belongSys') || 0,
}),
actions: {
toggleSideBar(withoutAnimation) {
......@@ -28,6 +27,7 @@ const useAppStore = defineStore(
}
},
closeSideBar({ withoutAnimation }) {
// 屏幕宽度小于 992px,或者在移动端,默认侧边栏导航是关闭的
Cookies.set('sidebarStatus', 0)
this.sidebar.opened = false
this.sidebar.withoutAnimation = withoutAnimation
......
......@@ -44,7 +44,16 @@ const usePermissionStore = defineStore(
// 链路中心
res.data = res.data.filter(item => item.belongSys == 0)
} else {
// 勤策
// 勤策移动端
const result = res.data.filter(item => item.belongSys == 1)
if (result.length == 0) {
showNotify({
message: '您没有《勤策移动端》菜单,联系"李秋林"开通!',
type: 'danger',
duration: 5000
})
return
}
res.data = res.data.filter(item => item.belongSys == 1)[0].children
}
const sdata = JSON.parse(JSON.stringify(res.data))
......
......@@ -74,7 +74,8 @@
<van-tabs v-model:active="active"
class="tabs"
swipeable
sticky>
sticky
:lazy-render="false">
<van-tab title="常规陈列">
<convention :isInitializing="isInitializing"
:form="form"
......@@ -91,9 +92,9 @@
ref="scheduleAdjustmentRef" />
</van-tab>
<van-tab title="品类信息">
<categoryInfomation :isInitializing="isInitializing"
<categoryInformation :isInitializing="isInitializing"
:form="form"
ref="categoryInfomationRef" />
ref="categoryInformationRef" />
</van-tab>
</van-tabs>
<!-- 任务总结 -->
......@@ -159,7 +160,7 @@ import { typeOptions as typeOption } from '@/views/mobile/constant'
import convention from './tabs/conventionalDisplay.vue'
import scheduleDisplay from './tabs/scheduleDisplay.vue'
import scheduleAdjustment from './tabs/scheduleAdjustment.vue'
import categoryInfomation from './tabs/categoryInfomation.vue'
import categoryInformation from './tabs/categoryInformation.vue'
import { showImagePreview } from 'vant';
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid';
......@@ -170,7 +171,7 @@ const route = useRoute()
const conventionRef = ref(null)
const scheduleDisplayRef = ref(null)
const scheduleAdjustmentRef = ref(null)
const categoryInfomationRef = ref(null)
const categoryInformationRef = ref(null)
/*************** 稽查任务总体 ***************/
const isInitializing = ref(true)
......@@ -231,7 +232,7 @@ const getInspectionTaskDetailFn = async () => {
conventionRef.value.init()
scheduleDisplayRef.value.init()
scheduleAdjustmentRef.value.init()
categoryInfomationRef.value.init()
categoryInformationRef.value.init()
})
// 一定在这里获取地理位置(保证稽查任务 id 创建完毕)
......@@ -352,7 +353,7 @@ const handleTypeConfirm = async ({ selectedValues }) => {
}
/*************** tabs 组 ***************/
const active = ref(3)
const active = ref(0)
/*************** 其他信息填写 ***************/
// 礼盒礼袋在售
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论