新增接口

This commit is contained in:
2025-02-08 16:42:01 +08:00
parent 9c357b182a
commit 93cd25f1bf
2 changed files with 178 additions and 28 deletions

View File

@@ -44,7 +44,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import {queryArea, queryPointByArea, callTask} from '@/utils/getData0.js'
import {queryBusinessProcesses, queryPointByArea, callTask} from '@/utils/getData0.js'
export default {
components: {
NavBar
@@ -61,48 +61,78 @@
options4: [],
index4: '',
options5: [],
index5: ''
index5: '',
retData: '',
descObj: {},
dtel: ''
};
},
created () {
this._queryArea3('')
this._queryArea4('')
this._queryBusinessProcesses()
},
methods: {
selectChange1 (e) {
if(!e){
return
}
this.index1 = e
},
selectChange2 (e) {
if(!e){
return
}
this.index2 = e
},
selectChange3 (e) {
if(!e){
return
}
this.index3 = e
this._queryPointByArea1(e)
},
selectChange4 (e) {
if(!e){
return
}
this.index4 = e
this._queryPointByArea2(e)
},
async _queryArea3 (a) {
let res = await queryArea(a)
this.options3 = [...res]
this.options3.map(el => {
this.$set(el, 'value', el.region_code)
this.$set(el, 'text', el.region_name)
selectChange5 (e) {
this.index1 = ''
this.index2 = ''
this.index3 = ''
this.index4 = ''
this.options1 = []
this.options2 = []
this.options3 = []
this.options4 = []
if(!e){
return
}
this.index5 = e
let descObj = this.retData.find(item => item.name == e);
let dictArr = descObj.dictDetails
dictArr.map(el => {
if (el.dictSort == 1) {
this.options3.push({'value': el.value, 'text' :el.label})
}
if (el.dictSort == 2) {
this.options4.push({'value': el.value, 'text' :el.label})
}
})
},
async _queryArea4 (a) {
let res = await queryArea(a)
this.options4 = [...res]
this.options4.map(el => {
this.$set(el, 'value', el.region_code)
this.$set(el, 'text', el.region_name)
async _queryBusinessProcesses () {
let res = await queryBusinessProcesses()
console.log(res)
this.retData = res.data
res.data.map(el => {
this.options5.push({'value': el.name, 'text' :el.description})
})
},
/** 点位查询1 */
async _queryPointByArea1 (a) {
let res = await queryPointByArea(a)
this.options1 = [...res]
this.options1 = [...res.data]
this.options1.map(el => {
this.$set(el, 'value', el.device_code)
this.$set(el, 'text', el.device_name)
@@ -111,7 +141,7 @@
/** 点位查询2 */
async _queryPointByArea2 (a) {
let res = await queryPointByArea(a)
this.options2 = [...res]
this.options2 = [...res.data]
this.options2.map(el => {
this.$set(el, 'value', el.device_code)
this.$set(el, 'text', el.device_name)
@@ -120,6 +150,14 @@
toClear () {
this.index1 = ''
this.index2 = ''
this.index3 = ''
this.index4 = ''
this.index5 = ''
this.options1 = []
this.options2 = []
this.options3 = []
this.options4 = []
this.options5 = []
},
async _callTask () {
this.disabled = true