import dayjs from 'dayjs'; Component({ options: { addGlobalClass: true, multipleSlots: true, }, properties: { index: { type: Number, value: 0, }, readOnly: { type: Boolean, value: false, }, // 设备位置信息 location: { type: Object, value: {}, observer(value) { this.setData({ ...value }); }, }, }, data: {}, methods: { onStandardChange(e) { if (!e) { this.setData({ dlUnstandardReason: '' }); } }, changeEdit() { this.setData({ readOnly: false, isUpdate: true }); }, cancel() { this.setData({ readOnly: true }); this.triggerEvent('cancel'); }, confirm() { const date = this.data.dlUpdateTime ? dayjs(this.data.dlUpdateTime) : dayjs(); const time = date.format('YYYY年MM月DD日'); this.setData({ time, readOnly: true }); const { readOnly, location, ...rest } = this.data; this.triggerEvent('confirm', rest); }, update() {}, }, });