设备基础管理
This commit is contained in:
@@ -1,41 +1,104 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader></TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<div class='default-main'>
|
||||
<TableHeader ref='tableHeaderRef'>
|
||||
<template #select>
|
||||
<el-form-item label='模版名称'>
|
||||
<el-input v-model='tableStore.table.params.name' clearable placeholder='请输入名称'></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label='装置型号'>
|
||||
<el-select v-model='tableStore.table.params.devType' placeholder='请选择' style='width: 100%'
|
||||
clearable>
|
||||
<el-option v-for='item in DevTypeOptions' :key='item.id' :label='item.name'
|
||||
:value='item.id'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload
|
||||
action=''
|
||||
class='upload-demo'
|
||||
:show-file-list='false'
|
||||
:auto-upload='false'
|
||||
:on-change='chooseFile'
|
||||
>
|
||||
<el-button :icon='Plus' type='primary' class='ml10'>新增模版</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref='tableRef' />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
<script setup lang='ts'>
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { addDevModel } from '@/api/access-boot/analyzeModel'
|
||||
import { AuditDevModel } from '@/api/cs-device-boot/devmodel'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/template'
|
||||
})
|
||||
const DevTypeOptions = ref()
|
||||
const tableHeaderRef = ref()
|
||||
queryByCode('Direct_Connected_Device').then((res) => {
|
||||
queryByid(res.data.id).then((res) => {
|
||||
DevTypeOptions.value = res.data
|
||||
})
|
||||
})
|
||||
const tableStore = new TableStore({
|
||||
url: '/system-boot/csDictData/list',
|
||||
url: '/cs-device-boot/devmodel/queryDevModelPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '数据分类', field: 'classId' },
|
||||
{ title: '数据名称', field: 'name' },
|
||||
{ title: '别名', field: 'otherName' },
|
||||
{ title: '展示名称', field: 'showName' },
|
||||
{ title: '相别', field: 'phase' },
|
||||
{ title: '单位', field: 'unit' },
|
||||
{ title: '基础数据类型', field: 'type' },
|
||||
{ title: '数据谐波次数', field: 'harmStart' },
|
||||
{ title: '数据统计方法', field: 'statMethod' },
|
||||
{ title: '数据存储', field: 'classId' },
|
||||
{ title: '数据来源', field: 'resourcesId' },
|
||||
{ title: '操作', field: '操作' }
|
||||
]
|
||||
{ title: '装置型号', field: 'devTypeName' },
|
||||
{ title: '模板名称', field: 'name' },
|
||||
{ title: '版本号', field: 'versionNo' },
|
||||
{ title: '版本时间', field: 'versionDate' },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '130',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
AuditDevModel({
|
||||
id: row.id,
|
||||
status: 0
|
||||
}).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
})
|
||||
|
||||
tableStore.table.params.devType = ''
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.searchState = 0
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const addMenu = () => {}
|
||||
const chooseFile = (e: any) => {
|
||||
console.warn(e)
|
||||
addDevModel(e.raw).then((res: any) => {
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user