158 lines
5.4 KiB
Vue
158 lines
5.4 KiB
Vue
<template>
|
|
<div>
|
|
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
|
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
|
|
<template #icon>
|
|
<icon name="el-icon-Plus" />
|
|
</template>
|
|
新增
|
|
</el-button>
|
|
<!-- <el-button
|
|
v-perms="['flow_type/delete']"
|
|
:disabled="!selectData.length"
|
|
@click="handleDelete(selectData)"
|
|
>
|
|
删除
|
|
</el-button> -->
|
|
<div class="mt-4">
|
|
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
|
{{ pager }}
|
|
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
|
|
<el-table-column label="名称" prop="title" show-overflow-tooltip />
|
|
<el-table-column label="优先级" prop="title" width="90" show-overflow-tooltip>
|
|
<template #default="{ row }">
|
|
<span
|
|
:class="{
|
|
one: row.priority == 1,
|
|
tow: row.priority == 2,
|
|
the: row.priority == 3,
|
|
fou: row.priority == 4
|
|
}"
|
|
>{{ row.priority_name }}</span
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
label="负责人"
|
|
prop="director_name"
|
|
width="90"
|
|
show-overflow-tooltip
|
|
/>
|
|
<el-table-column
|
|
label="协作人"
|
|
prop="assist_admin_names"
|
|
width="90"
|
|
show-overflow-tooltip
|
|
/>
|
|
<el-table-column
|
|
label="审查人"
|
|
prop="assist_check_names"
|
|
width="90"
|
|
show-overflow-tooltip
|
|
/>
|
|
<el-table-column label="开始时间" prop="start_time" show-overflow-tooltip />
|
|
<el-table-column label="结束时间" prop="end_time" show-overflow-tooltip />
|
|
<el-table-column label="审查时间" prop="check_time" show-overflow-tooltip />
|
|
<el-table-column label="状态" prop="status" show-overflow-tooltip>
|
|
<template #default="{ row }">
|
|
<span v-if="row.status == 1" style="color: #67c23a">正常</span>
|
|
<span v-else style="color: #fe0000">禁用</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="auto" fixed="right">
|
|
<template #default="{ row }">
|
|
<el-button
|
|
v-perms="['flow/edit']"
|
|
type="primary"
|
|
link
|
|
@click="handleEdit(row)"
|
|
>
|
|
编辑
|
|
</el-button>
|
|
<el-button
|
|
v-perms="['flow/delete']"
|
|
type="danger"
|
|
link
|
|
@click="handleDelete(row.id)"
|
|
>
|
|
删除
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="flex mt-4 justify-end">
|
|
<pagination v-model="pager" @change="getLists" />
|
|
</div>
|
|
</el-card>
|
|
<edit-popup
|
|
v-if="showEdit"
|
|
ref="editRef"
|
|
:dict-data="dictData"
|
|
@success="getLists"
|
|
@close="showEdit = false"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { usePaging } from '@/hooks/usePaging'
|
|
import { useDictData } from '@/hooks/useDictOptions'
|
|
import { timeFormat } from '@/utils/util'
|
|
import feedback from '@/utils/feedback'
|
|
import EditPopup from './edit.vue'
|
|
|
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
|
// 是否显示编辑框
|
|
const showEdit = ref(false)
|
|
|
|
// 查询条件
|
|
const queryParams = reactive({})
|
|
|
|
// 选中数据
|
|
const selectData = ref<any[]>([])
|
|
|
|
// 表格选择后回调事件
|
|
const handleSelectionChange = (val: any[]) => {
|
|
selectData.value = val.map(({ id }) => id)
|
|
}
|
|
|
|
// 获取字典数据
|
|
const { dictData } = useDictData('')
|
|
|
|
// 添加
|
|
const handleAdd = async () => {
|
|
showEdit.value = true
|
|
await nextTick()
|
|
editRef.value?.open('add')
|
|
}
|
|
|
|
// 编辑
|
|
const handleEdit = async (data: any) => {
|
|
showEdit.value = true
|
|
await nextTick()
|
|
editRef.value?.open('edit')
|
|
editRef.value?.setFormData(data)
|
|
}
|
|
|
|
// 删除
|
|
const handleDelete = async (id: number | any[]) => {
|
|
await feedback.confirm('确定要删除?')
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.one {
|
|
color: #f7ba2a;
|
|
}
|
|
.the {
|
|
color: #ff5100;
|
|
}
|
|
.tow {
|
|
color: #f38200;
|
|
}
|
|
.fou {
|
|
color: red;
|
|
}
|
|
</style>
|