优化
This commit is contained in:
@ -6,7 +6,7 @@ VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
# 李陈杰 209
|
||||
VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
# 曾涛
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
# 罗成
|
||||
|
@ -4,6 +4,7 @@
|
||||
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path">
|
||||
<svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" />
|
||||
{{ item.meta?.title }}
|
||||
<!-- <span class="bage" v-if="item.meta?.title == '我的任务' && total > 0">{{ total }}</span> -->
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
@ -26,20 +27,27 @@ import useAppStore from '@/store/modules/app';
|
||||
import useSettingsStore from '@/store/modules/settings';
|
||||
import usePermissionStore from '@/store/modules/permission';
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useNoticeStore from '@/store/modules/notice';
|
||||
import { pageByTaskWait } from '@/api/workflow/task';
|
||||
const userStore = useUserStore();
|
||||
const noticeStore = storeToRefs(useNoticeStore());
|
||||
// 顶部栏初始数
|
||||
const visibleNumber = ref<number>(-1);
|
||||
// 当前激活菜单的 index
|
||||
const currentIndex = ref<string>();
|
||||
// 隐藏侧边栏路由
|
||||
const hideList = ['/index', '/user/profile'];
|
||||
|
||||
const total = ref(1);
|
||||
const appStore = useAppStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const permissionStore = usePermissionStore();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
onMounted(() => {
|
||||
console.log(33333);
|
||||
getWaitingList();
|
||||
});
|
||||
// 主题颜色
|
||||
const theme = computed(() => settingsStore.theme);
|
||||
// 所有的路由信息
|
||||
@ -158,6 +166,26 @@ onBeforeUnmount(() => {
|
||||
onMounted(() => {
|
||||
setVisibleNumber();
|
||||
});
|
||||
// 获取我的待办
|
||||
//分页
|
||||
const getWaitingList = () => {
|
||||
pageByTaskWait({ pageNum: 1, pageSize: 10 }).then((resp) => {
|
||||
console.log(resp);
|
||||
|
||||
total.value = resp.total;
|
||||
});
|
||||
};
|
||||
//用深度监听 消息
|
||||
watch(
|
||||
() => noticeStore.state.value.notices,
|
||||
(newVal) => {
|
||||
let time = setTimeout(() => {
|
||||
getWaitingList();
|
||||
clearTimeout(time);
|
||||
}, 500);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@ -197,4 +225,31 @@ onMounted(() => {
|
||||
.topmenu-container .svg-icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.bage {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: -12px;
|
||||
padding: 0 6px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
background: #ff7a7a;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.el-menu-item .el-menu-item__content {
|
||||
position: relative;
|
||||
padding-right: 24px;
|
||||
}
|
||||
|
||||
.menu-title {
|
||||
display: inline-block;
|
||||
max-width: calc(100% - 24px);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
@ -57,7 +57,9 @@ const props = defineProps({
|
||||
});
|
||||
const total = ref(0);
|
||||
onMounted(() => {
|
||||
if (onlyOneChild.value.meta?.title == '我的待办') {
|
||||
if (onlyOneChild.value.meta?.title == '我的待办' || props.item.meta?.title == '我的任务') {
|
||||
console.log(44444444);
|
||||
|
||||
getWaitingList();
|
||||
}
|
||||
});
|
||||
@ -123,7 +125,8 @@ watch(
|
||||
() => noticeStore.state.value.notices,
|
||||
(newVal) => {
|
||||
if (onlyOneChild.value.meta?.title == '我的待办') {
|
||||
// 延迟1秒
|
||||
console.log(121212121);
|
||||
|
||||
let time = setTimeout(() => {
|
||||
getWaitingList();
|
||||
clearTimeout(time);
|
||||
|
@ -45,7 +45,6 @@ router.beforeEach(async (to, from, next) => {
|
||||
accessRoutes.forEach((route) => {
|
||||
if (!isHttp(route.path)) {
|
||||
router.addRoute(route); // 动态添加可访问路由表
|
||||
console.log('🚀 ~ route:', route);
|
||||
}
|
||||
});
|
||||
$cache.local.remove('isCheckRole');
|
||||
|
@ -136,7 +136,9 @@
|
||||
<!-- 物资名称列 -->
|
||||
<el-table-column prop="name" align="center" label="物资名称" width="160">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.name" v-if="scope.row.mrpBaseId" placeholder="请输入物资名称" disabled />
|
||||
<el-select
|
||||
v-else
|
||||
:disabled="!scope.row.batchNumber"
|
||||
v-model="scope.row.suppliespriceId"
|
||||
placeholder="请选择"
|
||||
@ -594,7 +596,8 @@ const handleUpdata = () => {
|
||||
qs: item.qs,
|
||||
arrivalTime: item.arrivalTime,
|
||||
remark: item.remark,
|
||||
Remaining: item.Remaining || 0,
|
||||
Remaining: Number(item.remaining) || 0,
|
||||
// remaining:
|
||||
quantityError: '',
|
||||
batchNumber: item.batchNumber,
|
||||
duplicateError: '',
|
||||
|
Reference in New Issue
Block a user