1
This commit is contained in:
		| @ -344,7 +344,7 @@ | ||||
|             <template #default="{ row }">{{ row.triggerTime && parseTime(row.triggerTime) }}</template> | ||||
|           </el-table-column> | ||||
|           <el-table-column label="过期时间" align="center" prop="expireTime" width="150" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }">{{ parseTime(row.expireTime) }}</template> | ||||
|             <template #default="{ row }">{{ row.expireTime && expirateTimeFormat(row.expireTime) }}</template> | ||||
|           </el-table-column> | ||||
|           <el-table-column label="创建时间" align="center" prop="createdAt" width="150" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }">{{ parseTime(row.createdAt) }}</template> | ||||
| @ -848,12 +848,7 @@ | ||||
|                         :rules="rules.expirateHour" | ||||
|                         class="ext-form-item" | ||||
|                       > | ||||
|                         <el-input | ||||
|                           v-model.number="item.expirateHour" | ||||
|                           size="mini" | ||||
|                           type="number" | ||||
|                           placeholder="过期时间(小时)" | ||||
|                         /> | ||||
|                         <el-input v-model.number="item.expirateHour" size="mini" type="number" placeholder="过期时间(小时)" /> | ||||
|                       </el-form-item> | ||||
|                     </el-col> | ||||
|                     <el-col :span="3"> | ||||
| @ -2386,6 +2381,27 @@ export default { | ||||
|       } else { | ||||
|         return this.orderTypes[row.orderType] ? this.orderTypes[row.orderType].l : '' | ||||
|       } | ||||
|     }, | ||||
|     expirateTimeFormat(expirateTime) { | ||||
|       // console.log("1111",this.parseTime(expirateTime)) | ||||
|       // 解析时间并转换为 UTC 时间 | ||||
|       const targetDate = new Date(expirateTime) | ||||
|       const currentDate = new Date() | ||||
|  | ||||
|       // 计算时间差(毫秒) | ||||
|       const diffInMilliseconds = targetDate.getTime() - currentDate.getTime() | ||||
|       // 转换为年 | ||||
|       const diffInYears = diffInMilliseconds / (1000 * 60 * 60 * 24 * 365.25) | ||||
|  | ||||
|       console.log('2222', diffInYears) | ||||
|       console.log('xxxx', diffInYears > 1) | ||||
|       if (diffInYears > 1) { | ||||
|         return '' | ||||
|       } else { | ||||
|         const dateStr = this.parseTime(expirateTime) | ||||
|         console.log('3333', dateStr) | ||||
|         return dateStr | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user