|
|
@@ -4,6 +4,7 @@
|
|
|
<span>{{temItem.templateName}}</span>
|
|
|
<div class="button">
|
|
|
<!--<el-button type="success" size="mini" @click="handleHisMsg()">回传HIS(JS通知)</el-button>-->
|
|
|
+ <el-button type="primary" size="mini" @click="showAiDialog = true">自然语言处理</el-button>
|
|
|
<el-button type="primary" size="mini" @click="handleHis()">回传HIS</el-button>
|
|
|
<el-button type="primary" size="mini" @click="submit()">保存病历</el-button>
|
|
|
</div>
|
|
|
@@ -44,10 +45,25 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog class="ai-dialog-wrapper" title="自然语言处理" :visible.sync="showAiDialog" center destroy-on-close :close-on-click-modal="false" :before-close="closeAiDialog">
|
|
|
+ <div style="height: 100%; overflow: auto;">
|
|
|
+ <el-input
|
|
|
+ type="textarea" :readonly="aiLoading"
|
|
|
+ :autosize="{ minRows: 4, maxRows: 8}"
|
|
|
+ placeholder="请描述患者的病情"
|
|
|
+ v-model="aiText">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button :disabled="aiLoading" @click="closeAiDialog()">取 消</el-button>
|
|
|
+ <el-button type="primary" :loading="aiLoading" @click="loadAi()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { addEMR, getEmrShowMsg, editEMR, backToHis } from "@/api/diagnosis.js";
|
|
|
+import { addEMR, getEmrShowMsg, editEMR, backToHis, getNLP_TemplateResult } from "@/api/diagnosis.js";
|
|
|
|
|
|
import { getTemplateList, getLastTemId, saveLastTemId } from "@/api/emr";
|
|
|
import { mapGetters, mapMutations } from "vuex";
|
|
|
@@ -63,6 +79,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ showAiDialog: false,
|
|
|
+ aiLoading: false,
|
|
|
+ aiText: '',
|
|
|
isSkip: true,
|
|
|
isEdit: false, // 是否修改
|
|
|
activeId: "",
|
|
|
@@ -143,6 +162,28 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ closeAiDialog(done) {
|
|
|
+ if (this.aiLoading) return;
|
|
|
+ if (done) done();
|
|
|
+ this.showAiDialog = false;
|
|
|
+ this.aiText = '';
|
|
|
+ },
|
|
|
+ async loadAi() {
|
|
|
+ if (this.aiText && this.aiText.trim()) {
|
|
|
+ this.aiLoading = true;
|
|
|
+ try {
|
|
|
+ const result = await getNLP_TemplateResult(this.aiText.trim());
|
|
|
+ if (result) this.showMsgToTem(result);
|
|
|
+ else throw { message: `` }
|
|
|
+ } catch (e) {
|
|
|
+ if (e.message) this.$message.error(e.message);
|
|
|
+ this.aiLoading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.aiLoading = false;
|
|
|
+ this.closeAiDialog();
|
|
|
+ },
|
|
|
// 关闭预览弹窗
|
|
|
handleClose() {
|
|
|
this.dialogVisible = false;
|
|
|
@@ -1184,4 +1225,21 @@ export default {
|
|
|
height: 76vh;
|
|
|
}
|
|
|
}
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.ai-dialog-wrapper {
|
|
|
+ ::v-deep {
|
|
|
+ .el-dialog, .el-dialog__body {
|
|
|
+ height: auto;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .el-dialog__body {
|
|
|
+ max-height: 50vh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-textarea, ::v-deep textarea {
|
|
|
+ max-height: 45vh;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
</style>
|