Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -20,7 +20,7 @@ export const getRoleList = (params: Role.ReqRoleParams) => {
|
|||||||
|
|
||||||
// 新增角色
|
// 新增角色
|
||||||
export const addRole = (params: { id: string }) => {
|
export const addRole = (params: { id: string }) => {
|
||||||
return http.post(`${rePrefix}/role/add`, params)
|
return http.post(`/RoleList_Add`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量添加角色
|
// 批量添加角色
|
||||||
@@ -35,7 +35,7 @@ export const editRole = (params: { id: string }) => {
|
|||||||
|
|
||||||
// 删除角色
|
// 删除角色
|
||||||
export const deleteRole = (params: { id: string[] }) => {
|
export const deleteRole = (params: { id: string[] }) => {
|
||||||
return http.post(`${rePrefix}/role/delete`, params)
|
return http.post(`/RoleList_Del`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换角色状态
|
// 切换角色状态
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
<el-dialog :model-value="dialogVisible" :title="title" v-bind="dialogSmall" @close="handleCancel" width="500" draggable>
|
<el-dialog :model-value="dialogVisible" :title="title" v-bind="dialogSmall" @close="handleCancel" width="500" draggable>
|
||||||
<div>
|
<div>
|
||||||
<el-form :model="data">
|
<el-form :model="data">
|
||||||
<el-form-item label="角色类型名称" :label-width="100">
|
<el-form-item label="名称" :label-width="100">
|
||||||
<el-input v-model="data.rolename" placeholder="请输入类型名称" autocomplete="off" />
|
<el-input v-model="data.rolename" placeholder="请输入名称" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色类型编码" :label-width="100">
|
<el-form-item label="编码" :label-width="100">
|
||||||
<el-input v-model="data.id" placeholder="请输入角色类型编码" autocomplete="off" />
|
<el-input v-model="data.id" placeholder="请输入编码" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色类型状态" :label-width="100">
|
<el-form-item label="状态" :label-width="100">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model=value
|
v-model=value
|
||||||
inline-prompt
|
inline-prompt
|
||||||
@@ -18,15 +18,15 @@
|
|||||||
inactive-text="禁用"
|
inactive-text="禁用"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色类型备注" :label-width="100">
|
<el-form-item label="备注" :label-width="100">
|
||||||
<el-input v-model="data.describe" placeholder="请输入备注" autocomplete="off" />
|
<el-input v-model="data.describe" :rows="2" type="textarea" placeholder="请输入备注" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="handleCancel">取消</el-button>
|
<el-button @click="handleCancel">取消</el-button>
|
||||||
<el-button type="primary" @click="handleCancel">
|
<el-button type="primary" @click="handleOK">
|
||||||
保存
|
保存
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,8 +38,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref,computed } from 'vue'
|
import { ref,computed } from 'vue'
|
||||||
import {dialogSmall} from '@/utils/elementBind'
|
import {dialogSmall} from '@/utils/elementBind'
|
||||||
|
import {
|
||||||
|
addRole,
|
||||||
|
} from '@/api/role/role'
|
||||||
|
|
||||||
const {dialogVisible,title,data} = defineProps<{
|
const {dialogVisible,title,data,updataList} = defineProps<{
|
||||||
dialogVisible:boolean;
|
dialogVisible:boolean;
|
||||||
title:string;
|
title:string;
|
||||||
data:{
|
data:{
|
||||||
@@ -48,10 +51,15 @@
|
|||||||
status:number;
|
status:number;
|
||||||
describe:string;
|
describe:string;
|
||||||
}
|
}
|
||||||
|
updataList:Function
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get: () => data.status === 1,
|
get: () => {
|
||||||
|
if(title === '新增角色')
|
||||||
|
return true
|
||||||
|
data.status === 1
|
||||||
|
},
|
||||||
set: (value: boolean) => data.status = value ? 1 : 0
|
set: (value: boolean) => data.status = value ? 1 : 0
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -63,4 +71,14 @@
|
|||||||
emit('update:visible',false)
|
emit('update:visible',false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleOK = () => {
|
||||||
|
addRole(data).then(res => {
|
||||||
|
if(res.code === "200")
|
||||||
|
ElMessage.success(res.message)
|
||||||
|
|
||||||
|
updataList()
|
||||||
|
})
|
||||||
|
emit('update:visible',false)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
<!-- :requestApi="getRoleList" -->
|
<!-- :requestApi="getRoleList" -->
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增角色</el-button>
|
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增</el-button>
|
||||||
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出角色数据</el-button>
|
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出数据</el-button>
|
||||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||||
@click='batchDelete(scope.selectedListIds)'>
|
@click='batchDelete(scope.selectedListIds)'>
|
||||||
批量删除角色
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
:dialogVisible = roleUnitVisible
|
:dialogVisible = roleUnitVisible
|
||||||
:title = roleUnitTitle
|
:title = roleUnitTitle
|
||||||
:data = roleUnitData
|
:data = roleUnitData
|
||||||
|
:updataList = "updataList"
|
||||||
@update:visible="roleUnitVisible = $event"
|
@update:visible="roleUnitVisible = $event"
|
||||||
/>
|
/>
|
||||||
<permissionUnit
|
<permissionUnit
|
||||||
@@ -81,6 +82,8 @@
|
|||||||
|
|
||||||
//const roleData = roleDataList
|
//const roleData = roleDataList
|
||||||
const roleData = ref<Role.ResRoleList[]>([])
|
const roleData = ref<Role.ResRoleList[]>([])
|
||||||
|
|
||||||
|
function updataList() {
|
||||||
getRoleList({
|
getRoleList({
|
||||||
id: '',
|
id: '',
|
||||||
rolename: '',
|
rolename: '',
|
||||||
@@ -91,8 +94,13 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.code == '200') {
|
if(res.code == '200') {
|
||||||
roleData.value = res.data.list
|
roleData.value = res.data.list
|
||||||
|
|
||||||
|
console.log(11111);
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
updataList()
|
||||||
|
|
||||||
// ProTable 实例
|
// ProTable 实例
|
||||||
const proTable = ref<ProTableInstance>()
|
const proTable = ref<ProTableInstance>()
|
||||||
@@ -166,6 +174,7 @@
|
|||||||
const deleteAccount = async (params: Role.ResRoleList) => {
|
const deleteAccount = async (params: Role.ResRoleList) => {
|
||||||
await useHandleData(deleteRole, { id: [params.id] }, `删除【${params.rolename}】角色`)
|
await useHandleData(deleteRole, { id: [params.id] }, `删除【${params.rolename}】角色`)
|
||||||
proTable.value?.getTableList()
|
proTable.value?.getTableList()
|
||||||
|
updataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量删除角色信息
|
// 批量删除角色信息
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
>
|
>
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增用户')">新增用户</el-button>
|
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增用户')">新增</el-button>
|
||||||
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出用户数据</el-button>
|
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出数据</el-button>
|
||||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||||
@click='batchDelete(scope.selectedListIds)'>
|
@click='batchDelete(scope.selectedListIds)'>
|
||||||
批量删除角色
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<!-- :requestApi="getRoleList" -->
|
<!-- :requestApi="getRoleList" -->
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button type='primary' :icon='CirclePlus' >新增设备</el-button>
|
<el-button type='primary' :icon='CirclePlus' >新增</el-button>
|
||||||
<el-button type='primary' :icon='Download' plain >导出设备数据</el-button>
|
<el-button type='primary' :icon='Download' plain >导出数据</el-button>
|
||||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
||||||
批量删除设备
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<!-- :requestApi="getRoleList" -->
|
<!-- :requestApi="getRoleList" -->
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button type='primary' :icon='CirclePlus' >新增检测脚本</el-button>
|
<el-button type='primary' :icon='CirclePlus' >新增</el-button>
|
||||||
<el-button type='primary' :icon='Download' plain >导出脚本数据</el-button>
|
<el-button type='primary' :icon='Download' plain >导出数据</el-button>
|
||||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
||||||
批量删除脚本
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<!-- :requestApi="getRoleList" -->
|
<!-- :requestApi="getRoleList" -->
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button type='primary' :icon='CirclePlus' >新增检测源</el-button>
|
<el-button type='primary' :icon='CirclePlus' >新增</el-button>
|
||||||
<el-button type='primary' :icon='Download' plain >导出检测源数据</el-button>
|
<el-button type='primary' :icon='Download' plain >导出数据</el-button>
|
||||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
||||||
批量删除检测源
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user