修改文章病例库管理相关操作问题
This commit is contained in:
parent
cd6dd3d202
commit
7103c40c44
@ -65,6 +65,13 @@ export const caseExchangeApi = {
|
||||
return postRequest(`/caseExchange/selected/update`, { exchangeId, isSelected });
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新审核状态 @author xing
|
||||
*/
|
||||
updateAuditStatus: (exchangeId, auditStatus) => {
|
||||
return postRequest(`/caseExchange/auditStatus/update`, { exchangeId, auditStatus });
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取疾病标签数据 @author xing
|
||||
*/
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="内容" name="articleContent">
|
||||
<a-form-item label="内容" name="articleContent" v-if="!isLinkChecked">
|
||||
<SmartWangeditor ref="contentRef" :modelValue="form.articleContent" :height="300" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@ -356,8 +356,13 @@
|
||||
// 开关状态变化处理
|
||||
function isLinkCheckedChange(checked) {
|
||||
form.isLink = checked ? 1 : 0;
|
||||
if (!checked) {
|
||||
form.isLinkUrl = undefined; // 关闭时清空链接地址
|
||||
if (checked) {
|
||||
// 切换到外部链接模式时,清空内容字段
|
||||
form.articleContent = '';
|
||||
form.articleContentText = '';
|
||||
} else {
|
||||
// 切换到非外部链接模式时,清空链接地址
|
||||
form.isLinkUrl = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@ -617,18 +622,47 @@
|
||||
form.authorList.splice(index, 1);
|
||||
}
|
||||
|
||||
const rules = {
|
||||
// 表单验证规则
|
||||
const rules = computed(() => ({
|
||||
articleTitle: [{ required: true, message: '标题 必填' }],
|
||||
articleStatus: [{ required: true, message: '状态(1:正常 2:禁用) 必填' }],
|
||||
pushDate: [{ required: true, message: '发表时间 必填' }],
|
||||
articleContent: [{ required: true, message: '内容 必填' }],
|
||||
};
|
||||
isLinkUrl: [{
|
||||
required: isLinkChecked.value,
|
||||
message: '外部链接地址 必填',
|
||||
validator: (rule, value) => {
|
||||
if (!isLinkChecked.value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!value || value.trim() === '') {
|
||||
return Promise.reject('外部链接地址 必填');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}],
|
||||
articleContent: [{
|
||||
required: !isLinkChecked.value,
|
||||
message: '内容 必填',
|
||||
validator: (rule, value) => {
|
||||
if (isLinkChecked.value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!value || value.trim() === '') {
|
||||
return Promise.reject('内容 必填');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}],
|
||||
}));
|
||||
|
||||
// 点击确定,验证表单
|
||||
async function onSubmit() {
|
||||
try {
|
||||
form.articleContent = contentRef.value.getHtml();
|
||||
form.articleContentText = contentRef.value.getText();
|
||||
// 只有在非外部链接模式下才获取内容
|
||||
if (!isLinkChecked.value) {
|
||||
form.articleContent = contentRef.value.getHtml();
|
||||
form.articleContentText = contentRef.value.getText();
|
||||
}
|
||||
await formRef.value.validateFields();
|
||||
save();
|
||||
} catch (err) {
|
||||
|
||||
@ -10,14 +10,11 @@
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="关键字" class="smart-query-form-item">
|
||||
<a-input style="width: 200px" v-model:value="queryForm.keywords" placeholder="标题/作者/" />
|
||||
<a-input style="width: 200px" v-model:value="queryForm.keywords" placeholder="疾病名称/标题/作者" />
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="articleStatus" class="smart-query-form-item">
|
||||
<SmartEnumSelect enum-name="STATUS_ENUM" v-model:value="queryForm.articleStatus" width="160px" />
|
||||
</a-form-item>
|
||||
<a-form-item label="删除状态" name="deleteStatus" class="smart-query-form-item">
|
||||
<SmartEnumSelect enum-name="DELETE_STATUS_ENUM" v-model:value="queryForm.deleteStatus" width="160px" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
@ -107,10 +104,6 @@
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'deleteStatus'">
|
||||
<span>{{ text === 1 ? '是' : '否' }}</span>
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'articleTitle'">
|
||||
<div class="text-wrap">{{ text }}</div>
|
||||
</template>
|
||||
@ -196,11 +189,6 @@
|
||||
},
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '删除状态',
|
||||
dataIndex: 'deleteStatus',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '阅读量',
|
||||
dataIndex: 'readNum',
|
||||
@ -239,7 +227,6 @@
|
||||
const queryFormState = {
|
||||
keywords: undefined, //关键字
|
||||
articleStatus: undefined, //状态
|
||||
deleteStatus: undefined, //删除状态
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
|
||||
@ -18,6 +18,9 @@
|
||||
<a-form-item label="精选状态" name="isSelected" class="smart-query-form-item">
|
||||
<SmartEnumSelect enum-name="SELECTED_ENUM" v-model:value="queryForm.isSelected" width="160px" />
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态" name="auditStatus" class="smart-query-form-item">
|
||||
<SmartEnumSelect enum-name="AUDIT_STATUS_ENUM" v-model:value="queryForm.auditStatus" width="160px" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
@ -82,6 +85,11 @@
|
||||
size="small"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'auditStatus'">
|
||||
<a-tag :color="getAuditStatusColor(text)">
|
||||
{{ getAuditStatusText(text) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'caseExchangeLabel'">
|
||||
<div v-if="text && text.length > 0" class="label-list-display">
|
||||
<div v-for="label in text" :key="label.exchangeLabelId" class="label-item-display">
|
||||
@ -92,6 +100,7 @@
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
<a-button @click="showAuditModal(record)" type="link" v-if="hasPermission('caseExchange:auditStatusUpdate')">审核</a-button>
|
||||
<a-button @click="showForm(record)" type="link">编辑</a-button>
|
||||
<a-button @click="onDelete(record)" danger type="link">删除</a-button>
|
||||
</div>
|
||||
@ -179,6 +188,16 @@
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
dataIndex: 'auditStatus',
|
||||
resizable: true,
|
||||
filterOptions: {
|
||||
type: 'enum-select',
|
||||
enumName: 'AUDIT_STATUS_ENUM',
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '阅读量',
|
||||
dataIndex: 'readNum',
|
||||
@ -229,6 +248,7 @@
|
||||
keyword: undefined, //关键字
|
||||
exchangeStatus: undefined, //状态
|
||||
isSelected: undefined, //精选状态
|
||||
auditStatus: undefined, //审核状态
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
@ -356,6 +376,60 @@
|
||||
|
||||
// ---------------------------- 状态切换 ----------------------------
|
||||
|
||||
// 获取审核状态文本
|
||||
function getAuditStatusText(status) {
|
||||
switch (status) {
|
||||
case 0: return '待审核';
|
||||
case 1: return '审核通过';
|
||||
case 2: return '审核不通过';
|
||||
default: return '未知';
|
||||
}
|
||||
}
|
||||
|
||||
// 获取审核状态颜色
|
||||
function getAuditStatusColor(status) {
|
||||
switch (status) {
|
||||
case 0: return 'orange';
|
||||
case 1: return 'green';
|
||||
case 2: return 'red';
|
||||
default: return 'default';
|
||||
}
|
||||
}
|
||||
|
||||
// 权限检查
|
||||
function hasPermission(permission) {
|
||||
// 这里应该根据实际的权限系统来实现
|
||||
// 暂时返回true,您需要根据实际情况修改
|
||||
return true;
|
||||
}
|
||||
|
||||
// 显示审核弹窗
|
||||
function showAuditModal(record) {
|
||||
Modal.confirm({
|
||||
title: '审核病例交流',
|
||||
content: `确定要将"${record.exchangeTitle}"标记为审核通过吗?`,
|
||||
okText: '审核通过',
|
||||
okType: 'primary',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
updateAuditStatus(record, 1);
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
// 更新审核状态
|
||||
async function updateAuditStatus(record, auditStatus) {
|
||||
try {
|
||||
await caseExchangeApi.updateAuditStatus(record.exchangeId, auditStatus);
|
||||
record.auditStatus = auditStatus;
|
||||
message.success('审核状态更新成功');
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
message.error('审核状态更新失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 状态切换
|
||||
async function onStatusChange(record, checked) {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user