添加切换角色功能
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-03-28 09:29:32 +08:00
parent a0d32a77ec
commit 7b1fd033b9
11 changed files with 537 additions and 366 deletions

View File

@ -57,7 +57,7 @@
num = e.data
}
</script>
<script src="./config.js"></script>
<script src="/config.js"></script>
</head>
<body>
<noscript>

View File

@ -160,4 +160,12 @@ export function GetObjectStoreToken(params) {
})
}
export function loginSelectUserRole(params) {
return request({
url: `/user/loginSelectUserType`,
method: 'get',
params
})
}

View File

@ -0,0 +1,107 @@
<template>
<el-dialog v-if="visible" :visible.sync="visible" v-dialogDrag width="540px" :close-on-click-modal="false"
:close-on-press-escape="false" append-to-body :title="$t('toggleRole:tip:title')" center top="30vh"
:show-close="false" :before-close="cancel">
<template v-if="hasRole">
<el-radio-group v-model="form.userRoleId" class="roles">
<el-radio v-for="item in roles" :key="item.Id" :label="item.Id" :disabled="item.IsUserRoleDisabled"
style="margin-bottom: 10px">
{{ item.UserTypeShortName }}
</el-radio>
</el-radio-group>
</template>
<div v-else style="text-align: center">
{{ $t('toggleRole:tip:noRole') }}
</div>
<div slot="footer">
<!-- 取消 -->
<el-button size="small" @click="cancel()">
{{ $t('common:button:cancel') }}
</el-button>
<!-- 保存 -->
<el-button type="primary" size="small" @click="save" :disabled="saveDisabled" :loading="loading" v-if="hasRole">
{{ $t('common:button:confirm') }}
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'toggleRole',
props: {
visible: {
type: Boolean,
default: false,
},
loading: {
type: Boolean,
default: false,
},
},
data() {
return {
form: {
userRoleId: null,
},
}
},
created() {
this.form.userRoleId = zzSessionStorage.getItem('userId')
},
computed: {
roles() {
return this.$store.state.user.roles
},
hasRole() {
return this.roles && this.roles.length > 0
},
saveDisabled() {
return this.form.userRoleId === zzSessionStorage.getItem('userId')
},
},
methods: {
cancel() {
this.$emit('update:visible', false)
this.$emit('cancel')
},
async save() {
try {
if (!this.form.userRoleId)
return this.$message.warning(this.$t('toggleRole:ruleMessage:select'))
zzSessionStorage.removeItem('lastWorkbench')
this.$emit('save', {
UserId: this.form.userRoleId,
UserTypeId: this.roles.find(item => item.Id === this.form.userRoleId).UserTypeId
})
} catch (err) {
console.log(err)
}
},
},
}
</script>
<style lang="scss" scoped>
.roles {
max-width: 365px;
width: fit-content;
display: flex;
align-content: center;
// justify-content: center;
flex-wrap: wrap;
margin: auto;
}
::v-deep .el-radio__original {
display: none !important;
/* 隐藏原生 radio 输入,但仍然允许交互 */
}
::v-deep.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}
.el-radio {
width: 60px;
}
</style>

View File

