Commit a5bb4881 by SunJie

elcs.101

parent 90d2140f
<template> <template>
<div> <div>
<div style="height:800px;overflow:auto"> <div style="height: 800px; overflow: auto">
<embed
<embed v-if="this.model.docXML!=''" :src="pdf" type="application/pdf" height="100%" width="100%"/> v-if="this.model.docXML"
<el-col><pre >{{this.model.docTXT}}</pre></el-col> :src="pdf"
type="application/pdf"
height="100%"
width="100%"
/>
<el-row v-if="!this.model.docXML">
<el-col v-for="(item, index) in model.docTXT" :key="index" >
<el-col :offset="4" :span="8">
{{ item[0] }}
</el-col>
<el-col :span="12">
{{ item[1] }}
</el-col> <el-divider></el-divider>
</el-col>
</el-row>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import Api from "~/service/Api" import Api from "~/service/Api";
export default { export default {
data(){ data() {
return { return {
model: {docXML:""}, model: { docXML: "" },
pdf:"data:application/pdf;base64,", pdf: "data:application/pdf;base64,",
} };
}, },
created() { created() {
this.model.docXML = window.sessionStorage.docXML this.model.docXML = window.sessionStorage.docXML;
this.model.docTXT = window.sessionStorage.docTXT this.model.docTXT = window.sessionStorage.docTXT
if(this.model.docXML!="") .split("\r\n")
Api.post("pdf",{"xml":this.model.docXML}).then(res=>{ .filter((item) => item)
if (res.respCode == "AAAAAA") { .map((item) => {
this.pdf += res.data let idx = item.indexOf(":");
} return [
}) item.substring(0, idx).trim(),
} item.substring(idx + 1).trim(),
];
} });
if (this.model.docXML != "")
Api.post("pdf", { xml: this.model.docXML }).then((res) => {
if (res.respCode == "AAAAAA") {
this.pdf += res.data;
}
});
},
};
</script> </script>
<style scoped> <style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment