2024-09-04 20:59:57 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="default-main">
|
2024-09-06 15:10:30 +08:00
|
|
|
<!-- 案例库 -->
|
2024-09-04 20:59:57 +08:00
|
|
|
<TableHeader ref="TableHeaderRef" datePicker>
|
|
|
|
|
<template #operation>
|
|
|
|
|
<el-button icon="el-icon-Plus" type="primary" @click="addUser">新增</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</TableHeader>
|
|
|
|
|
<Table ref="tableRef"></Table>
|
|
|
|
|
<!-- 弹框 -->
|
2024-09-12 20:01:17 +08:00
|
|
|
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
|
2024-09-04 20:59:57 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, ref, provide } from 'vue'
|
|
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
|
|
|
|
import PopupEdit from './components/form.vue'
|
2024-09-12 20:01:17 +08:00
|
|
|
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
2024-09-04 20:59:57 +08:00
|
|
|
defineOptions({
|
|
|
|
|
name: 'database/case'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const popupEditRef = ref()
|
|
|
|
|
|
|
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
|
|
|
|
|
const tableStore = new TableStore({
|
2024-09-12 16:15:14 +08:00
|
|
|
url: '/supervision-boot/libcase/pageQuery',
|
2024-09-04 20:59:57 +08:00
|
|
|
method: 'POST',
|
|
|
|
|
column: [
|
|
|
|
|
{ title: '电能质量事件名称', field: 'name' },
|
|
|
|
|
{
|
|
|
|
|
title: '发生事件',
|
2024-09-12 16:15:14 +08:00
|
|
|
field: 'type'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '事件简介',
|
|
|
|
|
field: 'summary'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '事件经过',
|
|
|
|
|
field: 'process'
|
2024-09-04 20:59:57 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '发生地点',
|
2024-09-12 16:15:14 +08:00
|
|
|
field: 'location'
|
2024-09-04 20:59:57 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '处理措施',
|
2024-09-12 16:15:14 +08:00
|
|
|
field: 'measures'
|
2024-09-04 20:59:57 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '治理效果',
|
2024-09-12 16:15:14 +08:00
|
|
|
field: 'effect'
|
2024-09-12 20:01:17 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
width: '140',
|
|
|
|
|
render: 'buttons',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
|
|
|
|
title: '修改',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
|
|
|
|
|
icon: 'el-icon-Plus',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
popupEditRef.value.open('修改案例', row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'delete',
|
|
|
|
|
title: '删除',
|
|
|
|
|
type: 'danger',
|
|
|
|
|
icon: 'el-icon-Delete',
|
|
|
|
|
render: 'confirmButton',
|
|
|
|
|
popconfirm: {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
confirmButtonType: 'danger',
|
|
|
|
|
title: '确定删除吗?'
|
|
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
libcaseBeleteyById({ id: row.id }).then(res => {
|
|
|
|
|
ElMessage.success('删除成功')
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-09-04 20:59:57 +08:00
|
|
|
}
|
|
|
|
|
],
|
2024-09-12 20:01:17 +08:00
|
|
|
loadCallback: () => {}
|
2024-09-04 20:59:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 弹框
|
|
|
|
|
const addUser = () => {
|
2024-09-06 15:10:30 +08:00
|
|
|
popupEditRef.value.open('新增案例')
|
2024-09-04 20:59:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss"></style>
|