verce-vue-test 0.0.139 → 0.0.140

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,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.139",
3
+ "version": "0.0.140",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -824,6 +824,37 @@ initColumns()
824
824
  width: 100%;
825
825
  }
826
826
 
827
+ /**
828
+ * 小尺寸表格样式:压缩单元格上下留白,并加粗底部横向滚动条的可操作区域。
829
+ */
830
+ .el-table-plus :deep(.el-table--small) {
831
+ --el-table-text-color: #000;
832
+ --el-table-header-text-color: #000;
833
+ color: #000;
834
+ }
835
+
836
+ .el-table-plus :deep(.el-table--small .el-table__cell) {
837
+ padding: 0 !important;
838
+ }
839
+
840
+ .el-table-plus :deep(.el-table--small .cell) {
841
+ line-height: 20px !important;
842
+ color: #000 !important;
843
+ }
844
+
845
+ .el-table-plus :deep(.el-table--small .el-table__empty-text) {
846
+ color: #000;
847
+ }
848
+
849
+ .el-table-plus :deep(.el-table--small .el-table-column--selection > .cell) {
850
+ height: 20px;
851
+ }
852
+
853
+ .el-table-plus :deep(.el-table--small .el-table__body-wrapper .el-scrollbar__bar.is-horizontal) {
854
+ height: 20px;
855
+ bottom: 0;
856
+ }
857
+
827
858
  /**
828
859
  * 工具栏样式
829
860
  */
@@ -17,9 +17,7 @@ import {
17
17
  } from '@element-plus/icons-vue'
18
18
  import {
19
19
  formatDate,
20
- type ForecastStatus,
21
20
  type ForeignPositionForecast,
22
- type VerifyStatus,
23
21
  } from './model'
24
22
  import {
25
23
  foreignPositionForecastBusinessContext,
@@ -127,14 +125,6 @@ function formatMoney(value: number) {
127
125
  })
128
126
  }
129
127
 
