import { defineStore } from 'pinia'

export const resourceAuditStore = defineStore({
	id: 'resourceAudit',
	state: () => ({
		// 资源审核相关参数
		auditParams: {
			id: null, // 资源ID
			state: null, // 状态
			audit: null // 是否审核
		}
	}),
	getters: {
		// 获取审核参数
		getAuditParams: (state) => state.auditParams
	},
	actions: {
		// 设置审核参数
		setAuditParams(params) {
			this.auditParams = { ...params }
		},
		// 清空审核参数
		clearAuditParams() {
			this.auditParams = {
				id: null,
				state: null,
				audit: null
			}
		}
	}
})
