完善模型库界面和开发配置
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
.app-shell {
|
||||
height: 100vh;
|
||||
display: grid;
|
||||
grid-template-rows: 42px 1fr;
|
||||
/* grid-template-rows: 42px 1fr; */
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
/* display: flex; */
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
@@ -50,6 +51,7 @@
|
||||
display: grid;
|
||||
grid-template-rows: auto auto 1fr auto;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.content-toolbar {
|
||||
@@ -80,17 +82,17 @@
|
||||
|
||||
.filter-toolbar {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(120px, 160px) minmax(120px, 160px) minmax(200px, 1fr) auto;
|
||||
grid-template-columns: minmax(120px, 200px) minmax(120px, 200px) minmax(200px, 200px) minmax(50px, 80px) minmax(50px, 80px);
|
||||
align-items: end;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
background: #f8fafb;
|
||||
/* background: #f8fafb; */
|
||||
border-bottom: 1px solid #d8e0e8;
|
||||
}
|
||||
|
||||
.filter-toolbar label {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
/* display: grid;
|
||||
gap: 3px; */
|
||||
}
|
||||
|
||||
.filter-toolbar span {
|
||||
@@ -129,21 +131,21 @@
|
||||
|
||||
.thumb {
|
||||
position: relative;
|
||||
height: 150px;
|
||||
min-height: 150px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background:
|
||||
/* background:
|
||||
linear-gradient(45deg, #edf2f5 25%, transparent 25%),
|
||||
linear-gradient(-45deg, #edf2f5 25%, transparent 25%),
|
||||
linear-gradient(45deg, transparent 75%, #edf2f5 75%),
|
||||
linear-gradient(-45deg, transparent 75%, #edf2f5 75%),
|
||||
#f8fafb;
|
||||
#f8fafb; */
|
||||
background-position: 0 0, 0 6px, 6px -6px, -6px 0;
|
||||
background-size: 12px 12px;
|
||||
border: 1px solid #d3dde5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
padding: 4px;
|
||||
/* padding: 4px; */
|
||||
}
|
||||
|
||||
.thumb-actions {
|
||||
@@ -253,6 +255,7 @@ dd {
|
||||
|
||||
.pagination-total,
|
||||
.pagination-range {
|
||||
display: none;
|
||||
color: #647586;
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -331,7 +334,7 @@ dd {
|
||||
}
|
||||
|
||||
.keyword-filter {
|
||||
grid-column: 1 / -1;
|
||||
/* grid-column: 1 / -1; */
|
||||
}
|
||||
|
||||
.pagination {
|
||||
|
||||
@@ -31,14 +31,11 @@ export async function renderApp() {
|
||||
<template id="modelPanelTemplate">
|
||||
<main class="content-pane">
|
||||
<div class="content-toolbar">
|
||||
<div>
|
||||
<h2>模型列表</h2>
|
||||
</div>
|
||||
<div class="content-actions">
|
||||
${isAdmin ? `<button id="manageUsersBtn" type="button">人员权限</button>` : ""}
|
||||
${isAdmin ? `<button id="manageDictionariesBtn" type="button">字典维护</button>` : ""}
|
||||
<button id="addProcessModelBtn" type="button" hidden>上传工艺模型</button>
|
||||
<button id="addModelBtn" class="primary-btn" type="button" hidden>增加模型</button>
|
||||
${isAdmin ? `<button id="addProcessModelBtn" type="button" hidden>上传工艺模型</button>` : ""}
|
||||
${isAdmin ? `<button id="addModelBtn1" class="primary-btn" type="button" hidden>增加模型</button>` : ""}
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-toolbar">
|
||||
@@ -59,6 +56,7 @@ export async function renderApp() {
|
||||
<input id="keywordFilter" placeholder="模型名 / 文件名 / 属性" />
|
||||
</label>
|
||||
<button id="resetFilterBtn" type="button">重置</button>
|
||||
<button id="addModelBtn" class="primary-btn" type="button">增加模型</button>
|
||||
</div>
|
||||
<div id="modelGrid" class="model-grid"></div>
|
||||
<footer id="modelPagination" class="pagination"></footer>
|
||||
@@ -92,8 +90,8 @@ function renderWorkspaceLayout() {
|
||||
panels: [
|
||||
{
|
||||
type: "left",
|
||||
size: 300,
|
||||
minSize: 220,
|
||||
size: 180,
|
||||
minSize: 150,
|
||||
resizable: true,
|
||||
overflow: "hidden",
|
||||
html: treeTemplate.innerHTML
|
||||
|
||||
@@ -24,6 +24,7 @@ export async function openDictionaryManager(onChanged?: () => Promise<void> | vo
|
||||
title: "品牌 / 类型维护",
|
||||
width: 680,
|
||||
height: 520,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<div class="dictionary-manager">
|
||||
${dictionaryPanelHtml("brands", "品牌")}
|
||||
|
||||
@@ -231,7 +231,7 @@ function renderModelCard(item: ModelItem) {
|
||||
const prop = item.properties ?? {};
|
||||
const thumb = item.thumbnail_url
|
||||
? `<img src="${item.thumbnail_url}" alt="" />`
|
||||
: `<div class="thumb-placeholder">GLB</div>`;
|
||||
: `<div class="thumb-placeholder">暂无预览图</div>`;
|
||||
return `
|
||||
<article class="model-card" data-model-id="${item.id}">
|
||||
<div class="model-info">
|
||||
@@ -391,6 +391,7 @@ async function openUploadModelDialog() {
|
||||
title: "增加模型",
|
||||
width: 560,
|
||||
height: 520,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<form id="modelUploadPopupForm" class="popup-form upload-popup-form">
|
||||
<label>
|
||||
@@ -466,6 +467,7 @@ export async function openProcessModelUploadDialog(input?: {
|
||||
title: "上传工艺模型",
|
||||
width: 640,
|
||||
height: 650,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<form id="processModelUploadPopupForm" class="popup-form upload-popup-form">
|
||||
<div class="upload-target-path">
|
||||
@@ -656,6 +658,7 @@ async function editModel(id: number) {
|
||||
title: "编辑模型",
|
||||
width: 520,
|
||||
height: 390,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<form id="modelEditPopupForm" class="popup-form">
|
||||
<label><span>模型名称</span><input name="name" value="${escapeHtml(oldName)}" /></label>
|
||||
|
||||
@@ -105,6 +105,7 @@ export function openModelPreview(
|
||||
width: 860,
|
||||
height: 620,
|
||||
modal: true,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<div class="preview-shell">
|
||||
<aside class="preview-process-panel">
|
||||
|
||||
@@ -16,6 +16,7 @@ export async function openUserManager() {
|
||||
title: "人员权限管理",
|
||||
width: 980,
|
||||
height: 560,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<div class="user-manager">
|
||||
<header class="user-manager-head">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
:root {
|
||||
font-family: "Microsoft YaHei", Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #1c2733;
|
||||
background: #eef2f5;
|
||||
}
|
||||
@@ -8,7 +7,9 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 62.5%;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
min-width: 320px;
|
||||
|
||||
@@ -38,6 +38,7 @@ export function formDialog<T>(options: {
|
||||
title: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
blockPage?: boolean;
|
||||
body: string;
|
||||
onOpen?: () => void;
|
||||
onSubmit: () => Promise<T> | T;
|
||||
@@ -57,6 +58,7 @@ export function formDialog<T>(options: {
|
||||
height: options.height ?? 300,
|
||||
modal: true,
|
||||
body: options.body,
|
||||
blockPage: options.blockPage ?? false,
|
||||
actions: {
|
||||
取消() {
|
||||
closeWith(null);
|
||||
@@ -96,6 +98,7 @@ export async function promptDialog(options: {
|
||||
return formDialog<string>({
|
||||
title: options.title,
|
||||
height: 210,
|
||||
blockPage: false,
|
||||
body: `
|
||||
<div class="popup-form">
|
||||
<label>
|
||||
|
||||
1
web/src/vendor/w2ui.ts
vendored
1
web/src/vendor/w2ui.ts
vendored
@@ -13,6 +13,7 @@ type W2Popup = {
|
||||
width?: number;
|
||||
height?: number;
|
||||
modal?: boolean;
|
||||
blockPage?: boolean;
|
||||
body?: string;
|
||||
actions?: Record<string, () => void | Promise<void>>;
|
||||
}): {
|
||||
|
||||
Reference in New Issue
Block a user