mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 15:26:48 +08:00
--fix 权限名单
This commit is contained in:
@@ -91,7 +91,35 @@
|
||||
:scroll="{ x: 700 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
>
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a-space align="start">
|
||||
<a-button v-if="record.status===0 || record.status===2 || record.status===-5" @click="handleEdit(record)" type="link">编辑</a-button>
|
||||
<a-button v-if="record.type===1" @click="createSub(record)" type="link">创建子项目</a-button>
|
||||
<a-button v-if="record.type===2" @click="createClass(record)" type="link">创建班级</a-button>
|
||||
<a-button v-if="record.status===0 && record.type===3" @click="showReviewModal(record.projectId)" type="link">提交审核</a-button>
|
||||
<a-button v-if="record.status===1 && record.type===3" @click="showRecallReviewModal(record.projectId)" type="link">撤回审核</a-button>
|
||||
<a-button v-if="record.status===2 && record.type===3" @click="push(record)" type="link">发布</a-button>
|
||||
<a-button v-if="record.status===3 && record.type===3" @click="showBackModal(record.projectId)" type="link">撤回发布</a-button>
|
||||
<a-button v-if="record.status===3 && record.type===3" @click="manage(record)" type="link">管理</a-button>
|
||||
<DropDown value="授权">
|
||||
<OwnerTableModelStudent :types="[4,5,6]" :id="record.projectId" :type="6">权限名单</OwnerTableModelStudent>
|
||||
<CommonStudent :type="4" :id="record.projectId" title="查看权">查看权</CommonStudent>
|
||||
<CommonStudent :type="5" :id="record.projectId" title="管理权">管理权</CommonStudent>
|
||||
</DropDown>
|
||||
<DropDown value="更多">
|
||||
<a-button @click="showCopyModal(record.projectId)" type="link">复制</a-button>
|
||||
<a-button v-if="record.status!==3" @click="showDeleteModal(record.projectId)" type="link" danger>删除</a-button>
|
||||
<a-button v-if="record.status===3" @click="showStartModal(record.projectId)" type="link">存为模版</a-button>
|
||||
<a-button v-if="record.status===3 && record.type===3" @click="showStopModal(record.projectId)" type="link">结束</a-button>
|
||||
<a-button v-if="record.status===-1 && record.type===3" @click="showBackFinashModal(record.projectId)" type="link">撤回</a-button>
|
||||
<a-button v-if="record.status!==3 && record.type===3" @click="baseInfo(record)" type="link">基础信息</a-button>
|
||||
</DropDown>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<div class="tableBox">
|
||||
<div class="pa">
|
||||
@@ -837,7 +865,8 @@ import * as moment from "moment";
|
||||
import NameInput from "@/components/project/NameInput";
|
||||
import { validateName } from "@/api/index1";
|
||||
import CommonStudent from "@/components/student/CommonStudent";
|
||||
import TableModelStudent from "@/components/student/TableModelStudent";
|
||||
import OwnerTableModelStudent from "@/components/student/OwnerTableModelStudent";
|
||||
import DropDown from "@/components/common/DropDown";
|
||||
|
||||
export default {
|
||||
name: "projectManage",
|
||||
@@ -847,10 +876,11 @@ export default {
|
||||
ProjCheckShip,
|
||||
NameInput,
|
||||
ProjectManager,
|
||||
// ProjectClass,
|
||||
OrgClass,
|
||||
TrainClass,
|
||||
// ProjManageShip
|
||||
CommonStudent,
|
||||
OwnerTableModelStudent,
|
||||
DropDown,
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
@@ -1397,265 +1427,9 @@ export default {
|
||||
dataIndex: "operation",
|
||||
key: "operation",
|
||||
width: 300,
|
||||
align: "center",
|
||||
align: "right",
|
||||
fixed: "right",
|
||||
customRender: (value) => {
|
||||
// console.log("value", value.record.type, value.record.status);
|
||||
return (
|
||||
<div className="operation">
|
||||
{value.record.status === 0 ||
|
||||
value.record.status === 2 ||
|
||||
value.record.status === -5 ? (
|
||||
<span
|
||||
onClick={() => {
|
||||
if (value.record.type === 1 || value.record.type === 2) {
|
||||
state.doublepro = true;
|
||||
state.projectInfo = value.record;
|
||||
} else {
|
||||
console.log(value.record);
|
||||
router.push({
|
||||
path: "/projectadd",
|
||||
query: {
|
||||
projectId: value.record.projectId,
|
||||
parentId: value.record.parentId,
|
||||
parentName: value.record.parentName,
|
||||
},
|
||||
});
|
||||
}
|
||||
}}
|
||||
style="cursor:pointer;"
|
||||
className="operation1"
|
||||
>
|
||||
编辑
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 0 && value.record.type === 3 ? (
|
||||
<span
|
||||
onClick={() => {
|
||||
showReviewModal(value.record.projectId);
|
||||
}}
|
||||
style="cursor:pointer"
|
||||
class="operation3"
|
||||
>
|
||||
提交审核
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 1 && value.record.type === 3 ? (
|
||||
<span
|
||||
onClick={() => {
|
||||
showRecallReviewModal(value.record.projectId);
|
||||
}}
|
||||
style="cursor:pointer"
|
||||
class="operation3"
|
||||
>
|
||||
撤回审核
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 2 && value.record.type === 3 ? (
|
||||
<span
|
||||
onClick={() => {
|
||||
let time =
|
||||
value.record.beginTime + "-" + value.record.endTime;
|
||||
let obj = {
|
||||
projectId: value.record.projectId,
|
||||
name: value.record.name,
|
||||
time: time,
|
||||
};
|
||||
showProjectPub(obj);
|
||||
}}
|
||||
style="cursor:pointer"
|
||||
class="operation3"
|
||||
>
|
||||
发布
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 3 && value.record.type === 3 ? (
|
||||
<div
|
||||
onClick={() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { projectId: value.record.projectId },
|
||||
});
|
||||
storage.set("projectId", value.record.projectId);
|
||||
}}
|
||||
>
|
||||
管理
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 3 && value.record.type === 3 ? (
|
||||
<span
|
||||
onClick={() => {
|
||||
showBackModal(value.record.projectId);
|
||||
}}
|
||||
style="cursor:pointer; margin-left: 21px; width:70px;"
|
||||
class="operation3"
|
||||
>
|
||||
撤回发布
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{
|
||||
<div className="tableSelect">
|
||||
<a-select style="width: 50px;" value="授权" dropdownClassName="tabledropdown">
|
||||
<a-select-option value="权限名单" label="权限名单">
|
||||
<TableModelStudent types={[4,5,6]} id={value.record.projectId}>权限名单</TableModelStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="查看权" label="查看权">
|
||||
<CommonStudent type={4} id={value.record.projectId}>查看权</CommonStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="管理权" label="管理权">
|
||||
<CommonStudent type={5} id={value.record.projectId}>管理权</CommonStudent>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
}
|
||||
{value.record.type === 1 ? (
|
||||
<span
|
||||
className="operation3"
|
||||
style="cursor: pointer"
|
||||
onClick={() => {
|
||||
state.projectInfo = {
|
||||
parentName: value.record.name,
|
||||
parentId: value.record.projectId,
|
||||
name: "",
|
||||
sourceBelongId: value.record.sourceBelongId,
|
||||
sourceBelongName: value.record.sourceBelongName,
|
||||
manager: value.record.manager,
|
||||
managerId: value.record.managerId,
|
||||
systemId: value.record.systemId,
|
||||
type: 2,
|
||||
};
|
||||
state.estabish = true;
|
||||
}}
|
||||
>
|
||||
创建子项目
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.type === 2 ? (
|
||||
<span
|
||||
className="operation3"
|
||||
style="cursor: pointer"
|
||||
onClick={() => {
|
||||
router.push({
|
||||
path: "/projectadd",
|
||||
query: {
|
||||
parentId: value.record.projectId,
|
||||
parentName:
|
||||
value.record.parentName + "——" + value.record.name,
|
||||
ptojectType: 3,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
创建班级
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<div className="tableSelect">
|
||||
<a-select
|
||||
style="width: 50px"
|
||||
value="更多"
|
||||
// options={state.projectNameList}
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option value="复制" label="复制">
|
||||
<div
|
||||
onClick={() => {
|
||||
showCopyModal(value.record.projectId);
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
{value.record.status !== 3 ? (
|
||||
<a-select-option value="删除" label="删除">
|
||||
<div
|
||||
onClick={() => {
|
||||
showDeleteModal(value.record.projectId);
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</div>
|
||||
</a-select-option>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.type === 3 ? (
|
||||
<a-select-option value="存为模版" label="存为模版">
|
||||
<div
|
||||
onClick={() => {
|
||||
showStartModal(value.record.projectId);
|
||||
}}
|
||||
>
|
||||
存为模版
|
||||
</div>
|
||||
</a-select-option>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status === 3 && value.record.type === 3 ? (
|
||||
<a-select-option value="结束" label="结束">
|
||||
<div
|
||||
onClick={() => {
|
||||
showStopModal(value.record.projectId);
|
||||
}}
|
||||
>
|
||||
结束
|
||||
</div>
|
||||
</a-select-option>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
{value.record.status === -1 && value.record.type === 3 ? (
|
||||
<a-select-option value="撤回" label="撤回">
|
||||
<div
|
||||
onClick={() => {
|
||||
showBackFinashModal(value.record.projectId);
|
||||
}}
|
||||
>
|
||||
撤回
|
||||
</div>
|
||||
</a-select-option>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{value.record.status !== 3 && value.record.type === 3 ? (
|
||||
<a-select-option value="基础信息" label="基础信息">
|
||||
<div
|
||||
onClick={() => {
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { projectId: value.record.projectId },
|
||||
});
|
||||
storage.set("projectId", value.record.projectId);
|
||||
}}
|
||||
>
|
||||
基础信息
|
||||
</div>
|
||||
</a-select-option>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</a-select>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
scopedSlots: {customRender: "action"}
|
||||
},
|
||||
]);
|
||||
const getTableDate = () => {
|
||||
@@ -1699,6 +1473,21 @@ export default {
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleEdit(record){
|
||||
if (record.type === 1 || record.type === 2) {
|
||||
state.doublepro = true;
|
||||
state.projectInfo = record;
|
||||
} else {
|
||||
router.push({
|
||||
path: "/projectadd",
|
||||
query: {
|
||||
projectId: record.projectId,
|
||||
parentId: record.parentId,
|
||||
parentName: record.parentName,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getTableDate();
|
||||
// 翻页
|
||||
@@ -1789,10 +1578,65 @@ export default {
|
||||
state.projectInfo.sourceBelongName = t;
|
||||
state.projectInfo.sourceBelongFullName = orgName;
|
||||
}
|
||||
function push(record){
|
||||
showProjectPub({
|
||||
projectId: record.projectId,
|
||||
name: record.name,
|
||||
time: record.beginTime + "-" + record.endTime,
|
||||
});
|
||||
}
|
||||
function manage(record){
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { projectId: record.projectId },
|
||||
});
|
||||
storage.set("projectId", record.projectId);
|
||||
}
|
||||
|
||||
function createSub(record){
|
||||
state.projectInfo = {
|
||||
parentName: record.name,
|
||||
parentId: record.projectId,
|
||||
name: "",
|
||||
sourceBelongId: record.sourceBelongId,
|
||||
sourceBelongName: record.sourceBelongName,
|
||||
manager: record.manager,
|
||||
managerId: record.managerId,
|
||||
systemId: record.systemId,
|
||||
type: 2,
|
||||
};
|
||||
state.estabish = true;
|
||||
}
|
||||
|
||||
function createClass(record){
|
||||
router.push({
|
||||
path: "/projectadd",
|
||||
query: {
|
||||
parentId: record.projectId,
|
||||
parentName: record.parentName + "——" + record.name,
|
||||
ptojectType: 3,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function baseInfo(record){
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: { projectId: record.projectId },
|
||||
});
|
||||
storage.set("projectId", record.projectId);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
dayjs,
|
||||
handleEdit,
|
||||
baseInfo,
|
||||
createClass,
|
||||
createSub,
|
||||
manage,
|
||||
push,
|
||||
moment,
|
||||
managerChange,
|
||||
reFinashedProject,
|
||||
@@ -2046,6 +1890,10 @@ export default {
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: #eff4fc;
|
||||
}
|
||||
th {
|
||||
background-color: #eff4fc !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
|
||||
Reference in New Issue
Block a user