Skip to content

Commit 6e04b61

Browse files
committed
fix: loadEditInfo
1 parent fbfd39b commit 6e04b61

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/views/list/table/Edit.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
validateStatus="warning"
3838
>
3939
<a-select v-decorator="['status', {rules: [{ required: true, message: '请选择状态' }], initialValue: '1'}]">
40-
<a-select-option value="1">Option 1</a-select-option>
41-
<a-select-option value="2">Option 2</a-select-option>
42-
<a-select-option value="3">Option 3</a-select-option>
40+
<a-select-option :value="1">Option 1</a-select-option>
41+
<a-select-option :value="2">Option 2</a-select-option>
42+
<a-select-option :value="3">Option 3</a-select-option>
4343
</a-select>
4444
</a-form-item>
4545

@@ -65,6 +65,7 @@
6565
showTime
6666
format="YYYY-MM-DD HH:mm:ss"
6767
placeholder="Select Time"
68+
v-decorator="['updatedAt']"
6869
/>
6970
</a-form-item>
7071

@@ -86,6 +87,9 @@
8687
</template>
8788

8889
<script>
90+
import moment from 'moment'
91+
import pick from 'lodash.pick'
92+
8993
export default {
9094
name: 'TableEdit',
9195
props: {
@@ -145,8 +149,10 @@ export default {
145149
new Promise((resolve) => {
146150
setTimeout(resolve, 1500)
147151
}).then(() => {
148-
form.setFieldsValue(data)
149-
// form.setFieldsValue({ no: '1', callNo: '999' })
152+
const formData = pick(data, ['no', 'callNo', 'status', 'description', 'updatedAt'])
153+
formData.updatedAt = moment(data.updatedAt)
154+
console.log('formData', formData)
155+
form.setFieldsValue(formData)
150156
})
151157
}
152158
}

0 commit comments

Comments
 (0)