main
lijingjia 4 months ago
parent 45d8cb79fd
commit 5975ff5889

@ -13,8 +13,8 @@ VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666
VITE_DROP_CONSOLE = true
# 后台接口父地址(必填)
VITE_GLOB_API_URL=http://localhost:3008
# VITE_GLOB_API_URL="/api" # 开发 测试环境
# VITE_GLOB_API_URL=http://localhost:3008
VITE_GLOB_API_URL="/api" # 开发 测试环境
# File upload address optional
#VITE_GLOB_UPLOAD_URL=http://localhost:8091/api/Common/UploadFile

@ -7,6 +7,7 @@ enum Api {
getPermission = '/adminApi/Permission/GetPermissionInfo',
getPermissionTree = '/adminApi/Permission/GetPermissionTree',
getPermissionTreeList = '/adminApi/Permission/GetPermissionTreeList',
updatePerm = '/adminApi/Permission/UpdateTenantPermissionInfo'
}
export function getPermissionList(data: PageRequest) {
return request<DataResult>({
@ -47,3 +48,11 @@ export function getPermissionTreeList() {
// params: query,
})
}
export function updatePermission(data: any) {
return request<DataResult>({
url: Api.updatePerm,
method: 'post',
data,
})
}

@ -142,6 +142,15 @@ export const formSchema: FormSchema[] = [
extra: '权限名称必须唯一',
},
},
{
field: 'permissionEnName',
label: '权限英文名称',
component: 'Input',
colProps: { span: 12 },
itemProps: {
extra: '权限名称必须唯一',
}
},
{
field: 'parentId',
label: '上级权限',
@ -196,7 +205,7 @@ export const formSchema: FormSchema[] = [
label: '菜单图标',
colProps: { span: 12 },
component: 'IconPicker',
ifShow: ({ values }) => !isButton(values.menuType),
ifShow: ({ values }) => !isButton(values.menuType)
},
{
field: 'permissionType',
@ -251,6 +260,19 @@ export const formSchema: FormSchema[] = [
defaultValue: 1,
// ifShow: ({ values }) => !isButton(values.menuType),
},
{
field: 'isCache',
label: '是否缓存',
component: 'RadioGroup',
colProps: { span: 12 },
defaultValue: false,
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false }
]
}
},
{
field: 'note',
component: 'InputTextArea',

@ -1,3 +1,11 @@
<!--
* @Author: lijingjia lijj_xl@163.com
* @Date: 2024-07-03 09:12:56
* @LastEditors: lijingjia lijj_xl@163.com
* @LastEditTime: 2024-07-03 16:13:54
* @FilePath: \ds-admin-web\ds-wms-admin-web\src\views\system\permission\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<PageWrapper contentClass="flex">
<a-card :bordered="false" class="w-1/2 menu">
@ -22,13 +30,17 @@
</a-card>
<a-card title="权限信息" :bordered="false" class="w-1/2 menu" style="margin-left: 10px">
<BasicForm @register="registerForm" />
<div style="text-align: right; position: relative; top: -30px; right: 30px;">
<a-button style="margin-right: 10px;" type="primary" @click="updatePermissions"></a-button>
<a-button type="primary" @click="customSaveFunc"></a-button>
</div>
</a-card>
</PageWrapper>
</template>
<script lang="ts" setup>
import { defineComponent, onMounted, ref, unref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getPermissionTreeList, getPermission, editPermission } from '/@/api/system/permission'
import { getPermissionTreeList, getPermission, editPermission, updatePermission } from '/@/api/system/permission'
import { BasicTree } from '/@/components/Tree/index'
import { PageWrapper } from '/@/components/Page'
import { formSchema } from './columns'
@ -72,13 +84,14 @@
offset: 20,
},
showResetButton: false,
submitButtonOptions: {
preIcon: 'ant-design:save-outlined',
type: 'warning',
text: '保存',
},
submitFunc: customSaveFunc,
// showActionButtonGroup: false,
showSubmitButton: false
// submitButtonOptions: {
// preIcon: 'ant-design:save-outlined',
// type: 'warning',
// text: '',
// },
// submitFunc: customSaveFunc,
// showActionButtonGroup: true,
})
function handleSelect(checkedKeys, event) {
if (!event.selected) {
@ -99,6 +112,16 @@
// setFieldsValue({ ...event.selectedNodes[0] });
// expose.doRefresh();
}
async function updatePermissions() {
const value = await validate()
console.log(value)
const postData = {
id: value.id
}
updatePermission(postData).then(res => {
notification.success({ message: res.message, duration: 3 })
})
}
async function customSaveFunc() {
try {
await validate()

Loading…
Cancel
Save