Commit 12c45f7f authored by 杨柠瑞's avatar 杨柠瑞

coding

parent 4594176c
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<!-- 表格 --> <!-- 表格 -->
<el-table :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row <el-table :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row
style="width: 100%" @selection-change="handleSelectionChange" @sort-change="sortChange"> style="width: 100%" @selection-change="handleSelectionChange" @sort-change="sortChange" @current-change="tableCurrentChange">
<el-table-column type="index" :index="indexMethod" label="序号" width="50px"></el-table-column> <el-table-column type="index" :index="indexMethod" label="序号" width="50px"></el-table-column>
<el-table-column type="selection" width="55" v-if="isShowSelection"></el-table-column> <el-table-column type="selection" width="55" v-if="isShowSelection"></el-table-column>
<el-table-column v-for="(column,index) in showColumns" :key="index" align="center" :label="column.name" :prop="column.codeCamel" :sortable="column.isSort"> <el-table-column v-for="(column,index) in showColumns" :key="index" align="center" :label="column.name" :prop="column.codeCamel" :sortable="column.isSort">
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
<el-button @click="openDialog('editData',scope.row)" v-if="isShowEditDataButton" type="text" size="small">编辑</el-button> <el-button @click="openDialog('editData',scope.row)" v-if="isShowEditDataButton" type="text" size="small">编辑</el-button>
<el-button @click="deleteData(scope.row)" type="text" v-if="isShowDeleteButton" size="small">删除</el-button> <el-button @click="deleteData(scope.row)" type="text" v-if="isShowDeleteButton" size="small">删除</el-button>
<el-button @click="openDialog('detail',scope.row)" type="text" v-if="isShowDetail" size="small">详情</el-button> <el-button @click="openDialog('detail',scope.row)" type="text" v-if="isShowDetail" size="small">详情</el-button>
<el-button @click="openDialog('detail',scope.row)" type="text" v-if="isShowDetail" size="small"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -285,6 +286,7 @@ ...@@ -285,6 +286,7 @@
* "showRefresh": false, //默认不显示刷新按钮 * "showRefresh": false, //默认不显示刷新按钮
* "showDeleteButton": false, //默认不显示删除按钮 * "showDeleteButton": false, //默认不显示删除按钮
* "buttonGroup": false //默认不以按钮组的方式呈现button * "buttonGroup": false //默认不以按钮组的方式呈现button
* tableCurrentChange(value){} // 设置点击某行所执行方法
* showDetail: { * showDetail: {
* isShow: false, // 默认不显示详情 * isShow: false, // 默认不显示详情
* showColumns: ['mobile', 'loginid', 'username', 'email'] * showColumns: ['mobile', 'loginid', 'username', 'email']
...@@ -552,6 +554,13 @@ ...@@ -552,6 +554,13 @@
self.listLoading = false self.listLoading = false
}) })
}, },
tableCurrentChange(value) {
const self = this
if (self.options && self.options.tableCurrentChange) {
console.log('value', value)
self.options.tableCurrentChange(value)
}
},
// 数据库字段转化显示,例如(0=否,1=是) // 数据库字段转化显示,例如(0=否,1=是)
changeValue(data) { changeValue(data) {
const self = this const self = this
......
...@@ -77,7 +77,8 @@ ...@@ -77,7 +77,8 @@
showDetail: { showDetail: {
isShow: true, isShow: true,
showColumns: ['mobile', 'loginid', 'username', 'email'] showColumns: ['mobile', 'loginid', 'username', 'email']
} },
tableCurrentChange(value) {}
// dataProcessing(value, params, definedOperate) {} // 处理返回后的数据,必须return 处理后的数据 // dataProcessing(value, params, definedOperate) {} // 处理返回后的数据,必须return 处理后的数据
} }
this.userDefined = { this.userDefined = {
...@@ -89,6 +90,9 @@ ...@@ -89,6 +90,9 @@
{ type: 'input', label: '', placeholder: '邮箱', code: 'email', value: '' }, { type: 'input', label: '', placeholder: '邮箱', code: 'email', value: '' },
{ type: 'datetime', label: '', placeholder: '创建时间', code: 'createTime', value: '' } { type: 'datetime', label: '', placeholder: '创建时间', code: 'createTime', value: '' }
], ],
definedOperation: {
label: '测试'
},
definedEdit() { definedEdit() {
}, },
......
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