工作量导出界面 增加权限控制
This commit is contained in:
parent
18191334e5
commit
2fc512a8dd
@ -17,14 +17,15 @@
|
||||
<el-button style="margin-left: 20px" @click="getdata()">查询</el-button>
|
||||
<el-button style="margin-left: 20px" @click="exportData()">导出</el-button>
|
||||
<el-button style="margin-left: 20px" @click="exportnowData()"
|
||||
>导出{{ Profilevo.doctorname }}工作量</el-button
|
||||
>导出{{ Profilevo.doctorname }}全部工作量</el-button
|
||||
>
|
||||
<el-button style="margin-left: 20px" @click="exportAllData()">导出全部</el-button>
|
||||
<el-button style="margin-left: 20px" @click="exportAllData()" v-if="power">导出全部</el-button>
|
||||
<el-select
|
||||
v-model="doctorvalue"
|
||||
clearable
|
||||
placeholder="请选择医生"
|
||||
style="margin-left: 20px; width: 180px"
|
||||
v-if="power"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
@ -51,10 +52,14 @@ import { EcganalysisparasApi } from '@/api/tblist/ecganalysisparas'
|
||||
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
||||
import { DiagnosisTemplateApi } from '@/api/applyregistration/diagnosisTemplate'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import * as ConfigApi from '@/api/infra/config' //李晓东
|
||||
|
||||
const Profilevo = ref<ProfileVO>({} as ProfileVO) //当前登录人信息
|
||||
const endDate = new Date()
|
||||
const startDate = new Date(endDate.getTime() - 7 * 24 * 3600 * 1000)
|
||||
const Date_value = ref<[Date, Date]>([startDate, endDate])
|
||||
const power = ref(false)
|
||||
|
||||
const getlogininfo = async () => {
|
||||
Profilevo.value = await getUserProfile()
|
||||
}
|
||||
@ -260,15 +265,29 @@ const calculateDailyDiagnosisCounts = (data: any[], dateArray: string[]) => {
|
||||
}
|
||||
|
||||
// 修改 onMounted
|
||||
onMounted(() => {
|
||||
getlogininfo()
|
||||
onMounted(async () => {
|
||||
await getlogininfo()
|
||||
getDoctorList()
|
||||
// 设置默认时间范围为当前日期往前7天
|
||||
const endDate = new Date()
|
||||
const startDate = new Date(endDate.getTime() - 6 * 24 * 3600 * 1000)
|
||||
Date_value.value = [startDate, endDate]
|
||||
exportpower()
|
||||
})
|
||||
|
||||
//p判断权限
|
||||
async function exportpower() {
|
||||
const data = await ConfigApi.getConfigKey('power.export')
|
||||
console.log(data)
|
||||
if (data) {
|
||||
console.log(Profilevo.value.doctorname)
|
||||
if (data.includes(Profilevo.value.doctorname)) {
|
||||
power.value = true
|
||||
} else {
|
||||
power.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
// 导出全部数据的方法
|
||||
async function exportAllData() {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user