eslink-ui-plus
Version:
vue3 component library, css framework
86 lines (84 loc) • 1.94 kB
text/typescript
/*
* @Author: xiaobo
* @Description:
* @Date: 2021-05-13 09:07:45
* @LastEditTime: 2022-01-21 14:29:34
* @FilePath: \eslink-ui-plus\components\page-operater-bar\useQuickRoute.ts
*/
// import { useApiAddMonitorList } from '@/views/meter-monitor/apis'
import { ElMessage } from 'element-plus'
import { ref } from 'vue'
import { Router } from 'vue-router'
interface IconListItemModel {
icon: string
name: string
click: () => void
}
const globalMeterId = ref('')
export const updateGlobalMeterId = (meterId: string) => {
globalMeterId.value = meterId
}
export default function useQuickRoute(router: Router) {
const quickNavSource = ref<IconListItemModel[]>([
{
icon: 'es-icon-stethoscope-fill',
name: '健康度检查',
click() {
router.push('/health-check')
},
},
{
icon: 'es-icon-mental-health-fill',
name: '用户/用气画像',
click() {
alert(11)
},
},
{
icon: 'es-icon-line-chart-fill',
name: '运行数据曲线',
click() {
alert(11)
},
},
{
icon: 'es-icon-database-2-fill',
name: '原数据查询',
click() {
alert(11)
},
},
{
icon: 'es-icon-banshou',
name: '检定分析',
click() {
router.push('/inspectional-analysis')
},
},
{
icon: 'es-icon-dashboard-2-fill',
name: '适配分析',
click() {
alert(11)
},
},
// {
// icon: 'iconeye-fill',
// name: '加入监控',
// async click() {
// if (globalMeterId.value !== '') {
// const { result } = await useApiAddMonitorList({
// meterMonitorListDTOList: [globalMeterId.value],
// })
// if (result.value) {
// ElMessage.success(
// `表具${globalMeterId.value}加入监控成功`,
// )
// }
// }
// console.log('globalMeterId', globalMeterId.value)
// },
// },
])
return { quickNavSource }
}