Browse Source

1111111

feature
是小王呀\24601 1 year ago
parent
commit
8d4d03e7f5
  1. 4
      src/main.js
  2. 98
      src/views/modules/shequzhili/analysis/TableRow.vue
  3. 23
      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 PopHomeTip from "@/components/PopHomeTip/index.vue";
import NameSplit from "@/components/NameSplit/index.vue"; import NameSplit from "@/components/NameSplit/index.vue";
import RelationGraph from "relation-graph"; import RelationGraph from "relation-graph";
import dayjs from 'dayjs' // import dayjs from 'dayjs'
// import AddNodeJw from "@/components/JwTree/addNode.vue"; // import AddNodeJw from "@/components/JwTree/addNode.vue";
//按钮 //按钮
@ -104,7 +104,7 @@ Vue.directive("fixed", {
// 挂载全局 // 挂载全局
Vue.prototype.$http = http; Vue.prototype.$http = http;
Vue.prototype.$sensitive = desensitization; Vue.prototype.$sensitive = desensitization;
Vue.prototype.$dayjs = dayjs // Vue.prototype.$dayjs = dayjs
// el-uploader的header配置 // el-uploader的header配置
Vue.prototype.$getElUploadHeaders = () => ({ Vue.prototype.$getElUploadHeaders = () => ({
Authorization: localStorage.getItem("token") || "", Authorization: localStorage.getItem("token") || "",

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

@ -1,65 +1,41 @@
<template> <template>
<tbody> <tbody>
<tr> <tr>
<td v-if="level === 1" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td> <td v-if="level === 1">{{ item.categoryName }}</td>
<td v-else></td> <td v-else></td>
<td v-if="level === 2" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td> <td v-if="level === 2">{{ item.categoryName }}</td>
<td v-else></td> <td v-else></td>
<td v-if="level === 3" :rowspan="calculateRowspan(item)">{{ item.categoryName }}</td> <td v-if="level === 3">{{ item.categoryName }}</td>
<td v-else></td> <td v-else></td>
<td v-if="level === 4">{{ item.categoryName }}</td> <td v-if="level === 4">{{ item.categoryName }}</td>
<td v-if="level === 4">{{ item.eventCount }}</td> <td v-else></td>
<td v-if="level === 4">{{ item.proportion }}</td> <td>{{ item.eventCount }}</td>
</tr> <td>{{ item.proportion }}</td>
<component </tr>
v-for="child in item.children" <TableRow
:is="'TableRow'" v-for="child in item.children"
:key="child.id" :key="child.id"
:item="child" :item="child"
:level="level + 1" :level="level + 1"
/> />
</tbody> </tbody>
</template> </template>
<script> <script>
export default { export default {
name: 'TableRow', name: 'TableRow',
props: { props: {
item: { item: {
type: Object, type: Object,
required: true, required: true,
},
level: {
type: Number,
required: true,
},
}, },
level: { components: {
type: Number, TableRow: () => import('./TableRow.vue'), //
required: true,
}, },
}, };
methods: { </script>
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>

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

@ -68,7 +68,7 @@
<img style="width: 40px;height: 40px;" src="./img/overdue.png"> <img style="width: 40px;height: 40px;" src="./img/overdue.png">
</div> </div>
<div class="card-content"> <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> <p class="card-text">办理超期事件数</p>
</div> </div>
</div> </div>
@ -86,6 +86,20 @@
<th>事件数量</th> <th>事件数量</th>
<th>同级占比</th> <th>同级占比</th>
</tr> </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" /> <TableRow v-for="item in tableList" :key="item.id" :item="item" :level="1" />
</thead> </thead>
@ -273,6 +287,7 @@ export default {
components: {TableRow}, components: {TableRow},
data() { data() {
return { return {
level:1,
tableList:[], tableList:[],
communityList:[], communityList:[],
departmentList:[], departmentList:[],
@ -613,7 +628,13 @@ export default {
await this.initEcharts(); await this.initEcharts();
}, },
methods: { methods: {
calculateRowspan(item) {
if (!item.children || !item.children.length) {
return 1;
}
},
initEcharts() { initEcharts() {
if(this.categoryCountShow){ if(this.categoryCountShow){

Loading…
Cancel
Save