提交 eaf5fe27 authored 作者: caodi\cd's avatar caodi\cd

fix:优化

上级 82aa36b7
<template>
<!-- 首页 -->
<view class="container">
<!-- 第一个模块 -->
<view class="header">
<view class="title">杭州内网监管在线-运维在线</view>
<view class="header-buttons">
<button class="log-button" @click="lookLog">操作日志</button>
<div class="exit-button" @click="logOut">
<image class="logout" src="@/static/img/logout.svg" mode="aspectFit"></image>
</div>
</view>
</view>
<!-- 首页 -->
<view class="container">
<!-- 第一个模块 -->
<view class="header">
<view class="title">杭州内网监管在线-运维在线</view>
<view class="header-buttons">
<button class="log-button" @click="lookLog">操作日志</button>
<div class="exit-button" @click="logOut">
<image
class="logout"
src="@/static/img/logout.svg"
mode="aspectFit"
></image>
</div>
</view>
</view>
<!-- 第二个模块 -->
<view class="profile-section">
<view class="profile-box">
<view class="profile-left">
<view class="avatar">
<image src="@/static/img/add-img/home1.png" mode="aspectFit"></image>
<view class="change-password" @click="updatePassword">修改密码</view>
</view>
<view class="username">{{ userName }}</view>
</view>
<view class="profile-right">
<button class="inspection-button" @click="toInspectionManagement">巡检管理</button>
<button class="record-button" @click="toListingManagement">设备上架管理</button>
</view>
</view>
</view>
<!-- 第二个模块 -->
<view class="profile-section">
<view class="profile-box">
<view class="profile-left">
<view class="avatar">
<image
src="@/static/img/add-img/home1.png"
mode="aspectFit"
></image>
<view class="change-password" @click="updatePassword"
>修改密码</view
>
</view>
<view class="username">{{ userName }}</view>
</view>
<view class="profile-right">
<button class="inspection-button" @click="toInspectionManagement">
巡检管理
</button>
<button class="record-button" @click="toListingManagement">
设备上架管理
</button>
</view>
</view>
</view>
<!-- 第三个模块 -->
<view class="card-section">
<view class="card-container">
<view class="card" v-for="(card, index) in cards" :key="index"
:style="{ backgroundImage: `url(${card.image})` }" @click="toList(card.url)">
<view class="card-text">{{ card.text }}</view>
</view>
</view>
</view>
<!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog ref="inputClose2" mode="base" title="确定退出该账号?" @confirm="dialogInputConfirm2">
</uni-popup-dialog>
</uni-popup>
</view>
<!-- 第三个模块 -->
<view class="card-section">
<view class="card-container">
<view
class="card"
v-for="(card, index) in cards"
:key="index"
:style="{ backgroundImage: `url(${card.image})` }"
@click="toList(card.url)"
>
<view class="card-text">{{ card.text }}</view>
</view>
</view>
</view>
<!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog
ref="inputClose2"
mode="base"
title="确定退出该账号?"
@confirm="dialogInputConfirm2"
>
</uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
cards: [{
image: '../../static/img/jf.png',
text: '机房巡检',
url:"/pages/inspectionContent/inspectionContentList?backValue=home"
},
{
image: '../../static/img/jd.png',
text: '井道巡检',
url:"/pages/shaftInspection/shaftInspectionList?backValue=home"
},
{
image: '../../static/img/sj.png',
text: '设备上架'
}
],
userName: this.$store.state.now_user.user,
};
export default {
data() {
return {
cards: [{
image: '../../static/img/jf.png',
text: '机房巡检',
url:"/pages/inspectionContent/inspectionContentList?backValue=home"
},
{
image: '../../static/img/jd.png',
text: '井道巡检',
url:"/pages/shaftInspection/shaftInspectionList?backValue=home"
},
{
image: '../../static/img/sj.png',
text: '设备上架',
url: "/pages/listingManagement/index?backValue=home"
}
],
userName: this.$store.state.now_user.user,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 三模块卡片跳转页面
toList(url){
uni.navigateTo({
url: url,
});
// 三模块卡片跳转页面
toList(url){
uni.navigateTo({
url: url,
});
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
}
};
}
};
</script>
<style scoped lang="less">
.container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
height: 100vh;
background-image: linear-gradient(115deg, #E8F0FB 0%, #E1EBFA 100%);
z-index: 1;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
height: 100vh;
background-image: linear-gradient(115deg, #e8f0fb 0%, #e1ebfa 100%);
z-index: 1;
}
.header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
position: relative;
margin-bottom: 147px;
.header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
position: relative;
margin-bottom: 147px;
.title {
position: absolute;
left: 50%;
transform: translateX(-50%);
ont-family: PingFangSC-Medium;
font-size: 32px;
color: #000000;
text-align: center;
line-height: 40px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
font-weight: 500;
}
.title {
position: absolute;
left: 50%;
transform: translateX(-50%);
ont-family: PingFangSC-Medium;
font-size: 32px;
color: #000000;
text-align: center;
line-height: 40px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
font-weight: 500;
}
.header-buttons {
display: flex;
align-items: center;
margin-left: auto; // 将按钮组推到最右侧
.header-buttons {
display: flex;
align-items: center;
margin-left: auto; // 将按钮组推到最右侧
.log-button {
width: 112px;
height: 36px;
background: #FFFFFF;
border-radius: 18px;
margin-right: 10px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #000000;
line-height: 36px;
font-weight: 400;
}
.log-button {
width: 112px;
height: 36px;
background: #ffffff;
border-radius: 18px;
margin-right: 10px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #000000;
line-height: 36px;
font-weight: 400;
}
.exit-button {
width: 36px;
height: 36px;
background: #FFFFFF;
border: 0.5px solid rgba(224, 224, 224, 1);
border-radius: 18px;
display: flex;
justify-content: center;
align-items: center;
.exit-button {
width: 36px;
height: 36px;
background: #ffffff;
border: 0.5px solid rgba(224, 224, 224, 1);
border-radius: 18px;
display: flex;
justify-content: center;
align-items: center;
.logout {
width: 16px;
height: 16px;
}
}
}
}
.logout {
width: 16px;
height: 16px;
}
}
}
}
.profile-section {
width: 720px;
.profile-section {
width: 720px;
.profile-box {
background-color: #fff;
border-radius: 12px;
padding: 16px 32px;
display: flex;
justify-content: space-between;
align-items: center;
.profile-box {
background-color: #fff;
border-radius: 12px;
padding: 16px 32px;
display: flex;
justify-content: space-between;
align-items: center;
.profile-left {
display: flex;
align-items: center;
.profile-left {
display: flex;
align-items: center;
.avatar {
position: relative;
width: 86px;
height: 86px;
border-radius: 50%;
overflow: hidden;
.avatar {
position: relative;
width: 86px;
height: 86px;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
image {
width: 100%;
height: 100%;
}
.change-password {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.5);
text-align: center;
height: 22px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #FFFFFF;
line-height: 20px;
font-weight: 400;
}
}
.change-password {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.5);
text-align: center;
height: 22px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #ffffff;
line-height: 20px;
font-weight: 400;
}
}
.username {
margin-left: 16px;
font-family: PingFangSC-Medium;
font-size: 20px;
color: #000000;
line-height: 28px;
font-weight: 500;
}
}
.username {
margin-left: 16px;
font-family: PingFangSC-Medium;
font-size: 20px;
color: #000000;
line-height: 28px;
font-weight: 500;
}
}
.profile-right {
display: flex;
.profile-right {
display: flex;
.inspection-button {
width: 112px;
height: 36px;
background-image: linear-gradient(105deg, #68ACFB 0%, #3774F6 100%);
border-radius: 18px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #FFFFFF;
line-height: 36px;
font-weight: 400;
margin-right: 16px;
}
.inspection-button {
width: 112px;
height: 36px;
background-image: linear-gradient(105deg, #68acfb 0%, #3774f6 100%);
border-radius: 18px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #ffffff;
line-height: 36px;
font-weight: 400;
margin-right: 16px;
}
.record-button {
width: 144px;
height: 36px;
background: #FFFFFF;
border: 1px solid rgba(55, 116, 246, 1);
border-radius: 18px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #3774F6;
line-height: 36px;
font-weight: 400;
}
}
}
}
.record-button {
width: 144px;
height: 36px;
background: #ffffff;
border: 1px solid rgba(55, 116, 246, 1);
border-radius: 18px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #3774f6;
line-height: 36px;
font-weight: 400;
}
}
}
}
.card-section {
width: 720px;
margin-top: 20px;
.card-section {
width: 720px;
margin-top: 20px;
.card-container {
display: flex;
justify-content: space-between;
.card-container {
display: flex;
justify-content: space-between;
.card {
width: 224px;
height: 194px;
background-color: #f0f0f0;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 130px;
background-size: cover; // 背景图覆盖整个卡片
background-position: center; // 背景图居中
.card {
width: 224px;
height: 194px;
background-color: #f0f0f0;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 130px;
background-size: cover; // 背景图覆盖整个卡片
background-position: center; // 背景图居中
.card-text {
text-align: center;
font-family: PingFangSC-Semibold;
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: 600;
}
}
}
}
</style>
\ No newline at end of file
.card-text {
text-align: center;
font-family: PingFangSC-Semibold;
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: 600;
}
}
}
}
</style>
......@@ -33,7 +33,7 @@
>
</view>
</view>
<view v-if="inspectionNumber >1" class="profile-right">
<view v-if="inspectionNumber > 1" class="profile-right">
<button v-if="!isSign" class="record-button" @click="toSign">
巡检人签字
</button>
......@@ -97,6 +97,12 @@
<script>
import moment from "moment";
import { pad_all_inspection_position } from "@/utils/dict.js";
import {
writeInspectionData,
addLog,
getLogContent,
LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js";
import { getInspectionDetails } from "@/request/index.js";
import signDialog from "@/components/signDialog.vue";
export default {
......@@ -116,6 +122,7 @@ export default {
uid: "",
options: {}, //存储数据
backValue: "",
all_data: [], //所有数据
};
},
computed: {
......@@ -136,6 +143,7 @@ export default {
} else {
this.init();
}
this.all_data = this.$store.state.all_data;
},
methods: {
init() {
......@@ -223,7 +231,7 @@ export default {
},
// 提交
submit(type = "sign", value = "") {
const all_data = this.$store.state.all_data; //获取全部数据
const all_data = this.all_data; //获取全部数据
let params = this.detailsInfo;
params.signImg = value;
console.log("all_data", all_data);
......@@ -234,7 +242,9 @@ export default {
const logContent = getLogContent(LOG_TYPE_ENUM.sys, "数据同步", "同步");
// 更新巡检list
console.log("all_data存储", all_data);
console.log("all_data一个", all_data[index]);
this.$store.commit("SET_ALL_DATA", all_data);
const userInfo = this.userInfo;
const inspectList = all_data.filter(
(item) => item.createByName == userInfo.user
);
......
......@@ -13,7 +13,7 @@
</block>
<block slot="right" class="nav-right">
<view class="header-buttons">
<button class="button">机房</button>
<button class="button">操作说明</button>
</view>
</block>
</uni-nav-bar>
......@@ -38,7 +38,8 @@
<text
class="inner-circle"
v-if="filteredData(selectedPhotos, group, date)"
></text>
></text
>
</view>
<text class="date">{{ date }}</text>
</view>
......@@ -49,9 +50,13 @@
class="card"
@click="previewPhoto(photo)"
>
<image :src="photo.url" mode="scaleToFill" class="photo"></image>
<view class="check-icon" @click.stop="toggleSelect(photo)">
<text v-if="photo.selected"></text>
<image :src="photo.url" mode="center" class="photo"></image>
<view
class="check-icon"
:class="{ active: photo.selected }"
@click.stop="toggleSelect(photo)"
>
<text v-if="photo.selected"></text>
</view>
<view class="delete-icon" @click.stop="deletePhoto(photo)"
>×</view
......@@ -325,21 +330,21 @@ export default {
</script>
<style lang="less" scoped>
.uni-nav-bar-text {
height: 28.8px;
width: 28.8px;
background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px;
color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
height: 28.8px;
width: 28.8px;
background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px;
color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
.iconfont {
font-size: 16px;
line-height: 28.8px;
}
.iconfont {
font-size: 16px;
line-height: 28.8px;
}
}
.nav-right {
......@@ -401,10 +406,15 @@ export default {
}
.selected-count {
background-color: #f0f0f0;
background-color: #fff;
padding: 6.4px;
font-size: 14.4px;
color: #000000;
line-height: 20.8px;
font-weight: 500;
border-radius: 6.4px;
margin-bottom: 12.8px;
padding-left: 25.6px;
}
.photo-box {
......@@ -425,13 +435,13 @@ export default {
align-items: center;
margin-bottom: 6.4px;
padding: 0 25.6px;
.date {
font-size: 20.8px;
color: #000000;
line-height: 14.4px;
font-weight: 500;
margin-left: 6.4px;
margin-bottom: 6.4px;
}
}
......@@ -455,18 +465,25 @@ export default {
position: absolute;
top: 6.4px;
left: 6.4px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 50%;
width: 19.2px;
height: 19.2px;
border: 1px solid rgba(255, 255, 255, 0.2);
display: flex;
justify-content: center;
align-items: center;
line-height: 19.2px;
font-size: 9.6px;
&.active {
background: #3774f6;
color: #fff;
border: 1px solid #fff;
}
}
.delete-icon {
position: absolute;
bottom: 6.4px;
bottom: 26.4px;
left: 6.4px;
background-color: rgba(255, 0, 0, 0.8);
border-radius: 50%;
......@@ -542,10 +559,13 @@ export default {
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
margin-bottom: 2px;
font-size: 8px;
text-align: center;
&.active {
border-color: #007aff;
background-color: #3774f6;
background: #3774f6;
color: #fff;
border: 1px solid #fff;
}
.inner-circle {
......@@ -555,4 +575,4 @@ export default {
margin-right: 6.4px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -151,6 +151,7 @@ export default {
uid: "",
options: {}, //存储数据
backValue: "",
all_data: [], //所有数据
};
},
computed: {
......@@ -176,6 +177,7 @@ export default {
} else {
this.init();
}
this.all_data = this.$store.state.all_data
},
mounted() {},
methods: {
......@@ -280,7 +282,7 @@ export default {
// 提交
submit(type = "sign", value = "") {
const all_data = this.$store.state.all_data; //获取全部数据
const all_data = this.all_data; //获取全部数据
let params = this.detailsInfo;
params.signImg = value;
console.log("all_data", all_data);
......@@ -292,6 +294,7 @@ export default {
console.log("all_data存储", all_data);
console.log("all_data一个", all_data[index]);
this.$store.commit("SET_ALL_DATA", all_data);
const userInfo = this.userInfo;
const inspectList = all_data.filter(
(item) => item.createByName == userInfo.user
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论