From b01346e041ffa205d69fddffa8c6f78cbeb307af Mon Sep 17 00:00:00 2001 From: WX <1377869194@qq.com> Date: 星期五, 11 八月 2023 10:57:48 +0800 Subject: [PATCH] 修改风场 --- src/components/YCWG.vue | 7 src/views/index.vue | 9 src/components/SYFX.vue | 7 src/components/dateTimePicker.vue | 156 ++++++++++++--- src/assets/img/sj.png | 0 src/components/BGDC.vue | 19 - src/components/SZSZ.vue | 4 src/assets/js/menuData.js | 42 +++ src/components/fetch.vue | 235 +++++++++++++++++++++++ src/views/menus.vue | 82 ++++++++ src/assets/js/menuTool.js | 34 ++ 11 files changed, 533 insertions(+), 62 deletions(-) diff --git a/src/assets/img/sj.png b/src/assets/img/sj.png new file mode 100644 index 0000000..bbbeaf0 --- /dev/null +++ b/src/assets/img/sj.png Binary files differ diff --git a/src/assets/js/menuData.js b/src/assets/js/menuData.js index a9f5b04..a6e6218 100644 --- a/src/assets/js/menuData.js +++ b/src/assets/js/menuData.js @@ -79,6 +79,23 @@ num: 41, isActive: true, name: "椋庡満妯℃嫙", + child: [ + { + id: "d21", + isActive: true, + name: "鏁翠釜鍘傚尯", + }, + { + id: "d22", + isActive: true, + name: "瑗块儴鍘傚尯", + }, + { + id: "d23", + isActive: true, + name: "涓滈儴鍘傚尯", + }, + ], }, { id: "d3", @@ -87,17 +104,26 @@ name: "姹℃煋鐗╂ā鎷�", }, { - id: "d4", + id: "d7", num: 43, isActive: true, - name: "鐩戞帶鐐逛綅", + name: "璁惧鍒嗗竷", + child: [ + { + id: "d4", + num: 43, + isActive: true, + name: "鐩戞帶鐐逛綅", + }, + { + id: "d5", + num: 44, + isActive: true, + name: "鎺掓斁鐐逛綅", + }, + ], }, - { - id: "d5", - num: 44, - isActive: true, - name: "鎺掓斁鐐逛綅", - }, + { id: "d6", num: 45, diff --git a/src/assets/js/menuTool.js b/src/assets/js/menuTool.js index 2030167..c0c5e56 100644 --- a/src/assets/js/menuTool.js +++ b/src/assets/js/menuTool.js @@ -53,7 +53,28 @@ window.sgworld.Navigate.flyToPosition(115.95108, 39.7411754, 7200, { heading: -90, }); - this.createFC("fc"); + + break; + case "d21": //鍏ㄥ満椋庡満妯℃嫙 + this.createFC("fc", "", { + start: "", + end: "", + Classify: "Main", + }); + break; + case "d22": //瑗块儴椋庡満妯℃嫙 + this.createFC("fc", "", { + start: "", + end: "", + Classify: "West", + }); + break; + case "d23": //涓滈儴椋庡満妯℃嫙 + this.createFC("fc", "", { + start: "", + end: "", + Classify: "East", + }); break; case "d3": //姹℃煋鐗╂ā鎷� window.sgworld.Navigate.flyToPosition(115.95108, 39.7411754, 7200, { @@ -150,7 +171,9 @@ break; case "d6": //澶╂皵鐗规晥娓呴櫎 break; - + case "d7": //鐩戞帶鐐逛綅鎺掓斁鐐逛綅娓呴櫎 + this.closePoi(); + break; case "e2": //闃堝�艰缃竻闄� break; case "e3": //绯荤粺璇存槑娓呴櫎 @@ -289,10 +312,10 @@ sgworld.Core.postMessage({ type: "delete" }); }, //椋庡満妯℃嫙 - createFC(type, date) { + createFC(type, date, data) { if (type == "fc") { sgworld.Core.postMessage( - `Type=shunxuwinds;Bool=true;Density=${FC.Density};Speed=${FC.Speed};` + `Type=shunxuwinds;Bool=true;Density=${FC.Density};Speed=${FC.Speed};StartLayer=${data.start};EndLayer=${data.end};Classify=${data.Classify};` ); } else if (type == "sj") { let arr = date.split(/\s+/); @@ -302,12 +325,11 @@ let Hour = arr[1]; sgworld.Core.postMessage( - `Type=customewinds;Bool=true;Year=${day[0]};Mouth=${day[1]};Day=${day[2]};Hour=${Hour};Density=${FC.Density};Speed=${FC.Speed};` + `Type=customewinds;Bool=true;Year=${day[0]};Mouth=${day[1]};Day=${day[2]};Hour=${Hour};Density=${FC.Density};Speed=${FC.Speed};StartLayer=${data.start};EndLayer=${data.end};Classify=${data.Classify};` ); // console.log( // `Type=customewinds;Bool=true;Year=${day[0]};Mouth=${day[1]};Day=${day[2]};Hour=${Hour[0]};Density=${FC.Density};Speed=${FC.Speed};` // ); - } else { } }, //椋庡満鍒犻櫎 diff --git a/src/components/BGDC.vue b/src/components/BGDC.vue index 209b93a..40f2125 100644 --- a/src/components/BGDC.vue +++ b/src/components/BGDC.vue @@ -32,7 +32,7 @@ </div> <div class="button_box"> - <el-button size="small" @click="selectList">纭</el-button> + <el-button @click="selectList" class="button">纭</el-button> </div> </div> </div> @@ -422,7 +422,7 @@ font-size: 30px; font-weight: bold; color: #ffffff; - padding-bottom: 30px; + padding-bottom: 10px; } } .form_box { @@ -430,12 +430,6 @@ justify-content: space-around; align-items: center; .inp_box { - span { - font-size: 24px; - font-weight: 400; - color: #ffffff; - padding-right: 10px; - } /deep/ .el-input__wrapper { width: 460px; background: rgba(0, 0, 0, 0.2); @@ -474,10 +468,13 @@ } } } -.el-button { +.button { background: rgba(0, 0, 0, 0.2); - border: 2px solid #2e58cc; - border-radius: 10px; + border: 4px solid #2e58cc !important; + border-radius: 20px !important; color: #ffffff; + height: 64px !important; + font-size: 28px !important; + padding: 16px 30px !important; } </style> diff --git a/src/components/SYFX.vue b/src/components/SYFX.vue index 9be8c34..a8d0f83 100644 --- a/src/components/SYFX.vue +++ b/src/components/SYFX.vue @@ -435,5 +435,12 @@ font-size: 24px !important; padding: 16px 30px !important; } + .el-button:focus, + .el-button:hover { + color: var(--el-button-hover-text-color); + border-color: var(--el-button-hover-border-color); + background-color: var(--el-button-hover-bg-color); + outline: 0; + } } </style> diff --git a/src/components/SZSZ.vue b/src/components/SZSZ.vue index 6b577d4..3b7b210 100644 --- a/src/components/SZSZ.vue +++ b/src/components/SZSZ.vue @@ -11,7 +11,9 @@ <el-input v-model="data.YJ" size="large" /> </div> <div class="button_box"> - <el-button size="small" @click="selectList">纭</el-button> + <el-button size="small" @click="selectList" class="button" + >纭</el-button + > </div> </div> </div> diff --git a/src/components/YCWG.vue b/src/components/YCWG.vue index 44d5c1a..068da73 100644 --- a/src/components/YCWG.vue +++ b/src/components/YCWG.vue @@ -337,6 +337,13 @@ font-size: 28px !important; padding: 16px 30px !important; } + .el-button:focus, + .el-button:hover { + color: var(--el-button-hover-text-color); + border-color: var(--el-button-hover-border-color); + background-color: var(--el-button-hover-bg-color); + outline: 0; + } } // .XZboxDate { // width: 70%; diff --git a/src/components/dateTimePicker.vue b/src/components/dateTimePicker.vue index 47fc10c..cc37748 100644 --- a/src/components/dateTimePicker.vue +++ b/src/components/dateTimePicker.vue @@ -1,24 +1,74 @@ <template> - <div class="picker_box"> - <div class="pickerBox"> - <div class="picker_title">鏃堕棿閫夋嫨</div> - <div class="form_box"> - <div class="inp_box XZboxDate"> - <el-date-picker - size="large" - v-model="selectform.value" - type="datetime" - @change="changeTime" - format="YYYY-MM-DD HH" - value-format="YYYY-MM-DD HH" - placeholder="閫夋嫨鏃堕棿" - /> + <div> + <div class="picker_box" v-show="tpData == 'd22' || tpData == 'd23'"> + <div class="pickerBox"> + <div class="picker_title">椋庡尯閫夋嫨</div> + <div class="form_box"> + <!-- <div class="inp_box XZboxDate"> + <span>椋庡尯</span> + <el-select + class="FQ_s" + v-model="selectform.fetch" + placeholder="椋庡尯" + size="large" + clearable + > + <el-option label="鏁翠釜鍘傚尯" value="Main" /> + <el-option label="瑗块儴鍘傚尯" value="West" /> + <el-option label="涓滈儴鍘傚尯" value="East" /> + </el-select> + </div> --> + + <div class="inp_box"> + <span>閫夋嫨灞傛暟</span> + <el-select + v-model="selectform.start" + size="large" + placeholder="寮�濮�" + class="CS_s" + clearable + > + <el-option :label="i" :value="i" v-for="(e, i) in 50" :key="i" /> + </el-select> + <i>-</i> + <el-select + v-model="selectform.end" + size="large" + placeholder="缁撴潫" + class="CS_s" + clearable + > + <el-option :label="e" :value="e" v-for="(e, i) in 50" :key="i" /> + </el-select> + </div> + + <div class="button_box"> + <el-button @click="FQselectBtn">纭畾</el-button> + </div> </div> + </div> + </div> + <div class="picker_box"> + <div class="pickerBox"> + <div class="picker_title">鏃堕棿閫夋嫨</div> + <div class="form_box"> + <div class="inp_box"> + <el-date-picker + size="large" + v-model="selectform.value" + type="datetime" + @change="changeTime" + format="YYYY-MM-DD HH" + value-format="YYYY-MM-DD HH" + placeholder="閫夋嫨鏃堕棿" + /> + </div> - <div class="button_box"></div> + <div class="button_box"></div> - <div class="button_box"> - <el-button @click="selectBtn">纭畾</el-button> + <div class="button_box"> + <el-button @click="selectBtn">纭畾</el-button> + </div> </div> </div> </div> @@ -39,8 +89,16 @@ let selectform = reactive({ value: "", + fetch: "", + start: 0, + end: 0, }); - + let btnState = false; + let CS = { + start: "", + end: "", + Classify: "", + }; const selectBtn = () => { if (selectform.value) { // let newTimeStr = `${value.slice(0, 13)}:00:00`; @@ -73,18 +131,33 @@ emit("changeTime", { data: newTimeStr, week: week }); if (props.tpData == "d2") { - menuTool.createFC("sj", newTimeStr); + if (!btnState) { + return ElMessage.error("璇峰厛閫夋嫨椋庡尯"); + } + menuTool.createFC("sj", newTimeStr, CS); } else { menuTool.createWRW("sj", newTimeStr); } } }; - function changeTime(value) {} - + function FQselectBtn() { + btnState = true; + selectform.value = ""; + CS.start = selectform.start; + CS.end = selectform.end; + CS.Classify = selectform.fetch; + if (selectform.start > selectform.end) { + CS.start = selectform.end; + CS.end = selectform.start; + } + menuTool.createFC("fc", "", CS); + } + function changeTime() {} return { selectBtn, changeTime, selectform, + FQselectBtn, }; }, }; @@ -99,7 +172,7 @@ width: 38%; } .picker_box { - width: calc(742px * 1); + // width: calc(742px * 1.5); // position: absolute; // right: 70px; // top: 490px; @@ -131,6 +204,9 @@ // justify-content: space-around; align-items: center; .inp_box { + display: flex; + // justify-content: space-around; + align-items: center; span { font-size: 24px; font-weight: 400; @@ -187,20 +263,34 @@ } .el-button { background: rgba(0, 0, 0, 0.2); - border: 4px solid #2e58cc !important; - border-radius: 20px !important; + border: 4px solid #2e58cc; + border-radius: 20px; color: #ffffff; - height: 64px !important; - font-size: 28px !important; - padding: 16px 30px !important; + height: 64px; + font-size: 28px; + padding: 16px 30px; + } + .el-button:focus, + .el-button:hover { + color: var(--el-button-hover-text-color); + border-color: var(--el-button-hover-border-color); + background-color: var(--el-button-hover-bg-color); + outline: 0; } } -// .XZboxDate { -// width: 70%; -// /deep/ .el-input { -// width: 100%; -// } -// } +.XZboxDate { + margin-right: 30px; + // width: 460px; + // .el-select { + // width: 30%; + // } +} +.FQ_s { + width: 160px; +} +.CS_s { + width: 100px; +} </style> <style> @media (width: 1920px) { diff --git a/src/components/fetch.vue b/src/components/fetch.vue new file mode 100644 index 0000000..0e8c9d2 --- /dev/null +++ b/src/components/fetch.vue @@ -0,0 +1,235 @@ +<template> + <div class="picker_box"> + <div class="pickerBox"> + <div class="picker_title">椋庡尯閫夋嫨</div> + <div class="form_box"> + <div class="inp_box XZboxDate"> + <span>椋庡尯</span> + <el-select + class="FQ_s" + v-model="selectform.fetch" + placeholder="椋庡尯" + size="large" + clearable + > + <el-option label="鏁翠釜鍘傚尯" value="Main" /> + <el-option label="瑗块儴鍘傚尯" value="West" /> + <el-option label="涓滈儴鍘傚尯" value="East" /> + </el-select> + </div> + + <div class="inp_box"> + <span>閫夋嫨灞傛暟</span> + <el-select + v-model="selectform.start" + size="large" + placeholder="寮�濮�" + class="CS_s" + clearable + @change="startChange" + > + <el-option :label="i" :value="i" v-for="(e, i) in 50" :key="i" /> + </el-select> + <i>-</i> + <el-select + v-model="selectform.end" + size="large" + placeholder="缁撴潫" + class="CS_s" + clearable + @change="endChange" + > + <el-option :label="e" :value="e" v-for="(e, i) in 50" :key="i" /> + </el-select> + </div> + + <div class="button_box"> + <el-button @click="selectBtn">纭畾</el-button> + </div> + </div> + </div> + </div> +</template> + +<script> +import { ref, reactive, onMounted, watch, computed } from "vue"; +import { useStore } from "vuex"; +import { FormInstance, ElMessage, ElMessageBox } from "element-plus"; +import menuTool from "@/assets/js/menuTool"; +export default { + //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + props: ["tpData"], + setup(props, { emit }) { + const store = useStore(); + + let selectform = reactive({ + fetch: "", + start: 0, + end: 0, + }); + + const selectBtn = () => { + if (selectform.start > selectform.end) { + return ElMessage.error("璇锋鏌ユ槸鍚︽湁鏁版嵁"); + } + }; + const endChange = (val) => {}; + const startChange = (val) => {}; + return { + selectBtn, + + selectform, + startChange, + endChange, + }; + }, +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.pickerBox { + width: 100%; +} +.pickerBox1 { + margin-right: 60px; + width: 38%; +} +.picker_box { + // width: calc(742px * 1); + // position: absolute; + // right: 70px; + // top: 490px; + // width: calc(742px * 1.5); + // width: 560px; + height: calc(200px * 1); + + background: url("../assets/img/d.png") no-repeat center; + background-size: 100% 100%; + padding: 40px; + padding-left: 60px; + padding-right: 60px; + box-sizing: border-box; + // display: flex; + // align-items: center; + // justify-content: space-around; + .picker_title { + font-size: 30px; + font-family: Microsoft YaHei; + font-weight: bold; + color: #ffffff; + padding-bottom: 10px; + } + .picker_title_right { + display: flex; + justify-content: flex-end; + } + .form_box { + width: 100%; + display: flex; + // justify-content: space-around; + align-items: center; + .inp_box { + display: flex; + // justify-content: space-around; + align-items: center; + span { + font-size: 24px; + font-weight: 400; + color: #ffffff; + padding-right: 10px; + white-space: nowrap; + } + i { + font-size: 24px; + font-weight: 400; + color: #ffffff; + padding-right: 10px; + padding-left: 10px; + } + // :deep(.el-date-editor) { + // height: 64px; + // } + // .el-date-picker { + // } + /deep/ .el-input__wrapper { + height: 64px; + // width: 460px; + background: rgba(0, 0, 0, 0.2); + border: 2px solid #2e58cc; + border-radius: 10px; + color: #ffffff; + padding: 0; + padding-left: 3px; + } + /deep/ .el-input__inner, + /deep/ .el-textarea__inner { + // background-color: rgba(134, 132, 132, 0.5); + color: #ffffff; + font-size: 24px; + } + /deep/.el-range-input { + color: white; + } + /deep/ .el-range-separator { + color: white; + } + } + :deep(.el-range-editor--large .el-range-separator) { + font-size: 24px; + } + :deep(.el-input__icon), + :deep(.el-range__icon) { + font-size: 28px; + } + ::-webkit-input-placeholder { + font-size: 24px; + } + :deep(.el-range-input) { + font-size: 28px; + } + } + .button_box { + margin-left: 20px; + } + .button_box_right { + display: flex; + justify-content: flex-end; + } + .el-button { + background: rgba(0, 0, 0, 0.2); + border: 4px solid #2e58cc !important; + border-radius: 20px !important; + color: #ffffff; + height: 64px !important; + font-size: 28px !important; + padding: 16px 30px !important; + } +} +.XZboxDate { + margin-right: 30px; + // width: 460px; + // .el-select { + // width: 30%; + // } +} +.FQ_s { + width: 160px; +} +.CS_s { + width: 100px; +} +</style> +<style> +@media (width: 1920px) { + .el-date-range-picker { + transform: scale(1); + } +} + +@media (width: 3840px) { + .el-date-range-picker { + transform: scale(1.7); + } +} +</style> diff --git a/src/views/index.vue b/src/views/index.vue index 9034e07..0822406 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -26,9 +26,15 @@ <div class="close" @click="popoutClose('QX')"></div> <chart></chart> </div> + <date-time-picker :tpData="checkMenuFlag" - v-if="checkMenuFlag == 'd2' || checkMenuFlag == 'd3'" + v-if=" + checkMenuFlag == 'd21' || + checkMenuFlag == 'd22' || + checkMenuFlag == 'd23' || + checkMenuFlag == 'd3' + " @changeTime="changeTime" ></date-time-picker> <div class="weather_box_c" v-show="checkMenuFlag == 'd6'"> @@ -77,6 +83,7 @@ import YCWG from "@/components/YCWG.vue"; //鏃堕棿閫夋嫨 import dateTimePicker from "@/components/dateTimePicker.vue"; + //澶╂皵鐗规晥 import weather from "@/views/weather.vue"; //闃堝�艰缃� diff --git a/src/views/menus.vue b/src/views/menus.vue index 4a56c63..2871c8a 100644 --- a/src/views/menus.vue +++ b/src/views/menus.vue @@ -24,10 +24,25 @@ class="menus_btn_c_list" v-for="(v, j) in item.child" :key="j" - @click="setMenuChildClick(v)" + @click.stop="setMenuChildClick(v)" :class="{ child_Menu_Options: childMenuOptions == v.id }" > {{ v.name }} + <div + class="menus_btn_c_list_chlid" + v-if="v.child" + v-show="childMenuOptions == v.id" + > + <div + class="menus_btn_c_list_chlid_list" + v-for="(e, k) in v.child" + :key="k" + :class="{ child_Menu_Options: checkMenuChildFlag == e.id }" + @click.stop="setMenuTreeChildClick(e)" + > + {{ e.name }} + </div> + </div> </div> </div> </div> @@ -41,7 +56,7 @@ export default { setup(props, { emit }) { const checkMenuFlag = ref("f1"); - + let checkMenuChildFlag = ref(""); let menuOptions = ref([]); let childMenuOptions = ref(""); const setMenuClick = (res) => { @@ -52,6 +67,13 @@ childMenuOptions.value = null; emit("menusData", { id: null, isActive: false }); menuTool.clearLeftTools(res); + } + if (checkMenuChildFlag.value != null) { + if (checkMenuChildFlag.value[0] == res.id[0]) { + checkMenuChildFlag.value = null; + // emit("menusData", { id: null, isActive: false }); + // menuTool.clearLeftTools(res); + } } } res.isActive = false; @@ -65,11 +87,36 @@ }; const setMenuChildClick = (res) => { if (childMenuOptions.value && childMenuOptions.value == res.id) { + if (checkMenuChildFlag.value != null) { + if (checkMenuChildFlag.value[0] == res.id[0]) { + checkMenuChildFlag.value = null; + emit("menusData", { id: null, isActive: false }); + menuTool.clearLeftTools(res); + } + } childMenuOptions.value = null; menuTool.clearLeftTools(res); res.isActive = false; } else { + if (checkMenuChildFlag.value) { + checkMenuChildFlag.value = null; + emit("menusData", { id: null, isActive: false }); + menuTool.clearLeftTools(res); + } childMenuOptions.value = res.id; + menuTool.leftTools(res); + res.isActive = true; + } + emit("menusData", res); + }; + const setMenuTreeChildClick = (res) => { + if (checkMenuChildFlag.value && checkMenuChildFlag.value == res.id) { + checkMenuChildFlag.value = null; + + menuTool.clearLeftTools(res); + res.isActive = false; + } else { + checkMenuChildFlag.value = res.id; menuTool.leftTools(res); res.isActive = true; } @@ -84,6 +131,8 @@ childMenuOptions, setMenuClick, setMenuChildClick, + checkMenuChildFlag, + setMenuTreeChildClick, }; }, }; @@ -150,6 +199,35 @@ line-height: 64px; border-radius: 5px; padding: 0 12px; + position: relative; + .menus_btn_c_list_chlid { + position: absolute; + width: 280px; + // height: 200px; + background: url("../assets/img/sj.png") no-repeat center; + background-size: 100% 100%; + right: -320px; + top: 50%; + transform: translateY(-50%); + padding: 43px 42px 52px 56px; + box-sizing: border-box; + .menus_btn_c_list_chlid_list { + width: 100%; + font-size: 30px; + font-family: JLinXin; + font-weight: 600; + color: #ffffff; + white-space: nowrap; + cursor: pointer; + line-height: 64px; + border-radius: 5px; + text-align: center; + // padding: 0 12px; + } + .menus_btn_c_list_chlid_list:hover { + background: rgba(0, 6, 80, 0.4); + } + } } .menus_btn_c_list:hover { background: rgba(0, 6, 80, 0.4); -- Gitblit v1.9.3