添加项目权限管理
This commit is contained in:
parent
674c32af90
commit
b1ee7c5f61
@ -56,6 +56,14 @@ export function deleteBatchProjects (queryParams:any){
|
||||
});
|
||||
}
|
||||
|
||||
//单个删除项目
|
||||
export function visibilityProjects (queryParams:any){
|
||||
return request({
|
||||
url:'/projects/'+queryParams.projectId+'/visibility' ,
|
||||
method: 'put',
|
||||
data: queryParams
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function topologyDevicesLsit(queryParams:any){
|
||||
|
||||
BIN
business-css/frontend/src/assets/table/permission.png
Normal file
BIN
business-css/frontend/src/assets/table/permission.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 653 B |
@ -7,7 +7,7 @@ export default {
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, nextTick } from "vue";
|
||||
import { ElForm, ElMessage, ElMessageBox } from "element-plus";
|
||||
import { searchProjectsLsit,addProjects,updateProjects,deleteProjects,deleteBatchProjects} from "@/api/business/project";
|
||||
import { searchProjectsLsit,addProjects,updateProjects,deleteProjects,deleteBatchProjects,visibilityProjects} from "@/api/business/project";
|
||||
import Page from '@/components/Pagination/page.vue'
|
||||
import ScenarioModel from '@/views/component/scenario/index.vue'
|
||||
import Antvx6 from '@/components/antvx6/index.vue'
|
||||
@ -79,7 +79,6 @@ function addClick() {
|
||||
}
|
||||
//新建项目-确认按钮/修改按钮
|
||||
function confirmClick(formEl: any) {
|
||||
console.log(info.value)
|
||||
formEl.validate((valid: any) => {
|
||||
if (valid) {
|
||||
|
||||
@ -110,11 +109,27 @@ function confirmClick(formEl: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmVisibilityClick() {
|
||||
const params = {
|
||||
projectId: info.value.projectId,
|
||||
visibility: info.value.visibility,
|
||||
}
|
||||
visibilityProjects(params).then((res:any) => {
|
||||
if(res == true){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "操作成功",
|
||||
});
|
||||
}
|
||||
gettableData();
|
||||
dialogPermissionVisible.value = false;
|
||||
});
|
||||
}
|
||||
//取消按钮
|
||||
function handleClose() {
|
||||
dialogVisible.value = false;
|
||||
isScenario.value = false;
|
||||
dialogPermissionVisible.value = false;
|
||||
if (infoForm.value != null) infoForm.value.resetFields();
|
||||
}
|
||||
//新建项目
|
||||
@ -128,6 +143,11 @@ function editClick(row: any) { // 打开修改项目弹窗
|
||||
info.value = JSON.parse(JSON.stringify(row));
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
const dialogPermissionVisible = ref(false);
|
||||
function permissionClick(row: any) { // 打开权限设置
|
||||
info.value = JSON.parse(JSON.stringify(row));
|
||||
dialogPermissionVisible.value = true;
|
||||
}
|
||||
function designClick(row: any) { // 打开分析设计
|
||||
info.value = JSON.parse(JSON.stringify(row));
|
||||
isShowAntvx6.value = true;
|
||||
@ -254,6 +274,10 @@ function closeAntvx6() {
|
||||
<img src="@/assets/table/simulation.png" alt="" title="模拟分析"
|
||||
@click="simulationClick(scope.row)"
|
||||
style="cursor: pointer; ">
|
||||
|
||||
<img src="@/assets/table/permission.png" alt="" title="权限设置"
|
||||
style="cursor: pointer; " @click="permissionClick(scope.row)">
|
||||
|
||||
<a :href=" apiUrl + '/projects/' + scope.row.projectId + '/exportProject'" target="_blank" rel="noopener noreferrer">
|
||||
<img src="@/assets/table/export.png" alt="" title="导出项目工程"
|
||||
style="cursor: pointer; ">
|
||||
@ -289,6 +313,29 @@ function closeAntvx6() {
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="dialogPermissionVisible" :close-on-click-modal="false"
|
||||
:modal="false" draggable :before-close="handleClose" :title="'权限管理'"
|
||||
append-to-body width="620px" height="600px">
|
||||
<el-form ref="infoForm" :model="info" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称:" prop="name">
|
||||
<el-input v-model="info.name" style="width: 100%" placeholder="输入项目名称" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限类型:" prop="visibility">
|
||||
<el-radio-group v-model="info.visibility" style="display: flex;">
|
||||
<el-radio label="PRIVATE">私有</el-radio>
|
||||
<el-radio label="PUBLIC">公开</el-radio>
|
||||
<el-radio label="READONLY">只读</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<span class="dialog-footer"
|
||||
style="display: flex;display: -webkit-flex; justify-content: flex-end;-webkit-justify-content: flex-end;">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmVisibilityClick" v-if="username == 'admin' || 'PUBLIC' == info.visibility
|
||||
|| title == '新增项目'">确 定</el-button>
|
||||
</span>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="isScenario" :close-on-click-modal="false"
|
||||
:modal="false" draggable :before-close="handleClose" title="历史模拟分析"
|
||||
append-to-body width="1142px">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user