提交 1c4b6f5f authored 作者: matian's avatar matian

chore:列表增加项目

上级 f26214dd
...@@ -32,77 +32,88 @@ const handleGetClassList = () => { ...@@ -32,77 +32,88 @@ const handleGetClassList = () => {
}) })
} }
const listOptions = $computed(() => { const listOptions = {
return { remote: {
remote: { httpRequest: getAlumniList,
httpRequest: getAlumniList, params: {
params: { project_prefix: '',
project_prefix: '', username: '',
username: '', sex: '',
sex: '', class_id: '',
class_id: '', province: '',
province: '', city: '',
city: '', industry: '',
industry: '', workplace: ''
workplace: '' },
}, beforeRequest(params: any) {
beforeRequest(params: any) { if (params.sex === '') {
if (params.sex === '') { params.sex = '999'
params.sex = '999' }
return params
}
},
filters: [
{ type: 'input', prop: 'username', placeholder: '姓名' },
{
type: 'select',
prop: 'sex',
placeholder: '性别',
options: [
{ value: '0', label: '女士' },
{ value: '1', label: '先生' },
{ value: '2', label: '未知' }
]
},
{
prop: 'class_id',
slots: 'filter-class'
},
{
prop: 'project_prefix',
slots: 'filter-project'
},
{ type: 'input', prop: 'province', placeholder: '省份', slots: 'filter-province' },
{ type: 'input', prop: 'city', placeholder: '城市', slots: 'filter-city' },
{ type: 'select', prop: 'industry', placeholder: '所在行业', options: industryCategoryList },
{ type: 'input', prop: 'workplace', placeholder: '工作单位' }
],
columns: [
{ label: '姓名', prop: 'username', align: 'center' },
{
label: '性别',
prop: 'sex',
align: 'center',
computed(row: any) {
if (row.row.sex === '0') {
return '女士'
} else if (row.row.sex === '1') {
return '先生'
} else if (row.row.sex === '2') {
return '未知'
} }
return params
} }
}, },
filters: [ { label: '班级', prop: 'class.name', align: 'center' },
{ type: 'input', prop: 'username', placeholder: '姓名' }, {
{ label: '项目',
type: 'select', prop: 'project_prefix',
prop: 'sex', align: 'center',
placeholder: '性别', computed(row: any) {
options: [ return allPrefixList.filter((item: any) => {
{ value: '0', label: '女士' }, console.log(item, row.row, 'item')
{ value: '1', label: '先生' }, if (item.prefix === row.row.project_prefix) {
{ value: '2', label: '未知' } return item
]
},
{
prop: 'class_id',
slots: 'filter-class'
},
{
prop: 'project_prefix',
slots: 'filter-project'
},
{ type: 'input', prop: 'province', placeholder: '省份', slots: 'filter-province' },
{ type: 'input', prop: 'city', placeholder: '城市', slots: 'filter-city' },
{ type: 'select', prop: 'industry', placeholder: '所在行业', options: industryCategoryList },
{ type: 'input', prop: 'workplace', placeholder: '工作单位' }
],
columns: [
{ label: '姓名', prop: 'username', align: 'center' },
{
label: '性别',
prop: 'sex',
align: 'center',
computed(row: any) {
if (row.row.sex === '0') {
return '女士'
} else if (row.row.sex === '1') {
return '先生'
} else if (row.row.sex === '2') {
return '未知'
} }
} })[0].name
}, }
{ label: '班级', prop: 'class.name', align: 'center' }, },
{ label: '省份', prop: 'province', align: 'center' }, { label: '省份', prop: 'province', align: 'center' },
{ label: '城市', prop: 'city', align: 'center' }, { label: '城市', prop: 'city', align: 'center' },
{ label: '所在行业', prop: 'industry', align: 'center' }, { label: '所在行业', prop: 'industry', align: 'center' },
{ label: '工作单位', prop: 'workplace', align: 'center' }, { label: '工作单位', prop: 'workplace', align: 'center' },
{ label: '操作', slots: 'table-operate', width: 230, align: 'center' } { label: '操作', slots: 'table-operate', width: 230, align: 'center' }
] ]
} }
})
const handleFresh = () => { const handleFresh = () => {
appList.value.refetch() appList.value.refetch()
} }
......
<script setup lang="ts"> <script setup lang="ts">
import { getAlumniView } from '../api' import { getAlumniView } from '../api'
import allPrefixList from '../prefix' import {allPrefixList} from '../prefix'
const route = useRoute() const route = useRoute()
const detailList: any = ref({}) const detailList: any = ref({})
let project: any = ref([]) let project: any = ref([])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论