Revert "```"

This reverts commit abc0674531.
This commit is contained in:
2025-12-26 22:21:21 +08:00
parent ae6c486114
commit 3115e38cc4
920 changed files with 14452 additions and 107025 deletions

View File

@@ -9,15 +9,17 @@
</div> -->
<el-scrollbar class="emr-template-scrollbar-container" style="width: 100%">
<div v-for="item in templateData" :key="item.id" class="scrollbar-item">
<el-tooltip effect="dark" :content="`${item.name}`" placement="bottom">
<el-tooltip
effect="dark"
:content="`${item.name}`"
placement="bottom"
>
<el-text class="2" truncated @click="handleNodeClick(item)">
<div class="template-item">
{{ item.name }}
<el-space>
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
<el-icon><Delete @click="handleDelete(item)" /></el-icon>
</el-space>
</div>
<div class="template-item">{{ item.name }}
<el-space>
<el-icon><Edit @click="handleEdit(item)" /></el-icon>
</el-space></div>
</el-text>
</el-tooltip>
</div>
@@ -31,8 +33,7 @@ import { getListByDefinitionId } from '../api';
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
import { Edit } from '@element-plus/icons-vue';
const emits = defineEmits(['templateClick', 'edit']);
const emits = defineEmits(['templateClick','edit']);
const props = defineProps({
definitionId: {
type: String,
@@ -54,12 +55,13 @@ const queryParams = ref({
const templateData = ref([]);
const queryList = async () => {
try {
if (unref(definitionId) && unref(definitionId) !== '') {
if ( unref(definitionId)&&unref(definitionId) !== '') {
const res = await getListByDefinitionId(unref(definitionId));
templateData.value = res.data || [];
} else {
}else{
templateData.value = [];
}
} catch (error) {
ElMessage.error('获取模板失败');
templateData.value = [];
@@ -71,60 +73,40 @@ const handleNodeClick = (data) => {
const handleEdit = (data) => {
emits('edit', data);
};
// 删除模板
const handleDelete = async (item) => {
try {
ElMessageBox.confirm('确定要删除该模板吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
await deleteTemplate(item.id);
ElMessage.success('删除成功');
queryList();
});
} catch (error) {
if (error !== 'cancel') {
ElMessage.error('删除失败');
}
}
};
const currentSelectTemplate = ref({});
defineExpose({ queryList });
</script>
<style lang="scss" scoped>
.emr-template-container {
height: 100%;
// padding: 8px;
.emr-template-scrollbar-container {
height: 100%;
// padding: 8px;
.emr-template-scrollbar-container{
padding: 8px;
height: 100%;
.scrollbar-item {
height: 40px;
line-height: 40px;
border-radius: 4px;
cursor: pointer;
background: var(--el-color-primary-light-9);
& + .scrollbar-item {
margin-top: 8px;
}
transition: all 0.3s ease;
.el-text {
width: calc(100% - 0px);
display: flex;
justify-content: space-between;
padding: 0 8px;
}
.template-item {
width: 100%;
display: flex;
justify-content: space-between;
}
.scrollbar-item {
height: 40px;
line-height: 40px;
border-radius: 4px;
cursor: pointer;
background: var(--el-color-primary-light-9);
& + .scrollbar-item {
margin-top: 8px;
}
.el-text{
width: calc(100% - 0px);
display: flex;
justify-content: space-between;
padding: 0 8px;
}
.template-item{
width: 100%;
display: flex;
justify-content: space-between;
}
}
}
}
</style>