import req from "@/request.js";

const portal = window.context.portal;
export default {
	//分页
	ListGet(data, cb) {
		req.post(portal + `/portalNewsNotice/v1/query`, data).then(rep => {
			cb(rep.data);
		});
	},
	// 新增
	addSave(data, cb) {
		req.post(portal + `/portalNewsNotice/v1/`, data).then(rep => {
			cb(rep.data);
		});
	},
	// 修改
	detailId(id, cb) {
		req.get(portal + `/portalNewsNotice/v1/` + id).then(rep => {
			cb(rep.data);
		});
	},
	// 确认修改
	upData(data, cb) {
		req.put(portal + `/portalNewsNotice/v1/`, data).then(rep => {
			cb(rep.data);
		});
	},
	//删除
	// remove(ids,cb) {
	//     req.delete(portal + `/portalNewsNotice/v1/?ids=`+ids).then(rep => {
	//         cb(rep.data);
	//     });
	// },
	remove(id) {
		return new Promise((resolve, reject) => {
			req.remove(portal + "/portalNewsNotice/v1/?ids=" + id).then(resp => {
				resolve(resp.data);
			}, error => {
				reject(error);
			})
		})
	},
	//排序
	saveProperty(data, cb) {
		req.post(portal + `/portalNewsNotice/v1/updateSequence`, data).then(rep => {
			cb(rep.data);
		});
	},

}
