| | |
| | | import { jsonp } from 'vue-jsonp'
|
| | | import any = jasmine.any;
|
| | |
|
| | |
|
| | | const statusMap = ["default", "processing", "success", "error"];
|
| | | const status = ["关闭", "运行中", "已上线", "异常"];
|
| | |
|
| | |
| | | private createForm: any = null;
|
| | |
|
| | | private editRecord: any = {};
|
| | |
|
| | | private pagination: any = {
|
| | | total: 0,
|
| | | current: 1,
|
| | | pageSize: 5,
|
| | | showSizeChanger: false,
|
| | | showQuickJumper: false
|
| | | pageSize: 10,
|
| | | showSizeChanger: true,
|
| | | showQuickJumper: true,
|
| | | pageSizeOptions: ["10", "30", "60", "100"],
|
| | | showTotal: (total: number) => `共有 ${this.pagination.total} 条数据`, //分页中显示总的数据
|
| | | };
|
| | |
|
| | | private updateRecord1: any = {};
|
| | |
| | | label: '/',
|
| | | },
|
| | | ]
|
| | | |
| | | private changesen:number=0
|
| | | private handleChangevalue1(value: string){
|
| | | console.log(value);
|
| | | console.log(this.changesen);
|
| | | if(this.changesen===1){
|
| | | this.handleChange2(this.reskey);
|
| | | }
|
| | | }
|
| | | private AQIhandleChange(value: string){
|
| | | this.handleChange2(this.reskey);
|
| | | console.log(this.changesen);
|
| | | if(this.changesen===1){
|
| | | this.handleChange2(this.reskey);
|
| | | }
|
| | | }
|
| | | private ceAQIhandleChange(value: string){
|
| | | this.handleChange2(this.reskey);
|
| | | console.log(this.changesen);
|
| | | if(this.changesen===1){
|
| | | this.handleChange2(this.reskey);
|
| | | }
|
| | | }
|
| | | private tablecolumns:TableColumnType<datatable>=[
|
| | | {
|
| | |
| | | // agehou:''
|
| | | // }
|
| | | ]
|
| | |
|
| | | private rowSelectionChange(selectedRowKeys: string[], selectedRows: DataType[]){
|
| | | // console.log(selectedRows);
|
| | | this.selectedtable=selectedRows
|
| | |
| | | }
|
| | |
|
| | | private columns: any[] = [
|
| | | {
|
| | | title: "序号",
|
| | | dataIndex: "key",
|
| | | key: "key",
|
| | | align: "center",
|
| | | customRender: (text:any, record:any, index:any) => `${index + 1}`,
|
| | | width: 60,
|
| | | },
|
| | | {
|
| | | title: "名称",
|
| | | dataIndex: "name"
|
| | |
| | | this.addMapFlag = true
|
| | | }
|
| | | private showMap2() {
|
| | | this.typeOperation = 'upa'
|
| | | this.editMapFlag = true
|
| | | }
|
| | | // 定位级别数据
|
| | |
| | | private current: number = 1
|
| | | private handlerTableChange(pagination: any, filter: any, sorter: any): void {
|
| | | this.current = pagination.current
|
| | | this.pagination.current = pagination.current;
|
| | | this.pagination.pageSize = pagination.pageSize;
|
| | | this.pagination.total = pagination.total;
|
| | | this.loadRuleData(pagination.current)
|
| | | }
|
| | |
|
| | |
| | |
|
| | | //下拉查询框方法
|
| | | private handleChange1(selectedItems:any) {
|
| | |
|
| | | if (selectedItems === undefined) {
|
| | | this.selectMt = null
|
| | | }else {
|
| | |
| | | this.datatable=[]
|
| | | this.datatable=res.data.data
|
| | | if(this.selectvalue1==='a99054'){
|
| | | console.log(21323);
|
| | | for(var i=0;i<this.datatable.length;i++){
|
| | | if(this.ceAQIvalue==='+'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel+Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2)
|
| | | }else if(this.ceAQIvalue==='-'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel-Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein).toFixed(2))
|
| | | }else if(this.ceAQIvalue==='*'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel*Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel * this.ceAQIvaluein).toFixed(2))
|
| | | }else if(this.ceAQIvalue==='/'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel/Number(this.ceAQIvaluein)).toFixed(3)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel / this.ceAQIvaluein).toFixed(3))
|
| | | }
|
| | | this.datatable[i].agehou='ce1*'+this.datatable[i].cel
|
| | | }
|
| | |
| | | // this.datatable[i].cel=parseFloat(this.datatable[i].cel+this.ceAQIvaluein).toFixed(2)
|
| | | // this.datatable[i].agehou='aqi*'+this.datatable[i].aqi+'+'+'ce1*'+this.datatable[i].cel
|
| | | if(this.AQIvalue1==='+'){
|
| | | // console.log(this,'+++');
|
| | | this.datatable[i].aqi=parseFloat((this.datatable[i].aqi) + Number(this.AQIvalue)).toFixed(2)
|
| | | this.datatable[i].aqi=((this.datatable[i].aqi-0) + (this.AQIvalue-0)).toFixed(2)
|
| | | }else if(this.AQIvalue1==='-'){
|
| | | this.datatable[i].aqi=parseFloat(this.datatable[i].aqi - Number(this.AQIvalue)).toFixed(2)
|
| | | this.datatable[i].aqi=Number((this.datatable[i].aqi - this.AQIvalue)).toFixed(2)
|
| | | } else if(this.AQIvalue1==='*'){
|
| | | this.datatable[i].aqi=parseFloat(this.datatable[i].aqi * Number(this.AQIvalue)).toFixed(2)
|
| | | this.datatable[i].aqi=Number((this.datatable[i].aqi * this.AQIvalue)).toFixed(2)
|
| | | }else if(this.AQIvalue1==='/'){
|
| | | this.datatable[i].aqi=parseFloat(this.datatable[i].aqi / Number(this.AQIvalue)).toFixed(3)
|
| | | } |
| | | this.datatable[i].aqi=Number((this.datatable[i].aqi / this.AQIvalue).toFixed(3))
|
| | | }
|
| | | if(this.ceAQIvalue==='+'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel + Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2)
|
| | | }else if(this.ceAQIvalue==='-'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel - Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein)).toFixed(2)
|
| | | }else if(this.ceAQIvalue==='*'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel * Number(this.ceAQIvaluein)).toFixed(2)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel * this.ceAQIvaluein)).toFixed(2)
|
| | | }else if(this.ceAQIvalue==='/'){
|
| | | this.datatable[i].cel=parseFloat(this.datatable[i].cel / Number(this.ceAQIvaluein)).toFixed(3)
|
| | | this.datatable[i].cel=Number((this.datatable[i].cel / this.ceAQIvaluein).toFixed(3))
|
| | | }
|
| | | this.datatable[i].agehou='aqi*'+this.datatable[i].aqi+'+'+'ce1*'+this.datatable[i].cel
|
| | | }
|
| | | }
|
| | | |
| | | this.changesen=1;
|
| | | })
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 存放查询的组织id
|
| | | private selectMt: any = null
|
| | | |
| | |
|
| | | private loading: boolean=false
|
| | | |
| | |
|
| | | private handleCancel(){
|
| | | |
| | |
|
| | | }
|
| | | //新建保存
|
| | | private handleCreateModalOk() {
|
| | |
| | | }
|
| | |
|
| | | private handleCreateModalCancel1():any{
|
| | | this.datatable=[];
|
| | | this.selectvalue1='请选择因子';
|
| | | this.changesen=0;
|
| | | this.visibleCreateModal1=false;
|
| | | this.datatable=[]
|
| | | this.selectvalue1='请选择因子'
|
| | | }
|
| | |
|
| | | private handlerSelectChange(arr1: any, arr2: any) {
|
| | |
| | | name: this.serch.name,
|
| | | mac: this.serch.name,
|
| | | page: pageSize,
|
| | | size: 8
|
| | | size: this.pagination.pageSize,
|
| | | })
|
| | | .then(res => {
|
| | | if(res.data.code === 0) {
|
| | |
| | | }
|
| | |
|
| | | private receiveFlag2(flag: boolean){
|
| | | console.log('receiveFlag2');
|
| | | this.editMapFlag = flag
|
| | | }
|
| | | // 接收新增经纬度点
|
| | | private receiveLomLat(lonLat: any) {
|
| | |
|
| | | this.addLL = lonLat
|
| | | this.getTownData(lonLat)
|
| | | }
|
| | |
|
| | | private getTownData(lonLat: any) {
|
| | | // jsonp('/proxy/reverse_geocoding/v3/', {
|
| | | jsonp('https://api.map.baidu.com/reverse_geocoding/v3/', {
|
| | | ak: 'e5ig9Z7AKFjv8wbkqDbuLkUMzBev0tgT',
|
| | | output: 'json',
|
| | | coordtype: 'wgs8411',
|
| | | extensions_town: true,
|
| | | location: lonLat.lat+ ',' + lonLat.lng
|
| | | }).then((res: any) => {
|
| | | if(this.typeOperation === 'add') {
|
| | | this.town_code = res.result.addressComponent.town_code
|
| | | this.form.setFieldsValue({
|
| | | jingdu: this.addLL.lng,
|
| | | weidu: this.addLL.lat,
|
| | | town: res.result.addressComponent.town
|
| | | })
|
| | | } else {
|
| | | console.log(res);
|
| | | if (!(res.result.addressComponent.town === '' && res.result.addressComponent.town_code === '')){
|
| | | this.editBeforeData.town.townName = res.result.addressComponent.town
|
| | | this.editBeforeData.town.townCode = res.result.addressComponent.town_code
|
| | | } else {
|
| | | this.editBeforeData.town.townName = res.result.addressComponent.town
|
| | | this.editBeforeData.town.townCode = res.result.addressComponent.town_code
|
| | | this.$message.warning('选择位置信息异常')
|
| | | }
|
| | | console.log(lonLat,'dsasa');
|
| | | let self=this
|
| | | var geocoder = new AMap.Geocoder({
|
| | | // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
| | | city: '010'
|
| | | })
|
| | | geocoder.getAddress(lonLat, function(status, result) {
|
| | | console.log(result,'result');
|
| | | if (status === 'complete' && result.info === 'OK') {
|
| | | // self.formattedAddress=result.regeocode.formattedAddress
|
| | | // console.log(result,'321312');
|
| | | if(self.typeOperation === 'add') {
|
| | | if(result.regeocode.addressComponent.towncode.length>9){
|
| | | self.town_code=result.regeocode.addressComponent.towncode.slice(0,9)
|
| | | }else{
|
| | | self.town_code = result.regeocode.addressComponent.towncode
|
| | | }
|
| | | self.form.setFieldsValue({
|
| | | jingdu: self.addLL[0],
|
| | | weidu: self.addLL[1],
|
| | | town: result.regeocode.addressComponent.township
|
| | | })
|
| | | console.log(self.town_code);
|
| | | } else {
|
| | | if (!(result.regeocode.addressComponent.township === '' && result.regeocode.addressComponent.towncode === '')){
|
| | | self.editBeforeData.town.townName = result.regeocode.addressComponent.township
|
| | | if(result.regeocode.addressComponent.towncode.length>9){
|
| | | self.editBeforeData.town.townCode = result.regeocode.addressComponent.towncode.slice(0,9)
|
| | | }else{
|
| | | self.editBeforeData.town.townCode = result.regeocode.addressComponent.towncode
|
| | | }
|
| | | // console.log(self.editBeforeData.town.townName,self.editBeforeData.town.townCode,'222');
|
| | | } else {
|
| | | self.editBeforeData.town.townName = result.regeocode.addressComponent.town
|
| | | self.editBeforeData.town.townCode = result.regeocode.addressComponent.towncode
|
| | | self.$message.warning('选择位置信息异常')
|
| | | }
|
| | |
|
| | | }
|
| | | })
|
| | | }
|
| | | // result为对应的地理位置详细信息
|
| | | }
|
| | | })
|
| | |
|
| | | // jsonp('/proxy/reverse_geocoding/v3/', {
|
| | | // jsonp('https://api.map.baidu.com/reverse_geocoding/v3/', {
|
| | | // ak: 'e5ig9Z7AKFjv8wbkqDbuLkUMzBev0tgT',
|
| | | // output: 'json',
|
| | | // coordtype: 'wgs8411',
|
| | | // extensions_town: true,
|
| | | // location: lonLat.lat+ ',' + lonLat.lng
|
| | | // }).then((res: any) => {
|
| | | // console.log(res,'res');
|
| | | // if(this.typeOperation === 'add') {
|
| | | // this.town_code = res.result.addressComponent.town_code
|
| | | // this.form.setFieldsValue({
|
| | | // jingdu: this.addLL.lng,
|
| | | // weidu: this.addLL.lat,
|
| | | // town: res.result.addressComponent.town
|
| | | // })
|
| | | // } else {
|
| | | // console.log(res,'555');
|
| | | // if (!(res.result.addressComponent.town === '' && res.result.addressComponent.town_code === '')){
|
| | | // this.editBeforeData.town.townName = res.result.addressComponent.town
|
| | | // this.editBeforeData.town.townCode = res.result.addressComponent.town_code
|
| | | // } else {
|
| | | // this.editBeforeData.town.townName = res.result.addressComponent.town
|
| | | // this.editBeforeData.town.townCode = res.result.addressComponent.town_code
|
| | | // this.$message.warning('选择位置信息异常')
|
| | | // }
|
| | |
|
| | | // }
|
| | | // })
|
| | | }
|
| | | // 接收修改经纬度点
|
| | | private receiveLomLat1(lonLat: any) {
|
| | | this.editBeforeData.longitude = lonLat.lng
|
| | | this.editBeforeData.latitude = lonLat.lat
|
| | | console.log(lonLat,'lonLat');
|
| | | this.editBeforeData.longitude = lonLat[0]
|
| | | this.editBeforeData.latitude = lonLat[1]
|
| | | this.getTownData(lonLat)
|
| | | }
|
| | |
|