@qilitt-mickey/vue3-temp-skill 1.1.34 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -14
- package/SKILL.md +4 -2
- package/bin/cli.js +18 -4
- package/package.json +2 -1
- package/references/addon-enable.md +1 -1
- package/references/api-check.md +1 -1
- package/references/auth-pages.md +1 -1
- package/references/base-code-dict.md +1 -1
- package/references/chart-echarts.md +1 -1
- package/references/code-quality.md +1 -1
- package/references/core-kernel.md +1 -1
- package/references/crud-pages.md +244 -244
- package/references/data-compare.md +1 -1
- package/references/data-mapping.md +1 -1
- package/references/data-screen.md +1 -1
- package/references/data-writeback.md +1 -1
- package/references/design-handoff.md +25 -35
- package/references/design-system.md +1 -1
- package/references/design-verify.md +27 -2
- package/references/detail-page.md +1 -1
- package/references/directives-advanced.md +7 -7
- package/references/download-export.md +1 -1
- package/references/feedback-loading.md +1 -1
- package/references/feedback-ui.md +1 -1
- package/references/file-management.md +7 -7
- package/references/flowchart-g6.md +1 -1
- package/references/form-advanced.md +1 -1
- package/references/graph-relation.md +7 -7
- package/references/http-api.md +1 -1
- package/references/i18n-localization.md +1 -1
- package/references/icons.md +1 -1
- package/references/layout-theme.md +1 -1
- package/references/mobile-h5.md +1 -1
- package/references/particles.md +7 -7
- package/references/permission-auth.md +1 -1
- package/references/project-inventory.md +1 -1
- package/references/qrcode-barcode.md +1 -1
- package/references/rich-text.md +1 -1
- package/references/seamless-scroll.md +1 -1
- package/references/table-vxe.md +1 -1
- package/references/tree-table.md +7 -7
- package/references/ui-components.md +1 -1
- package/references/verify-captcha.md +1 -1
- package/references/websocket-realtime.md +7 -7
- package/references/wechat-js.md +1 -1
- package/references/workflow-bpmn.md +1 -1
- package/scripts/check.mjs +6 -0
- package/scripts/field-schema-audit.mjs +246 -0
- package/scripts/handoff.mjs +388 -22
package/references/crud-pages.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: crud-pages
|
|
3
3
|
description: 查询列表页、表单页、标准 CRUD。含 useTableSearch、列表标准样板、表单约定。
|
|
4
4
|
scope: project
|
|
5
5
|
tags: [vue3, crud, list, form, detail, table, useTableSearch, page, layout, 批量, 排序, 批量操作]
|
|
@@ -249,249 +249,249 @@ function handleSizeChange(size: number) {
|
|
|
249
249
|
</template>
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
补充:`ReTableOperate` 用 `:list`;`defineOptions.name` === 路由 `name`;`svgLoading` 来自 `useApp()`;列表定高走壳层令牌 + `vts-page-card`。
|
|
253
|
-
|
|
254
|
-
## 列表设计模式样板(设计 Skill 产出存在时使用)
|
|
255
|
-
|
|
256
|
-
> **触发条件**:存在 `design-handoff/v1` JSON(含 `structureRequirements` + `pageStructure` 段)、用户指定设计规范、或命中 `design-system` 模块且设计 Skill 产出可用。
|
|
257
|
-
>
|
|
258
|
-
> **1:1 还原要求**:页面区域结构必须按 JSON `structureRequirements.pageRegions` 实现,框架壳层按 `structureRequirements.frameworkShell` 实现。详见设计 Skill 的 `project-implementation-protocol.md`。
|
|
259
|
-
>
|
|
260
|
-
> **与出厂模式的区别**:出厂模式(上文 L1-L9)直接堆 `el-card` + 查询区 + 表格,无页面标题区。设计模式按 JSON `pageStructure` 区域拆分,包含完整的页面标题区、筛选区容器、操作栏、表格区。
|
|
261
|
-
>
|
|
262
|
-
> **结构变化**(以 JSON `structureRequirements.pageRegions` 为准,下方为默认区域):
|
|
263
|
-
> - 新增 `.vts-page-header`(标题 + 描述 + 标题区操作按钮)— 对应 JSON `pageStructure.regions.header`
|
|
264
|
-
> - 查询区从 `bg-bg_color p-5` 升级为 `.vts-filter-area`(有容器感 + 分隔线)— 对应 `pageStructure.regions.filter`
|
|
265
|
-
> - 表格区外包 `.vts-table-area`(有圆角边框包裹)— 对应 `pageStructure.regions.table`
|
|
266
|
-
> - 主操作按钮(新增/导入)从 `ReTableBar #buttons` 移到 `.vts-page-header__actions`
|
|
267
|
-
> - 若 JSON 指定额外区域(如统计区、页签切换区),按 `pageStructure.regions` 顺序在 `otherRef` 位或独立区域中实现
|
|
268
|
-
|
|
269
|
-
| # | 必须 |
|
|
270
|
-
|---|------|
|
|
271
|
-
| D1 | `el-card` + `class="vts-page-card"` + `ref="content"`(同 L1) |
|
|
272
|
-
| D2 | `.vts-page-header`:标题 18px 加粗 + 描述 13px tertiary + 右侧操作按钮(新增/导入) |
|
|
273
|
-
| D3 | `.vts-filter-area`:筛选区容器(独立背景 + 圆角 + 底部分隔线) |
|
|
274
|
-
| D4 | `.vts-action-bar`:表格上方操作栏(批量删除等 + 右侧刷新/列设置) |
|
|
275
|
-
| D5 | `.vts-table-area`:表格区包裹(圆角 + 边框) |
|
|
276
|
-
| D6 | 表头:品牌色浅底 + 字重 600 + 底部强调线(由 `element-plus.scss` 全局提供) |
|
|
277
|
-
| D7 | 行 hover:品牌色极浅底 + 过渡(由 `element-plus.scss` 全局提供) |
|
|
278
|
-
| D8 | 其余同 L4-L9(ReGrid / ReTableBar / RePagination / ReTableOperate) |
|
|
279
|
-
|
|
280
|
-
```vue
|
|
281
|
-
<script setup lang="ts">
|
|
282
|
-
import type { OperateButton } from "@/components/ReTableOperate";
|
|
283
|
-
import type { Customer, CustomerQuery } from "@/api/customer";
|
|
284
|
-
import { getCustomerList } from "@/api/customer";
|
|
285
|
-
import { ReGrid } from "@/components/ReGrid";
|
|
286
|
-
import { ReGridItem } from "@/components/ReGridItem";
|
|
287
|
-
import { RePagination } from "@/components/RePagination";
|
|
288
|
-
import { ReTableBar } from "@/components/ReTableBar";
|
|
289
|
-
import { ReTableOperate, resolveOperateColumnWidth } from "@/components/ReTableOperate";
|
|
290
|
-
import { useApp } from "@/hooks/useApp";
|
|
291
|
-
import { useTableSearch } from "@/hooks/useTableSearch";
|
|
292
|
-
import { message } from "@/utils/message";
|
|
293
|
-
|
|
294
|
-
defineOptions({ name: "CustomerList" });
|
|
295
|
-
|
|
296
|
-
const { svgLoading } = useApp();
|
|
297
|
-
const formQuery = reactive<CustomerQuery>({ keyword: "", status: undefined });
|
|
298
|
-
|
|
299
|
-
const {
|
|
300
|
-
content,
|
|
301
|
-
otherRef,
|
|
302
|
-
tableHeight,
|
|
303
|
-
paginationRef,
|
|
304
|
-
loading,
|
|
305
|
-
formRef,
|
|
306
|
-
multipleTableRef,
|
|
307
|
-
pagination,
|
|
308
|
-
onSearch,
|
|
309
|
-
tableData,
|
|
310
|
-
gridRef,
|
|
311
|
-
showCollapse,
|
|
312
|
-
collapsed,
|
|
313
|
-
collapsedToggle,
|
|
314
|
-
upBold,
|
|
315
|
-
downBold,
|
|
316
|
-
reset,
|
|
317
|
-
} = useTableSearch(
|
|
318
|
-
formQuery,
|
|
319
|
-
getCustomerList,
|
|
320
|
-
`${import.meta.env.VITE_API_BASE_URL}/console/customer/list`,
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
const tableList = computed(() => tableData.value.tableList as Customer[]);
|
|
324
|
-
|
|
325
|
-
const operateLimit = 3;
|
|
326
|
-
|
|
327
|
-
const operateButtons: OperateButton[] = [
|
|
328
|
-
{
|
|
329
|
-
label: $t("删除"),
|
|
330
|
-
type: "danger",
|
|
331
|
-
icon: "i-ep:delete",
|
|
332
|
-
onClick: (row) => handleDelete(row as Customer),
|
|
333
|
-
},
|
|
334
|
-
];
|
|
335
|
-
|
|
336
|
-
onMounted(() => onSearch());
|
|
337
|
-
|
|
338
|
-
function handleDelete(row: Customer) {
|
|
339
|
-
message($t("删除成功"), { type: "success" });
|
|
340
|
-
onSearch();
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
function handleCurrentChange(cur: number) {
|
|
344
|
-
pagination.currentPage = cur;
|
|
345
|
-
onSearch();
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
function handleSizeChange(size: number) {
|
|
349
|
-
pagination.pageSize = size;
|
|
350
|
-
onSearch();
|
|
351
|
-
}
|
|
352
|
-
</script>
|
|
353
|
-
|
|
354
|
-
<template>
|
|
355
|
-
<div>
|
|
356
|
-
<el-card
|
|
357
|
-
ref="content"
|
|
358
|
-
class="vts-page-card"
|
|
359
|
-
shadow="never"
|
|
360
|
-
>
|
|
361
|
-
<!-- D2: 页面标题区 -->
|
|
362
|
-
<div class="vts-page-header">
|
|
363
|
-
<div class="vts-page-header__info">
|
|
364
|
-
<span class="vts-page-header__title">{{ $t("客户列表") }}</span>
|
|
365
|
-
<span class="vts-page-header__desc">{{ $t("管理客户的售价、类型与库存信息") }}</span>
|
|
366
|
-
</div>
|
|
367
|
-
<div class="vts-page-header__actions">
|
|
368
|
-
<el-button
|
|
369
|
-
type="primary"
|
|
370
|
-
v-auth="['admin']"
|
|
371
|
-
@click="handleAdd"
|
|
372
|
-
>
|
|
373
|
-
{{ $t("新增") }}
|
|
374
|
-
</el-button>
|
|
375
|
-
<el-button v-auth="['admin']">{{ $t("导入") }}</el-button>
|
|
376
|
-
</div>
|
|
377
|
-
</div>
|
|
378
|
-
|
|
379
|
-
<!-- D3: 筛选区容器 -->
|
|
380
|
-
<div class="vts-filter-area">
|
|
381
|
-
<el-form
|
|
382
|
-
ref="formRef"
|
|
383
|
-
:inline="true"
|
|
384
|
-
:model="formQuery"
|
|
385
|
-
>
|
|
386
|
-
<ReGrid
|
|
387
|
-
ref="gridRef"
|
|
388
|
-
:collapsed="collapsed"
|
|
389
|
-
:gap="[0, 20]"
|
|
390
|
-
:cols="{ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }"
|
|
391
|
-
style="max-height: 300px; overflow-y: auto;"
|
|
392
|
-
@should-show-collapse="(val) => (showCollapse = val)"
|
|
393
|
-
>
|
|
394
|
-
<ReGridItem index="0">
|
|
395
|
-
<el-form-item :label="$t('关键词')" prop="keyword" class="w-[100%] !mr-0">
|
|
396
|
-
<el-input v-model="formQuery.keyword" clearable :placeholder="$t('请输入')" />
|
|
397
|
-
</el-form-item>
|
|
398
|
-
</ReGridItem>
|
|
399
|
-
<ReGridItem index="1">
|
|
400
|
-
<el-form-item :label="$t('状态')" prop="status" class="w-[100%] !mr-0">
|
|
401
|
-
<el-select v-model="formQuery.status" clearable :placeholder="$t('请选择')">
|
|
402
|
-
<el-option :label="$t('启用')" :value="1" />
|
|
403
|
-
<el-option :label="$t('禁用')" :value="0" />
|
|
404
|
-
</el-select>
|
|
405
|
-
</el-form-item>
|
|
406
|
-
</ReGridItem>
|
|
407
|
-
<ReGridItem suffix>
|
|
408
|
-
<div class="flex flex-end">
|
|
409
|
-
<el-button
|
|
410
|
-
type="primary"
|
|
411
|
-
:loading="loading"
|
|
412
|
-
@click="pagination.currentPage = 1; pagination.pageSize = 10; onSearch()"
|
|
413
|
-
>
|
|
414
|
-
{{ $t("查询") }}
|
|
415
|
-
</el-button>
|
|
416
|
-
<el-button @click="reset">{{ $t("重置") }}</el-button>
|
|
417
|
-
<el-button
|
|
418
|
-
v-if="showCollapse"
|
|
419
|
-
type="primary"
|
|
420
|
-
link
|
|
421
|
-
class="!font-size-12"
|
|
422
|
-
@click="collapsedToggle"
|
|
423
|
-
>
|
|
424
|
-
{{ collapsed ? $t("展开") : $t("收起") }}
|
|
425
|
-
<el-icon class="el-icon--right">
|
|
426
|
-
<component :is="collapsed ? downBold : upBold" />
|
|
427
|
-
</el-icon>
|
|
428
|
-
</el-button>
|
|
429
|
-
</div>
|
|
430
|
-
</ReGridItem>
|
|
431
|
-
</ReGrid>
|
|
432
|
-
</el-form>
|
|
433
|
-
</div>
|
|
434
|
-
|
|
435
|
-
<div ref="otherRef">
|
|
436
|
-
<!-- 统计/页签等额外模块;无则删除整段 -->
|
|
437
|
-
</div>
|
|
438
|
-
|
|
439
|
-
<!-- D4+D5: 操作栏 + 表格区 -->
|
|
440
|
-
<div class="vts-table-area">
|
|
441
|
-
<ReTableBar :columns="[]" @refresh="onSearch">
|
|
442
|
-
<template #title>
|
|
443
|
-
<span class="truncate font-size-16 font-bold">{{ $t("展示列表") }}</span>
|
|
444
|
-
</template>
|
|
445
|
-
<template #buttons>
|
|
446
|
-
<el-button type="danger" v-auth="['admin']">{{ $t("批量删除") }}</el-button>
|
|
447
|
-
</template>
|
|
448
|
-
<template #default="{ size }">
|
|
449
|
-
<div class="vl-parent">
|
|
450
|
-
<el-table
|
|
451
|
-
ref="multipleTableRef"
|
|
452
|
-
v-loading.lock="loading"
|
|
453
|
-
:element-loading-text="$t('加载中')"
|
|
454
|
-
:element-loading-spinner="svgLoading"
|
|
455
|
-
element-loading-svg-view-box="0, 0, 20, 20"
|
|
456
|
-
:style="{ height: `${tableHeight}px` }"
|
|
457
|
-
:size="size"
|
|
458
|
-
:data="tableList"
|
|
459
|
-
row-key="id"
|
|
460
|
-
>
|
|
461
|
-
<el-table-column prop="code" :label="$t('编号')" min-width="120" />
|
|
462
|
-
<el-table-column prop="name" :label="$t('名称')" min-width="140" />
|
|
463
|
-
<el-table-column
|
|
464
|
-
:label="$t('操作')"
|
|
465
|
-
:width="resolveOperateColumnWidth({ list: operateButtons, limit: operateLimit, size })"
|
|
466
|
-
fixed="right"
|
|
467
|
-
>
|
|
468
|
-
<template #default="{ row, $index }">
|
|
469
|
-
<ReTableOperate
|
|
470
|
-
:list="operateButtons"
|
|
471
|
-
:row="row"
|
|
472
|
-
:index="$index"
|
|
473
|
-
:limit="operateLimit"
|
|
474
|
-
:size="size"
|
|
475
|
-
/>
|
|
476
|
-
</template>
|
|
477
|
-
</el-table-column>
|
|
478
|
-
</el-table>
|
|
479
|
-
<RePagination
|
|
480
|
-
ref="paginationRef"
|
|
481
|
-
:size="size"
|
|
482
|
-
:pagination="pagination"
|
|
483
|
-
@handle-current-change="handleCurrentChange"
|
|
484
|
-
@handle-size-change="handleSizeChange"
|
|
485
|
-
/>
|
|
486
|
-
</div>
|
|
487
|
-
</template>
|
|
488
|
-
</ReTableBar>
|
|
489
|
-
</div>
|
|
490
|
-
</el-card>
|
|
491
|
-
</div>
|
|
492
|
-
</template>
|
|
493
|
-
```
|
|
494
|
-
|
|
252
|
+
补充:`ReTableOperate` 用 `:list`;`defineOptions.name` === 路由 `name`;`svgLoading` 来自 `useApp()`;列表定高走壳层令牌 + `vts-page-card`。
|
|
253
|
+
|
|
254
|
+
## 列表设计模式样板(设计 Skill 产出存在时使用)
|
|
255
|
+
|
|
256
|
+
> **触发条件**:存在 `design-handoff/v1` JSON(含 `structureRequirements` + `pageStructure` 段)、用户指定设计规范、或命中 `design-system` 模块且设计 Skill 产出可用。
|
|
257
|
+
>
|
|
258
|
+
> **1:1 还原要求**:页面区域结构必须按 JSON `structureRequirements.pageRegions` 实现,框架壳层按 `structureRequirements.frameworkShell` 实现。详见设计 Skill 的 `project-implementation-protocol.md`。
|
|
259
|
+
>
|
|
260
|
+
> **与出厂模式的区别**:出厂模式(上文 L1-L9)直接堆 `el-card` + 查询区 + 表格,无页面标题区。设计模式按 JSON `pageStructure` 区域拆分,包含完整的页面标题区、筛选区容器、操作栏、表格区。
|
|
261
|
+
>
|
|
262
|
+
> **结构变化**(以 JSON `structureRequirements.pageRegions` 为准,下方为默认区域):
|
|
263
|
+
> - 新增 `.vts-page-header`(标题 + 描述 + 标题区操作按钮)— 对应 JSON `pageStructure.regions.header`
|
|
264
|
+
> - 查询区从 `bg-bg_color p-5` 升级为 `.vts-filter-area`(有容器感 + 分隔线)— 对应 `pageStructure.regions.filter`
|
|
265
|
+
> - 表格区外包 `.vts-table-area`(有圆角边框包裹)— 对应 `pageStructure.regions.table`
|
|
266
|
+
> - 主操作按钮(新增/导入)从 `ReTableBar #buttons` 移到 `.vts-page-header__actions`
|
|
267
|
+
> - 若 JSON 指定额外区域(如统计区、页签切换区),按 `pageStructure.regions` 顺序在 `otherRef` 位或独立区域中实现
|
|
268
|
+
|
|
269
|
+
| # | 必须 |
|
|
270
|
+
|---|------|
|
|
271
|
+
| D1 | `el-card` + `class="vts-page-card"` + `ref="content"`(同 L1) |
|
|
272
|
+
| D2 | `.vts-page-header`:标题 18px 加粗 + 描述 13px tertiary + 右侧操作按钮(新增/导入) |
|
|
273
|
+
| D3 | `.vts-filter-area`:筛选区容器(独立背景 + 圆角 + 底部分隔线) |
|
|
274
|
+
| D4 | `.vts-action-bar`:表格上方操作栏(批量删除等 + 右侧刷新/列设置) |
|
|
275
|
+
| D5 | `.vts-table-area`:表格区包裹(圆角 + 边框) |
|
|
276
|
+
| D6 | 表头:品牌色浅底 + 字重 600 + 底部强调线(由 `element-plus.scss` 全局提供) |
|
|
277
|
+
| D7 | 行 hover:品牌色极浅底 + 过渡(由 `element-plus.scss` 全局提供) |
|
|
278
|
+
| D8 | 其余同 L4-L9(ReGrid / ReTableBar / RePagination / ReTableOperate) |
|
|
279
|
+
|
|
280
|
+
```vue
|
|
281
|
+
<script setup lang="ts">
|
|
282
|
+
import type { OperateButton } from "@/components/ReTableOperate";
|
|
283
|
+
import type { Customer, CustomerQuery } from "@/api/customer";
|
|
284
|
+
import { getCustomerList } from "@/api/customer";
|
|
285
|
+
import { ReGrid } from "@/components/ReGrid";
|
|
286
|
+
import { ReGridItem } from "@/components/ReGridItem";
|
|
287
|
+
import { RePagination } from "@/components/RePagination";
|
|
288
|
+
import { ReTableBar } from "@/components/ReTableBar";
|
|
289
|
+
import { ReTableOperate, resolveOperateColumnWidth } from "@/components/ReTableOperate";
|
|
290
|
+
import { useApp } from "@/hooks/useApp";
|
|
291
|
+
import { useTableSearch } from "@/hooks/useTableSearch";
|
|
292
|
+
import { message } from "@/utils/message";
|
|
293
|
+
|
|
294
|
+
defineOptions({ name: "CustomerList" });
|
|
295
|
+
|
|
296
|
+
const { svgLoading } = useApp();
|
|
297
|
+
const formQuery = reactive<CustomerQuery>({ keyword: "", status: undefined });
|
|
298
|
+
|
|
299
|
+
const {
|
|
300
|
+
content,
|
|
301
|
+
otherRef,
|
|
302
|
+
tableHeight,
|
|
303
|
+
paginationRef,
|
|
304
|
+
loading,
|
|
305
|
+
formRef,
|
|
306
|
+
multipleTableRef,
|
|
307
|
+
pagination,
|
|
308
|
+
onSearch,
|
|
309
|
+
tableData,
|
|
310
|
+
gridRef,
|
|
311
|
+
showCollapse,
|
|
312
|
+
collapsed,
|
|
313
|
+
collapsedToggle,
|
|
314
|
+
upBold,
|
|
315
|
+
downBold,
|
|
316
|
+
reset,
|
|
317
|
+
} = useTableSearch(
|
|
318
|
+
formQuery,
|
|
319
|
+
getCustomerList,
|
|
320
|
+
`${import.meta.env.VITE_API_BASE_URL}/console/customer/list`,
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
const tableList = computed(() => tableData.value.tableList as Customer[]);
|
|
324
|
+
|
|
325
|
+
const operateLimit = 3;
|
|
326
|
+
|
|
327
|
+
const operateButtons: OperateButton[] = [
|
|
328
|
+
{
|
|
329
|
+
label: $t("删除"),
|
|
330
|
+
type: "danger",
|
|
331
|
+
icon: "i-ep:delete",
|
|
332
|
+
onClick: (row) => handleDelete(row as Customer),
|
|
333
|
+
},
|
|
334
|
+
];
|
|
335
|
+
|
|
336
|
+
onMounted(() => onSearch());
|
|
337
|
+
|
|
338
|
+
function handleDelete(row: Customer) {
|
|
339
|
+
message($t("删除成功"), { type: "success" });
|
|
340
|
+
onSearch();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function handleCurrentChange(cur: number) {
|
|
344
|
+
pagination.currentPage = cur;
|
|
345
|
+
onSearch();
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function handleSizeChange(size: number) {
|
|
349
|
+
pagination.pageSize = size;
|
|
350
|
+
onSearch();
|
|
351
|
+
}
|
|
352
|
+
</script>
|
|
353
|
+
|
|
354
|
+
<template>
|
|
355
|
+
<div>
|
|
356
|
+
<el-card
|
|
357
|
+
ref="content"
|
|
358
|
+
class="vts-page-card"
|
|
359
|
+
shadow="never"
|
|
360
|
+
>
|
|
361
|
+
<!-- D2: 页面标题区 -->
|
|
362
|
+
<div class="vts-page-header">
|
|
363
|
+
<div class="vts-page-header__info">
|
|
364
|
+
<span class="vts-page-header__title">{{ $t("客户列表") }}</span>
|
|
365
|
+
<span class="vts-page-header__desc">{{ $t("管理客户的售价、类型与库存信息") }}</span>
|
|
366
|
+
</div>
|
|
367
|
+
<div class="vts-page-header__actions">
|
|
368
|
+
<el-button
|
|
369
|
+
type="primary"
|
|
370
|
+
v-auth="['admin']"
|
|
371
|
+
@click="handleAdd"
|
|
372
|
+
>
|
|
373
|
+
{{ $t("新增") }}
|
|
374
|
+
</el-button>
|
|
375
|
+
<el-button v-auth="['admin']">{{ $t("导入") }}</el-button>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<!-- D3: 筛选区容器 -->
|
|
380
|
+
<div class="vts-filter-area">
|
|
381
|
+
<el-form
|
|
382
|
+
ref="formRef"
|
|
383
|
+
:inline="true"
|
|
384
|
+
:model="formQuery"
|
|
385
|
+
>
|
|
386
|
+
<ReGrid
|
|
387
|
+
ref="gridRef"
|
|
388
|
+
:collapsed="collapsed"
|
|
389
|
+
:gap="[0, 20]"
|
|
390
|
+
:cols="{ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }"
|
|
391
|
+
style="max-height: 300px; overflow-y: auto;"
|
|
392
|
+
@should-show-collapse="(val) => (showCollapse = val)"
|
|
393
|
+
>
|
|
394
|
+
<ReGridItem index="0">
|
|
395
|
+
<el-form-item :label="$t('关键词')" prop="keyword" class="w-[100%] !mr-0">
|
|
396
|
+
<el-input v-model="formQuery.keyword" clearable :placeholder="$t('请输入')" />
|
|
397
|
+
</el-form-item>
|
|
398
|
+
</ReGridItem>
|
|
399
|
+
<ReGridItem index="1">
|
|
400
|
+
<el-form-item :label="$t('状态')" prop="status" class="w-[100%] !mr-0">
|
|
401
|
+
<el-select v-model="formQuery.status" clearable :placeholder="$t('请选择')">
|
|
402
|
+
<el-option :label="$t('启用')" :value="1" />
|
|
403
|
+
<el-option :label="$t('禁用')" :value="0" />
|
|
404
|
+
</el-select>
|
|
405
|
+
</el-form-item>
|
|
406
|
+
</ReGridItem>
|
|
407
|
+
<ReGridItem suffix>
|
|
408
|
+
<div class="flex flex-end">
|
|
409
|
+
<el-button
|
|
410
|
+
type="primary"
|
|
411
|
+
:loading="loading"
|
|
412
|
+
@click="pagination.currentPage = 1; pagination.pageSize = 10; onSearch()"
|
|
413
|
+
>
|
|
414
|
+
{{ $t("查询") }}
|
|
415
|
+
</el-button>
|
|
416
|
+
<el-button @click="reset">{{ $t("重置") }}</el-button>
|
|
417
|
+
<el-button
|
|
418
|
+
v-if="showCollapse"
|
|
419
|
+
type="primary"
|
|
420
|
+
link
|
|
421
|
+
class="!font-size-12"
|
|
422
|
+
@click="collapsedToggle"
|
|
423
|
+
>
|
|
424
|
+
{{ collapsed ? $t("展开") : $t("收起") }}
|
|
425
|
+
<el-icon class="el-icon--right">
|
|
426
|
+
<component :is="collapsed ? downBold : upBold" />
|
|
427
|
+
</el-icon>
|
|
428
|
+
</el-button>
|
|
429
|
+
</div>
|
|
430
|
+
</ReGridItem>
|
|
431
|
+
</ReGrid>
|
|
432
|
+
</el-form>
|
|
433
|
+
</div>
|
|
434
|
+
|
|
435
|
+
<div ref="otherRef">
|
|
436
|
+
<!-- 统计/页签等额外模块;无则删除整段 -->
|
|
437
|
+
</div>
|
|
438
|
+
|
|
439
|
+
<!-- D4+D5: 操作栏 + 表格区 -->
|
|
440
|
+
<div class="vts-table-area">
|
|
441
|
+
<ReTableBar :columns="[]" @refresh="onSearch">
|
|
442
|
+
<template #title>
|
|
443
|
+
<span class="truncate font-size-16 font-bold">{{ $t("展示列表") }}</span>
|
|
444
|
+
</template>
|
|
445
|
+
<template #buttons>
|
|
446
|
+
<el-button type="danger" v-auth="['admin']">{{ $t("批量删除") }}</el-button>
|
|
447
|
+
</template>
|
|
448
|
+
<template #default="{ size }">
|
|
449
|
+
<div class="vl-parent">
|
|
450
|
+
<el-table
|
|
451
|
+
ref="multipleTableRef"
|
|
452
|
+
v-loading.lock="loading"
|
|
453
|
+
:element-loading-text="$t('加载中')"
|
|
454
|
+
:element-loading-spinner="svgLoading"
|
|
455
|
+
element-loading-svg-view-box="0, 0, 20, 20"
|
|
456
|
+
:style="{ height: `${tableHeight}px` }"
|
|
457
|
+
:size="size"
|
|
458
|
+
:data="tableList"
|
|
459
|
+
row-key="id"
|
|
460
|
+
>
|
|
461
|
+
<el-table-column prop="code" :label="$t('编号')" min-width="120" />
|
|
462
|
+
<el-table-column prop="name" :label="$t('名称')" min-width="140" />
|
|
463
|
+
<el-table-column
|
|
464
|
+
:label="$t('操作')"
|
|
465
|
+
:width="resolveOperateColumnWidth({ list: operateButtons, limit: operateLimit, size })"
|
|
466
|
+
fixed="right"
|
|
467
|
+
>
|
|
468
|
+
<template #default="{ row, $index }">
|
|
469
|
+
<ReTableOperate
|
|
470
|
+
:list="operateButtons"
|
|
471
|
+
:row="row"
|
|
472
|
+
:index="$index"
|
|
473
|
+
:limit="operateLimit"
|
|
474
|
+
:size="size"
|
|
475
|
+
/>
|
|
476
|
+
</template>
|
|
477
|
+
</el-table-column>
|
|
478
|
+
</el-table>
|
|
479
|
+
<RePagination
|
|
480
|
+
ref="paginationRef"
|
|
481
|
+
:size="size"
|
|
482
|
+
:pagination="pagination"
|
|
483
|
+
@handle-current-change="handleCurrentChange"
|
|
484
|
+
@handle-size-change="handleSizeChange"
|
|
485
|
+
/>
|
|
486
|
+
</div>
|
|
487
|
+
</template>
|
|
488
|
+
</ReTableBar>
|
|
489
|
+
</div>
|
|
490
|
+
</el-card>
|
|
491
|
+
</div>
|
|
492
|
+
</template>
|
|
493
|
+
```
|
|
494
|
+
|
|
495
495
|
**设计模式与出厂模式的关键差异**:
|
|
496
496
|
|
|
497
497
|
| 差异点 | 出厂模式 | 设计模式 | JSON 来源 |
|