Browse Source

表单试用

x-emr
bianyaqi 2 years ago
parent
commit
6e3c23143f
  1. 2
      public/editor.html
  2. 2
      src/page-subspecialty/views/modules/formList/laserSurgery.vue
  3. 27
      src/page-subspecialty/views/modules/template/formManage/index.vue

2
public/editor.html

@ -16,7 +16,7 @@
$(function() {
//配置项可以不设置,会使用默认设置
let option = {
license:'WQ7peJQ3Kov4+1UWJXy8anvGMs9q9Krx1RVy/0b1Cu2NsyX+AAHehvZTkM9MfZ4U05PB87yFuHfWTM7F7EL4FQplorJA7Qm6naoINcGznSdFEEdN+EiwMNdPCFulVg3mu65at1ldCyqYtg3rmPhtUOwAc5oIYmi05xlXlRJnzvw=',
license:'rjpuZZZOIbaSKwwYczGJTw9kdNPqqomH7wxLs3RABLMynprUIj4sn7jSmI9ilOJdXD3yAqVn6Jd706ojIs2HDPX6LHyY/BsZTak0DzhNO1r1Q4f0QwKUj4+iE4mWq4AU0MWFVLuoEGN1O0yYJDMjQwsgZBtmFYL6vlCHnU+ru/M=',
mode:'form', //默认模式 form:表单模式,design:设计模式
pdfUrl:'https://www.x-emr.cn/pdf/post', //pdf生成服务
dictionary: [ //知识库

2
src/page-subspecialty/views/modules/formList/laserSurgery.vue

@ -207,7 +207,7 @@
/>
</div>
</div>
<img-editor v-if="editorShow" ref="imgEditorRef" :is-od-or-os="this.confirmData.eyeType" @closeDialog="closeDialog" @fullImgBack="fullImgBack" />
<img-editor v-if="editorShow" ref="imgEditorRef" :is-od-or-os="confirmData.eyeType" @closeDialog="closeDialog" @fullImgBack="fullImgBack" />
</div>
</div>
</template>

27
src/page-subspecialty/views/modules/template/formManage/index.vue

@ -4,8 +4,9 @@
<div class="flex1" style="background: #FFFFFF;padding:0 10px">
<div style="padding: 10px 0">
<el-button type="primary" size="mini" @click="saveForm">保存</el-button>
<el-button type="primary" size="mini" @click="setForm">设置</el-button>
<el-button type="primary" size="mini" @click="setFormMode">表格模式</el-button>
<el-button type="primary" size="mini" @click="setForm">获取html</el-button>
<el-button type="primary" size="mini" @click="setFormMode('form')">表格模式</el-button>
<el-button type="primary" size="mini" @click="setFormMode('design')">设计模式</el-button>
</div>
<editor mode="design" @after-init.native="onAfterInit" />
</div>
@ -28,19 +29,33 @@ export default {
onAfterInit(e) {
this.editor = e.editor
this.editor.execCommand('new')
this.setForm()
if (this.editor) {
this.imageChange()
// this.editor.$('#patientId').change(() => {
// console.log('asdfas')
// })
}
},
imageChange() {
const data = this.editor.getBindObject().BODY
const keys = Object.keys(data)
this.editor.$('#img_editor').click(() => {
this.editor.$('#img_editor')[0].src = require('@/assets/img/od.png')
})
console.log(keys)
},
saveForm() {
const html = this.editor.getHtml()
console.log(this.editor.getBindObject())
window.sessionStorage.setItem('form', encodeURIComponent(html))
},
setForm() {
const html = decodeURIComponent(window.sessionStorage.getItem('form'))
this.editor.loadHtml(html)
this.editor.execCommand('design')
},
setFormMode() {
this.editor.execCommand('form')
},
setFormMode(mode) {
this.editor.execCommand(mode)
}
}
}

Loading…
Cancel
Save