|
@@ -1,19 +1,20 @@
|
|
|
<template>
|
|
|
测试用住院号:
|
|
|
- <el-input v-model="editData.data.patNo" style="width: 120px;" placeholder="请输入住院号"/>
|
|
|
+ <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()" style="width: 120px;"
|
|
|
+ placeholder="请输入住院号"/>
|
|
|
测试用住院次数:
|
|
|
<el-input-number style="width: 120px;" :min="1" :precision="0" v-model="editData.data.times"
|
|
|
placeholder="请输入住院次数"/>
|
|
|
<el-button @click="openDialog(true,null)">新增数据</el-button>
|
|
|
<el-button @click="testWhetherPatientDataIsNormal">测试全部数据</el-button>
|
|
|
<xc-table :data="data" @currentChange="queryChange" @sizeChange="queryChange">
|
|
|
- <el-table-column label="操作" width="80">
|
|
|
+ <el-table-column label="操作" width="120">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="warning" @click="openDialog(false,scope.row)">编辑</el-button>
|
|
|
- <!-- <el-button type="danger">删除</el-button>-->
|
|
|
+ <el-button type="warning" round icon="Edit" @click="openDialog(false,scope.row)"></el-button>
|
|
|
+ <el-button type="danger" round icon="Delete" @click="clickDelete(scope.row)"></el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="delFlag" label="删除" width="30"/>
|
|
|
+ <!-- <el-table-column prop="delFlag" label="删除" width="30"/>-->
|
|
|
<el-table-column prop="id" label="uuid" width="40"/>
|
|
|
<el-table-column prop="name" label="数据名称" width="80" show-overflow-tooltip/>
|
|
|
<el-table-column prop="sqlSentence" label="语句内容" show-overflow-tooltip/>
|
|
@@ -21,9 +22,7 @@
|
|
|
|
|
|
<el-drawer v-model="editData.dialog"
|
|
|
:title="editData.title"
|
|
|
- :show-close="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :close-on-click-modal="false"
|
|
|
+ @closed="close"
|
|
|
size="90%">
|
|
|
<el-row>
|
|
|
|
|
@@ -31,7 +30,8 @@
|
|
|
<el-form :model="editData.data" :label-width="90" :rules="rules" ref="formRef">
|
|
|
|
|
|
<el-form-item prop="patNo" label="住院号">
|
|
|
- <el-input v-model="editData.data.patNo" placeholder="请输入住院号"/>
|
|
|
+ <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()"
|
|
|
+ placeholder="请输入住院号"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="patNo" label="住院次数">
|
|
@@ -40,12 +40,25 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="name" label="名称">
|
|
|
- <el-input v-model="editData.data.name" placeholder="请输入名称"/>
|
|
|
+ <el-input v-model="editData.data.name" @blur="editData.data.name = $event.target.value.trim()"
|
|
|
+ placeholder="请输入名称"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="dataType" label="数据类型">
|
|
|
+ <el-radio-group v-model="editData.data.dataType">
|
|
|
+ <el-radio :label="0">对象</el-radio>
|
|
|
+ <el-radio :label="1">数组</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="groupName" label="分组名称" v-if="editData.data.dataType === 1">
|
|
|
+ <el-input v-model="editData.data.groupName" @blur="editData.data.groupName = $event.target.value.trim()"
|
|
|
+ placeholder="请输入分组名称"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="sqlSentence" label="语句内容">
|
|
|
<el-input v-model="editData.data.sqlSentence" type="textarea"
|
|
|
- :autosize="{ minRows: 30, maxRows: 4 }"
|
|
|
+ :autosize="{ minRows: 30, maxRows: 40 }"
|
|
|
placeholder="请输入sql语句" @change="editData.passedTheTest = false"/>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -53,7 +66,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
- <JsonViewer :value="checkData" style="height: 100%" copyable boxed sort theme="jv-light"/>
|
|
|
+ <JsonViewer :value="checkData" style="height: 100%" copyable :expandDepth="3"/>
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
@@ -61,7 +74,7 @@
|
|
|
|
|
|
<template #footer>
|
|
|
<div>
|
|
|
- <el-button type="primary" @click="testSql">测试sql</el-button>
|
|
|
+ <el-button type="primary" plain @click="testSql">测试sql</el-button>
|
|
|
<el-button type="primary" @click="confirm">确认</el-button>
|
|
|
<el-button @click="close">取消</el-button>
|
|
|
</div>
|
|
@@ -69,8 +82,8 @@
|
|
|
</el-drawer>
|
|
|
|
|
|
|
|
|
- <el-dialog v-model="returnValue.dialog" title="该患者的数据">
|
|
|
- <JsonViewer :value="returnValue.data" style="height: 100%" copyable boxed sort theme="jv-light"/>
|
|
|
+ <el-dialog v-model="returnValue.dialog" title="该患者的数据" draggable>
|
|
|
+ <JsonViewer :value="returnValue.data" style="height: 100%" copyable :expandDepth="3"/>
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
@@ -78,7 +91,7 @@
|
|
|
<script setup name='EmrDataMaintenance'>
|
|
|
import XcTable from "@/components/xc/xc-table/XcTable.vue";
|
|
|
import {
|
|
|
- addData,
|
|
|
+ addData, deleteById,
|
|
|
fetchCountryDictionary,
|
|
|
getEmrInpatientData,
|
|
|
testSqlAPi, updateData
|
|
@@ -104,6 +117,8 @@ let editData = $ref({
|
|
|
sqlSentence: '',
|
|
|
patNo: '014807',
|
|
|
times: 3,
|
|
|
+ dataType: 0,
|
|
|
+ groupName: ''
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -116,7 +131,6 @@ let checkData = $ref('')
|
|
|
|
|
|
onMounted(() => {
|
|
|
queryData()
|
|
|
-
|
|
|
})
|
|
|
|
|
|
|
|
@@ -153,6 +167,8 @@ const openDialog = (isAdd, row) => {
|
|
|
sqlSentence: '',
|
|
|
patNo: editData.data.patNo,
|
|
|
times: editData.data.times,
|
|
|
+ dataType: 0,
|
|
|
+ groupName: ''
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -167,18 +183,34 @@ const openDialog = (isAdd, row) => {
|
|
|
sqlSentence: row.sqlSentence,
|
|
|
patNo: editData.data.patNo,
|
|
|
times: editData.data.times,
|
|
|
+ dataType: row.dataType,
|
|
|
+ groupName: row.groupName
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+const clickDelete = (row) => {
|
|
|
+ ElMessageBox.alert('您确定要删除改sql语句', '提示', {
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ deleteById(row.id).then(() => {
|
|
|
+ queryData()
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
let formRef = $ref(null)
|
|
|
+
|
|
|
const rules = ref({
|
|
|
patNo: [{required: true, message: '请输入住院号', trigger: 'blur'}],
|
|
|
times: [{required: true, message: '请输入住院次数', trigger: 'blur'}],
|
|
|
name: [{required: true, message: '请输入名称', trigger: 'blur'}],
|
|
|
sqlSentence: [{required: true, message: '请输入sql语句', trigger: 'blur'}],
|
|
|
+ groupName: [{required: true, message: '请输入分组名称', trigger: 'blur'}]
|
|
|
})
|
|
|
|
|
|
const testSql = () => {
|
|
@@ -207,8 +239,10 @@ const confirm = () => {
|
|
|
}).then(async () => {
|
|
|
if (editData.isEdit) {
|
|
|
await updateData(editData.data)
|
|
|
+ queryData()
|
|
|
} else {
|
|
|
await addData(editData.data);
|
|
|
+ queryData()
|
|
|
}
|
|
|
editData.dialog = false
|
|
|
}).catch(() => {
|
|
@@ -230,4 +264,4 @@ const close = () => {
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
-</style>
|
|
|
+</style>
|