main
wangqiujuan0808 2023-12-13 15:05:24 +08:00
parent 56d59abe0b
commit 46944238b9
6 changed files with 31 additions and 20 deletions

View File

@ -12,7 +12,9 @@
<div v-for="(item, index) of dataList" :key="index" :class="'div' + index"> <div v-for="(item, index) of dataList" :key="index" :class="'div' + index">
<div>{{ item.title }}</div> <div>{{ item.title }}</div>
<div v-for="(it, i) of item.data" :key="i"> <div v-for="(it, i) of item.data" :key="i">
<Process :itemData="it"></Process> <!-- <Process :itemData="it"></Process> -->
<span>{{ it.label }}</span>
<span class="font26" :style="{ 'color': it.color }">{{ it.value }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -20,7 +22,7 @@
</template> </template>
<script> <script>
import { onMounted, reactive, ref, toRefs,watch } from "vue"; import { onMounted, reactive, ref, toRefs, watch } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import myApi from "@/api/myApi.js"; import myApi from "@/api/myApi.js";
import BarEchart from "./BarEchart.vue"; import BarEchart from "./BarEchart.vue";
@ -168,9 +170,9 @@ export default {
}); });
watch(() => store.state.pclData, val => { watch(() => store.state.pclData, val => {
if (val) { if (val) {
console.log('flow',val); console.log('flow', val);
state.dataList.forEach(ele => { state.dataList.forEach(ele => {
ele.data[0].value = Number(val[ele.data[0].key]).toFixed(2)+''; ele.data[0].value = Number(val[ele.data[0].key]).toFixed(2) + '';
}) })
} }
}, { deep: true, immediate: true }); }, { deep: true, immediate: true });

View File

@ -12,7 +12,7 @@
{{ currentTime }} {{ currentTime }}
</p> </p>
<p class="mr10">登录名 admin</p> <p class="mr10">登录名 admin</p>
<img src="../assets/index.png" alt="" class="mr10" @click="back"/> <!-- <img src="../assets/index.png" alt="" class="mr10" @click="back"/> -->
<el-icon size="32" class="mr10" @click="setting"><Setting /></el-icon> <el-icon size="32" class="mr10" @click="setting"><Setting /></el-icon>
<el-icon size="32" class="mr10" @click="logout"><SwitchButton /></el-icon> <el-icon size="32" class="mr10" @click="logout"><SwitchButton /></el-icon>
</div> </div>

View File

@ -3,12 +3,13 @@
<span>{{ itemData.label }}</span> <span>{{ itemData.label }}</span>
<!-- <div :id="'process' + itemData.id" class="process-echart"></div> --> <!-- <div :id="'process' + itemData.id" class="process-echart"></div> -->
<div class="process-echart"> <div class="process-echart">
<el-progress :text-inside="true" :stroke-width="20" :percentage="itemData.value" :color="itemData.color" /> <el-progress :text-inside="true" :stroke-width="20" :percentage="itemData.value" :color="itemData.color"
show-text format="format"/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { nextTick, onMounted, reactive, ref, toRefs,watch } from "vue"; import { nextTick, onMounted, reactive, ref, toRefs, watch } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
export default { export default {
name: "Process", name: "Process",
@ -23,6 +24,11 @@ export default {
onMounted(() => { onMounted(() => {
getEchart(); getEchart();
}); });
//
const format = (percentage) => {
return percentage;
}
// watch(() => props.itemData, val => { // watch(() => props.itemData, val => {
// if (val) { // if (val) {
// console.log(123 ,val); // console.log(123 ,val);
@ -158,7 +164,8 @@ export default {
return { return {
...toRefs(state), ...toRefs(state),
getEchart, getEchart,
loadProcessChart loadProcessChart,
format
}; };
}, },
}; };

View File

@ -14,7 +14,9 @@
<div v-for="(item, index) of dataList" :key="index" :class="'div' + index" class="process-content"> <div v-for="(item, index) of dataList" :key="index" :class="'div' + index" class="process-content">
<!-- <div>{{ item.title }}</div> --> <!-- <div>{{ item.title }}</div> -->
<div v-for="(it, i) of item.data" :key="i"> <div v-for="(it, i) of item.data" :key="i">
<Process :itemData="it"></Process> <!-- <Process :itemData="it"></Process> -->
<span>{{ it.label }}</span>
<span class="font26" :style="{'color': it.color}">{{ item.value}}</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,7 +5,7 @@ const router = createRouter({
routes: [ routes: [
{ {
path: '/', path: '/',
redirect: '/home' redirect: '/page'
}, },
{ {
path: '/home', path: '/home',

View File

@ -28,14 +28,14 @@ export const uploadImgServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/u
export const uploadImgsServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/upload/files' export const uploadImgsServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/upload/files'
export const pathMap = { export const pathMap = {
login: '登录', login: '中水系统',
home: '世博浦西区活水公园', home: '中水系统',
level: '世博浦西区活水公园', level: '中水系统',
page: '世博浦西区活水公园', page: '中水系统',
weather: '世博浦西区活水公园', weather: '中水系统',
green: '世博浦西区活水公园', green: '中水系统',
biology: '世博浦西区活水公园', biology: '中水系统',
shentou: '世博浦西区活水公园', shentou: '中水系统',
chuxu: '世博浦西区活水公园', chuxu: '中水系统',
config: '世博浦西区活水公园' config: '中水系统'
} }