add. composer package list query
This commit is contained in:
parent
7c5ce71322
commit
1657512c84
@ -7,7 +7,7 @@ use think\response\Json;
|
||||
|
||||
class ComposerController extends BaseController
|
||||
{
|
||||
public function list(): Json
|
||||
public function info(): Json
|
||||
{
|
||||
$composerLockFile = $this->app->getRootPath() . 'composer.lock';
|
||||
$composerLockData = json_decode(file_get_contents($composerLockFile), true);
|
||||
|
||||
@ -71,7 +71,7 @@ Route::group("adminapi", function () {
|
||||
|
||||
|
||||
Route::group("system", function () {
|
||||
Route::get('composer/package', [ComposerController::class, "list"])->name("system.composerPackageList");
|
||||
Route::get('composer', [ComposerController::class, "info"])->name("system.composerInfo");
|
||||
Route::get('command', [CommandController::class, "list"])->name("system.commandList");
|
||||
|
||||
|
||||
|
||||
@ -1,17 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Package, PackageParam } from './model';
|
||||
import type { Composer, ComposerParam } from './model';
|
||||
|
||||
/**
|
||||
* 查询引入的包列表
|
||||
* 查询composer信息
|
||||
*/
|
||||
export async function listPackage(params?: PackageParam) {
|
||||
const res = await request.get<ApiResult<Package[]>>(
|
||||
'/system/composer/package',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
export async function composerInfo(params?: ComposerParam) {
|
||||
const res = await request.get<ApiResult<Composer>>('/system/composer', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Package {}
|
||||
export interface Composer {
|
||||
packages: any;
|
||||
}
|
||||
|
||||
export interface PackageParam extends PageParam {}
|
||||
export interface ComposerParam extends PageParam {}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
DatasourceFunction,
|
||||
Columns
|
||||
} from 'ele-admin-plus/es/ele-pro-table/types';
|
||||
import { listPackage } from '@/api/system/composer';
|
||||
import { composerInfo } from '@/api/system/composer';
|
||||
|
||||
defineOptions({ name: 'SystemComposerPackage' });
|
||||
|
||||
@ -79,9 +79,12 @@
|
||||
hideInExport: true
|
||||
}
|
||||
]);
|
||||
|
||||
const info = ref(false);
|
||||
/** 表格数据源 */
|
||||
const datasource: DatasourceFunction = ({ pages, where, orders }) => {
|
||||
return listPackage({ ...where, ...orders, ...pages });
|
||||
return composerInfo({ ...where, ...orders, ...pages }).then((data: any) => {
|
||||
info.value = data;
|
||||
return data.packages;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user