Commit 31275b8f by luyt

add: table more button组件

1 parent 8c024d46
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -24,10 +24,13 @@
<img class="img-60" :src="scope.scope.shareImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button v-if="scope.scope.liveStatus == '102'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<!-- test 更多操作 -->
<GLTableButton :buttonList="buttonList" :buttonItem="scope"></GLTableButton>
</span>
</GLTable>
<hr />
......@@ -106,15 +109,10 @@
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch> -->
<GLCombiForm
ref="showSearch"
:formObj="searchForm"
:searchSelectObj="searchSelectObj"
:formData="searchFormData"
@handleOk="handleOkFn"
@handleRest="handleRestFn"></GLCombiForm>
<GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleOkFn" @handleRest="handleRestFn"></GLCombiForm>
<hr />
<!-- 测试 GLFooter -->
<GLFooter></GLFooter>
</div>
......@@ -189,13 +187,13 @@ export default {
{
label: '直播状态3',
prop: 'liveStatus3',
line: 1,
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态4',
prop: 'liveStatus4',
line: 1,
line: 1
// addHtml: 'shareImgUrl'
}
]
......@@ -209,7 +207,7 @@ export default {
{
label: '直播状态3',
prop: 'liveStatus3',
line: 1,
line: 1
// addHtml: 'shareImgUrl'
}
]
......@@ -486,7 +484,90 @@ export default {
isHide: true
}
],
// 测试表格更多操作项
buttonList: [
{
type: 'el-button',
name: row => {
return '打开'
},
condition: row => {
return false
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
name: row => {
return '新增1'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
name: row => {
return '新增2'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
// 类型
type: 'el-button',
// 名字 //自定义内容 可以是html结构
name: row => {
return '新增3'
},
// 条件判断
condition: row => {
return true
},
// 属性
attrs: {
type: 'text'
},
//click事件
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
//自定义内容
name: row => {
return '<div>自定义<i class="el-icon-edit"></i></div>'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
}
]
}
},
methods: {
......@@ -506,6 +587,10 @@ export default {
},
handleRestFn() {
console.log('您点击了取消')
},
//test table 更多 单行数据 ,单行的配置项
conditionFn(row,config) {
console.log('row: ', row)
}
}
}
......
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-21 10:36:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 18:37:14
* @FilePath: \npm\glsx-components\src\index.js
*/
// import _Vue from 'vue'
// const GLComponents = {}
// const componentsFiles = require.context(`./components`, true, /.vue|js$/)
// GLComponents.install = Vue => {
// if (!Vue) {
// window.Vue = Vue = _Vue
// }
// componentsFiles.keys().forEach(path => {
// const component = componentsFiles(path).default
// Vue.component(component.name, component)
// })
// }
// export default GLComponents
/**
* 仅用于本地测试 npm run serve
*/
......
......@@ -13,7 +13,8 @@
GLFooter,
GLSearch,
GLSearchItem,
GLCombiForm
GLCombiForm,
GLTableButton
} from '../../dist/glsx-components.umd.min.js'
import '../../dist/glsx-components.css'
......@@ -31,4 +32,5 @@
Vue.use(GLFooter)
Vue.use(GLSearch)
Vue.use(GLSearchItem)
Vue.use(GLCombiForm)
\ No newline at end of file
Vue.use(GLCombiForm)
Vue.use(GLTableButton)
......@@ -23,10 +23,10 @@ import '@/theme/theme.scss'
// // import '../dist/glsx-components.css'
// //开发完成后,本地测试使用我们第二次封装的组件
import './index'
// import './index'
//开发完成后,打包后本地测试,我们第二次封装的组件
// import './localtest/index'
import './localtest/index'
Vue.config.productionTip = false
......
/**
* new line 2021-12-15
*
*/
import Vue from 'vue'
import { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker } from 'element-ui'
import { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker, Dropdown, DropdownItem,DropdownMenu } from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css' //todo 按需引入插件样式
import 'element-ui/lib/theme-chalk/table.css'
import 'element-ui/lib/theme-chalk/table-column.css'
......@@ -21,6 +20,9 @@ import 'element-ui/lib/theme-chalk/icon.css'
import 'element-ui/lib/theme-chalk/select.css'
import 'element-ui/lib/theme-chalk/option.css'
import 'element-ui/lib/theme-chalk/date-picker.css'
import 'element-ui/lib/theme-chalk/dropdown.css'
import 'element-ui/lib/theme-chalk/dropdown-item.css'
import 'element-ui/lib/theme-chalk/dropdown-menu.css'
// 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题
const fixElTableErr = table => {
......@@ -46,6 +48,9 @@ Vue.use(Icon)
Vue.use(Select)
Vue.use(Option)
Vue.use(DatePicker)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(DropdownMenu)
//打包后的组件dist 测试组件可能需要的
export { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker }
export { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker, Dropdown, DropdownItem,DropdownMenu }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!