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; //创建时间
|
createTime?: string| null; //创建时间
|
||||||
updateBy?: string| null; //更新用户
|
updateBy?: string| null; //更新用户
|
||||||
updateTime?: string| null; //更新时间
|
updateTime?: string| null; //更新时间
|
||||||
|
angle: number; // 是否支持电压相角、电流相角指标
|
||||||
|
usePhaseIndex: number; // 角型接线时是否使用相别的指标来进行检测
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type {Plan} from './interface'
|
import type { Plan } from './interface'
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import type {ErrorSystem} from '../device/interface/error'
|
import type { ErrorSystem } from '../device/interface/error'
|
||||||
import type {Device} from '../device/interface/device'
|
import type { Device } from '../device/interface/device'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name 检测计划管理模块
|
* @name 检测计划管理模块
|
||||||
@@ -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)
|
return http.upload(`/adPlan/importSubPlan`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,3 +139,8 @@ export const importSubPlan = (params: Device.ReqPqDevParams) => {
|
|||||||
export const exportPlanCheckData = (params: Plan.ResPlan) => {
|
export const exportPlanCheckData = (params: Plan.ResPlan) => {
|
||||||
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}`)
|
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>
|
<template>
|
||||||
<el-dialog
|
<el-dialog v-model="dialogVisible" :title="parameter.title" :destroy-on-close="true" width="580px" draggable>
|
||||||
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 class="drawer-multiColumn-form" style="margin-top: 10px" label-width="100px">
|
||||||
<el-form-item label="文件上传:">
|
<el-form-item label="文件上传:">
|
||||||
<el-upload
|
<el-upload
|
||||||
|
|||||||
@@ -1,40 +1,62 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 基础信息弹出框 -->
|
<!-- 基础信息弹出框 -->
|
||||||
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogSmall" @close="close" align-center>
|
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogSmall" @close="close" align-center>
|
||||||
<div>
|
<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-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>
|
||||||
<el-form-item label="存储地址" prop="path" >
|
<el-form-item label="存储地址" prop="path">
|
||||||
<el-input v-model='formContent.path' placeholder="请输入icd存储地址" maxlength="32" show-word-limit/>
|
<el-input
|
||||||
</el-form-item>
|
v-model="formContent.path"
|
||||||
</el-form>
|
placeholder="请输入icd存储地址"
|
||||||
</div>
|
maxlength="32"
|
||||||
<template #footer>
|
show-word-limit
|
||||||
<div class="dialog-footer">
|
/>
|
||||||
<el-button @click="close()">取消</el-button>
|
</el-form-item>
|
||||||
<el-button type="primary" @click="save()" >
|
<el-form-item label="是否支持电压相角、电流相角指标" prop="angle" label-width="auto">
|
||||||
保存
|
<el-switch
|
||||||
</el-button>
|
v-model="formContent.angle"
|
||||||
</div>
|
:active-value="1"
|
||||||
</template>
|
:inactive-value="0"
|
||||||
</el-dialog>
|
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>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
</template>
|
<script lang="ts" setup>
|
||||||
|
import { ElMessage, type FormInstance, type FormItemRule } from 'element-plus'
|
||||||
|
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'
|
||||||
|
|
||||||
<script lang="ts" setup>
|
const dictStore = useDictStore()
|
||||||
import{ ElMessage, type FormInstance,type FormItemRule } from 'element-plus'
|
// 定义弹出组件元信息
|
||||||
import type { ProTableInstance } from '@/components/ProTable/interface'
|
const dialogFormRef = ref()
|
||||||
import { ref,computed, Ref} from 'vue'
|
function useMetaInfo() {
|
||||||
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()
|
|
||||||
function useMetaInfo() {
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
const formContent = ref<ICD.ResICD>({
|
const formContent = ref<ICD.ResICD>({
|
||||||
@@ -42,12 +64,13 @@
|
|||||||
name: '',
|
name: '',
|
||||||
path: '',
|
path: '',
|
||||||
state: 1,
|
state: 1,
|
||||||
|
angle: 0,
|
||||||
|
usePhaseIndex: 0
|
||||||
})
|
})
|
||||||
return { dialogVisible, titleType, formContent }
|
return { dialogVisible, titleType, formContent }
|
||||||
}
|
}
|
||||||
|
|
||||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
|
||||||
|
|
||||||
|
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||||
|
|
||||||
// 清空formContent
|
// 清空formContent
|
||||||
const resetFormContent = () => {
|
const resetFormContent = () => {
|
||||||
@@ -56,23 +79,22 @@ const resetFormContent = () => {
|
|||||||
name: '',
|
name: '',
|
||||||
path: '',
|
path: '',
|
||||||
state: 1,
|
state: 1,
|
||||||
|
angle: 0,
|
||||||
|
usePhaseIndex: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let dialogTitle = computed(() => {
|
let dialogTitle = computed(() => {
|
||||||
return titleType.value === 'add' ? '新增ICD' : '编辑ICD'
|
return titleType.value === 'add' ? '新增ICD' : '编辑ICD'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//定义规则
|
||||||
|
const formRuleRef = ref<FormInstance>()
|
||||||
//定义规则
|
//定义校验规则
|
||||||
const formRuleRef = ref<FormInstance>()
|
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||||
//定义校验规则
|
|
||||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
|
||||||
name: [{ required: true, message: 'icd名称必填!', trigger: 'blur' }],
|
name: [{ required: true, message: 'icd名称必填!', trigger: 'blur' }],
|
||||||
path: [{ required: true, message: 'icd存储地址必填!', trigger: 'blur' }],
|
path: [{ required: true, message: 'icd存储地址必填!', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const close = () => {
|
const close = () => {
|
||||||
@@ -81,47 +103,46 @@ const close = () => {
|
|||||||
resetFormContent()
|
resetFormContent()
|
||||||
// 重置表单
|
// 重置表单
|
||||||
dialogFormRef.value?.resetFields()
|
dialogFormRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存数据
|
// 保存数据
|
||||||
const save = () => {
|
const save = () => {
|
||||||
try {
|
try {
|
||||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (formContent.value.id) {
|
if (formContent.value.id) {
|
||||||
await updateICD(formContent.value);
|
await updateICD(formContent.value)
|
||||||
} else {
|
} else {
|
||||||
await addICD(formContent.value);
|
await addICD(formContent.value)
|
||||||
}
|
}
|
||||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||||
close()
|
close()
|
||||||
// 刷新表格
|
// 刷新表格
|
||||||
await props.refreshTable!()
|
await props.refreshTable!()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
//error('验证过程中出现错误', err)
|
//error('验证过程中出现错误', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: ICD.ResICD) => {
|
const open = async (sign: string, data: ICD.ResICD) => {
|
||||||
// 重置表单
|
// 重置表单
|
||||||
dialogFormRef.value?.resetFields()
|
dialogFormRef.value?.resetFields()
|
||||||
titleType.value = sign
|
titleType.value = sign
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
formContent.value = { ...data }
|
formContent.value = { ...data }
|
||||||
} else {
|
} else {
|
||||||
resetFormContent()
|
resetFormContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对外映射
|
// 对外映射
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
refreshTable: (() => Promise<void>) | undefined;
|
refreshTable: (() => Promise<void>) | undefined
|
||||||
}>()
|
}>()
|
||||||
|
</script>
|
||||||
</script>
|
|
||||||
@@ -61,7 +61,14 @@
|
|||||||
>
|
>
|
||||||
导出检测结果
|
导出检测结果
|
||||||
</el-button>
|
</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 type="primary" icon="Box" v-auth.plan="'add_subplan'" v-if="!isTabPlanFather">
|
||||||
数据合并
|
数据合并
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -158,6 +165,7 @@
|
|||||||
<!-- 向计划导入/导出设备对话框 -->
|
<!-- 向计划导入/导出设备对话框 -->
|
||||||
<PlanPopup :refresh-table="proTable?.getTableList" ref="planPopup" @update:tab="addNewChildTab" />
|
<PlanPopup :refresh-table="proTable?.getTableList" ref="planPopup" @update:tab="addNewChildTab" />
|
||||||
<DevTransfer ref="devTransfer" @update:table="addNewChildTab" />
|
<DevTransfer ref="devTransfer" @update:table="addNewChildTab" />
|
||||||
|
<ImportZip ref="planCheckDataImportZip" @result="importResult" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { ElMessage, ElMessageBox, TabPaneName } from 'element-plus'
|
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 { Plan } from '@/api/plan/interface'
|
||||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||||
import { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
|
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 { Device } from '@/api/device/interface/device'
|
||||||
import { useDictStore } from '@/stores/modules/dict'
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
|
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
|
||||||
import { useHandleData } from '@/hooks/useHandleData'
|
import { useHandleData } from '@/hooks/useHandleData'
|
||||||
import router from '@/routers'
|
import router from '@/routers'
|
||||||
import { useDownload } from '@/hooks/useDownload'
|
import { useDownload } from '@/hooks/useDownload'
|
||||||
|
import ImportZip from '@/components/ImportZip/index.vue'
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
const planFormContent = ref<Plan.ReqPlan>()
|
const planFormContent = ref<Plan.ReqPlan>()
|
||||||
@@ -191,7 +207,7 @@ const isTabPlanFather = ref(true)
|
|||||||
const planId = ref('')
|
const planId = ref('')
|
||||||
const planTabDevList = ref<any[]>([])
|
const planTabDevList = ref<any[]>([])
|
||||||
const patternId = ref('')
|
const patternId = ref('')
|
||||||
|
const planCheckDataImportZip = ref<InstanceType<typeof ImportZip> | null>(null)
|
||||||
const getTableList = async (params: any) => {
|
const getTableList = async (params: any) => {
|
||||||
if (!planFormContent.value) {
|
if (!planFormContent.value) {
|
||||||
return Promise.resolve({ data: [], total: 0 })
|
return Promise.resolve({ data: [], total: 0 })
|
||||||
@@ -601,6 +617,21 @@ const exportPlanCheckResultData = async () => {
|
|||||||
() => useDownload(exportPlanCheckData, `${planFormContent.value.name}_计划检测结果`, params, false, '.zip')
|
() => 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 })
|
defineExpose({ open, handleTableDataUpdate })
|
||||||
|
|
||||||
interface ChildrenPlanProps {
|
interface ChildrenPlanProps {
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ const statisticalAnalysis = async (row: Partial<Plan.ReqPlan> = {}) => {
|
|||||||
|
|
||||||
const importSubClick = () => {
|
const importSubClick = () => {
|
||||||
const params = {
|
const params = {
|
||||||
title: '检测计划',
|
title: '导入检测计划',
|
||||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
||||||
importApi: importSubPlan
|
importApi: importSubPlan
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user