@ -2,11 +2,7 @@
<div class="navbar navbar-flex-wrapper">
<div class="leftMenu">
<div class="navbar-flex-wrapper">
<hamburger
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<breadcrumb class="breadcrumb-container" />
</div>
@ -36,6 +32,12 @@
<!-- <el-dropdown-item>
<span style="display:block;" @click="account">Account</span>
</el-dropdown-item> -->
<!-- 切换角色 -->
<el-dropdown-item divided v-if="hasRole">
<span style="display: block" @click="openToggleRole">{{
$t('system:navbar:button:toggleRole')
}}</span>
</el-dropdown-item>
<el-dropdown-item divided>
<span style="display: block" @click="logout">{{
$t("trials:trials-myinfo:button:loginout")
@ -46,6 +48,8 @@
</div>
</div>
</div>
<toggleRole v-if="toggleRoleVisible" :visible.sync="toggleRoleVisible" :loading="toggleRoleLoading"
@save="loginByRole" />
</div>
</template>
@ -54,27 +58,101 @@ import { mapGetters, mapMutations } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from "@/components/Hamburger";
import Screenfull from "@/components/Screenfull";
import { resetRouter } from '@/router'
import toggleRole from '@/components/toggleRole'
export default {
components: {
Breadcrumb,
Hamburger,
Screenfull,
toggleRole
},
data() {
return {
isReviewer: false,
userTypeShortName: zzSessionStorage.getItem("userTypeShortName"),
toggleRoleVisible: false,
toggleRoleLoading: false
};
},
computed: {
...mapGetters(["sidebar", "name", "device"]),
roles() {
return this.$store.state.user.roles
},
hasRole() {
return this.roles && this.roles.length > 1
},
},
created() {
this.isReviewer = JSON.parse(zzSessionStorage.getItem("IsReviewer"));
this.$store.dispatch('user/getUserInfo')
},
methods: {
...mapMutations({ setLanguage: "lang/setLanguage" }),
openToggleRole() {
this.$store.dispatch('user/getUserInfo').then((res) => {
this.toggleRoleVisible = true
})
},
loginByRole(row) {
let { UserId, UserTypeId } = row
if (this.$store.state.user.userId === UserId) {
this.toggleRoleVisible = false
this.toggleRoleLoading = false
return false
}
this.toggleRoleLoading = true
this.$store
.dispatch('user/loginByRole', { UserId, UserTypeId })
.then((res) => {
if (res) {
this.$store
.dispatch('permission/generateRoutes')
.then(async (res) => {
if (res && res.length > 0) {
resetRouter()
await this.$store.dispatch('global/getNoticeList')
this.$router.addRoutes(res)
this.toggleRoleLoading = false
if (this.loginType === 'DevOps') {
this.$router.replace({ path: res[0].path })
return
}
if (this.hasPermi(['role:radmin'])) {
this.$router.replace({ path: res[0].path })
return
}
if (
this.hasPermi(['role:pm', 'role:oa', 'role:admin', 'role:dev'])
) {
history.replaceState(null, null, '/trials/trials-inspection')
history.go(0)
} else {
history.replaceState(null, null, '/trials/trials-list')
history.go(0)
}
this.toggleRoleVisible = false
this.toggleRoleLoading = false
this.$EventBus.$emit('reload')
} else {
//
this.toggleRoleLoading = false
this.$message.warning(this.$t('login:message:login2'))
}
})
.catch((err) => {
console.log(err)
this.toggleRoleLoading = false
})
} else {
this.toggleRoleLoading = false
}
})
.catch(() => {
this.toggleRoleLoading = false
})
},
toggleSideBar() {
this.$store.dispatch("app/toggleSideBar");
},
@ -106,12 +184,14 @@ export default {
flex-direction: row;
justify-content: space-between;
}
.navbar {
height: 50px;
overflow: hidden;
// position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container {
line-height: 46px;
height: 100%;
@ -133,6 +213,7 @@ export default {
// float: right;
height: 100%;
line-height: 50px;
// position: relative;
&:focus {
outline: none;
@ -159,6 +240,7 @@ export default {
.avatar-container {
display: inline-block;
margin-right: 200px;
.user-avatar {
margin-top: 5px;
width: 40px;
@ -166,16 +248,19 @@ export default {
border-radius: 10px;
}
}
.dropdown-container {
// margin-left: 30px;
// position: absolute;
// right: 20px;
// top: 0px;
cursor: pointer;
.el-icon-caret-bottom {
font-size: 12px;
}
}
.el-dropdown-link {
color: #999c9e;
cursor: pointer;

View File

@ -101,7 +101,7 @@ Vue.prototype.resetForm = resetForm
Vue.prototype.selectDictLabel = selectDictLabel
// Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$getObjectName = (url) => {
// console.log(url,'url')
// console.log(Vue.prototype.OSSclientConfig.viewEndpoint,'url')

View File

@ -1,6 +1,6 @@
import { getToken, setToken, removeToken, setName, removeName } from '@/utils/auth'
import { login, getUserMenuTree, getUserPermissions } from '@/api/user'
import { login, getUserMenuTree, getUserPermissions, loginSelectUserRole } from '@/api/user'
import { getUser } from '@/api/admin'
import { resetRouter } from '@/router'
import md5 from 'js-md5'
const getDefaultState = () => {
@ -16,13 +16,17 @@ const getDefaultState = () => {
TotalNeedSignSystemDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
TotalNeedSignTrialDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
TrialStatusStr: null,
isTestUser: false
isTestUser: false,
roles: []
}
}
const state = getDefaultState()
const mutations = {
SET_ROLES: (state, roles) => {
state.roles = roles
},
RESET_STATE: (state) => {
Object.assign(state, getDefaultState())
},
@ -78,6 +82,9 @@ const mutations = {
}
const actions = {
setRoles({ commit }, roles) {
commit('SET_ROLES', roles)
},
// user login
login({ commit }, userInfo) {
const { username, password } = userInfo
@ -135,6 +142,49 @@ const actions = {
})
})
},
loginByRole({ commit }, userInfo) {
const { UserId, UserTypeId } = userInfo
let params = {
UserId, UserTypeId
}
return new Promise((resolve, reject) => {
loginSelectUserRole(params).then(async response => {
if (response.IsSuccess) {
const data = response.Result.JWTStr
try {
commit('SET_TOKEN', data)
setToken(data)
commit('SET_USERID', UserId)
zzSessionStorage.setItem('userId', UserId)
const userString = decodeURIComponent(escape(window.atob(data.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
const user = JSON.parse(userString)
zzSessionStorage.setItem('userTypeShortName', user.userTypeShortName)
// commit('SET_USERTYPESHORTNAME', user.userTypeShortName)
commit('SET_NAME', user.fullName)
setName(user.fullName)
zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt)
var permissions = await getUserPermissions()
var menuTree = await getUserMenuTree()
commit('SET_TREE', menuTree.Result)
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)
}
resolve(response.Result)
} else {
reject(response.ErrorMessage)
}
}).catch(() => {
reject()
})
})
},
setTree({ commit }, tree) {
commit('SET_TREE', tree)
},
@ -186,7 +236,19 @@ const actions = {
setToken({ commit }, token) {
commit('SET_TOKEN', token)
},
// 获取用户信息
getUserInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getUser(state.userId).then(res => {
if (res.Result) {
commit('SET_ROLES', res.Result.AccountList)
}
resolve(res.Result)
}).catch(err => {
reject(err)
})
})
},
// remove token
resetToken({ commit }) {
return new Promise(resolve => {

View File

@ -122,6 +122,7 @@ import Img1 from '@/assets/pic-1.png'
import logoImg from '@/assets/zzlogo2.png'
import { getHospital } from '@/api/hospital.js'
import { getHIRHospitalList, updateDefaultHospital } from '@/api/admin'
// import config from '/public/config.js'
export default {
name: 'Login',

View File

@ -342,6 +342,11 @@ export default {
this.selectPatient = item
},
},
mounted() {
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -1,13 +1,9 @@
<template>
<div class="trials-navbar" style="position: relative">
<div class="leftMenu">
<img
v-if="language === 'zh' && hospital.HospitalLogoPath"
:src="OSSclientConfig.basePath + hospital.HospitalLogoPath"
crossOrigin="anonymous"
alt=""
style="min-width: 170px;"
/>
<img v-if="language === 'zh' && hospital.HospitalLogoPath"
:src="OSSclientConfig.basePath + hospital.HospitalLogoPath" crossOrigin="anonymous" alt=""
style="min-width: 170px;" />
<div v-else style="width: 170px;"></div>
<!-- <img v-else src="@/assets/zzlogo3.png" alt="" /> -->
<span style="white-space: nowrap">
@ -19,39 +15,25 @@
<NoticeMarquee />
</div>
<div class="right-menu">
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
size="mini"
@select="handleSelect"
>
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" size="mini" @select="handleSelect">
<!-- <el-menu-item v-if="!hasPermi(['role:air', 'role:rpm', 'role:radmin', 'role:rcrc', 'role:rir'])" index="1">
<i class="el-icon-odometer" /> -->
<!-- 工作台 -->
<!-- <span slot="title">{{ $t('trials:menuTitle:workbench') }}</span>
</el-menu-item> -->
<el-menu-item
v-if="hasPermi(['role:pm', 'role:oa', 'role:admin', 'role:dev'])"
index="1"
>
<el-menu-item v-if="hasPermi(['role:pm', 'role:oa', 'role:admin', 'role:dev'])" index="1">
<i class="el-icon-odometer" />
<!-- 检查 -->
<span slot="title">{{ $t('trials:menuTitle:inspection') }}</span>
</el-menu-item>
<el-menu-item
v-if="!hasPermi(['role:zys'])"
index="2"
:disabled="TotalNeedSignSystemDocCount !== 0"
>
<el-menu-item v-if="!hasPermi(['role:zys'])" index="2" :disabled="TotalNeedSignSystemDocCount !== 0">
<i class="el-icon-box" />
<!-- 我的项目 -->
<span slot="title">
{{ $t('trials:tab:trials') }}
</span>
</el-menu-item>
<el-menu-item
v-if="
<el-menu-item v-if="
!hasPermi([
'role:air',
'role:rpm',
@ -60,9 +42,7 @@
'role:rir',
'role:zys',
])
"
index="3"
>
" index="3">
<i class="el-icon-chat-dot-square" />
<!-- 通知消息 -->
<span slot="title">{{ $t('trials:tab:notice') }}</span>
@ -80,11 +60,12 @@
$t('trials:trials-myinfo:title:accountInfo')
}}</el-menu-item>
<!-- 管理后台 -->
<el-menu-item
v-if="hasPermi(['role:dev', 'role:oa', 'role:admin'])"
index="4-4"
>{{ $t('trials:trials-myinfo:title:system') }}</el-menu-item
>
<el-menu-item v-if="hasPermi(['role:dev', 'role:oa', 'role:admin'])" index="4-4">{{
$t('trials:trials-myinfo:title:system') }}</el-menu-item>
<!-- 切换角色 -->
<el-menu-item index="4-5" v-if="hasRole">{{
$t('trials:trials-myinfo:title:toggleRole')
}}</el-menu-item>
<!-- 退出 -->
<el-menu-item index="4-3">{{
$t('trials:trials-myinfo:button:loginout')
@ -92,6 +73,8 @@
</el-submenu>
</el-menu>
<!-- <TopLang />-->
<toggleRole v-if="toggleRoleVisible" :visible.sync="toggleRoleVisible" :loading="toggleRoleLoading" :roles="roles"
@save="loginByRole" />
</div>
</div>
</template>
@ -103,8 +86,10 @@ import TopLang from './topLang'
import NoticeMarquee from './noticeMarquee'
import { getHospital } from '@/api/hospital.js'
import logoImg from '@/assets/zzlogo2.png'
import { resetRouter } from '@/router'
import toggleRole from '@/components/toggleRole'
export default {
components: { TopLang, NoticeMarquee },
components: { TopLang, NoticeMarquee, toggleRole },
data() {
return {
logoImg,
@ -116,6 +101,8 @@ export default {
HospitalLogoPath: null,
HospitalName: null,
},
toggleRoleVisible: false,
toggleRoleLoading: false,
}
},
computed: {
@ -127,6 +114,16 @@ export default {
'TotalNeedSignSystemDocCount',
'language',
]),
roles() {
return this.$store.state.user.roles
},
hasRole() {
return (
this.roles &&
this.roles.length > 1 &&
this.roles.filter((item) => !item.IsUserRoleDisabled).length > 1
)
},
},
watch: {
$route(v) {
@ -137,9 +134,67 @@ export default {
this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
this.changeRoute(this.$route)
this.getInfo()
this.$store.dispatch('user/getUserInfo')
},
methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }),
loginByRole(row) {
let { UserId, UserTypeId } = row
if (this.$store.state.user.userId === UserId) {
this.toggleRoleVisible = false
this.toggleRoleLoading = false
return false
}
this.toggleRoleLoading = true
this.$store
.dispatch('user/loginByRole', { UserId, UserTypeId })
.then((res) => {
if (res) {
this.$store
.dispatch('permission/generateRoutes')
.then(async (res) => {
if (res && res.length > 0) {
resetRouter()
await this.$store.dispatch('global/getNoticeList')
this.$router.addRoutes(res)
this.toggleRoleLoading = false
if (this.loginType === 'DevOps') {
this.$router.replace({ path: res[0].path })
return
}
if (this.hasPermi(['role:radmin'])) {
this.$router.replace({ path: res[0].path })
return
}
if (
this.hasPermi(['role:pm', 'role:oa', 'role:admin', 'role:dev'])
) {
history.replaceState(null, null, '/trials/trials-inspection')
history.go(0)
} else {
history.replaceState(null, null, '/trials/trials-list')
history.go(0)
}
this.toggleRoleVisible = false
this.toggleRoleLoading = false
this.$EventBus.$emit('reload')
} else {
//
this.toggleRoleLoading = false
this.$message.warning(this.$t('login:message:login2'))
}
})
.catch((err) => {
this.toggleRoleLoading = false
})
} else {
this.toggleRoleLoading = false
}
})
.catch(() => {
this.toggleRoleLoading = false
})
},
//
async getInfo() {
try {
@ -180,6 +235,12 @@ export default {
break
case '4-4':
this.go('/system')
break
case '4-5':
this.$store.dispatch('user/getUserInfo').then((res) => {
this.toggleRoleVisible = true
})
break
case '1':
this.go('/trials/trials-inspection')
@ -230,33 +291,40 @@ export default {
overflow: hidden;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.el-breadcrumb__item {
font-size: 16px;
}
.leftMenu {
display: flex;
align-items: center;
padding-left: 20px;
img {
height: 28px;
margin-right: 10px;
}
span {
font-size: 20px;
position: relative;
top: -1px;
}
}
.right-menu,
.center-menu {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 100%;
// line-height: 70px;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 8px;
@ -274,9 +342,11 @@ export default {
}
}
}
.avatar-container {
display: inline-block;
margin-right: 200px;
.user-avatar {
margin-top: 5px;
width: 40px;
@ -284,12 +354,15 @@ export default {
border-radius: 10px;
}
}
.dropdown-container {
cursor: pointer;
.el-icon-caret-bottom {
font-size: 12px;
}
}
.el-dropdown-link {
color: #999c9e;
cursor: pointer;

View File

@ -5,51 +5,26 @@
<el-form :inline="true">
<!-- 项目类型 -->
<el-form-item :label="$t('trials:trials-list:form:trialType')">
<el-select
v-model="searchData.trialType"
style="width: 150px"
clearable
>
<el-option
v-for="item in $d.TrialType"
:key="item.id"
:label="item.label"
:value="item.value"
/>
<el-select v-model="searchData.trialType" style="width: 150px" clearable>
<el-option v-for="item in $d.TrialType" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 项目编号 -->
<el-form-item :label="$t('trials:trials-list:table:trialId')">
<el-input
v-model="searchData.TrialCode"
style="width: 100px"
clearable
/>
<el-input v-model="searchData.TrialCode" style="width: 100px" clearable />
</el-form-item>
<!-- 研究方案号 -->
<el-form-item :label="$t('trials:trials-list:table:researchNumber')">
<el-input
v-model="searchData.ResearchProgramNo"
style="width: 100px"
clearable
/>
<el-input v-model="searchData.ResearchProgramNo" style="width: 100px" clearable />
</el-form-item>
<!-- 试验名称 -->
<el-form-item :label="$t('trials:trials-list:table:experimentName')">
<el-input
v-model="searchData.ExperimentName"
style="width: 100px"
clearable
/>
<el-input v-model="searchData.ExperimentName" style="width: 100px" clearable />
</el-form-item>
<!-- Sponsor -->
<el-form-item :label="$t('trials:trials-list:table:sponsor')">
<el-input
v-model="searchData.SponsorName"
style="width: 100px"
clearable
/>
<el-input v-model="searchData.SponsorName" style="width: 100px" clearable />
</el-form-item>
<el-form-item>
@ -58,11 +33,7 @@
{{ $t("common:button:search") }}
</el-button>
<!-- Reset -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
{{ $t("common:button:reset") }}
</el-button>
<!-- Export -->
@ -79,12 +50,7 @@
</el-form>
<span style="margin-left: auto">
<!-- New -->
<el-button
v-hasPermi="['trials:trials-list:new']"
icon="el-icon-plus"
type="primary"
@click="handleNew"
>
<el-button v-hasPermi="['trials:trials-list:new']" icon="el-icon-plus" type="primary" @click="handleNew">
{{ $t("common:button:new") }}
</el-button>
</span>
@ -92,123 +58,59 @@
<!-- 项目列表 -->
<template slot="main-container">
<el-table
v-adaptive="{ bottomOffset: 60 }"
v-loading="listLoading"
:data="list"
stripe
height="100"
@sort-change="handleSortChange"
@row-click="handleDetail"
:default-sort="{ prop: 'createTime', order: 'descending' }"
>
<el-table v-adaptive="{ bottomOffset: 60 }" v-loading="listLoading" :data="list" stripe height="100"
@sort-change="handleSortChange" @row-click="handleDetail"
:default-sort="{ prop: 'createTime', order: 'descending' }">
<!-- <el-table-column type="selection" align="left" width="45" /> -->
<el-table-column width="40">
<template slot-scope="scope">
<i
v-if="!scope.row.AuthorizationEncrypt"
class="el-icon-warning-outline"
:title="$t('trials:trials-list:tipMessage:tipOne')"
style="color: red; font-size: 20px"
></i>
<i
v-if="
<i v-if="!scope.row.AuthorizationEncrypt" class="el-icon-warning-outline"
:title="$t('trials:trials-list:tipMessage:tipOne')" style="color: red; font-size: 20px"></i>
<i v-if="
scope.row.AuthorizationEncrypt &&
scope.row.AuthorizationDate &&
!trialExpired(scope.row.AuthorizationDate, 15)
"
class="el-icon-warning-outline"
:title="$t('trials:trials-list:tipMessage:tipTwo')"
style="color: #e6a23c; font-size: 20px"
></i>
<i
v-if="
" class="el-icon-warning-outline" :title="$t('trials:trials-list:tipMessage:tipTwo')"
style="color: #e6a23c; font-size: 20px"></i>
<i v-if="
scope.row.AuthorizationEncrypt &&
scope.row.AuthorizationDate &&
!trialExpired(scope.row.AuthorizationDate)
"
class="el-icon-warning-outline"
:title="$t('trials:trials-list:tipMessage:tipThree')"
style="color: red; font-size: 20px"
></i>
" class="el-icon-warning-outline" :title="$t('trials:trials-list:tipMessage:tipThree')"
style="color: red; font-size: 20px"></i>
</template>
</el-table-column>
<el-table-column
prop="trialType"
:label="$t('trials:trials-list:form:trialType')"
show-overflow-tooltip
>
<el-table-column prop="trialType" :label="$t('trials:trials-list:form:trialType')" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ $fd("TrialType", scope.row.TrialType) }}</span>
</template>
</el-table-column>
<el-table-column
prop="TrialCode"
:label="$t('trials:trials-list:table:trialId')"
show-overflow-tooltip
min-width="100"
sortable="custom"
/>
<el-table-column
prop="ResearchProgramNo"
:label="$t('trials:trials-list:table:researchNumber')"
show-overflow-tooltip
min-width="120"
sortable="custom"
/>
<el-table-column prop="TrialCode" :label="$t('trials:trials-list:table:trialId')" show-overflow-tooltip
min-width="100" sortable="custom" />
<el-table-column prop="ResearchProgramNo" :label="$t('trials:trials-list:table:researchNumber')"
show-overflow-tooltip min-width="120" sortable="custom" />
<el-table-column
prop="ExperimentName"
:label="$t('trials:trials-list:table:experimentName')"
show-overflow-tooltip
min-width="120"
sortable="custom"
/>
<el-table-column prop="ExperimentName" :label="$t('trials:trials-list:table:experimentName')"
show-overflow-tooltip min-width="120" sortable="custom" />
<el-table-column
prop="Sponsor"
:label="$t('trials:trials-list:table:sponsor')"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
prop="TrialStatusStr"
:label="$t('trials:trials-list:table:status')"
show-overflow-tooltip
sortable="custom"
>
<el-table-column prop="Sponsor" :label="$t('trials:trials-list:table:sponsor')" min-width="90"
show-overflow-tooltip sortable="custom" />
<el-table-column prop="TrialStatusStr" :label="$t('trials:trials-list:table:status')" show-overflow-tooltip
sortable="custom">
<template slot-scope="scope">
<el-tag
v-if="scope.row.TrialStatusStr === 'Initializing'"
type="info"
>{{ $fd("TrialStatusEnum", scope.row.TrialStatusStr) }}</el-tag
>
<el-tag
v-if="scope.row.TrialStatusStr === 'Ongoing'"
type="primary"
>{{ $fd("TrialStatusEnum", scope.row.TrialStatusStr) }}</el-tag
>
<el-tag
v-if="scope.row.TrialStatusStr === 'Completed'"
type="warning"
>{{ $fd("TrialStatusEnum", scope.row.TrialStatusStr) }}</el-tag
>
<el-tag
v-if="scope.row.TrialStatusStr === 'Stopped'"
type="danger"
>{{ $fd("TrialStatusEnum", scope.row.TrialStatusStr) }}</el-tag
>
<el-tag v-if="scope.row.TrialStatusStr === 'Initializing'" type="info">{{ $fd("TrialStatusEnum",
scope.row.TrialStatusStr) }}</el-tag>
<el-tag v-if="scope.row.TrialStatusStr === 'Ongoing'" type="primary">{{ $fd("TrialStatusEnum",
scope.row.TrialStatusStr) }}</el-tag>
<el-tag v-if="scope.row.TrialStatusStr === 'Completed'" type="warning">{{ $fd("TrialStatusEnum",
scope.row.TrialStatusStr) }}</el-tag>
<el-tag v-if="scope.row.TrialStatusStr === 'Stopped'" type="danger">{{ $fd("TrialStatusEnum",
scope.row.TrialStatusStr) }}</el-tag>
</template>
</el-table-column>
<!--阅片标准-->
<el-table-column
prop="CriterionTypeList"
:label="$t('trials:trials-list:table:CriterionTypeList')"
show-overflow-tooltip
v-if="hasPermi(['role:pm', 'role:pi', 'role:sr'])"
min-width="130"
>
<el-table-column prop="CriterionTypeList" :label="$t('trials:trials-list:table:CriterionTypeList')"
show-overflow-tooltip v-if="hasPermi(['role:pm', 'role:pi', 'role:sr'])" min-width="130">
<template slot-scope="scope">
<span>{{
scope.row.CriterionTypeList.map((item) =>
@ -218,38 +120,16 @@
</template>
</el-table-column>
<!--待提交访视数量-->
<el-table-column
prop="UnSubmitCount"
:label="$t('trials:trials-list:table:UnSubmitCount')"
show-overflow-tooltip
min-width="90"
v-if="hasPermi(['role:pm'])"
sortable="custom"
/>
<el-table-column prop="UnSubmitCount" :label="$t('trials:trials-list:table:UnSubmitCount')"
show-overflow-tooltip min-width="90" v-if="hasPermi(['role:pm'])" sortable="custom" />
<!--待阅片数量-->
<el-table-column
prop="UnReadCount"
:label="$t('trials:trials-list:table:UnReadCount')"
show-overflow-tooltip
min-width="90"
v-if="hasPermi(['role:pm', 'role:pi', 'role:sr'])"
sortable="custom"
/>
<el-table-column
prop="CreateTime"
:label="$t('trials:trials-list:table:createDate')"
show-overflow-tooltip
min-width="170"
sortable="custom"
/>
<el-table-column prop="UnReadCount" :label="$t('trials:trials-list:table:UnReadCount')" show-overflow-tooltip
min-width="90" v-if="hasPermi(['role:pm', 'role:pi', 'role:sr'])" sortable="custom" />
<el-table-column prop="CreateTime" :label="$t('trials:trials-list:table:createDate')" show-overflow-tooltip
min-width="170" sortable="custom" />
<!--到期日-->
<el-table-column
prop="AuthorizationDate"
:label="$t('trials:trials-list:table:dateAuthorized')"
show-overflow-tooltip
min-width="170"
sortable="custom"
/>
<el-table-column prop="AuthorizationDate" :label="$t('trials:trials-list:table:dateAuthorized')"
show-overflow-tooltip min-width="170" sortable="custom" />
<!--授权时长-->
<!-- <el-table-column
prop="AuthorizationDuration"
@ -260,122 +140,53 @@
<el-table-column label="" min-width="200" align="left" fixed="right">
<template slot-scope="scope">
<!-- 详情 -->
<el-button
v-hasPermi="['trials:trials-list:panel']"
circle
icon="el-icon-info"
:disabled="scope.row.IsDeleted"
:title="$t('trials:trials-list:action:panel')"
@click.stop="handleDetail(scope.row)"
/>
<el-button v-hasPermi="['trials:trials-list:panel']" circle icon="el-icon-info"
:disabled="scope.row.IsDeleted" :title="$t('trials:trials-list:action:panel')"
@click.stop="handleDetail(scope.row)" />
<!-- 编辑项目基本信息 -->
<el-button
v-hasPermi="['trials:trials-list:edit']"
circle
icon="el-icon-edit-outline"
:disabled="scope.row.IsDeleted"
:title="$t('trials:trials-list:action:edit')"
@click.stop="handleEdit(scope.row)"
/>
<el-button v-hasPermi="['trials:trials-list:edit']" circle icon="el-icon-edit-outline"
:disabled="scope.row.IsDeleted" :title="$t('trials:trials-list:action:edit')"
@click.stop="handleEdit(scope.row)" />
<!-- 修改项目状态 -->
<el-button
v-hasPermi="['trials:trials-list:status']"
circle
icon="el-icon-edit"
:disabled="scope.row.IsDeleted"
:title="$t('trials:trials-list:action:status')"
@click.stop="handleStatus(scope.row)"
/>
<el-button v-hasPermi="['trials:trials-list:status']" circle icon="el-icon-edit"
:disabled="scope.row.IsDeleted" :title="$t('trials:trials-list:action:status')"
@click.stop="handleStatus(scope.row)" />
<!-- 废除项目 -->
<el-button
v-hasPermi="['trials:trials-list:abolish']"
circle
icon="el-icon-delete"
:disabled="
scope.row.IsDeleted ||
<el-button v-hasPermi="['trials:trials-list:abolish']" circle icon="el-icon-delete" :disabled="scope.row.IsDeleted ||
scope.row.TrialStatusStr !== 'Initializing'
"
:title="$t('trials:trials-list:action:abolition')"
@click.stop="handleAbandon(scope.row)"
/>
" :title="$t('trials:trials-list:action:abolition')" @click.stop="handleAbandon(scope.row)" />
<!-- 激活 -->
<el-button
v-if="!scope.row.AuthorizationEncrypt"
v-hasPermi="['trials:trials-list:activate']"
circle
icon="el-icon-key"
:title="$t('trials:trials-list:action:activate')"
@click.stop="handleActivate(scope.row)"
/>
<el-button v-if="!scope.row.AuthorizationEncrypt" v-hasPermi="['trials:trials-list:activate']" circle
icon="el-icon-key" :title="$t('trials:trials-list:action:activate')"
@click.stop="handleActivate(scope.row)" />
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
</template>
<!-- 新增/编辑项目 -->
<el-dialog
v-if="dialogVisible"
:visible.sync="dialogVisible"
:title="title"
:fullscreen="true"
append-to-body
custom-class="base-dialog-wrapper"
>
<TrialForm
:trial-id="currentId"
@getList="getList"
@closeDialog="closeDialog"
/>
<el-dialog v-if="dialogVisible" :visible.sync="dialogVisible" :title="title" :fullscreen="true" append-to-body
custom-class="base-dialog-wrapper">
<TrialForm :trial-id="currentId" @getList="getList" @closeDialog="closeDialog" />
</el-dialog>
<!-- 修改项目状态 -->
<el-dialog
v-dialogDrag
v-if="statusVisible"
:visible.sync="statusVisible"
:close-on-click-modal="false"
:title="$t('trials:trials-list:dialogTitle:changeStatus')"
width="700px"
custom-class="base-dialog-wrapper"
append-to-body
>
<TrialStatusForm
:data="currentRow"
@close="closeStatusDialog"
@getList="getList"
/>
<el-dialog v-dialogDrag v-if="statusVisible" :visible.sync="statusVisible" :close-on-click-modal="false"
:title="$t('trials:trials-list:dialogTitle:changeStatus')" width="700px" custom-class="base-dialog-wrapper"
append-to-body>
<TrialStatusForm :data="currentRow" @close="closeStatusDialog" @getList="getList" />
</el-dialog>
<el-dialog
v-if="doneDialogVisible"
:visible.sync="doneDialogVisible"
:title="doneTitle"
:fullscreen="true"
append-to-body
custom-class="base-dialog-wrapper"
>
<DoneList
:trial-id="currentId"
@getList="getList"
@closeDialog="doneDialogVisible = false"
/>
<el-dialog v-if="doneDialogVisible" :visible.sync="doneDialogVisible" :title="doneTitle" :fullscreen="true"
append-to-body custom-class="base-dialog-wrapper">
<DoneList :trial-id="currentId" @getList="getList" @closeDialog="doneDialogVisible = false" />
</el-dialog>
<!--项目激活-->
<activateProject
v-if="activateVisible"
:visible.sync="activateVisible"
:data="currentRow"
@getList="getList"
/>
<activateProject v-if="activateVisible" :visible.sync="activateVisible" :data="currentRow" @getList="getList" />
</BaseContainer>
</template>
<script>
@ -479,6 +290,11 @@ export default {
created() {
this.initPage();
},
mounted() {
this.$EventBus.$on('reload', (data) => {
window.location.reload()
})
},
methods: {
//
moment(data) {

View File

@ -186,10 +186,12 @@ export default {
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #d0d0d0;
}
display: flex;
flex-direction: column;
width: 100%;
@ -200,26 +202,31 @@ export default {
.workbench-stats {
height: 120px;
}
.workbench-content {
flex: 1;
overflow-y: auto;
.content-wrapper {
width: 100%;
height: 100%;
display: flex;
flex-flow: wrap;
padding: 5px;
.item {
width: 50%;
height: 500px;
padding: 5px;
box-sizing: border-box;
.el-card__body {
height: 100%;
}
}
}
}
.table-row__p {
color: #53646f;
font-size: 13px;
@ -227,16 +234,19 @@ export default {
line-height: 18px;
margin-bottom: 0px;
}
.table-row__span {
color: #9eabb4;
font-weight: 300;
font-size: 12px;
}
.el-row {
.el-col {
padding: 5px;
}
}
.status:before {
content: '';
margin-bottom: 0;
@ -246,6 +256,7 @@ export default {
margin-right: 7px;
border-radius: 50%;
}
.status--red:before {
background-color: #e36767;
}
@ -273,6 +284,7 @@ export default {
.status--green {
color: #6cdb56;
}
.status--green:before {
background-color: #6cdb56;
}
@ -280,9 +292,11 @@ export default {
.status--grey {
color: #9eabb4;
}
.status--grey:before {
background-color: #9eabb4;
}
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;