mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
feat:增加授权
This commit is contained in:
@@ -583,14 +583,42 @@
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 归属权抽屉 -->
|
||||
<owner-ship v-model:Ownervisible="Ownervisible" />
|
||||
<!-- <owner-ship v-model:Ownervisible="Ownervisible" /> -->
|
||||
<!-- 查看权抽屉 -->
|
||||
<query-right v-model:Queryvisible="Queryvisible" />
|
||||
<!-- <query-right v-model:Queryvisible="Queryvisible" /> -->
|
||||
<!-- 管理权抽屉 -->
|
||||
<manage-right v-model:Managevisible="Managevisible" />
|
||||
<!-- <manage-right v-model:Managevisible="Managevisible" /> -->
|
||||
<!-- 授权名单抽屉 -->
|
||||
<power-list v-model:PLvisible="PLvisible" :selectPathId="selectPathId" />
|
||||
<!-- <power-list v-model:PLvisible="PLvisible" :selectPathId="selectPathId" /> -->
|
||||
|
||||
<!-- 授权名单抽屉 -->
|
||||
<proj-power-list
|
||||
v-model:ProjPvisible="PLvisible"
|
||||
:selectProjectId="selectPathId"
|
||||
classify="learnPath"
|
||||
/>
|
||||
<!-- 归属权抽屉 -->
|
||||
<proj-owner-ship
|
||||
v-model:ProjOwnervisible="Ownervisible"
|
||||
:selectProjectId="selectPathId"
|
||||
classify="learnPath"
|
||||
/>
|
||||
<!-- 查看权抽屉 -->
|
||||
<proj-check-ship
|
||||
v-model:ProjCheckvisible="Queryvisible"
|
||||
:selectProjectId="selectPathId"
|
||||
v-model:addAuthList="addAuthList"
|
||||
:authClassify="authClassify"
|
||||
classify="learnPath"
|
||||
/>
|
||||
<!-- 管理权抽屉 -->
|
||||
<proj-check-ship
|
||||
v-model:ProjCheckvisible="Managevisible"
|
||||
:selectProjectId="selectPathId"
|
||||
v-model:addAuthList="addAuthList"
|
||||
:authClassify="authClassify"
|
||||
classify="learnPath"
|
||||
/>
|
||||
<!-- 创建路径loading -->
|
||||
|
||||
<!-- 更多背景图 v-model:visible="learnBgMore" -->
|
||||
@@ -638,12 +666,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, onMounted } from "vue";
|
||||
import { reactive, toRefs, onMounted, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import OwnerShip from "../../components/drawers/Ownership";
|
||||
import PowerList from "../../components/drawers/PowerList";
|
||||
import QueryRight from "../../components/drawers/QueryRight";
|
||||
import ManageRight from "../../components/drawers/ManageRight";
|
||||
// import OwnerShip from "../../components/drawers/Ownership";
|
||||
// import PowerList from "../../components/drawers/PowerList";
|
||||
// import QueryRight from "../../components/drawers/QueryRight";
|
||||
import ProjOwnerShip from "../../components/drawers/ProjectOwn";
|
||||
import ProjPowerList from "../../components/drawers/ProjPowerList";
|
||||
import ProjCheckShip from "../../components/drawers/ProjCheckPower";
|
||||
// import ManageRight from "../../components/drawers/ManageRight";
|
||||
import * as api from "../../api/index1";
|
||||
import { message } from "ant-design-vue";
|
||||
import {
|
||||
@@ -654,7 +685,16 @@ import {
|
||||
import { storage } from "../../api/storage";
|
||||
export default {
|
||||
name: "learningPath",
|
||||
components: { OwnerShip, PowerList, QueryRight, ManageRight },
|
||||
components: {
|
||||
// OwnerShip,
|
||||
// PowerList,
|
||||
// QueryRight,
|
||||
// ManageRight,
|
||||
ProjOwnerShip,
|
||||
|
||||
ProjPowerList,
|
||||
ProjCheckShip,
|
||||
},
|
||||
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
@@ -863,7 +903,9 @@ export default {
|
||||
lpLoading: false,
|
||||
learnBgMore: false, //是否显示更多学习路径背景
|
||||
|
||||
selectPathId: null, //选择的
|
||||
selectPathId: null, //选择授权的路径id
|
||||
addAuthList: null, //确定授权列表
|
||||
authClassify: null, //显示的是管理权还是查看权
|
||||
});
|
||||
const selectProjectName = (value, index) => {
|
||||
console.log("value", value, index);
|
||||
@@ -1038,17 +1080,22 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
const showOwner = () => {
|
||||
const showOwner = (id) => {
|
||||
state.Ownervisible = true;
|
||||
state.selectPathId = id;
|
||||
};
|
||||
const showPower = (id) => {
|
||||
state.PLvisible = true;
|
||||
state.selectPathId = id;
|
||||
};
|
||||
const showQuery = () => {
|
||||
const showQuery = (id) => {
|
||||
state.authClassify = 2;
|
||||
state.selectPathId = id;
|
||||
state.Queryvisible = true;
|
||||
};
|
||||
const showManage = () => {
|
||||
const showManage = (id) => {
|
||||
state.authClassify = 1;
|
||||
state.selectPathId = id;
|
||||
state.Managevisible = true;
|
||||
};
|
||||
const getTableDate = (tableData) => {
|
||||
@@ -1244,7 +1291,7 @@ export default {
|
||||
<a-select-option value="归属权" label="归属权">
|
||||
<div
|
||||
onClick={() => {
|
||||
showOwner();
|
||||
showOwner(text.record.id);
|
||||
}}
|
||||
>
|
||||
归属权
|
||||
@@ -1253,7 +1300,7 @@ export default {
|
||||
<a-select-option value="查看权" label="查看权">
|
||||
<div
|
||||
onClick={() => {
|
||||
showQuery();
|
||||
showQuery(text.record.id);
|
||||
}}
|
||||
>
|
||||
查看权
|
||||
@@ -1262,7 +1309,7 @@ export default {
|
||||
<a-select-option value="管理权" label="管理权">
|
||||
<div
|
||||
onClick={() => {
|
||||
showManage();
|
||||
showManage(text.record.id);
|
||||
}}
|
||||
>
|
||||
管理权
|
||||
@@ -1650,7 +1697,35 @@ export default {
|
||||
// console.log("执行");
|
||||
getLearnPath();
|
||||
});
|
||||
|
||||
//添加权限
|
||||
watch(
|
||||
() => state.addAuthList,
|
||||
(res) => {
|
||||
console.log("res", res, state.addAuthList);
|
||||
let obj = {
|
||||
type: 1,
|
||||
tag:
|
||||
state.authClassify === 1 ? 3 : state.authClassify === 2 ? 4 : null,
|
||||
opt: 3,
|
||||
deptList: res[1],
|
||||
groupList: res[2],
|
||||
refId: state.selectProjectId,
|
||||
pageNo: 20,
|
||||
pageSize: 1,
|
||||
studentList: res[0],
|
||||
};
|
||||
console.log("obj", obj);
|
||||
api
|
||||
.optionAuthPerm(obj)
|
||||
.then((res) => {
|
||||
console.log("添加授权成功", res);
|
||||
message.success("添加授权成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加授权失败", err);
|
||||
});
|
||||
}
|
||||
);
|
||||
return {
|
||||
...toRefs(state),
|
||||
selectProjectName,
|
||||
|
||||
Reference in New Issue
Block a user