review:【antd】【iot】商品分类
This commit is contained in:
@@ -3,19 +3,19 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace IotProductCategoryApi {
|
||||
/** IoT 產品分類 VO */
|
||||
/** 产品分类 */
|
||||
export interface ProductCategory {
|
||||
id?: number; // 分類 ID
|
||||
name: string; // 分類名稱
|
||||
parentId?: number; // 父级分類 ID
|
||||
sort?: number; // 分類排序
|
||||
status?: number; // 分類狀態
|
||||
description?: string; // 分類描述
|
||||
createTime?: string; // 創建時間
|
||||
id?: number; // 分类 ID
|
||||
name: string; // 分类名称
|
||||
parentId?: number; // 父级分类 ID
|
||||
sort?: number; // 分类排序
|
||||
status?: number; // 分类状态
|
||||
description?: string; // 分类描述
|
||||
createTime?: string; // 创建时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查詢產品分類分頁 */
|
||||
/** 查询产品分类分页 */
|
||||
export function getProductCategoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<IotProductCategoryApi.ProductCategory>>(
|
||||
'/iot/product-category/page',
|
||||
@@ -23,33 +23,33 @@ export function getProductCategoryPage(params: PageParam) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 查詢產品分類詳情 */
|
||||
/** 查询产品分类详情 */
|
||||
export function getProductCategory(id: number) {
|
||||
return requestClient.get<IotProductCategoryApi.ProductCategory>(
|
||||
`/iot/product-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增產品分類 */
|
||||
/** 新增产品分类 */
|
||||
export function createProductCategory(
|
||||
data: IotProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.post('/iot/product-category/create', data);
|
||||
}
|
||||
|
||||
/** 修改產品分類 */
|
||||
/** 修改产品分类 */
|
||||
export function updateProductCategory(
|
||||
data: IotProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.put('/iot/product-category/update', data);
|
||||
}
|
||||
|
||||
/** 刪除產品分類 */
|
||||
/** 刪除产品分类 */
|
||||
export function deleteProductCategory(id: number) {
|
||||
return requestClient.delete(`/iot/product-category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 獲取產品分類精簡列表 */
|
||||
/** 获取产品分类精简列表 */
|
||||
export function getSimpleProductCategoryList() {
|
||||
return requestClient.get<IotProductCategoryApi.ProductCategory[]>(
|
||||
'/iot/product-category/simple-list',
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<script lang="ts" setup>
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
defineOptions({ name: 'IotPlugin' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page description="物聯網插件管理" title="插件管理">
|
||||
<div class="p-4">
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
target="_blank"
|
||||
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
|
||||
>
|
||||
該功能支持 Vue3 + element-plus 版本!
|
||||
</Button>
|
||||
<div class="mt-4">
|
||||
<h3>功能說明:</h3>
|
||||
<p>IoT 插件管理功能</p>
|
||||
<h3 class="mt-4">待實現:</h3>
|
||||
<ul>
|
||||
<li>⚠️ API 接口定義</li>
|
||||
<li>⚠️ 頁面實現</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -56,16 +56,11 @@ async function handleDelete(row: IotProductCategoryApi.ProductCategory) {
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
showCollapseButton: true,
|
||||
collapsed: true,
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
|
||||
@@ -17,6 +17,8 @@ import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
// TODO @haohao:应该是 form.vue,不用前缀;
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<IotProductCategoryApi.ProductCategory>();
|
||||
const getTitle = computed(() => {
|
||||
@@ -38,7 +40,7 @@ const [Form, formApi] = useVbenForm({
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
// TODO @haohao:参考别的 form;1)文件的命名可以简化;2)代码可以在简化下;
|
||||
// TODO @haohao:参考 apps/web-antd/src/views/system/dept/modules/form.vue 简化 useVbenModal 里的代码;
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
|
||||
Reference in New Issue
Block a user