|
@@ -120,11 +120,11 @@
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">最近使用</view>
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">最近使用</view>
|
|
<view class="cu-list grid col-5 no-border">
|
|
<view class="cu-list grid col-5 no-border">
|
|
<view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.recentlyUsed" :key="index">
|
|
<view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.recentlyUsed" :key="index">
|
|
- <image :src="item.imgUrl" style="width: 40px; height: 40px"></image>
|
|
|
|
- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
|
|
|
|
+ <image :src="item.icon" style="width: 40px; height: 40px"></image>
|
|
|
|
+ <!-- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
- </view>
|
|
|
|
- <text style="font-size: 13px">{{ item.name }}</text>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <text style="font-size: 13px">{{ item.menuName }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -135,11 +135,11 @@
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">常用功能</view>
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">常用功能</view>
|
|
<view class="cu-list grid col-5 no-border">
|
|
<view class="cu-list grid col-5 no-border">
|
|
<view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.cuIconList" :key="index">
|
|
<view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.cuIconList" :key="index">
|
|
- <image :src="item.imgUrl" style="width: 40px; height: 40px"></image>
|
|
|
|
- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
|
|
|
|
+ <image :src="item.icon" style="width: 40px; height: 40px"></image>
|
|
|
|
+ <!-- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
- </view>
|
|
|
|
- <text style="font-size: 13px">{{ item.name }}</text>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <text style="font-size: 13px">{{ item.menuName }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -158,7 +158,7 @@ import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni
|
|
import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
|
|
import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
|
|
import useXunJianStore from "@/store/modules/xunJian.js";
|
|
import useXunJianStore from "@/store/modules/xunJian.js";
|
|
|
|
|
|
-import { scan_push, getHomePageData, getFunctionalModuleStatistics } from "@/api/index";
|
|
|
|
|
|
+import { scan_push, getHomePageData, getFunctionalModuleStatistics,getAppRouters,getRouters } from "@/api/index";
|
|
|
|
|
|
const settingsStore = useXunJianStore(); //全局变量值Store
|
|
const settingsStore = useXunJianStore(); //全局变量值Store
|
|
const BASE_URL = inject("$BASE_URL");
|
|
const BASE_URL = inject("$BASE_URL");
|
|
@@ -178,11 +178,15 @@ const arrayList = reactive({
|
|
codeResult: "",
|
|
codeResult: "",
|
|
|
|
|
|
swiperList: ["../static/images/index/banner1.png", "../static/images/index/banner2.jpg", "../static/images/index/banner3.jpg"],
|
|
swiperList: ["../static/images/index/banner1.png", "../static/images/index/banner2.jpg", "../static/images/index/banner3.jpg"],
|
|
- cuIconList: json.cuIconList,
|
|
|
|
|
|
+ // cuIconList: json.cuIconList,
|
|
recentlyUsed: [],
|
|
recentlyUsed: [],
|
|
});
|
|
});
|
|
|
|
|
|
onLoad((option) => {
|
|
onLoad((option) => {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//获取首页标题
|
|
//获取首页标题
|
|
if (uni.getStorageSync("homeTitle")) {
|
|
if (uni.getStorageSync("homeTitle")) {
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
@@ -211,6 +215,13 @@ onLoad((option) => {
|
|
// nextTick(() => {
|
|
// nextTick(() => {
|
|
// hackReset.value = true;
|
|
// hackReset.value = true;
|
|
// });
|
|
// });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getAppRoutersData()
|
|
|
|
+ getRoutersData()
|
|
});
|
|
});
|
|
|
|
|
|
async function init() {
|
|
async function init() {
|
|
@@ -285,18 +296,18 @@ function getLocation() {
|
|
|
|
|
|
// 九宫格页面跳转
|
|
// 九宫格页面跳转
|
|
function navItemClick(item) {
|
|
function navItemClick(item) {
|
|
- if (item.redirectUrl) {
|
|
|
|
|
|
+ if (item.path) {
|
|
item.sort = 0;
|
|
item.sort = 0;
|
|
|
|
|
|
arrayList.recentlyUsed.push(item);
|
|
arrayList.recentlyUsed.push(item);
|
|
|
|
|
|
if (arrayList.recentlyUsed.length > 0) {
|
|
if (arrayList.recentlyUsed.length > 0) {
|
|
arrayList.recentlyUsed = arrayList.recentlyUsed.filter((currentValue, currentIndex, selfArr) => {
|
|
arrayList.recentlyUsed = arrayList.recentlyUsed.filter((currentValue, currentIndex, selfArr) => {
|
|
- return selfArr.findIndex((x) => x.redirectUrl === currentValue.redirectUrl) === currentIndex;
|
|
|
|
|
|
+ return selfArr.findIndex((x) => x.path === currentValue.path) === currentIndex;
|
|
});
|
|
});
|
|
|
|
|
|
arrayList.recentlyUsed.filter((el) => {
|
|
arrayList.recentlyUsed.filter((el) => {
|
|
- if (el.redirectUrl === item.redirectUrl) {
|
|
|
|
|
|
+ if (el.path === item.path) {
|
|
el.sort++;
|
|
el.sort++;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -307,7 +318,7 @@ function navItemClick(item) {
|
|
uni.setStorageSync("recentlyUsed", arrayList.recentlyUsed);
|
|
uni.setStorageSync("recentlyUsed", arrayList.recentlyUsed);
|
|
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: item.redirectUrl,
|
|
|
|
|
|
+ url: item.path,
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -358,7 +369,30 @@ function InputFocus(e) {
|
|
|
|
|
|
function InputBlur(e) {
|
|
function InputBlur(e) {
|
|
arrayList.InputBottom = 0;
|
|
arrayList.InputBottom = 0;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function getAppRoutersData() {
|
|
|
|
+ getAppRouters({
|
|
|
|
+ domain :'localhost:81'
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ arrayList.cuIconList=res.data
|
|
|
|
+ console.log(window.location.host)
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+function getRoutersData() {
|
|
|
|
+ getRouters({
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ console.log(1)
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//echarts图表请求
|
|
//echarts图表请求
|
|
async function getHomeData(param = {}) {
|
|
async function getHomeData(param = {}) {
|
|
getHomePageData(param).then((res) => {
|
|
getHomePageData(param).then((res) => {
|
|
@@ -405,6 +439,8 @@ async function getHomeData(param = {}) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// 未处理告警请求
|
|
// 未处理告警请求
|
|
async function getHandleData(param = {}) {
|
|
async function getHandleData(param = {}) {
|
|
getFunctionalModuleStatistics(param).then((res) => {
|
|
getFunctionalModuleStatistics(param).then((res) => {
|