Commit d5176562 authored by liwei's avatar liwei

语音部署指令位置页面和语音指令页面开发,以及AI无人站换热站搜索框改造

parent c6775349
......@@ -2,7 +2,7 @@ import httpTwo from '../httpTwo'
export const getVoiceCommandsData = (item) => {
return httpTwo.get(`/busVoiceCommands/list?page=${item.page}&rows=${item.pageSize}&stationId=${item.stationId}&ipAddress=${item.ipAddress}&macAddress=${item.macAddress}&startTime=${item.startTime}&endTime=${item.endTime}`)
return httpTwo.get(`/busVoiceCommands/list?page=${item.page}&rows=${item.rows}&stationId=${item.stationId}&ipAddress=${item.ipAddress}&macAddress=${item.macAddress}&startTime=${item.startTime}&endTime=${item.endTime}`)
}
export const addVoiceCommands = (item) => {
......@@ -18,5 +18,5 @@ export const updateVoiceCommands = (item) => {
}
export const exportVoiceCommands = (item) => {
return httpTwo.get(`/busVoiceCommands/export`)
return httpTwo.get(`/busVoiceCommands/export?stationId=${item.stationId}&ipAddress=${item.ipAddress}&macAddress=${item.macAddress}&startTime=${item.startTime}&endTime=${item.endTime}`,'','',{responseType:'blob'})
}
......@@ -3,7 +3,7 @@ import axios from "axios";
export const getVoiceCommandsLocationData = (item) => {
return httpTwo.get(`/busVoiceCommandsLocation/list?page=${item.page}&rows=${item.pageSize}&stationId=${item.stationId}&ipAddress=${item.ipAddress}&macAddress=${item.macAddress}`)
return httpTwo.get(`/busVoiceCommandsLocation/list?page=${item.page}&rows=${item.rows}&stationId=${item.stationId}&ipAddress=${item.ipAddress}&macAddress=${item.macAddress}`)
}
export const addVoiceCommandsLocation = (item) => {
......@@ -17,3 +17,7 @@ export const deleteVoiceCommandsLocation = (id) => {
export const updateVoiceCommandsLocation = (item) => {
return httpTwo.put(`/busVoiceCommandsLocation/update/${item.businessId}`,item)
}
export const getVoiceCommandsLocationDetail = (id) => {
return httpTwo.get(`/busVoiceCommandsLocation/detail/${id}`)
}
......@@ -218,24 +218,34 @@ function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -262,8 +272,8 @@ onMounted(() => {
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -157,24 +157,34 @@ function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -197,8 +207,8 @@ getSupplys();
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -165,24 +165,34 @@ function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -205,8 +215,8 @@ getSupplys();
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -182,24 +182,34 @@ function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -222,8 +232,8 @@ getSupplys();
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -182,24 +182,34 @@ function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -222,8 +232,8 @@ getSupplys();
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -3,7 +3,8 @@ import {reactive, ref} from "vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import axios from "axios";
import store from "../../store";
import {getVoiceCommandsLocationData,deleteVoiceCommandsLocation,addVoiceCommandsLocation,updateVoiceCommandsLocation} from "../../api/AIStation/VoiceCommandLocation";
import {getVoiceCommandsLocationData,deleteVoiceCommandsLocation,addVoiceCommandsLocation,updateVoiceCommandsLocation,getVoiceCommandsLocationDetail} from "../../api/AIStation/VoiceCommandLocation";
import { ElMessage } from 'element-plus';
// 查询条件
const queryParams = ref({
......@@ -14,10 +15,10 @@ const queryParams = ref({
//供热站详情数据
const singleDetails = ref({
stationName: '供热站1',//换热站名称
code: '1',//编号
ipAddress: '192.168.11.11',
macAddress: 'A2-B2-C2-D2-02-2C',
stationName: '',//换热站名称
code: '',//编号
ipAddress: '',
macAddress: '',
})
//新增或修改表单参数
......@@ -32,20 +33,12 @@ const addOrUpdateForm = ref({
//列表数据
const voiceCommandLocationData = ref([
{
businessId: '1',
stationId: 'e1289fbe-9d71-4426-a500-d3024a8c84c1',
code: '1111',
stationName: '换热站1',
macAddress: 'A1-B1-C1-D1-01-1C',
ipAddress: '192.168.11.1',
},
{
businessId: '2',
stationId: 'b6216c70-d0c0-465f-8019-594dfa954a7c',
code: '222',
stationName: '换热站2',
macAddress: 'A2-B2-C2-D2-02-2C',
ipAddress: '192.168.11.2',
businessId: '',
stationId: '',
code: '',
stationName: '',
macAddress: '',
ipAddress: '',
}
])
......@@ -55,7 +48,7 @@ const props = { multiple: true, emitPath: false }
//换热站列表
const options = ref([])
// 分页
const Page = reactive({total: 0, pageSize: 20, page: 1});
const Page = reactive({total: 0, rows: 20, page: 1});
// 详情弹窗
const detailOpen = ref(false)
//新增 修改弹窗
......@@ -69,7 +62,7 @@ function loadData(){
console.log('调用了LoadData')
const item = {
page: Page.page,
pageSize: Page.pageSize,
rows: Page.rows,
stationId: queryParams.value.stationId,
ipAddress: queryParams.value.ipAddress,
macAddress: queryParams.value.macAddress,
......@@ -78,22 +71,40 @@ function loadData(){
//查询数据
getVoiceCommandsLocationData(item).then(res => {
voiceCommandLocationData.value = res.rows
Page.rows = res.pageSize
Page.total = res.total
})
}
const handleFormData = async () => {
//在options.value中查找出value值等于addOrUpdateForm.value.stationId的label
const option = options.value.find(item => item.stationId === addOrUpdateForm.value.stationId);
console.log('option:',option)
const item = {
businessId: addOrUpdateForm.value.businessId,
stationId: addOrUpdateForm.value.stationId,
code: addOrUpdateForm.value.code,
ipAddress: addOrUpdateForm.value.ipAddress,
macAddress: addOrUpdateForm.value.macAddress,
stationName: option.stationName,
supplyId: option.supplyId,
unitId: option.unitId,
flag: '1',
delflag: '0'
}
if (addOrUpdateForm.value.businessId === ''){
console.log('走新增-----')
//新增 调新增的接口
addVoiceCommandsLocation(item).then(res => {
dialogFormVisible.value = false
if (res.code === 1){
//mac和ip重复 提示一个警告信息
ElMessage({
message: '当前mac和ip地址已重复,请重新输入',
type: 'warning'
});
}else{
dialogFormVisible.value = false
}
}).catch((err) => {
console.log('err:',err)
dialogFormVisible.value = false
......@@ -103,7 +114,15 @@ const handleFormData = async () => {
} else {
console.log('走修改---')
updateVoiceCommandsLocation(item).then(res => {
dialogFormVisible.value = false
if (res.code === 1){
//mac和ip重复 提示一个警告信息
ElMessage({
message: '当前mac和ip地址已重复,请重新输入',
type: 'warning'
});
} else{
dialogFormVisible.value = false
}
}).catch((err) => {
console.log('err:',err)
dialogFormVisible.value = false
......@@ -132,12 +151,14 @@ const tableBodyClass = data => { // 表体样式
// 分页大小改变时触发
const handleSizeChange = (val) => {
Page.pageSize = val;
Page.rows = val;
loadData()
};
// 当前页改变时触发
const handleCurrentChange = (val) => {
Page.page = val;
loadData()
};
//详情按钮触发
......@@ -162,9 +183,14 @@ function handleAddButton(row) {
//修改按钮触发
function handleUpdateButton(row) {
addOrUpdateForm.value = row
formTitle.value = '修改'
dialogFormVisible.value = true
getVoiceCommandsLocationDetail(row.businessId).then(res => {
addOrUpdateForm.value = res.data
formTitle.value = '修改'
dialogFormVisible.value = true
}).catch((err) => {
console.log('err:',err)
dialogFormVisible.value = false
})
}
//删除按钮
......@@ -230,21 +256,32 @@ function getSupplys(){
options.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -268,8 +305,8 @@ getSupplys()
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......@@ -312,7 +349,7 @@ getSupplys()
</template>
</el-table-column>
</el-table>
<el-pagination v-model:current-page="Page.page" v-model:page-size="Page.pageSize"
<el-pagination v-model:current-page="Page.page" v-model:page-size="Page.rows"
:page-sizes="[20, 30, 50, 100, 200, 300, 400]" :disabled="disabled"
layout="total, sizes, prev, pager, next, jumper" :total="Page.total"
@size-change="handleSizeChange" @current-change="handleCurrentChange" class="pagination"/>
......@@ -360,12 +397,12 @@ getSupplys()
<el-form-item label="换热站:">
<!-- <el-cascader :options="options" v-model="addOrUpdateForm.stationId" :props="props" collapse-tags clearable :show-all-levels="false"-->
<!-- placeholder="请选择" style="min-width: 210px;" />-->
<el-select v-model="addOrUpdateForm.stationId" placeholder="请选择">
<el-select v-model="addOrUpdateForm.stationId" placeholder="请选择" filterable clearable>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......
......@@ -9,57 +9,32 @@ import {getVoiceCommandsData,deleteVoiceCommands,addVoiceCommands,updateVoiceCom
const options = ref([]);
const enterpriseId = ref();
const props = { multiple: true, emitPath: false }
const stationId = ref();
const loading = ref(true);
// 分页
const Page = reactive({total: 0, pageSize: 20, page: 1});
const Page = reactive({page: 1, rows: 20, total: 0});
const VoiceCommandData = ref([
{
stationId: '1',
question: '播报天气预报',
answer: '今天天气晴朗',
updateDate: '2023-02-01 12:00:00',
macAddress: 'A1-B1-C1-D1-01-1C',
ipAddress: '192.168.11.1',
result: '0'
},
{
stationId: '2',
question: '说一下用电量',
answer: '当前站电表抄表据和近三日用量',
updateDate: '2024-12-11 12:00:00',
macAddress: 'A2-B2-C2-D2-02-2C',
ipAddress: '192.168.11.2',
result: '1'
stationName: '',
question: '',
answer: '',
updateDate: '',
macAddress: '',
ipAddress: '',
result: ''
}
])
// 详情弹窗
const detailOpen = ref(false)
const singleDetails = {
updateDate: '2023-02-11 12:00:00',
stationId: '1',
result: '1',
question: '说一下用电量',
answer: '当前站电表抄表据和近三日用量',
ipAddress: '192.168.11.2',
macAddress: 'A2-B2-C2-D2-02-2C',
updateDate: '',
stationId: '',
result: '',
question: '',
answer: '',
ipAddress: '',
macAddress: '',
}
// 供热站
const heatStationList = [
{
label: '行政区供热站',
value: 1
},
{
label: '东部供热站',
value: 2
},
{
label: '小王庄供热站',
value: 3
}
]
const queryParams = ref({
stationId: '',
......@@ -74,7 +49,7 @@ function loadData(){
console.log('调用了LoadData')
const item = {
page: Page.page,
pageSize: Page.pageSize,
rows: Page.rows,
stationId: queryParams.value.stationId,
startTime: queryParams.value.startTime,
endTime: queryParams.value.endTime,
......@@ -85,12 +60,31 @@ function loadData(){
//查询数据
getVoiceCommandsData(item).then(res => {
VoiceCommandData.value = res.rows
Page.rows = res.pageSize
Page.total = res.total
})
}
loadData()
const handleExport = () => {
console.log('导出:', queryParams.value);
const item = {
stationId: queryParams.value.stationId,
startTime: queryParams.value.startTime,
endTime: queryParams.value.endTime,
ipAddress: queryParams.value.ipAddress,
macAddress: queryParams.value.macAddress,
}
exportVoiceCommands(item).then(res => {
const blob = new Blob([res])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '语音指令信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
};
// 重置
......@@ -114,65 +108,39 @@ function getEnterprise(){
}
}
//获取换热机组列表
// function getSupplys(){
// loading.value = true;
// // tableData.length = 0;
// options.length = 0;
// stationId.length = 0;
// const result = store.getters.getEnterprise();
// if (result) {
// result.forEach(element=>{
// if(element.enterpriseId=== enterpriseId.value){
// if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
// element.serviceCenterList.forEach(center=>{
// let c = [];
// center.supplyList.forEach(supply => {
// let chi = [];
// supply.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// });
// c.push({ children: chi, label: supply.supplyName});
// });
// options.push({children: c, label: center.serviceCenterName});
// })
// }else{
// element.supplyList.forEach(element => {
// let chi = [];
// element.transferList.forEach(unit => {
// chi.push({ value: unit.unitId, label: unit.unitName });
// })
// options.push({ children: chi, label: element.supplyName});
// })
// }
// }
// });
// }
// // stationId.value.push(options[0].children[0].children[0].value);
// }
//获取换热机组列表
function getSupplys(){
loading.value = true;
// tableData.length = 0;
options.length = 0;
stationId.length = 0;
const result = store.getters.getEnterprise();
if (result) {
console.log('result:',result)
result.forEach(element=>{
let allItems = []
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{//遍历一级目录下的
center.supplyList.forEach(supply => {//拿到一级目录下的然后遍历它二级目录下的
supply.transferList.forEach(unit => {//拿到
allItems.push({ value: unit.unitId, label: unit.unitName })
console.log('supply:',supply)
supply.stationList.forEach(station => {//拿到
let unitIdList = []
supply.transferList.forEach(unit => {
//unit的stationId等于station的stationId的话,就把这个unit的unitId添加到unitIdList中
if(unit.stationId === station.stationId){
unitIdList.push(unit.unitId)
}
})
//将unitIdList集合按逗号分隔成字符串
let unitId = unitIdList.join(',')
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId,unitId: unitId})
});
});
})
}else{
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
allItems.push({ value: unit.unitId, label: unit.unitName })
element.stationList.forEach(station => {
allItems.push({ stationId: station.stationId, stationName: station.stationName,supplyId: station.supplyId})
})
})
}
......@@ -192,12 +160,14 @@ const tableBodyClass = data => { // 表体样式
}
// 分页大小改变时触发
const handleSizeChange = (val) => {
Page.pageSize = val;
Page.rows = val;
loadData()
};
// 当前页改变时触发
const handleCurrentChange = (val) => {
Page.page = val;
loadData()
};
function handleDetail(row) {
......@@ -219,8 +189,8 @@ function handleDetail(row) {
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:label="item.stationName"
:value="item.stationId">
</el-option>
</el-select>
</el-form-item>
......@@ -255,7 +225,7 @@ function handleDetail(row) {
<el-form-item>
<el-button type="primary" @click="loadData()" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn">重置</el-button>
<el-button type="primary" @click="handleExport" class="add-search-btn">导出</el-button>
<el-button type="primary" @click="handleExport()" class="add-search-btn">导出</el-button>
</el-form-item>
</el-form>
</div>
......@@ -269,7 +239,7 @@ function handleDetail(row) {
:row-class-name="tableBodyClass"
>
<el-table-column type="index" label="序号" align="center" width="100"/>
<el-table-column prop="stationId" align="center" label="换热站" sortable/>
<el-table-column prop="stationName" align="center" label="换热站" sortable/>
<el-table-column prop="updateDate" align="center" width="180" label="触发时间" sortable/>
<el-table-column prop="question" align="center" label="提问"/>
<el-table-column prop="answer" align="center" label="回答"/>
......@@ -291,7 +261,7 @@ function handleDetail(row) {
</template>
</el-table-column>
</el-table>
<el-pagination v-model:current-page="Page.page" v-model:page-size="Page.pageSize"
<el-pagination v-model:current-page="Page.page" v-model:page-size="Page.rows"
:page-sizes="[20, 30, 50, 100, 200, 300, 400]" :small="small" :disabled="disabled"
:background="background" layout="total, sizes, prev, pager, next, jumper" :total="Page.total"
@size-change="handleSizeChange" @current-change="handleCurrentChange" class="pagination"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment