cimos7-vue3-common 0.4.96 → 0.4.97

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cimos7-vue3-common",
3
3
  "private": false,
4
- "version": "0.4.96",
4
+ "version": "0.4.97",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "miao_z"
@@ -144,7 +144,7 @@ const tData = ref([
144
144
  ]);
145
145
 
146
146
  const columns = [
147
- { key: 'serialIndex', label: '序号', width: '80px', default: true },
147
+ { key: 'serialIndex', label: '序号', width: '5rem', default: true },
148
148
  { key: 'name', label: '姓名', default: true },
149
149
  { key: 'age', label: '年龄', default: true },
150
150
  { key: 'amount', label: '金额', default: false }, // 默认不显示
@@ -605,10 +605,9 @@ const handleReset = (form) => {
605
605
  ### Events 事件
606
606
 
607
607
  | 事件名 | 说明 | 回调参数 |
608
- |--------|------|----------|
609
- | rowClick | 行点击 | (row, column, event, extraParam) |
610
- | search | 搜索 | (searchForm) |
611
- | reset | 重置 | (searchForm) |
608
+ |--------|------|----------| rowClick | 行点击 | (row, column, event, extraParam) |
609
+ | search | 搜索 | (searchForm, pageInfo) |
610
+ | reset | 重置 | (searchForm, pageInfo) |
612
611
  | loadSuccess | 数据加载成功 | (data) |
613
612
  | loadData | 加载数据(仅在传入 data 时触发) | (pageInfo, searchForm) |
614
613
  | tapOpt | 批量操作按钮点击 | (checkedArray) |
@@ -710,6 +709,7 @@ console.log(tableRef.value.pageInfo); // { pageIndex, pageSize, total }
710
709
 
711
710
  <!-- 搜索栏左侧按钮 -->
712
711
  <template #searchLeft>
712
+ <el-input :span="6" placeholder="请输入用户名" v-model="searchParams.username" />
713
713
  <el-button type="primary">新增</el-button>
714
714
  </template>
715
715
 
@@ -725,15 +725,15 @@ console.log(tableRef.value.pageInfo); // { pageIndex, pageSize, total }
725
725
 
726
726
  <!-- 统计数据卡片 -->
727
727
  <template #chartCard>
728
- <el-card style="margin-top: 12px;">
729
- <div style="display: flex; gap: 24px;">
728
+ <el-card style="margin-top: .75rem;">
729
+ <div style="display: flex; gap: 1.5rem;">
730
730
  <div>
731
- <div style="color: #999; font-size: 12px;">总记录数</div>
732
- <div style="font-size: 24px; font-weight: bold;">{{ tData.length }}</div>
731
+ <div style="color: #999; font-size: .75rem;">总记录数</div>
732
+ <div style="font-size: 1.5rem; font-weight: bold;">{{ tData.length }}</div>
733
733
  </div>
734
734
  <div>
735
- <div style="color: #999; font-size: 12px;">平均年龄</div>
736
- <div style="font-size: 24px; font-weight: bold;">{{ avgAge }}</div>
735
+ <div style="color: #999; font-size: .75rem;">平均年龄</div>
736
+ <div style="font-size: 1.5rem; font-weight: bold;">{{ avgAge }}</div>
737
737
  </div>
738
738
  </div>
739
739
  </el-card>
@@ -772,7 +772,7 @@ const avgAge = computed(() => {
772
772
  });
773
773
 
774
774
  const columns = [
775
- { key: 'serialIndex', label: '序号', width: '80px', show: true },
775
+ { key: 'serialIndex', label: '序号', width: '5rem', show: true },
776
776
  { key: 'name', label: '姓名', show: true },
777
777
  { key: 'age', label: '年龄', show: true },
778
778
  { key: 'action', label: '操作', width: 200, show: true },
@@ -794,12 +794,16 @@ const tapDelete = (scope) => {
794
794
  console.log('删除:', scope.row);
795
795
  };
796
796
 
797
- const handleSearch = (form) => {
798
- console.log('搜索:', form);
797
+ const handleSearch = (form, pageInfo) => {
798
+ console.log('搜索:', form, pageInfo);
799
+ // 请求列表数据时需要带上 pageInfo
800
+ fetchList({ ...form, pageInfo });
799
801
  };
800
802
 
801
- const handleReset = () => {
802
- console.log('重置');
803
+ const handleReset = (form, pageInfo) => {
804
+ console.log('重置:', form, pageInfo);
805
+ // 请求列表数据时需要带上 pageInfo
806
+ fetchList({ ...form, pageInfo });
803
807
  };
804
808
 
805
809
  const handleChangeColumns = (selectedKeys) => {
@@ -837,6 +841,7 @@ const handleBatchExport = () => {
837
841
 
838
842
  <!-- 搜索栏左侧按钮 -->
839
843
  <template #searchLeft>
844
+ <el-input :span="6" placeholder="请输入用户名" v-model="searchParams.username" />
840
845
  <el-button type="primary">新增</el-button>
841
846
  </template>
842
847
 
@@ -847,11 +852,11 @@ const handleBatchExport = () => {
847
852
 
848
853
  <!-- 统计数据 -->
849
854
  <template #chartCard>
850
- <el-card style="margin-top: 12px;">
851
- <div style="display: flex; gap: 24px;">
855
+ <el-card style="margin-top: .75rem;">
856
+ <div style="display: flex; gap: 1.5rem;">
852
857
  <div>
853
- <div style="color: #999; font-size: 12px;">总记录数</div>
854
- <div style="font-size: 24px; font-weight: bold;">{{ totalCount }}</div>
858
+ <div style="color: #999; font-size: .75rem;">总记录数</div>
859
+ <div style="font-size: 1.5rem; font-weight: bold;">{{ totalCount }}</div>
855
860
  </div>
856
861
  </div>
857
862
  </el-card>
@@ -880,7 +885,7 @@ const checkedColumn = ref([]);
880
885
  const totalCount = ref(0);
881
886
 
882
887
  const columns = [
883
- { key: 'serialIndex', label: '序号', width: '80px', show: true },
888
+ { key: 'serialIndex', label: '序号', width: '5rem', show: true },
884
889
  { key: 'name', label: '姓名', show: true },
885
890
  { key: 'age', label: '年龄', show: true },
886
891
  { key: 'action', label: '操作', width: 200, show: true },
@@ -981,7 +986,7 @@ const tData = ref([
981
986
  ]);
982
987
 
983
988
  const columns = [
984
- { key: 'serialIndex', label: '序号', width: '80px', show: true },
989
+ { key: 'serialIndex', label: '序号', width: '5rem', show: true },
985
990
  { key: 'name', label: '姓名', show: true },
986
991
  { key: 'age', label: '年龄', show: true },
987
992
  { key: 'action', label: '操作', width: 200, show: true },
@@ -1031,7 +1036,7 @@ const tableRef = ref(null);
1031
1036
  const checkedColumn = ref([]);
1032
1037
 
1033
1038
  const columns = [
1034
- { key: 'serialIndex', label: '序号', width: '80px' },
1039
+ { key: 'serialIndex', label: '序号', width: '5rem' },
1035
1040
  { key: 'name', label: '姓名' },
1036
1041
  { key: 'age', label: '年龄' },
1037
1042
  { key: 'action', label: '操作', width: 160 },
@@ -1249,7 +1254,7 @@ const loadColumns = async () => {
1249
1254
 
1250
1255
  ```vue
1251
1256
  <template>
1252
- <div style="padding: 20px;">
1257
+ <div style="padding: 1.25rem;">
1253
1258
  <h3>基础用法</h3>
1254
1259
  <IconPark name="Home" />
1255
1260
 
@@ -1279,7 +1284,7 @@ const loadColumns = async () => {
1279
1284
  <h3>自定义样式</h3>
1280
1285
  <IconPark
1281
1286
  name="Home"
1282
- :customStyle="{ marginRight: '10px', opacity: 0.8 }"
1287
+ :customStyle="{ marginRight: '.625rem', opacity: 0.8 }"
1283
1288
  />
1284
1289
 
1285
1290
  <h3>带边框</h3>
@@ -1312,17 +1317,17 @@ const handleClick = (event) => {
1312
1317
  ```vue
1313
1318
  <template>
1314
1319
  <el-button type="primary">
1315
- <IconPark name="Add" style="margin-right: 4px;" />
1320
+ <IconPark name="Add" style="margin-right: .25rem;" />
1316
1321
  新增
1317
1322
  </el-button>
1318
1323
 
1319
1324
  <el-button>
1320
- <IconPark name="Edit" style="margin-right: 4px;" />
1325
+ <IconPark name="Edit" style="margin-right: .25rem;" />
1321
1326
  编辑
1322
1327
  </el-button>
1323
1328
 
1324
1329
  <el-button type="danger">
1325
- <IconPark name="Delete" style="margin-right: 4px;" />
1330
+ <IconPark name="Delete" style="margin-right: .25rem;" />
1326
1331
  删除
1327
1332
  </el-button>
1328
1333
  </template>
@@ -1338,7 +1343,7 @@ import { IconPark } from 'cimos7-vue3-common';
1338
1343
  <template>
1339
1344
  <CTable :data="tableData" :columns="columns">
1340
1345
  <template #action="scope">
1341
- <span style="display: flex; gap: 8px;">
1346
+ <span style="display: flex; gap: .5rem;">
1342
1347
  <IconPark
1343
1348
  name="Edit"
1344
1349
  color="#1890ff"
@@ -1402,7 +1407,7 @@ const handleDelete = (row) => {
1402
1407
  | data | 数据对象 | Object | {} | 是 |
1403
1408
  | title | 标题文本 | String | '详情信息' | 否 |
1404
1409
  | columnsCount | 列数 | Number | 3 | 否 |
1405
- | gap | 网格间距 | String | '12px 16px' | 否 |
1410
+ | gap | 网格间距 | String | '.75rem 1rem' | 否 |
1406
1411
  | tooltipProps | Tooltip 配置对象,支持 Element Plus el-tooltip 所有属性 | Object | { placement: 'top', effect: 'dark' } | 否 |
1407
1412
 
1408
1413
  ### fields 配置项
@@ -1443,13 +1448,13 @@ const handleDelete = (row) => {
1443
1448
 
1444
1449
  ```vue
1445
1450
  <template>
1446
- <div style="padding: 20px;">
1451
+ <div style="padding: 1.25rem;">
1447
1452
  <CFieldList
1448
1453
  :fields="fields"
1449
1454
  :data="data"
1450
1455
  title="用户详情"
1451
1456
  :columnsCount="2"
1452
- gap="16px 24px"
1457
+ gap="1rem 1.5rem"
1453
1458
  />
1454
1459
  </div>
1455
1460
  </template>
@@ -1493,7 +1498,7 @@ const fields = ref([
1493
1498
 
1494
1499
  ```vue
1495
1500
  <template>
1496
- <div style="padding: 20px;">
1501
+ <div style="padding: 1.25rem;">
1497
1502
  <CFieldList
1498
1503
  :fields="fields"
1499
1504
  :data="data"
@@ -1552,7 +1557,7 @@ const tooltipProps = ref({
1552
1557
 
1553
1558
  ```vue
1554
1559
  <template>
1555
- <div style="padding: 20px;">
1560
+ <div style="padding: 1.25rem;">
1556
1561
  <CFieldList
1557
1562
  :fields="fields"
1558
1563
  :data="data"
@@ -1647,7 +1652,7 @@ CnUpload 组件主要通过配置使用,暂无额外插槽。
1647
1652
 
1648
1653
  ```vue
1649
1654
  <template>
1650
- <div style="padding: 20px;">
1655
+ <div style="padding: 1.25rem;">
1651
1656
  <CnUpload
1652
1657
  v-model="fileList"
1653
1658
  :uploadPath="uploadPath"
@@ -1684,7 +1689,7 @@ const handleError = (file) => {
1684
1689
 
1685
1690
  ```vue
1686
1691
  <template>
1687
- <div style="padding: 20px;">
1692
+ <div style="padding: 1.25rem;">
1688
1693
  <CnUpload
1689
1694
  v-model="fileList"
1690
1695
  :uploadPath="uploadPath"
@@ -1720,7 +1725,7 @@ const beforeUpload = (files) => {
1720
1725
 
1721
1726
  ```vue
1722
1727
  <template>
1723
- <div style="padding: 20px;">
1728
+ <div style="padding: 1.25rem;">
1724
1729
  <CnUpload
1725
1730
  v-model="fileList"
1726
1731
  :uploadPath="uploadPath"
@@ -1747,7 +1752,7 @@ const handleChange = (fileList) => {
1747
1752
 
1748
1753
  ```vue
1749
1754
  <template>
1750
- <div style="padding: 20px;">
1755
+ <div style="padding: 1.25rem;">
1751
1756
  <CnUpload
1752
1757
  v-model="fileList"
1753
1758
  :uploadPath="uploadPath"
@@ -1770,7 +1775,7 @@ const uploadPath = '/api/file/upload';
1770
1775
 
1771
1776
  ```vue
1772
1777
  <template>
1773
- <div style="padding: 20px;">
1778
+ <div style="padding: 1.25rem;">
1774
1779
  <CnUpload
1775
1780
  v-model="fileList"
1776
1781
  :uploadPath="uploadPath"
@@ -1831,6 +1836,11 @@ const handleProgress = (file) => {
1831
1836
 
1832
1837
  ## 更新日志
1833
1838
 
1839
+ ### v1.6.0
1840
+ - TableLayout: search 和 reset 事件新增 pageInfo 参数传递
1841
+ - TableLayout: 父组件请求列表数据时需要带上 pageInfo(包含 pageIndex、pageSize、total)
1842
+ - TableLayout: 更新文档,说明 search/reset 事件新的参数格式和使用方法
1843
+
1834
1844
  ### v1.5.0
1835
1845
  - 新增 CnUpload 组件:文件上传组件,支持多文件上传、拖拽上传、拖拽排序、上传进度、上传中断等功能
1836
1846
  - CnUpload: 内置多种文件类型图标(图片、视频、音频、PDF、Word、Excel、压缩包等)
@@ -1850,11 +1860,9 @@ const handleProgress = (file) => {
1850
1860
  ### v1.2.0
1851
1861
  - SearchHeader: 重构插槽的显示逻辑,插槽内容作为 el-col 参与 24 栅格布局
1852
1862
  - SearchHeader: 折叠时,插槽内容与搜索配置项一起计算显示(按顺序:searchLeft → 搜索项 → searchMiddle → searchBtnAfter)
1853
- - SearchHeader: searchLeftSpan、searchMiddleSpan、searchBtnAfterSpan 现在表示插槽实际占用的 span
1854
1863
  - 更新组件使用文档,说明新的插槽折叠逻辑
1855
1864
 
1856
1865
  ### v1.1.0
1857
- - SearchHeader: 新增 searchLeftSpan、searchMiddleSpan、searchBtnAfterSpan 属性
1858
1866
  - SearchHeader: 考虑插槽内容占用的 span,优化展开/收起逻辑
1859
1867
  - SearchHeader: 修复插槽内容影响行数计算的问题
1860
1868
  - 更新组件使用文档,添加插槽预留 span 的使用说明和示例