3 changed files with 214 additions and 22 deletions
@ -0,0 +1,69 @@ |
|||||
|
<template> |
||||
|
<!-- 确认模板 --> |
||||
|
<div class=''> |
||||
|
<el-dialog title="模板确认" :visible.sync="showTemplate" width="50%" :close-on-click-modal="false"> |
||||
|
<div id="luckysheet"></div> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="handleCancel">取 消</el-button> |
||||
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import options from "@/utils/luckysheetConfig.js"; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
created() { }, |
||||
|
methods: { |
||||
|
handleCancel(){ |
||||
|
this.$emit('handelHideTemplate') |
||||
|
}, |
||||
|
handleConfirm(){ |
||||
|
this.$emit('saveLuckysheetJson',this.exportJson) |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
console.log(this.fileUrl, 'fileUrl==='); |
||||
|
this.urlToFile('http://localhost:9001/epmet-work-pc/test1.xlsx',this.fileName) |
||||
|
this.$nextTick(() => { |
||||
|
window.luckysheet.destroy(); |
||||
|
options.title = '模板确认' |
||||
|
window.luckysheet.create({ |
||||
|
...options, |
||||
|
hook: { |
||||
|
cellEditBefore: this.handleCellEditBefore, |
||||
|
}, |
||||
|
}); |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
showTemplate: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
fileUrl: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
fileName: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
components: {}, |
||||
|
computed: {}, |
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss' scoped> |
||||
|
#luckysheet { |
||||
|
height: 500px; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue