123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- import { ref,computed } from 'vue'
- import { useRoute } from 'vue-router'
- //ETA试用列表 表格column 和mock数据
- //ETA试用列表
- export const etaTrialColumn = [
- {
- key:'UserName',
- label:'姓名'
- },
- {
- key:'CompanyName',
- label:'公司名称'
- },{
- key:'Position',
- label:'职位',
- minWidth:'50'
- },{
- key:'Seller',
- label:'申请人',
- minWidth:'50'
- },{
- key:'Expiration',
- label:'账号到期时长',
- minWidth:'80'
- },{
- key:'ModifyTime',
- label:'账号更新时间',
- minWidth:'120'
- },{
- key:'LastLoginTime',
- label:'最近一次登录时间',
- minWidth:'120'
- },{
- key:'LastLoginDuration',
- label:'最近一次登录时长',
- },{
- key:'LoginNum',
- label:'累计登录次数',
- },{
- key:'ActiveTime',
- label:'累计活跃时长',
- },{
- key:'IndexNum',
- label:'累计添加指标',
- minWidth:'80'
- },
- {
- key:'ChartNum',
- label:'累计添加图表',
- minWidth:'80'
- },
- {
- key:'InterestModule',
- label:'感兴趣模块',
- minWidth:'140'
- }
- ]
- //管理员-审批列表 非管理员-我的审批
- export const adminApprovalList=[
- {
- key:'UserName',
- label:'姓名'
- },
- {
- key:'CompanyName',
- label:'公司名称'
- },{
- key:'Position',
- label:'职位',
- minWidth:'50'
- },
- {
- key:'Mobile',
- label:'手机号码',
- },{
- key:'Seller',
- label:'申请人',
- minWidth:'50'
- },{
- key:'ModifyTime',
- label:'提交申请时间',
- minWidth:'120'
- },{
- key:'ApprovalContent',
- label:'待审内容',
- },{
- key:'ApprovalStatus',
- label:'当前状态',
- }
- ]
- //非管理员-账号列表
- export const approvedList=[
- {
- key:'UserName',
- label:'姓名'
- },
- {
- key:'CompanyName',
- label:'公司名称'
- },{
- key:'Position',
- label:'职位',
- minWidth:'50'
- },
- {
- key:'Mobile',
- label:'手机号码',
- },{
- key:'Account',
- label:'账号',
- minWidth:'50'
- },{
- key:'Password',
- label:'密码',
- minWidth:'50'
- },{
- key:'Enabled',
- label:'用户状态',
- },{
- key:'Expiration',
- label:'账号到期时长',
- minWidth:'80'
- },{
- key:'ModifyTime',
- label:'更新时间',
- minWidth:'80'
- }
- ]
- //申请启用审批/申请账号审批
- export const applyApprovalList=[
- {
- key:'UserName',
- label:'姓名'
- },{
- key:'CompanyName',
- label:'公司名称'
- },{
- key:'Position',
- label:'职位'
- },{
- key:'Mobile',
- label:'手机号'
- },{
- key:'Seller',
- label:'申请人'
- }]
- //审批列表-当前状态
- /* export const ApprovalStatus = {
- 0:'未审批',
- 1:'已审批',
- 2:'已撤回',
- 3:'已驳回'
- } */
- export const ApprovalStatus={
- '待审批':0,
- '已审批':1,
- '已撤回':2,
- '驳回':3
- }
- //启用,账号重复提示弹窗
- export const textMap = {
- 0:'该用户账号已禁用,是否申请启用',
- 1:'该用户信息已提交申请 ,请勿重复提交'
- }
- export function useConfig() {
- const route = useRoute()
- const columnList = ref([])
- const canEdit = ref(false)
- const listType = sessionStorage.getItem('etaApprovalListType')||'all';
- const Role = computed(() => {
- return localStorage.getItem("Role");
- })
- let interenceName = ''
- if(route.path === '/etaTrialList') {
- columnList.value = etaTrialColumn
- canEdit.value = false
- interenceName = 'getETATrialList'
- }else if(route.path === '/etaApprovalList') {
- canEdit.value = true
- //管理员-审批列表
- if(Role.value.includes('admin')){
- columnList.value = adminApprovalList
- interenceName='getAdminApprovalList'
- }
- //非管理员-我的审批
- if(!Role.value.includes('admin')&&listType==='all'){
- columnList.value = adminApprovalList
- interenceName='getApprovalAllList'
- }
- //非管理员-账号列表
- if(!Role.value.includes('admin')&&listType!=='all'){
- columnList.value = approvedList
- interenceName='getApprovalList'
- }
- }
- return {
- columnList,
- canEdit,
- listType,
- interenceName,
- ApprovalStatus
- }
- }
|