export const provinceList = [
	{ label: "北京", value: "北京", selected: 0 },
	{ label: "天津", value: "天津", selected: 0 },
	{ label: "河北", value: "河北", selected: 0 },
	{ label: "山西", value: "山西", selected: 0 },
	{ label: "内蒙古", value: "内蒙古", selected: 0 },
	{ label: "辽宁", value: "辽宁", selected: 0 },
	{ label: "吉林", value: "吉林", selected: 0 },
	{ label: "黑龙江", value: "黑龙江", selected: 0 },
	{ label: "上海", value: "上海", selected: 0 },
	{ label: "江苏", value: "江苏", selected: 0 },
	{ label: "浙江", value: "浙江", selected: 0 },
	{ label: "安徽", value: "安徽", selected: 0 },
	{ label: "福建", value: "福建", selected: 0 },
	{ label: "江西", value: "江西", selected: 0 },
	{ label: "山东", value: "山东", selected: 0 },
	{ label: "河南", value: "河南", selected: 0 },
	{ label: "湖北", value: "湖北", selected: 0 },
	{ label: "湖南", value: "湖南", selected: 0 },
	{ label: "广东", value: "广东", selected: 0 },
	{ label: "广西", value: "广西", selected: 0 },
	{ label: "海南", value: "海南", selected: 0 },
	{ label: "重庆", value: "重庆", selected: 0 },
	{ label: "四川", value: "四川", selected: 0 },
	{ label: "贵州", value: "贵州", selected: 0 },
	{ label: "云南", value: "云南", selected: 0 },
	{ label: "西藏", value: "西藏", selected: 0 },
	{ label: "陕西", value: "陕西", selected: 0 },
	{ label: "甘肃", value: "甘肃", selected: 0 },
	{ label: "青海", value: "青海", selected: 0 },
	{ label: "宁夏", value: "宁夏", selected: 0 },
	{ label: "新疆", value: "新疆", selected: 0 },
	{ label: "台湾", value: "台湾", selected: 0 },
	{ label: "香港", value: "香港", selected: 0 },
	{ label: "澳门", value: "澳门", selected: 0 }
];

export const ispList = [
	{ label: "电信", value: "1", selected: 0 },
	{ label: "移动", value: "2", selected: 0 },
	{ label: "联通", value: "3", selected: 0 }
];

export const natTypeList = [
	{ label: "公网", value: "public" },
	{ label: "内网", value: "inner" }
];

export const dialTypeList = [
	{ label: "固定公网单IP", value: "staticNetSingle", type: "1" },
	{ label: "固定公网多IP", value: "staticNetCouple", type: "1" },
	{ label: "服务器拨号", value: "serverDial", type: "1" },
	{ label: "软路由", value: "virtualRoute", type: "1" },
	{ label: "静态单IP", value: "1", type: "2" }
];
export const dialTypeSingleList = [{ label: "静态单IP", value: "1" }];
export const ipTypeList = [
	{ label: "多IP", value: "1" },
	{ label: "单IP", value: "2" }
];
export const ipProtocolList = [
	{ label: "双线", value: "1" },
	{ label: "IPV4", value: "2" },
	{ label: "IPV6", value: "3" }
];
export const netCardList = [
	{ netDevName: "eth0", ip: "192.168.1.12", speed: "1000", selected: false },
	{ netDevName: "eth1", ip: "192.168.1.13", speed: "1000", selected: true },
	{ netDevName: "eth2", ip: "192.168.1.15", speed: "1000", selected: false },
	{ netDevName: "eth3", ip: "", speed: "1000", selected: false },
	{ netDevName: "eth4", ip: "", speed: "", selected: false }
];
export const businessTypeList = [
	{ label: "PX", value: "1" },
	{ label: "QN", value: "2" }
];
export const stateList = [
	{ label: "待审核", value: "bound", color: "#F33535", selected: 0, css: "dot_error" },
	{ label: "交付中", value: "waitAudit", color: "#F33535", selected: 0, css: "dot_error" },
	{ label: "验收未通过", value: "auditFailed", color: "#F33535", selected: 0, css: "dot_error" },
	{ label: "服务中", value: "inService", color: "#00af51", selected: 0, css: "dot_success" },
	{ label: "已下线", value: "offline", color: "#F33535", selected: 0, css: "dot_warning" },
	{ label: "已清退", value: "repelled", color: "#F33535", selected: 0, css: "dot_warning" }
];
export const resourceTypeList = [
	{ label: "汇聚资源", value: "aggregation" },
	{ label: "专线资源", value: "dedicated" }
];
export const onlineStatusList = [
	{ label: "离线", value: "outline", selected: 0, color: "#F33535", css: "dot_error" },
	{ label: "在线", value: "online", selected: 0, color: "#00af51", css: "dot_success" },
	{ label: "网络异常", value: "error", selected: 0, color: "#f0ad4e", css: "dot_warning" }
];
export const dialStatusList = [
	{ label: "拨号失败", value: "failed" },
	{ label: "已拨通", value: "succeed" }
];
export const connectStatusList = [
	{ label: "联网失败", value: "failed" },
	{ label: "已联网", value: "succeed" }
];
export const cardTypeList = [
	{ label: "银行卡", value: 1, icon: "jc-icon-yinxingqia002", slected: 0, color: "#107c84" },
	{ label: "支付宝", value: 2, icon: "jc-icon-zhifubaozhifu", slected: 0, color: "#009fe8" },
	{ label: "微信", value: 3, icon: "jc-icon-weixinzhifu", slected: 0, color: "#6bcc03" }
];
export const deviceHelper = {
	getConnectStatusText(value: string) {
		return this.getText(connectStatusList, value);
	},
	getDialStatusText(value: string) {
		return this.getText(dialStatusList, value);
	},
	getOnlineStatusText(value: string) {
		return this.getText(onlineStatusList, value);
	},
	getStateText(value: string) {
		return this.getText(stateList, value);
	},
	getResourceTypeText(value: string) {
		return this.getText(resourceTypeList, value);
	},
	getDialTypeText(value: string) {
		return this.getText(dialTypeList, value);
	},
	getNatTypeText(value: string) {
		return this.getText(natTypeList, value);
	},
	getText(list: any[], value: string, key: string = "label") {
		let text = "";
		list.forEach((item) => {
			if (item.value === value) {
				text = item[key];
				return;
			}
		});
		return text.trim();
	}
};
