From d36a75f67d80199d59419c96c63880f1ee99f03d Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 24 十一月 2025 14:03:43 +0800
Subject: [PATCH] Revert "测试"
---
pages/index.vue | 83 ++++++++++++++---------------------------
1 files changed, 29 insertions(+), 54 deletions(-)
diff --git a/pages/index.vue b/pages/index.vue
index 63d1fbb..98d5dba 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -106,8 +106,7 @@
<input class="form-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
</uni-td>
<!--<uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.daa008" />-->
- <!--宸ュ崟鏁伴噺-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa008" />--><!--宸ュ崟鏁伴噺-->
<!--</uni-td>-->
<uni-td align="center">
<input class="form-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
@@ -190,16 +189,11 @@
<div style="height: 400px; overflow: auto;">
<table>
+
<view class="section card">
- <uni-table ref="table"
- type="selection"
- border
- stripe
- emptyText="鏆傛棤鏇村鏁版嵁"
- class="large-selection-table"
- @selection-change="selectionChange">
+ <uni-table ref="table" type="selection" border stripe emptyText="鏆傛棤鏇村鏁版嵁"
+ class="large-selection-table" @selection-change="selectionChange">
<uni-tr>
- <uni-th type="selection" align="center" class="th" style="width: 70px;"></uni-th> <!-- 鏂板閫夋嫨鍒� -->
<uni-th align="center" class="th" style="color: #FFFFFF; width: 170px;">宸ュ簭</uni-th>
<uni-th align="center" class="th" style="color: #FFFFFF; width: 490px;">宸ュ崟鍙�</uni-th>
<uni-th align="center" class="th" style="color: #FFFFFF; width: 250px;">浜у搧缂栫爜</uni-th>
@@ -214,42 +208,42 @@
<!--<uni-th align="center" class="th" style="color: #FFFFFF; width: 100px;">閫夋嫨</uni-th>-->
</uni-tr>
<uni-tr v-for="(item, index) in tableData"
- :key="item.id || index" <!-- 淇敼: 浼樺厛浣跨敤鍚庣 id -->
+ :key="index"
:class="{'row-selected': selectedIndexs.includes(index)}"
@click="onRowClick(index)"
style="cursor: pointer;">
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.procName" /><!--宸ュ簭-->
+ <input class="form-input" disabled="true" type="text" v-model="item.procName" /><!--宸ュ簭-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa001" />
+ <input class="form-input" disabled="true" type="text" v-model="item.daa001" />
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa002" />
+ <input class="form-input" disabled="true" type="text" v-model="item.daa002" />
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa003" /><!--浜у搧鍚嶇О-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa003" /><!--浜у搧鍚嶇О-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa004" /><!--瑙勬牸-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa004" /><!--瑙勬牸-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa011" /><!--宸茬敓浜ф暟閲�-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa011" /><!--宸茬敓浜ф暟閲�-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" :value="(item.daa008 || 0) - (item.daa011 || 0)" /><!--鏈敓浜ф暟閲�-->
+ <input class="form-input" disabled="true" type="text" :value="(item.daa008 || 0) - (item.daa011 || 0)" /><!--鏈敓浜ф暟閲�-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
</uni-td>
<!--<uni-td align="center">
<input class="form-input" disabled="true" type="text" v-model="item.daa008" />--><!--宸ュ崟鏁伴噺-->
<!--</uni-td>-->
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
+ <input class="form-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
</uni-td>
<uni-td align="center">
- <input class="form-input row-input" disabled="true" type="text" v-model="item.staffName" /><!--鎶ュ伐浜�-->
+ <input class="form-input" disabled="true" type="text" v-model="item.staffName" /><!--鎶ュ伐浜�-->
</uni-td>
</uni-tr>
</uni-table>
@@ -350,16 +344,16 @@
this.refresh();
},
methods: {
- onRowClick(index) { // 淇敼: 鏁磋鐐瑰嚮瀹炵幇鍗曢��
- const row = this.tableData[index];
- if (!row) return;
- // 鍗曢��: 鍙繚鐣欏綋鍓嶇储寮�
- this.selectedIndexs = [index]; // 淇濈暀宸叉湁娉ㄩ噴閫昏緫
- // 濡傛灉 uni-table 鏆撮湶鏂规硶鍒欏悓姝ュ閫夋鐘舵��
- if (this.$refs.table) {
- this.$refs.table.clearSelection && this.$refs.table.clearSelection();
- this.$refs.table.toggleRowSelection && this.$refs.table.toggleRowSelection(row, true);
- }
+ onRowClick(index) {
+ this.selectedIndexs = [index];
+ this.$nextTick(() => {
+ const row = this.tableData[index];
+ if (this.$refs.table && this.$refs.table.toggleRowSelection) {
+ this.$refs.table.clearSelection && this.$refs.table.clearSelection();
+ this.$refs.table.toggleRowSelection(row, true);
+ }
+ });
+ this.selectionChange({ detail: { index } });
},
checkForUpdate() {
this.$post({
@@ -613,25 +607,10 @@
let day = String(date.getDate()).padStart(2, '0'); // 鑾峰彇鏃ユ湡骞惰ˉ闆�
return `${year}-${month}-${day}`; // 杩斿洖鏍煎紡鍖栧悗鐨勫瓧绗︿覆
},
- selectionChange(e) { // 淇敼: 浣跨敤 selection 鏁扮粍鑰屼笉鏄� index
- // 鍗曢�夌洿鎺ヨ祴鍊硷紙淇濈暀鍘熸敞閲婏級
- const selection = e.detail && e.detail.selection ? e.detail.selection : [];
- if (selection.length === 0) {
- this.selectedIndexs = [];
- return;
- }
- // 澶氶�夋椂鍙繚鐣欐渶鍚庝竴涓紙淇濈暀鍘熲�滃閫夐粯璁や负鏈�鍚庝竴鏉♀�濋�昏緫锛�
- const last = selection[selection.length - 1];
- const idx = this.tableData.findIndex(r => (r.id || r.daa001) === (last.id || last.daa001));
- this.selectedIndexs = idx >= 0 ? [idx] : [];
- // 寮哄埗鍙嬀閫夋渶鍚庝竴涓紙闃叉澶氶�夋畫鐣欙級
- if (selection.length > 1 && this.$refs.table) {
- this.$nextTick(() => {
- this.$refs.table.clearSelection && this.$refs.table.clearSelection();
- this.$refs.table.toggleRowSelection && this.$refs.table.toggleRowSelection(last, true);
- });
- }
- },
+ selectionChange(e) {
+ // 鍗曢�夌洿鎺ヨ祴鍊�
+ this.selectedIndexs = [e.detail.index];
+ },
selectedItems() {
return this.selectedIndexs.map(i => this.tableData[i])
@@ -780,10 +759,6 @@
</script>
<style lang="scss">
-
- /* 杩藉姞琛屽唴杈撳叆涓嶆嫤鎴偣鍑� */
-.row-input { pointer-events: none; } /* 鏂板: 閬垮厤 input 鎶㈠崰鐐瑰嚮 */
-
:deep(.checkbox),
:deep(.checkbox__inner) {
--
Gitblit v1.9.3