
import { netStaffDefaultReviewer } from '@/api/index.js'
export const commonJS = {
	onShow() {
		//获取 默认的抄送人
		this.getDefaultCopy()
	},
	onUnload() {
		uni.removeStorageSync('copyPeople')
	},
	methods: {
		getDefaultCopy() {
			netStaffDefaultReviewer().then(res=>{
				res = res.data
				let arr = uni.getStorageSync('copyPeople')?uni.getStorageSync('copyPeople'):[]
				arr.forEach((item,index)=>{
					res.forEach(ele=>{
						if(item.id == ele.id){
							item.isDel = false
						}
					})
				})
				this.copyList = this.checkReport([...res,...uni.getStorageSync('copyPeople')])
			})
		},
		delCopy(index) {
			this.copyList.splice(index,1)
			uni.setStorageSync('copyPeople',this.copyList)
		},
	}
}