李林
2024-03-12 b67db3c5770e0ecc0b8a36b9c297aee16aa44227
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<style scoped>
    #luckysheet {
        margin: 0px;
        padding: 0px;
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0px;
        top: 0px;
    }
</style>
<style>
    #luckysheet .save{
        width: 50px;
        height: 26px;
        color: #fff;
        background-color: #3A7BFA;
        border-radius: 4px;
        border-color: transparent;
        cursor: pointer;
    }
    
    #luckysheet .save:hover{
        opacity: .8;
    }
    
    #luckysheet .save:active{
        opacity: .7;
    }
</style>
<template>
    <div id="luckysheet"></div>
</template>
 
<script>
    export default {
        data() {
            return {
                data: {}
            }
        },
        mounted() {
            this.$nextTick(() => {
                this.templateWrite()
            })
        },
        methods: {
            templateWrite() {
                $(function() {
                    //配置项
                    var options = {
                        container: 'luckysheet',
                        title: "模板编制",
                        lang: "zh",
                        showsheetbar: false,
                        showstatisticBarConfig: {
                            view: false
                        },
                        data: [{
                            name: '模板',
                            order: '0'
                        }],
                        enableAddRow: false,
                        row: 100,
                        enableAddBackTop: false,
                        showtoolbarConfig: {
                            chart: false, // '图表'
                            pivotTable: false,  //'数据透视表'
                            protection:false, // '工作表保护'
                        },
                        cellRightClickConfig: {
                            copyAs: false, // 复制为
                            hideRow: false, // 隐藏选中行和显示选中行
                            hideColumn: false, // 隐藏选中列和显示选中列
                            sort: false, // 排序选区
                            filter: false, // 筛选选区
                            chart: false, // 图表生成
                            image: false, // 插入图片
                            matrix: false, // 矩阵操作选区
                        },
                        myFolderUrl: 'http://127.0.0.1/',
                        functionButton: '<button onClick="excelClosed()" class="save">保存</button>'
                    }
                    luckysheet.create(options)
                })
            }
        }
    }
</script>