wangqiujuan0808 2023-12-12 20:49:19 +08:00
parent ef69e7c282
commit 881a986408
3 changed files with 14 additions and 7 deletions

View File

@ -6,11 +6,11 @@
<div class="one-card-content"> <div class="one-card-content">
<div> <div>
<p>节水量</p> <p>节水量</p>
<font><span class="font26">4.00</span></font> <font><span class="font26">{{ baseData && baseData.vd2716.toFixed(2) }}</span></font>
</div> </div>
<div> <div>
<p>节碳量</p> <p>节碳量</p>
<font><span class="font26">0.67</span>kg</font> <font><span class="font26">{{ baseData && (baseData.vd2716 * 0.168).toFixed(2) }}</span>kg</font>
</div> </div>
<div> <div>
<p>原水箱液位<span class="font26">{{ baseData && baseData.vd500.toFixed(2) }}</span>m</p> <p>原水箱液位<span class="font26">{{ baseData && baseData.vd500.toFixed(2) }}</span>m</p>

View File

@ -23,7 +23,7 @@
</template> </template>
<script> <script>
import { onMounted, reactive, ref, toRefs, nextTick } from "vue"; import { onMounted, reactive, ref, toRefs, watch } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import {useStore} from 'vuex'; import {useStore} from 'vuex';
export default { export default {
@ -106,7 +106,13 @@ export default {
}] }]
}] }]
}) })
watch(() => store.state.pclData, val => {
if (val) {
console.log('主页', val);
state.menus[0].parms[0].value = val.vd2716.toFixed(2);
state.menus[0].parms[1].value = (val.vd2716 * 0.168).toFixed(2);
}
}, { deep: true, immediate: true });
onMounted(() => { onMounted(() => {
store.commit("setModelName", ''); store.commit("setModelName", '');
}) })

View File

@ -33,13 +33,14 @@ import md5 from "js-md5";
import { reactive, ref, toRefs, onMounted } from "vue"; import { reactive, ref, toRefs, onMounted } from "vue";
import myApi from "@/api/myApi.js"; import myApi from "@/api/myApi.js";
import { localSet, localGet } from "@/utils"; import { localSet, localGet } from "@/utils";
import bgImg from '@/assets/bg2.png'
export default { export default {
name: "Login", name: "Login",
setup() { setup() {
const loginForm = ref(null); const loginForm = ref(null);
const state = reactive({ const state = reactive({
projectName: "", projectName: "",
loginImg: "", loginImg: bgImg,
ruleForm: { ruleForm: {
username: "", username: "",
password: "", password: "",
@ -57,8 +58,8 @@ export default {
onMounted(async () => { onMounted(async () => {
const res = await myApi.getInfo(); const res = await myApi.getInfo();
state.projectName = res.data.title || '世博浦西区活水公园'; state.projectName = res.data && res.data.title || '世博浦西区活水公园';
state.loginImg = res.data.loginImg; state.loginImg = res.data && res.data.loginImg || bgImg;
}); });
const submitForm = async () => { const submitForm = async () => {