rollback^2
xy 10 months ago
parent 5f3e23397a
commit a86418f21a

@ -51,3 +51,11 @@ export function preDistance(params) {
params params
}) })
} }
export function leaveByYear(params) {
return request({
method: 'get',
url: '/api/oa/statistics/leave-by-year',
params
})
}

@ -0,0 +1 @@
<svg t="1739774928951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6189" width="200" height="200"><path d="M822.276658 170.174061h-100.687434v97.920327c0 29.88111-24.221616 54.103942-54.103942 54.103942s-54.103942-24.221616-54.103942-54.103942V170.174061H411.022476v97.920327c0 29.88111-24.221616 54.103942-54.103943 54.103942s-54.103942-24.221616-54.103942-54.103942V170.174061H201.724558c-68.261801 0-124.109934 55.848132-124.109934 124.108717v496.439734c0 68.260585 55.848132 124.11115 124.109934 124.11115h620.5521c68.258152 0 124.108717-55.848132 124.108718-124.11115V294.282778c0.001216-68.260585-55.849348-124.108717-124.108718-124.108717z m62.053751 620.550884c0 34.128468-27.925282 62.05375-62.053751 62.053751H201.724558c-34.129684 0-62.054967-27.925282-62.054967-62.053751V418.392712h744.660818v372.332233z" fill="" p-id="6190"></path><path d="M387.581732 263.376318c0 17.134172-13.890271 31.024443-31.024443 31.024442-17.134172 0-31.023226-13.890271-31.023226-31.024442V139.141104c0.001216-17.132956 13.889054-31.023226 31.024442-31.023226 17.134172 0 31.024443 13.890271 31.024443 31.023226l-0.001216 124.235214zM698.149697 263.376318c0 17.134172-13.889054 31.024443-31.024443 31.024442-17.134172 0-31.024443-13.890271-31.024443-31.024442V139.141104c0-17.132956 13.890271-31.023226 31.024443-31.023226 17.135388 0 31.024443 13.890271 31.024443 31.023226v124.235214z" fill="" p-id="6191"></path><path d="M354.367929 559.588165c15.552968-16.534531 32.589835-41.346057 51.085059-74.438229 10.696238-22.372823 21.893597-32.110608 33.570181-29.191462 14.595731 2.919146 20.43524 11.198575 17.514878 24.812743-0.981563 1.960693-2.43992 3.899493-4.37872 5.838293-1.96191 4.881056-2.919146 7.800202-2.919146 8.757438h205.799808c13.614168 0.980347 20.912034 8.278212 21.893596 21.893597 0 14.595731-6.817423 21.893597-20.432807 21.893596H555.789018v45.24555h94.872251c11.676585 0.981563 18.47333 7.798986 20.43524 20.43524-0.981563 13.637278-7.297866 20.432807-18.976883 20.432807H555.789018v71.520298h109.467982c11.676585 0.981563 17.514877 8.279428 17.514878 21.893597-0.981563 13.638494-7.297866 20.434023-18.974451 20.434023h-108.008409v49.625486c-0.981563 11.676585-8.279428 17.992887-21.893597 18.97445-14.595731 0-21.893597-5.837076-21.893597-17.513661v-51.085058h-151.795602c-12.656931 0-19.476787-6.795529-20.434024-20.434024 0.957237-13.614168 7.777092-20.912034 20.434024-21.893596h33.571397v-77.357375c-1.96191-24.311623 10.695022-35.988207 37.947685-35.030971h80.27652v-45.245549h-86.114813c-13.637278 23.351953-27.731889 40.868047-42.32762 52.543415-13.638494 9.737785-25.315079 10.217012-35.029754 1.459573-7.800202-9.714675-5.838292-20.91325 5.838292-33.570181z m81.736094 75.897801v61.30207h75.896585v-71.519082h-65.680789c-7.798986 0.980347-11.197358 4.378719-10.215796 10.217012z" fill="" p-id="6192"></path></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1,78 @@
<template>
<div>
<card-container>
<vxe-grid v-bind="tableData">
<template #toolbarButtons>
<el-date-picker v-model="select.year" type="year" size="small" value-format="yyyy"></el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getData"></el-button>
</template>
</vxe-grid>
</card-container>
</div>
</template>
<script>
import { leaveByYear } from '@/api/attendance'
export default {
data() {
return {
select: {
year: new Date().getFullYear().toString()
},
tableData: {}
}
},
methods: {
async getData() {
try {
const res = await leaveByYear(this.select)
if (res[0].other) {
this.tableData = {
minHeight: 200,
maxHeight: 600,
toolbarConfig: {
print: true,
export: true,
custom: true,
slots: {
buttons: 'toolbarButtons'
}
},
sortConfig: {
},
columns: [
{
title: '姓名',
field: 'name',
width: 120,
align: 'center',
filters: [{ data: '' }],
filterRender: {
name: 'input'
}
},
...Object.keys(res[0].other)?.map(key => ({
title: key,
width: 'auto',
field: 'other',
align: 'center',
formatter: ({ cellValue }) => cellValue[key] ?? 0,
}))
],
data: res
}
}
} catch (err) {
console.error(err)
}
}
},
computed: {},
created() {
this.getData()
}
}
</script>
<style scoped lang="scss">
</style>

@ -39,6 +39,12 @@
field="id" field="id"
title="流水号" title="流水号"
></vxe-column> ></vxe-column>
<vxe-column
header-align="center"
min-width="240"
field="_simple"
title="简要"
></vxe-column>
<vxe-column <vxe-column
width="80" width="80"
title="发起人" title="发起人"

@ -200,11 +200,18 @@
field="last_log.user.name" field="last_log.user.name"
></vxe-column> ></vxe-column>
<vxe-column <vxe-column
header-align="center" align="center"
min-width="140" min-width="140"
field="custom_model.name" field="custom_model.name"
title="流程名称" title="流程名称"
></vxe-column> ></vxe-column>
<vxe-column
:visible="$route.params.type === 'todo'"
header-align="center"
min-width="240"
field="_simple"
title="简要"
></vxe-column>
<vxe-column <vxe-column
:visible="$route.params.type !== 'all'" :visible="$route.params.type !== 'all'"
align="center" align="center"
@ -486,6 +493,20 @@ export default {
}; };
}, },
methods: { methods: {
contentFormatter(row) {
const { data, fields } = row
let text = ''
fields.forEach((field, index) => {
let options = []
if (field.show_in_list && field.type !== 'relation' && data[field.name]) {
if (field?.selection_model) {
options = field.selection_model_items || [];
}
text += `${field.label}:${(field?.selection_model ? options.find(j => j.id === data[field.name])?.name : data[field.name]) ?? '-'}\n`
}
row._simple = text
})
},
cellClickEvent(e) { cellClickEvent(e) {
if (e.column?.field !== 'title') return if (e.column?.field !== 'title') return
this.listPopoverId = e.row.id this.listPopoverId = e.row.id
@ -539,6 +560,9 @@ export default {
try { try {
const res = await flowList(this.$route.params.type, this.select, false); const res = await flowList(this.$route.params.type, this.select, false);
console.log(res); console.log(res);
if (this.$route.params.type === 'todo') {
res.data?.data?.forEach(i => this.contentFormatter(i))
}
this.list = res?.data?.data || []; this.list = res?.data?.data || [];
this.total = res?.data?.total ?? 0; this.total = res?.data?.total ?? 0;
this.models = res.customModels; this.models = res.customModels;

Loading…
Cancel
Save