From d4e5744f3df7c90b44a900d1f61f5850b199b47d Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期二, 04 三月 2025 10:20:59 +0800 Subject: [PATCH] 完成维修工单评价功能 --- eims-ui/apps/web-antd/src/utils/render.tsx | 40 +++++++++++++++++----------------------- 1 files changed, 17 insertions(+), 23 deletions(-) diff --git a/eims-ui/apps/web-antd/src/utils/render.tsx b/eims-ui/apps/web-antd/src/utils/render.tsx index fcc9102..667b7b6 100644 --- a/eims-ui/apps/web-antd/src/utils/render.tsx +++ b/eims-ui/apps/web-antd/src/utils/render.tsx @@ -22,10 +22,10 @@ QuarkIcon, SafariIcon, UcIcon, - WindowsIcon, + WindowsIcon } from '@vben/icons'; -import { Tag } from 'ant-design-vue'; +import { Rate, Tag } from 'ant-design-vue'; import { DictTag } from '#/components/dict'; @@ -102,7 +102,7 @@ DELETE: 'red', GET: 'green', POST: 'blue', - PUT: 'orange', + PUT: 'orange' }; const color = colors[method] ?? 'default'; @@ -123,12 +123,7 @@ * @param [gap] 闂撮殧 * @returns render */ -export function renderDictTags( - value: string[], - dicts: DictData[], - wrap = true, - gap = 1, -) { +export function renderDictTags(value: string[], dicts: DictData[], wrap = true, gap = 1) { if (!Array.isArray(value)) { return <div>{value}</div>; } @@ -151,12 +146,7 @@ const dictInfo = getDict(dictName); return renderDictTag(value, dictInfo); } -export function renderIconSpan( - icon: ComponentType, - value: string, - center = false, - marginLeft = '2px', -) { +export function renderIconSpan(icon: ComponentType, value: string, center = false, marginLeft = '2px') { const justifyCenter = center ? 'justify-center' : ''; return ( @@ -172,7 +162,7 @@ { icon: LinuxIcon, value: 'linux' }, { icon: OSXIcon, value: 'osx' }, { icon: AndroidIcon, value: 'android' }, - { icon: IPhoneIcon, value: 'iphone' }, + { icon: IPhoneIcon, value: 'iphone' } ]; /** @@ -191,16 +181,14 @@ { icon: QQIcon, value: 'qq' }, { icon: DingtalkIcon, value: 'dingtalk' }, { icon: UcIcon, value: 'uc' }, - { icon: BaiduIcon, value: 'baidu' }, + { icon: BaiduIcon, value: 'baidu' } ]; export function renderOsIcon(os: string, center = false) { if (!os) { return; } - let current = osOptions.find((item) => - os.toLocaleLowerCase().includes(item.value), - ); + let current = osOptions.find((item) => os.toLocaleLowerCase().includes(item.value)); // windows瑕佺壒娈婂鐞� if (os.toLocaleLowerCase().includes('windows')) { current = osOptions[0]; @@ -217,9 +205,7 @@ if (!browser) { return; } - const current = browserOptions.find((item) => - browser.toLocaleLowerCase().includes(item.value), - ); + const current = browserOptions.find((item) => browser.toLocaleLowerCase().includes(item.value)); if (current) { return renderIconSpan(current.icon, browser, center, '5px'); } @@ -227,3 +213,11 @@ const defaultIcon = DefaultBrowserIcon; return renderIconSpan(defaultIcon, browser, center, '5px'); } + +export function renderRate(value: string) { + if (!value) { + return null; + } + + return <Rate disabled value={Number(value)}></Rate>; +} -- Gitblit v1.9.3