| | |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | :show-summary="false" |
| | | :highlight-current-row="true" |
| | | :highlight-current-row="false" |
| | | @row-click="handleRowClick" |
| | | > |
| | | <slot></slot> |
| | |
| | | --el-table-bg-color: transparent; |
| | | --el-table-row-hover-bg-color: #23dad0a2; |
| | | --el-table-current-row-bg-color: #7dff5d96; |
| | | --el-table-text-color: var(--font-color); |
| | | --el-table-text-color: var(--el-text-color-primary); |
| | | } |
| | | |
| | | .t-row { |
| | |
| | | /* background: red !important; */ |
| | | /* height: 40px; |
| | | border: 1px solid black; */ |
| | | text-align: center !important; |
| | | } |
| | | |
| | | .t-header-row { |
| | | } |
| | | |
| | | .t-header-cell { |
| | | background-color: var(--bg-color-2) !important; |
| | | /* background-color: var(--bg-color-2) !important; */ |
| | | text-align: center !important; |
| | | color: white !important; |
| | | color: var(--el-text-color-primary) !important; |
| | | } |
| | | </style> |
| | |
| | | this.area.districtcode = location.dCode |
| | | this.area.districtname = location.dName |
| | | }, |
| | | setTimePeriod(time, type) { |
| | | const d = time ? dayjs(time) : dayjs() |
| | | this.area.starttime = d.startOf(type).format('YYYY-MM-DD HH:mm:ss') |
| | | this.area.endtime = d.endOf(type).format('YYYY-MM-DD HH:mm:ss') |
| | | }, |
| | | // 设置æ¶é´ä¸ºç»å®æ¶é´å¯¹åºå½æ¥ç头尾 |
| | | setTimeOneDay(time) { |
| | | const d = time ? dayjs(time) : dayjs() |
| | | this.area.starttime = d.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
| | | this.area.endtime = d.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
| | | this.setTimePeriod(time, 'day') |
| | | }, |
| | | // 设置æ¶é´ä¸ºç»å®æ¶é´å¯¹åºå½æç头尾 |
| | | setTimeOneMonth(time) { |
| | | this.setTimePeriod(time, 'month') |
| | | }, |
| | | // è®¾ç½®åºæ¯ç±»å |
| | | setSceneType(t) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref } from 'vue' |
| | | import { defineStore } from 'pinia' |
| | | import timeUtil from '@/utils/time-util' |
| | | |
| | | // å·¡æ¥ä»»å¡ |
| | | export const useSubtaskStore = defineStore('subtask', () => { |
| | | // 彿ææå·¡æ¥ç»è®¡ä¿¡æ¯ |
| | | const summaryList = ref([]) |
| | | const summaryMap = ref(new Map()) |
| | | const subtaskLoading = ref(false) |
| | | const onFetchList = [] |
| | | const onFetchMap = [] |
| | | |
| | | // 设置æ°çå¼ |
| | | function setSummary(data) { |
| | | summaryList.value = data |
| | | summaryMap.value.clear() |
| | | data.forEach((e) => { |
| | | const tag = timeUtil.formatYMD(e.subtask.planstarttime) |
| | | if (!summaryMap.value.has(tag)) { |
| | | summaryMap.value.set(tag, []) |
| | | } |
| | | summaryMap.value.get(tag).push(e) |
| | | }) |
| | | if (onFetchList.length > 0) { |
| | | onFetchList.forEach((e) => { |
| | | if (e.tag) { |
| | | e.fun(summaryMap.value.get(e.tag)) |
| | | } else { |
| | | e.fun(summaryList.value) |
| | | } |
| | | }) |
| | | } |
| | | if (onFetchMap.length > 0) { |
| | | onFetchMap.forEach((e) => { |
| | | e(summaryMap.value) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | function getSummaryList(timeTag, callback) { |
| | | if (summaryMap.value.size === 0) { |
| | | onFetchList.push({ tag: timeTag, fun: callback }) |
| | | } else { |
| | | if (timeTag) { |
| | | callback(summaryMap.value.get(timeTag)) |
| | | } else { |
| | | callback(summaryList.value) |
| | | } |
| | | } |
| | | } |
| | | |
| | | function getSummaryMap(callback) { |
| | | if (summaryMap.value.size === 0) { |
| | | onFetchMap.push(callback) |
| | | } else { |
| | | callback(summaryMap.value) |
| | | } |
| | | } |
| | | |
| | | return { summaryList, summaryMap, subtaskLoading, setSummary, getSummaryList, getSummaryMap } |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | const fontSize = 12 |
| | | |
| | | function barChartOption(chartData) { |
| | | const x = chartData.xAxis |
| | | const legends = chartData.yAxis.map((v) => { |
| | | return v.name |
| | | }) |
| | | const series = chartData.yAxis.map((v) => { |
| | | return { |
| | | name: v.name, |
| | | type: 'bar', |
| | | data: v.data |
| | | } |
| | | }) |
| | | return { |
| | | legend: { |
| | | data: legends, |
| | | textStyle: { |
| | | fontSize: fontSize, |
| | | color: 'white' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: x, |
| | | axisLabel: { |
| | | rotate: 45, |
| | | textStyle: { |
| | | fontSize: fontSize |
| | | }, |
| | | color: '#ffffff', |
| | | textBorderColor: '#fff' |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: fontSize, |
| | | color: 'white' |
| | | } |
| | | } |
| | | }, |
| | | series: series |
| | | } |
| | | } |
| | | |
| | | export { barChartOption } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | const fontSize = 12 |
| | | |
| | | // æ¾ç¤ºåcountä¸ªæ°æ®æ ç¾ |
| | | function genData(chartData, count) { |
| | | chartData.forEach((item, index) => { |
| | | const _show = index < count |
| | | item.label = { show: _show } |
| | | item.labelLine = { show: _show } |
| | | }) |
| | | return chartData |
| | | } |
| | | |
| | | /** |
| | | * 饼å¾ï¼å䏿 ¼å°å¾ï¼é
ç½® |
| | | * @param {String} name ç³»ååç§° |
| | | * @param {Array} chartData æ°æ® |
| | | * @param {boolean} sort æ¯å¦æåº |
| | | * @param {number} showLegendCount æ¾ç¤ºæ ç¾æ°é |
| | | * @returns |
| | | */ |
| | | function pieChartOption(name, chartData, showLegendCount) { |
| | | let _data = chartData |
| | | if (showLegendCount) { |
| | | _data = genData(_data, showLegendCount) |
| | | } |
| | | return { |
| | | // legend: { |
| | | // textStyle: { |
| | | // fontSize: fontSize, |
| | | // color: 'white' |
| | | // } |
| | | // }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: name, |
| | | type: 'pie', |
| | | // radius: '55%', |
| | | center: ['50%', '50%'], |
| | | data: _data, |
| | | roseType: 'radius', |
| | | percentPrecision: 0, |
| | | label: { |
| | | position: 'outside', |
| | | formatter: '{b}({d}%)', |
| | | color: 'rgba(255, 255, 255, 0.8)' |
| | | }, |
| | | labelLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255, 255, 255, 0.3)' |
| | | }, |
| | | smooth: 0.2, |
| | | length: 5, |
| | | length2: 5 |
| | | }, |
| | | itemStyle: { |
| | | color: '#c23531', |
| | | shadowBlur: 200, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | }, |
| | | animationType: 'scale', |
| | | animationEasing: 'elasticOut', |
| | | animationDelay: function (idx) { |
| | | return Math.random() * 200 |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | |
| | | export { pieChartOption } |
| | |
| | | viewMode: '3D', // å°å¾æ¨¡å¼ |
| | | resizeEnable: true, |
| | | center: [121.603928, 31.252955], |
| | | zooms: [3, 18], |
| | | zooms: [2, 20], |
| | | zoom: 14 |
| | | }) |
| | | |
| | |
| | | */ |
| | | |
| | | import { map, AMap } from './index' |
| | | import util from './util' |
| | | |
| | | var _massMarks = undefined |
| | | |
| | |
| | | map.add(massMarks) |
| | | }, |
| | | |
| | | createLabelMarks(img, dataList) { |
| | | createLabelMarks(img, dataList, onClick) { |
| | | const layer = new AMap.LabelsLayer({ |
| | | zooms: [3, 20], |
| | | zIndex: 1000, |
| | | // å¼å¯æ 注é¿è®©ï¼é»è®¤ä¸ºå¼å¯ï¼v1.4.15 æ°å¢å±æ§ |
| | | collision: true, |
| | | collision: false, |
| | | // å¼å¯æ 注淡å
¥å¨ç»ï¼é»è®¤ä¸ºå¼å¯ï¼v1.4.15 æ°å¢å±æ§ |
| | | animation: true |
| | | }) |
| | |
| | | image: img, |
| | | // clipOrigin: [14, 92], |
| | | // clipSize: [50, 68], |
| | | size: [30, 30], |
| | | size: [20, 20], |
| | | anchor: 'bottom-center', |
| | | angel: 0, |
| | | retina: true |
| | |
| | | direction: 'top', |
| | | offset: [0, -5], |
| | | style: { |
| | | fontSize: 16, |
| | | fontSize: 12, |
| | | fontWeight: 'normal', |
| | | fillColor: '#fff', |
| | | strokeColor: '#333', |
| | |
| | | } |
| | | } |
| | | curData.extData = { |
| | | index: i |
| | | data: data |
| | | } |
| | | |
| | | var labelMarker = new AMap.LabelMarker(curData) |
| | | labelMarker.on('click', (event) => { |
| | | console.log(labelMarker.getExtData()) |
| | | console.log(event) |
| | | util.setFitView([event.target]) |
| | | // util.setZoomSmall() |
| | | // util.setCenter(event.lnglat) |
| | | // èªå®ä¹ç¹å»äºä»¶ |
| | | if (typeof onClick === 'function') { |
| | | onClick(event.data.data.extData.data) |
| | | } |
| | | }) |
| | | |
| | | // markers.push(labelMarker); |
| | | |
| | |
| | | clearViews() { |
| | | map.clearMap() |
| | | }, |
| | | setFitView() { |
| | | map.setFitView() |
| | | setFitView(views) { |
| | | if (views) { |
| | | map.setFitView(views) |
| | | } else { |
| | | map.setFitView() |
| | | } |
| | | }, |
| | | setZoomSmall() { |
| | | map.setZoom(18) |
| | | }, |
| | | setZoomMedium() { |
| | | map.setZoom(14) |
| | | }, |
| | | setZoomLarge() { |
| | | map.setZoom(6) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // var index = 0 |
| | | setInterval(() => { |
| | | streams.push({ |
| | | // index: index, |
| | | time: dayjs().format('YYYY-MM-DD HH:mm:ss'), |
| | | user: users[parseInt(Math.random() * users.length)], |
| | | obj: objs[parseInt(Math.random() * objs.length)], |
| | | event: events[parseInt(Math.random() * events.length)] |
| | | }) |
| | | scrollToBottom() |
| | | // index++ |
| | | }, 10000) |
| | | // setInterval(() => { |
| | | // streams.push({ |
| | | // time: dayjs().format('YYYY-MM-DD HH:mm:ss'), |
| | | // user: users[parseInt(Math.random() * users.length)], |
| | | // obj: objs[parseInt(Math.random() * objs.length)], |
| | | // event: events[parseInt(Math.random() * events.length)] |
| | | // }) |
| | | // scrollToBottom() |
| | | // }, 10000) |
| | | }) |
| | | </script> |
| | |
| | | <template> |
| | | <!-- <div class="border-r-small"> --> |
| | | <BaseCard> |
| | | <div class="font-large">é®é¢æ´æ¹è·è¸ª</div> |
| | | <el-row justify="space-between" align="middle"> |
| | | <div class="font-large">é®é¢æ´æ¹è·è¸ª</div> |
| | | <OptionTime v-model="time" type="date"></OptionTime> |
| | | </el-row> |
| | | <div> |
| | | <el-row justify="end"> |
| | | <OptionTime v-model="time" type="date"></OptionTime> |
| | | </el-row> |
| | | <ProblemSummary :data="subtaskList" :proStatistic="proStatistic"></ProblemSummary> |
| | | <ProblemTable :data="subtaskList"></ProblemTable> |
| | | </div> |
| | | </BaseCard> |
| | | <BaseCard> |
| | | <el-row justify="space-between" align="middle"> |
| | | <div class="font-large">åæè¶å¿</div> |
| | | <OptionTime v-model="time"></OptionTime> |
| | | </el-row> |
| | | <div> |
| | | <ProblemChangeChart ref="pChangeRef"></ProblemChangeChart> |
| | | </div> |
| | | </BaseCard> |
| | | <BaseCard> |
| | | <el-row justify="space-between" align="middle"> |
| | | <div class="font-large">é®é¢åå¸</div> |
| | | </el-row> |
| | | <div> |
| | | <ProblemType ref="pTypeRef"></ProblemType> |
| | | </div> |
| | | </BaseCard> |
| | | <!-- <BaseCard> |
| | | <el-collapse v-model="activeNames" @change="handleChange"> |
| | | <el-collapse-item title="åæè¶å¿" name="1"> |
| | | <ProblemChangeChart ref="pChangeRef"></ProblemChangeChart> |
| | |
| | | <ProblemType ref="pTypeRef"></ProblemType> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </BaseCard> |
| | | </BaseCard> --> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | | <script> |
| | | import { useAreaStore } from '@/stores/area.js' |
| | | import { useSubtaskStore } from '@/stores/subtask.js' |
| | | import { mapStores } from 'pinia' |
| | | import dayjs from 'dayjs' |
| | | |
| | |
| | | const d = nV ? dayjs(nV) : dayjs() |
| | | this.area.starttime = d.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
| | | this.area.endtime = d.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
| | | // this.areaStore.setTimeOneDay(nV) |
| | | this.fetchSubtask() |
| | | this.fetchDayProblemsStatistic() |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapStores(useAreaStore) |
| | | ...mapStores(useAreaStore), |
| | | ...mapStores(useSubtaskStore) |
| | | }, |
| | | methods: { |
| | | fetchSubtask() { |
| | | taskApi.fetchSubtaskSummaryByArea(this.area).then((res) => { |
| | | this.subtaskList = res.data |
| | | // taskApi.fetchSubtaskSummaryByArea(this.area).then((res) => { |
| | | // this.subtaskList = res.data |
| | | // }) |
| | | const tag = dayjs(this.time).format('YYYY-MM-DD') |
| | | this.subtaskStore.getSummaryList(tag, (v) => { |
| | | this.subtaskList = v ? v : [] |
| | | }) |
| | | }, |
| | | fetchDayProblemsStatistic() { |
| | |
| | | <template> |
| | | <el-row justify="space-between"> |
| | | <el-col :span="18"> |
| | | <div> |
| | | <el-text size="small"> |
| | | åºæ¯æ°ï¼{{ sceneNum }}ï¼é®é¢æ»æ°ï¼{{ proNum }}ï¼ååºæ¯é®é¢åå¼ï¼{{ proEachSceneNum }}ï¼ |
| | | </div> |
| | | <div> |
| | | </el-text> |
| | | <el-text size="small"> |
| | | æ´æ¹æ»æ°ï¼{{ changeNum }}ï¼æææ´æ¹æ°ï¼{{ changePassNum }}ï¼é®é¢æ´æ¹çï¼{{ |
| | | changePer |
| | | }}ï¼æææ´æ¹çï¼{{ changePassPer }} |
| | | </div> |
| | | </el-text> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-row justify="end"> |
| | | <OptionTime v-model="time"></OptionTime> |
| | | <!-- <OptionTime v-model="time"></OptionTime> --> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import { barChartOption } from '@/utils/echart/bar-chart-option' |
| | | import { useSubtaskStore } from '@/stores/subtask.js' |
| | | import { mapStores } from 'pinia' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | sceneNum: 51, |
| | | proNum: 161, |
| | | changeNum: 40, |
| | | changePassNum: 40 |
| | | sceneNum: 0, |
| | | proNum: 0, |
| | | changeNum: 0, |
| | | changePassNum: 0 |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapStores(useSubtaskStore), |
| | | proEachSceneNum() { |
| | | return Math.round((this.proNum / this.sceneNum) * 10) / 10 |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | refresh() { |
| | | const fontSize = 12 |
| | | const option = { |
| | | legend: { |
| | | data: ['é®é¢æ°', 'æ´æ¹æ°'], |
| | | textStyle: { |
| | | fontSize: fontSize, |
| | | color: 'white' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['1å·', '2å·', '3å·', '4å·', '5å·', '6å·', '7å·', '8å·', '9å·'], |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: fontSize |
| | | }, |
| | | color: '#ffffff', |
| | | textBorderColor: '#fff' |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: fontSize, |
| | | color: 'white' |
| | | } |
| | | } |
| | | }, |
| | | series: [ |
| | | fetchData() { |
| | | this.subtaskStore.getSummaryMap((map) => { |
| | | this.refresh(map) |
| | | }) |
| | | }, |
| | | refresh(map) { |
| | | let sceneNum = 0, |
| | | proNum = 0, |
| | | changeNum = 0, |
| | | changePassNum = 0 |
| | | const chartData = { |
| | | xAxis: [], |
| | | yAxis: [ |
| | | { |
| | | name: 'é®é¢æ°', |
| | | type: 'bar', |
| | | data: [12, 8, 9, 7, 14, 19, 9, 7, 14] |
| | | data: [] |
| | | }, |
| | | { |
| | | name: 'æ´æ¹æ°', |
| | | type: 'bar', |
| | | data: [6, 2, 5, 3, 6, 3, 6, 2, 5] |
| | | data: [] |
| | | } |
| | | // { |
| | | // name: 'æ´æ¹ç', |
| | | // type: 'bar', |
| | | // data: [820, 832, 901, 934, 1290, 1330, 1320] |
| | | // } |
| | | ] |
| | | } |
| | | const list = [] |
| | | for (const key of map.keys()) { |
| | | const value = map.get(key) |
| | | list.push({ name: key, value: value }) |
| | | } |
| | | // ææ¥ææ£åºæå |
| | | list |
| | | .sort(function (a, b) { |
| | | return b.name - a.name |
| | | }) |
| | | .forEach((e) => { |
| | | chartData.xAxis.push(dayjs(e.name).format('DDæ¥')) |
| | | let pNum = 0, |
| | | cNum = 0 |
| | | |
| | | e.value.forEach((s) => { |
| | | sceneNum++ |
| | | pNum += s.proNum |
| | | cNum += s.changeNum |
| | | changePassNum += s.changeCheckedNum |
| | | }) |
| | | chartData.yAxis[0].data.push(pNum) |
| | | chartData.yAxis[1].data.push(cNum) |
| | | proNum += pNum |
| | | changeNum += cNum |
| | | }) |
| | | const option = barChartOption(chartData) |
| | | this.echart.setOption(option) |
| | | |
| | | this.sceneNum = sceneNum |
| | | this.proNum = proNum |
| | | this.changeNum = changeNum |
| | | this.changePassNum = changePassNum |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.echart = echarts.init(this.$refs.echart) |
| | | this.refresh() |
| | | this.fetchData() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <!-- <div class="font-small"> |
| | | 仿¥ç»è®¡ï¼é®é¢æ°: {{ summary.proNum }}ï¼æ´æ¹æ°: {{ summary.changeNum }}ï¼æ´æ¹ç: |
| | | {{ summary.changePer }} |
| | | </div> --> |
| | | |
| | | <div v-if="mainProType" class="font-small"> |
| | | çªåºé®é¢ï¼{{ mainProType.name }}ï¼é®é¢æ°ï¼{{ mainProType.count }}ï¼å æ¯{{ mainProType.per }} |
| | | </div> |
| | | <BaseTable :data="summary"> |
| | | <el-table-column |
| | | label="é®é¢æ°" |
| | | prop="proNum" |
| | | :show-overflow-tooltip="true" |
| | | width="60" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="æ´æ¹æ°" |
| | | prop="changeNum" |
| | | :show-overflow-tooltip="true" |
| | | width="60" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="æ´æ¹ç" |
| | | prop="changePer" |
| | | :show-overflow-tooltip="true" |
| | | width="60" |
| | | ></el-table-column> |
| | | </BaseTable> |
| | | <el-row> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="9" :xl="9"> |
| | | <div v-show="mainProType"> |
| | | <el-text>çªåºé®é¢</el-text> |
| | | <div ref="echartRef" class="pie-chart"></div> |
| | | </div> |
| | | <template v-if="mainProType"> |
| | | <div v-show="false" class="font-small"> |
| | | çªåºé®é¢ï¼{{ mainProType.name }}ï¼é®é¢æ°ï¼{{ mainProType.count }}ï¼å æ¯{{ |
| | | mainProType.per |
| | | }} |
| | | </div> |
| | | </template> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="colSpanLarge" :xl="colSpanLarge"> |
| | | <el-text>åæ¥æ±æ»</el-text> |
| | | <BaseTable :data="summary"> |
| | | <el-table-column |
| | | label="é®é¢æ°" |
| | | prop="proNum" |
| | | :show-overflow-tooltip="true" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="æ´æ¹æ°" |
| | | prop="changeNum" |
| | | :show-overflow-tooltip="true" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="æ´æ¹ç" |
| | | prop="changePer" |
| | | :show-overflow-tooltip="true" |
| | | ></el-table-column> |
| | | </BaseTable> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | <script setup> |
| | | import { computed, ref } from 'vue' |
| | | import { computed, onMounted, ref, watch } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | import * as echarts from 'echarts' |
| | | import { pieChartOption } from '@/utils/echart/chart-option' |
| | | |
| | | const props = defineProps({ |
| | | date: { |
| | | type: Date, |
| | | default: new Date() |
| | | }, |
| | | data: { |
| | | type: Array, |
| | | default: () => [] |
| | |
| | | loading: Boolean |
| | | }) |
| | | |
| | | const colSpanLarge = computed(() => { |
| | | return mainProType.value ? 15 : 24 |
| | | }) |
| | | |
| | | // é¥¼å¾ |
| | | let echart |
| | | const echartRef = ref(null) |
| | | |
| | | // 彿¥æ¶é´ |
| | | const timeObj = computed(() => { |
| | | const d = dayjs(props.date) |
| | | return { |
| | | year: d.year(), |
| | | month: d.month(), |
| | | date: d.date() |
| | | } |
| | | }) |
| | | |
| | | // é®é¢åæ´æ¹æ°éç»è®¡ |
| | | const summary = computed(() => { |
| | | let proNum = 0, |
| | | changeNum = 0, |
| | |
| | | return [{ proNum, changeNum, changePer }] |
| | | }) |
| | | |
| | | // çªåºé®é¢ç»è®¡ |
| | | const mainProType = computed(() => { |
| | | let res |
| | | let total = 0, |
| | |
| | | } |
| | | } |
| | | }) |
| | | refreshChart(props.proStatistic) |
| | | return res |
| | | }) |
| | | |
| | | function refreshChart(data) { |
| | | if (!data || !echart) return |
| | | const chartData = data |
| | | .map((item) => { |
| | | return { |
| | | value: item.count, |
| | | name: item.name |
| | | } |
| | | }) |
| | | // æ£åºæå |
| | | .sort(function (a, b) { |
| | | return b.value - a.value |
| | | }) |
| | | const option = pieChartOption('é®é¢åå¸', chartData, 1) |
| | | const series = option.series[0] |
| | | // series.radius = '50%' |
| | | series.center = ['10%', '50%'] |
| | | series.label.formatter = '{b}\n{c}个({d}%)' |
| | | echart.setOption(option) |
| | | setTimeout(() => { |
| | | echart.resize() |
| | | }, 100) |
| | | } |
| | | |
| | | // watch(props.proStatistic, (nV, oV) => { |
| | | // if (nV != oV) { |
| | | // refreshChart(nV) |
| | | // } |
| | | // }) |
| | | |
| | | onMounted(() => { |
| | | echart = echarts.init(echartRef.value) |
| | | }) |
| | | </script> |
| | | <style scoped> |
| | | .pie-chart { |
| | | /* width: 200px; */ |
| | | height: 70px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-row justify="space-between"> |
| | | <el-col :span="18"> |
| | | <div v-if="mainProType"> |
| | | <el-text v-if="mainProType"> |
| | | çªåºé®é¢ï¼{{ mainProType.name }}ï¼é®é¢æ°ï¼{{ mainProType.count }}ï¼å æ¯{{ mainProType.per }} |
| | | <!-- <span v-for="item in mainProType" :key="item.name"> |
| | | {{ item.name }}ï¼é®é¢æ°ï¼{{ item.count }}ï¼å æ¯{{ item.per }} |
| | | </span> --> |
| | | </div> |
| | | </el-text> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-row justify="end"> |
| | |
| | | </template> |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import { pieChartOption } from '@/utils/echart/chart-option' |
| | | import { unref } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | |
| | | import problemApi from '@/api/fysp/problemApi.js' |
| | | import { useFetchData } from '@/composables/fetchData' |
| | | import { useAreaStore } from '@/stores/area.js' |
| | |
| | | const param = unref(this.areaStore.area) |
| | | param.starttime = dayjs(param.starttime).startOf('month').format('YYYY-MM-DD HH:mm:ss') |
| | | param.endtime = dayjs(param.endtime).endOf('month').format('YYYY-MM-DD HH:mm:ss') |
| | | this.fetchData((page, pageSize) => { |
| | | this.fetchData(() => { |
| | | return problemApi.fetchProblemsStatistic(param).then((res) => { |
| | | this.dataList = res |
| | | const chartData = res |
| | |
| | | }) |
| | | }, |
| | | refresh(chartData) { |
| | | const fontSize = 12 |
| | | const option = { |
| | | legend: { |
| | | data: ['é®é¢', 'æ´æ¹'], |
| | | textStyle: { |
| | | fontSize: fontSize, |
| | | color: 'white' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'é®é¢åå¸', |
| | | type: 'pie', |
| | | radius: '55%', |
| | | center: ['50%', '50%'], |
| | | data: chartData, |
| | | // data: [ |
| | | // { value: 24, name: 'åºå
¥å£ï¼éè·¯ï¼æ¬å°' }, |
| | | // { value: 20, name: 'å·¥ç¨è½¦è¾' }, |
| | | // { value: 18, name: 'éè·¯æ¬å°' }, |
| | | // { value: 26, name: 'è·¯é¢ç¡¬å' }, |
| | | // { value: 30, name: '渣å' } |
| | | // ].sort(function (a, b) { |
| | | // return a.value - b.value |
| | | // }), |
| | | roseType: 'radius', |
| | | label: { |
| | | color: 'rgba(255, 255, 255, 0.8)' |
| | | }, |
| | | labelLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255, 255, 255, 0.3)' |
| | | }, |
| | | smooth: 0.2, |
| | | length: 10, |
| | | length2: 20 |
| | | }, |
| | | itemStyle: { |
| | | color: '#c23531', |
| | | shadowBlur: 200, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | }, |
| | | animationType: 'scale', |
| | | animationEasing: 'elasticOut', |
| | | animationDelay: function (idx) { |
| | | return Math.random() * 200 |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | const option = pieChartOption('é®é¢åå¸', chartData) |
| | | this.echart.setOption(option) |
| | | } |
| | | }, |
| | |
| | | <ManagementView></ManagementView> |
| | | </el-scrollbar> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-col :span="17"> |
| | | <el-scrollbar class="page-left-top"> |
| | | <VisualizationView></VisualizationView> |
| | | </el-scrollbar> |
| | |
| | | <InspectionView></InspectionView> |
| | | </el-scrollbar> |
| | | </el-col> |
| | | <el-col :span="7" class="page-right"> |
| | | <!-- <el-col :span="7" class="page-right"> |
| | | <el-scrollbar height="var(--fy-body-height)"> |
| | | <StatisticView></StatisticView> |
| | | </el-scrollbar> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { provide, ref } from 'vue' |
| | | import { provide, ref, unref } from 'vue' |
| | | import InspectionView from '@/views/inspection/InspectionView.vue' |
| | | import ManagementView from '@/views/management/ManagementView.vue' |
| | | import StatisticView from '@/views/management/StatisticView.vue' |
| | | import VisualizationView from '@/views/visualization/VisualizationView.vue' |
| | | import { useAreaStore } from '@/stores/area.js' |
| | | import { useSubtaskStore } from '@/stores/subtask.js' |
| | | import { useMapStore } from '@/stores/map.js' |
| | | import taskApi from '@/api/fysp/taskApi.js' |
| | | import marks from '@/utils/map/marks.js' |
| | | import mapUtil from '@/utils/map/util.js' |
| | | import scene_1 from '@/assets/icon/scene_1.png' |
| | | |
| | | provide('mapHeight', 'calc(var(--fy-body-height) / 4 * 3)') |
| | | provide('excludeMapHeight', 'calc(var(--fy-body-height) / 4 * 1)') |
| | | const windowHeight = ref(window.innerHeight) |
| | | |
| | | const areaStore = useAreaStore() |
| | | areaStore.setTimeOneDay() |
| | | const subtaskStore = useSubtaskStore() |
| | | const mapStore = useMapStore() |
| | | |
| | | // åå§åæ¥è¯¢èå´ |
| | | areaStore.setTimeOneMonth() |
| | | areaStore.setLocation({ |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | |
| | | }) |
| | | areaStore.setSceneType('1') |
| | | |
| | | // const headerHeight = computed(()=>{ |
| | | // return |
| | | // }) |
| | | // fetch('../../assets/styles/layout.scss').then((res) => { |
| | | // console.log(res.text()) |
| | | // }) |
| | | |
| | | provide('mapHeight', 'calc(var(--fy-body-height) / 4 * 3)') |
| | | provide('excludeMapHeight', 'calc(var(--fy-body-height) / 4 * 1)') |
| | | // è·åæ¬æçææå·¡æ¥ç»è®¡ä¿¡æ¯ |
| | | subtaskStore.subtaskLoading = true |
| | | taskApi.fetchSubtaskSummaryByArea(areaStore.area).then((res) => { |
| | | // åå¨ä¸ºå
¨å±æ°æ® |
| | | subtaskStore.setSummary(res.data) |
| | | subtaskStore.subtaskLoading = false |
| | | // ç»å¶å°å¾æ è®° |
| | | marks.createLabelMarks(scene_1, unref(res.data), (v) => { |
| | | mapStore.focusMarker = v |
| | | }) |
| | | mapUtil.setFitView() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { inject } from 'vue' |
| | | import { inject, unref } from 'vue' |
| | | import { useAreaStore } from '@/stores/area.js' |
| | | import { mapStores } from 'pinia' |
| | | |
| | |
| | | }) |
| | | }, |
| | | newLabelMasks(data) { |
| | | marks.createLabelMarks(scene_1, data) |
| | | marks.createLabelMarks(scene_1, unref(data)) |
| | | } |
| | | }, |
| | | mounted() { |