import request from "../../request.js"

export default {
	// 获取组态场景列表
	getConfigurationListData(data){
		return new Promise((resolve, reject) => {
			request.TokenRequest({
				url: '/console/admin/scene/list',
				method: 'POST',
			},data)
			.then((res) =>{
				resolve(res);
			}).catch(err =>{
				reject(err);
			})
		})
	},
	// 获取组态分享列表
	getConfigurationShareList(data){
		return new Promise((resolve, reject) => {
			request.TokenRequest({
				url: '/console/admin/share/list',
				method: 'POST',
			},data)
			.then((res) =>{
				resolve(res);
			}).catch(err =>{
				reject(err);
			})
		})
	},
	// 新增组态
	addConfigurationShare(data){
		return new Promise((resolve, reject) => {
			request.TokenRequest({
				url: '/console/admin/share/add',
				method: 'POST',
			},data)
			.then((res) =>{
				resolve(res);
			}).catch(err =>{
				reject(err);
			})
		})
	},
	// 删除组态
	delConfigurationShare(data){
		return new Promise((resolve, reject) => {
			request.TokenRequest({
				url: '/console/admin/share/delete',
				method: 'POST',
			},data)
			.then((res) =>{
				resolve(res);
			}).catch(err =>{
				reject(err);
			})
		})
	},
}