417 lines
12 KiB
Vue
417 lines
12 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
|
|
|
|
<a-form-item field="article_title" label="文章标题">
|
|
<a-input :style="{ width: '182px' }" v-model="queryForm.article_title" placeholder="请输入文章标题" @press-enter="handleQuery" />
|
|
|
|
</a-form-item>
|
|
<a-form-item field="article_status" label="文章状态">
|
|
<a-select v-model="queryForm.article_status" placeholder="请选择文章状态" :style="{ width: '182px' }">
|
|
<a-option :value="2">禁用</a-option>
|
|
<a-option :value="1">正常</a-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
<a-form-item field="is_top" label="是否置顶">
|
|
<a-select v-model="queryForm.is_top" placeholder="请选择是否置顶" :style="{ width: '182px' }">
|
|
<a-option :value="0">否</a-option>
|
|
<a-option :value="1">是</a-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
<a-form-item field="order.sort" label="排序值排序">
|
|
<a-select v-model="queryForm.order.sort" placeholder="请选择排序值排序" :style="{ width: '182px' }">
|
|
<a-option value="asc">正序</a-option>
|
|
<a-option value="desc">倒序</a-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
<!-- <a-form-item field="is_top" label="修改shi'jshijianian">
|
|
<a-select v-model="queryForm.is_top" placeholder="请选择是否置顶" :style="{ width: '182px' }">
|
|
<a-option :value="0">否</a-option>
|
|
<a-option :value="1">是</a-option>
|
|
</a-select>
|
|
</a-form-item> -->
|
|
<a-form-item>
|
|
<a-space>
|
|
<a-button type="primary" @click="handleQuery"><icon-search /> 搜索</a-button>
|
|
<a-button @click="handleResetQuery"><icon-loop /> 重置</a-button>
|
|
</a-space>
|
|
</a-form-item>
|
|
</a-form>
|
|
|
|
<a-divider />
|
|
|
|
<!-- action -->
|
|
<div class="action">
|
|
<a-space>
|
|
<a-button v-has="'admin:sysArticleList:add'" type="primary" @click="handleAdd"><icon-plus /> 添加 </a-button>
|
|
<!-- <a-button v-has="'admin:platformMedinceList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
|
|
<a-button v-has="'admin:platformMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button> -->
|
|
</a-space>
|
|
</div>
|
|
|
|
<!-- table -->
|
|
<!-- :row-selection="{ type: 'checkbox', showCheckedAll: true }" -->
|
|
<a-table :columns="columns" :data="tableData"
|
|
:scroll="{ x: 1200 }"
|
|
|
|
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
|
|
row-key="hospital_id" @selection-change="(selection) => {deleteData = selection;console.log(selection)}"
|
|
@page-change="handlePageChange" @page-size-change="handlepage_sizeChange">
|
|
<template #doctor_id="{record,rowIndex}">
|
|
<div>{{(rowIndex+1)+(pager.page-1)*pager.page_size}}</div>
|
|
</template>
|
|
<template #source_name="{record}">
|
|
<div>{{record.article_science_source.source_name}}</div>
|
|
</template>
|
|
<template #source_image="{record}">
|
|
<a-image
|
|
width="50"
|
|
height="50"
|
|
fit="cover"
|
|
:src="record.article_science_source.source_image"
|
|
/>
|
|
|
|
</template>
|
|
<template #article_image="{record}">
|
|
<a-image
|
|
width="50"
|
|
height="50"
|
|
fit="cover"
|
|
:src="record.article_image"
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #article_science_class="{record}">
|
|
<div>{{record.article_science_class?record.article_science_class:'——'}}</div>
|
|
</template>
|
|
<template #article_status="{record}">
|
|
<div>{{record.article_status==1?'正常':'禁用'}}</div>
|
|
</template>
|
|
<template #is_top="{record}">
|
|
<div>{{record.is_top==1?'是':'否'}}</div>
|
|
</template>
|
|
<template #created_at="{record}">
|
|
<div>{{parseTime(record.created_at)}}</div>
|
|
</template>
|
|
<template #action="{ record }">
|
|
<a-space>
|
|
<a-button v-has="'admin:sysArticleList:detail'" type="text"
|
|
@click="handleDetail(record)"><icon-book />详情</a-button>
|
|
<!-- <a-button v-has="'admin:sysArticleList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
|
|
修改</a-button> -->
|
|
<!-- <a-button v-has="'admin:platformMedinceList:remove'" type="text"
|
|
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button> -->
|
|
</a-space>
|
|
</template>
|
|
</a-table>
|
|
|
|
<articleModal ref="hospitalChild" :modalVisible="modalVisible" :modalForm="modalForm" :id="modalForm.article_id" @freshDetail="freshDetail" @familyVisibleChange="()=>{modalVisible=false,modalForm.article_id=''}"></articleModal>
|
|
<!-- Akiraka 20230223 删除与批量删除 开始 -->
|
|
<!-- <DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removeFamily"
|
|
@deleteVisibleChange="() => deleteVisible = false" /> -->
|
|
<!-- Akiraka 20230223 删除与批量删除 结束 -->
|
|
<a-modal v-model:visible="okVisible" :modal-style="{width:'320px'}" body-class="okmodal"
|
|
@cancel="()=>okVisible=false">
|
|
<template #title>
|
|
提示
|
|
</template>
|
|
<div>确定保存当前信息?</div>
|
|
</a-modal>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
|
|
import { getArticleList,getArticleDetail} from '@/api/kepu/list';
|
|
import { downloadFile } from '@/utils/downloadFile';
|
|
import { parseTime } from '@/utils/parseTime';
|
|
// Akiraka 20230210 删除数据
|
|
const deleteData = ref([])
|
|
// Akiraka 20230210 删除对话框
|
|
const deleteVisible = ref(false)
|
|
// Akiraka 20230210 监听删除事件
|
|
const okVisible = ref(false);
|
|
const hospitalChild=ref(null);
|
|
watch(() => deleteVisible.value, (value) => {
|
|
if (value == false) {
|
|
getMedinceInfo(pager);
|
|
}
|
|
});
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const currentPage = ref(1);
|
|
|
|
|
|
// Pager
|
|
const pager = {
|
|
total: 0,
|
|
page: 1,
|
|
page_size: 10,
|
|
};
|
|
// form
|
|
const queryForm = reactive({
|
|
order:{
|
|
sort:''
|
|
}
|
|
});
|
|
const modalForm = reactive({
|
|
|
|
|
|
});
|
|
const provinceData = ref([]);
|
|
const cityData = ref([]);
|
|
const countryData = ref([]);
|
|
|
|
|
|
// Modal
|
|
const modalVisible = ref(false);
|
|
const modalTitle = ref('默认标题');
|
|
|
|
// Batch Del List
|
|
let batchList = [];
|
|
|
|
// Table Columns
|
|
const columns = [
|
|
{ title: '编号', dataIndex: 'doctor_id', slotName: 'doctor_id', width: '90' },
|
|
{ title: '标题', dataIndex: 'article_title',width:200 },
|
|
{ title: '排序值', dataIndex: 'sort',width:80 },
|
|
// { title: '文章分类', dataIndex: 'article_science_class',slotName: 'article_science_class',width:100 },
|
|
{ title: '文章来源', dataIndex: 'source_name', slotName: 'source_name',width: 120 },
|
|
{ title: '文章来源图片', dataIndex: 'source_image',slotName: 'source_image',width:120 },
|
|
{ title: '文章图片', dataIndex: 'article_image',slotName: 'article_image',width:120 },
|
|
{ title: '状态', dataIndex: 'article_status',slotName: 'article_status',width:80 },
|
|
{ title: '是否置顶', dataIndex: 'is_top',slotName: 'is_top',width:100 },
|
|
{ title: '创建时间', dataIndex: 'created_at',slotName: 'created_at',width:200 },
|
|
{ title: '操作', slotName: 'action', fixed: "right", width: 180 },
|
|
];
|
|
|
|
// Table Data
|
|
const tableData = ref([]);
|
|
//弹框状态
|
|
const modalSatus = ref('add');
|
|
// 新增Satus
|
|
const handleAdd = () => {
|
|
modalVisible.value = true;
|
|
|
|
hospitalChild.value.getData();
|
|
};
|
|
|
|
//详情
|
|
const handleDetail = async (record) => {
|
|
const { code, data, message } = await getArticleDetail(record.article_id)
|
|
if (code == 200) {
|
|
Object.assign(modalForm, data);
|
|
modalVisible.value = true;
|
|
}
|
|
hospitalChild.value.getData(true);
|
|
};
|
|
// 批量删除
|
|
const handleBatchDelete = () => {
|
|
if (batchList.length !== 0) {
|
|
proxy.$modal.warning({
|
|
title: '提示',
|
|
content: '是否批量删除以下选中的数据?',
|
|
hideCancel: false,
|
|
onOk: async () => {
|
|
const res = await removeFamily({ ids: batchList });
|
|
proxy.$message.success(res.message);
|
|
getMedinceInfo(pager);
|
|
},
|
|
onCancel: () => {
|
|
proxy.$message.info('已取消批量删除数据');
|
|
},
|
|
});
|
|
} else {
|
|
proxy.$message.error('请勾选需要删除的数据!');
|
|
}
|
|
};
|
|
|
|
/**
|
|
* 分页改变
|
|
* @param {Number} [page]
|
|
*/
|
|
const handlePageChange = (page) => {
|
|
pager.page = page;
|
|
// 修改当前页码
|
|
currentPage.value = page;
|
|
getMedinceInfo({ ...pager, ...queryForm });
|
|
};
|
|
|
|
// 每页数据量
|
|
const handlepage_sizeChange = (page_size) => {
|
|
pager.page_size = page_size;
|
|
getMedinceInfo({ ...pager, ...queryForm });
|
|
};
|
|
|
|
// 获取患者信息
|
|
const getMedinceInfo = async (params = {}) => {
|
|
const { data, code, message } = await getArticleList(params);
|
|
if (code == 200) {
|
|
tableData.value = data.data;
|
|
|
|
Object.assign(pager, { total: data.total, page: data.page, page_size: data.page_size });
|
|
}
|
|
};
|
|
|
|
// 查询患者信息
|
|
const handleQuery = async () => {
|
|
pager.page = 1;
|
|
currentPage.value = 1;
|
|
if(queryForm.is_top===''){
|
|
delete queryForm.is_top;
|
|
}
|
|
if(!queryForm.article_status){
|
|
delete queryForm.article_status;
|
|
}
|
|
|
|
const params = {
|
|
page: pager.page,
|
|
page_size: pager.page_size,
|
|
...queryForm,
|
|
};
|
|
getMedinceInfo(params);
|
|
};
|
|
const freshDetail = async () => {
|
|
|
|
if(queryForm.is_top===''){
|
|
delete queryForm.is_top;
|
|
}
|
|
if(!queryForm.article_status){
|
|
delete queryForm.article_status;
|
|
}
|
|
|
|
const params = {
|
|
page: pager.page,
|
|
page_size: pager.page_size,
|
|
...queryForm,
|
|
};
|
|
getMedinceInfo(params);
|
|
};
|
|
// 重置搜索
|
|
const handleResetQuery = () => {
|
|
proxy.$refs.queryFormRef.resetFields();
|
|
pager.page = 1;
|
|
pager.page_size=10;
|
|
currentPage.value = 1;
|
|
getMedinceInfo({...pager, ...queryForm});
|
|
}
|
|
const handlExport=async(type)=>{
|
|
proxy.$loading.show();
|
|
let fromData=null;
|
|
if(type==1){
|
|
fromData={
|
|
type,
|
|
...queryForm
|
|
}
|
|
}else if(type==2){
|
|
if(deleteData.value.length==0){
|
|
proxy.$message.warning('请勾选数据');
|
|
proxy.$loading.hide();
|
|
return false;
|
|
};
|
|
let id='';
|
|
deleteData.value.forEach((item)=>{
|
|
if(id){
|
|
id+=","+item
|
|
}else{
|
|
id=item;
|
|
}
|
|
})
|
|
fromData={
|
|
type,
|
|
id
|
|
}
|
|
}else if(type==3){
|
|
fromData={
|
|
type
|
|
}
|
|
}
|
|
const {code,data}=await exportFamily(fromData);
|
|
if(code==200){
|
|
downloadFile(data,'就诊人列表');
|
|
}
|
|
proxy.$loading.hide();
|
|
}
|
|
|
|
onMounted(() => {
|
|
getMedinceInfo(pager);
|
|
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.action {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.okmodal div {
|
|
text-align: center;
|
|
}
|
|
|
|
.hospital_name {
|
|
width: 140px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.headImg {
|
|
margin-right: 20px;
|
|
border-radius: 50%;
|
|
width: 80px;
|
|
height: 80px;
|
|
}
|
|
|
|
.arco-form-item-layout-horizontal:first-child,
|
|
.arco-form-item-layout-horizontal:nth-child(2) {
|
|
align-items: center;
|
|
}
|
|
.cellbox{
|
|
margin-top: 35px;
|
|
}
|
|
.cellbox .cell{
|
|
width:50%;
|
|
border-bottom:1px dashed #efefef;
|
|
margin-bottom: 20px;
|
|
}
|
|
.cellbox .cell:first-child{
|
|
border: none;
|
|
}
|
|
.cell{
|
|
.arco-form-item{
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
.box {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.cert .arco-form-item-label-col {
|
|
flex: 0 0 8px !important;
|
|
}
|
|
|
|
.red {
|
|
display: inline-block;
|
|
margin-right: 5px;
|
|
font-size: 14px;
|
|
color: red;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.cardNum {
|
|
width: 148px;
|
|
}
|
|
.codbox{
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.reason{
|
|
width:250px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
</style> |