mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 04:16:47 +08:00
--fix 权限名单
This commit is contained in:
@@ -96,12 +96,35 @@
|
||||
style="border: 1px solid #f2f6fe"
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="tableData"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
:loading="tableLoading"
|
||||
expandRowByClick="true"
|
||||
:scroll="{ x: 1550 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
/>
|
||||
>
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a-space>
|
||||
<a-button v-if="record.state==='草稿'" @click="showPub(record)" type="link">发布</a-button>
|
||||
<a-button v-if="record.state==='草稿'" @click="getLearnPathInfo(record.id)" type="link">编辑</a-button>
|
||||
<a-button v-if="record.state==='已发布'" @click="getLearnPathInfo(record.id)" type="link">编辑</a-button>
|
||||
<a-button @click="manage(record.id)" type="link">管理</a-button>
|
||||
<DropDown value="授权">
|
||||
<OwnerTableModelStudent :types="[7,8,9]" :id="record.id" :type="9">权限名单</OwnerTableModelStudent>
|
||||
<CommonStudent :type="7" :id="record.id" title="查看权">查看权</CommonStudent>
|
||||
<CommonStudent :type="8" :id="record.id" title="管理权">管理权</CommonStudent>
|
||||
</DropDown>
|
||||
<DropDown value="更多">
|
||||
<a-button @click="showCopyModal(record.id)" type="link">复制</a-button>
|
||||
<a-button @click="showDeleteModal(record.id)" type="link" danger>删除</a-button>
|
||||
<a-button v-if="record.state==='已发布'" @click="showBackModal(record.id)" type="link">撤回</a-button>
|
||||
<a-button v-if="record.state==='已发布'" @click="showStopModal(record.id)" type="link">结束</a-button>
|
||||
<a-button v-if="record.state==='已结束'" @click="showStartModal(record.id)" type="link">启用</a-button>
|
||||
</DropDown>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="tableBox">
|
||||
<div class="pa">
|
||||
@@ -706,26 +729,27 @@ import { useStore } from "vuex";
|
||||
import OrgClass from "@/components/project/OrgClass";
|
||||
import NameInput from "@/components/project/NameInput";
|
||||
import {validateName} from "@/api/index1";
|
||||
import DropDown from "@/components/common/DropDown";
|
||||
|
||||
|
||||
export default {
|
||||
name: "learningPath",
|
||||
components: {
|
||||
// OwnerShip,
|
||||
// PowerList,
|
||||
// QueryRight,
|
||||
// ManageRight,
|
||||
ProjOwnerShip,
|
||||
OrgClass,
|
||||
NameInput,
|
||||
ProjPowerList,
|
||||
ProjCheckShip,
|
||||
CommonStudent,
|
||||
OwnerTableModelStudent,
|
||||
DropDown
|
||||
},
|
||||
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
tableLoading: false,
|
||||
out: false,
|
||||
out1: false,
|
||||
number: null,
|
||||
@@ -948,7 +972,8 @@ export default {
|
||||
state.routeStudentsNum = null;
|
||||
};
|
||||
//显示复制窗口
|
||||
const showCopyModal = () => {
|
||||
const showCopyModal = (id) => {
|
||||
state.copyPathId = id;
|
||||
state.copyModal = true;
|
||||
};
|
||||
//关闭复制窗口
|
||||
@@ -981,7 +1006,8 @@ export default {
|
||||
};
|
||||
|
||||
//显示结束窗口
|
||||
const showStopModal = () => {
|
||||
const showStopModal = (id) => {
|
||||
state.stopPathId = id;
|
||||
state.stopModal = true;
|
||||
};
|
||||
//关闭结束窗口
|
||||
@@ -1013,7 +1039,8 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
const showDeleteModal = () => {
|
||||
const showDeleteModal = (id) => {
|
||||
state.deletePathId = id;
|
||||
state.deleteModal = true;
|
||||
};
|
||||
const closeDeleteModal = () => {
|
||||
@@ -1160,265 +1187,12 @@ export default {
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
className: "h",
|
||||
dataIndex: "opacation",
|
||||
key: "opacation",
|
||||
dataIndex: "operation",
|
||||
key: "operation",
|
||||
width: "20%",
|
||||
align: "center",
|
||||
align: "right",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: (text) => {
|
||||
// console.log(text);
|
||||
return (
|
||||
<div class="operation">
|
||||
<div class="nSelect">
|
||||
{text.record.state === "草稿" ? (
|
||||
<div class="fb">
|
||||
<div
|
||||
style="cursor:pointer"
|
||||
class="jc"
|
||||
onClick={() => {
|
||||
// console.log("text.record.", text.record);
|
||||
showPub(text.record);
|
||||
}}
|
||||
>
|
||||
发布
|
||||
</div>
|
||||
<div
|
||||
class="jc"
|
||||
onClick={() => {
|
||||
// console.log("text.record", text.record);
|
||||
|
||||
getLearnPathInfo(text.record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
{text.record.state === "已发布" ? (
|
||||
<div class="fb">
|
||||
<div
|
||||
class="jc"
|
||||
onClick={() => {
|
||||
// state.out1 = true;
|
||||
// state.pathName = text.record.manager;
|
||||
// // state.pathBg = "";
|
||||
// // state.organizationSelectName = null;
|
||||
// // state.organizationSelectId = null;
|
||||
// state.pathIntro = text.record.remark;
|
||||
// state.editPathId = text.record.id;
|
||||
}}
|
||||
></div>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
{
|
||||
// text.record.state === "未发布" ? (
|
||||
// <div class="fb">
|
||||
// <div
|
||||
// style="cursor:pointer"
|
||||
// class="jc"
|
||||
// onClick={() => {
|
||||
// showCopyModal();
|
||||
// }}
|
||||
// >
|
||||
// 复制
|
||||
// </div>
|
||||
// </div>
|
||||
// ) : (
|
||||
// <div></div>
|
||||
// )
|
||||
}
|
||||
</div>
|
||||
<div class="tableSelect">
|
||||
<div
|
||||
class="g1"
|
||||
onClick={() => {
|
||||
router.push({
|
||||
path: "/leveladd",
|
||||
});
|
||||
storage.set("routerId", text.record.id);
|
||||
}}
|
||||
>
|
||||
管理
|
||||
</div>
|
||||
{
|
||||
<a-select
|
||||
style="width: 50px;margin-top:2px;margin-left:25px"
|
||||
value="授权"
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option value="权限名单" label="权限名单">
|
||||
<OwnerTableModelStudent types={[7,8,9]} id={text.record.id} type={9}>权限名单</OwnerTableModelStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="查看权" label="查看权">
|
||||
<CommonStudent type={7} id={text.record.id}>查看权</CommonStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="管理权" label="管理权">
|
||||
<CommonStudent type={8} id={text.record.id}>管理权</CommonStudent>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
}
|
||||
</div>
|
||||
<div class="tableSelect">
|
||||
{text.record.state === "草稿" ? (
|
||||
<a-select
|
||||
style="width: 50px;margin-top:2px;margin-right:20px;"
|
||||
value="更多"
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option
|
||||
value="复制"
|
||||
label="复制"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.copyPathId = text.record.id;
|
||||
showCopyModal();
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
|
||||
<a-select-option
|
||||
value="删除"
|
||||
label="删除"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.deletePathId = text.record.id;
|
||||
// console.log("text.record", text.record);
|
||||
showDeleteModal();
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</div>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
{text.record.state === "已发布" ? (
|
||||
<div>
|
||||
<a-select
|
||||
style="width: 50px;margin-top:2px;margin-right:20px;"
|
||||
value="更多"
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option
|
||||
value="复制"
|
||||
label="复制"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.copyPathId = text.record.id;
|
||||
showCopyModal();
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
|
||||
<a-select-option
|
||||
value="撤回"
|
||||
label="撤回"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
showBackModal(text.record.id);
|
||||
}}
|
||||
>
|
||||
撤回
|
||||
</div>
|
||||
</a-select-option>
|
||||
<a-select-option
|
||||
value="结束"
|
||||
label="结束"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.stopPathId = text.record.id;
|
||||
showStopModal();
|
||||
}}
|
||||
>
|
||||
结束
|
||||
</div>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
{text.record.state === "已结束" ? (
|
||||
<div>
|
||||
<a-select
|
||||
style="width: 50px;margin-top:2px;margin-right:20px;"
|
||||
value="更多"
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option
|
||||
value="复制"
|
||||
label="复制"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.copyPathId = text.record.id;
|
||||
showCopyModal();
|
||||
}}
|
||||
>
|
||||
复制
|
||||
</div>
|
||||
</a-select-option>
|
||||
{/**
|
||||
<a-select-option
|
||||
value="启用"
|
||||
label="启用"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
showStartModal();
|
||||
}}
|
||||
>
|
||||
启用
|
||||
</div>
|
||||
</a-select-option>
|
||||
*/}
|
||||
|
||||
<a-select-option
|
||||
value="删除"
|
||||
label="删除"
|
||||
style="padding-left:35px"
|
||||
>
|
||||
<div
|
||||
onClick={() => {
|
||||
state.deletePathId = text.record.id;
|
||||
showDeleteModal();
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</div>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
scopedSlots: { customRender: "action" }
|
||||
},
|
||||
];
|
||||
return columns;
|
||||
@@ -1506,6 +1280,7 @@ export default {
|
||||
|
||||
//获取学习路径列表
|
||||
const getLearnPath = () => {
|
||||
state.tableLoading = true
|
||||
let obj = {
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
@@ -1532,6 +1307,7 @@ export default {
|
||||
}
|
||||
getTableDate(arr);
|
||||
state.tableDataTotal = Number(res.data.data.total);
|
||||
state.tableLoading = false
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -1569,45 +1345,6 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
//获取路径图详细信息
|
||||
const getLearnPathInfo = (id) => {
|
||||
// console.log("编辑学习路径图id", id);
|
||||
//获取学习路径详情
|
||||
api
|
||||
.getRouterDetail(id)
|
||||
.then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
console.log("获取学习路径详情成功", res.data.data);
|
||||
let detail = res.data.data.routerInfo;
|
||||
state.pathName = detail.name;
|
||||
state.pathBg = detail.picUrl;
|
||||
state.pathBgId = "";
|
||||
state.organizationSelectName = detail.organizationName;
|
||||
state.organizationSelectId = detail.organizationId;
|
||||
state.pathIntro = detail.remark;
|
||||
state.editPathId = id;
|
||||
let arr = imgData.value;
|
||||
arr.forEach((item) => {
|
||||
if (item.dictValue === state.pathBg) {
|
||||
state.pathBgId = item.dictCode;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//for (let i = 0; i < arr.length; i++) {
|
||||
// console.log("arr[i].dictValue", arr[i].dictValue, state.pathBg);
|
||||
// if (arr[i].dictValue === state.pathBg) {
|
||||
// state.pathBgId = arr[i].dictCode;
|
||||
|
||||
// }
|
||||
// }
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取详情失败", err);
|
||||
});
|
||||
state.out1 = true;
|
||||
};
|
||||
//编辑学习路径图
|
||||
const editLearnPath = async () => {
|
||||
if (!state.pathName) {
|
||||
@@ -1809,10 +1546,17 @@ export default {
|
||||
});
|
||||
}
|
||||
);
|
||||
function manage(id){
|
||||
router.push({
|
||||
path: "/leveladd",
|
||||
});
|
||||
storage.set("routerId", id);
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
imgData,
|
||||
manage,
|
||||
selectProjectName,
|
||||
expandTable,
|
||||
handleOut,
|
||||
@@ -2755,6 +2499,10 @@ export default {
|
||||
// position: absolute;
|
||||
// bottom: -40px;
|
||||
}
|
||||
th {
|
||||
background-color: #eff4fc !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
|
||||
.operation {
|
||||
|
||||
Reference in New Issue
Block a user