|
|
@@ -9,7 +9,13 @@
|
|
|
<!-- 天气遮罩 -->
|
|
|
<div class="weather-mask" v-show="isExpanded" @click="handleMaskClick"></div>
|
|
|
<!-- 天气 -->
|
|
|
- <weather-info ref="weatherInfoRef" class="weather-info" @weatherExpanded="weatherExpanded" :isGarden="false" @changeGarden="changeGarden"></weather-info>
|
|
|
+ <weather-info
|
|
|
+ ref="weatherInfoRef"
|
|
|
+ class="weather-info"
|
|
|
+ @weatherExpanded="weatherExpanded"
|
|
|
+ :isGarden="false"
|
|
|
+ @changeGarden="changeGarden"
|
|
|
+ ></weather-info>
|
|
|
<div class="farm-monitor-container" :class="{ 'container-role': curRole == 2 }">
|
|
|
<div class="farm-monitor-left" @click="handleCardClick(monitorCards.left)">
|
|
|
<div class="title">
|
|
|
@@ -73,18 +79,18 @@ const farmPopupType = ref("create");
|
|
|
const gardenId = ref(null);
|
|
|
|
|
|
const isGarden = ref(false);
|
|
|
-const changeGarden = ({id}) => {
|
|
|
+const changeGarden = ({ id }) => {
|
|
|
gardenId.value = id;
|
|
|
getExpertByFarmId();
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const expertInfo = ref({});
|
|
|
const getExpertByFarmId = () => {
|
|
|
VE_API.home.getExpertByFarmId({ farmId: gardenId.value }).then(({ data }) => {
|
|
|
expertInfo.value = data || {};
|
|
|
- sessionStorage.setItem('expertId',data.appUserId);
|
|
|
+ sessionStorage.setItem("expertId", data.appUserId);
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
// 监测卡片数据
|
|
|
const monitorCards = ref({
|
|
|
@@ -109,16 +115,16 @@ const monitorCards = ref({
|
|
|
|
|
|
// 卡片点击事件
|
|
|
const handleCardClick = (card) => {
|
|
|
- if(curRole == 0){
|
|
|
- if(!isGarden.value){
|
|
|
+ if (curRole == 0) {
|
|
|
+ if (!isGarden.value) {
|
|
|
showFarmPopup.value = true;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (card.route === "/pest") {
|
|
|
- if(curRole == 2){
|
|
|
+ if (curRole == 2) {
|
|
|
ElMessage.warning("该功能正在升级中,敬请期待");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
const dropdownGardenItem = ref({
|
|
|
organId: 766,
|
|
|
periodId: 1,
|
|
|
@@ -148,7 +154,7 @@ const handleBtn = () => {
|
|
|
|
|
|
onActivated(() => {
|
|
|
getBannerList();
|
|
|
- isGarden.value = Boolean(localStorage.getItem('isGarden'));
|
|
|
+ isGarden.value = Boolean(localStorage.getItem("isGarden"));
|
|
|
// 检测是否从创建农场页面成功返回
|
|
|
if (route.query.showSuccess === "true") {
|
|
|
farmPopupType.value = "success";
|
|
|
@@ -186,7 +192,7 @@ const getBannerList = () => {
|
|
|
VE_API.home.warningPageList(params).then(({ data }) => {
|
|
|
bannerObj.value = data[0] || {};
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const isExpanded = ref(false);
|
|
|
const weatherInfoRef = ref(null);
|
|
|
@@ -203,7 +209,7 @@ const handleMaskClick = () => {
|
|
|
|
|
|
const handleBannerClick = () => {
|
|
|
router.push(`/warning_detail?id=${bannerObj.value.id}`);
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
@@ -217,22 +223,29 @@ const handleBannerClick = () => {
|
|
|
height: 200px;
|
|
|
position: relative;
|
|
|
z-index: 1;
|
|
|
- .banner-img{
|
|
|
+ .banner-img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|
|
|
}
|
|
|
- .banner-title{
|
|
|
+ .banner-title {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
padding: 10px 12px 34px 12px;
|
|
|
box-sizing: border-box;
|
|
|
- background-color: rgba(0, 0, 0, 0.35);
|
|
|
+ background: linear-gradient(
|
|
|
+ 180deg,
|
|
|
+ rgba(102, 102, 102, 0) -64.3%,
|
|
|
+ rgba(0, 0, 0, 0.0074) -1.43%,
|
|
|
+ rgba(0, 0, 0, 0.684747) 39.67%,
|
|
|
+ rgba(0, 0, 0, 0.74) 40.09%,
|
|
|
+ rgba(0, 0, 0, 0.74) 83.2%
|
|
|
+ );
|
|
|
color: #fff;
|
|
|
font-weight: bold;
|
|
|
- backdrop-filter: blur(4px);
|
|
|
+ backdrop-filter: blur(2px);
|
|
|
}
|
|
|
}
|
|
|
.weather-mask {
|
|
|
@@ -314,9 +327,9 @@ const handleBannerClick = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- &.container-role{
|
|
|
+ &.container-role {
|
|
|
height: 104px;
|
|
|
- .farm-monitor-left{
|
|
|
+ .farm-monitor-left {
|
|
|
background: url("@/assets/img/home/farm-bg-4.png") no-repeat center center / 100% 100%;
|
|
|
}
|
|
|
.farm-monitor-right {
|