@@ -180,6 +217,9 @@ import {
exportplcData,
queryFdrDesc,
queryplcDesc,
+ importfaultCodeDict,
+ exportfaultCodeDict,
+ queryfaultCodeDict,
} from '/@/api/backend/theoreticalpowerCurve/request'
import * as echarts from 'echarts'
// 导入
@@ -292,6 +332,42 @@ const download2 = () => {
})
}
+// 导入
+const update3 = (file: any) => {
+ const formData = new FormData()
+ formData.append('file', file.file)
+ const v = generateRandomNumber(16)
+ const id = encrypt_aes(currentRow.value.id, v)
+ formData.append('id', id)
+ return importfaultCodeDict(formData, v)
+ .then((res: any) => {
+ if (res.success) {
+ ElMessage.success('更新成功')
+ getRunLog()
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+ .catch((err) => {
+ ElMessage.error(err?.response?.data?.msg ?? '更新失败')
+ })
+}
+
+// 导出
+const download3 = () => {
+ console.log(currentRow)
+ exportfaultCodeDict({ id: currentRow.value.id }).then((res: any) => {
+ const downloadUrl = window.URL.createObjectURL(res)
+ const a = document.createElement('a')
+ a.href = downloadUrl
+ a.download = '故障码字典' + new Date().getTime()
+ document.body.appendChild(a)
+ a.click()
+ window.URL.revokeObjectURL(downloadUrl)
+ document.body.removeChild(a)
+ })
+}
+
const rowClassName = ({ row, rowIndex }: any) => {
if (currentRow.value === row) {
return 'current-row'
@@ -339,10 +415,6 @@ const option: any = reactive({
},
},
series: [],
- grid: {
- left: '3%',
- right: '3%',
- },
})
const chart: any = ref(null)
const chartContainer = ref(null)
@@ -457,6 +529,8 @@ const faultRecordingData: any = ref([])
const faultRecordingpageData: any = ref([])
const runLogData: any = ref([])
const runLogpageData: any = ref([])
+const faultCodeDictData: any = ref([])
+const faultCodeDictpageData: any = ref([])
const handleSizeChange1 = (val: any) => {
paginationOptions1.pageSize = val
@@ -483,6 +557,20 @@ const handleCurrentChange2 = (val: any) => {
const end = start + paginationOptions2.pageSize
runLogpageData.value = runLogData.value.slice(start, end)
}
+
+const handleSizeChange3 = (val: any) => {
+ paginationOptions3.pageSize = val
+ paginationOptions3.current = 1
+ runLogpageData.value = runLogData.value.slice(0, paginationOptions1.pageSize)
+}
+// 当前页改变时触发
+const handleCurrentChange3 = (val: any) => {
+ paginationOptions3.current = val
+ const start = (paginationOptions3.current - 1) * paginationOptions3.pageSize
+ const end = start + paginationOptions3.pageSize
+ runLogpageData.value = runLogData.value.slice(start, end)
+}
+
const getList = () => {
const transparams = searchParams()
theoreticalpowerCurveList(transparams)
@@ -498,6 +586,7 @@ const getList = () => {
getpowerCurve()
getFaultRecording()
getRunLog()
+ getfaultCodeDict()
} else {
ElMessage.error(res.msg ?? '查询失败')
}
@@ -574,6 +663,19 @@ const getRunLog = () => {
})
}
+const getfaultCodeDict = () => {
+ currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
+ queryfaultCodeDict({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
+ if (res.code == 200) {
+ faultCodeDictData.value = [...res.data]
+ paginationOptions3.total = faultCodeDictData.value.length
+ faultCodeDictpageData.value = faultCodeDictData.value.slice(0, paginationOptions3.pageSize)
+ } else {
+ ElMessage.warning('查询失败')
+ }
+ })
+}
+
const paginationOptions = reactive({
current: 1,
pageSize: 5,
@@ -592,6 +694,13 @@ const paginationOptions2 = reactive({
total: 0,
pageSizes: [5, 50, 100],
})
+
+const paginationOptions3 = reactive({
+ current: 1,
+ pageSize: 5,
+ total: 0,
+ pageSizes: [5, 50, 100],
+})
const getcurrentPage = () => {
getList()
}
@@ -694,7 +803,7 @@ $paginationHeight: 32px;
}
.chartContainer {
- width: 100%;
+ width: 50%;
height: 240px;
border: 1px solid rgb(217, 217, 217);
margin-top: 10px;
@@ -705,8 +814,7 @@ $paginationHeight: 32px;
}
}
.box-card2 {
- width: 100%;
- margin-bottom: 20px;
+ width: 50%;
.chartContainer {
width: 100%;
height: 200px;