Преглед изворни кода

Update: Disable select box input

iaun пре 3 месеци
родитељ
комит
b12db9d6b8

+ 3 - 0
frontend/src/components/Dashboard.jsx

@@ -367,6 +367,7 @@ function Dashboard() {
                 placeholder="选择月份"
                 format="YYYY-MM"
                 style={{ width: isMobile ? '100%' : 'auto' }}
+                inputReadOnly
               />
             </Col>
           </Row>
@@ -509,6 +510,7 @@ function Dashboard() {
             onChange={handleDateChange}
             allowClear={false}
             style={{ width: isMobile ? '100%' : 200 }}
+            inputReadOnly
           />
           <Button
             icon={<ReloadOutlined />}
@@ -618,6 +620,7 @@ function Dashboard() {
                 allowClear={false}
                 placeholder="选择年份"
                 style={{ width: isMobile ? '100%' : 'auto' }}
+                inputReadOnly
               />
             </Col>
           </Row>

+ 2 - 0
frontend/src/components/Export.jsx

@@ -119,6 +119,7 @@ function Export() {
                   style={{ width: 200 }}
                   placeholder="选择月份"
                   format="YYYY-MM"
+                  inputReadOnly
                 />
               </div>
               <Button
@@ -156,6 +157,7 @@ function Export() {
                   allowClear={false}
                   style={{ width: 200 }}
                   placeholder="选择年份"
+                  inputReadOnly
                 />
               </div>
               <Button

+ 1 - 5
frontend/src/components/ItemForm.jsx

@@ -127,11 +127,7 @@ function ItemForm({ visible, item, suppliers = [], onSuccess, onCancel }) {
               placeholder="请选择供应商(可选)"
               allowClear
               disabled={loading}
-              showSearch
-              optionFilterProp="children"
-              filterOption={(input, option) =>
-                (option?.children ?? '').toLowerCase().includes(input.toLowerCase())
-              }
+              showSearch={false}
             >
               <Select.Option key="none" value={-1}>
                 无供应商

+ 3 - 5
frontend/src/components/WorkRecordForm.jsx

@@ -127,8 +127,7 @@ function WorkRecordForm({ visible, record, onSuccess, onCancel }) {
           >
             <Select
               placeholder="请选择人员"
-              showSearch
-              optionFilterProp="label"
+              showSearch={false}
               options={persons.map(p => ({ label: p.name, value: p.id }))}
               disabled={loading}
             />
@@ -140,8 +139,7 @@ function WorkRecordForm({ visible, record, onSuccess, onCancel }) {
           >
             <Select
               placeholder="请选择物品"
-              showSearch
-              optionFilterProp="label"
+              showSearch={false}
               options={items.map(i => ({ 
                 label: `${i.supplier_name ? `[${i.supplier_name}] ` : ''}${i.name} (¥${Number(i.unit_price).toFixed(2)})`, 
                 value: i.id 
@@ -154,7 +152,7 @@ function WorkRecordForm({ visible, record, onSuccess, onCancel }) {
             label="工作日期"
             rules={[{ required: true, message: '请选择工作日期' }]}
           >
-            <DatePicker style={{ width: '100%' }} disabled={loading} />
+            <DatePicker style={{ width: '100%' }} disabled={loading} inputReadOnly />
           </Form.Item>
           <Form.Item
             name="quantity"

+ 7 - 0
frontend/src/components/WorkRecordList.jsx

@@ -352,6 +352,7 @@ function WorkRecordList() {
           <Select
             placeholder="选择人员"
             allowClear
+            showSearch={false}
             style={{ width: '100%' }}
             value={selectedPersonId}
             onChange={handleFilterChange(setSelectedPersonId)}
@@ -365,6 +366,7 @@ function WorkRecordList() {
             onChange={handleFilterChange(setSelectedMonth)}
             format="YYYY-MM"
             style={{ width: '100%' }}
+            inputReadOnly
           />
         </Col>
         <Col xs={12} sm={6} md={4}>
@@ -373,12 +375,14 @@ function WorkRecordList() {
             value={selectedDate}
             onChange={handleFilterChange(setSelectedDate)}
             style={{ width: '100%' }}
+            inputReadOnly
           />
         </Col>
         <Col xs={12} sm={6} md={4}>
           <Select
             placeholder="结算状态"
             allowClear
+            showSearch={false}
             style={{ width: '100%' }}
             value={selectedSettlement}
             onChange={handleFilterChange(setSelectedSettlement)}
@@ -432,6 +436,7 @@ function WorkRecordList() {
           <Select
             placeholder="选择人员(不选则全部)"
             allowClear
+            showSearch={false}
             style={{ width: '100%' }}
             value={batchPersonId}
             onChange={setBatchPersonId}
@@ -446,6 +451,7 @@ function WorkRecordList() {
             onChange={setBatchMonth}
             format="YYYY-MM"
             style={{ width: '100%' }}
+            inputReadOnly
           />
         </div>
         <div style={{ marginBottom: 16 }}>
@@ -453,6 +459,7 @@ function WorkRecordList() {
           <Select
             placeholder="选择供应商(不选则全部)"
             allowClear
+            showSearch={false}
             style={{ width: '100%' }}
             value={batchSupplierId}
             onChange={setBatchSupplierId}