Commit 8c46f021 by 胡悦

。。

1 parent 68074757
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<script> <script>
export default { export default {
name: 'UserForm', name: 'UserCreate',
props: { props: {
dialogFormVisible: Boolean, dialogFormVisible: Boolean,
editUser: Object editUser: Object
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<div class="default p-t15"> <div class="default p-t15">
<div class="control-tabledata-button"> <div class="control-tabledata-button">
<gl-button size="small" @click="createUser(editUser={})">新增用户</gl-button> <gl-button size="small" @click="createUser(editUser={})">新增用户</gl-button>
<gl-button size="small" @click="delteSelected(index[rows])">删除选中</gl-button> <gl-button size="small" @click="toggleSelection(this.toggle)">删除选中</gl-button>
<user-form :dialogFormVisible="dialogFormVisible" :editUser="editUser" @userFormData="handleUserFormData"></user-form> <user-create :dialogFormVisible="dialogFormVisible" :editUser="editUser" @userFormData="handleUserFormData"></user-create>
</div> </div>
<div class="m-b8"> <div class="m-b8">
<gl-table :table="userData" ref="multipleTable" :pagination="pagination"></gl-table> <gl-table :table="userData" ref="multipleTable" :pagination="pagination"></gl-table>
...@@ -21,18 +21,19 @@ ...@@ -21,18 +21,19 @@
</template> </template>
<script> <script>
import { UserForm, UserDetail } from '@/components/index' import { UserCreate, UserDetail } from '@/components/index'
import { getUser } from '@/api/userApi' import { getUser } from '@/api/userApi'
import { userDetailColumn } from '@/common/common' import { userDetailColumn } from '@/common/common'
export default { export default {
name: 'user', name: 'user',
components: { components: {
UserForm, UserCreate,
UserDetail UserDetail
}, },
data() { data() {
return { return {
userName: '', userName: '',
toggle: {},
dialogFormVisible: false, dialogFormVisible: false,
editUser: {}, editUser: {},
userDetailVisible: false, userDetailVisible: false,
...@@ -40,6 +41,7 @@ export default { ...@@ -40,6 +41,7 @@ export default {
columnParam: [], columnParam: [],
consoleParam: [], consoleParam: [],
userData: { userData: {
select: this.handleSelectionChange,
border: true, border: true,
align: 'center', align: 'center',
height: 500, height: 500,
...@@ -177,13 +179,24 @@ export default { ...@@ -177,13 +179,24 @@ export default {
return createTime return createTime
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val // this.multipleSelection = val
alert(val)
this.toggle = val
},
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row)
})
} else {
this.$refs.multipleTable.clearSelection()
}
}, },
finduserName() { finduserName() {
this.userName = '' this.userName = ''
}, },
delteSelected(index, rows) { delteSelected(val) {
console.log(rows) console.log(val)
}, },
confirmDeleteOrNot(index, rows) { confirmDeleteOrNot(index, rows) {
this.$confirm('确定要删除这条数据?', '', { this.$confirm('确定要删除这条数据?', '', {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!