Browse Source

信件分类小类别

master
laishajiang 2 years ago
parent
commit
d2e73e1b74
  1. 3
      src/api/data.ts
  2. 108
      src/views/data/category.vue

3
src/api/data.ts

@ -11,3 +11,6 @@ export function getCategorylist(query: any) {
export function getsourcelist(query: any) { export function getsourcelist(query: any) {
return request.get({ url: '/data/getsourcelist',query }) return request.get({ url: '/data/getsourcelist',query })
} }
export function getCategoryHeaderlist(query: any) {
return request.get({ url: '/data/listForCategoryHeader',query })
}

108
src/views/data/category.vue

@ -38,39 +38,50 @@
<main> <main>
<div class="table-container"> <div class="table-container">
<el-table :data="statistics" style="width: 100%"> <el-table :data="statistics" style="width: 100%">
<el-table-column prop="second_dept_name1" label="单位名称" align="center" width="200" /> <el-table-column
<el-table-column key="allcount1" sortable prop="allcount1" label="信件总量" align="center" /> v-for="(column, index) in columns"
<el-table-column label="投诉类" align="center" > :key="index"
<el-table-column prop="sumcount1" sortable label="数量" align="center" /> :prop="column.prop"
<el-table-column prop="countrate1" sortable label="占比" align="center" /> :label="column.label"
</el-table-column> :sortable="column.sortable"
<el-table-column label="举报类" align="center" > :width="column.width"
<el-table-column prop="sumcount2" sortable label="数量" align="center" /> align='center'
<el-table-column prop="countrate2" sortable label="占比" align="center" /> >
</el-table-column> <!-- 如果列有子列递归渲染 -->
<el-table-column label="咨询求助类" align="center" > <el-table-column
<el-table-column prop="sumcount3" sortable label="数量" align="center" /> v-if="column.children"
<el-table-column prop="countrate3" sortable label="占比" align="center" /> v-for="(childColumn, childIndex) in column.children"
</el-table-column> :key="childIndex"
<el-table-column label="工作建议类" align="center" > :prop="childColumn.prop"
<el-table-column prop="sumcount4" sortable label="数量" align="center" /> :label="childColumn.label"
<el-table-column prop="countrate4" sortable label="占比" align="center" /> sortable
</el-table-column> align='center'
<el-table-column label="涉众金融平台类" align="center" > >
<el-table-column prop="sumcount5" sortable label="数量" align="center" /> <!-- 如果子列还有子列继续递归 -->
<el-table-column prop="countrate5" sortable label="占比" align="center" /> <el-table-column
v-if="childColumn.children"
v-for="(grandChildColumn, grandChildIndex) in childColumn.children"
:key="grandChildIndex"
:prop="grandChildColumn.prop"
:label="grandChildColumn.label"
sortable
align='center'
>
<el-table-column
v-if="grandChildColumn.children"
v-for="(grandgrandChildColumnChildColumn, grandgrandChildIndex) in grandChildColumn.children"
:key="grandgrandChildIndex"
:prop="grandgrandChildColumnChildColumn.prop"
:label="grandgrandChildColumnChildColumn.label"
sortable
align='center'
>
</el-table-column> </el-table-column>
<el-table-column label="无效类" align="center" >
<el-table-column prop="sumcount6" sortable label="数量" align="center" />
<el-table-column prop="countrate6" sortable label="占比" align="center" />
</el-table-column> </el-table-column>
<el-table-column label="终止类" align="center" >
<el-table-column prop="sumcount7" sortable label="数量" align="center" />
<el-table-column prop="countrate7" sortable label="占比" align="center" />
</el-table-column> </el-table-column>
<el-table-column label="感谢信类" align="center" >
<el-table-column prop="sumcount8" sortable label="数量" align="center" />
<el-table-column prop="countrate8" sortable label="占比" align="center" />
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@ -86,10 +97,10 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useDictData } from "@/hooks/useDictOptions";
import useMailStore from "@/stores/modules/mail"; import useMailStore from "@/stores/modules/mail";
import { ref, reactive, watchEffect } from "vue"; import { ref, reactive, watchEffect } from "vue";
import { getlist ,getCategorylist} from '@/api/data' import { getCategoryHeaderlist ,getCategorylist} from '@/api/data'
import { useDictOptions } from '@/hooks/useDictOptions' import { useDictOptions } from '@/hooks/useDictOptions'
import { deptEasyLists,listSecond } from '@/api/org/department' import { deptEasyLists,listSecond } from '@/api/org/department'
@ -104,37 +115,10 @@ const { optionsData } = useDictOptions<{
api: listSecond api: listSecond
}, },
}) })
const modifiedCategoryHeaders = computed(() => {
const headers = [...categoryHeaders.value];
const complaintIndex = headers.findIndex(h => h.label === '投诉类');
if (complaintIndex !== -1) {
const complaintHeader = headers.splice(complaintIndex, 1);
headers.splice(complaintIndex, 0, ...complaintHeader, { label: '数量', width: 120 }, { label: '占比', width: 120 });
}
return headers;
});
const categoryHeaders = ref([
{ label: '投诉类' },
{ label: '举报类' },
{ label: '咨询求助类' },
{ label: '工作建议类' },
{ label: '涉众金融平台类' },
{ label: '无效类' },
{ label: '终止类' },
{ label: '感谢信类' },
]) ;
const subHeaders = ref([
{ label: '数量' },
{ label: '占比' },
]);
const mailStore = useMailStore(); const mailStore = useMailStore();
mailStore.getMailCategorys(); mailStore.getMailCategorys();
const { dictData } = useDictData(["mail_source", "mail_level", "mail_state"]);
const query = ref({ const query = ref({
size: 10, size: 10,
@ -146,7 +130,7 @@ const totalSize = reactive({
}) })
const statistics = ref([]); const statistics = ref([]);
const columns = ref([]);
const handleMailTimeQuery = (val: any) => { const handleMailTimeQuery = (val: any) => {
if (val) { if (val) {
query.value.searchStartTime = val[0]; query.value.searchStartTime = val[0];
@ -162,11 +146,15 @@ const handleMailTimeQuery = (val: any) => {
function getList() { function getList() {
getCategoryHeaderlist(query.value).then((data) => {
columns.value = data;
});
getCategorylist(query.value).then((data) => { getCategorylist(query.value).then((data) => {
statistics.value = data.records; statistics.value = data.records;
totalSize.total = data.total; totalSize.total = data.total;
totalSize.pages = data.pages; totalSize.pages = data.pages;
}); });
} }
function reset() { function reset() {

Loading…
Cancel
Save