|
@@ -68,25 +68,32 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作">
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button type="primary" v-if="hasPerm('user:edit')" size="mini" style="margin-right: 10px;" @click="edit(scope.row)">编辑</el-button>
|
|
|
|
- <el-dropdown>
|
|
|
|
- <span class="el-dropdown-link">
|
|
|
|
- 操作<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
- </span>
|
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
|
- <el-dropdown-item>
|
|
|
|
- <el-popconfirm
|
|
|
|
- title=" 确定要删除这个用户吗?"
|
|
|
|
- @confirm="del(scope.row)"
|
|
|
|
- >
|
|
|
|
- <el-button type="text" v-if="hasPerm('user:del')" size="mini" slot="reference">删除</el-button>
|
|
|
|
- </el-popconfirm>
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item>
|
|
|
|
- <el-button type="text" @click="handleFarm(scope.row)" size="mini" >分配牧场</el-button>
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </el-dropdown>
|
|
|
|
|
|
+ <el-button type="primary" v-if="hasPerm('user:edit')" size="mini" @click="edit(scope.row)">编辑</el-button>
|
|
|
|
+ <el-button type="success" style="margin-right: 5px" @click="handleFarm(scope.row)" size="mini" >分配牧场</el-button>
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ title=" 确定要删除这个用户吗?"
|
|
|
|
+ @confirm="del(scope.row)"
|
|
|
|
+ >
|
|
|
|
+ <el-button type="danger" v-if="hasPerm('user:del')" size="mini" slot="reference">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+<!-- <el-dropdown>-->
|
|
|
|
+<!-- <span class="el-dropdown-link">-->
|
|
|
|
+<!-- 操作<i class="el-icon-arrow-down el-icon--right"></i>-->
|
|
|
|
+<!-- </span>-->
|
|
|
|
+<!-- <el-dropdown-menu slot="dropdown">-->
|
|
|
|
+<!-- <el-dropdown-item>-->
|
|
|
|
+<!-- <el-popconfirm-->
|
|
|
|
+<!-- title=" 确定要删除这个用户吗?"-->
|
|
|
|
+<!-- @confirm="del(scope.row)"-->
|
|
|
|
+<!-- >-->
|
|
|
|
+<!-- <el-button type="text" v-if="hasPerm('user:del')" size="mini" slot="reference">删除</el-button>-->
|
|
|
|
+<!-- </el-popconfirm>-->
|
|
|
|
+<!-- </el-dropdown-item>-->
|
|
|
|
+<!-- <el-dropdown-item>-->
|
|
|
|
+<!-- <el-button type="text" @click="handleFarm(scope.row)" size="mini" >分配牧场</el-button>-->
|
|
|
|
+<!-- </el-dropdown-item>-->
|
|
|
|
+<!-- </el-dropdown-menu>-->
|
|
|
|
+<!-- </el-dropdown>-->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -148,7 +155,7 @@
|
|
width="50%">
|
|
width="50%">
|
|
<div>
|
|
<div>
|
|
<el-table
|
|
<el-table
|
|
- :data="farmList"
|
|
|
|
|
|
+ :data="getFarmList"
|
|
ref="multipleTable"
|
|
ref="multipleTable"
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
@selection-change="handleFarmChange">
|
|
@selection-change="handleFarmChange">
|
|
@@ -177,7 +184,7 @@
|
|
<script>
|
|
<script>
|
|
import TableFooter from '../../components/TableFooter';
|
|
import TableFooter from '../../components/TableFooter';
|
|
import {getUserList, addUser, editUser, isUser, delUser,} from '../../utils/api';
|
|
import {getUserList, addUser, editUser, isUser, delUser,} from '../../utils/api';
|
|
-import { mapState } from 'vuex';
|
|
|
|
|
|
+import { mapState, mapActions } from 'vuex';
|
|
export default {
|
|
export default {
|
|
name: "UserAdmin",
|
|
name: "UserAdmin",
|
|
components: {
|
|
components: {
|
|
@@ -217,11 +224,28 @@ export default {
|
|
// farmList: [],
|
|
// farmList: [],
|
|
// 选中牧场的id
|
|
// 选中牧场的id
|
|
selectFarm: '',
|
|
selectFarm: '',
|
|
|
|
+ getFarmList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ farmList: {
|
|
|
|
+ handler(newVal) {
|
|
|
|
+ if(newVal.length > 0) {
|
|
|
|
+ this.getFarmList = []
|
|
|
|
+ newVal.forEach(item => {
|
|
|
|
+ if(item.rowStatus) {
|
|
|
|
+ this.getFarmList.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapActions(['GetFarm']),
|
|
// 搜索
|
|
// 搜索
|
|
search() {
|
|
search() {
|
|
this.init();
|
|
this.init();
|
|
@@ -253,14 +277,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // getFarm() {
|
|
|
|
- // getFarm().then(res => {
|
|
|
|
- // console.log(res)
|
|
|
|
- // if(res.code === 10000) {
|
|
|
|
- // this.farmList = res.data;
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
// 添加用户
|
|
// 添加用户
|
|
addUser() {
|
|
addUser() {
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
@@ -477,6 +493,7 @@ export default {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.init();
|
|
this.init();
|
|
|
|
+ this.GetFarm();
|
|
// 获取牧场列表
|
|
// 获取牧场列表
|
|
// this.getFarm();
|
|
// this.getFarm();
|
|
}
|
|
}
|