
import request from '@/utils/request';

import { Tools } from '@/assets/ls/js/common.js';
var baseAPI2 = process.env.VUE_APP_LOCAL_API2 + '/';
var DownloadUrl = process.env.VUE_APP_Download + '/';

var reqTransmit = function(url, type, param){
	type = type.toLowerCase();
	var paramKey = type === 'get' ? 'params' : 'data';
	var body = {url: baseAPI2 + url, param:param};
	var reqConfig = {
		url: 'biz/transmit',
		method: type,
	};
	reqConfig[paramKey] = body;
	return request(reqConfig)
};
var reqTransmitUpload = function(url, type, param){
	var reqConfig = {
		url: 'biz/transmitUpload',
		method: type,
		data:param,
		params:{path:url},
	};
	return request(reqConfig/* , {'Content-Type':'application/x-www-form-urlencoded'} */)
};

var reqApi = function(){
	return {
		donwloadURl:DownloadUrl,
		onCarInfo:function(param){
			return request({
				url: 'biz/onCarInfo',
				method: 'post',
				data:param
			})
		},
		getWeather: function(param) {
			var body = {url:'https://i.tianqi.com/', body:param};
			return request({
				url: 'biz/transmitText',
				method: 'post',
				params:body
			})
		},
		getRules:function(baseInfo){
			var rules = {};
			for(var key in baseInfo){
				var item = baseInfo[key];
				if(item.must){
					var typeStr = item.type ? '请选择' : '请输入';
					rules[key] = [{required: true, message:typeStr+item.name, trigger:'blur', type:item.rulesType}];
				};
			};return Object.keys(rules)[0] ? rules : void 0;
		},
		getItem: function(param, query){
			return reqTransmit('ls/data/selData', 'get', param)
		},
		saveItem: function(data){
			return reqTransmit('ls/data/selData', 'POST', data)
		},
		updateItem: function(data){
			return reqTransmit('ls/data/selData', 'put', data)
		},
		removeItem: function(data){
			return reqTransmit('ls/data/selData', 'delete', data)
		},

		common:{
			getRequst: function(searchItem){
				var param = searchItem || {}, sort = 'date,desc';
				param.page = this.table.page - 1;
				param.size = this.table.size;
				param.sort = sort;
				this.table.loading = true;
				this.pageApi.request('get', param).then((res) => {
					this.table.loading = false;
					if(res && res.stat){
						var body = res.body || {};
						var list = body.list || [];
						this.table.dataList = list;
						this.table.total = body.total * 1;
					}else{
						this.$notify({
							title: res.msg,
							type: 'error',
							duration: 2500
						})
					};
				}).catch(function(error) {
					this.table.loading = false;
				})
			},
			removeRequst: function(item){
				return this.pageApi.request('delete', item).then((res) => {
					if(res.code === 200){
						this.$notify({
							title: '删除成功！',
							type: 'success',
							duration: 2500
						});
						this.loadData()
					}else{
						this.$notify({
							title: res.msg,
							type: 'error',
							duration: 2500
						})
					};
				});
			},
			addRequst: function(item){
				return this.pageApi.request('post', item).then((res) => {
					this.form.visible = false;
					if(res.code === 200){
						this.$notify({
							title: '添加成功！',
							type: 'success',
							duration: 2500
						});
						this.loadData()
					}else{
						this.$notify({
							title: res.msg,
							type: 'error',
							duration: 2500
						})
					};
				}).catch(function(error) {
					this.form.status.cu = 0
				});
			},
			putRequst: function(item){
				return this.pageApi.request('put', item).then((res) => {
					this.form.visible = false;
					if(res.code === 200){
						this.$notify({
							title: '修改成功！',
							type: 'success',
							duration: 2500
						});
						this.loadData()
					}else{
						this.$notify({
							title: res.msg,
							type: 'error',
							duration: 2500
						})
					};
				}).catch(function(error) {
					this.form.status.cu = 0
				});
			},
			upload:function(e, key){
				var tag = e.target || e.srcElement;
				var file = tag.files[0];
				if(file){
					this.fullLoading = this.$loading({
						lock: true,
						text: 'Loading',
						spinner: 'el-icon-loading',
						background: 'rgba(0, 0, 0, 0.7)'
					});

					var data = new FormData();
					data.append('file', file);
					return this.pageApi.upload(data).then((res) => {
						this.fullLoading.close();
						if(res.head.code === '0000'){
							this.form.item[key] = res.body.filename;
							this.$notify({
								title: '提示',
								message: '文件上传成功',
								type: 'success',
								duration: 5000
							})
						};
					}).catch(function(error) {
						this.form.status.cu = 0
					});
				};
			},
			getSearchParam:function(form){
				var search = form.search, query = form.query, searchItem = {};
				if(query && Object.keys(query)[0]){
					if(Object.prototype.toString.call(form.search) === '[object Array]'){
						for(var item of form.search){
							if(item.type === "daterange"){
								var queryVal = query[item.key];
								queryVal && (searchItem[item.key] = queryVal.join(','));
							}else{
								searchItem.searchName = item.key;
								searchItem.searchValue = query[item.key];
							};
							searchItem.limit = item.mode || 0;
						};
					}else{
						searchItem.searchName = form.search.key;
						searchItem.searchValue = query[form.search.key];
						searchItem.limit = form.search.mode;
					};
				};
				return searchItem;
			},
			toSearch:function(form){
				this.table.page = 1;
				var searchItem = {
					searchName:form.search.key,
					searchValue:form.query[form.search.key],
					limit:form.search.mode
				}
				this.loadData(searchItem)
			},
			// toDownload:function(item){
			// 	var download = this.pageApi.download;
			// 	var filePath = download.filePath;
			// 	var fileName = item[download.keyName].indexOf('.') > 0 ? item.[download.keyName] : '';
			// 	if(filePath && fileName){
			// 		window.open(DownloadUrl + filePath + fileName);
			// 	}else{
			// 		this.$notify({
			// 			title: '提示',
			// 			message: '未找到要下载的文件！',
			// 			type: 'warning',
			// 			duration: 5000
			// 		})
			// 	};
			// },
			toAdd:function(){		// 添加表单
				this.$refs['form1'] && this.$refs['form1'].clearValidate();
				this.form.title = '添加' + this.form.config.title;
				this.form.status.cu = 0;
				this.form.visible = true;
				this.form.reqType = 'add';
				var item = {};
				for(var key in this.Dict.baseInfo){
					item[key] = '';
				};
				this.form.item = item;
			},
			toEdit:function(item){		// 添加表单
				var form = this.form;
				this.$refs['form1'] && this.$refs['form1'].clearValidate();
				form.title = '编辑' + form.config.title;
				form.status.cu = 0;
				form.visible = true;
				form.reqType = 'edit';
				form.item = item;
			},
			toDelete:function(item){		// 删除表单
				this.$confirm('确认删除该条数据吗?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then((e) => {
					this.reqRemoveItem({id:item.id})
				}).catch((e) => {
				})
			},
			getSelectName:function(val, list){
				for(var item of list){
					if(val === item.value)return item.name;
				};
			},
			submitForm:function(form, item){
				if(!this.form.status.cu){
					form.validate(valid => {
						if(valid){
							this.form.status.cu = 2;
							if(this.form.reqType === 'add'){
								this.reqAddItem(item);
							}else{
								this.reqEditItem(item);
							}
						}else{
							this.form.status.cu = 0
						}
					});
				};
			},
		},

		/**
		  * @param: 参数说明:
			must:true, 是否启用表单验证
			form:0		// 不在表单中显示
			operWidth:'150',		// 表格中操作栏的宽度
			otherBtn:[		// 上部添加按钮
				{'fn':'toAdd', 'type':'primary', 'icon':'el-icon-plus'},
			],

			// 文件下载配制
			download:{
				filePath:'upload/public/',
				keyName:'districtfilename',
			},
			// 文件上传配制
			upload: function(data){
				return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
			},
		 
		  * @author: Kimber
		  * @updatetime: 2021/12/8(周三)
		  * @createtime: 2021/12/8(周三)
		  */
		Security:{
			qyjcxx:{
				qyjbxx:{
					request:function(type, param){
						return reqTransmit('ls/baseinfomation', type, param)
					},
				},
				qyzz:{		// 企业证照管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'150',
						title:'企业证照管理',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'证照名称',
							'key':'credentialsname',
						},
						baseInfo:{
							"credentialsname":{name:"证照名称", must:true},
							"credentialsno":{name:"证照编号", must:true},
							"credentialsimg":{name:"证照照片", type:'img', must:true},
							"credentialstype":{name:"证件类型", type:'list', must:true},
							"filelist":{name:"证件扫描件名", must:true},
							"issueorganization":{name:"颁证机构", must:true},
							"issuedate":{name:"发证日期", type:'date', must:true},
							"validdate":{name:"生效日期", type:'date', must:true},
							"expirydate":{name:"失效日期", type:'date', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							credentialstype:[
								{'name':'釆矿许可证','value':"1"},
								{'name':'安全生产许可证','value':"2"},
								{'name':'工商营业执照','value':"3"},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/credentials', type, param)
					},
				},
				qytzgl:{	// 企业图纸管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						title:'企业图纸管理',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'图纸名称',
							'key':'papername',
							'mode':0,
						},
						baseInfo:{
							"papername":{name:"图纸名称", must:true},
							"paperno":{name:"图纸编号", must:true},
							"papertype":{name:"图纸类型", type:'list', must:true},
							"paperfilename":{name:"图纸文件", type:'filename', must:true},
							"paperdescribe":{name:"图纸说明", must:true},
							"edituser":{name:"编制人", must:true},
							"checkuser":{name:"审核人", must:true},
							"checkdate":{name:"审核日期", type:'date', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							papertype:[
								{'name':'地形地质图','value':"1"},
								{'name':'釆剥工程年末图','value':"2"},
								{'name':'釆场边坡工程平面及剖面图','value':"3"},
								{'name':'釆场最终境界图','value':"4"},
								{'name':'排土场年末图','value':"5"},
								{'name':'排土场工程平面及剖面图','value':"6"},
								{'name':'供配电系统图','value':"7"},
								{'name':'井下釆空区与露天矿平面对照图','value':"8"},
								{'name':'防排水系统图','value':"9"},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/paper', type, param)
					},
					download:{
						filePath:'upload/paper/',
						keyName:'paperfilename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				cyryxx:{		// 从业人员信息管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						title:'从业人员信息管理',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'员工编号',
							'key':'staffno',
							'mode':0,
						},
						baseInfo:{
							"staffno":{name:"员工编号", must:true},
							"staffname":{name:"姓名", must:true},
							"position":{name:"职务"},
							"departmentid":{name:"部门"},
							"sex":{name:"性别"},
							"education":{name:"学历", type:'list', must:true},
							"professional":{name:"专业"},
							"idcard":{name:"身份证号", must:true},
							"tel":{name:"联系电话"},
							"photofilename":{name:"个人照片", type:'filename', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							education:[
								{'name':'中专','value':"1"},
								{'name':'大专','value':"2"},
								{'name':'本科','value':"3"},
								{'name':'硕士','value':"4"},
								{'name':'博士','value':"5"},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/staff', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'photofilename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				qyaqgl:{		// 企业安全管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						title:'企业安全管理',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'制度名称',
							'key':'rulename',
							'mode':0,
						},
						baseInfo:{
							"ruleno":{name:"制度编号", must:true},
							"rulename":{name:"制度名称", must:true},
							"ruletype":{name:"制度类型", type:'list', must:true},
							"publishdep":{name:"发布部门"},
							//"updatetime":{name:"更新日期", type:'date', must:true},
							"rstatus":{name:"状态", type:'list', must:true},
							"rulefilename":{name:"制度文件", type:'filename', must:true},
						},
						selectList:{
							ruletype:[
								{'name':'安全生产规章制度','value':"1"},
								{'name':'安全教育培训制度','value':"2"},
								{'name':'安全操作规程','value':"3"},
							],
							rstatus:[
								{'name':'生效','value':"1"},
								{'name':'废弃','value':"2"},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/rule', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'rulefilename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				gysbgl:{		// 工艺设备管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						title:'工艺设备管理',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'采场名称',
							'key':'stopename',
							'mode':0,
						},
						baseInfo:{
							"stopename":{name:"采场名称", must:true},
							"equipment":{name:"设备", must:true},
							"technique":{name:"工艺", must:true},
							"updatedate":{name:"更新日期", type:'date', must:true, form:0},
							"filename":{name:"制度文件", type:'filename', must:true},
						},
						selectList:{
						},
					},
					download:{
						filePath:'upload/public/',
						keyName:'filename',
					},
					request:function(type, param){
						return reqTransmit('ls/technique', type, param)
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				ttgysb:{		// 淘汰工艺设备上报
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'150',
						title:'淘汰工艺设备上报',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'设备或工艺名称',
							'key':'ename',
							'mode':0,
						},
						baseInfo:{
							"ename":{name:"设备或工艺名称", must:true},
							"enjoin":{name:"禁止原因", must:true},
							"enjoindate":{name:"禁止期限"},
							"ereplace":{name:"替代产品及优点"},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					request:function(type, param){
						return reqTransmit('ls/techniquee', type, param)
					},
				},
				aqscgl:{		// 安全生产管理
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						title:'安全生产管理',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'机构图片名称',
							'key':'organname',
							'mode':0,
						},
						baseInfo:{
							"organname":{name:"机构图片名称", must:true},
							"filename":{name:"机构图片名上传附件", type:'filename', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					request:function(type, param){
						return reqTransmit('ls/organ', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'filename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
			},
			yhpc:{
				pqgl:{		// 片区管理
					name:'片区管理',
					Dict:{
						search:{
							'name':'片区名称',
							'key':'districtname',
							'mode':0,
						},
						baseInfo:{
							"districtno":{name:"片区编码", must:true},
							"districtname":{name:"片区名称", must:true},
							"districtfilename":{name:"片区cad文件名", type:'filename', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'片区',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/dis', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'districtfilename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				fxqygl:{		// 风险区域管理
					name:'风险区域管理',
					Dict:{
						search:{
							'name':'风险点名称',
							'key':'riskpointname',
							'mode':0,
						},
						baseInfo:{
							"districtno":{name:"片区编码", type:'list', must:true},
							"riskpointno":{name:"风险点编码", must:true},
							"riskpointname":{name:"风险点名称", must:true},
							"areacoordinate":{name:"风险点区域坐标", must:true},
							"longitude":{name:"风险点中心经度", must:true},
							"latitude":{name:"风险点中心维度", must:true/* , type:'map' */},
							"height":{name:"风险点中心高度", must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							districtno: function(){
								return reqTransmit('ls/dis/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'150',
						title:'风险区域',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/riskpoint', type, param)
					},
				},
				bsrwgl:{		// 辨识任务管理
					name:'辨识任务管理',
					Dict:{
						search:{
							'name':'风险辨识活动名称',
							'key':'name',
							'mode':0,
						},
						baseInfo:{
							"riskldenttaskno":{name:"辨识任务编码", must:true},
							"type":{name:"风险辨识类型", must:true, type:'list'},
							"name":{name:"风险辨识活动名称"},
							"starttime":{name:"开始时间", type:'date', must:true},
							"endtime":{name:"结束时间", type:'date', must:true},
							"officer":{name:"活动组织人"},
							"participants":{name:"活动参与人"},
							"paperfilename":{name:"风险辨识报告文件名", type:'filename'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							type:[
								{'name':'年度辨识','value':"1"},
								{'name':'专项辨识','value':"2"},
							],
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'辨识任务',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/identtask', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'paperfilename',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				fxqd:{		// 风险清单
					name:'风险清单',
					Dict:{
						search:{
							'name':'风险编码',
							'key':'riskno',
							'mode':0,
						},
						baseInfo:{
							"riskno":{name:"风险编码", must:true},
							"riskpointno":{name:"风险区域编码", type:'list', must:true},
							"riskldenttaskld":{name:"辨识任务编码", type:'list', must:true},
							"robject":{name:"辨识对象", must:true},
							"checkproject":{name:"检查项目"},
							"riskdesc":{name:"风险描述"},
							"risktype":{name:"风险类型", must:true, type:'list'},
							"risklevel":{name:"风险等级", must:true, type:'list'},
							"statue":{name:"管控状态", must:true, type:'list'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							risktype:[
								{'name':'顶板','value':"1"},
								{'name':'机电','value':"2"},
								{'name':'放炮','value':"3"},
								{'name':'火灾','value':"4"},
								{'name':'水灾','value':"5"},
								{'name':'运输','value':"6"},
								{'name':'其他','value':"7"},
								{'name':'煤尘','value':"8"},
								{'name':'瓦斯','value':"9"},
								{'name':'冲击地压','value':"10"},
								{'name':'通风系统','value':"11"},
								{'name':'滑坡','value':"12"},
								{'name':'溃坝','value':"13"},
								{'name':'中毒','value':"14"},
								{'name':'窒息','value':"15"},
								{'name':'爆炸','value':"16"},
								{'name':'坍塌','value':"17"},
								{'name':'淹溺','value':"18"},
								{'name':'触电','value':"19"},
								{'name':'泄漏','value':"20"},
								{'name':'其他','value':"21"},
							],
							risklevel:[
								{'name':'重大','value':"1"},
								{'name':'较大','value':"2"},
								{'name':'一般','value':"3"},
								{'name':'低','value':"4"},
							],
							riskpointno: function(){
								return reqTransmit('ls/riskpoint/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
							riskldenttaskld: function(){
								return reqTransmit('ls/identtask/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
							statue:[
								{'name':'未管控','value':"0"},
								{'name':'已管控','value':"1"},
							],	
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'150',
						title:'风险清单',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/risklist', type, param)
					},
				},
				fxgkcs:{		// 风险管控措施
					name:'风险管控措施',
					Dict:{
						search:{
							'name':'编码',
							'key':'measureno',
							'mode':0,
						},
						baseInfo:{
							"measureno":{name:"编码", must:true},
							"riskno":{name:"风险编码", must:true, type:'list'},
							"measures":{name:"措施详情", must:true},
							"controldepart":{name:"责任岗位"},
							"controlman":{name:"责任单位"},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							riskno: function(){
								return reqTransmit('ls/measure/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'150',
						title:'风险管控',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/measure', type, param)
					},
				},
				sgyhpc:{		// 事故隐患排查
					name:'事故隐患排查',
					Dict:{
						search:{
							'name':'编码',
							'key':'htcno',
							'mode':0,
						},
						baseInfo:{
							"htcno":{name:"编码", must:true},
							"inspectedon":{name:"排查日期", type:'date', must:true},
							"inspectiontype":{name:"排查类型", type:'list', must:true},
							"status":{name:"隐患状态", type:'list', must:true},
							"inspectedby":{name:"排查人"},
							"riskno":{name:"风险编码", must:true, type:'list'},
							"riskpointno":{name:"风险点编码", must:true, type:'list'},
							"areadetail":{name:"详细地点"},
							"htclevel":{name:"隐患等级", type:'list', must:true},
							"description":{name:"隐患描述", must:true},
							"managedepart":{name:"整改单位", must:true},
							"imgurllist":{name:"现场取证图片", type:'filename'},
							"limitdate":{name:"整改截止日期", type:'date', must:true},
							"measure":{name:"整改措施"},
							"correctiondate":{name:"整改时间", type:'date'},
							"correctionlmgurilist":{name:"整改后照片", type:'filename'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							inspectiontype:[
								{'name':'日常隐患排查','value':"1"},
								{'name':'综合性隐患排查','value':"2"},
								{'name':'专业性隐患排查','value':"3"},
								{'name':'专项或季节性隐患排查','value':"4"},
								{'name':'专家诊断性检查','value':"5"},
								{'name':'履职检査','value':"6"},
								{'name':'监管单位检查','value':"7"},
								{'name':'其他类型','value':"8"},
							],
							htclevel:[
								{'name':'重大','value':"1"},
								{'name':'一般','value':"2"},
							],
							status:[
								{'name':'整改中','value':"1"},
								{'name':'已整改','value':"2"},
							],
							riskpointno: function(){
								return reqTransmit('ls/riskpoint/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
							riskno: function(){
								return reqTransmit('ls/measure/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
						},
					},
					config:{
						formWidth:'920px',
						labelWidth:'150',
						operWidth:'180',
						title:'辨识任务',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/htc', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'imgurllist',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
			},
			yjgl:{
				yjya:{		// 应急预案管理
					name:'应急预案管理',
					Dict:{
						search:{
							'name':'应急预案名称',
							'key':'emergencyp1annarae',
							'mode':0,
						},
						baseInfo:{
							"emergencyplanno":{name:"编码", must:true},
							"emergencyp1annarae":{name:"应急预案名称", must:true},
							"publishdepart":{name:"编制单位"},
							"filenamelist":{name:"应急预案文件名", must:true, type:'filename'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'应急预案',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/plan', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'filenamelist',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				yjwz:{		// 应急物资管理
					name:'应急物资管理',
					Dict:{
						search:{
							'name':'应急物资名称',
							'key':'suppliesname',
							'mode':0,
						},
						baseInfo:{
							"suppliesno":{name:"编码", must:true},
							"suppliestype":{name:"应急物资类别", must:true},
							"suppliesname":{name:"应急物资名称", must:true},
							"scount":{name:"应急物资数量", must:true, type:'number'},
							"sunit":{name:"单位"},
							"place":{name:"存放地点", must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'应急物资',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/supplies', type, param)
					},
				},
				yjyljh:{		// 应急演练计划
					name:'应急演练计划',
					Dict:{
						search:{
							'name':'演练计划名称',
							'key':'drillname',
							'mode':0,
						},
						baseInfo:{
							"drillno":{name:"编码", must:true},
							"drillname":{name:"应急演练计划名称", must:true},
							"startdate":{name:"应急演练计划开始日期", type:'date', must:true},
							"enddate":{name:"应急演练计划结束日期", type:'date', must:true},
							"drillrange":{name:"应急演练范围"},
							"drilltarget":{name:"应急演练目标"},
							//"drilldate":{name:"应急演练日期", type:'date'},
							"flag":{name:"是否结束", must:true, type:'list', form:0},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							flag:[
								{'name':'结束','value':1},
								{'name':'未结束','value':0},
							],
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'170',
						operWidth:'180',
						title:'应急演练',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/drill', type, param)
					},
				},
				yjylss:{		// 应急演练实施
					name:'应急演练实施',
					Dict:{
						search:{
							'name':'编码',
							'key':'implemtno',
							'mode':0,
						},
						baseInfo:{
							"implemtno":{name:"编码", must:true},
							"drillno":{name:"应急演练计划编码", type:'list', must:true},
							"date":{name:"应急演练日期", type:'date', must:true},
							"participants":{name:"应急演练人员", must:true},
							"area":{name:"应急演练地点", must:true},
							"money":{name:"应急演练资金"},
							"scheme":{name:"应急演练实施方案"},
							"filelist":{name:"应急演练附件", type:'filename'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							drillno: function(){
								return reqTransmit('ls/drill/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'应急演练',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/implemt', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'filelist',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				yjdwxx:{		// 应急队伍信息
					name:'应急队伍信息',
					Dict:{
						search:{
							'name':'救援队伍名称',
							'key':'rescueteamname',
							'mode':0,
						},
						baseInfo:{
							"rescueteainno":{name:"编码", must:true},
							"rescueteamname":{name:"救援队伍名称", must:true},
							"rescueteamtype":{name:"救援队伍类别", must:true},
							"numer":{name:"救援队伍人数", must:true},
							"tel":{name:"救援队伍联系方式", must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'150',
						operWidth:'180',
						title:'应急队伍',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/rescue', type, param)
					},
				},
			},
			sgbgfx:{
				scsggl:{		// 事故管理
					name:'事故管理',
					Dict:{
						search:{
							'name':'事故名称',
							'key':'accidentname',
							'mode':0,
						},
						baseInfo:{
							"accidentno":{name:"编码", must:true},
							"accidentname":{name:"事故名称", must:true},
							"accidenttime":{name:"事故时间", type:'date', must:true},
							"accidentarea":{name:"事故地点"},
							"accidenttype":{name:"事故类别", type:'list', must:true},
							"accidentdegree":{name:"事故级别", type:'list', must:true},
							"lossamount":{name:"直接损失金额", type:'number', must:true},
							"accidentreason":{name:"事故原因"},
							"seriouslylnjured":{name:"重伤人数", type:'number'},
							"deaths":{name:"死亡人数", type:'number'},
							"missing":{name:"失踪人数", type:'number'},
							"accidentthrough":{name:"事故经过", type:'textarea', width:360, rows:4},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							accidenttype:[
								{'name':'顶板','value':"1"},
								{'name':'机电','value':"2"},
								{'name':'运输','value':"3"},
								{'name':'提升','value':"4"},
                                {'name':'透水','value':"5"},
								{'name':'中毒','value':"6"},
                                {'name':'窒息','value':"7"},
								{'name':'爆炸','value':"8"},
								{'name':'坍塌','value':"9"},
								{'name':'淹溺','value':"10"},
                                {'name':'触电','value':"11"},
								{'name':'高空坠落','value':"12"},
                                {'name':'其他','value':"13"},
							],
							accidentdegree:[
								{'name':'特别重大','value':"1"},
								{'name':'重大','value':"2"},
								{'name':'较大','value':"3"},
								{'name':'一般','value':"4"},
							],
						},
					},
					config:{
						formWidth:'920px',
						labelWidth:'120',
						operWidth:'150',
						title:'事故',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/accident', type, param)
					},
				},
				swryxx:{		// 伤亡人员信息
					name:'伤亡人员信息',
					Dict:{
						search:{
							'name':'姓名',
							'key':'pname',
							'mode':0,
						},
						baseInfo:{
							"accidentno":{name:"编码", must:true},
							"pname":{name:"姓名", must:true},
							"age":{name:"年龄"},
							"diploma":{name:"文化程度"},
							"worktype":{name:"工种"},
							"address":{name:"家庭住址"},
							"deathstype":{name:"伤亡类型", type:'list'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							deathstype:[
								{'name':'伤亡','value':"1"},
								{'name':'失踪','value':"2"},
								{'name':'重伤','value':"3"},
								{'name':'轻伤','value':"4"},
							],
						},
					},
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'150',
						title:'伤亡人员信息',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/personnel', type, param)
					},
				},
			},
			aqjyypx:{
				pxjhgl:{		// 培训计划
					name:'培训计划',
					Dict:{
						search:{
							'name':'培训主题',
							'key':'esubject',
							'mode':0,
						},
						baseInfo:{
							"eduplanno":{name:"编码", must:true},
							"esubject":{name:"培训主题", must:true},
							"eyear":{name:"年度", must:true, placeholder:'年度长度不能超过4位'},
							"type":{name:"培训类别", must:true},
							"methods":{name:"培训方式"},
							"startdate":{name:"计划开始日期", type:'date', must:true},
							"enddate":{name:"计划结束日期", type:'date', must:true},
							"eobject":{name:"培训对象", must:true},
							"teacher":{name:"培训讲师"},
							"purpose":{name:"培训目的", must:true},
                            "econtent":{name:"培训内容", must:true},
                            "flag":{name:"是否结束", must:true, type:'list', form:0},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							flag:[
								{'name':'结束','value':1},
								{'name':'未结束','value':0},
							],
						},
					},
					config:{
						formWidth:'920px',
						labelWidth:'120',
						operWidth:'150',
						title:'培训计划',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					request:function(type, param){
						return reqTransmit('ls/eduplan', type, param)
					},
				},
				pxjlgl:{		// 培训记录
					config:{
						title:'培训记录',
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'150',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
						],
					},
					Dict:{
						search:{
							'name':'编码',
							'key':'edurecordno',
							'mode':0,
						},
						baseInfo:{
							"edurecordno":{name:"编码", must:true},
							"eduplanno":{name:"培训计划编码", type:'list', must:true},
							"edurecorddate":{name:"培训日期", type:'date', must:true},
							"uploadfile":{name:"培训记录附件", type:'filename', must:true},
							"attendees":{name:"参加培训人员名单", type:'textarea', width:260, rows:4, must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							eduplanno: function(){
								return reqTransmit('ls/eduplan/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.eduplanno,'value':item.eduplanno})
									};
									return list;
								});
							},
						},
					},
					request:function(type, param){
						return reqTransmit('ls/edurecord', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'uploadfile',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				ryzzzs:{		// 人员资质证书
					config:{
						title:'人员资质证书',
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						buttons:[
							{'fn':'toDownload', 'type':'success', 'icon':'el-icon-download'}, 
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'人员姓名',
							'key':'rname',
							'mode':0,
						},
						baseInfo:{
							"recordno":{name:"编码", must:true},
							"rname":{name:"人员姓名", must:true},
							"type":{name:"证书类型", type:'list', must:true},
							"issueorganization":{name:"颁证机构"},
							"credentialsno":{name:"证书编号", must:true},
							"awarddate":{name:"发证日期", type:'date', must:true},
							"validitydate":{name:"证书有效期", type:'date', must:true},
							"filelist":{name:"证书文件", must:true, type:'filename'},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"创建时间", type:'date', form:0},
						},
						selectList:{
							// c. 27特种作业类型
							type:[
								{'name':'电工作业','value':'1'},
								{'name':'金属焊接、切割作业','value':'2'},
								{'name':'起重机械作业','value':'3'},
								{'name':'企业内机动车驾驶','value':'4'},
								{'name':'攀爬架设作业','value':'5'},
								{'name':'锅炉作业（含水质化验）','value':'6'},
								{'name':'压力容器作业','value':'7'},
								{'name':'制冷运行作业','value':'8'},
								{'name':'爆破作业','value':'9'},
								{'name':'矿山通风作业','value':'10'},
								{'name':'矿山排水作业','value':'11'},
								{'name':'矿山安全检查作业','value':'12'},
								{'name':'矿山提升运输作业','value':'13'},
								{'name':'采掘（剥）作业','value':'14'},
								{'name':'矿山救援作业','value':'15'},
								{'name':'危险物品作业','value':'16'},
								{'name':'经国家局批准的其他作业','value':'17'},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/record', type, param)
					},
					download:{
						filePath:'upload/public/',
						keyName:'filelist',
					},
					upload: function(data){
						return reqTransmitUpload('./public/'+this.download.filePath, 'post', data)
					},
				},
				tzzygw:{		// 特种作业岗位
					config:{
						title:'特种作业岗位',
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'编码',
							'key':'specialoperationsno',
							'mode':0,
						},
						baseInfo:{
							"specialoperationsno":{name:"编码", must:true},
							"certificate":{name:"证书名称", must:true},
							"stype":{name:"特种作业类型", type:'list', must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							// c. 27特种作业类型
							stype:[
								{'name':'电工作业','value':'1'},
								{'name':'金属焊接、切割作业','value':'2'},
								{'name':'起重机械作业','value':'3'},
								{'name':'企业内机动车驾驶','value':'4'},
								{'name':'攀爬架设作业','value':'5'},
								{'name':'锅炉作业（含水质化验）','value':'6'},
								{'name':'压力容器作业','value':'7'},
								{'name':'制冷运行作业','value':'8'},
								{'name':'爆破作业','value':'9'},
								{'name':'矿山通风作业','value':'10'},
								{'name':'矿山排水作业','value':'11'},
								{'name':'矿山安全检查作业','value':'12'},
								{'name':'矿山提升运输作业','value':'13'},
								{'name':'采掘（剥）作业','value':'14'},
								{'name':'矿山救援作业','value':'15'},
								{'name':'危险物品作业','value':'16'},
								{'name':'经国家局批准的其他作业','value':'17'},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/special', type, param)
					},
				},
				ygpxda:{		// 员工培训档案
					config:{
						title:'员工培训档案',
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'180',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'编码',
							'key':'eduplanno',
							'mode':0,
						},
						baseInfo:{
							"eduplanno":{name:"编码", must:true},
							"staffname":{name:"员工姓名", must:true},
							"record":{name:"持证情况", must:true},
							"edudate":{name:"培训时间", type:'date'},
							"eduassess":{name:"培训评估", must:true},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
						},
					},
					request:function(type, param){
						return reqTransmit('ls/edustaff', type, param)
					},
				},
			},
			ryzsxx:{
				getItem: function(param, query){
					return reqTransmit('ls/record', 'get', param)
				},
				saveItem: function(data){
					return request({
						url: 'ls/record',
						method: 'POST',
						data:data,
					}).then((res) => {
						return res
					})
				},
				updateItem: function(data){
					return request({
						url: 'ls/record',
						method: 'put',
						data:data,
					})
				},
				removeItem: function(data){
					return request({
						url: 'ls/record',
						method: 'delete',
						data:data,
					})
				},
			},
			tzsb:{
				tzgl:{		// 台账管理
					config:{
						formWidth:'920px',
						labelWidth:'120',
						operWidth:'150',
						title:'台账管理',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'设备名称',
							'key':'eqname',
							'mode':0,
						},
						baseInfo:{
							"eqno":{name:"设备编码", must:true},
							"etype":{name:"设备类别", must:true},
							"eqname":{name:"设备名称", must:true},
							"model":{name:"规格型号"},
							"manufacturedate":{name:"生产日期", type:'date', must:true},
							"esystem":{name:"所属系统"},
							"installdate":{name:"安装日期", type:'date'},
                            "number":{name:"出厂编号", must:true},
                            "factory":{name:"生产厂家"},
							"putdate":{name:"投运日期", type:'date', must:true},
							"estatus":{name:"设备状态", type:'list', must:true},
                            "area":{name:"安装地点", must:true},
							"checkperiod":{name:"检验周期（月）", must:true, type:'number'},
                            "ratedvoltage":{name:"额定电压", type:'number'},
                            "ratedcurrent":{name:"额定电流", type:'number'},
                            "ratedpower":{name:"额定功率", type:'number'},
                            "contact":{name:"联系人", must:true},
                            "contacttel":{name:"联系电话", must:true},
                            "opcertificate":{name:"持证要求"},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							estatus:[
								{'name':'正常','value':"0"},
								{'name':'报警','value':"1"},
							],
						},
					},
					request:function(type, param){
						return reqTransmit('ls/info', type, param)
					},
				},
				jybg:{		// 检验报告
					config:{
						formWidth:'520px',
						labelWidth:'120',
						operWidth:'150',
						title:'检验报告',
						buttons:[
							{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
							{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
						],
					},
					Dict:{
						search:{
							'name':'检验报告编号',
							'key':'reportno',
							'mode':0,
						},
						baseInfo:{
							"reportno":{name:"检验报告编号", must:true},
							"eqno":{name:"设备编码", type:'list', must:true},
							"checkdate":{name:"检验日期", type:'date', must:true},
							"reportlist":{name:"检验报告", must:true, type:'textarea', width:260, rows:4},
							"updatetime":{name:"更新时间", type:'date', form:0},
							"addtime":{name:"添加时间", type:'date', form:0},
						},
						selectList:{
							eqno: function(){
								return reqTransmit('ls/info/code', 'get', {}).then(function(res){
									var list = [];
									for(var item of res){
										list.push({'name':item.drillno,'value':item.drillno})
									};
									return list;
								});
							},
						},
					},
					request:function(type, param){
						return reqTransmit('ls/repor', type, param)
					},
				},
			},
		},
		bpjc:{
			jyl:{		// 降雨量
				name:'降雨量',
				Dict:{
					search:[
						//{'type':'string', 'name':'片区名称', 'key':'districtname', 'mode':0, 'width':'240px'},
						{'type':'daterange', 'name':'按日期范围查询', 'key':'timeSpace'},
					],
					baseInfo:{
						"zkname":{name:"测点编号", must:true},
						"sensorname":{name:"传感器名称", must:true},
						"jctime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"value2":{name:"降雨总量", must:true},
						"value3":{name:"实时降雨量", must:true},
					},
					selectList:{
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/bp/jiangyuliang', type, param).then(function(res){
						if(type === 'get'){
							var body = res.body, list = body.list;
							for(var item of list){
								item.value2 = ~~(item.value2 * 100) / 100
							};
						};
						return res;
					});
				},
			},
			btbmwy:{		// 坝体表面位移
				name:'坝体表面位移',
				Dict:{
					search:[
						//{'type':'string', 'name':'片区名称', 'key':'districtname', 'mode':0, 'width':'240px'},
						{'type':'daterange', 'name':'按日期范围查询', 'key':'timeSpace'},
					],
					baseInfo:{
						"zkname":{name:"测点编号", must:true},
						"sensorname":{name:"传感器名称", must:true},
						"disx":{name:"x方向变化量", must:true},
						"disy":{name:"y方向变化量", must:true},
						"disz":{name:"z方向变化量", must:true},
						"jctime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/bp/batidibiaoweiyi', type, param)
				},
			},
			btwylr:{		// 坝体位移录入
				name:'坝体位移录入',
				Dict:{
					search:[
						{'type':'string', 'name':'测点编号', 'key':'zkname', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"zkname":{name:"测点编号", must:true},
						"sensorname":{name:"传感器名称", must:true},
						"disx":{name:"x方向变化量", must:true},
						"disy":{name:"y方向变化量", must:true},
						"disz":{name:"z方向变化量", must:true},
						"curx":{name:"当前点X坐标", must:true},
						"cury":{name:"当前点Y坐标", must:true},
						"curz":{name:"当前点Z坐标", must:true},
						"ifbj":{name:"是否报警", type:'list', must:true},
						//"ifstart":{name:"是否起始", must:true},
						//"ifview":{name:"是否显示", must:true},
						"jctime":{name:"监测时间", must:true, type:'date', formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"jcbjtime":{name:"解除报警时间", type:'date'},
						//"lenghtb":{name:"B原始值", must:true},
						//"lengtha":{name:"A原始值(1/10毫米)", must:true},
					},
					selectList:{
						ifbj:[
							{'name':'否','value':0},
							{'name':'是','value':1},
						],
					},
				},
				config:{
					title:'位移记录',
					labelWidth:'120',
					otherBtn:[
						{fn:'toAdd', type:'primary', icon:'el-icon-plus',}
					],
				},
				request:function(type, param){
					return reqTransmit('ls/bp/batidibiaoweiyiyh', type, param)
				},
			},
			ksw:{		// 库水位
				name:'库水位',
				Dict:{
					search:[
						{'type':'daterange', 'name':'按日期范围查询', 'key':'timeSpace'},
					],
					baseInfo:{
						"zkname":{name:"测点编号", must:true},
						"sensorname":{name:"传感器名称", must:true},
						"value2":{name:"水位高度", must:true},
						"ifbj":{name:"是否报警", type:'list', must:true},
						"jctime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						ifbj:[
							{'name':'否','value':'0'},
							{'name':'是','value':'1'},
						],
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/bp/kushuiwei', type, param)
				},
			},
			bjgl:{		// 报警管理
				name:'报警管理',
				Dict:{
					search:[
						{'type':'daterange', 'name':'按日期范围查询', 'key':'timeSpace'},
					],
					baseInfo:{
						"alarmname":{name:"报警名称", must:true},
						"alarmtype":{name:"报警类型", must:true},
						"fs":{name:"是否发送过短信", type:'list', must:true},
						"status":{name:"报警状态", type:'list', must:true},
						"yjjb":{name:"预警级别", must:true},
						"jctime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val*1000), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						fs:[
							{'name':'未发送','value':0},
							{'name':'发送','value':1},
						],
						status:[
							{'name':'报警','value':0},
							{'name':'已解除','value':1},
						],
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/bp/alarmtype', type, param)
				},
			},
			yjjbsz:{		// 预警级别设置
				name:'预警级别设置',
				Dict:{
					baseInfo:{
						"sensormark":{name:"设备类型", must:true, disabled:true},
						"alarm1":{name:"报警值1"},
						"alarm2":{name:"报警值2"},
						"alarm3":{name:"报警值3"},
						"alarm4":{name:"报警值4"},
					},
					selectList:{
					},
				},
				config:{
					title:'预警',
					labelWidth:'120',
					pagination:false,
					buttons:[
						{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
					],
				},
				request:function(type, param){
					return reqTransmit('ls/bp/sensor', type, param)
				},
			},
		},
		rcgl:{
			qyjbxxgl:{
				name:'区域基本信息管理',
				Dict:{
					/* search:[
						{'type':'string', 'name':'区域名称', 'key':'areaname', 'mode':0, 'width':'240px'},
					], */
					baseInfo:{
						"areaname":{name:"区域名称", must:true},
						"areano":{name:"区域编号", must:true},
						"areanumber":{name:"核定人数", must:true},
						"areatype":{name:"区域类型", type:'list', must:true},
						"addtime":{name:"时间", form:0, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						areatype:[
							{'name':'重点区域','value':'重点区域'},
							{'name':'一般区域','value':'一般区域'},
							{'name':'限入区域','value':'限入区域'},
							{'name':'其它','value':'其它'},
						],
					},
				},
				config:{
					pagination:false,
					title:'区域基本信息',
					buttons:[
						{'fn':'toEdit', 'type':'primary', 'icon':'el-icon-edit'}, 
						{'fn':'toDelete', 'type':'danger', 'icon':'el-icon-delete'}
					],
					otherBtn:[
						{fn:'toAdd', type:'primary', icon:'el-icon-plus', name:'添加区域'}
					],
				},
				request:function(type, param){
					return reqTransmit('ls/ar/areaInfo/pc', type, param)
				},
			},
			rygl:{		// 人员管理
				name:'人员管理',
				Dict:{
					search:[
						{'type':'string', 'name':'区域名称', 'key':'devicename', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"devicename":{name:"区域名称", must:true},
						"empno":{name:"人员编号", must:true},
						"devicekey":{name:"设备编码", must:true},
						"photoftpurl":{name:"照片", type:'button', name:'预览', btnType:'primary', icon:'', align:'center', click:function(url){
							var that = this;
							var loading = this.$loading({lock: true,text: '请稍后.....',spinner: 'el-icon-loading',background: 'rgba(0, 0, 0, 0.7)'});

							request({url: 'tools/downloadImgToBase64',method: 'get',params:{url:url},}).then(function(res){
								loading.close();
								if(res.head.code === '0000'){
									var body = res.body, data = body.data, type = body.type;
									that.$alert('<div style="min-width:300px;"><img src="data:'+type+';base64,'+data+'"/></div>', '提示', {
										dangerouslyUseHTMLString: true,
										showConfirmButton:false,
										customClass:'custom-alert'
									});
								}else{
									that.$alert(res.head.message, '提示', {
										type: 'warning'
									})
								};
							});
						}},
						"rectime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/pc/carPersonAcclog2', type, param)
				},
			},
			clgl:{		// 车辆管理
				name:'车辆管理',
				Dict:{
					search:[
						{'type':'string', 'name':'车牌号', 'key':'license', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"deviceName":{name:"设备名称", must:true},
						"ipaddr":{name:"区域名称", must:true},
						"license":{name:"车牌号码", must:true},
						"direction":{name:"方向", must:true, type:'list'},
						"carColor":{name:"车牌颜色", must:true, type:'list'},
						//"sec":{name:"sec", must:true},
						//"serialno":{name:"serialno", must:true},
						//"triggerType":{name:"triggerType", must:true},
						"type":{name:"类型", must:true, type:'list'},
						"imageFile":{name:"图像数据", must:true},
						"addtime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						direction:[
							{'name':'未知','value':0},
							{'name':'来向','value':1},
							{'name':'去向','value':2},
						],
						carColor:[
							{'name':'未知','value':0},
							{'name':'蓝牌','value':'BLUE_PLATE'},
							{'name':'黄牌','value':'YELLOW_PLATE'},
							{'name':'白牌','value':'WHITE_PLATE'},
							{'name':'黑牌','value':'BLACK_PLATE'},
							{'name':'绿牌','value':'GREEN_PLATE'},
							{'name':'黄绿牌','value':'YELLOW_GREEN_PLATE'},
						],
						type:[
							{'name':'未知','value':0},
							{'name':'未知','value':'PLATE_TYPE_NULL'},
							{'name':'普通蓝牌','value':'PLATE_TYPE_BLUE'},
							{'name':'普通黑牌','value':'PLATE_TYPE_BLACK'},
							{'name':'普通黄牌','value':'PLATE_TYPE_YELL'},
							{'name':'双层黄牌','value':'PLATE_TYPE_YELL2'},
							{'name':'警察车牌','value':'PLATE_TYPE_POL'},
							{'name':'武警车牌','value':'PLATE_TYPE_APOL'},
							{'name':'双层武警','value':'PLATE_TYPE_APOL2'},
							{'name':'单层军牌','value':'PLATE_TYPE_ARM'},
							{'name':'双层军牌','value':'PLATE_TYPE_ARM2'},
							{'name':'个性车牌','value':'PLATE_TYPE_INDI'},
							{'name':'新能源小车牌','value':'PLATE_TYPE_NEWN'},
							{'name':'新能源大车牌','value':'PLATE_TYPE_NEWN1'},
							{'name':'大使馆车牌','value':'PLATE_TYPE_EMB'},
							{'name':'领事馆车牌','value':'PLATE_TYPE_CON'},
							{'name':'民航车牌','value':'PLATE_TYPE_MIN'},
						],
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/pc/carAcclog', type, param)
				},
			},
		},
		hjjc:{
			history:{
				name:'历史数据',
				Dict:{
					search:[
						{'type':'string', 'name':'数据项', 'key':'dataitem', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"deviceId":{name:"设备ID", must:true},
						"dataitem":{name:"数据项", must:true},
						"datavalue":{name:"数据值", must:true},
						"ifbj":{name:"是否报警", type:'list', must:true},
						"mesg":{name:"信息", must:true},
						"addtime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						ifbj:[
							{'name':'否','value':0},
							{'name':'是','value':1},
						],
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/hj/hjDevdata', type, param)
				},
			},
			ycsjgl:{		// 异常数据管理
				name:'异常数据管理',
				Dict:{
					search:[
						{'type':'string', 'name':'测点编码', 'key':'measpno', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"measpno":{name:"测点编码", must:true},
						"abnormaltype":{name:"异常类型", type:'list', must:true},
						"startdate":{name:"异常开始时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"enddate":{name:"异常结束时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"maximum":{name:"异常期间最大值", must:true},
						"maxtime":{name:"最大值时刻", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"average":{name:"平均值", must:true},
						"reason":{name:"异常原因", must:true},
						"measures":{name:"处理措施", must:true},
						"addname":{name:"录入人", must:true},
						"addtime":{name:"录入时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
						"datadate":{name:"数据时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						abnormaltype:[
							{'name':'超限报警','value':1},
							{'name':'断电报警','value':2},
							{'name':'馈电异常','value':3},
							{'name':'标校','value':4},
							{'name':'标校报警','value':5},
							{'name':'超量程','value':8},
							{'name':'控制器故障','value':16},
							{'name':'不巡检','value':32},
							{'name':'暂停','value':64},
							{'name':'传感器故障','value':128},
							{'name':'离线','value':255},
						],
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/hj/hjAbnormal', type, param)
				},
			},
		},
		zjjj:{
			jcxxgl:{		//	基础信息管理
				name:'基础信息管理',
				Dict:{
					baseInfo:{
						"areano":{name:"区域编号", must:true},
						"areaname":{name:"区域名称", must:true},
						"areatype":{name:"区域类型", must:true},
						"areanumber":{name:"区域核定人数", must:true},
						"type":{name:"警戒类型", type:'list', must:true},
						"addtime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
						type:[
							{'name':'人员车辆','value':1},
							{'name':'周界警戒','value':2},
						],
					},
				},
				config:{
					pagination:false,
				},
				request:function(type, param){
					return reqTransmit('ls/ar/areaInfo/zj', type, param)
				},
			},
			qysbgl:{		// 区域设备管理
				name:'人员管理',
				Dict:{
					search:[
						{'type':'string', 'name':'区域名称', 'key':'devicename', 'mode':0, 'width':'240px'},
					],
					baseInfo:{
						"devicename":{name:"区域名称", must:true},
						"zjareano":{name:"区域编号", must:true},
						"deviceno":{name:"设备编号", must:true},
						"deviceip":{name:"设备IP", must:true},
						"addtime":{name:"时间", must:true, type:"formatDate", formatDate:function(val){return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')}},
					},
					selectList:{
					},
				},
				config:{
				},
				request:function(type, param){
					return reqTransmit('ls/zj/zjDevice', type, param)
				},
			},
			rqbjsj:{		// 入侵报警数据
				name:'入侵报警数据',
				Dict:{
					/* search:[
						{'type':'string', 'name':'车牌号', 'key':'license', 'mode':0, 'width':'240px'},
					], */
					baseInfo:{
						"channelname":{name:"通道名称", must:true},
						"disname":{name:"区域名称", must:true},
						"eventstate":{name:"事件状态"},
						//"eventtype":{name:"事件类型", form:0},
						"datetime":{name:"时间"},
					},
					selectList:{
					},
				},
				config:{
				},
				request:function(type, param){
					param.start = param.page * param.size;
					param.command = 'zhouj_list';
					//return reqTransmit('ls/zj/zjAbnormal', type, param)
					return reqTransmit('ls/data/selData', type, param)
				},
			},
		},
		edge:{
			Screen:{
				rcgl:{
					getCarList: function(param){
						return reqTransmit('ls/car/seldata', 'get', param)
						//return request({url: 'ls/car/seldata', method:'get', param:param})
					},
				},
			},
		},
	};
};

// 配制信息
var Config = function(){
	// 获取单元信息
	var getModuleInfo = function(that){
		var path = that.$route.path || '';
		var parts = path.replace('/', '').split('/');
		var i = 0;
		// 递归遍历
		return (function loop(json){
			var key = parts[i]; i++;
			return json[key] ? loop(json[key]) : json;
		})(reqApi);
	};
	return {getModuleInfo:getModuleInfo}
};


//export var tailingPond = tailingPond();
export var reqApi = reqApi();
export var Config = Config();

// WEBPACK FOOTER //
// ./src/common/js/common.js