| | |
| | | } |
| | | ] |
| | | ) |
| | | |
| | | // 时间格式化 |
| | | const timeForm = { |
| | | hour12: false, |
| | |
| | | const deleteDialog = ref(false) |
| | | const addRecord = ref({}) |
| | | const details = ref({}) |
| | | |
| | | // 查看记录 |
| | | const viewRecord = (row) =>{ |
| | | details.value = JSON.parse(JSON.stringify(row)) |
| | | dialogDetails.value = true |
| | | } |
| | | |
| | | // 删除记录 |
| | | const deleteRecord = (index) =>{ |
| | | chosenIndex.value = index |
| | | deleteDialog.value = true |
| | |
| | | tableData.splice(chosenIndex.value,1) |
| | | deleteDialog.value = false |
| | | } |
| | | |
| | | // 修改记录 |
| | | const editRecord =(index, row)=>{ |
| | | dialogAddRecord.value = true |
| | | chosenIndex.value = index |
| | | addRecord.value = JSON.parse(JSON.stringify(row)) |
| | | } |
| | | |
| | | // 新增修改记录确认 |
| | | const confirmAddRecord = async (formEl: FormInstance | undefined) =>{ |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | |
| | | } |
| | | const indexClear = ()=>{ |
| | | chosenIndex.value = -1 |
| | | } |
| | | const editRecord =(index, row)=>{ |
| | | dialogAddRecord.value = true |
| | | chosenIndex.value = index |
| | | addRecord.value = JSON.parse(JSON.stringify(row)) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |