添加查看页面

This commit is contained in:
GGJ
2025-02-28 13:58:15 +08:00
parent 82e8bf2e0b
commit 188456c970
6 changed files with 255 additions and 57 deletions

View File

@@ -130,32 +130,38 @@
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="215">
<el-table-column label="操作" width="165">
<template #default="{ row }">
<el-button
type="primary"
link
:icon="CopyDocument"
@click="copyRow(row)"
>
复制
</el-button>
<el-button
type="primary"
link
:icon="CopyDocument"
@click="openDialog('edit', row)"
>
编辑
</el-button>
<el-button
type="primary"
link
:icon="Delete"
@click="deleteRow(row)"
>
删除
</el-button>
<div class="actionButtons">
<el-button
type="primary"
link
:icon="CopyDocument"
@click="copyRow(row)"
>
复制
</el-button>
<el-button type="primary" link :icon="View" @click="view(row)">
查看
</el-button>
<el-button
type="primary"
link
:icon="EditPen"
@click="openDialog('edit', row)"
>
编辑
</el-button>
<el-button
type="primary"
link
:icon="Delete"
@click="deleteRow(row)"
>
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
@@ -180,6 +186,8 @@
@close="showDialog = false"
v-if="showDialog"
/>
<!-- 查看 -->
<viewRow ref="viewRowRef" />
</div>
</template>
@@ -189,7 +197,7 @@ import Tree from './tree.vue'
import Commun from './communication.vue'
import type { CascaderOption } from 'element-plus'
import { getTreeData } from '@/api/check/test'
import { CirclePlus, Delete, Check, CopyDocument } from '@element-plus/icons-vue'
import { CirclePlus, Delete, Check, CopyDocument, View, EditPen } from '@element-plus/icons-vue'
import type { TestScript } from '@/api/device/interface/testScript'
import TestProjectPopup from '@/views/machine/testScript/components/testProjectPopup.vue'
import { CheckData } from '@/api/check/interface'
@@ -197,6 +205,7 @@ import { dlsDetails, deleteDtls, updateDtls, addScriptDtls, checkDataList } from
import { useDictStore } from '@/stores/modules/dict'
import { useHandleData } from '@/hooks/useHandleData'
import { scriptDtlsCheckDataList } from '@/api/device/testScript/index'
import viewRow from './viewRow.vue'
interface TabOption {
label?: string
name?: string
@@ -222,6 +231,7 @@ const dictStore = useDictStore()
const activeName = ref('')
const childActiveName = ref('')
const firstName = 'first'
const viewRowRef = ref()
const communicationList = ref([])
const testProjectPopupRef = ref()
const tableData: any = ref([])
@@ -365,6 +375,10 @@ const copyRow = async (row: any) => {
}
})
}
// 查看
const view = (row: any) => {
viewRowRef.value?.open(row)
}
// 删除
const deleteRow = async (row: any) => {
await useHandleData(deleteDtls, { enable: row.enable, index: row.index, scriptId: row.scriptId }, `删除`)
@@ -476,6 +490,12 @@ onMounted(() => {
width: 20px !important;
}
}
.actionButtons {
.el-button {
margin-left: 0px;
margin: 5px 6px;
}
}
</style>
<style>
input::-webkit-inner-spin-button {