4 Star 5 Fork 0

松果果 / neves-house

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

neves-house

依赖组件说明

  • Element UI

依赖的UI(不建议后续再引入其他UI)

  • pubsub-js

一个利用JavaScript进行发布/订阅的库语法

功能更新说明

  • 在readme中添加依赖的组件的描述

  • 更新ElementUI到最新版 2.15.6(当前时间:2021年9月)

预添加功能

  • 去除heyUI,减少项目依赖
  • 去除sailing字样,避免版权问题
  • 添加蓝黑主体支持

DataGrid

代码示例看源码

html:

<data-grid  v-bind="datagrid">
    <!--在最前面添加自定义字段-->
    <template #extend-column-before>
        <el-table-column type="index" width="60px" label="序号"></el-table-column>
    </template>
    
    <!--在列表上方添加自定义按钮-->
    <template #batch-operation>
        <el-button @click="handleOpen('',{},'add')">新增</el-button>
    </template>
    
    <!--在最后面添加自定义字段-->    
    <template #extend-column-after>
        <el-table-column label="操作" width="180">
            <template slot-scope="scope">
                <el-button size="mini" @click="handleOpen(scope.$index, scope.row,'add')">编辑
                </el-button>
                <el-button size="mini" type="danger" @click="handleOpen(scope.$index, scope.row,'detail')">详情
                </el-button>
            </template>
        </el-table-column>
    </template>
</data-grid>

js:

datagrid: {
    /*table事件 参考element-ui的table事件*/
    tableEvents: {
        'selection-change': 'handleSelectionChange'
    },
    /*table属性 参考element-ui的table属性*/
    tableAttributes: {
        showHeader: true,
        border: false,
        height: 'calc(100vh - 200px)',
        stripe: true,//是否斑马线
    },
    /*导出excel属性设置*/
    exportAttributes: {
        name: new Date().getTime(), // excel文件名称
        title: '我是标题', // 内容标题
        footer: '我是页脚', // 内容页脚
        worksheet: '导出测试页' // 自定义sheet名称
    },
    /*便捷操作按钮组*/    
    convenientButtons: {
        size:'small', //按钮尺寸:medium、small、mini 
        export: {
            label: '导出', //显示的字段
            icon: 'el-icon-download', //显示的图标
            exportType: 'batch' //导出数据模式, all: 当前表格中所有数据  batch: 勾选的数据 (只限export使用该属性)
        },
        import: {
            label: '导入',
            icon: 'el-icon-upload2'
        },
        template: {
            label: '模板下载',
            icon: 'el-icon-s-unfold'
        },
        screenColumn:{
            icon:'el-icon-s-unfold',
            label:'筛选表字段',
            class:'nh-screen' //自定义class (export/import/template 都支持自定义class)
        },
    },
    /*是否开启筛选字段*/
    /*显示的列*/
    tabColumn: [
        {prop: "date", label: "日期", width: "20",show:true},
        {prop: "name", label: "姓名", width: "20",show:true},
        {prop: "gender", label: "性别", width: "10",show:true},
        {prop: "address", label: "地址",width: "30",show:true},
        {prop: "ads", label: "ADS",width: "20",show:true},
    ],
    /*table数据*/
    tabData: [
        {
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄',
            gender: ''
        }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
        }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
        }],
    /*分页属性*/
    pageAttributes: {
        pageNum: 1,
        pageSize: 16,
        total: 50,
        pageSizes: [10, 20, 50],
        layout: "total, prev, pager, next, sizes, jumper",
        pageClass: 'page-test'
    },
    /*page的事件*/
    pageEvents: {
        'size-change': 'handleSizeChange',
        'current-change': 'handleCurrentChange'
    }
}

Events:

事件名称 说明
startDownload excel导出开始
finishDownload excel导出结束
batchImport 批量导入
downloadTemplate 模板下载

空文件

简介

UI库 展开 收起
JavaScript 等 3 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/creci/neves-house.git
git@gitee.com:creci/neves-house.git
creci
neves-house
neves-house
develop

搜索帮助

344bd9b3 5694891 D2dac590 5694891