修改测试bug
This commit is contained in:
@@ -41,7 +41,7 @@ export function deviceRtData(data: any) {
|
|||||||
form.append('pageNum', data.pageNum)
|
form.append('pageNum', data.pageNum)
|
||||||
form.append('pageSize', data.pageSize)
|
form.append('pageSize', data.pageSize)
|
||||||
form.append('searchValue', data.searchValue)
|
form.append('searchValue', data.searchValue)
|
||||||
form.append('dataLevel',data.dataLevel)
|
form.append('dataLevel', data.dataLevel)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/cs-device-boot/csGroup/deviceRtData',
|
url: '/cs-device-boot/csGroup/deviceRtData',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -60,7 +60,7 @@ export function realTimeData(data: any) {
|
|||||||
form.append('pageSize', data.pageSize)
|
form.append('pageSize', data.pageSize)
|
||||||
form.append('searchValue', data.searchValue)
|
form.append('searchValue', data.searchValue)
|
||||||
form.append('targetType', data.targetType)
|
form.append('targetType', data.targetType)
|
||||||
form.append('dataLevel',data.dataLevel)
|
form.append('dataLevel', data.dataLevel)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/cs-harmonic-boot/data/realTimeData',
|
url: '/cs-harmonic-boot/data/realTimeData',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -68,4 +68,19 @@ export function realTimeData(data: any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 设备监控-》测试项数据
|
||||||
|
export function getTestData(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-harmonic-boot/data/getTestData',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 设备监控-删除装置测试项
|
||||||
|
export function deleteItem(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-device-boot/wlRecord/deleteItem',
|
||||||
|
method: 'POST',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -73,10 +73,11 @@ export const governDeviceRegister = (data: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 便携式设备注册
|
// 便携式设备注册
|
||||||
export const portableDeviceRegister = (data: any) => {
|
export const portableDeviceRegister = (params: any) => {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: `/access-boot/device/wlRegister?nDid=${data.nDid}`,
|
url: `/access-boot/device/wlRegister`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
<Icon class="ba-icon-dark" v-if="field.render == 'icon'" :name="fieldValue ? fieldValue : field.default ?? ''" />
|
<Icon class="ba-icon-dark" v-if="field.render == 'icon'" :name="fieldValue ? fieldValue : field.default ?? ''" />
|
||||||
|
|
||||||
<!-- switch -->
|
<!-- switch -->
|
||||||
<el-switch v-if="field.render == 'switch'" @change="onChangeField" :model-value="fieldValue.toString()"
|
<el-switch v-if="field.render == 'switch'" @change="onChangeField(field, $event)"
|
||||||
:loading="row.loading" active-value="1" inactive-value="0" />
|
:model-value="fieldValue.toString()" :loading="row.loading" inline-prompt :active-value="field.activeValue" :active-text="field.activeText"
|
||||||
|
:inactive-value="field.inactiveValue" :inactive-text="field.inactiveText" />
|
||||||
|
|
||||||
<!-- image -->
|
<!-- image -->
|
||||||
<div v-if="field.render == 'image' && fieldValue" class="ba-render-image">
|
<div v-if="field.render == 'image' && fieldValue" class="ba-render-image">
|
||||||
@@ -124,8 +125,10 @@ if (props.field.renderFormatter && typeof props.field.renderFormatter == 'functi
|
|||||||
fieldValue.value = props.field.renderFormatter(props.row, props.field, fieldValue.value, props.column, props.index)
|
fieldValue.value = props.field.renderFormatter(props.row, props.field, fieldValue.value, props.column, props.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onChangeField = (value: any) => {
|
const onChangeField = (row: any, value: any) => {
|
||||||
TableStore.onTableAction('field-change', { value: value, ...props })
|
row.onChangeField && row.onChangeField(props.row, value)
|
||||||
|
|
||||||
|
// TableStore.onTableAction('field-change', { value: value, ...props })
|
||||||
}
|
}
|
||||||
|
|
||||||
const onButtonClick = (btn: OptButton) => {
|
const onButtonClick = (btn: OptButton) => {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import type { AxiosRequestConfig, Method } from 'axios'
|
import type { AxiosRequestConfig, Method } from 'axios'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ElLoading,ElMessage, ElNotification, type LoadingOptions } from 'element-plus'
|
import { ElLoading, ElMessage, ElNotification, type LoadingOptions } from 'element-plus'
|
||||||
import { refreshToken } from '@/api/user-boot/user'
|
import { refreshToken } from '@/api/user-boot/user'
|
||||||
import router from '@/router/index'
|
import router from '@/router/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import { set } from 'lodash'
|
||||||
|
|
||||||
window.requests = []
|
window.requests = []
|
||||||
window.tokenRefreshing = false
|
window.tokenRefreshing = false
|
||||||
@@ -150,11 +151,13 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
return Promise.reject(response.data)
|
return Promise.reject(response.data)
|
||||||
} else {
|
} else {
|
||||||
if (options.showCodeMessage) {
|
if (options.showCodeMessage) {
|
||||||
// ElNotification({
|
if (response.config.url == '/access-boot/device/wlRegister') {
|
||||||
// type: 'error',
|
setTimeout(() => {
|
||||||
// message: response.data.message || '未知错误'
|
|
||||||
// })
|
|
||||||
ElMessage.error(response.data.message || '未知错误')
|
ElMessage.error(response.data.message || '未知错误')
|
||||||
|
}, 6000)
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.data.message || '未知错误')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Promise.reject(response.data)
|
return Promise.reject(response.data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,27 +79,34 @@
|
|||||||
realTimeFlag
|
realTimeFlag
|
||||||
">
|
">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="日期" v-show="dataSet.indexOf('_history') != -1">
|
<el-form-item label="日期"
|
||||||
|
v-show="dataSet.includes('_items') || dataSet.indexOf('_history') != -1">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据类型" v-if="dataSet.indexOf('_history') == -1">
|
<el-form-item label="数据类型" v-if="!dataSet.includes('_')">
|
||||||
|
<el-select v-model="formInline.targetType" @change="handleTargetTypeChange">
|
||||||
<el-select v-model="formInline.targetType">
|
|
||||||
<el-option v-for="item in queryList" :key="item.id" :label="item.name"
|
<el-option v-for="item in queryList" :key="item.id" :label="item.name"
|
||||||
:value="item.id" />
|
:value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="指标" v-show="!realTimeFlag">
|
|
||||||
<el-input style="width: 160px" v-model="formInline.searchValue" autocomplete="off" clearable
|
<el-form-item label="值类型" v-if="!dataSet.includes('_items')">
|
||||||
placeholder="请输入关键词"></el-input>
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item label="值类型">
|
|
||||||
<el-select style="min-width: 120px !important" v-model="formInline.dataLevel"
|
<el-select style="min-width: 120px !important" v-model="formInline.dataLevel"
|
||||||
:disabled="dataLevel == 'Primary' && deviceType == '0'">
|
:disabled="dataLevel == 'Primary' && deviceType == '0'">
|
||||||
<el-option value="Primary" label="一次值"></el-option>
|
<el-option value="Primary" label="一次值"></el-option>
|
||||||
<el-option value="Secondary" label="二次值"></el-option>
|
<el-option value="Secondary" label="二次值"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="筛选" v-if="!dataSet.includes('_')">
|
||||||
|
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable
|
||||||
|
placeholder="请输入关键词"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="偶数/奇数" v-if="oddAndEvenFlag && !dataSet.includes('_')">
|
||||||
|
<el-select v-model="oddAndEven" style="min-width: 120px !important">
|
||||||
|
<el-option v-for="item in oddAndEvenList" :key="item.value" :label="item.label"
|
||||||
|
:value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type="primary" icon="el-icon-Search" @click="handleClick">查询</el-button>
|
<el-button type="primary" icon="el-icon-Search" @click="handleClick">查询</el-button>
|
||||||
@@ -138,7 +145,7 @@
|
|||||||
"
|
"
|
||||||
></div> -->
|
></div> -->
|
||||||
<!-- v-loading="tableLoading" -->
|
<!-- v-loading="tableLoading" -->
|
||||||
|
<div :style="{ height: tableHeight }" v-loading="tableLoading" v-if="!dataSet.includes('_')">
|
||||||
<div style="overflow: auto" :style="{ height: tableHeight }" v-loading="tableLoading" v-if="
|
<div style="overflow: auto" :style="{ height: tableHeight }" v-loading="tableLoading" v-if="
|
||||||
dataSet.indexOf('_trenddata') == -1 &&
|
dataSet.indexOf('_trenddata') == -1 &&
|
||||||
dataSet.indexOf('_realtimedata') == -1 &&
|
dataSet.indexOf('_realtimedata') == -1 &&
|
||||||
@@ -284,6 +291,7 @@
|
|||||||
<el-empty description="暂无数据" v-if="tableData.length === 0"></el-empty>
|
<el-empty description="暂无数据" v-if="tableData.length === 0"></el-empty>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<!-- <el-pagination v-if="
|
<!-- <el-pagination v-if="
|
||||||
tableData.length &&
|
tableData.length &&
|
||||||
dataSet.indexOf('_trenddata') == -1 &&
|
dataSet.indexOf('_trenddata') == -1 &&
|
||||||
@@ -296,7 +304,7 @@
|
|||||||
|
|
||||||
<!-- 趋势数据 -->
|
<!-- 趋势数据 -->
|
||||||
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_trenddata') != -1">
|
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_trenddata') != -1">
|
||||||
<Trend ref="trendRef"></Trend>
|
<Trend ref="trendRef" :TrendList="TrendList"></Trend>
|
||||||
</div>
|
</div>
|
||||||
<!-- 实时数据 -->
|
<!-- 实时数据 -->
|
||||||
<div :style="`height: calc(100vh - (${sonTab == 1 ? '378px' : sonTab == 2 ? '340px' : '425px'}))`"
|
<div :style="`height: calc(100vh - (${sonTab == 1 ? '378px' : sonTab == 2 ? '340px' : '425px'}))`"
|
||||||
@@ -328,9 +336,9 @@
|
|||||||
<Event ref="eventRef"></Event>
|
<Event ref="eventRef"></Event>
|
||||||
</div>
|
</div>
|
||||||
<!-- 测试项记录 -->
|
<!-- 测试项记录 -->
|
||||||
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_items') != -1"
|
<div style="height: calc(100vh - 395px)" v-if="dataSet.indexOf('_items') != -1"
|
||||||
v-loading="tableLoading">
|
v-loading="tableLoading">
|
||||||
<!-- <Event ref="eventRef"></Event> -->
|
<testItemRecords ref="testItemRecordsRef" @onSubmit="handleClick" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!tableData" style="height: 42px"></div>
|
<div v-if="!tableData" style="height: 42px"></div>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -356,7 +364,7 @@ import {
|
|||||||
queryDictType,
|
queryDictType,
|
||||||
|
|
||||||
} from '@/api/cs-device-boot/EquipmentDelivery'
|
} from '@/api/cs-device-boot/EquipmentDelivery'
|
||||||
import { deviceHisData, deviceRtData, realTimeData } from '@/api/cs-device-boot/csGroup'
|
import { deviceHisData, deviceRtData, realTimeData, getTestData } from '@/api/cs-device-boot/csGroup'
|
||||||
import { ref, reactive, onMounted, onUnmounted, inject, nextTick, onBeforeUnmount } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted, inject, nextTick, onBeforeUnmount } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
@@ -368,6 +376,7 @@ import recordWoves from './tabs/components/recordwoves.vue' //实时数据-实
|
|||||||
import offLineDataImport from './offLineDataImport/index.vue'
|
import offLineDataImport from './offLineDataImport/index.vue'
|
||||||
import Event from './tabs/event.vue'
|
import Event from './tabs/event.vue'
|
||||||
import nearRealTimeData from './nearRealTimeData.vue'
|
import nearRealTimeData from './nearRealTimeData.vue'
|
||||||
|
import testItemRecords from './testItemRecords.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
@@ -384,14 +393,18 @@ const tableLoading = ref(false)
|
|||||||
const getGroupLoading = ref(false)
|
const getGroupLoading = ref(false)
|
||||||
const deviceData = ref<any>(null)
|
const deviceData = ref<any>(null)
|
||||||
const dataSet = ref('')
|
const dataSet = ref('')
|
||||||
|
const testItemRecordsRef = ref()
|
||||||
const nearRealTimeDataRef = ref()
|
const nearRealTimeDataRef = ref()
|
||||||
const devTypeOptions = ref([])
|
const devTypeOptions = ref([])
|
||||||
const devModelOptions = ref([])
|
const devModelOptions = ref([])
|
||||||
const tableData = ref<any[]>([])
|
const tableData = ref<any[]>([])
|
||||||
const tableHeight = mainHeight(290).height
|
const tableHeight = mainHeight(290).height
|
||||||
const tableHeightBox = mainHeight(310).height
|
const tableHeightBox = mainHeight(310).height
|
||||||
const mangePopup = ref()
|
const searchValue = ref('')
|
||||||
const datePickerRef = ref()
|
const TrendList=ref({})
|
||||||
|
const oddAndEven = ref('1')
|
||||||
|
const datePickerRef = ref('1')
|
||||||
|
const oddAndEvenFlag = ref(false)
|
||||||
const formInline = reactive({
|
const formInline = reactive({
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -404,7 +417,21 @@ const formInline = reactive({
|
|||||||
targetType: '',
|
targetType: '',
|
||||||
dataLevel: 'Secondary'
|
dataLevel: 'Secondary'
|
||||||
})
|
})
|
||||||
|
const oddAndEvenList = [
|
||||||
|
{
|
||||||
|
value: '1',
|
||||||
|
label: '奇次',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '偶次',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '全部',
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
const detail = ref<any>(null)
|
const detail = ref<any>(null)
|
||||||
//是否显示实时数据默认内容
|
//是否显示实时数据默认内容
|
||||||
const realTimeFlag = ref(true)
|
const realTimeFlag = ref(true)
|
||||||
@@ -567,20 +594,24 @@ const deviceId: any = ref('')
|
|||||||
const lineId: any = ref('')
|
const lineId: any = ref('')
|
||||||
const dataLevel: any = ref('')
|
const dataLevel: any = ref('')
|
||||||
const nodeClick = async (e: anyObj) => {
|
const nodeClick = async (e: anyObj) => {
|
||||||
|
searchValue.value = ''
|
||||||
await queryDictType({
|
await queryDictType({
|
||||||
lineId: e?.id
|
lineId: e?.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
oddAndEvenFlag.value = false
|
||||||
queryList.value = res.data
|
queryList.value = res.data
|
||||||
formInline.targetType = res.data[0].id
|
formInline.targetType = res.data[0].id
|
||||||
})
|
})
|
||||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
|
||||||
if (e.level == 2) return
|
if (e.level == 2) return
|
||||||
deviceId.value = e?.pid
|
deviceId.value = e?.pid
|
||||||
lineId.value = e?.id
|
lineId.value = e?.id
|
||||||
|
TrendList.value=e
|
||||||
if (!e) {
|
if (!e) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//选中设备名称后,点击标签页也能查询数据,要求点击设备名称后,点击标签页默认查询第一个监测点数据
|
//选中设备名称后,点击标签页也能查询数据,要求点击设备名称后,点击标签页默认查询第一个监测点数据
|
||||||
if (e.level == 3 || e.level == 2) {
|
if (e.level == 3 || e.level == 2) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -948,15 +979,16 @@ const handleClick = async (tab?: any) => {
|
|||||||
}
|
}
|
||||||
//测试项记录
|
//测试项记录
|
||||||
if (dataSet.value.includes('_items')) {
|
if (dataSet.value.includes('_items')) {
|
||||||
|
formInline.startTime = datePickerRef.value && datePickerRef.value.timeValue[0]
|
||||||
|
formInline.endTime = datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||||
formInline.id = dataSet.value
|
formInline.id = dataSet.value
|
||||||
// await deviceRtData(formInline)
|
await getTestData(formInline)
|
||||||
await realTimeData(formInline)
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
tableData.value = res.data
|
tableData.value = res.data
|
||||||
formInline.total = res.data.total
|
formInline.total = res.data.total
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
setTimeout(() => { //targetType
|
setTimeout(() => { //targetType
|
||||||
nearRealTimeDataRef.value?.setData(res.data, queryList.value.filter((item: any) => item.id == formInline.targetType))
|
testItemRecordsRef.value?.setData(res.data,)
|
||||||
}, 500)
|
}, 500)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
@@ -979,12 +1011,41 @@ const handleClick = async (tab?: any) => {
|
|||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
tableData.value = res.data
|
tableData.value = res.data
|
||||||
formInline.total = res.data.total
|
formInline.total = res.data.total
|
||||||
tableLoading.value = false
|
let queryListName = queryList.value.filter((item: any) => item.id == formInline.targetType)
|
||||||
|
let list = res.data.filter((item: any) => {
|
||||||
|
if (item.otherName.includes(searchValue.value)) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (oddAndEvenFlag.value) {
|
||||||
|
list = list.filter((item: any) => {
|
||||||
|
let str = item.otherName.split("次")[0]
|
||||||
|
queryListName[0].name == '间谐波电压含有率' ? str = str - 0.5 : ''
|
||||||
|
|
||||||
|
if (oddAndEven.value == '1') {
|
||||||
|
// 奇次
|
||||||
|
if (str % 2 != 0) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (oddAndEven.value == '2') {
|
||||||
|
// 偶次
|
||||||
|
if (str % 2 == 0) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => { //targetType
|
setTimeout(() => { //targetType
|
||||||
nearRealTimeDataRef.value?.setData(res.data, queryList.value.filter((item: any) => item.id == formInline.targetType))
|
nearRealTimeDataRef.value?.setData(list, queryListName)
|
||||||
|
tableLoading.value = false
|
||||||
}, 500)
|
}, 500)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}, 1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
@@ -1045,6 +1106,14 @@ queryByCode('Device_Type').then(res => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
const handleTargetTypeChange = () => {
|
||||||
|
|
||||||
|
if (queryList.value.filter((item: any) => item.id == formInline.targetType)[0].name != '基本数据') {
|
||||||
|
oddAndEvenFlag.value = true
|
||||||
|
} else {
|
||||||
|
oddAndEvenFlag.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
const queryList: any = ref([])
|
const queryList: any = ref([])
|
||||||
|
|
||||||
const echoName = (value: any, arr: any[]) => {
|
const echoName = (value: any, arr: any[]) => {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ const setData = (data: any, targetType: any) => {
|
|||||||
|
|
||||||
dataList.value = JSON.parse(JSON.stringify(data))
|
dataList.value = JSON.parse(JSON.stringify(data))
|
||||||
|
|
||||||
console.log("🚀 ~ setData ~ targetType:", targetType[0].code)
|
|
||||||
if (targetType[0].code == 'base_data' || targetType[0].code == '1') {
|
if (targetType[0].name == '基本数据' ) {
|
||||||
column.value = [
|
column.value = [
|
||||||
{ field: 'otherName', title: '名称', },
|
{ field: 'otherName', title: '名称', },
|
||||||
{ field: 'valueA', title: 'A相', },
|
{ field: 'valueA', title: 'A相', },
|
||||||
@@ -31,26 +31,6 @@ const setData = (data: any, targetType: any) => {
|
|||||||
{ field: 'valueC', title: 'C相', },
|
{ field: 'valueC', title: 'C相', },
|
||||||
{ field: 'valueM', title: '', },
|
{ field: 'valueM', title: '', },
|
||||||
]
|
]
|
||||||
} else if (targetType[0].code == 'other_data') {
|
|
||||||
let list: any = []
|
|
||||||
data.forEach((item: any, i: any) => {
|
|
||||||
if (i % 2 == 0) {
|
|
||||||
list.push(item)
|
|
||||||
} else {
|
|
||||||
list[list.length - 1].otherName1 = item.otherName
|
|
||||||
list[list.length - 1].valueM1 = item.valueM
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
dataList.value = JSON.parse(JSON.stringify(list))
|
|
||||||
|
|
||||||
column.value = [
|
|
||||||
{ field: 'otherName', title: '名称', },
|
|
||||||
{ field: 'valueM', title: '', },
|
|
||||||
{ field: 'otherName1', title: '名称', },
|
|
||||||
{ field: 'valueM1', title: '', },
|
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
column.value = [
|
column.value = [
|
||||||
{ field: 'otherName', title: '谐波次数', },
|
{ field: 'otherName', title: '谐波次数', },
|
||||||
@@ -62,7 +42,7 @@ const setData = (data: any, targetType: any) => {
|
|||||||
key.value += 1
|
key.value += 1
|
||||||
}
|
}
|
||||||
const formatter = (row: any) => {
|
const formatter = (row: any) => {
|
||||||
return row.cellValue || '/'
|
return row.cellValue==null? '/':row.cellValue
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ setData })
|
defineExpose({ setData })
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<!-- 实时数据 - 谐波频谱页面 -->
|
<!-- 实时数据 - 谐波频谱页面 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="realtrend" v-loading="loading">
|
<div class="realtrend" v-loading="loading">
|
||||||
<el-select v-model="selectValue" v-if="!loading" style="width: 100px" class="select">
|
<div class="select">
|
||||||
|
<div class="mr10">偶数/奇数 </div>
|
||||||
|
<el-select v-model="selectValue" v-if="!loading" style="width: 100px" >
|
||||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</div>
|
||||||
<el-tabs type="border-card" v-if="tabsList.length != 0" v-model="activeName" @tab-click="handleClick">
|
<el-tabs type="border-card" v-if="tabsList.length != 0" v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane v-for="(item, index) in tabsList" :label="item.groupName" :name="index" :key="index">
|
<el-tab-pane v-for="(item, index) in tabsList" :label="item.groupName" :name="index" :key="index">
|
||||||
<div>
|
<div>
|
||||||
@@ -311,6 +314,9 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
|
|||||||
.select {
|
.select {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -40px;
|
top: -40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.realtrend_top {
|
.realtrend_top {
|
||||||
|
|||||||
@@ -20,6 +20,14 @@
|
|||||||
<el-option value="Secondary" label="二次值"></el-option>
|
<el-option value="Secondary" label="二次值"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="数据类型">
|
||||||
|
<el-select style="min-width: 120px !important" placeholder="请选择" v-model="searchForm.valueType" clearable>
|
||||||
|
<el-option value="max" label="最大值"></el-option>
|
||||||
|
<el-option value="min" label="最小值"></el-option>
|
||||||
|
<el-option value="avg" label="平均值"></el-option>
|
||||||
|
<el-option value="cp95" label="cp95"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item class="history_count" v-for="(item, index) in countData" :key="index"
|
<el-form-item class="history_count" v-for="(item, index) in countData" :key="index"
|
||||||
:label="item.name.includes('次数') ? item.name : item.name + '谐波次数'"
|
:label="item.name.includes('次数') ? item.name : item.name + '谐波次数'"
|
||||||
@@ -57,6 +65,13 @@ const dictData = useDictData()
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/device/control'
|
name: 'govern/device/control'
|
||||||
})
|
})
|
||||||
|
const props = defineProps({
|
||||||
|
TrendList: {
|
||||||
|
type: Array,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log("🚀 ~ props:", props.TrendList)
|
||||||
|
|
||||||
//电压等级
|
//电压等级
|
||||||
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
//接线方式
|
//接线方式
|
||||||
@@ -92,7 +107,8 @@ searchForm.value = {
|
|||||||
count: '',
|
count: '',
|
||||||
searchBeginTime: '',
|
searchBeginTime: '',
|
||||||
searchEndTime: '',
|
searchEndTime: '',
|
||||||
dataLevel: 'Primary'
|
dataLevel: 'Primary',
|
||||||
|
valueType:''
|
||||||
}
|
}
|
||||||
//统计指标
|
//统计指标
|
||||||
const indexOptions: any = ref([])
|
const indexOptions: any = ref([])
|
||||||
@@ -101,7 +117,7 @@ const countOptions: any = ref([])
|
|||||||
// Harmonic_Type
|
// Harmonic_Type
|
||||||
// portable-harmonic
|
// portable-harmonic
|
||||||
const legendDictList: any = ref([])
|
const legendDictList: any = ref([])
|
||||||
queryByCode('portable-harmonic').then(res => {
|
queryByCode(props?.TrendList?.lineType == 0 ? 'apf-harmonic' : 'portable-harmonic').then(res => {
|
||||||
queryCsDictTree(res.data.id).then(item => {
|
queryCsDictTree(res.data.id).then(item => {
|
||||||
//排序
|
//排序
|
||||||
indexOptions.value = item.data.sort((a: any, b: any) => {
|
indexOptions.value = item.data.sort((a: any, b: any) => {
|
||||||
@@ -180,6 +196,7 @@ const init = async () => {
|
|||||||
list: lists,
|
list: lists,
|
||||||
valueType: searchForm.value.type,
|
valueType: searchForm.value.type,
|
||||||
dataLevel: searchForm.value.dataLevel,
|
dataLevel: searchForm.value.dataLevel,
|
||||||
|
valueType: searchForm.value.valueType,
|
||||||
startTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
startTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||||
endTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
endTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||||
}
|
}
|
||||||
|
|||||||
95
src/views/govern/device/control/testItemRecords.vue
Normal file
95
src/views/govern/device/control/testItemRecords.vue
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div :style="{ height: height }">
|
||||||
|
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
|
||||||
|
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
|
||||||
|
:min-width="item.width"></vxe-column>
|
||||||
|
<vxe-column title="操作" fixed="right" width="100">
|
||||||
|
<template v-slot:default="scoped">
|
||||||
|
<el-button link type="danger" @click="remove(scoped.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script setup lang='ts'>
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
|
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const voltageLevelList: any = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
|
import { deleteItem } from '@/api/cs-device-boot/csGroup'
|
||||||
|
const volConTypeList = dictData.getBasicData('Dev_Connect')
|
||||||
|
const emit = defineEmits(['onSubmit'])
|
||||||
|
const height = mainHeight(325).height
|
||||||
|
const dataList = ref([])
|
||||||
|
const key: any = ref(0)
|
||||||
|
const column: any = ref([
|
||||||
|
{ field: 'itemName', title: '名称', width: '100px' },
|
||||||
|
{ field: 'voltageLevel', title: '电压等级', width: '100px' },
|
||||||
|
{ field: 'volConType', title: ' 电压接线方式', width: '100px' },
|
||||||
|
{ field: 'capacitySi', title: '用户协议容量', width: '100px' },
|
||||||
|
{ field: 'capacitySscb', title: '基准短路容量', width: '100px' },
|
||||||
|
{ field: 'capacitySscmin', title: '最小短路容量', width: '100px' },
|
||||||
|
{ field: 'capacitySt', title: '供电设备容量', width: '100px' },
|
||||||
|
{ field: 'location', title: ' 测试位置', width: '100px' },
|
||||||
|
{ field: 'startTime', title: '数据起始时间', width: '140px' },
|
||||||
|
{ field: 'endTime', title: '数据结束时间', width: '140px' },
|
||||||
|
{ field: 'statisticalInterval', title: '统计间隔', width: '100px' },
|
||||||
|
{ field: 'ct', title: 'CT', width: '70px' },
|
||||||
|
{ field: 'pt', title: 'PT', width: '70px' },
|
||||||
|
|
||||||
|
])
|
||||||
|
const setData = (data: any) => {
|
||||||
|
dataList.value = JSON.parse(JSON.stringify(data))
|
||||||
|
key.value += 1
|
||||||
|
}
|
||||||
|
const formatter = (row: any) => {
|
||||||
|
if (row.column.field == 'voltageLevel') {
|
||||||
|
return row.cellValue == null ? '/' : voltageLevelList.filter((item: any) => item.id == row.cellValue)[0]?.name
|
||||||
|
} else if (row.column.field == 'volConType') {
|
||||||
|
return row.cellValue == null ? '/' : volConTypeList.filter((item: any) => item.id == row.cellValue)[0]?.name
|
||||||
|
} else {
|
||||||
|
return row.cellValue == null ? '/' : row.cellValue
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 删除
|
||||||
|
const remove = (row: any) => {
|
||||||
|
ElMessageBox.prompt('二次校验密码确认', '', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
customClass: 'customInput',
|
||||||
|
inputType: 'text'
|
||||||
|
}).then(({ value }) => {
|
||||||
|
passwordConfirm(value).then(res => {
|
||||||
|
console.log('密码正确');
|
||||||
|
|
||||||
|
deleteItem({ id: row.id }).then(() => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
emit('onSubmit')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ setData })
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.customInput {
|
||||||
|
.el-input__inner {
|
||||||
|
-webkit-text-security: disc !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,33 +4,16 @@
|
|||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="设备类型">
|
<el-form-item label="设备类型">
|
||||||
<!-- <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入设备类型" /> -->
|
<!-- <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入设备类型" /> -->
|
||||||
<el-select
|
<el-select v-model="tableStore.table.params.devType" clearable @change="devTypeChange"
|
||||||
v-model="tableStore.table.params.devType"
|
placeholder="请选择设备类型">
|
||||||
clearable
|
<el-option v-for="item in devTypeOptions" :key="item.value" :label="item.label"
|
||||||
@change="devTypeChange"
|
:value="item.value" />
|
||||||
placeholder="请选择设备类型"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in devTypeOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备型号">
|
<el-form-item label="设备型号">
|
||||||
<el-select
|
<el-select v-model="tableStore.table.params.devModel" filterable clearable placeholder="请选择设备型号">
|
||||||
v-model="tableStore.table.params.devModel"
|
<el-option v-for="item in devModelOptionsFilter" :key="item.value" :label="item.label"
|
||||||
filterable
|
:value="item.value" />
|
||||||
clearable
|
|
||||||
placeholder="请选择设备型号"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in devModelOptionsFilter"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通讯协议">
|
<el-form-item label="通讯协议">
|
||||||
@@ -51,15 +34,8 @@
|
|||||||
<el-button type="primary" @click="downLoadFile" class="ml10" icon="el-icon-Download">
|
<el-button type="primary" @click="downLoadFile" class="ml10" icon="el-icon-Download">
|
||||||
模版下载
|
模版下载
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-upload
|
<el-upload style="display: inline-block" action="" accept=".xlsx" class="upload-demo"
|
||||||
style="display: inline-block"
|
:show-file-list="false" :auto-upload="false" :on-change="bulkImport">
|
||||||
action=""
|
|
||||||
accept=".xlsx"
|
|
||||||
class="upload-demo"
|
|
||||||
:show-file-list="false"
|
|
||||||
:auto-upload="false"
|
|
||||||
:on-change="bulkImport"
|
|
||||||
>
|
|
||||||
<el-button type="primary" class="ml10" icon="el-icon-Tickets">批量导入</el-button>
|
<el-button type="primary" class="ml10" icon="el-icon-Tickets">批量导入</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增设备</el-button>
|
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增设备</el-button>
|
||||||
@@ -67,44 +43,25 @@
|
|||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef"></Table>
|
<Table ref="tableRef"></Table>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog :title="dialogTitle" v-model="dialogFormVisible" :close-on-click-modal="false"
|
||||||
:title="dialogTitle"
|
:before-close="resetForm" draggable width="800px">
|
||||||
v-model="dialogFormVisible"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:before-close="resetForm"
|
|
||||||
draggable
|
|
||||||
width="800px"
|
|
||||||
>
|
|
||||||
<el-form :model="form" label-width="auto" :rules="rules" ref="ruleFormRef" class="form-two">
|
<el-form :model="form" label-width="auto" :rules="rules" ref="ruleFormRef" class="form-two">
|
||||||
<el-form-item label="设备名称:" prop="name">
|
<el-form-item label="设备名称:" prop="name">
|
||||||
<el-input
|
<el-input v-model="form.name" autocomplete="off" clearable placeholder="请输入(项目名称+设备名称)"></el-input>
|
||||||
v-model="form.name"
|
|
||||||
autocomplete="off"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入(项目名称+设备名称)"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="网络设备ID:" prop="ndid" class="top">
|
<el-form-item label="网络设备ID:" prop="ndid" class="top">
|
||||||
<el-input v-model="form.ndid" autocomplete="off" placeholder="请输入"></el-input>
|
<el-input v-model="form.ndid" autocomplete="off" placeholder="请输入"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类型:" prop="devType" class="top">
|
<el-form-item label="设备类型:" prop="devType" class="top">
|
||||||
<el-select v-model="form.devType" placeholder="请选择" @change="formDevTypeChange" clearable>
|
<el-select v-model="form.devType" placeholder="请选择" @change="formDevTypeChange" clearable>
|
||||||
<el-option
|
<el-option v-for="item in devTypeOptions" :key="item.value" :label="item.label"
|
||||||
v-for="item in devTypeOptions"
|
:value="item.value"></el-option>
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备型号:" prop="devModel" class="top">
|
<el-form-item label="设备型号:" prop="devModel" class="top">
|
||||||
<el-select v-model="form.devModel" filterable placeholder="请选择" clearable>
|
<el-select v-model="form.devModel" filterable placeholder="请选择" clearable>
|
||||||
<el-option
|
<el-option v-for="item in formDevModelOptionsFilter" :key="item.value" :label="item.label"
|
||||||
v-for="item in formDevModelOptionsFilter"
|
:value="item.value"></el-option>
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通讯协议:" prop="devAccessMethod" class="top">
|
<el-form-item label="通讯协议:" prop="devAccessMethod" class="top">
|
||||||
@@ -137,6 +94,7 @@ import Table from '@/components/table/index.vue'
|
|||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||||
import {
|
import {
|
||||||
addEquipmentDelivery,
|
addEquipmentDelivery,
|
||||||
deleteEquipmentDelivery,
|
deleteEquipmentDelivery,
|
||||||
@@ -254,6 +212,35 @@ const tableStore = new TableStore({
|
|||||||
},
|
},
|
||||||
{ title: '录入时间', field: 'createTime' },
|
{ title: '录入时间', field: 'createTime' },
|
||||||
{ title: '网络设备ID', field: 'ndid' },
|
{ title: '网络设备ID', field: 'ndid' },
|
||||||
|
{
|
||||||
|
title: '使用状态',
|
||||||
|
render: 'switch',
|
||||||
|
width: 100,
|
||||||
|
field: 'usageStatus',
|
||||||
|
activeText: '启用',
|
||||||
|
inactiveText: '停用',
|
||||||
|
inactiveValue: '0',
|
||||||
|
activeValue: '1',
|
||||||
|
onChangeField: (row: any, value: any) => {
|
||||||
|
console.log("🚀 ~ row:", row)
|
||||||
|
ElMessageBox.prompt('二次校验密码确认', '', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
customClass: 'customInput',
|
||||||
|
inputType: 'text'
|
||||||
|
}).then(({ value }) => {
|
||||||
|
passwordConfirm(value).then(res => {
|
||||||
|
editEquipmentDelivery({ ...row, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||||
|
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '通讯状态',
|
title: '通讯状态',
|
||||||
field: 'runStatus',
|
field: 'runStatus',
|
||||||
@@ -277,6 +264,7 @@ const tableStore = new TableStore({
|
|||||||
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -284,69 +272,69 @@ const tableStore = new TableStore({
|
|||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
//直连装置注册
|
//直连装置注册
|
||||||
{
|
// {
|
||||||
title: '注册',
|
// title: '注册',
|
||||||
type: 'primary',
|
// type: 'primary',
|
||||||
icon: 'el-icon-Grid',
|
// icon: 'el-icon-Grid',
|
||||||
render: 'basicButton',
|
// render: 'basicButton',
|
||||||
disabled: row => {
|
// disabled: row => {
|
||||||
return (
|
|
||||||
(row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
|
|
||||||
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
|
|
||||||
row.status == '1'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
click: row => {
|
|
||||||
// 直连设备注册
|
|
||||||
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
governDeviceRegister({
|
|
||||||
nDid: row.ndid,
|
|
||||||
type: '4'
|
|
||||||
}).then(res => {
|
|
||||||
ElMessage.success(res.message)
|
|
||||||
tableStore.onTableAction('search', {})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(e => {})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//便携式设备注册
|
|
||||||
{
|
|
||||||
title: '注册',
|
|
||||||
type: 'primary',
|
|
||||||
icon: 'el-icon-Grid',
|
|
||||||
render: 'basicButton',
|
|
||||||
disabled: row => {
|
|
||||||
// return (
|
// return (
|
||||||
// (row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
|
// (row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
|
||||||
// row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
|
// row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
|
||||||
// row.status != '1'
|
// row.status == '1'
|
||||||
// )
|
// )
|
||||||
return true
|
// },
|
||||||
},
|
// click: row => {
|
||||||
click: row => {
|
// // 直连设备注册
|
||||||
// 便携式设备注册
|
// ElMessageBox.confirm('确定注册该设备吗?', '提示', {
|
||||||
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
|
// confirmButtonText: '确认',
|
||||||
confirmButtonText: '确认',
|
// cancelButtonText: '取消',
|
||||||
cancelButtonText: '取消',
|
// type: 'warning'
|
||||||
type: 'warning'
|
// })
|
||||||
})
|
// .then(() => {
|
||||||
.then(() => {
|
// governDeviceRegister({
|
||||||
portableDeviceRegister({
|
// nDid: row.ndid,
|
||||||
nDid: row.ndid
|
// type: '4'
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
ElMessage.success(res.message)
|
// ElMessage.success(res.message)
|
||||||
tableStore.index()
|
// tableStore.onTableAction('search', {})
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
.catch(e => {})
|
// .catch(e => {})
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
// //便携式设备注册
|
||||||
|
// {
|
||||||
|
// title: '注册',
|
||||||
|
// type: 'primary',
|
||||||
|
// icon: 'el-icon-Grid',
|
||||||
|
// render: 'basicButton',
|
||||||
|
// disabled: row => {
|
||||||
|
// // return (
|
||||||
|
// // (row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
|
||||||
|
// // row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
|
||||||
|
// // row.status != '1'
|
||||||
|
// // )
|
||||||
|
// return true
|
||||||
|
// },
|
||||||
|
// click: row => {
|
||||||
|
// // 便携式设备注册
|
||||||
|
// ElMessageBox.confirm('确定注册该设备吗?', '提示', {
|
||||||
|
// confirmButtonText: '确认',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// type: 'warning'
|
||||||
|
// })
|
||||||
|
// .then(() => {
|
||||||
|
// portableDeviceRegister({
|
||||||
|
// nDid: row.ndid
|
||||||
|
// }).then(res => {
|
||||||
|
// ElMessage.success(res.message)
|
||||||
|
// tableStore.index()
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// .catch(e => {})
|
||||||
|
// }
|
||||||
|
// },
|
||||||
//直连设备接入
|
//直连设备接入
|
||||||
// {
|
// {
|
||||||
// title: '接入',
|
// title: '接入',
|
||||||
@@ -407,7 +395,7 @@ const tableStore = new TableStore({
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(e => {})
|
.catch(e => { })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -512,7 +500,7 @@ const tableStore = new TableStore({
|
|||||||
tableStore.onTableAction('search', {})
|
tableStore.onTableAction('search', {})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(e => {})
|
.catch(e => { })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -580,11 +568,28 @@ const add = () => {
|
|||||||
|
|
||||||
// 确认
|
// 确认
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ruleFormRef.value.validate((valid: any) => {
|
ruleFormRef.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (dialogTitle.value == '新增设备') {
|
if (dialogTitle.value == '新增设备') {
|
||||||
addEquipmentDelivery(form).then(res => {
|
addEquipmentDelivery(form).then(res => {
|
||||||
ElMessage.success('新增成功')
|
ElMessage.success('新增成功')
|
||||||
|
if (devTypeOptions.value.filter((item: any) => item.value == form.devType)[0].code == 'Portable') {
|
||||||
|
setTimeout(() => {
|
||||||
|
ElMessage.warning('设备正在接入中,请稍等。')
|
||||||
|
}, 3000)
|
||||||
|
portableDeviceRegister({
|
||||||
|
nDid: res.data.ndid
|
||||||
|
}).then(pres => {
|
||||||
|
ElMessage.success(pres.message)
|
||||||
|
tableStore.index()
|
||||||
|
}).catch(err => {
|
||||||
|
// clearTimeout (time)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
resetForm()
|
resetForm()
|
||||||
tableStore.onTableAction('search', {})
|
tableStore.onTableAction('search', {})
|
||||||
})
|
})
|
||||||
@@ -630,7 +635,7 @@ onMounted(() => {
|
|||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
|
|
||||||
const addMenu = () => {}
|
const addMenu = () => { }
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.qrcode-label {
|
.qrcode-label {
|
||||||
@@ -659,3 +664,10 @@ const addMenu = () => {}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss">
|
||||||
|
.customInput {
|
||||||
|
.el-input__inner {
|
||||||
|
-webkit-text-security: disc !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
6
types/table.d.ts
vendored
6
types/table.d.ts
vendored
@@ -58,6 +58,12 @@ declare global {
|
|||||||
replaceValue?: any
|
replaceValue?: any
|
||||||
// 时间格式化
|
// 时间格式化
|
||||||
timeFormat?: string
|
timeFormat?: string
|
||||||
|
// 开关控制
|
||||||
|
onChangeField?: (row: TableRow, value: any) => void
|
||||||
|
activeValue?: string
|
||||||
|
inactiveValue?: string
|
||||||
|
activeText?: string
|
||||||
|
inactiveText?: string
|
||||||
// 自定义组件/函数渲染
|
// 自定义组件/函数渲染
|
||||||
customRender?: string | Component
|
customRender?: string | Component
|
||||||
// 使用了 render 属性时,渲染前对字段值的预处理方法,请返回新值
|
// 使用了 render 属性时,渲染前对字段值的预处理方法,请返回新值
|
||||||
|
|||||||
Reference in New Issue
Block a user