new Files
This commit is contained in:
32
front/public/code/AppendDoc.vue
Normal file
32
front/public/code/AppendDoc.vue
Normal file
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
|
||||
<el-row>
|
||||
<el-button-group>
|
||||
<el-button plain type="primary" @click="appendHtml()">添加病程</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
|
||||
<Source src="/code/AppendDoc.vue"></Source>
|
||||
<Editor doc="https://www.x-emr.cn/doc/233.html" @load="onLoad" style="margin: 10px 0;"></Editor>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import axios from 'axios'//引入axios
|
||||
|
||||
let editor
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//添加日常病程
|
||||
const appendHtml = function() {
|
||||
axios.get('https://www.x-emr.cn/doc/233.html').then((result) => {
|
||||
editor.appendHtml(result.data)
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
96
front/public/code/BindData.vue
Normal file
96
front/public/code/BindData.vue
Normal file
@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<Source src="/code/BindData.vue"></Source>
|
||||
<el-row>
|
||||
<el-col :span="16">
|
||||
<Editor @load="onLoad" style="margin: 10px 0;"></Editor>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card style="margin: 10px;">
|
||||
<el-form @change="bindData()" label-width="auto">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="patient.pat_name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-input v-model="patient.pat_sex"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄">
|
||||
<el-input v-model="patient.pat_age"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="就诊科室">
|
||||
<el-input v-model="patient.visit_dept"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="就诊号">
|
||||
<el-input v-model="patient.pat_id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="就诊时间">
|
||||
<el-date-picker v-model="patient.visit_time" type="datetime" value-format="YYYY-MM-DD hh:mm:ss"></el-date-picker>
|
||||
<el-radio-group v-model="patient.firstcall" style="margin-left: 10px;">
|
||||
<el-radio value="1">初诊</el-radio>
|
||||
<el-radio value="2">复诊</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="patient.pat_phone"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 家庭住址">
|
||||
<el-input v-model="patient.pat_address"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 主诉">
|
||||
<el-input v-model="patient.pat_appeal"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 现病史">
|
||||
<el-input v-model="patient.pat_now_history"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 既往史">
|
||||
<el-input v-model="patient.pat_past_history"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 过敏史">
|
||||
<el-input v-model="patient.pat_allergy_history"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 诊断">
|
||||
<el-input v-model="patient.diagnosis"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 处方">
|
||||
<el-input v-model="patient.presc" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 建议">
|
||||
<el-input v-model="patient.advice"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 医生签字">
|
||||
<el-input v-model="patient.doctor_name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const patient = ref({})
|
||||
|
||||
var editor
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
|
||||
editor = e.target.contentWindow.editor
|
||||
|
||||
setTimeout(()=>{
|
||||
//异步加载文档
|
||||
editor.loadUrl('/mock/bind_data.html').then(()=>{
|
||||
patient.value = editor.getBindObject()
|
||||
})
|
||||
//文档输入后表单值随着变化
|
||||
editor.document.addEventListener('input', ()=>{
|
||||
patient.value = editor.getBindObject()
|
||||
})
|
||||
}, 0)
|
||||
}
|
||||
|
||||
//表单数据改变
|
||||
const bindData = () => {
|
||||
editor.setBindObject(patient.value)
|
||||
}
|
||||
</script>
|
19
front/public/code/Calculate.vue
Normal file
19
front/public/code/Calculate.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<Source src="/code/Calculate.vue"></Source>
|
||||
<el-row>
|
||||
<Editor doc="/mock/assess_table.html" @load="onLoad" style="margin: 10px 0;" mode="design"></Editor>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
var editor
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
|
||||
</script>
|
47
front/public/code/Command.vue
Normal file
47
front/public/code/Command.vue
Normal file
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<Source src="/code/Command.vue"></Source>
|
||||
<el-row>
|
||||
<el-button-group>
|
||||
<el-button plain type="primary" @click="execCommand('form')">表单模式</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('design')">设计模式</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('readonly')">只读模式</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="margin-left: 20px;">
|
||||
<el-button plain type="primary" @click="execCommand('print')">打印</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('preview')">打印预览</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('previewPdf')">预览PDF</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('previewHtml')">预览HTML</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="margin-left: 20px;">
|
||||
<el-button plain type="primary" @click="execCommand('exportHtml')">导出模板</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('exportJson')">导出数据</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('exportPdf')">导出PDF</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('exportWord')">导出Word</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="margin-left: 20px;">
|
||||
<el-button plain type="primary" @click="execCommand('mobile')">移动填报</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<Editor doc="https://www.x-emr.cn/doc/999.html" @load="onLoad" style="margin: 10px 0;" mode="design"></Editor>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
var editor
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//文档命令I
|
||||
const execCommand = (cmd) => {
|
||||
let param = {fileName:'病案首页'}
|
||||
editor.execCommand(cmd, param)
|
||||
}
|
||||
const current = ref("1")
|
||||
|
||||
</script>
|
60
front/public/code/DataTable.vue
Normal file
60
front/public/code/DataTable.vue
Normal file
@ -0,0 +1,60 @@
|
||||
|
||||
<template>
|
||||
<Source src="/code/DataTable.vue"></Source>
|
||||
<el-row>
|
||||
<el-col :span="2" style="vertical-align: center;">服务器地址:</el-col>
|
||||
<el-col :span="8"><el-input v-model="dataUrl" ></el-input></el-col>
|
||||
<el-col :span="1"></el-col>
|
||||
<el-col :span="1"><el-button plain type="primary" @click="bindDataForTable">填充数据</el-button></el-col>
|
||||
<el-col :span="1"></el-col>
|
||||
<el-col :span="1"><el-button plain type="primary" @click="clearDataTable">清除数据</el-button></el-col>
|
||||
<el-col :span="1"></el-col>
|
||||
<el-col :span="1"><el-button plain type="primary" @click="execCommand('preview')">打印预览</el-button></el-col>
|
||||
<el-col :span="1"></el-col>
|
||||
<el-col :span="1"><el-button plain type="primary" @click="execCommand('print')">打印</el-button></el-col>
|
||||
</el-row>
|
||||
<Editor @load="onLoad" doc="/mock/data_table.html" mode="design" style="margin: 10px 0;"></Editor>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import axios from 'axios'
|
||||
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
editor:null,
|
||||
//服务端地址
|
||||
dataUrl:'https://www.x-emr.cn/doc/list.json'
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
//加载编辑器
|
||||
onLoad: function(e) {
|
||||
this.editor = e.target.contentWindow.editor
|
||||
},
|
||||
|
||||
//获取数据到表格
|
||||
bindDataForTable: function() {
|
||||
axios.get(this.dataUrl).then(res=>{
|
||||
this.editor.bindDataList('list', res.data)
|
||||
|
||||
let html = `<field tabindex="0" id="" type="DropdownList" contenteditable="false" class="blank input" title="请选择" data-list="[{"value":"0","text":"选项1"},{"value":"1","text":"选项2"}]" name="" data-code="" data-expression="" event="undefined" multi="false" validate="false" data-show-vaule="" data-show-id="">请选择</field>`
|
||||
this.editor.$('#list tr:not(:first) td:nth-child(3)').html(html)
|
||||
|
||||
})
|
||||
},
|
||||
//清除数据表格
|
||||
clearDataTable: function() {
|
||||
this.editor.bindDataList('list', [])
|
||||
},
|
||||
execCommand : function(cmd){
|
||||
this.editor.execCommand(cmd)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
27
front/public/code/DocLang.vue
Normal file
27
front/public/code/DocLang.vue
Normal file
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<Source src="/code/DocLang.vue"></Source>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="英文" name="en-us" >
|
||||
<Editor mode="design" lang="en-us" doc="/mock/en_us.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="简体中文" name="zh-cn">
|
||||
<Editor mode="design" lang="zh-cn" doc="https://www.x-emr.cn/doc/999.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="繁体中文" name="zh-tw">
|
||||
<Editor mode="design" lang="zh-tw" doc="/mock/zh-tw.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="藏文" name="zh-bo">
|
||||
<Editor mode="design" lang="zh-bo" doc="/mock/zh-bo.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="维文" name="zh-ug">
|
||||
<Editor mode="design" lang="zh-ug" doc="/mock/zh-ug.html"></Editor>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const activeName = ref('en-us')
|
||||
|
||||
</script>
|
20
front/public/code/DocMode.vue
Normal file
20
front/public/code/DocMode.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<Source src="/code/DocMode.vue"></Source>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="设计模式" name="design">
|
||||
<Editor mode="design" doc="https://www.x-emr.cn/doc/999.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="表单模式" name="form">
|
||||
<Editor mode="form" doc="https://www.x-emr.cn/doc/999.html"></Editor>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="阅读模式" name="readonly">
|
||||
<Editor mode="readonly" doc="https://www.x-emr.cn/doc/999.html"></Editor>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const activeName = ref('design')
|
||||
|
||||
</script>
|
153
front/public/code/EChart.vue
Normal file
153
front/public/code/EChart.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<h2>echarts 代码参考 https://echarts.apache.org/examples/zh/index.html</h2>
|
||||
<el-row>
|
||||
<el-button-group>
|
||||
<el-button plain type="primary" @click="addSvgEChart()">添加图表(SVG)</el-button>
|
||||
<el-button plain type="primary" @click="addCanvasEChart()">添加图表(Canvas)</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
<Source src="/code/EChart.vue"></Source>
|
||||
<Editor doc="https://www.x-emr.cn/doc/asdf1.html" @load="onLoad" style="margin: 10px 0;"></Editor>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
let editor = null
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//添加图表
|
||||
const addSvgEChart = function () {
|
||||
var _body = editor.document.getElementById('_body')
|
||||
let chartDom = editor.document.createElement('div')
|
||||
chartDom.style.width = '100%'
|
||||
chartDom.style.height = '500px'
|
||||
_body.appendChild(chartDom)
|
||||
|
||||
var myChart = echarts.init(chartDom, null, { renderer: 'svg' });
|
||||
var option = {
|
||||
title: {
|
||||
text: 'Referer of a Website',
|
||||
subtext: 'Fake Data',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Access From',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{ value: 1048, name: 'Search Engine' },
|
||||
{ value: 735, name: 'Direct' },
|
||||
{ value: 580, name: 'Email' },
|
||||
{ value: 484, name: 'Union Ads' },
|
||||
{ value: 300, name: 'Video Ads' }
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
|
||||
//添加图表
|
||||
const addCanvasEChart = function () {
|
||||
var _body = editor.document.getElementById('_body')
|
||||
let chartDom = editor.document.createElement('div')
|
||||
chartDom.style.width = '100%'
|
||||
chartDom.style.height = '500px'
|
||||
_body.appendChild(chartDom)
|
||||
|
||||
var myChart = echarts.init(chartDom, null, { renderer: 'canvas' });
|
||||
var option = {
|
||||
title: {
|
||||
text: 'Rainfall vs Evaporation',
|
||||
subtext: 'Fake Data'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['Rainfall', 'Evaporation']
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
dataView: { show: true, readOnly: false },
|
||||
magicType: { show: true, type: ['line', 'bar'] },
|
||||
restore: { show: true },
|
||||
saveAsImage: { show: true }
|
||||
}
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
// prettier-ignore
|
||||
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: 'Rainfall',
|
||||
type: 'bar',
|
||||
data: [
|
||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
|
||||
],
|
||||
markPoint: {
|
||||
data: [
|
||||
{ type: 'max', name: 'Max' },
|
||||
{ type: 'min', name: 'Min' }
|
||||
]
|
||||
},
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Evaporation',
|
||||
type: 'bar',
|
||||
data: [
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
||||
],
|
||||
markPoint: {
|
||||
data: [
|
||||
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
|
||||
{ name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
|
||||
]
|
||||
},
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
|
||||
</script>
|
18
front/public/code/Editor.vue
Normal file
18
front/public/code/Editor.vue
Normal file
@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<!-- 根据实际部署环境修改 editor.html 的路径 -->
|
||||
<iframe src="./editor.html" v-bind="objectOfAttrs"></iframe>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
objectOfAttrs:{
|
||||
width:'100%',
|
||||
height:'800vh',
|
||||
frameborder: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
15
front/public/code/Home.vue
Normal file
15
front/public/code/Home.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<h3>
|
||||
Vue 集成X-EMR 编辑器步骤
|
||||
</h3>
|
||||
<h4>1.新建组件 Editor.vue</h4>
|
||||
<Source src="/code/Editor.vue" open="true"></Source>
|
||||
<h4>2.模块中使用@load获取组件的editor实例</h4>
|
||||
<Source src="/code/Simple.vue" open="true"></Source>
|
||||
<h4>3.自定义修改配置 editor.html</h4>
|
||||
<Source src="/editor.html" open="true"></Source>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
76
front/public/code/SaveDoc.vue
Normal file
76
front/public/code/SaveDoc.vue
Normal file
@ -0,0 +1,76 @@
|
||||
|
||||
<template>
|
||||
<el-row>
|
||||
<el-col :span="2" style="vertical-align: center;">服务器地址:</el-col>
|
||||
<el-col :span="10"><el-input v-model="serverUrl" ></el-input></el-col>
|
||||
<el-col :span="1"></el-col>
|
||||
<el-col :span="2"><el-button plain type="primary" @click="saveHtml">保存文档</el-button></el-col>
|
||||
<el-col :span="2"> <el-button plain type="primary" @click="saveHtmlAndData">保存数据&文档</el-button></el-col>
|
||||
</el-row>
|
||||
<Source src="/code/SaveDoc.vue"></Source>
|
||||
<Editor @load="onLoad" doc="https://www.x-emr.cn/doc/999.html" style="margin: 10px 0;"></Editor>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
editor:null,
|
||||
//服务端地址
|
||||
serverUrl:'http://localhost/post'
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
//初始化
|
||||
onLoad: function(e) {
|
||||
this.editor = e.target.contentWindow.editor
|
||||
},
|
||||
//仅保存HTML文档
|
||||
saveHtml: function() {
|
||||
|
||||
// 若文档未修改,则无需保存
|
||||
if(this.editor.edited == false){
|
||||
this.$message.error('文档未修改,无需保存');
|
||||
return;
|
||||
}
|
||||
|
||||
// 若文档校验不通过,则无法保存
|
||||
if(this.editor.validate() == false){
|
||||
this.$message.error('请查看文档是否有未填项或不合规内容');
|
||||
return;
|
||||
}
|
||||
|
||||
let data = {'doc': this.editor.getHtml()}
|
||||
axios.post(this.serverUrl, data).then(res=>{
|
||||
this.$message.success('保存成功')
|
||||
})
|
||||
},
|
||||
//保存文档及机构化数据
|
||||
saveHtmlAndData: function() {
|
||||
// 若文档未修改,则无需保存
|
||||
if(this.editor.edited == false){
|
||||
this.$message.error('文档未修改,无需保存');
|
||||
return;
|
||||
}
|
||||
|
||||
// 若文档校验不通过,则无法保存
|
||||
if(this.editor.validate() == false){
|
||||
this.$message.error('请查看文档是否有未填项或不合规内容');
|
||||
return;
|
||||
}
|
||||
|
||||
let data = {
|
||||
'doc': this.editor.getHtml(),
|
||||
'data': this.editor.getBindObject()
|
||||
}
|
||||
axios.post(this.serverUrl, data).then(res=>{
|
||||
this.$message.success('保存成功')
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
44
front/public/code/Signature.vue
Normal file
44
front/public/code/Signature.vue
Normal file
File diff suppressed because one or more lines are too long
20
front/public/code/Simple.vue
Normal file
20
front/public/code/Simple.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<el-button plain type="primary" @click="execCommand('print')">打印</el-button>
|
||||
<Editor doc="https://www.x-emr.cn/doc/999.html" @load="onLoad" style="margin: 10px 0;" mode="design"></Editor>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
var editor = null
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//处理文档命令
|
||||
const execCommand = (cmd) => {
|
||||
editor.execCommand(cmd)
|
||||
}
|
||||
|
||||
</script>
|
134
front/public/code/VitalSigns.vue
Normal file
134
front/public/code/VitalSigns.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<Source src="/code/VitalSigns.vue"></Source>
|
||||
<el-row>
|
||||
<el-form-item label="体温单ID">
|
||||
<el-col :span="24"><el-input v-model="vitalSignsId" ></el-input></el-col>
|
||||
</el-form-item>
|
||||
<el-button-group style="margin-left: 20px;">
|
||||
<el-button plain type="primary" @click="createVitalSigns()">创建体温单</el-button>
|
||||
<el-button plain type="primary" @click="updateVitalSigns()">更新体温单</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="margin: 0 20px;">
|
||||
<el-button plain type="primary" @click="createBabyVitalSigns()">新生儿体温单</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="margin-left: 20px;">
|
||||
<el-button plain type="primary" @click="execCommand('preview')">打印预览</el-button>
|
||||
<el-button plain type="primary" @click="execCommand('print')">打印</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
<Editor @load="onLoad" style="margin: 10px 0;"></Editor>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const vitalSignsId = ref('')
|
||||
|
||||
let editor = null
|
||||
//初始化后
|
||||
const onLoad = function(e) {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//文档命令
|
||||
const execCommand = (cmd) => {
|
||||
editor.execCommand(cmd)
|
||||
}
|
||||
//添加体温单
|
||||
const createVitalSigns = () => {
|
||||
let data = {
|
||||
"id": vitalSignsId.value,
|
||||
"name": "吴晓莉",
|
||||
"inDate": "2023-08-01",
|
||||
"diag": "新型冠状病毒肺炎",
|
||||
"dept": "呼吸内科",
|
||||
"bed": "801",
|
||||
"medicalNo": "202300991",
|
||||
"begin": "2023-08-01",
|
||||
"operateDate": "2023-08-03",
|
||||
"notes": "入院-十时二十分,,转入ICU,,,,,,,手术,,,,,,,,,,,,,,,出院,死亡于×时×分",
|
||||
"sphygmus": "112,110,109,103,108,85,90,83,90,103,108,85,90,83,90,,90,83,90,103,108,85,90,83,90",
|
||||
"heart": "112,120,118,111,,,,,,,112,120,118,111",
|
||||
"tempType": "0,1,2,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1",
|
||||
"temperature": "38.7,38.9,38.5,39.1|37.1,38.5,38.5,,,38.5,38.5|36.9,38.4,38.8,,38.5,38.6,38.8,,38.9,38.8,38.5,38.6,38.8,,38.9,38.8,34,34.0",
|
||||
"breath": "30,30,R,,35,35,35,35,35,35,35,35,,R,R,35,35,,R,,,35,35,,R",
|
||||
"labels": "血压(mmHg)|入水量(ml)|出水量(ml)|大便(次)|小便(次)|身高(cm)|体重(kg)|过敏药",
|
||||
"data1": "120/85,121/84,,110/75,",
|
||||
"data2": "1180ml,,,500ml,,40ml",
|
||||
"data3": "500ml,,,,500ml,,67ml",
|
||||
"data4": "2,4,5,3,3,3,2,,2",
|
||||
"data5": "2,4,5,3,3,3,2,,2",
|
||||
"data6": "167cm,,,,,,,,,164cm",
|
||||
"data7": "95kg,,,,,90kg",
|
||||
"data8": "青霉素,",
|
||||
"data9": "测试,"
|
||||
}
|
||||
vitalSignsId.value = editor.createVitalSigns(data)
|
||||
}
|
||||
|
||||
//更新体温单
|
||||
const updateVitalSigns = () => {
|
||||
let data = {
|
||||
"id": vitalSignsId.value,
|
||||
"name": "吴晓莉",
|
||||
"inDate": "2023-08-01",
|
||||
"diag": "新型冠状病毒肺炎",
|
||||
"dept": "呼吸内科",
|
||||
"bed": "801",
|
||||
"medicalNo": "202300991",
|
||||
"begin": "2023-09-01",
|
||||
"operateDate": "2023-08-03",
|
||||
"notes": ",,,,,,,,,,,,,,出院,死亡于×时×分",
|
||||
"sphygmus": "112,110,109,103,108,85,90,83,90,103,108,85,90,83,90,90,90,83,90,103,108,85,90,83,90",
|
||||
"heart": ",,,,,,112,120,118,111,,,110,120,120,118,111,100",
|
||||
"tempType": ",,,,,,0,1,2,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1",
|
||||
"temperature": ",,,,,,38.7,38.9,38.5,39.1,38.5,38.5,,,38.5,38.5,38.4,38.8,,38.5,38.6,38.8,,38.9,38.838.5,38.6,38.8,,38.9,38.8,34,34.0",
|
||||
"breath": ",,,,,,30,30,R,,35,35,35,35,35,35,35,35,,R,R,35,35,,R,,,35,35,,R",
|
||||
"labels": "血压(mmHg)|入水量(ml)|出水量(ml)|大便(次)|小便(次)|身高(cm)|体重(kg)|过敏药",
|
||||
"data1": ",,,,,,120/85,121/84,,110/75,",
|
||||
"data2": ",,,,,,1180ml,,,500ml,,40ml",
|
||||
"data3": "500ml,,,,500ml,,67ml",
|
||||
"data4": "2,4,5,3,3,3,2,,2",
|
||||
"data5": "2,4,5,3,3,3,2,,2",
|
||||
"data6": "167cm,,,,,,,,,164cm",
|
||||
"data7": "95kg,,,,,90kg",
|
||||
"data8": "青霉素,",
|
||||
"data9": "测试,",
|
||||
"pain":"2,2,4,5,8,8,9|2,6|3,,,4,4,4"
|
||||
|
||||
}
|
||||
vitalSignsId.value = editor.createVitalSigns(data)
|
||||
}
|
||||
|
||||
//添加新生儿体温单
|
||||
const createBabyVitalSigns = () => {
|
||||
let data =
|
||||
{
|
||||
"id": vitalSignsId.value,
|
||||
"type": "baby",
|
||||
"name": "吴晓莉",
|
||||
"inDate": "2023-08-01",
|
||||
"sex": "男",
|
||||
"dept": "妇产科",
|
||||
"bed": "801",
|
||||
"medicalNo": "202300991",
|
||||
"begin": "2023-08-01",
|
||||
"notes": "出生-十时二十分",
|
||||
"weight": "3200,,,,3300,,,,3400,,,,3400,,,,3500,,,,3400,,,,",
|
||||
"heart": "112,120,118,111,,,,,,,112,120,118,111",
|
||||
"tempType": "2,2,2,3,2,1,2,2,2,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1",
|
||||
"temperature": "37.7,37.9,38.5,37.1,37.5,38.5,,,37.5,38.5,37.4,37.8,,37.5,37.6,37.8,,37.9,37.8,37.5,38.6,37.8,,37.9,37.8",
|
||||
"physicalcool": ",,,37.6,,,,,,,,37.5,,,,,,,,,37.4,,",
|
||||
"breath": "30,30,R,,35,35,35,35,35,35,35,35,,R,R,35,35,,R,,,35,35,,R",
|
||||
"labels": "血压(mmHg)|入水量(ml)|出水量(ml)|大便(次)|小便(次)",
|
||||
"data1": "120/85,121/84,,110/75,",
|
||||
"data2": "1180ml,,,500ml,,40ml",
|
||||
"data3": "500ml,,,,500ml,,67ml",
|
||||
"data4": "2,4,5,3,3,3,2,,2",
|
||||
"data5": "2,4,5,3,3,3,2,,2",
|
||||
}
|
||||
//第二个参数isBaby:true
|
||||
editor.createVitalSigns(data)
|
||||
}
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user