修改资料库
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,11 +65,11 @@
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="edit(row)">修改</el-button>
|
||||
<!-- <el-button type="danger" link @click="del(row)">删除</el-button> -->
|
||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
||||
<!-- <el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
@@ -79,6 +80,24 @@
|
||||
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref="popupEditRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||
<!-- 删除 -->
|
||||
<el-dialog v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||
<el-tree-select
|
||||
v-model="TreeValue"
|
||||
:data="TreeData"
|
||||
filterable
|
||||
check-strictly
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
|
||||
<el-button type="primary" @click="del">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -94,6 +113,7 @@ import PopupEdit from './components/form.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||
defineOptions({
|
||||
name: 'database/algorithm'
|
||||
})
|
||||
@@ -102,10 +122,16 @@ const height = mainHeight(20)
|
||||
const heightTab = mainHeight(82)
|
||||
const size = ref(0)
|
||||
const addTreeRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const treeRef = ref()
|
||||
const popupEditRef = ref()
|
||||
const TreeData = ref([])
|
||||
const TreeValue = ref([])
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const dotList: any = ref()
|
||||
|
||||
const templatePolicy: any = ref([])
|
||||
@@ -175,12 +201,33 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
const onAddTree = () => {
|
||||
addTreeRef.value.open('新增')
|
||||
}
|
||||
// 删除
|
||||
const del = (row: any) => {
|
||||
deleteyById({ id: row.id }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
treeRef.value.loadData()
|
||||
const deletes = () => {
|
||||
queryAllAlgorithmLibrary().then(res => {
|
||||
TreeData.value = res.data
|
||||
})
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 删除
|
||||
const del = () => {
|
||||
if (TreeValue.value.length == 0) {
|
||||
return ElMessage.warning('请选择数据')
|
||||
}
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteyById({ id: TreeValue.value }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
dialogVisible.value = false
|
||||
treeRef.value.loadData()
|
||||
})
|
||||
})
|
||||
|
||||
// if (TreeValue.value.length > 0) {
|
||||
// ElMessage.warning('请选择数据')
|
||||
// return
|
||||
// }
|
||||
}
|
||||
// 修改
|
||||
const edit = (row: any) => {
|
||||
|
||||
Reference in New Issue
Block a user