130
- function statusTagType(status: ForecastStatus) {
131
- return ['PS01', 'PS02', 'PS06', 'PS07'].includes(status) ? 'primary' : 'info'
132
- }
133
-
134
- function verifyTagType(status: VerifyStatus) {
135
- return status === 'VS03' ? 'info' : 'primary'
136
- }
137
-
138
128
  function validateAmountRange() {
139
129
  const { minAmount, maxAmount } = filterForm.value
140
130
  const componentValid = amountRangeRef.value?.validate() ?? amountRangeValid.value
@@ -301,6 +291,24 @@ function getDeleteRestriction(row: ForeignPositionForecast) {
301
291
  return ''
302
292
  }
303
293
 
294
+ const singleSelectedRow = computed(() => (
295
+ selectedRows.value.length === 1 ? selectedRows.value[0] : null
296
+ ))
297
+
298
+ const singleSelectionTip = computed(() => {
299
+ if (selectedRows.value.length === 0) return '请选择一条数据'
300
+ if (selectedRows.value.length > 1) return '仅支持选择一条数据,请取消多余选择'
301
+ return ''
302
+ })
303
+
304
+ const selectedEditRestriction = computed(() => (
305
+ singleSelectedRow.value ? getEditRestriction(singleSelectedRow.value) : ''
306
+ ))
307
+
308
+ const selectedDeleteRestriction = computed(() => (
309
+ singleSelectedRow.value ? getDeleteRestriction(singleSelectedRow.value) : ''
310
+ ))
311
+
304
312
  function openAddEditor() {
305
313
  clearTableSelection()
306
314
  editorMode.value = 'add'
@@ -427,6 +435,21 @@ async function handleAuthorization(row: ForeignPositionForecast) {
427
435
  }
428
436
  }
429
437
 
438
+ function handleSelectedEdit() {
439
+ if (!singleSelectedRow.value) return
440
+ void openEditEditor(singleSelectedRow.value)
441
+ }
442
+
443
+ function handleSelectedDelete() {
444
+ if (!singleSelectedRow.value) return
445
+ void handleDelete(singleSelectedRow.value)
446
+ }
447
+
448
+ function handleSelectedAuthorization() {
449
+ if (!singleSelectedRow.value) return
450
+ void handleAuthorization(singleSelectedRow.value)
451
+ }
452
+
430
453
  async function handleApproval(approved: boolean) {
431
454
  if (approvalAction.value) return
432
455
 
@@ -499,7 +522,7 @@ onBeforeUnmount(() => {
499
522
 
500
523
  <template v-else>
501
524
  <section class="query-panel" aria-label="外币头寸预报查询条件">
502
- <el-form :model="filterForm" label-position="top" size="small" class="query-form">
525
+ <el-form :model="filterForm" label-position="top" size="small" class="query-form" @submit.prevent="handleQuery">
503
526
  <div class="query-grid" :class="{ 'is-collapsed': filterCollapsed }">
504
527
  <el-form-item label="起息日">
505
528
  <el-date-picker
@@ -611,20 +634,20 @@ onBeforeUnmount(() => {
611
634
  @validate="amountRangeValid = $event"
612
635
  />
613
636
  </el-form-item>
614
- </div>
615
637
 
616
- <div class="query-actions">
617
- <el-button
618
- text
619
- type="primary"
620
- :icon="filterCollapsed ? ArrowDown : ArrowUp"
621
- :aria-expanded="!filterCollapsed"
622
- @click="filterCollapsed = !filterCollapsed"
623
- >
624
- {{ filterCollapsed ? '展开筛选' : '收起筛选' }}
625
- </el-button>
626
- <el-button :icon="RefreshLeft" @click="handleReset">重置</el-button>
627
- <el-button type="primary" :icon="Search" :loading="isQuerying" @click="handleQuery">查询</el-button>
638
+ <div class="query-actions">
639
+ <el-button
640
+ text
641
+ type="primary"
642
+ :icon="filterCollapsed ? ArrowDown : ArrowUp"
643
+ :aria-expanded="!filterCollapsed"
644
+ @click="filterCollapsed = !filterCollapsed"
645
+ >
646
+ {{ filterCollapsed ? '展开筛选' : '收起筛选' }}
647
+ </el-button>
648
+ <el-button :icon="RefreshLeft" @click="handleReset">重置</el-button>
649
+ <el-button native-type="submit" type="primary" :icon="Search" :loading="isQuerying">查询</el-button>
650
+ </div>
628
651
  </div>
629
652
  </el-form>
630
653
  </section>
@@ -679,6 +702,64 @@ onBeforeUnmount(() => {
679
702
  <template #toolbar>
680
703
  <div class="table-toolbar-actions">
681
704
  <el-button size="small" type="primary" :icon="Plus" @click="openAddEditor">新增</el-button>
705
+ <el-tooltip
706
+ :content="selectedEditRestriction || singleSelectionTip"
707
+ placement="top"
708
+ :show-after="200"
709
+ :disabled="selectedRows.length === 1 && !selectedEditRestriction"
710
+ >
711
+ <span class="toolbar-action-tooltip">
712
+ <el-button
713
+ size="small"
714
+ type="primary"
715
+ :icon="EditPen"
716
+ :disabled="!singleSelectedRow || Boolean(selectedEditRestriction)"
717
+ :plain="!singleSelectedRow || Boolean(selectedEditRestriction)"
718
+ @click="handleSelectedEdit"
719
+ >
720
+ 修改
721
+ </el-button>
722
+ </span>
723
+ </el-tooltip>
724
+ <el-tooltip
725
+ :content="selectedDeleteRestriction || singleSelectionTip"
726
+ placement="top"
727
+ :show-after="200"
728
+ :disabled="selectedRows.length === 1 && !selectedDeleteRestriction"
729
+ >
730
+ <span class="toolbar-action-tooltip">
731
+ <el-button
732
+ size="small"
733
+ type="danger"
734
+ :icon="Delete"
735
+ :disabled="!singleSelectedRow || Boolean(selectedDeleteRestriction)"
736
+ :plain="!singleSelectedRow || Boolean(selectedDeleteRestriction)"
737
+ @click="handleSelectedDelete"
738
+ >
739
+ 删除
740
+ </el-button>
741
+ </span>
742
+ </el-tooltip>
743
+ <el-tooltip
744
+ :content="singleSelectionTip"
745
+ placement="top"
746
+ :show-after="200"
747
+ :disabled="selectedRows.length === 1"
748
+ >
749
+ <span class="toolbar-action-tooltip">
750
+ <el-button
751
+ size="small"
752
+ type="primary"
753
+ :icon="singleSelectedRow?.authirization === '1' ? CircleClose : CircleCheck"
754
+ :loading="Boolean(authorizationActionPredRefNo)"
755
+ :disabled="!singleSelectedRow || Boolean(authorizationActionPredRefNo)"
756
+ :plain="!singleSelectedRow || Boolean(authorizationActionPredRefNo)"
757
+ @click="handleSelectedAuthorization"
758
+ >
759
+ {{ singleSelectedRow?.authirization === '1' ? '取消授权' : '授权' }}
760
+ </el-button>
761
+ </span>
762
+ </el-tooltip>
682
763
  <span class="operation-divider" aria-hidden="true"></span>
683
764
  <el-button size="small" :icon="UploadFilled">导入</el-button>
684
765
  </div>
@@ -720,26 +801,18 @@ onBeforeUnmount(() => {
720
801
  <template #default="{ row }">{{ getOptionLabel(forecastWayOptions, row.predWay) }}</template>
721
802
  </el-table-column>
722
803
  <el-table-column label="预报状态" width="136">
723
- <template #default="{ row }">
724
- <el-tag :type="statusTagType(row.predStatus)" size="small" effect="light">
725
- {{ getOptionLabel(forecastStatusOptions, row.predStatus) }}
726
- </el-tag>
727
- </template>
804
+ <template #default="{ row }">{{ getOptionLabel(forecastStatusOptions, row.predStatus) }}</template>
728
805
  </el-table-column>
729
806
  <el-table-column label="预报类型" width="102">
730
807
  <template #default="{ row }">{{ getOptionLabel(forecastTypeOptions, row.predType) }}</template>
731
808
  </el-table-column>
732
809
  <el-table-column prop="groundBranch" label="落地机构" width="160" show-overflow-tooltip />
733
810
  <el-table-column label="收支方向" width="88">
734
- <template #default="{ row }">
735
- <span class="direction-text" :class="row.payDirection === 'I' ? 'is-income' : 'is-expense'">
736
- {{ getOptionLabel(payDirectionOptions, row.payDirection) }}
737
- </span>
738
- </template>
811
+ <template #default="{ row }">{{ getOptionLabel(payDirectionOptions, row.payDirection) }}</template>
739
812
  </el-table-column>
740
813
  <el-table-column prop="bankAccount" label="账户行" width="188" show-overflow-tooltip />
741
814
  <el-table-column prop="currency" label="币种" width="82">
742
- <template #default="{ row }"><strong class="currency-code">{{ row.currency }}</strong></template>
815
+ <template #default="{ row }">{{ row.currency }}</template>
743
816
  </el-table-column>
744
817
  <el-table-column
745
818
  prop="predAmount"
@@ -753,11 +826,7 @@ onBeforeUnmount(() => {
753
826
  </el-table-column>
754
827
  <el-table-column prop="valueDate" label="起息日" width="116" />
755
828
  <el-table-column label="核销状态" width="108">
756
- <template #default="{ row }">
757
- <el-tag :type="verifyTagType(row.verifyStatus)" size="small" effect="plain">
758
- {{ getOptionLabel(verifyStatusOptions, row.verifyStatus) }}
759
- </el-tag>
760
- </template>
829
+ <template #default="{ row }">{{ getOptionLabel(verifyStatusOptions, row.verifyStatus) }}</template>
761
830
  </el-table-column>
762
831
  <el-table-column prop="verifyAmount" label="核销金额(元)" width="148" align="right">
763
832
  <template #default="{ row }"><span class="money-cell">{{ formatMoney(row.verifyAmount) }}</span></template>
@@ -792,49 +861,6 @@ onBeforeUnmount(() => {
792
861
  >
793
862
  <template #default="{ row }">{{ row.approvalTime || '—' }}</template>
794
863
  </el-table-column>
795
- <el-table-column
796
- column-key="operation"
797
- label="操作"
798
- width="280"
799
- fixed="right"
800
- align="center"
801
- disabled
802
- >
803
- <template #default="{ row }">
804
- <div class="row-actions">
805
- <el-button
806
- link
807
- type="primary"
808
- :icon="EditPen"
809
- :disabled="Boolean(getEditRestriction(row))"
810
- :title="getEditRestriction(row)"
811
- @click.stop="openEditEditor(row)"
812
- >
813
- 修改
814
- </el-button>
815
- <el-button
816
- link
817
- type="danger"
818
- :icon="Delete"
819
- :disabled="Boolean(getDeleteRestriction(row))"
820
- :title="getDeleteRestriction(row)"
821
- @click.stop="handleDelete(row)"
822
- >
823
- 删除
824
- </el-button>
825
- <el-button
826
- link
827
- type="primary"
828
- :icon="row.authirization === '1' ? CircleClose : CircleCheck"
829
- :loading="authorizationActionPredRefNo === row.predRefNo"
830
- :disabled="Boolean(authorizationActionPredRefNo) && authorizationActionPredRefNo !== row.predRefNo"
831
- @click.stop="handleAuthorization(row)"
832
- >
833
- {{ row.authirization === '1' ? '取消授权' : '授权' }}
834
- </el-button>
835
- </div>
836
- </template>
837
- </el-table-column>
838
864
  </ElTablePro>
839
865
  </section>
840
866
 
@@ -865,15 +891,15 @@ onBeforeUnmount(() => {
865
891
  }
866
892
 
867
893
  .query-panel {
868
- margin-bottom: 10px;
869
- padding: 12px 16px 10px;
894
+ margin-bottom: 8px;
895
+ padding: 6px 10px;
870
896
  border-radius: 7px;
871
897
  }
872
898
 
873
899
  .query-grid {
874
900
  display: grid;
875
- grid-template-columns: repeat(6, minmax(0, 1fr));
876
- gap: 8px 12px;
901
+ grid-template-columns: repeat(8, minmax(0, 1fr));
902
+ gap: 3px 6px;
877
903
  }
878
904
 
879
905
  .query-grid.is-collapsed .filter-secondary {
@@ -886,12 +912,12 @@ onBeforeUnmount(() => {
886
912
  }
887
913
 
888
914
  .query-form :deep(.el-form-item__label) {
889
- height: 24px;
915
+ height: 18px;
890
916
  padding: 0;
891
917
  color: #475467;
892
918
  font-size: 12px;
893
919
  font-weight: 600;
894
- line-height: 24px;
920
+ line-height: 18px;
895
921
  }
896
922
 
897
923
  .query-form :deep(.el-input),
@@ -922,15 +948,18 @@ onBeforeUnmount(() => {
922
948
 
923
949
  .query-actions {
924
950
  display: flex;
951
+ grid-column: -3 / -1;
925
952
  justify-content: flex-end;
926
- gap: 8px;
927
- margin-top: 10px;
928
- padding-top: 10px;
929
- border-top: 1px dashed #e2e8f0;
953
+ align-self: end;
954
+ gap: 6px;
930
955
  }
931
956
 
932
957
  .query-actions .el-button {
933
- min-width: 86px;
958
+ min-width: 66px;
959
+ }
960
+
961
+ .query-actions .el-button + .el-button {
962
+ margin-left: 0;
934
963
  }
935
964
 
936
965
  .table-toolbar-actions {
@@ -940,6 +969,10 @@ onBeforeUnmount(() => {
940
969
  flex-wrap: wrap;
941
970
  }
942
971
 
972
+ .toolbar-action-tooltip {
973
+ display: inline-flex;
974
+ }
975
+
943
976
  .table-toolbar-actions .el-button + .el-button {
944
977
  margin-left: 0;
945
978
  }
@@ -1032,7 +1065,8 @@ onBeforeUnmount(() => {
1032
1065
  .forecast-table {
1033
1066
  width: 100%;
1034
1067
  --el-table-header-bg-color: #f3f6fa;
1035
- --el-table-header-text-color: #344054;
1068
+ --el-table-header-text-color: #000;
1069
+ --el-table-text-color: #000;
1036
1070
  --el-table-row-hover-bg-color: #f1f6ff;
1037
1071
  --el-table-border-color: #e1e6ed;
1038
1072
  }
@@ -1075,66 +1109,27 @@ onBeforeUnmount(() => {
1075
1109
  .forecast-table :deep(.el-table__cell) {
1076
1110
  padding: 6px 0;
1077
1111
  font-size: 12px;
1112
+ color: #000;
1078
1113
  }
1079
1114
 
1080
1115
  .forecast-table :deep(.el-table__row) {
1081
1116
  height: 42px;
1082
1117
  }
1083
1118
 
1084
- .forecast-table :deep(.el-tag) {
1085
- max-width: 100%;
1086
- }
1087
-
1088
- .money-cell,
1089
- .currency-code {
1119
+ .money-cell {
1120
+ color: #000;
1090
1121
  font-variant-numeric: tabular-nums;
1091
1122
  }
1092
1123
 
1093
1124
  .money-cell {
1094
- color: #27364f;
1095
1125
  font-weight: 650;
1096
1126
  }
1097
1127
 
1098
- .currency-code {
1099
- color: #174ea6;
1100
- letter-spacing: .03em;
1101
- }
1102
-
1103
- .direction-text {
1104
- font-weight: 700;
1105
- }
1106
-
1107
- .direction-text.is-income,
1108
- .direction-text.is-expense {
1109
- color: var(--page-blue);
1110
- }
1111
-
1112
- .row-actions {
1113
- display: flex;
1114
- align-items: center;
1115
- justify-content: center;
1116
- gap: 8px;
1117
- white-space: nowrap;
1118
- }
1119
-
1120
- .row-actions .el-button {
1121
- width: 78px;
1122
- justify-content: center;
1123
- }
1124
-
1125
- .row-actions .el-button + .el-button {
1126
- margin-left: 0;
1127
- }
1128
-
1129
1128
  @media (max-width: 1380px) {
1130
- .query-grid:not(.is-collapsed) {
1129
+ .query-grid {
1131
1130
  grid-template-columns: repeat(4, minmax(0, 1fr));
1132
1131
  }
1133
1132
 
1134
- .query-grid.is-collapsed {
1135
- grid-template-columns: repeat(6, minmax(0, 1fr));
1136
- }
1137
-
1138
1133
  .operation-bar {
1139
1134
  align-items: flex-start;
1140
1135
  flex-direction: column;
@@ -61,15 +61,21 @@ export const ftuFilterOptions = [
61
61
  ] satisfies SelectOption[]
62
62
 
63
63
  export const currencyOptions = [
64
- { value: 'USD', label: 'USD 美元' },
65
- { value: 'EUR', label: 'EUR 欧元' },
66
- { value: 'HKD', label: 'HKD 港币' },
67
- { value: 'JPY', label: 'JPY 日元' },
68
- { value: 'GBP', label: 'GBP 英镑' },
69
- { value: 'SGD', label: 'SGD 新加坡元' },
70
- { value: 'AUD', label: 'AUD 澳元' },
71
- { value: 'CAD', label: 'CAD 加拿大元' },
72
- { value: 'CHF', label: 'CHF 瑞士法郎' },
64
+ { value: 'CNY', label: 'CNY-人民币' },
65
+ { value: 'USD', label: 'USD-美元' },
66
+ { value: 'HKD', label: 'HKD-港元' },
67
+ { value: 'EUR', label: 'EUR-欧元' },
68
+ { value: 'AUD', label: 'AUD-澳大利亚元' },
69
+ { value: 'CHF', label: 'CHF-瑞士法郎' },
70
+ { value: 'GBP', label: 'GBP-英镑' },
71
+ { value: 'CAD', label: 'CAD-加拿大元' },
72
+ { value: 'NZD', label: 'NZD-新西兰元' },
73
+ { value: 'SGD', label: 'SGD-新加坡元' },
74
+ { value: 'JPY', label: 'JPY-日元' },
75
+ { value: 'SEK', label: 'SEK-瑞典克朗' },
76
+ { value: 'NOK', label: 'NOK-挪威克朗' },
77
+ { value: 'DKK', label: 'DKK-丹麦克朗' },
78
+ { value: 'KZT', label: 'KZT-哈萨克斯坦坚戈' },
73
79
  ] satisfies SelectOption[]
74
80
 
75
81
  export const clientTypeOptions = [
@@ -48,7 +48,7 @@ export const useForeignPositionForecastStore = defineStore(
48
48
  const selectionResetKey = ref(0)
49
49
  const isLoading = ref(false)
50
50
  const isQuerying = ref(false)
51
- const filterCollapsed = ref(true)
51
+ const filterCollapsed = ref(false)
52
52
  const currentPage = ref(1)
53
53
  const pageSize = ref(25)
54
54
  const successfulPage = ref(1)