Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is running Details

uat_us
caiyiling 2024-12-26 16:07:52 +08:00
commit 47c6b30d4a
12 changed files with 148 additions and 39 deletions

View File

@ -325,3 +325,12 @@ export function useUserIDGetDoctorID(data) {
data
})
}
// 管理端修改用户角色
export function updateUserRoleInfo(data) {
return request({
url: `/User/updateUserRoleInfo`,
method: 'put',
data
})
}

View File

@ -19,7 +19,7 @@
v-for="item in roles"
:key="item.Id"
:label="item.Id"
:disabled="item.isUserRoleDisabled"
:disabled="item.IsUserRoleDisabled"
style="margin-bottom: 10px"
>
{{ item.UserTypeShortName }}

View File

@ -293,6 +293,7 @@ async function VueInit() {
}()
_vm.$forceUpdate()
}
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$path = []
var t = function (key) {
if (!~Vue.prototype.$path.indexOf(key)) {

View File

@ -189,6 +189,7 @@ const actions = {
commit('SET_PERMISSIONS', permissions.Result)
zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
zzSessionStorage.removeItem('lastWorkbench')
} catch (e) {
console.log(e)
}
@ -272,6 +273,21 @@ const actions = {
console.log(e)
}
},
async resetData({ commit, state }) {
try {
removeToken() // must remove token first
// await loginOut({
// UserRoleId: zzSessionStorage.getItem('userId'),
// IdentityUserId: zzSessionStorage.getItem('identityUserId'),
// })
resetRouter()
removeName()
zzSessionStorage.clear()
commit('RESET_STATE')
} catch (e) {
console.log(e)
}
},
setToken({ commit }, token) {
commit('SET_TOKEN', token)
},

View File

@ -138,7 +138,7 @@ export default {
...mapMutations({ setLanguage: 'lang/setLanguage' }),
async logout() {
var loginType = zzSessionStorage.getItem('loginType')
await this.$store.dispatch('user/logout')
await this.$store.dispatch('user/resetData')
if (loginType) {
this.$router.push(`/login?loginType=${loginType}`)
} else {

View File

@ -85,11 +85,32 @@
style="width: 100%"
:disabled="user.CanEditUserType === false || type === 1"
@change="handleChange"
v-if="type === 0"
>
<template v-for="(userType, key) of userTypeOptions">
<template v-for="userType of userTypeOptions">
<el-option
v-if="userType.UserTypeEnum !== 20"
:key="key"
:key="userType.Id"
:label="userType.UserType"
:value="userType.Id"
/>
</template>
</el-select>
<el-select
ref="userType"
v-model="Roles"
size="small"
placeholder="Please select"
multiple
style="width: 100%"
:disabled="user.CanEditUserType === false || type === 1"
@change="handleChange"
v-else
>
<template v-for="userType of userTypeOptions">
<el-option
v-if="userType.UserTypeEnum !== 20"
:key="userType.Id"
:label="userType.UserType"
:value="userType.Id"
/>
@ -162,9 +183,10 @@
<roleList
v-if="visible"
:visible.sync="visible"
:list="user.UserRoleList"
:roles.sync="user.Roles"
:userId="userId"
:list="userRoleList"
:userTypeOptions="userTypeOptions"
@getRoleList="getRoleList"
/>
</el-form>
</template>
@ -193,6 +215,10 @@ export default {
},
methods: {
openRoleList() {
this.userRoleList = []
this.user.UserRoleList.forEach((item) => {
this.userRoleList.push(Object.assign({}, item))
})
this.visible = true
},
handleChange(val) {
@ -274,10 +300,33 @@ export default {
IdentityUserId: this.userId,
}).then((res) => {
this.user = res.Result
this.Roles = []
this.user.Roles = []
this.user.UserRoleList = []
res.Result.AccountList.forEach((item) => {
if (!item.IsUserRoleDisabled) {
this.Roles.push(item.UserTypeId)
this.user.Roles.push(item.UserTypeId)
}
this.user.UserRoleList.push({
UserTypeEnum: item.UserTypeEnum,
UserTypeId: item.UserTypeId,
IsUserRoleDisabled: item.IsUserRoleDisabled,
UserTypeShortName: item.UserTypeShortName,
})
})
})
},
getRoleList() {
getUser({
IdentityUserId: this.userId,
}).then((res) => {
this.Roles = []
this.user.Roles = []
this.user.UserRoleList = []
res.Result.AccountList.forEach((item) => {
if (!item.IsUserRoleDisabled) {
this.Roles.push(item.UserTypeId)
this.user.Roles.push(item.UserTypeId)
}
this.user.UserRoleList.push({
@ -315,6 +364,8 @@ export default {
}
}
return {
userRoleList: [],
Roles: [],
user: {
Roles: [],
UserRoleList: [],

View File

@ -7,7 +7,6 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
:show-close="false"
:title="$t('system:userlist:roleList:title')"
:before-close="cancel"
>
@ -19,7 +18,12 @@
>
{{ $t('common:button:new') }}
</el-button>
<el-table :data="list" style="width: 100%" max-height="300px">
<el-table
:data="list"
style="width: 100%"
max-height="300px"
v-loading="loading"
>
<el-table-column type="index" width="40" />
<el-table-column
prop="UserTypeShortName"
@ -56,9 +60,13 @@
</el-table>
<div slot="footer">
<!-- 保存 -->
<el-button type="primary" size="small" @click="save">
<el-button type="primary" :loading="loading" size="small" @click="save">
{{ $t('common:button:confirm') }}
</el-button>
<!-- 取消 -->
<el-button size="small" @click="cancel">
{{ $t('common:button:cancel') }}
</el-button>
</div>
<el-dialog
v-if="addVisible"
@ -103,9 +111,11 @@
</el-dialog>
</template>
<script>
import { updateUserRoleInfo } from '@/api/admin.js'
export default {
name: 'roleList',
props: {
userId: { type: String, default: '' },
visible: {
type: Boolean,
default: false,
@ -116,12 +126,6 @@ export default {
return []
},
},
roles: {
type: Array,
default: () => {
return []
},
},
userTypeOptions: {
type: Array,
default: () => {
@ -132,6 +136,7 @@ export default {
data() {
return {
addVisible: false,
loading: false,
form: {
roles: [],
},
@ -161,15 +166,24 @@ export default {
openAdd() {
this.addVisible = true
},
save() {
let roles = []
this.list.forEach((item) => {
if (!item.IsUserRoleDisabled) {
roles.push(item.UserTypeId)
async save() {
try {
let data = {
Id: this.userId,
UserRoleList: this.list,
}
})
this.$emit('update:roles', roles)
this.$emit('update:visible', false)
this.loading = true
let res = await updateUserRoleInfo(data)
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:updatedSuccessfully'))
this.$emit('update:visible', false)
this.$emit('getRoleList')
}
} catch (err) {
this.loading = false
console.log(err)
}
},
async saveAdd() {
try {

View File

@ -270,15 +270,16 @@ export default {
history.go(0)
// this.$router.replace({ path: '/trials/trials-list' })
} else {
history.replaceState(null, null, '/trials')
history.replaceState(null, null, '/trials/trials-workbench')
history.go(0)
// this.$router.replace({ path: '/trials/trials-workbench' })
}
this.toggleRoleVisible = false
this.toggleRoleLoading = false
this.$nextTick(() => {
window.location.reload()
})
this.$EventBus.$emit('reload')
// this.$nextTick(() => {
// window.location.reload()
// })
} else {
//
this.toggleRoleLoading = false

View File

@ -788,6 +788,11 @@ export default {
created() {
this.initPage()
},
mounted(){
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
},
methods: {
initPage() {
this.getList()

View File

@ -525,7 +525,7 @@ export default {
.getElementsByTagName('canvas')
let a = document.createElement('a')
a.href = qrCodeCanvas[0].toDataURL('image/url')
a.download = `${this.$t('trials:researchRecord:title:code')}.png`
a.download = `${this.$route.query.researchProgramNo}${this.$t('trials:researchRecord:title:code')}.png`
a.click()
},
//

View File

@ -632,10 +632,10 @@
:close-on-click-modal="false"
:title="$t('trials:logincCfg:form:modality')"
custom-class="base-dialog-wrapper"
width="900px"
width="400px"
>
<div class="base-dialog-body" style="height: 400px; text-align: center">
<el-transfer
<div class="base-dialog-body">
<!-- <el-transfer
filterable
:filter-method="filterMethod"
filter-placeholder=""
@ -651,8 +651,8 @@
}"
:render-content="renderFunc"
>
</el-transfer>
<!-- <el-table
</el-transfer> -->
<el-table
ref="multipleTable"
:data="$d.Modality"
stripe
@ -671,7 +671,7 @@
prop="value"
:label="$t('trials:logincCfg:form:modality')"
/>
</el-table> -->
</el-table>
</div>
<div
class="base-dialog-footer"
@ -959,7 +959,8 @@ export default {
handleConfirmModality() {
this.form.ModalityList = Object.assign(
[],
this.selectedList.map((v) => v)
// this.selectedList.map((v) => v)
this.selectedList.map((v) => v.value)
)
let Modalitys = this.form.ModalityList.map((item) => {
return this.$fd('Modality', item.trim())
@ -984,12 +985,20 @@ export default {
},
handleSetModality() {
this.modalityListVisible = true
var a = this.$d.Modality.filter((v) => {
return !!this.form.ModalityList.find((v1) => {
return v1 === v.value
this.$nextTick(() => {
var a = this.$d.Modality.filter((v) => {
return !!this.form.ModalityList.find((v1) => {
return v1 === v.value
})
})
this.toggleSelection(a)
})
this.selectedList = a.map((item) => item.value)
// var a = this.$d.Modality.filter((v) => {
// return !!this.form.ModalityList.find((v1) => {
// return v1 === v.value
// })
// })
// this.selectedList = a.map((item) => item.value)
},
handleBodyPartSelectionChange(val) {
this.selectedBodyParts = val

View File

@ -487,6 +487,9 @@ export default {
hoursTip=this.$t('common:date:good evening')
}
this.hoursTip = hoursTip
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
},
methods: {
getUserInfo() {