| | |
| | | interface type { |
| | | |
| | | } |
| | | // export default defineComponent({ |
| | | // name: 'workCheckinRecord', |
| | | // setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({}); |
| | | |
| | | // 分页 |
| | | const currentPage = ref(1) |
| | | const pageSize = ref(10) |
| | | |
| | | // 判断编辑和新增 |
| | | const chosenIndex = ref(-1) |
| | | |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`) |
| | | } |
| | |
| | | result:[{required: true, message: '该内容不能为空',trigger:'blur'}], |
| | | checkTime:[{required: true, message: '该内容不能为空',trigger:'blur'}] |
| | | }) |
| | | |
| | | const dialogDetails = ref(false) |
| | | const dialogAddRecord = ref(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 |
| | | } |
| | | |
| | | // 弹窗确认删除记录 |
| | | const conFirmDelete = ()=> { |
| | | tableData.splice(chosenIndex.value,1) |
| | | deleteDialog.value = false |
| | | } |
| | | |
| | | // 弹窗确认新增记录 |
| | | const confirmAddRecord = async (formEl: FormInstance | undefined) =>{ |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | |
| | | }) |
| | | |
| | | } |
| | | // 新增弹窗关闭时的数据初始化处理 |
| | | const closeAdd =()=>{ |
| | | addRecord.value={} |
| | | chosenIndex.value = -1 |
| | |
| | | const indexClear = ()=>{ |
| | | chosenIndex.value = -1 |
| | | } |
| | | |
| | | // 修改编辑记录 |
| | | const editRecord =(index, row)=>{ |
| | | dialogAddRecord.value = true |
| | | chosenIndex.value = index |
| | |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | // return { |
| | | // renderMenu, |
| | | // multipleTableRef, |
| | | // tableData, |
| | | // currentPage, |
| | | // pageSize, |
| | | // dialogDetails, |
| | | // details, |
| | | // deleteDialog, |
| | | // dialogAddRecord, |
| | | // viewRecord, |
| | | // deleteRecord, |
| | | // handleSizeChange, |
| | | // handleCurrentChange, |
| | | // Plus, |
| | | // Edit, |
| | | // Delete, |
| | | // Search, |
| | | // Download, |
| | | // handleSelectionChange, |
| | | // Refresh, |
| | | // ...toRefs(state), |
| | | // }; |
| | | // }, |
| | | // }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |