|
|
|
@ -1,107 +1,83 @@
|
|
|
|
|
<template> |
|
|
|
|
<ContentWrap> |
|
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
|
<el-form |
|
|
|
|
class="-mb-15px" |
|
|
|
|
:model="queryParams" |
|
|
|
|
ref="queryFormRef" |
|
|
|
|
:inline="true" |
|
|
|
|
label-width="68px" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="名称" prop="name"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.name" |
|
|
|
|
placeholder="请输入名称" |
|
|
|
|
clearable |
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
class="!w-240px" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="创建时间" prop="createTime"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="queryParams.createTime" |
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
type="daterange" |
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
|
|
|
class="!w-220px" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
|
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
plain |
|
|
|
|
@click="openForm('create')" |
|
|
|
|
v-hasPermi="['system:policy:create']" |
|
|
|
|
> |
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="success" |
|
|
|
|
plain |
|
|
|
|
@click="handleExport" |
|
|
|
|
:loading="exportLoading" |
|
|
|
|
v-hasPermi="['system:policy:export']" |
|
|
|
|
> |
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
|
<ContentWrap> |
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
|
|
|
<!-- <el-table-column label="id" align="center" prop="id" /> --> |
|
|
|
|
<el-table-column label="名称" align="center" prop="name" /> |
|
|
|
|
<el-table-column label="生效日期" align="center" prop="effectiveDate" :formatter="dateFormatter2" /> |
|
|
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
label="创建时间" |
|
|
|
|
align="center" |
|
|
|
|
prop="createTime" |
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
width="180px" |
|
|
|
|
/> |
|
|
|
|
<el-table-column label="操作" align="center" min-width="120px"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-button |
|
|
|
|
link |
|
|
|
|
type="primary" |
|
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
|
v-hasPermi="['system:policy:update']" |
|
|
|
|
> |
|
|
|
|
编辑 |
|
|
|
|
<section class="flex flex-col gap-20px"> |
|
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" @submit.prevent> |
|
|
|
|
<el-form-item prop="name"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.name" |
|
|
|
|
placeholder="请输入名称" |
|
|
|
|
clearable |
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
class="!w-240px" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="handleQuery" type="primary" plain> |
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> 查询 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="ml-auto"> |
|
|
|
|
<el-button |
|
|
|
|
link |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete(scope.row.id)" |
|
|
|
|
v-hasPermi="['system:policy:delete']" |
|
|
|
|
type="primary" |
|
|
|
|
@click="openForm('create')" |
|
|
|
|
v-hasPermi="['system:policy:create']" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
<Icon icon="ep:circle-plus" class="mr-5px" /> 新增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
link |
|
|
|
|
type="primary" |
|
|
|
|
@click="clickOpenDetail(scope.row.id)" |
|
|
|
|
|
|
|
|
|
@click="handleExport" |
|
|
|
|
:loading="exportLoading" |
|
|
|
|
v-hasPermi="['system:policy:export']" |
|
|
|
|
> |
|
|
|
|
详情 |
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<!-- 分页 --> |
|
|
|
|
<Pagination |
|
|
|
|
:total="total" |
|
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
|
@pagination="getList" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true"> |
|
|
|
|
<el-table-column label="名称" prop="name" /> |
|
|
|
|
<el-table-column |
|
|
|
|
label="生效日期" |
|
|
|
|
prop="effectiveDate" |
|
|
|
|
:formatter="dateFormatter2" |
|
|
|
|
width="320" |
|
|
|
|
/> |
|
|
|
|
<el-table-column label="发布人" width="320"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
{{ `${row.createName} | ${row.createDeptName}` }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="创建时间" |
|
|
|
|
prop="createTime" |
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
width="320" |
|
|
|
|
/> |
|
|
|
|
<el-table-column label="操作选项" align="center" width="120px"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-button |
|
|
|
|
link |
|
|
|
|
type="primary" |
|
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
|
v-hasPermi="['system:policy:update']" |
|
|
|
|
> |
|
|
|
|
编辑 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<!-- 分页 --> |
|
|
|
|
<el-pagination |
|
|
|
|
:total="total" |
|
|
|
|
:show-page-size="false" |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
v-model:current-page="queryParams.pageNo" |
|
|
|
|
v-model:page-size="queryParams.pageSize" |
|
|
|
|
@change="getList" |
|
|
|
|
class="ml-auto" |
|
|
|
|
/> |
|
|
|
|
</section> |
|
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
@ -109,7 +85,7 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' |
|
|
|
|
import download from '@/utils/download' |
|
|
|
|
import { PolicyApi, PolicyVO } from '@/api/system/policy' |
|
|
|
|
import PolicyForm from './PolicyForm.vue' |
|
|
|
@ -127,7 +103,7 @@ const queryParams = reactive({
|
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
name: undefined, |
|
|
|
|
createTime: [], |
|
|
|
|
createTime: [] |
|
|
|
|
}) |
|
|
|
|
const queryFormRef = ref() // 搜索的表单 |
|
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
@ -145,7 +121,7 @@ const getList = async () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const clickOpenDetail = (id: number) => { |
|
|
|
|
console.log(id); |
|
|
|
|
console.log(id) |
|
|
|
|
window.open(`/policyDetail?id=${id}`, '_blank') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -199,4 +175,4 @@ const handleExport = async () => {
|
|
|
|
|
onMounted(() => { |
|
|
|
|
getList() |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
</script> |
|
|
|
|