提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -9,17 +9,15 @@
</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-space></div>
<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>
</el-text>
</el-tooltip>
</div>
@@ -33,7 +31,8 @@ import { getListByDefinitionId } from '../api';
import { ElTree } from 'element-plus';
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { patientInfo } from '../../store/patient.js';
const emits = defineEmits(['templateClick','edit']);
import { Edit } from '@element-plus/icons-vue';
const emits = defineEmits(['templateClick', 'edit']);
const props = defineProps({
definitionId: {
type: String,
@@ -55,13 +54,12 @@ 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 = [];
@@ -73,40 +71,60 @@ 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;
}
.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;
}
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;
}
}
}
}
}
</style>