|
@@ -85,108 +85,146 @@
|
|
|
<el-main v-loading="loaded">
|
|
|
<el-row>
|
|
|
<el-col :span="20">
|
|
|
- <div class="tool_emr">
|
|
|
- <el-select style="width: 150px;"
|
|
|
- @change="textStyleFunc.fontFamily()"
|
|
|
- v-model="emrStyle.fontFamily">
|
|
|
- <el-option v-for="item in availableFonts"
|
|
|
- :value="item.font"
|
|
|
- :label="item.text">
|
|
|
+ <div style="height: 30px" @mousewheel="mousewheel($event)">
|
|
|
+ <el-scrollbar ref="tootScrollRef" @scroll="scroll">
|
|
|
+ <div class="tool_emr">
|
|
|
+ <el-select style="width: 150px;"
|
|
|
+ @change="textStyleFunc.fontFamily()"
|
|
|
+ v-model="emrStyle.fontFamily">
|
|
|
+ <el-option v-for="item in availableFonts"
|
|
|
+ :value="item.font"
|
|
|
+ :label="item.text">
|
|
|
<span :style="{'fontFamily':item.font }">
|
|
|
{{ item.text }}
|
|
|
</span>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-select style="width: 70px;"
|
|
|
- @change="textStyleFunc.fontSize()"
|
|
|
- v-model="emrStyle.fontSize">
|
|
|
- <el-option v-for="item in fontSizes"
|
|
|
- :value="item.code"
|
|
|
- :label="item.name"/>
|
|
|
- </el-select>
|
|
|
- <el-divider direction="vertical"/>
|
|
|
- <el-button-group>
|
|
|
- <el-button @click="styleFunc('fontSizeAdjust','increase')"
|
|
|
- title="放大字体">
|
|
|
- +
|
|
|
- </el-button>
|
|
|
- <el-button @click="styleFunc('fontSizeAdjust','decrease')"
|
|
|
- title="缩小字体">
|
|
|
- -
|
|
|
- </el-button>
|
|
|
- </el-button-group>
|
|
|
- <el-divider direction="vertical"/>
|
|
|
- <el-button-group>
|
|
|
- <el-button
|
|
|
- title="字体加粗"
|
|
|
- :class="buttonClass('fontWeight','bold')"
|
|
|
- @click="textStyleFunc.fontWeight()">
|
|
|
- <i class="iconfont icon-jiacu"></i>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- title="斜体"
|
|
|
- :class="buttonClass('fontStyle','oblique')"
|
|
|
- @click="textStyleFunc.fontStyle()">
|
|
|
- <i class="iconfont icon-xieti"></i>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- title="下划线"
|
|
|
- :class="buttonClass('underline')"
|
|
|
- @click="textStyleFunc.underline()">
|
|
|
- <i class="iconfont icon-xiahuaxian"></i>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- title="删除线"
|
|
|
- :class="buttonClass('lineThrough')"
|
|
|
- @click="textStyleFunc.lineThrough()">
|
|
|
- <i class="iconfont icon-shanchuxian"></i>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- title="上标"
|
|
|
- :class="buttonClass('super')"
|
|
|
- @click="textStyleFunc.super()">
|
|
|
- <i class="iconfont icon-zitishangbiao"></i>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- title="下标"
|
|
|
- :class="buttonClass('sub')"
|
|
|
- @click="textStyleFunc.sub()">
|
|
|
- <i class="iconfont icon-zitixiabiao"></i>
|
|
|
- </el-button>
|
|
|
- </el-button-group>
|
|
|
- <div class="color_picker"
|
|
|
- title="字体颜色">
|
|
|
- <i class="iconfont icon-zitiyanse"></i>
|
|
|
- <el-color-picker v-model="emrStyle.color"
|
|
|
- @change="textStyleFunc.color()"
|
|
|
- :predefine="predefineColors"/>
|
|
|
- </div>
|
|
|
- <div class="color_picker"
|
|
|
- title="背景颜色">
|
|
|
- <i class="iconfont icon-beijingyanse"></i>
|
|
|
- <el-color-picker v-model="emrStyle.backgroundColor"
|
|
|
- @change="textStyleFunc.backgroundColor()"
|
|
|
- :predefine="predefineColors"/>
|
|
|
- </div>
|
|
|
- <el-divider direction="vertical"/>
|
|
|
- <el-button-group>
|
|
|
- <el-button title="左对齐"
|
|
|
- @click="textStyleFunc.alignment('left')">
|
|
|
- <i class="iconfont icon-zuoduiqi"></i>
|
|
|
- </el-button>
|
|
|
- <el-button title="居中对其"
|
|
|
- @click="textStyleFunc.alignment('center')">
|
|
|
- <i class="iconfont icon-juzhongduiqi"></i>
|
|
|
- </el-button>
|
|
|
- <el-button title="右对齐"
|
|
|
- @click="textStyleFunc.alignment('right')">
|
|
|
- <i class="iconfont icon-youduiqi"></i>
|
|
|
- </el-button>
|
|
|
- <el-button title="两端对齐"
|
|
|
- @click="textStyleFunc.alignment('justify')">
|
|
|
- <i class="iconfont icon-zuoyouduiqi"></i>
|
|
|
- </el-button>
|
|
|
- </el-button-group>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select style="width: 70px;"
|
|
|
+ @change="textStyleFunc.fontSize()"
|
|
|
+ v-model="emrStyle.fontSize">
|
|
|
+ <el-option v-for="item in fontSizes"
|
|
|
+ :value="item.code"
|
|
|
+ :label="item.name"/>
|
|
|
+ </el-select>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button @click="styleFunc('fontSizeAdjust','increase')"
|
|
|
+ title="放大字体">
|
|
|
+ +
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="styleFunc('fontSizeAdjust','decrease')"
|
|
|
+ title="缩小字体">
|
|
|
+ -
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button
|
|
|
+ title="字体加粗"
|
|
|
+ :class="buttonClass('fontWeight','bold')"
|
|
|
+ @click="textStyleFunc.fontWeight()">
|
|
|
+ <i class="iconfont icon-jiacu"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ title="斜体"
|
|
|
+ :class="buttonClass('fontStyle','oblique')"
|
|
|
+ @click="textStyleFunc.fontStyle()">
|
|
|
+ <i class="iconfont icon-xieti"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ title="下划线"
|
|
|
+ :class="buttonClass('underline')"
|
|
|
+ @click="textStyleFunc.underline()">
|
|
|
+ <i class="iconfont icon-xiahuaxian"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ title="删除线"
|
|
|
+ :class="buttonClass('lineThrough')"
|
|
|
+ @click="textStyleFunc.lineThrough()">
|
|
|
+ <i class="iconfont icon-shanchuxian"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ title="上标"
|
|
|
+ :class="buttonClass('super')"
|
|
|
+ @click="textStyleFunc.super()">
|
|
|
+ <i class="iconfont icon-zitishangbiao"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ title="下标"
|
|
|
+ :class="buttonClass('sub')"
|
|
|
+ @click="textStyleFunc.sub()">
|
|
|
+ <i class="iconfont icon-zitixiabiao"></i>
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ <div class="color_picker"
|
|
|
+ title="字体颜色">
|
|
|
+ <i class="iconfont icon-zitiyanse"></i>
|
|
|
+ <el-color-picker v-model="emrStyle.color"
|
|
|
+ @change="textStyleFunc.color()"
|
|
|
+ :predefine="predefineColors"/>
|
|
|
+ </div>
|
|
|
+ <div class="color_picker"
|
|
|
+ title="背景颜色">
|
|
|
+ <i class="iconfont icon-beijingyanse"></i>
|
|
|
+ <el-color-picker v-model="emrStyle.backgroundColor"
|
|
|
+ @change="textStyleFunc.backgroundColor()"
|
|
|
+ :predefine="predefineColors"/>
|
|
|
+ </div>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button-group>
|
|
|
+ <el-popover
|
|
|
+ :width="0"
|
|
|
+ trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <el-button title="无序列表">
|
|
|
+ <i class="iconfont icon-wuxuliebiao"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <emr-unordered-list list-type="disorder" @click-list="textStyleFunc.unorderedList"/>
|
|
|
+ </el-popover>
|
|
|
+ <el-popover
|
|
|
+ :width="0"
|
|
|
+ trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <el-button title="有序列表">
|
|
|
+ <i class="iconfont icon-youxuliebiao"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <emr-unordered-list list-type="orderly" @click-list="textStyleFunc.orderedList"/>
|
|
|
+ </el-popover>
|
|
|
+ </el-button-group>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button title="左对齐"
|
|
|
+ @click="textStyleFunc.alignment('left')">
|
|
|
+ <i class="iconfont icon-zuoduiqi"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button title="居中对其"
|
|
|
+ @click="textStyleFunc.alignment('center')">
|
|
|
+ <i class="iconfont icon-juzhongduiqi"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button title="右对齐"
|
|
|
+ @click="textStyleFunc.alignment('right')">
|
|
|
+ <i class="iconfont icon-youduiqi"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button title="两端对齐"
|
|
|
+ @click="textStyleFunc.alignment('justify')">
|
|
|
+ <i class="iconfont icon-zuoyouduiqi"></i>
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button title="增加缩进"
|
|
|
+ @click="textStyleFunc.indent(1)">
|
|
|
+ <i class="iconfont icon-yousuojin"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button title="减小缩进"
|
|
|
+ @click="textStyleFunc.indent(-1)">
|
|
|
+ <i class="iconfont icon-zuosuojin"></i>
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
</div>
|
|
|
<div class="emr-iframe">
|
|
|
<iframe ref="emrRef"
|
|
@@ -235,6 +273,7 @@ import EmrAssistant from "@/components/zhu-yuan-yi-sheng/emr/EmrAssistant.vue";
|
|
|
import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
|
|
|
import {getWardsApi} from "@/api/login";
|
|
|
import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
+import EmrUnorderedList from "@/components/zhu-yuan-yi-sheng/emr/EmrUnorderedList.vue";
|
|
|
|
|
|
const props = defineProps({
|
|
|
huanZheXinXi: {
|
|
@@ -310,7 +349,7 @@ let emrStyle = $ref({
|
|
|
// 颜色
|
|
|
color: '',
|
|
|
backgroundColor: '',
|
|
|
- paragraphSetting: {}
|
|
|
+ paragraphStyle: {}
|
|
|
})
|
|
|
const predefineColors = ref([
|
|
|
'#ff4500',
|
|
@@ -623,7 +662,8 @@ const emrEvent = {
|
|
|
emrStyle.sub = context.subScript
|
|
|
emrStyle.color = context.color
|
|
|
emrStyle.backgroundColor = context.backgroundColor
|
|
|
- emrStyle.paragraphSetting = context.paragraphSetting
|
|
|
+ emrStyle.paragraphStyle = context.paragraphStyle
|
|
|
+
|
|
|
console.log(evt, contextMap, component, context)
|
|
|
},
|
|
|
|
|
@@ -845,9 +885,11 @@ let doctorLevel = 1;
|
|
|
const doctorLevelFunc = () => {
|
|
|
if (extractFields('管床医生编码') === userData.code) {
|
|
|
doctorLevel = 1
|
|
|
- } else if (extractFields('主治医生编码') === userData.code) {
|
|
|
+ }
|
|
|
+ if (extractFields('主治医生编码') === userData.code) {
|
|
|
doctorLevel = 2
|
|
|
- } else if (extractFields('主任医生编码') === userData.code) {
|
|
|
+ }
|
|
|
+ if (extractFields('主任医生编码') === userData.code) {
|
|
|
doctorLevel = 3
|
|
|
}
|
|
|
}
|
|
@@ -929,17 +971,6 @@ const paginationSymbol = () => {
|
|
|
editor.execute('insertContents', {value: [{type: 'pagebreak'}]})
|
|
|
}
|
|
|
|
|
|
-// 通用的方法
|
|
|
-const styleFunc = (name, value) => {
|
|
|
- emrStyle[name] = value
|
|
|
- editor.execute(name, {value: value})
|
|
|
-}
|
|
|
-
|
|
|
-const styleFuncNormal = (name, style) => {
|
|
|
- let value = emrStyle[name]
|
|
|
- styleFunc(name, value === 'normal' ? style : 'normal')
|
|
|
-}
|
|
|
-
|
|
|
const textStyleFunc = ref({
|
|
|
fontFamily: () => {
|
|
|
editor.execute('fontFamily', {value: emrStyle.fontFamily})
|
|
@@ -988,37 +1019,43 @@ const textStyleFunc = ref({
|
|
|
editor.execute('backgroundColor', {value: emrStyle.backgroundColor})
|
|
|
},
|
|
|
alignment: (val) => {
|
|
|
- return
|
|
|
- emrStyle.paragraphSetting.textAlign = {value: val}
|
|
|
- console.log(emrStyle.paragraphSetting)
|
|
|
-
|
|
|
-
|
|
|
- editor.execute('paragraphSetting', {
|
|
|
- value: {
|
|
|
- "lineHeight": {
|
|
|
- "type": "单倍行距",
|
|
|
- "value": 1
|
|
|
- },
|
|
|
- "paragraphSpacing": {
|
|
|
- "before": 0,
|
|
|
- "after": 0
|
|
|
- },
|
|
|
- "paragraphIndent": {
|
|
|
- "left": 0,
|
|
|
- "right": 0
|
|
|
- },
|
|
|
- "specialIndent": {
|
|
|
- "type": "无",
|
|
|
- "value": 0
|
|
|
- },
|
|
|
- "textAlign": {
|
|
|
- "value": "center"
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ editor.execute('textAlign', {value: val})
|
|
|
+ },
|
|
|
+ unorderedList: (val) => {
|
|
|
+ if (val === null) {
|
|
|
+ editor.execute("nonList", {
|
|
|
+ value: "none"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ editor.execute('symbolList', {"value": val})
|
|
|
+ },
|
|
|
+ orderedList: (val) => {
|
|
|
+ if (val === null) {
|
|
|
+ editor.execute("nonList", {
|
|
|
+ value: "none"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //设置有序列表
|
|
|
+ editor.execute('orderList', {"value": val})
|
|
|
+ },
|
|
|
+ indent: (val) => {
|
|
|
+ emrStyle.paragraphStyle.specialIndent.value += val
|
|
|
+ editor.execute('paragraphStyle', {value: emrStyle.paragraphStyle})
|
|
|
+ console.log({value: emrStyle.paragraphStyle})
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const scroll = ({scrollLeft: left, scrollTop}) => {
|
|
|
+ scrollLeft = left
|
|
|
+}
|
|
|
+
|
|
|
+const tootScrollRef = ref(null)
|
|
|
+let scrollLeft = 0
|
|
|
+const mousewheel = (e) => {
|
|
|
+ let eventDelta = -e.wheelDelta || -e.deltaY * 40;
|
|
|
+ tootScrollRef.value?.setScrollLeft(scrollLeft + eventDelta);
|
|
|
+}
|
|
|
+
|
|
|
const buttonClass = (val, activation = true) => {
|
|
|
if (emrStyle[val] === activation) {
|
|
|
return 'emr__button_select'
|
|
@@ -1084,7 +1121,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|
|
}
|
|
|
|
|
|
.tool_emr {
|
|
|
- width: 100%;
|
|
|
+ width: 1326px;
|
|
|
height: 30px;
|
|
|
background-color: #f0f0f0;
|
|
|
display: flex;
|