1
0

feat(ware): 上架数据产品功能

- 新增数据产品上架相关的对话框组件和页面功能
- 实现数据产品的添加、编辑和详情查看功能
- 添加数据产品相关的实体类、控制器、服务类和仓库接口
This commit is contained in:
2024-12-13 18:18:49 +08:00
parent 8202a27f55
commit dbdf9c59bb
8 changed files with 345 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
textarea {
resize: none !important;
}

View File

@@ -0,0 +1,119 @@
import './dialog-ware.css'
import {apiGet, apiPost, formInputClearable, horizontalFormOptions, information} from "../constants.js";
function detailForm() {
return {
debug: information.debug,
type: 'form',
...horizontalFormOptions(),
horizontal: {
left: 2,
},
body: [
{
type: 'hidden',
name: 'id',
},
{
type: 'input-image',
name: 'icon',
label: '图标',
},
{
type: 'input-text',
name: 'name',
label: '商品名称',
maxLength: 10,
showCounter: true,
required: true,
...formInputClearable,
},
{
type: 'textarea',
name: 'description',
label: '商品简介',
required: true,
...formInputClearable,
showCounter: true,
trimContents: true,
minRows: 2,
maxRows: 2,
},
{
type: 'input-rich-text',
name: 'content',
label: '商品详情',
required: true,
options: {
min_height: 300,
}
}
]
}
}
export function wareAddDialog() {
return {
actionType: 'dialog',
dialog: {
title: '上架数据产品',
size: 'md',
actions: [
{
type: 'reset',
label: '重置',
},
{
type: 'submit',
label: '确定',
level: 'primary',
}
],
body: {
...detailForm(),
api: apiPost(`\${base}/ware/save`),
}
}
}
}
export function wareDetailDialog() {
return {
actionType: 'dialog',
dialog: {
title: '确权申请详情',
size: 'md',
body: {
...detailForm(),
initApi: apiGet(`\${base}/ware/detail/\${id}`),
static: true,
}
}
}
}
export function wareEditeDialog() {
return {
actionType: 'dialog',
dialog: {
title: '确权申请详情',
size: 'md',
actions: [
{
type: 'reset',
label: '重置',
},
{
type: 'submit',
label: '确定',
level: 'primary',
}
],
body: {
...detailForm(),
api: apiPost(`\${base}/ware/save`),
initApi: apiGet(`\${base}/ware/detail/\${${field}}`),
},
}
}
}

View File

@@ -5,6 +5,7 @@ import {tabData} from "./tab-data.js";
import {tabSettings} from "./tab-settings.js";
import {tabCheck} from "./tab-check.js";
import {tabPermissions} from "./tab-permissions.js";
import {tabMarket} from "./tab-market.js";
useAmis(information => {
return {
@@ -58,7 +59,7 @@ useAmis(information => {
tabsMode: 'vertical',
tabs: [
// tabOverview(),
// tabMarket(),
tabMarket(),
tabPermissions(),
tabCheck(),
tabData(),

View File

@@ -1,9 +1,16 @@
import {wareAddDialog} from "../../components/ware/dialog-ware.js";
export function tabMarket() {
return {
title: '数据市场',
icon: 'fa fa-store',
body: [
'hello world'
{
type: 'action',
label: '',
icon: 'fa fa-plus',
...wareAddDialog()
},
]
}
}