|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div class="home-container layout-pd">
|
|
|
- <AudioPlayer :url="url"/>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16" class="left-content">
|
|
|
<el-row :gutter="20">
|
|
@@ -95,9 +94,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
-
|
|
|
+ <!-- 常用入口 -->
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8" class="right-content">
|
|
|
- <div class="right-entrance box w100" v-loading="loading">
|
|
|
+ <div class="right-entrance box w100" v-loading="entranceLoading">
|
|
|
<p class="right-entrance-title">常用入口
|
|
|
<span @click="customEntry">
|
|
|
<SvgIcon name="ele-Setting" class="mr5"/>自定义
|
|
@@ -105,9 +104,9 @@
|
|
|
</p>
|
|
|
<template v-if="entranceList.length">
|
|
|
<ul class="right-entrance-list">
|
|
|
- <li class="right-entrance-list-item" v-for="(item, index) in entranceList" :key="index" :data-id="item.id">
|
|
|
- <img v-lazy="getImageUrl(item.url)" alt="" class="my-handle"/>
|
|
|
- <p>{{ item.name }}</p>
|
|
|
+ <li class="right-entrance-list-item" v-for="(item, index) in entranceList" :key="index" :data-id="item.id" @click="goLink(item.path)">
|
|
|
+ <img v-lazy="getImageUrl(item.fastIcon)" alt="" class="my-handle"/>
|
|
|
+ <p>{{ item.pageName }}</p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</template>
|
|
@@ -137,66 +136,22 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <Entrance ref="entranceRef" @updateList="getEntrance" />
|
|
|
+ <Entrance ref="entranceRef" @updateEntrance="getEntrance" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="home">
|
|
|
import { defineAsyncComponent, reactive, toRefs, ref, onMounted } from "vue";
|
|
|
-import Sortable from 'sortablejs';
|
|
|
+import {useRouter} from "vue-router"
|
|
|
import { Vue3SeamlessScroll } from "vue3-seamless-scroll";
|
|
|
import { getImageUrl } from "/@/utils/tools";
|
|
|
-import { formatDate } from '/@/utils/formatTime';// 引入api
|
|
|
-const Entrance = defineAsyncComponent(() => import('/@/views/home/component/entrance.vue'))
|
|
|
-const AudioPlayer = defineAsyncComponent(() => import('/@/components/AudioPlayer/index.vue'))
|
|
|
-const url = "http://music.163.com/song/media/outer/url?id=447925558.mp3";
|
|
|
+import { formatDate } from '/@/utils/formatTime';
|
|
|
+import { geFastMenu } from '/@/api/home';
|
|
|
+const Entrance = defineAsyncComponent(() => import('/@/views/home/component/entrance.vue'));
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
const state = reactive({
|
|
|
- entranceList: <any>[
|
|
|
- {
|
|
|
- name: "工单回访",
|
|
|
- url: "home/gdhf.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "全部工单",
|
|
|
- url: "home/qbgd.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "甄别管理",
|
|
|
- url: "home/zbgl.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "受理列表",
|
|
|
- url: "home/sllb.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "业务查询",
|
|
|
- url: "home/ywcx.png",
|
|
|
- id:Math.random()
|
|
|
- },{
|
|
|
- name: "工单回访",
|
|
|
- url: "home/gdhf.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "全部工单",
|
|
|
- url: "home/qbgd.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "甄别管理",
|
|
|
- url: "home/zbgl1.png",
|
|
|
- id:Math.random()
|
|
|
- },
|
|
|
- {
|
|
|
- name: "受理列表",
|
|
|
- url: "home/sllb.png",
|
|
|
- id:Math.random()
|
|
|
- }
|
|
|
- ],
|
|
|
+ entranceList: <any>[],
|
|
|
noticeList: [
|
|
|
{
|
|
|
title: "市城区迁改23处盲道优化446个临时停车泊位",
|
|
@@ -242,28 +197,10 @@ const state = reactive({
|
|
|
}
|
|
|
],
|
|
|
loading:false,
|
|
|
+ entranceLoading:false,
|
|
|
sortEntranceList:[],
|
|
|
sortable:<any>'',
|
|
|
})
|
|
|
-// 入口可拖动排序
|
|
|
-const initSortable = ()=>{
|
|
|
- const el = <HTMLElement>document.querySelector('.right-entrance-list');
|
|
|
- if (!el) return false;
|
|
|
- state.sortable.el && state.sortable.destroy();
|
|
|
- state.sortable = Sortable.create(el, {
|
|
|
- animation: 300,
|
|
|
- handle:'.my-handle',
|
|
|
- onEnd: () => {
|
|
|
- const sortEndList: any = [];
|
|
|
- state.sortable.toArray().map((val: any) => {
|
|
|
- state.entranceList.map((v: any) => {
|
|
|
- if (v.id == val) sortEndList.push({ ...v });
|
|
|
- });
|
|
|
- });
|
|
|
- state.sortEntranceList = sortEndList;
|
|
|
- },
|
|
|
- });
|
|
|
-}
|
|
|
const entranceRef = ref();
|
|
|
// 自定义入口
|
|
|
const customEntry = () => {
|
|
@@ -271,9 +208,21 @@ const customEntry = () => {
|
|
|
}
|
|
|
//获取入口设置
|
|
|
const getEntrance = () => {
|
|
|
-
|
|
|
+ state.entranceLoading = true;
|
|
|
+ geFastMenu().then((res:any)=>{
|
|
|
+ state.entranceList = res?.result ?? [];
|
|
|
+ setTimeout(() => {
|
|
|
+ state.entranceLoading = false;
|
|
|
+ }, 300);
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+// 跳转
|
|
|
+const goLink = (val:string)=>{
|
|
|
+ router.push(val);
|
|
|
}
|
|
|
-const changeList = (val: string) => { //切换列表
|
|
|
+ //切换列表
|
|
|
+const changeList = (val: string) => {
|
|
|
if (state.active === val) return;
|
|
|
state.active = val;
|
|
|
}
|
|
@@ -291,9 +240,9 @@ const more = (val:string)=>{
|
|
|
}
|
|
|
}
|
|
|
onMounted(()=>{
|
|
|
- initSortable();
|
|
|
+ getEntrance();
|
|
|
})
|
|
|
-const { entranceList, noticeList, active, activities,loading } = toRefs(state);
|
|
|
+const { entranceList, noticeList, active, activities,loading,entranceLoading } = toRefs(state);
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.box {
|
|
@@ -459,7 +408,6 @@ const { entranceList, noticeList, active, activities,loading } = toRefs(state);
|
|
|
height: 50px;
|
|
|
margin-top:15px;
|
|
|
margin-bottom: 13px;
|
|
|
- cursor: grab;
|
|
|
}
|
|
|
&:hover {
|
|
|
color: var(--el-color-primary);
|