修改测试bug

This commit is contained in:
guanj
2026-02-04 09:35:24 +08:00
parent dd0dab7643
commit 3fdb41c468
21 changed files with 308 additions and 156 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-dialog draggable class="cn-operate-dialog" width="520px" v-model.trim="dialogVisible" :title="title">
<el-dialog draggable class="cn-operate-dialog" width="540px" v-model.trim="dialogVisible" :title="title">
<el-form :inline="false" ref="formRef" :model="form" label-width="auto" class="form-one" :rules="rules">
<el-form-item label="项目名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入项目名称" />
@@ -23,14 +23,9 @@
<el-form-item label="排序" prop="sort">
<el-input maxlength="32" show-word-limit-number v-model.number="form.sort" :min="0" />
</el-form-item>
<el-form-item label="拓扑图" prop="sort">
<el-form-item label="拓扑图">
<div class="image-radio-group">
<div
class="image-radio-item"
v-for="item in images"
:key="item.id"
@click="handleSelect(item.id)"
>
<div class="image-radio-item" v-for="item in images" :key="item.id" @click="handleSelect(item.id)">
<el-radio :label="item.id" v-model="form.topoIds" class="hidden-radio">
{{ item.name }}
</el-radio>
@@ -64,7 +59,7 @@ import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
import { add, update } from '@/api/user-boot/role'
import { useAdminInfo } from '@/stores/adminInfo'
import { addProject, updateProject } from '@/api/cs-device-boot/edData'
import { addProject, updateProjects } from '@/api/cs-device-boot/edData'
import { getTopoTemplate } from '@/api/cs-device-boot/topologyTemplate'
import { getFileUrl } from '@/api/system-boot/file'
const adminInfo = useAdminInfo()
@@ -124,13 +119,11 @@ const open = (text: string, List: any, data?: anyObj, id?: string) => {
}
const submit = async () => {
formRef.value.validate(async valid => {
console.log("🚀 ~ submit ~ form.topoIds:", form.topoIds)
if (valid) {
if (form.id) {
await updateProject({ ...form ,topoIds:[form.topoIds]})
await updateProjects({ ...form, topoIds: form.topoIds == '' ? [] : [form.topoIds] })
} else {
await addProject({ ...form,topoIds:[form.topoIds] })
await addProject({ ...form, topoIds: form.topoIds == '' ? [] : [form.topoIds] })
}
ElMessage.success('保存成功')
tableStore.index()
@@ -150,7 +143,11 @@ const getImageList = async () => {
}
const handleSelect = (filePath: any) => {
form.topoIds = filePath
if (form.topoIds == filePath) {
form.topoIds = ''
} else {
form.topoIds = filePath
}
}
defineExpose({ open })
</script>

View File

@@ -1,14 +1,24 @@
<template>
<div class="default-main">
<div style="display: flex">
<div style="width: 800px">
<el-row v-loading="tableStore.table.loading">
<el-col :span="11">
<div class="custom-table-header">
<div class="title">工程列表</div>
<div class="title">
工程列表
<el-input
class="ml10"
v-model="searchValue"
placeholder="请输入工程名称"
clearable
style="width: 240px"
@input="inpChaange"
/>
</div>
<el-button :icon="Plus" type="primary" @click="addRole" class="ml10">新增工程</el-button>
</div>
<Table ref="tableRef" @currentChange="currentChange" />
</div>
<div style="flex: 1">
</el-col>
<el-col :span="13">
<div class="custom-table-header">
<div class="title">項目列表</div>
@@ -25,17 +35,19 @@
<vxe-column field="projectName" title="项目名称"></vxe-column>
<vxe-column field="projectArea" title="地址"></vxe-column>
<vxe-column title="拓扑图">
<vxe-column field="projectRemark" title="备注"></vxe-column>
<vxe-column title="拓扑图" width="100px">
<template #default="{ row }">
<el-image
:hide-on-click-modal="true"
:preview-teleported="true"
v-if="row.topologyInfo"
:preview-src-list="[row.topologyImageUrl]"
:src="getUrl(row) ? row.topologyImageUrl : ''"
></el-image>
<span v-else>/</span>
</template>
</vxe-column>
<vxe-column field="projectRemark" title="备注"></vxe-column>
<vxe-column field="projectSort" title="排序" width="80px"></vxe-column>
<vxe-column title="操作" width="180px">
<template #default="{ row }">
@@ -64,8 +76,8 @@
</vxe-column>
</vxe-table>
</div>
</div>
</div>
</el-col>
</el-row>
<!-- 新增工程 -->
<popup ref="popupRef" @save="save" />
<!-- 新增項目 -->
@@ -78,7 +90,7 @@ import { Plus } from '@element-plus/icons-vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { delTemplate, deleteSysExcel, bandRelation, queryList } from '@/api/harmonic-boot/luckyexcel'
import { deleteProject ,deleteEngineering} from '@/api/cs-device-boot/edData'
import { deleteProject, deleteEngineering } from '@/api/cs-device-boot/edData'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { defaultAttribute } from '@/components/table/defaultAttribute'
@@ -92,13 +104,16 @@ defineOptions({
const height = mainHeight(80)
const volConTypeList: any = dictData.getBasicData('Dev_Connect')
import { getFileUrl } from '@/api/system-boot/file'
const popupRef = ref()
const tableRef = ref()
const tableRef1 = ref()
const itemList = ref([])
const searchValue = ref('')
const itemList: any = ref([])
const menuListId = ref([])
const itemAddRef = ref()
const engineeringId = ref('')
const tableList = ref([])
const tableStore: any = new TableStore({
url: '/cs-device-boot/engineeringProjectRelation/list',
method: 'POST',
@@ -161,17 +176,30 @@ const tableStore: any = new TableStore({
],
loadCallback: () => {
if (engineeringId.value == '') {
engineeringId.value = tableStore.table.data[0].engineeringId
}
let list = tableStore.table.data.filter((item: any) => item.engineeringId == engineeringId.value)
tableRef.value.getRef().setCurrentRow(list[0])
itemList.value = list[0].projectInfoList
tableList.value = JSON.parse(JSON.stringify(tableStore.table.data))
setTableRow()
}
})
provide('tableStore', tableStore)
// 过滤
const inpChaange = (val: any) => {
engineeringId.value = ''
if (val == '') {
tableStore.table.data = tableList.value
} else {
tableStore.table.data = tableList.value.filter((item: any) => item.engineeringName.includes(val))
}
setTableRow()
}
const setTableRow = () => {
if (engineeringId.value == '') {
engineeringId.value = tableStore.table.data[0].engineeringId
}
let list = tableStore.table.data.filter((item: any) => item.engineeringId == engineeringId.value)
tableRef.value.getRef().setCurrentRow(list[0] ?? {})
itemList.value = list?.[0]?.projectInfoList ?? []
}
// 修改模版
const itemModification = (row: any) => {
itemAddRef.value.open('新增项目', tableStore.table.data, row, engineeringId.value)

View File

@@ -1,14 +1,14 @@
<template>
<div class="default-main">
<div v-show="show && lookShow" style="display: flex">
<div style="width: 600px">
<el-row v-show="show && lookShow">
<el-col :span="10">
<div class="custom-table-header">
<div class="title">报表列表</div>
<el-button :icon="Plus" type="primary" @click="addRole" class="ml10">新增报表</el-button>
</div>
<Table ref="tableRef" @currentChange="currentChange" />
</div>
<div style="flex: 1">
</el-col>
<el-col :span="14">
<div class="custom-table-header">
<div class="title">模版绑定</div>
@@ -61,8 +61,9 @@
</vxe-column>
</vxe-table>
</div>
</div>
</div>
</el-col>
</el-row>
<luckysheet ref="luckysheetRef" v-if="!show" @shutDown="shutDown" />
<!-- 查看 -->
<look ref="lookRef" v-if="!lookShow" @shutDown="shutDown" />

View File

@@ -1,6 +1,18 @@
<template>
<div class="default-main">
<TableHeader :showReset="false" showExport>
<template #select>
<el-form-item label="关键字筛选">
<el-input
maxlength="32"
show-word-limit
style="width: 240px"
v-model.trim="tableStore.table.params.searchValue"
clearable
placeholder="请输入敏感负荷名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button :icon="Plus" type="primary" @click="addMenu" class="ml10">新增</el-button>
</template>