Browse Source

1111111

7.31
是小王呀\24601 1 year ago
parent
commit
8d4d03e7f5
  1. 4
      src/main.js
  2. 100
      src/views/modules/shequzhili/analysis/TableRow.vue
  3. 27
      src/views/modules/shequzhili/analysis/index.vue

4
src/main.js

@ -48,7 +48,7 @@ import PopTips from "@/components/PopTips/index.vue";
import PopHomeTip from "@/components/PopHomeTip/index.vue";
import NameSplit from "@/components/NameSplit/index.vue";
import RelationGraph from "relation-graph";
import dayjs from 'dayjs'
// import dayjs from 'dayjs'
// import AddNodeJw from "@/components/JwTree/addNode.vue";
//按钮
@ -104,7 +104,7 @@ Vue.directive("fixed", {
// 挂载全局
Vue.prototype.$http = http;
Vue.prototype.$sensitive = desensitization;
Vue.prototype.$dayjs = dayjs
// Vue.prototype.$dayjs = dayjs
// el-uploader的header配置
Vue.prototype.$getElUploadHeaders = () => ({
Authorization: localStorage.getItem("token") || "",

100
src/views/modules/shequzhili/analysis/TableRow.vue

@ -1,65 +1,41 @@
<template>
<tbody>
<tr>
<td v-if="level === 1" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 2" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 3" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 4">{{ item.categoryName }}</td>
<td v-if="level === 4">{{ item.eventCount }}</td>
<td v-if="level === 4">{{ item.proportion }}</td>
</tr>
<component
v-for="child in item.children"
:is="'TableRow'"
:key="child.id"
:item="child"
:level="level + 1"
/>
</tbody>
</template>
<script>
export default {
name: 'TableRow',
props: {
item: {
type: Object,
required: true,
<tbody>
<tr>
<td v-if="level === 1">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 2">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 3">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 4">{{ item.categoryName }}</td>
<td v-else></td>
<td>{{ item.eventCount }}</td>
<td>{{ item.proportion }}</td>
</tr>
<TableRow
v-for="child in item.children"
:key="child.id"
:item="child"
:level="level + 1"
/>
</tbody>
</template>
<script>
export default {
name: 'TableRow',
props: {
item: {
type: Object,
required: true,
},
level: {
type: Number,
required: true,
},
},
level: {
type: Number,
required: true,
components: {
TableRow: () => import('./TableRow.vue'), //
},
},
methods: {
calculateRowspan(item) {
if (!item.children || !item.children.length) {
return 1;
}
return item.children.reduce((sum, child) => sum + this.calculateRowspan(child), 0);
},
},
};
</script>
<style scoped>
table {
width: 100%;
border-collapse: collapse;
}
th, td {
width: 40px;
height: 20px;
border: 1px solid #ccc;
padding: 8px;
text-align: center;
}
thead {
background-color: #f9f9f9;
}
</style>
};
</script>

27
src/views/modules/shequzhili/analysis/index.vue

@ -68,7 +68,7 @@
<img style="width: 40px;height: 40px;" src="./img/overdue.png">
</div>
<div class="card-content">
<p class="card-title">{{analysisList.illegalResolveTotal}}{{analysisList.illegalResolveRate?analysisList.illegalResolveRate:"--"}} <span class="percentage">{{analysisList.illegalResolveRate?analysisList.illegalResolveRate:"--"}}%</span></p>
<p class="card-title">{{analysisList.illegalResolveTotal}} <span class="percentage">{{analysisList.illegalResolveRate}}%</span></p>
<p class="card-text">办理超期事件数</p>
</div>
</div>
@ -86,6 +86,20 @@
<th>事件数量</th>
<th>同级占比</th>
</tr>
<tr v-for="item in tableList" :key="item.id" :item="item" :level=1>
<td v-if="level === 1" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 2" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 3" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td>
<td v-else></td>
<td v-if="level === 4">{{ item.categoryName }}</td>
<td v-if="level === 4">{{ item.eventCount }}</td>
<td v-if="level === 4">{{ item.proportion }}</td>
<td v-else></td>
<td >{{ item.eventCount }}</td>
<td >{{item.proportion}}</td>
</tr>
<TableRow v-for="item in tableList" :key="item.id" :item="item" :level="1" />
</thead>
@ -273,6 +287,7 @@ export default {
components: {TableRow},
data() {
return {
level:1,
tableList:[],
communityList:[],
departmentList:[],
@ -281,7 +296,7 @@ export default {
queryDateStart: "",
queryDateEnd: "",
},
agencyLevel:'',
orgData: {
@ -613,7 +628,13 @@ export default {
await this.initEcharts();
},
methods: {
calculateRowspan(item) {
if (!item.children || !item.children.length) {
return 1;
}
},
initEcharts() {
if(this.categoryCountShow){

Loading…
Cancel
Save