@@ -0,0 +1,22 @@ | |||||
/** | |||||
* v-hasRole 角色权限处理 | |||||
*/ | |||||
import { useUserStore } from '@/store/modules/user' | |||||
export default { | |||||
mounted (el, binding, vnode) { | |||||
const { value } = binding | |||||
const roles = useUserStore().userInfo.userRoleInfoList | |||||
if (value && value instanceof Array && value.length > 0) { | |||||
const roleFlag = value | |||||
const hasRole = roles.some(role => { | |||||
return roleFlag.includes(role.name) | |||||
}) | |||||
if (!hasRole) { | |||||
el.parentNode && el.parentNode.removeChild(el) | |||||
} | |||||
} else { | |||||
throw new Error(`请设置角色权限标签值`) | |||||
} | |||||
} | |||||
} |
@@ -1,4 +1,6 @@ | |||||
import waterMarker from './waterMarker' | import waterMarker from './waterMarker' | ||||
import hasRole from './hasRole' | |||||
const directivesList = { | const directivesList = { | ||||
// 这里放指令 | // 这里放指令 | ||||
waterMarker // 水印指令 | waterMarker // 水印指令 | ||||
@@ -9,6 +11,8 @@ const directives = { | |||||
// 注册自定义指令 | // 注册自定义指令 | ||||
app.directive(key, directivesList[key]) | app.directive(key, directivesList[key]) | ||||
}) | }) | ||||
app.directive('hasRole', hasRole) | |||||
} | } | ||||
} | } | ||||
@@ -0,0 +1,27 @@ | |||||
/** | |||||
* v-hasPermi 操作权限处理 | |||||
*/ | |||||
import useUserStore from '@/store/modules/user' | |||||
export default { | |||||
mounted (el, binding, vnode) { | |||||
const { value } = binding | |||||
const all_permission = '*:*:*' | |||||
const permissions = useUserStore().roleList | |||||
if (value && value instanceof Array && value.length > 0) { | |||||
const permissionFlag = value | |||||
const hasPermissions = permissions.some(permission => { | |||||
return all_permission === permission || permissionFlag.includes(permission) | |||||
}) | |||||
if (!hasPermissions) { | |||||
el.parentNode && el.parentNode.removeChild(el) | |||||
} | |||||
} else { | |||||
throw new Error(`请设置操作权限标签值`) | |||||
} | |||||
} | |||||
} |
@@ -61,7 +61,8 @@ const props = defineProps({ | |||||
const res = await userList({ | const res = await userList({ | ||||
...pageParams, | ...pageParams, | ||||
...searchForm, | ...searchForm, | ||||
...props.params | |||||
...props.params, | |||||
scene: 1 | |||||
}) | }) | ||||
total.value = res.data.total | total.value = res.data.total | ||||
tableData.value = res.data.records || [] | tableData.value = res.data.records || [] | ||||
@@ -4,7 +4,6 @@ import { useRouter } from 'vue-router' | |||||
import { onMounted, reactive, ref, h, getCurrentInstance, watch } from 'vue' | import { onMounted, reactive, ref, h, getCurrentInstance, watch } from 'vue' | ||||
import { fileFormatVerification, handleFileSuccess, handleFileError } from '@/utils/uploadAction.js' | import { fileFormatVerification, handleFileSuccess, handleFileError } from '@/utils/uploadAction.js' | ||||
import { | import { | ||||
defer, | |||||
list, | list, | ||||
startDeclare, | startDeclare, | ||||
exportAnnualPlanEditTable, projectExcel | exportAnnualPlanEditTable, projectExcel | ||||
@@ -15,6 +14,7 @@ import ImportProjectDialog from './importProjectDialog.vue' | |||||
import ExportFieldDialog from './exportFieldDialog.vue' | import ExportFieldDialog from './exportFieldDialog.vue' | ||||
import useExportExc from '@/utils/useExportExc' | import useExportExc from '@/utils/useExportExc' | ||||
import { getIsShowRegionTree, getTreeParams } from '@/utils/getIsShowRegionTree' | import { getIsShowRegionTree, getTreeParams } from '@/utils/getIsShowRegionTree' | ||||
const { proxy } = getCurrentInstance(), | const { proxy } = getCurrentInstance(), | ||||
props = defineProps({ | props = defineProps({ | ||||
isTemporaryAugment: { | isTemporaryAugment: { | ||||
@@ -146,7 +146,7 @@ const { proxy } = getCurrentInstance(), | |||||
createOnMin: searchForm.times?.[0] || undefined, | createOnMin: searchForm.times?.[0] || undefined, | ||||
createOnMax: searchForm.times?.[1] || undefined, | createOnMax: searchForm.times?.[1] || undefined, | ||||
regionCode: areaCode.value || undefined, | regionCode: areaCode.value || undefined, | ||||
isTemporaryAugment: props.isTemporaryAugment, // 非补增 | |||||
// isTemporaryAugment: props.isTemporaryAugment, // 非补增 | |||||
times: undefined | times: undefined | ||||
}) | }) | ||||
data.value = res.data.records | data.value = res.data.records | ||||
@@ -255,17 +255,17 @@ const { proxy } = getCurrentInstance(), | |||||
router.push({ name: 'planEdit', query: { id: data.projectId }}) | router.push({ name: 'planEdit', query: { id: data.projectId }}) | ||||
}, | }, | ||||
// 暂缓 | // 暂缓 | ||||
projectDefer = (data) => { | |||||
proxy.$messageBox | |||||
.confirm(`是否暂缓【${data.projectName}】?`, '提示!', { | |||||
type: 'warning' | |||||
}) | |||||
.then(async () => { | |||||
await defer({ projectId: data.projectId }) | |||||
proxy.$message.success('暂缓成功!') | |||||
getTableData() | |||||
}) | |||||
}, | |||||
// projectDefer = (data) => { | |||||
// proxy.$messageBox | |||||
// .confirm(`是否暂缓【${data.projectName}】?`, '提示!', { | |||||
// type: 'warning' | |||||
// }) | |||||
// .then(async () => { | |||||
// await defer({ projectId: data.projectId }) | |||||
// proxy.$message.success('暂缓成功!') | |||||
// getTableData() | |||||
// }) | |||||
// }, | |||||
// 立项批复 | // 立项批复 | ||||
approvalDialogData = reactive({ | approvalDialogData = reactive({ | ||||
visible: false, | visible: false, | ||||
@@ -438,10 +438,12 @@ onMounted(async () => { | |||||
<el-button | <el-button | ||||
type="primary" | type="primary" | ||||
@click="search" | @click="search" | ||||
>查询</el-button> | |||||
>查询 | |||||
</el-button> | |||||
<el-button | <el-button | ||||
@click="reset" | @click="reset" | ||||
>重置</el-button> | |||||
>重置 | |||||
</el-button> | |||||
</div> | </div> | ||||
</el-form-item> | </el-form-item> | ||||
</el-col> | </el-col> | ||||
@@ -457,7 +459,8 @@ onMounted(async () => { | |||||
type="primary" | type="primary" | ||||
size="small" | size="small" | ||||
@click="startPlanDeclare" | @click="startPlanDeclare" | ||||
>{{ areaCode==='331181'?'列入年度计划':'开启方案申报' }}</el-button> | |||||
>{{ areaCode === '331181' ? '列入年度计划' : '开启方案申报' }} | |||||
</el-button> | |||||
</div> | </div> | ||||
<div class="flex items-center relative"> | <div class="flex items-center relative"> | ||||
<!-- <el-button | <!-- <el-button | ||||
@@ -490,7 +493,8 @@ onMounted(async () => { | |||||
type="primary" | type="primary" | ||||
plain | plain | ||||
size="small" | size="small" | ||||
>导入</el-button> | |||||
>导入 | |||||
</el-button> | |||||
<!-- <template #tip> | <!-- <template #tip> | ||||
<div class="el-upload__tip">支持.xlsx、.xls</div> | <div class="el-upload__tip">支持.xlsx、.xls</div> | ||||
</template> --> | </template> --> | ||||
@@ -501,13 +505,15 @@ onMounted(async () => { | |||||
plain | plain | ||||
size="small" | size="small" | ||||
@click="exportEdit" | @click="exportEdit" | ||||
>导出编辑表</el-button> | |||||
>导出编辑表 | |||||
</el-button> | |||||
<el-button | <el-button | ||||
type="primary" | type="primary" | ||||
plain | plain | ||||
size="small" | size="small" | ||||
@click="showExportFieldDialog" | @click="showExportFieldDialog" | ||||
>导出</el-button> | |||||
>导出 | |||||
</el-button> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -521,8 +527,8 @@ onMounted(async () => { | |||||
@get-table-data="getTableData" | @get-table-data="getTableData" | ||||
> | > | ||||
<template #action="{ scope }"> | <template #action="{ scope }"> | ||||
<a v-if="scope.row.status===10010" @click="toEdit(scope.row)">编辑</a> | |||||
<a v-if="scope.row.status===10010" @click="projectDefer(scope.row)">暂缓</a> | |||||
<a v-if="scope.row.status===10010" v-hasRole="['超级管理员']" @click="toEdit(scope.row)">编辑</a> | |||||
<!-- <a v-if="scope.row.status===10010" @click="projectDefer(scope.row)">暂缓</a>--> | |||||
<a v-if="scope.row.status===10014" @click="showApprovalDialog(scope.row)">立项批复</a> | <a v-if="scope.row.status===10014" @click="showApprovalDialog(scope.row)">立项批复</a> | ||||
<a @click="router.push({name:'projectDetail',query:{id:scope.row.projectId}})">详情</a> | <a @click="router.push({name:'projectDetail',query:{id:scope.row.projectId}})">详情</a> | ||||
</template> | </template> | ||||
@@ -547,4 +553,5 @@ onMounted(async () => { | |||||
@close="closeExportFieldDialog" | @close="closeExportFieldDialog" | ||||
@export-project="exportProject" | @export-project="exportProject" | ||||
/> | /> | ||||
</template> | </template> |
@@ -86,6 +86,7 @@ const { proxy } = getCurrentInstance(), | |||||
const res = await userList({ | const res = await userList({ | ||||
...pageParams, | ...pageParams, | ||||
...searchForm, | ...searchForm, | ||||
scene: 2, | |||||
userRoleList: [{ id: searchForm.userRoleList }] | userRoleList: [{ id: searchForm.userRoleList }] | ||||
// regionId: import.meta.env.MODE === 'production' ? treeInfo.value && treeInfo.value.region || undefined : '330102' | // regionId: import.meta.env.MODE === 'production' ? treeInfo.value && treeInfo.value.region || undefined : '330102' | ||||
}) | }) | ||||
@@ -372,37 +372,37 @@ onMounted(async () => { | |||||
>驳回 | >驳回 | ||||
</el-button> | </el-button> | ||||
<el-button @click="router.go(-1)">返回</el-button> | <el-button @click="router.go(-1)">返回</el-button> | ||||
<el-dropdown | |||||
v-if="((flowData.canPass||flowData.canReject||flowData.canSeal)&&(flowData.processProgressVo.processDefName!=='申请延期审批流程')&&flowData.processProgressVo.processDefName!=='申请借阅审批流程')||isWithDraw()" | |||||
size="small" | |||||
type="primary" | |||||
class="ml-6" | |||||
> | |||||
<span class="el-dropdown-link"> | |||||
<span class="flex items-center more"> | |||||
<svg-icon name="moreIcon" class="mr-8" /> | |||||
<span>更多</span> | |||||
</span> | |||||
</span> | |||||
<template #dropdown> | |||||
<el-dropdown-menu> | |||||
<el-dropdown-item v-if="isWithDraw()"> | |||||
<el-button | |||||
plain | |||||
type="primary" | |||||
@click="withdraw" | |||||
>撤回</el-button> | |||||
</el-dropdown-item> | |||||
<el-dropdown-item v-if="(flowData.canPass||flowData.canReject||flowData.canSeal)&&flowData.processProgressVo.processDefName!=='申请延期审批流程'&&flowData.processProgressVo.processDefName!=='申请借阅审批流程'"> | |||||
<el-button | |||||
plain | |||||
type="danger" | |||||
@click="showDialog('退回','BACK')" | |||||
>退回</el-button> | |||||
</el-dropdown-item> | |||||
</el-dropdown-menu> | |||||
</template> | |||||
</el-dropdown> | |||||
<!-- <el-dropdown--> | |||||
<!-- v-if="((flowData.canPass||flowData.canReject||flowData.canSeal)&&(flowData.processProgressVo.processDefName!=='申请延期审批流程')&&flowData.processProgressVo.processDefName!=='申请借阅审批流程')||isWithDraw()"--> | |||||
<!-- size="small"--> | |||||
<!-- type="primary"--> | |||||
<!-- class="ml-6"--> | |||||
<!-- >--> | |||||
<!-- <span class="el-dropdown-link">--> | |||||
<!-- <span class="flex items-center more">--> | |||||
<!-- <svg-icon name="moreIcon" class="mr-8" />--> | |||||
<!-- <span>更多</span>--> | |||||
<!-- </span>--> | |||||
<!-- </span>--> | |||||
<!-- <template #dropdown>--> | |||||
<!-- <el-dropdown-menu>--> | |||||
<!-- <el-dropdown-item v-if="isWithDraw()">--> | |||||
<!-- <el-button--> | |||||
<!-- plain--> | |||||
<!-- type="primary"--> | |||||
<!-- @click="withdraw"--> | |||||
<!-- >撤回</el-button>--> | |||||
<!-- </el-dropdown-item>--> | |||||
<!-- <el-dropdown-item v-if="(flowData.canPass||flowData.canReject||flowData.canSeal)&&flowData.processProgressVo.processDefName!=='申请延期审批流程'&&flowData.processProgressVo.processDefName!=='申请借阅审批流程'">--> | |||||
<!-- <el-button--> | |||||
<!-- plain--> | |||||
<!-- type="danger"--> | |||||
<!-- @click="showDialog('退回','BACK')"--> | |||||
<!-- >退回</el-button>--> | |||||
<!-- </el-dropdown-item>--> | |||||
<!-- </el-dropdown-menu>--> | |||||
<!-- </template>--> | |||||
<!-- </el-dropdown>--> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -46,7 +46,7 @@ export default defineConfig(() => { | |||||
proxy: { | proxy: { | ||||
'/pm': { | '/pm': { | ||||
// 后台地址 | // 后台地址 | ||||
target: 'http://120.26.44.207:38888', | |||||
target: 'http://121.199.28.40:9089', | |||||
changeOrigin: true | changeOrigin: true | ||||
} | } | ||||
} | } | ||||