|
@@ -10,7 +10,7 @@
|
|
|
></el-transfer>
|
|
|
<div class="footer-handles">
|
|
|
<el-button size="small">取消</el-button>
|
|
|
- <el-button type="primary" size="small" @click="pushUsers">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="changeUsers">确定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -22,23 +22,23 @@ export default {
|
|
|
props: {
|
|
|
jobName: {
|
|
|
type: String,
|
|
|
- default: "**部门人员"
|
|
|
+ default: "**部门人员",
|
|
|
},
|
|
|
users: {
|
|
|
type: Array,
|
|
|
- default: (val)=>{
|
|
|
- console.log(val);
|
|
|
- return []
|
|
|
- }
|
|
|
+ default: (val) => {
|
|
|
+ console.log(val);
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ visible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
},
|
|
|
- visible:{
|
|
|
- type:Boolean,
|
|
|
- default:false
|
|
|
- }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- value: ["1"],
|
|
|
+ value: [],
|
|
|
data: [
|
|
|
// { key: 1, label: "选择1", disabled: false },
|
|
|
// { key: 2, label: "选择2", disabled: false },
|
|
@@ -47,20 +47,23 @@ export default {
|
|
|
// { key: 5, label: "选择5", disabled: false }
|
|
|
],
|
|
|
loading: {
|
|
|
- transfer: false
|
|
|
- }
|
|
|
+ transfer: false,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.value = this.users.map((v) => {
|
|
|
+ return v.id;
|
|
|
+ });
|
|
|
this.loading.transfer = true;
|
|
|
- getUsers().then(res => {
|
|
|
- // console.log(res);
|
|
|
+ getUsers().then((res) => {
|
|
|
+ // console.log(res);
|
|
|
let result = res.data.result;
|
|
|
let data = [];
|
|
|
- result.forEach(e => {
|
|
|
+ result.forEach((e) => {
|
|
|
data.push({
|
|
|
key: e.id,
|
|
|
- label: e.username
|
|
|
+ label: e.username,
|
|
|
});
|
|
|
});
|
|
|
this.data = data;
|
|
@@ -68,20 +71,25 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
watch: {
|
|
|
- // 打开了则把已经选择的value初始一下
|
|
|
- visible(val){
|
|
|
- this.value = this.users
|
|
|
- }
|
|
|
+ // 打开了则把已经选择的value初始一下
|
|
|
+ visible(val) {
|
|
|
+ this.value = this.users.map((v) => {
|
|
|
+ return v.id;
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
handleChange(value, direction, movedKeys) {
|
|
|
console.log(this.value);
|
|
|
console.log(value, direction, movedKeys);
|
|
|
},
|
|
|
- pushUsers(){
|
|
|
- console.log('确定按钮,之后还没写,等待后端完成');
|
|
|
- }
|
|
|
- }
|
|
|
+ //改变岗位下的用户
|
|
|
+ changeUsers() {
|
|
|
+ // console.log("用户组id", this.value);
|
|
|
+ // console.log("确定按钮,之后还没写,等待后端完成");
|
|
|
+ this.$emit("change-visible", this.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|