执行监听页面

This commit is contained in:
zhujiyan
2024-05-07 11:48:55 +08:00
parent 63cab044f3
commit c17da13b7a

View File

@@ -1,24 +1,66 @@
<!-- 全局属性执行监听页面 --> <!-- 全局属性执行监听页面 -->
<template> <template>
<div class="home"> <div class="home">
<div class="info"> <navTitle>
<navTitle> <template #nav_name>配置要执行的监听</template>
<template #nav_name>配置要执行的监听</template> </navTitle>
</navTitle> <div class="watchs_info">
<el-button type="primary" :icon="Plus" size="small" @click="handleAdd">新增</el-button>
<el-table :data="tableData" border style="width: 100%" height="400">
<el-table-column align="left" prop="listenerType" label="名称" width="180" />
<el-table-column align="left" prop="javaClass" label="JAVA监听器" width="180" />
<el-table-column align="left" fixed="right" label="操作" width="120">
<template #default="scope">
<el-button link type="danger" size="small" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
<!-- 新增监听组件 -->
<addWatch
v-if="addFlag"
v-model="addFlag"
:addFlag="addFlag"
@close="close"
@addWatch="addTableData"
></addWatch>
</div> </div>
</template> </template>
<script> <script setup>
import { ref } from 'vue'
import navTitle from '../components/navTitle.vue' import navTitle from '../components/navTitle.vue'
export default { import { Plus } from '@element-plus/icons-vue'
components: { import addWatch from '../components/addWatch.vue'
navTitle let tableData = ref([])
}, const addFlag = ref(false)
data() { async function handleAdd() {
return {} addFlag.value = true
}, }
mounted() {}, const close = async () => {
methods: {} addFlag.value = false
}
//接收弹框新增数据
function addTableData(val) {
tableData.value = [...tableData.value, val]
}
//删除
const handleDelete=(index,val)=>{
tableData.value.splice(index,1)
} }
</script> </script>
<style scoped></style> <style scoped lang="scss">
.home {
width: 100%;
height: calc(100vh - 100px);
padding-top: 20px;
.watchs_info {
width: 96%;
height: auto;
margin-top: 10px;
margin: 0 auto;
.el-button {
margin: 10px 0;
}
}
}
</style>