微调
This commit is contained in:
@@ -62,6 +62,7 @@ export namespace Dict {
|
||||
name: string; // 名称
|
||||
code: string; // 编码
|
||||
sort: number; // 排序
|
||||
openValue?: number | null;
|
||||
level?: number | null; // 事件等级:0-普通;1-中等;2-严重 (默认为0)
|
||||
algoDescribe?: number | null; // 与高级算法内部Id描述对应
|
||||
value?: string | null; // 字典针对电压等级
|
||||
|
||||
@@ -142,21 +142,21 @@
|
||||
</el-dropdown>
|
||||
</div> -->
|
||||
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type='primary'
|
||||
link
|
||||
:icon='Download'
|
||||
@click="openDrawer('报告下载', scope.row)"
|
||||
v-if='form.activeTabs === 3 && form.activeChildTabs === 0 && scope.row.reportState === 1'
|
||||
>报告下载
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
|
||||
<el-button
|
||||
type='primary'
|
||||
link
|
||||
:icon='Postcard'
|
||||
@click="openDrawer('报告生成', scope.row)"
|
||||
v-if='form.activeTabs === 3 && scope.row.reportState !== 1'
|
||||
v-if='form.activeTabs === 3 '
|
||||
>报告生成
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
@@ -477,6 +477,7 @@ const getTableList = async (params: any) => {
|
||||
} else {
|
||||
checkStateList.value = checkStateTable.value
|
||||
}
|
||||
console.log('table,getBoundPqDevList')
|
||||
return getBoundPqDevList({
|
||||
'planId': props.id,
|
||||
'checkStateList': checkStateList.value,
|
||||
@@ -659,10 +660,12 @@ const handleSelectionChange = (selection: any[]) => {
|
||||
|
||||
//查询
|
||||
const handleSearch = () => {
|
||||
console.log('handleSearch,getBoundPqDevList')
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
//重置
|
||||
const handleRefresh = () => {
|
||||
console.log('handleRefresh,getBoundPqDevList')
|
||||
form.value.search = null
|
||||
form.value.checkStatus = null
|
||||
form.value.checkResult = null
|
||||
@@ -772,7 +775,11 @@ function tableHeaderInit(val: number) {
|
||||
break
|
||||
}
|
||||
//console.log("test",columns);
|
||||
handleRefresh()
|
||||
form.value.search = null
|
||||
form.value.checkStatus = null
|
||||
form.value.checkResult = null
|
||||
form.value.checkReportStatus = null
|
||||
//handleRefresh()
|
||||
}
|
||||
|
||||
function refreshStatusList() {
|
||||
@@ -980,7 +987,7 @@ const handleTest = async (val: string) => {
|
||||
const data = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
const url = 'ws://localhost:7777/hello?name=cdf';
|
||||
const url = 'ws://192.168.1.127:7777/hello?name=cdf';
|
||||
socketClient.Instance.connect(url);
|
||||
data.socketServe = socketClient.Instance;
|
||||
data.socketServe.registerCallBack('aaa', (res: { code: number; }) => {
|
||||
@@ -1034,6 +1041,8 @@ const handleTest = async (val: string) => {
|
||||
ElMessage.success('归档成功!')
|
||||
}
|
||||
})
|
||||
|
||||
emit('batchGenerateClicked') // 触发事件
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ const searchForm = ref({
|
||||
})
|
||||
const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
|
||||
const getTreeData = (val: any) => {
|
||||
|
||||
defaultChecked.value = []
|
||||
data.value = val
|
||||
if (data.value.length > 0 && data.value[0].children.length > 0) {
|
||||
@@ -76,6 +77,30 @@ const getTreeData = (val: any) => {
|
||||
|
||||
}
|
||||
|
||||
//点击表格后左侧树刷新,高亮显示对应节点
|
||||
const clickTableToTree = (val: any,id:any) => {
|
||||
defaultChecked.value = []
|
||||
data.value = val
|
||||
let node = ref('')
|
||||
if (data.value.length > 0) {
|
||||
for (let i = 0; i < data.value.length; i++){
|
||||
for (let j = 0; j < data.value[i].children.length; j++) {
|
||||
if (data.value[i].children[j].id == id) {
|
||||
node.value = data.value[i].children[j].id
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(node.value);
|
||||
idd.value = node.value
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const {updateSelectedTreeNode} = defineProps<{
|
||||
updateSelectedTreeNode:Function;
|
||||
}>();
|
||||
@@ -123,7 +148,7 @@ const detail = () => {
|
||||
onMounted(() => {
|
||||
// console.log()
|
||||
})
|
||||
defineExpose({ getTreeData })
|
||||
defineExpose({ getTreeData ,clickTableToTree})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<el-row :gutter='10'>
|
||||
<el-col :lg='4' :xl='4' :md='4' :sm='4'>
|
||||
<div class='left_tree'>
|
||||
<tree ref='treeRef' :updateSelectedTreeNode='getPieData || (() => {})' />
|
||||
<!-- <tree ref='treeRef' :updateSelectedTreeNode='getPieData || (() => {})' /> -->
|
||||
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :lg='20' :xl='20' :md='20' :sm='20'>
|
||||
@@ -266,16 +267,10 @@ const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefin
|
||||
return undefined
|
||||
}
|
||||
|
||||
const getPieData = async (id: string) => {
|
||||
currentId.value = id // 设置当前ID
|
||||
// 初始化计数对象
|
||||
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
|
||||
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
const reportStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
if (id) {
|
||||
const boundPqDevList = ref<Device.ResPqDev[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
const plan = findPlanById(planList.value?.data || [], id)
|
||||
planName.value = '所选计划:' + plan.name
|
||||
|
||||
const updateData = (id: string) => {
|
||||
getPieData(id);//刷新饼图
|
||||
|
||||
//获取点击树的父节点名字
|
||||
const parentNodeName = ref('')
|
||||
for (let i = 0; i < planList.value.data.length; i++) {
|
||||
@@ -293,6 +288,19 @@ const getPieData = async (id: string) => {
|
||||
}else{
|
||||
handleCheckFunction(0)
|
||||
}
|
||||
}
|
||||
|
||||
const getPieData = async (id: string) => {
|
||||
currentId.value = id // 设置当前ID
|
||||
// 初始化计数对象
|
||||
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
|
||||
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
const reportStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
if (id) {
|
||||
const boundPqDevList = ref<Device.ResPqDev[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
const plan = findPlanById(planList.value?.data || [], id)
|
||||
planName.value = '所选计划:' + plan.name
|
||||
|
||||
|
||||
select_Plan.value = plan
|
||||
if (plan) {
|
||||
@@ -302,6 +310,7 @@ const getPieData = async (id: string) => {
|
||||
// 处理未找到计划的情况
|
||||
isTimeCheck.value = false // 或者其他默认值
|
||||
}
|
||||
console.log('饼图getBoundPqDevList')
|
||||
const pqDevList_Result2 = await getBoundPqDevList({ 'planId': id, 'checkStateList': [0, 1, 2, 3] })
|
||||
boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[]
|
||||
// 遍历 boundPqDevList 并更新计数对象
|
||||
@@ -431,7 +440,8 @@ const resizeObserver = new ResizeObserver(entries => {
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeMount(async () => {
|
||||
|
||||
const initPlan = async () => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
|
||||
const reqPlan: Plan.ReqPlan = {
|
||||
pattern: patternId,
|
||||
@@ -455,8 +465,10 @@ onBeforeMount(async () => {
|
||||
state: 0,
|
||||
}
|
||||
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
|
||||
}
|
||||
|
||||
console.log(planList.value.data)
|
||||
onBeforeMount(async () => {
|
||||
await initPlan()
|
||||
for (let i = 0; i < planList.value.data.length; i++) {
|
||||
if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
|
||||
currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id
|
||||
@@ -483,11 +495,13 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const handleBatchGenerate = () => {
|
||||
const handleBatchGenerate = async () => {
|
||||
console.log('批量生成按钮被点击了');
|
||||
// 在这里添加其他逻辑,比如显示对话框、更新状态等
|
||||
await initPlan()
|
||||
treeRef.value.clickTableToTree(planList.value.data,currentId.value)
|
||||
getPieData(currentId.value)
|
||||
|
||||
|
||||
if (form.value.activeTabs === 0)//设备检测
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.document_State === '未归档')
|
||||
|
||||
@@ -344,6 +344,13 @@ const rules = computed(() => {
|
||||
{
|
||||
formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
//保存时判是否加密,把识别码密钥字段清空
|
||||
if(formContent.value.encryptionFlag === 0){
|
||||
formContent.value.series = null
|
||||
formContent.value.devKey = null
|
||||
}
|
||||
|
||||
if (formContent.value.id) {
|
||||
await updatePqDev(formContent.value);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
|
||||
@@ -12,10 +12,16 @@
|
||||
<el-form-item label="编码" :label-width="100" prop="code">
|
||||
<el-input v-model="formContent.code" placeholder="请输入" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="值" :label-width="100" prop="dictValue">
|
||||
<el-input v-model="formContent.dictValue" placeholder="请输入" autocomplete="off"/>
|
||||
<el-form-item label="开启值描述" :label-width="100" >
|
||||
<el-radio-group v-model="formContent.openValue" @change="handleOpenValueChange">
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件等级" :label-width="100" prop="level">
|
||||
<el-form-item label="值" :label-width="100" prop="value" v-if="formContent.openValue==1">
|
||||
<el-input v-model="formContent.value" placeholder="请输入" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件等级" :label-width="100" prop="level" v-if="false">
|
||||
<el-select v-model.number="formContent.level">
|
||||
<el-option label="普通" :value="0"/>
|
||||
<el-option label="中等" :value="1"/>
|
||||
@@ -42,7 +48,7 @@ import {dialogSmall} from "@/utils/elementBind";
|
||||
import {addDictData, updateDictData} from "@/api/system/dictionary/dictData/index.ts";
|
||||
import {Dict} from "@/api/system/dictionary/interface";
|
||||
import {ElMessage, FormItemRule} from "element-plus";
|
||||
import type {Ref} from "vue";
|
||||
import {computed, Ref} from "vue";
|
||||
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{required: true, message: '类型名称必填!', trigger: 'blur'}],
|
||||
@@ -63,10 +69,11 @@ function useMetaInfo() {
|
||||
name: "",
|
||||
code: "",
|
||||
value: "",
|
||||
dictValue: "",
|
||||
//dictValue: "",
|
||||
level: 0,
|
||||
sort: 100,
|
||||
state: 1,
|
||||
openValue:0
|
||||
})
|
||||
|
||||
return {dialogVisible, titleType, formContent, dictTypeName};
|
||||
@@ -83,13 +90,21 @@ const resetFormContent = () => {
|
||||
name: "",
|
||||
code: "",
|
||||
value: "",
|
||||
dictValue: "",
|
||||
//dictValue: "",
|
||||
level: 0,
|
||||
sort: 100,
|
||||
state: 1,
|
||||
openValue:0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handleOpenValueChange = ()=> {
|
||||
if(formContent.value.openValue == 0){
|
||||
formContent.value.value = null
|
||||
}
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
resetFormContent()
|
||||
@@ -106,15 +121,18 @@ const open = (sign: string, typeId: string, name: string, data: Dict.ResDictData
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
formContent.value = {...data}
|
||||
formContent.value.dictValue = data.value
|
||||
//formContent.value.dictValue = data.value
|
||||
}
|
||||
}
|
||||
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if(formContent.value.openValue === 0){
|
||||
formContent.value.value = null
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
formContent.value.value = formContent.value.dictValue
|
||||
if (formContent.value.id) {
|
||||
await updateDictData(formContent.value)
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,7 @@ import {useHandleData} from '@/hooks/useHandleData'
|
||||
import {deleteDictData, getDictDataListByTypeId, exportDictData} from "@/api/system/dictionary/dictData/index";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportDictType} from "@/api/system/dictionary/dictType";
|
||||
import { isShallow } from 'vue';
|
||||
defineOptions({
|
||||
name: 'dict'
|
||||
})
|
||||
@@ -80,7 +81,13 @@ const columns = reactive<ColumnProps<Dict.ResDictData>[]>([
|
||||
{
|
||||
prop: 'value',
|
||||
label: '值',
|
||||
minWidth: 180
|
||||
minWidth: 180,
|
||||
render: (scope) => {
|
||||
if (scope.row.openValue === 0 || scope.row.value === null || scope.row.value === '') {
|
||||
return <span>/</span>; // 使用 JSX 返回 VNode
|
||||
}
|
||||
return <span>{scope.row.value}</span>; // 使用 JSX 返回 VNode
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
<el-form-item label='类型编码' :label-width='100' prop='code'>
|
||||
<el-input v-model='formContent.code' placeholder='请输入' autocomplete='off' />
|
||||
</el-form-item>
|
||||
<el-form-item label="开启等级" :label-width="100">
|
||||
<el-form-item label="开启等级" :label-width="100" v-if="false">
|
||||
<el-radio-group v-model="formContent.openLevel" >
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开启描述" :label-width="100">
|
||||
<el-form-item label="开启描述" :label-width="100" v-if="false">
|
||||
<el-radio-group v-model="formContent.openDescribe" >
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
|
||||
Reference in New Issue
Block a user