添加权限设置

This commit is contained in:
limengnan 2026-04-02 16:09:18 +08:00
parent 86c7d1c7a9
commit 8b5f6ffc36
8 changed files with 47 additions and 47 deletions

View File

@ -1470,11 +1470,11 @@ const boundaryClick = () => {
<img src="@/assets/x6/reduce.png">
<div class="operation-icon-text">缩小</div>
</div>
<div class="operation-icon-box" @click="isDisplay = !isDisplay">
<!-- <div class="operation-icon-box" @click="isDisplay = !isDisplay">
<img v-if="isDisplay" src="@/assets/x6/display.png">
<img v-else src="@/assets/x6/hide.png">
<div class="operation-icon-text">显示</div>
</div>
</div> -->
<div class="operation-icon-box" style="width: 60px;" @click="boundaryClick">
<img v-if="!isBoundary" src="@/assets/x6/display.png">

View File

@ -253,9 +253,9 @@ function changeStatus(row: any) {
<el-button type="primary" style="margin-left: 10px" @click="gettableData">搜索</el-button>
</div>
<div style="display: flex;display: -webkit-flex;">
<el-button type="primary" @click="addClick">
<el-button type="primary" @click="addClick" v-hasPerm="['algorithm:add']">
新增</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" v-hasPerm="['algorithm:delete']"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
</div>
</div>
@ -272,7 +272,7 @@ function changeStatus(row: any) {
{{ dateFormat(scope.row.updatedAt) }}
</template>
</el-table-column>
<el-table-column prop="status" label="是否激活" width="90" align="center">
<el-table-column prop="status" label="是否激活" width="90" align="center" v-hasPerm="['algorithm:update']">
<template #default="scope">
<el-switch
v-model="scope.row.status"
@ -291,9 +291,9 @@ function changeStatus(row: any) {
<span
style="display: flex;display: -webkit-flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/table/edit.png" alt="" title="修改"
@click="editClick(scope.row)" style="cursor: pointer; ">
@click="editClick(scope.row)" style="cursor: pointer; " v-hasPerm="['algorithm:update']">
<img src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['algorithm:delete']">
</span>
</template>
</el-table-column>
@ -345,7 +345,7 @@ function changeStatus(row: any) {
<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="confirmClick(infoForm)"> </el-button>
<el-button type="primary" @click="confirmClick(infoForm)" v-hasPerm="['algorithm:update']"> </el-button>
</span>
</el-form>
</el-dialog>

View File

@ -187,7 +187,7 @@ function editClick(row: any) {
//
function delAloneClick(row: any) {
ElMessageBox.confirm("确定删除此算法数据吗?", "删除提示", {
ElMessageBox.confirm("确定删除此算法版本吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -252,7 +252,7 @@ onMounted(() => {
gettableData();
});
function changeStatus(row: any) {
ElMessageBox.confirm("确定是否激活此算法数据吗?", "激活提示", {
ElMessageBox.confirm("确定是否激活此算法版本吗?", "激活提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -302,7 +302,7 @@ function changeShowResult(isShow:boolean){ // 切换显示结果模型
<!-- <el-button type="primary" @click="addClick">
新增</el-button> -->
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['algorithmModel:delete']">删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableData" style="width: 100%; height: calc(100vh - 270px);margin-bottom: 10px;" border
@ -337,10 +337,10 @@ function changeShowResult(isShow:boolean){ // 切换显示结果模型
<img src="@/assets/table/view.png" alt="" title="查看详情"
@click="editClick(scope.row)" style="cursor: pointer; ">
<img src="@/assets/table/activate.png" alt="" title="是否激活"
@click="changeStatus(scope.row)" style="cursor: pointer; ">
@click="changeStatus(scope.row)" style="cursor: pointer; " v-hasPerm="['algorithmModel:activate']">
<img v-if="scope.row.isCurrent == 0" src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
<img v-else src="@/assets/table/del_disabled.png" alt="" title="删除">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['algorithmModel:delete']">
<img v-else src="@/assets/table/del_disabled.png" alt="" title="删除" v-hasPerm="['algorithmModel:delete']">
</span>
</template>
</el-table-column>

View File

@ -483,7 +483,7 @@ const objectSpanMethod = ({
<div style="display: flex;display: -webkit-flex;">
<el-button type="primary" style="margin-left: 10px" @click="gettableData">查询</el-button>
<el-button type="primary" @click="resetClick">重置</el-button>
<el-button type="primary" @click="addClick">新建训练任务</el-button>
<el-button type="primary" @click="addClick" v-hasPerm="['modelTrainTask:add']">新建训练任务</el-button>
</div>
</div>
@ -522,13 +522,13 @@ const objectSpanMethod = ({
@click="viewClick(scope.row)" style="cursor: pointer; ">
<img src="@/assets/table/release.png" alt="" title="发布模型" v-if="scope.row.status == 'Success'"
@click="releaseClick(scope.row)" style="cursor: pointer; ">
<img v-else src="@/assets/table/release_disabled.png" alt="" title="发布模型">
@click="releaseClick(scope.row)" style="cursor: pointer; " v-hasPerm="['modelTrainTask:release']">
<img v-else src="@/assets/table/release_disabled.png" alt="" title="发布模型" v-hasPerm="['modelTrainTask:release']">
<img v-if="scope.row.status == 'Success' ||scope.row.status == 'Failed' " src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
<img v-else src="@/assets/table/del_disabled.png" alt="" title="删除">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['modelTrainTask:delete']">
<img v-else src="@/assets/table/del_disabled.png" alt="" title="删除" v-hasPerm="['modelTrainTask:delete']">
</span>
</template>
</el-table-column>

View File

@ -78,7 +78,7 @@ function handleMenu(row:any) {
const infoForm = ref();
//
const input = ref("");
//
//
const title = ref("");
const info: any = ref({
@ -92,7 +92,7 @@ const info: any = ref({
const dialogVisible = ref(false);
function addClick() {
title.value = "新增设备";
title.value = "新增临界数据";
info.value = {
deviceType: queryParams.value.type,
diameter: null,
@ -105,7 +105,7 @@ function addClick() {
customAttrsData.value = []
dialogVisible.value = true;
}
//-/
//-/
function confirmClick(formEl: any) {
formEl.validate((valid: any) => {
if (valid) {
@ -160,21 +160,21 @@ function handleClose() {
dialogVisible.value = false;
if (infoForm.value != null) infoForm.value.resetFields();
}
//
//
const rules = ref({
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
name: [{ required: true, message: "请输入临界数据名称", trigger: "blur" }],
code: [{ required: true, message: "请输入临界数据编码", trigger: "blur" }],
});
//
//
function editClick(row: any) {
title.value = "修改设备";
title.value = "修改临界数据";
info.value = JSON.parse(JSON.stringify(row));
dialogVisible.value = true;
}
//
//
function delAloneClick(row: any) {
ElMessageBox.confirm("确定删除此设备吗?", "删除提示", {
ElMessageBox.confirm("确定删除此临界数据吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -196,7 +196,7 @@ function delAloneClick(row: any) {
//
function delClick() {
ElMessageBox.confirm("确定删除已选择设备吗?", "删除提示", {
ElMessageBox.confirm("确定删除已选择临界数据吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -295,11 +295,11 @@ onMounted(() => {
<div
style="display: flex;display: -webkit-flex; justify-content: space-between; -webkit-justify-content: space-between;margin-bottom: 10px">
<div style="display: flex;display: -webkit-flex;">
<!-- <el-input v-model="input" placeholder="请输入设备名称" @keyup.enter="gettableData" style="width: 200px" clearable />
<!-- <el-input v-model="input" placeholder="请输入临界数据名称" @keyup.enter="gettableData" style="width: 200px" clearable />
<el-button type="primary" style="margin-left: 10px" @click="gettableData">搜索</el-button> -->
</div>
<div style="display: flex;display: -webkit-flex;">
<el-button type="primary" @click="addClick">
<el-button type="primary" @click="addClick" v-hasPerm="['criticalData:add']">
新增</el-button>
<el-upload
ref="upload"
@ -312,10 +312,10 @@ onMounted(() => {
:before-upload="handlePreview"
:on-success="handlesSuccess"
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;">导入</el-button>
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['criticalData:import']">导入</el-button>
</el-upload>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['criticalData:delete']">删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableData" style="width: 100%; height: calc(100vh - 260px);margin-bottom: 10px;" border
@ -339,9 +339,9 @@ onMounted(() => {
<span
style="display: flex;display: -webkit-flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/table/edit.png" alt="" title="修改"
@click="editClick(scope.row)" style="cursor: pointer; ">
@click="editClick(scope.row)" style="cursor: pointer; " v-hasPerm="['criticalData:update']">
<img src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['criticalData:delete']">
</span>
</template>
</el-table-column>

View File

@ -350,11 +350,11 @@ onMounted(() => {
<el-button type="primary" style="margin-left: 10px" @click="gettableData">搜索</el-button>
</div>
<div style="display: flex;display: -webkit-flex;">
<el-button type="primary" @click="addClick">
<el-button type="primary" @click="addClick" v-hasPerm="['device:add']">
新增</el-button>
<el-upload
ref="upload"
accept=".xlsx,.xls"
accept=".xlsx,.xls" v-hasPerm="['device:import']"
class="upload-demo"
:data="{deviceType: queryParams.type}"
:action=" url + '/devices/import' "
@ -365,7 +365,7 @@ onMounted(() => {
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;">导入</el-button>
</el-upload>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" v-hasPerm="['device:delete']"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
</div>
</div>
@ -436,10 +436,10 @@ onMounted(() => {
<template #default="scope">
<span
style="display: flex;display: -webkit-flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/table/edit.png" alt="" title="修改"
<img src="@/assets/table/edit.png" alt="" title="修改" v-hasPerm="['device:update']"
@click="editClick(scope.row)" style="cursor: pointer; ">
<img src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['device:delete']">
</span>
</template>
</el-table-column>

View File

@ -313,7 +313,7 @@ onMounted(() => {
<el-button type="primary" style="margin-left: 10px" @click="gettableData">搜索</el-button>
</div>
<div style="display: flex;display: -webkit-flex;">
<el-button type="primary" @click="addClick">
<el-button type="primary" @click="addClick" v-hasPerm="['material:add']">
新增</el-button>
<el-upload
ref="upload"
@ -325,10 +325,10 @@ onMounted(() => {
:before-upload="handlePreview"
:on-success="handlesSuccess"
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;">导入</el-button>
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['material:import']">导入</el-button>
</el-upload>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['material:delete']">删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableData" style="width: 100%; height: calc(100vh - 260px);margin-bottom: 10px;" border
@ -348,10 +348,10 @@ onMounted(() => {
<template #default="scope">
<span
style="display: flex;display: -webkit-flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/table/edit.png" alt="" title="修改"
<img src="@/assets/table/edit.png" alt="" title="修改" v-hasPerm="['material:update']"
@click="editClick(scope.row)" style="cursor: pointer; ">
<img src="@/assets/table/del.png" alt="" title="删除"
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
@click="delAloneClick(scope.row)" style="cursor: pointer; " v-hasPerm="['material:delete']">
</span>
</template>
</el-table-column>

View File

@ -70,7 +70,7 @@ function confirmClick(formEl: any) {
});
return
}
if( isSonAlgorithmType != deviceData.value.length){
if( isSonAlgorithmType != deviceData.value.length && isAlgorithmType == true){
ElMessage({
type: "error",
message: "设备算法配置映射没有填写完全",