feat: 修改按钮权限

This commit is contained in:
2025-12-17 17:32:59 +08:00
parent c0237acfff
commit ff8b4e5cba

View File

@ -79,28 +79,30 @@
<template #controls="{ row }"> <template #controls="{ row }">
<!-- 01 提交 02 上报县局 03 上班市局 04 采纳 05 退回 06 打标签 07 转合成 08 转线索 09 转会商v-if="qxkz.deptLevel == '01'" --> <!-- 01 提交 02 上报县局 03 上班市局 04 采纳 05 退回 06 打标签 07 转合成 08 转线索 09 转会商v-if="qxkz.deptLevel == '01'" -->
<!-- 在提交和退回得状态才能进行上报 --> <!-- 在提交和退回得状态才能进行上报 -->
<el-link size="small" type="primary" @click="appearNewspapers(row)">上报</el-link> <el-link v-if="isShowBtn('上报')" size="small" type="primary" @click="appearNewspapers(row)">上报</el-link>
<!-- 只有上报状态才能进行采纳 --> <!-- 只有上报状态才能进行采纳 -->
<el-link size="small" type="primary" @click="cnMsg(row)">采纳</el-link> <el-link v-if="isShowBtn('采纳')" size="small" type="primary" @click="cnMsg(row)">采纳</el-link>
<!-- 只有上报状态才能回退 --> <!-- 只有上报状态才能回退 -->
<el-link size="small" type="primary" @click="rollbackNewspapers(row)">回退</el-link> <el-link v-if="isShowBtn('回退')" size="small" type="primary" @click="rollbackNewspapers(row)">回退</el-link>
<!-- 只有采纳状态才能分组 --> <!-- 只有采纳状态才能分组 -->
<el-link size="small" type="primary" @click="opneMsg(row)">分组</el-link> <el-link v-if="isShowBtn('分组')" size="small" type="primary" @click="opneMsg(row)">分组</el-link>
<!-- 所有状态都能进行转线索 --> <!-- 所有状态都能进行转线索 -->
<el-link size="small" type="primary" @click="FollowUpOnLeads(row)" >转线索</el-link> <el-link v-if="isShowBtn('转线索')" size="small" type="primary" @click="FollowUpOnLeads(row)">转线索</el-link>
<!-- 所有状态都能进行转合成 --> <!-- 所有状态都能进行转合成 -->
<el-link size="small" type="primary" @click="openFkDialogszl(row)">转合成</el-link> <el-link v-if="isShowBtn('转合成')" size="small" type="primary" @click="openFkDialogszl(row)">转合成</el-link>
<!-- 所有状态都能进行转会商 --> <!-- 所有状态都能进行转会商 -->
<el-link size="small" type="primary" @click="addEdit('info', row)" v-if="qxkz.depBool">转会商</el-link> <el-link v-if="isShowBtn('转会商')" size="small" type="primary" @click="addEdit('info', row)">转会商</el-link>
<!-- 只有领导有肯定 --> <!-- 只有领导有肯定 -->
<el-link size="small" type="primary" @click="affirm(row)" v-if="qxkz.roleCode">肯定</el-link> <el-link v-if="isShowBtn('肯定')" size="small" type="primary" @click="affirm(row)">肯定</el-link>
<el-link size="small" type="primary" @click="FollowUpOnDept(row)">关注部门</el-link> <el-link v-if="isShowBtn('关注部门')" size="small" type="primary" @click="FollowUpOnDept(row)">关注部门</el-link>
<!-- 市局能给所有数据创建标签 --> <!-- 市局能给所有数据创建标签 -->
<el-link size="small" type="primary" @click="openCustomTag(row)">创建</el-link> <el-link v-if="isShowBtn('创建标签')" size="small" type="primary" @click="openCustomTag(row)">创建</el-link>
<el-link size="small" type="danger" @click="delDictItem(row.id)">删除</el-link>
<el-link size="small" type="primary" @click="addEdit('edit', row)">修改</el-link> <el-link v-if="isShowBtn('删除')" size="small" type="danger" @click="delDictItem(row.id)">删除</el-link>
<el-link size="small" type="primary" @click="addEdit('info', row)">详情</el-link>
<el-link v-if="isShowBtn('修改')" size="small" type="primary" @click="addEdit('edit', row)">修改</el-link>
<el-link v-if="isShowBtn('详情')" size="small" type="primary" @click="addEdit('info', row)">详情</el-link>
</template> </template>
</MyTable> </MyTable>
@ -131,7 +133,7 @@
@getList="getList" /> @getList="getList" />
<Fszl v-model="fszlShow" path="/xxcj/sendFqzl" :itemData="dataList" /> <Fszl v-model="fszlShow" path="/xxcj/sendFqzl" :itemData="dataList" />
<CustomTag v-model="customTagShow" :dataList="dataList" @getList="getList" :dict="{ D_XXCJ_BQLX }" /> <CustomTag v-model="customTagShow" :dataList="dataList" @getList="getList" :dict="{ D_XXCJ_BQLX }" />
<Configuration v-model="configurationShow" :dataList="dataList" @getList="getList" /> <Configuration v-model="configurationShow" :dataList="dataList" @getList="getList" />
</template> </template>
<script setup> <script setup>
@ -174,7 +176,7 @@ const chooseData = (val) => {
const isShow = ref(false) const isShow = ref(false)
const searchConfiger = ref([ const searchConfiger = ref([
{ label: "情报标题", prop: 'qbmc', placeholder: "请输入情报标题", showType: "input" }, { label: "情报标题", prop: 'qbmc', placeholder: "请输入情报标题", showType: "input" },
{ label: "标签级别", prop: 'qbjb', placeholder: "请选择标签级别", showType: "select",options:D_BZ_BQJB}, { label: "标签级别", prop: 'qbjb', placeholder: "请选择标签级别", showType: "select", options: D_BZ_BQJB },
{ label: "情报处置状态", prop: 'lczt', placeholder: "请选择处置状态", showType: "select", options: D_BZ_LCZT }, { label: "情报处置状态", prop: 'lczt', placeholder: "请选择处置状态", showType: "select", options: D_BZ_LCZT },
{ label: "线索编号", prop: 'xsBh', placeholder: "请输入线索编号", showType: "input" }, { label: "线索编号", prop: 'xsBh', placeholder: "请输入线索编号", showType: "input" },
{ label: "关键字", prop: 'keyword', placeholder: "请输入关键字", showType: "input" }, { label: "关键字", prop: 'keyword', placeholder: "请输入关键字", showType: "input" },
@ -233,7 +235,7 @@ const rollbackNewspapers = (item) => {
if (item.lczt == '04') { if (item.lczt == '04') {
proxy.$message({ proxy.$message({
message: '已经采纳的信息无法回退', message: '已经采纳的信息无法回退',
type: 'warning', type: 'warning',
showClose: true, showClose: true,
@ -274,7 +276,7 @@ const rollbackNewspapers = (item) => {
} }
// 上报 // 上报
const appearNewspapers = (item) => { const appearNewspapers = (item) => {
if ((item.lczt == '01' || item.lczt == '05'||item.lczt == '02') && item.qbjb == '00' && qxkz.deptLevel != '01') { if ((item.lczt == '01' || item.lczt == '05' || item.lczt == '02') && item.qbjb == '00' && qxkz.deptLevel != '01') {
proxy.$confirm("确定要上报", "警告", { type: "warning" }).then(() => { proxy.$confirm("确定要上报", "警告", { type: "warning" }).then(() => {
let promes = {} let promes = {}
if (qxkz.deptLevel == '02') { if (qxkz.deptLevel == '02') {
@ -304,8 +306,10 @@ const opneMsg = (item) => {
// 打标签 // 打标签
const customTagShow = ref(false) const customTagShow = ref(false)
const openCustomTag = (item) => { const openCustomTag = (item) => {
if (qxkz.depBool) { customTagShow.value = true if (qxkz.depBool) {
dataList.value = item }else { customTagShow.value = true
dataList.value = item
} else {
proxy.$message.warning('暂无权限') proxy.$message.warning('暂无权限')
} }
@ -325,8 +329,8 @@ const affirm = (item) => {
const configurationShow = ref(false) const configurationShow = ref(false)
const FollowUpOnDept = (item) => { const FollowUpOnDept = (item) => {
if (qxkz.depBool) { if (qxkz.depBool) {
configurationShow.value = true configurationShow.value = true
dataList.value = item dataList.value = item
} else { } else {
proxy.$message.warning('暂无权限') proxy.$message.warning('暂无权限')
} }
@ -492,7 +496,7 @@ const tabHeightFn = () => {
} else { } else {
pageData.tableHeight = window.innerHeight - 250; pageData.tableHeight = window.innerHeight - 250;
} }
window.onresize = function () { window.onresize = function() {
tabHeightFn(); tabHeightFn();
}; };
}; };
@ -506,31 +510,60 @@ const FollowUpOnLeads = (row) => {
}) })
return return
} else { } else {
proxy.$confirm("确定要转线索吗?", "警告", { type: "warning" }).then(() => { proxy.$confirm("确定要转线索吗?", "警告", { type: "warning" }).then(() => {
xxcjXxzsx({ ids: Array.isArray(row) ? row.join(',') : row.id }).then(res => { xxcjXxzsx({ ids: Array.isArray(row) ? row.join(',') : row.id }).then(res => {
proxy.$message({ type: "success", message: "转线索成功" }); proxy.$message({ type: "success", message: "转线索成功" });
getList(); getList();
})
}) })
})
} }
} }
// 发送指令 // 发送指令
const fszlShow = ref(false) const fszlShow = ref(false)
const openFkDialogszl = (row) => { const openFkDialogszl = (row) => {
if (!qxkz.depBool) { if (!qxkz.depBool) {
proxy.$message({ proxy.$message({
message: '权限不足', message: '权限不足',
type: 'warning', type: 'warning',
showClose: true, showClose: true,
}) })
return return
} else { } else {
fszlShow.value = true fszlShow.value = true
dataList.value = row dataList.value = row
} }
} }
/** 获取当前角色 */
function getRole() {
const { deptBizType, deptLevel } = getItem('deptId')[0]
// JS_666666 市情指领导 JS_777777 市情指人员 JS_888888 县情指人员
/** 是否是市情指领导 */
const isShiQzLeader = getItem('roleList').find(item => item.roleCode == 'JS_666666') != undefined
if(isShiQzLeader) return '市情指领导'
/** 是否是市情指人员 */
const isShiQz = getItem('roleList').find(item => item.roleCode == 'JS_777777') != undefined
if(isShiQz) return '市情指挥人员'
/** 是否是县情指人员 */
const isXianQz = getItem('roleList').find(item => item.roleCode == 'JS_888888') != undefined
if(isXianQz) return '县情指人员'
return '部门'
}
/** 是否展示按钮 */
const isShowBtn = (btnName) => {
/** 按钮权限 */
const buttonPermissions = {
"市情指领导": ["肯定", "采纳", "回退", "分组", "转线索", "转合成", "转会商", "修改", "详情"],
"市情指挥人员": ["采纳", "回退", "分组", "转线索", "转合成", "转会商", "修改", "详情"],
"县情指人员": ["上报", "回退", "修改", "详情"],
"部门": ["上报", "新增", "修改", "续报"]
};
const role = getRole(); // 角色
return buttonPermissions[role]?.includes(btnName) || false;
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>