Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -24,6 +24,8 @@ export namespace ICD {
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
angle: number; // 是否支持电压相角、电流相角指标
|
||||
usePhaseIndex: number; // 角型接线时是否使用相别的指标来进行检测
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,7 +130,7 @@ export const exportSubPlan = (params: Plan.ResPlan) => {
|
||||
}
|
||||
|
||||
// 导入子检测计划
|
||||
export const importSubPlan = (params: Device.ReqPqDevParams) => {
|
||||
export const importSubPlan = (params: Plan.ResPlan) => {
|
||||
return http.upload(`/adPlan/importSubPlan`, params)
|
||||
}
|
||||
|
||||
@@ -139,3 +139,8 @@ export const importSubPlan = (params: Device.ReqPqDevParams) => {
|
||||
export const exportPlanCheckData = (params: Plan.ResPlan) => {
|
||||
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}`)
|
||||
}
|
||||
|
||||
// 导入子检测计划检测结果数据
|
||||
export const importSubPlanCheckData = (params: Plan.ResPlan) => {
|
||||
return http.upload(`/adPlan/importSubPlanCheckData`, params)
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="`导入${parameter.title}`"
|
||||
:destroy-on-close="true"
|
||||
width="580px"
|
||||
draggable
|
||||
>
|
||||
<el-dialog v-model="dialogVisible" :title="parameter.title" :destroy-on-close="true" width="580px" draggable>
|
||||
<el-form class="drawer-multiColumn-form" style="margin-top: 10px" label-width="100px">
|
||||
<el-form-item label="文件上传:">
|
||||
<el-upload
|
||||
|
||||
@@ -2,35 +2,57 @@
|
||||
<!-- 基础信息弹出框 -->
|
||||
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogSmall" @close="close" align-center>
|
||||
<div>
|
||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules'>
|
||||
<el-form :model="formContent" label-position="right" label-width="80" ref="dialogFormRef" :rules="rules">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model='formContent.name' placeholder="请输入icd名称" maxlength="32" show-word-limit/>
|
||||
<el-input v-model="formContent.name" placeholder="请输入icd名称" maxlength="32" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="存储地址" prop="path">
|
||||
<el-input v-model='formContent.path' placeholder="请输入icd存储地址" maxlength="32" show-word-limit/>
|
||||
<el-input
|
||||
v-model="formContent.path"
|
||||
placeholder="请输入icd存储地址"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否支持电压相角、电流相角指标" prop="angle" label-width="auto">
|
||||
<el-switch
|
||||
v-model="formContent.angle"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
inline-prompt
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角型接线时是否使用相别的指标来进行检测" prop="usePhaseIndex" label-width="auto">
|
||||
<el-switch
|
||||
v-model="formContent.usePhaseIndex"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
inline-prompt
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="save()" >
|
||||
保存
|
||||
</el-button>
|
||||
<el-button type="primary" @click="save()">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, type FormInstance, type FormItemRule } from 'element-plus'
|
||||
import type { ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { ref,computed, Ref} from 'vue'
|
||||
import { computed, ref, Ref } from 'vue'
|
||||
import { type ICD } from '@/api/device/interface/icd'
|
||||
import { dialogSmall } from '@/utils/elementBind'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { addICD, updateICD } from '@/api/device/icd'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
@@ -42,13 +64,14 @@
|
||||
name: '',
|
||||
path: '',
|
||||
state: 1,
|
||||
angle: 0,
|
||||
usePhaseIndex: 0
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||
|
||||
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
formContent.value = {
|
||||
@@ -56,6 +79,8 @@ const resetFormContent = () => {
|
||||
name: '',
|
||||
path: '',
|
||||
state: 1,
|
||||
angle: 0,
|
||||
usePhaseIndex: 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,17 +88,14 @@ const resetFormContent = () => {
|
||||
return titleType.value === 'add' ? '新增ICD' : '编辑ICD'
|
||||
})
|
||||
|
||||
|
||||
|
||||
//定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{ required: true, message: 'icd名称必填!', trigger: 'blur' }],
|
||||
path: [{ required: true, message: 'icd存储地址必填!', trigger: 'blur' }],
|
||||
path: [{ required: true, message: 'icd存储地址必填!', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
@@ -89,9 +111,9 @@ const close = () => {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (formContent.value.id) {
|
||||
await updateICD(formContent.value);
|
||||
await updateICD(formContent.value)
|
||||
} else {
|
||||
await addICD(formContent.value);
|
||||
await addICD(formContent.value)
|
||||
}
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
close()
|
||||
@@ -121,7 +143,6 @@ const close = () => {
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
refreshTable: (() => Promise<void>) | undefined
|
||||
}>()
|
||||
|
||||
</script>
|
||||
@@ -61,7 +61,14 @@
|
||||
>
|
||||
导出检测结果
|
||||
</el-button>
|
||||
<el-button type="primary" icon="Upload" v-auth.plan="'add_subplan'">导入检测结果</el-button>
|
||||
<el-button
|
||||
v-auth.plan="'add_subplan'"
|
||||
type="primary"
|
||||
icon="Upload"
|
||||
@click="importSubCheckDataClick"
|
||||
>
|
||||
导入检测结果
|
||||
</el-button>
|
||||
<el-button type="primary" icon="Box" v-auth.plan="'add_subplan'" v-if="!isTabPlanFather">
|
||||
数据合并
|
||||
</el-button>
|
||||
@@ -158,6 +165,7 @@
|
||||
<!-- 向计划导入/导出设备对话框 -->
|
||||
<PlanPopup :refresh-table="proTable?.getTableList" ref="planPopup" @update:tab="addNewChildTab" />
|
||||
<DevTransfer ref="devTransfer" @update:table="addNewChildTab" />
|
||||
<ImportZip ref="planCheckDataImportZip" @result="importResult" />
|
||||
</template>
|
||||
<script setup lang="tsx">
|
||||
import { ElMessage, ElMessageBox, TabPaneName } from 'element-plus'
|
||||
@@ -166,13 +174,21 @@ import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入
|
||||
import { Plan } from '@/api/plan/interface'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
|
||||
import { deletePlan, exportPlanCheckData, exportSubPlan, getDevListByPlanId, subPlanBindDev } from '@/api/plan/plan'
|
||||
import {
|
||||
deletePlan,
|
||||
exportPlanCheckData,
|
||||
exportSubPlan,
|
||||
getDevListByPlanId,
|
||||
importSubPlanCheckData,
|
||||
subPlanBindDev
|
||||
} from '@/api/plan/plan'
|
||||
import { Device } from '@/api/device/interface/device'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import router from '@/routers'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import ImportZip from '@/components/ImportZip/index.vue'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const planFormContent = ref<Plan.ReqPlan>()
|
||||
@@ -191,7 +207,7 @@ const isTabPlanFather = ref(true)
|
||||
const planId = ref('')
|
||||
const planTabDevList = ref<any[]>([])
|
||||
const patternId = ref('')
|
||||
|
||||
const planCheckDataImportZip = ref<InstanceType<typeof ImportZip> | null>(null)
|
||||
const getTableList = async (params: any) => {
|
||||
if (!planFormContent.value) {
|
||||
return Promise.resolve({ data: [], total: 0 })
|
||||
@@ -601,6 +617,21 @@ const exportPlanCheckResultData = async () => {
|
||||
() => useDownload(exportPlanCheckData, `${planFormContent.value.name}_计划检测结果`, params, false, '.zip')
|
||||
)
|
||||
}
|
||||
|
||||
const importSubCheckDataClick = () => {
|
||||
const params = {
|
||||
title: '导入计划检测结果',
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
||||
importApi: importSubPlanCheckData
|
||||
}
|
||||
planCheckDataImportZip.value?.acceptParams(params)
|
||||
}
|
||||
|
||||
const importResult = async (success: boolean | undefined) => {
|
||||
if (success) {
|
||||
await props.refreshTable!()
|
||||
}
|
||||
}
|
||||
defineExpose({ open, handleTableDataUpdate })
|
||||
|
||||
interface ChildrenPlanProps {
|
||||
|
||||
@@ -641,7 +641,7 @@ const statisticalAnalysis = async (row: Partial<Plan.ReqPlan> = {}) => {
|
||||
|
||||
const importSubClick = () => {
|
||||
const params = {
|
||||
title: '检测计划',
|
||||
title: '导入检测计划',
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
||||
importApi: importSubPlan
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user