|
|
|
@ -114,7 +114,7 @@ |
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
@click="handleStatusChange(scope.row)" |
|
|
|
@click="showRoleChange(scope.row)" |
|
|
|
v-hasPermi="['system:user:edit']" |
|
|
|
>{{$t('page.system.user.history')}}</el-button> |
|
|
|
|
|
|
|
@ -259,6 +259,8 @@ |
|
|
|
<el-button @click="upload.open = false">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<Sign ref="signRef" @callback="doUpdate" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -269,11 +271,12 @@ import Treeselect from "@riophae/vue-treeselect" |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css" |
|
|
|
import { Splitpanes, Pane } from "splitpanes" |
|
|
|
import "splitpanes/dist/splitpanes.css" |
|
|
|
import Sign from '@/views/business/study/comp/sign.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "User", |
|
|
|
dicts: ['sys_normal_disable', 'sys_user_sex'], |
|
|
|
components: { Treeselect, Splitpanes, Pane }, |
|
|
|
components: { Treeselect, Splitpanes, Pane,Sign }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
@ -389,7 +392,8 @@ export default { |
|
|
|
// trigger: "blur" |
|
|
|
// } |
|
|
|
// ] |
|
|
|
} |
|
|
|
}, |
|
|
|
oldRoleIdList:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
@ -481,6 +485,7 @@ export default { |
|
|
|
postIds: [], |
|
|
|
roleIds: [] |
|
|
|
} |
|
|
|
this.oldRoleIdList = [] |
|
|
|
this.resetForm("form") |
|
|
|
}, |
|
|
|
/** 搜索按钮操作 */ |
|
|
|
@ -532,6 +537,7 @@ export default { |
|
|
|
const userId = row.userId || this.ids |
|
|
|
getUser(userId).then(response => { |
|
|
|
this.form = response.data |
|
|
|
this.oldRoleIdList = _.cloneDeep(response.roleIds) |
|
|
|
this.postOptions = response.posts |
|
|
|
this.roleOptions = response.roles |
|
|
|
this.$set(this.form, "postIds", response.postIds) |
|
|
|
@ -570,14 +576,27 @@ export default { |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
if (this.form.userId != undefined) { |
|
|
|
updateUser(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}) |
|
|
|
let updateRole = false; |
|
|
|
if(this.oldRoleIdList.length!==this.form.roleIds.length){ |
|
|
|
updateRole = true |
|
|
|
}else{ |
|
|
|
for(let i=0;i<this.oldRoleIdList.length;i++){ |
|
|
|
if(_.findIndex(this.form.roleIds,o=>{return o==this.oldRoleIdList[i]})==-1){ |
|
|
|
updateRole = true |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(updateRole){ |
|
|
|
this.$refs.signRef.show( |
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
) |
|
|
|
}else{ |
|
|
|
this.doUpdate({}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
addUser(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("新增成功") |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}) |
|
|
|
@ -585,6 +604,16 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
doUpdate(sign){ |
|
|
|
this.$modal.loading() |
|
|
|
updateUser({user:this.form,sign:sign}).then(response => { |
|
|
|
this.$refs.signRef.cancel() |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 删除按钮操作 */ |
|
|
|
handleDelete(row) { |
|
|
|
const userIds = row.userId || this.ids |
|
|
|
@ -637,6 +666,9 @@ export default { |
|
|
|
return _.map(row.roles,'roleName').join(',') |
|
|
|
} |
|
|
|
return '' |
|
|
|
}, |
|
|
|
showRoleChange(row){ |
|
|
|
this.saveSimpleLog({name:row.nickName,nameEn:row.nickName,jcmc:this.$t('page.system.user.history','zh_CN'),jcmcEn:this.$t('page.system.user.history','en_US')}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |