统一crud接口名称

This commit is contained in:
qianlishi
2025-01-10 13:53:42 +08:00
parent 34c15d5b6e
commit 273e957ca0
2 changed files with 11 additions and 31 deletions

View File

@@ -17,7 +17,7 @@ export function getAuthorityTree(data = {}) {
}
// 列表查询数据
export function getPageList(params) {
export function toGetPageList(params) {
return http.request({
url: 'accessAuthority/pageList',
method: 'GET',
@@ -26,7 +26,7 @@ export function getPageList(params) {
}
// 新增
export function addAccessAuthority(data) {
export function toAddApi(data) {
return http.request({
url: 'accessAuthority',
method: 'post',
@@ -35,7 +35,7 @@ export function addAccessAuthority(data) {
}
// 修改
export function updateAccessAuthority(data) {
export function toUpdateApi(data) {
return http.request({
url: 'accessAuthority',
method: 'put',
@@ -44,7 +44,7 @@ export function updateAccessAuthority(data) {
}
// 批量删除
export function deleteBatchAccessAuthority(data) {
export function toDeleteApi(data) {
return http.request({
url: 'accessAuthority/delete/batch',
method: 'post',
@@ -53,7 +53,7 @@ export function deleteBatchAccessAuthority(data) {
}
// 查询详情页
export function getDetail(data) {
export function toGetDataDetailApi(data) {
return http.request({
url: 'accessAuthority/' + data.id,
method: 'get',

View File

@@ -13,7 +13,7 @@
<script lang="ts" setup>
import { JsqCrud, useCrud } from '@/components/Base/Jsq-crud';
import { getFormSchemas, getTreeOptions, getTableButtons, getDialogRecordingSchemas, getTableColumns } from './utils/schemas';
import { getPageList, addAccessAuthority, updateAccessAuthority, deleteBatchAccessAuthority, getDetail } from '@/api/access/accessAuthority'
import { toGetPageList, toAddApi, toUpdateApi, toDeleteApi, toGetDataDetailApi } from '@/api/access/accessAuthority'
// 新增
const addClick = () => {
@@ -59,34 +59,14 @@
columns: columns, // 表格配置
},
apiOptions: {
queryApi: getPageList, // 查询
addApi: addAccessAuthority, // 新增
removeApi: deleteBatchAccessAuthority, // 删除
updateApi: updateAccessAuthority, // 修改
getDataByIdApi: getDetail // 查询详情页
queryApi: toGetPageList, // 查询
addApi: toAddApi, // 新增
removeApi: toDeleteApi, // 删除
updateApi: toUpdateApi, // 修改
getDataByIdApi: toGetDataDetailApi // 查询详情页
}
});
</script>
<style lang="less" scoped>
.view-container {
width: 100%;
height: calc(100vh - 118px);
display: flex;
flex-direction: row;
&-left {
width: 20%;
height: calc(100vh - 118px);
overflow-y: auto;
background: #fff;
padding: 20px 10px;
box-sizing: border-box;
}
&-right {
background: #fff;
flex: 1;
padding: 20px 10px;
margin-left: 6px;
}
}
</style>