From 74b0638a0763fd3e58264900ca97e5411af276ce Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Thu, 19 Dec 2024 19:03:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BA=A7=E5=93=81=E5=B1=95=E7=A4=BA=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 constants.js 中更新了信息结构,使用空值合并运算符提高代码健壮性 - 在 main.js 中添加了样式文件导入,提升页面视觉效果 - 在 tab-market.js 中增加了数据产品详情对话框,丰富了产品信息展示内容 --- gringotts-frontend/components/constants.js | 5 +-- gringotts-frontend/pages/index/main.js | 1 + gringotts-frontend/pages/index/style.css | 0 gringotts-frontend/pages/index/tab-market.js | 44 ++++++++++++++++++-- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 gringotts-frontend/pages/index/style.css diff --git a/gringotts-frontend/components/constants.js b/gringotts-frontend/components/constants.js index dc594ce..b2ba757 100644 --- a/gringotts-frontend/components/constants.js +++ b/gringotts-frontend/components/constants.js @@ -1,6 +1,5 @@ export const information = { debug: true, - // baseUrl: '', baseUrl: 'http://127.0.0.1:20080', title: '可信供给中心', } @@ -17,8 +16,8 @@ export function useAmis(amisObject) { struct, { data: { - debug: information.debug, - base: information.baseUrl, + debug: information.debug ?? false, + base: information.baseUrl ?? '', }, }, { diff --git a/gringotts-frontend/pages/index/main.js b/gringotts-frontend/pages/index/main.js index 0c44642..284a598 100644 --- a/gringotts-frontend/pages/index/main.js +++ b/gringotts-frontend/pages/index/main.js @@ -1,3 +1,4 @@ +import './style.css' import {apiGet, useAmis} from '../../components/constants.js' import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js"; import {tabUser} from "./tab-user.js"; diff --git a/gringotts-frontend/pages/index/style.css b/gringotts-frontend/pages/index/style.css new file mode 100644 index 0000000..e69de29 diff --git a/gringotts-frontend/pages/index/tab-market.js b/gringotts-frontend/pages/index/tab-market.js index dc02e41..6add9b9 100644 --- a/gringotts-frontend/pages/index/tab-market.js +++ b/gringotts-frontend/pages/index/tab-market.js @@ -1,4 +1,3 @@ -import {wareDetailDialog} from "../../components/ware/dialog-ware.js"; import {apiGet, crudCommonOptions} from "../../components/constants.js"; import {authenticationAddDialog} from "../../components/permission/dialog-permission.js"; @@ -26,19 +25,58 @@ export function tabMarket() { 'reload', ], mode: 'cards', + columnsCount: 3, card: { header: { title: '${name}', subTitle: '${createdTime}', - description: '${description}', avatar: '${icon}', avatarClassName: 'pull-left thumb-md avatar b-3x m-r' }, + body: '${TRUNCATE(description, 50)}', actions: [ { type: 'action', label: '查看', - ...wareDetailDialog(), + actionType: 'dialog', + dialog: { + title: '数据产品详情', + size: 'md', + actions: [], + body: { + type: 'service', + api: apiGet(`\${base}/ware/detail/\${id}`), + body: [ + { + type: 'property', + title: '产品信息', + items: [ + { + label: '名称', + content: '${name}', + }, + { + label: '归属', + content: '${createdUsername}', + }, + { + label: '创建时间', + content: '${createdTime}', + }, + { + span: 3, + label: '描述', + content: '${description}', + }, + ] + }, + { + type: 'tpl', + tpl: '${content|raw}' + } + ] + } + } }, { type: 'action',