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