设备基础管理
This commit is contained in:
15
src/api/access-boot/analyzeModel.ts
Normal file
15
src/api/access-boot/analyzeModel.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 新增设备模版
|
||||||
|
export const addDevModel = (file:any) => {
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('file', file)
|
||||||
|
return request({
|
||||||
|
url: '/access-boot/analyzeModel/addModel',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
},
|
||||||
|
data: form,
|
||||||
|
})
|
||||||
|
}
|
||||||
10
src/api/cs-device-boot/devmodel.ts
Normal file
10
src/api/cs-device-boot/devmodel.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 编辑设备模版
|
||||||
|
export const AuditDevModel = (data:any) => {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/devmodel/AuditDevModel',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
24
src/api/cs-device-boot/edData.ts
Normal file
24
src/api/cs-device-boot/edData.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 新增程序版本
|
||||||
|
export const addEdData = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/edData/addEdData',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const auditEdData = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/edData/auditEdData',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type='primary' @click='addMenu' icon='el-icon-plus'>新增字典</el-button>
|
<el-button :icon="Plus" type="primary" @click="addMenu" class="ml10">新增字典</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref='tableRef' />
|
<Table ref='tableRef' />
|
||||||
@@ -56,6 +56,9 @@ import Table from '@/components/table/index.vue'
|
|||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import PopupDictionary from './popupDictionary.vue'
|
import PopupDictionary from './popupDictionary.vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { delCsDictData } from '@/api/system-boot/csDictData'
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/manage/basic/dictionary'
|
name: 'govern/manage/basic/dictionary'
|
||||||
@@ -109,6 +112,11 @@ const tableStore = new TableStore({
|
|||||||
title: '确定删除吗?'
|
title: '确定删除吗?'
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
|
delCsDictData(row.id).then((res) => {
|
||||||
|
console.warn(res)
|
||||||
|
ElMessage.success(res.message)
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
178
src/views/govern/manage/basic/popupVersion.vue
Normal file
178
src/views/govern/manage/basic/popupVersion.vue
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog class='cn-operate-dialog' v-model='dialogVisible' :title='title'>
|
||||||
|
<el-scrollbar>
|
||||||
|
<el-form :inline='true' :model='form' label-width='120px' ref='formRef' :rules='rules'>
|
||||||
|
<el-form-item label='装置类型:' prop='type'>
|
||||||
|
<el-select v-model='form.type' placeholder='请选择' style='width: 100%' @change='typeChange'>
|
||||||
|
<el-option v-for='item in TypeOptions' :key='item.id' :label='item.name'
|
||||||
|
:value='item.id'></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='装置型号:' prop='devType'>
|
||||||
|
<el-select v-model='form.devType' placeholder='请选择' style='width: 100%' @change='devTypeChange'>
|
||||||
|
<el-option v-for='item in DevTypeOptions' :key='item.id' :label='item.name'
|
||||||
|
:value='item.id'></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='版本号:' prop='versionNo'>
|
||||||
|
<el-input v-model='form.versionNo' autocomplete='off' placeholder='请输入'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='版本类型:' prop='versionType'>
|
||||||
|
<el-input v-model='form.versionType' autocomplete='off'
|
||||||
|
placeholder='填写特殊类型(不填默认通用类型)'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='版本协议:' prop='versionAgreement'>
|
||||||
|
<el-input v-model='form.versionAgreement' autocomplete='off' placeholder='请输入'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='版本日期:' prop='versionDate'>
|
||||||
|
<el-date-picker
|
||||||
|
v-model='form.versionDate'
|
||||||
|
type='date'
|
||||||
|
value-format='yyyy-MM-dd'
|
||||||
|
placeholder='选择日期时间'
|
||||||
|
style='width: 100%'
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='描述:' prop='description'>
|
||||||
|
<el-input v-model='form.description' autocomplete='off' placeholder='请输入'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='CRC校验:' prop='crcInfo'>
|
||||||
|
<el-input v-model='form.crcInfo' autocomplete='off' placeholder='请输入'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-form :inline='true' :model='form' label-width='120px' class='mt10'>
|
||||||
|
<el-form-item label='升级文件:' prop='file'>
|
||||||
|
<el-upload
|
||||||
|
:limit='1'
|
||||||
|
:auto-upload='false'
|
||||||
|
:on-change='fileChange'
|
||||||
|
:on-exceed='fileExceed'
|
||||||
|
:file-list='fileList'
|
||||||
|
>
|
||||||
|
<el-button size='small' type='primary'>点击上传</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class='dialog-footer'>
|
||||||
|
<el-button @click='dialogVisible = false'>取消</el-button>
|
||||||
|
<el-button type='primary' @click='submit'>确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { reactive } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||||
|
import { addEdData, auditEdData } from '@/api/cs-device-boot/edData'
|
||||||
|
|
||||||
|
const TypeOptions = ref()
|
||||||
|
const DevTypeAllOptions = ref()
|
||||||
|
const DevTypeOptions = ref()
|
||||||
|
|
||||||
|
const fileList = ref()
|
||||||
|
const tableStore = inject('tableStore') as TableStore
|
||||||
|
const formRef = ref()
|
||||||
|
const form = reactive({
|
||||||
|
devType: null,
|
||||||
|
devTypeName: null,
|
||||||
|
versionAgreement: null,
|
||||||
|
versionNo: null,
|
||||||
|
versionType: null,
|
||||||
|
crcInfo: null,
|
||||||
|
description: null,
|
||||||
|
versionDate: null,
|
||||||
|
type: null,
|
||||||
|
id: null,
|
||||||
|
file: null
|
||||||
|
})
|
||||||
|
const rules = {
|
||||||
|
type: [{ required: true, message: '装置类型不能为空', trigger: 'blur' }],
|
||||||
|
devType: [{ required: true, message: '装置型号不能为空', trigger: 'blur' }],
|
||||||
|
versionNo: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||||
|
versionType: [{ required: true, message: '版本类型不能为空', trigger: 'blur' }],
|
||||||
|
versionAgreement: [{ required: true, message: '版本协议不能为空', trigger: 'blur' }],
|
||||||
|
versionDate: [{ required: true, message: '版本日期不能为空', trigger: 'blur' }],
|
||||||
|
description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
|
||||||
|
crcInfo: [{ required: true, message: 'CRC校验不能为空', trigger: 'blur' }],
|
||||||
|
file: [{ required: true, message: '升级文件不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
const typeChange = () => {
|
||||||
|
console.log(form.type)
|
||||||
|
form.devType = null
|
||||||
|
form.devTypeName = null
|
||||||
|
queryCsDictTree(form.type).then((res) => {
|
||||||
|
DevTypeOptions.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const devTypeChange = (e: any) => {
|
||||||
|
console.log(e)
|
||||||
|
form.devTypeName = DevTypeOptions.value.filter((item: any) => item.value == e)[0].label
|
||||||
|
}
|
||||||
|
const fileChange = (e: any) => {
|
||||||
|
console.log('fileChange!')
|
||||||
|
console.log(e)
|
||||||
|
form.file = e.raw
|
||||||
|
}
|
||||||
|
const fileExceed = (e: any) => {
|
||||||
|
console.log('fileExceed!')
|
||||||
|
console.log(e)
|
||||||
|
ElMessage.error('只能上传一个文件')
|
||||||
|
}
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('新增版本')
|
||||||
|
const open = (text: string, data?: anyObj) => {
|
||||||
|
title.value = text
|
||||||
|
dialogVisible.value = true
|
||||||
|
if (data) {
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = data[key]
|
||||||
|
}
|
||||||
|
fileList.value = [{
|
||||||
|
name: data.filePath,
|
||||||
|
url: data.filePath
|
||||||
|
}]
|
||||||
|
} else {
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
queryByCode('Direct_Connected_Device').then((res) => {
|
||||||
|
queryCsDictTree(res.data.id).then((res) => {
|
||||||
|
TypeOptions.value = res.data
|
||||||
|
})
|
||||||
|
queryByid(res.data.id).then((res) => {
|
||||||
|
DevTypeAllOptions.value = res.data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const submit = () => {
|
||||||
|
console.log(formRef)
|
||||||
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
|
console.log(valid)
|
||||||
|
if (valid) {
|
||||||
|
let submitForm = new FormData()
|
||||||
|
for (let key in form) {
|
||||||
|
submitForm.append(key, form[key])
|
||||||
|
}
|
||||||
|
if (form.id) {
|
||||||
|
await auditEdData(form)
|
||||||
|
} else {
|
||||||
|
await addEdData(form)
|
||||||
|
}
|
||||||
|
ElMessage.success('操作成功')
|
||||||
|
tableStore.index()
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
@@ -1,41 +1,104 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class='default-main'>
|
||||||
<TableHeader></TableHeader>
|
<TableHeader ref='tableHeaderRef'>
|
||||||
<Table ref="tableRef" />
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang='ts'>
|
||||||
import { ref, onMounted, provide } from 'vue'
|
import { ref, onMounted, provide } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/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({
|
defineOptions({
|
||||||
name: 'govern/manage/basic/template'
|
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({
|
const tableStore = new TableStore({
|
||||||
url: '/system-boot/csDictData/list',
|
url: '/cs-device-boot/devmodel/queryDevModelPage',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '数据分类', field: 'classId' },
|
{ title: '装置型号', field: 'devTypeName' },
|
||||||
{ title: '数据名称', field: 'name' },
|
{ title: '模板名称', field: 'name' },
|
||||||
{ title: '别名', field: 'otherName' },
|
{ title: '版本号', field: 'versionNo' },
|
||||||
{ title: '展示名称', field: 'showName' },
|
{ title: '版本时间', field: 'versionDate' },
|
||||||
{ title: '相别', field: 'phase' },
|
{
|
||||||
{ title: '单位', field: 'unit' },
|
title: '操作',
|
||||||
{ title: '基础数据类型', field: 'type' },
|
align: 'center',
|
||||||
{ title: '数据谐波次数', field: 'harmStart' },
|
width: '130',
|
||||||
{ title: '数据统计方法', field: 'statMethod' },
|
render: 'buttons',
|
||||||
{ title: '数据存储', field: 'classId' },
|
buttons: [
|
||||||
{ title: '数据来源', field: 'resourcesId' },
|
{
|
||||||
{ title: '操作', field: '操作' }
|
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)
|
provide('tableStore', tableStore)
|
||||||
tableStore.table.params.searchState = 0
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
const addMenu = () => {}
|
const chooseFile = (e: any) => {
|
||||||
|
console.warn(e)
|
||||||
|
addDevModel(e.raw).then((res: any) => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,41 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class='default-main'>
|
||||||
<TableHeader></TableHeader>
|
<TableHeader ref='tableHeaderRef'>
|
||||||
<Table ref="tableRef" />
|
<template #select>
|
||||||
|
<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-button :icon='Plus' type='primary' @click='addMenu' class='ml10'>新增版本</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref='tableRef' />
|
||||||
|
<PopupVersion ref='popupVersionRef'></PopupVersion>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang='ts'>
|
||||||
import { ref, onMounted, provide } from 'vue'
|
import { ref, onMounted, provide } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { delCsDictData } from '@/api/system-boot/csDictData'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import PopupVersion from '@/views/govern/manage/basic/popupVersion.vue'
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
import { auditEdData } from '@/api/cs-device-boot/edData'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/manage/basic/version'
|
name: 'govern/manage/basic/version'
|
||||||
})
|
})
|
||||||
|
const popupVersionRef = ref()
|
||||||
|
const dictData = useDictData()
|
||||||
|
const DevTypeOptions = ref()
|
||||||
|
const tableHeaderRef = ref()
|
||||||
|
queryByCode('Direct_Connected_Device').then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
queryByid(res.data.id).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
DevTypeOptions.value = res.data
|
||||||
|
})
|
||||||
|
})
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/system-boot/csDictData/list',
|
url: '/cs-device-boot/edData/queryEdDataPage',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '数据分类', field: 'classId' },
|
{ title: '装置型号', field: 'devTypeName' },
|
||||||
{ title: '数据名称', field: 'name' },
|
{ title: '版本号', field: 'versionNo' },
|
||||||
{ title: '别名', field: 'otherName' },
|
{ title: '版本协议', field: 'versionAgreement' },
|
||||||
{ title: '展示名称', field: 'showName' },
|
{ title: '版本日期', field: 'versionDate' },
|
||||||
{ title: '相别', field: 'phase' },
|
{ title: '归档日期', field: 'updateTime' },
|
||||||
{ title: '单位', field: 'unit' },
|
{ title: '描述', field: 'description' },
|
||||||
{ title: '基础数据类型', field: 'type' },
|
{ title: '状态', field: 'statusName' },
|
||||||
{ title: '数据谐波次数', field: 'harmStart' },
|
{
|
||||||
{ title: '数据统计方法', field: 'statMethod' },
|
title: '操作',
|
||||||
{ title: '数据存储', field: 'classId' },
|
align: 'center',
|
||||||
{ title: '数据来源', field: 'resourcesId' },
|
width: '130',
|
||||||
{ title: '操作', field: '操作' }
|
render: 'buttons',
|
||||||
]
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '编辑',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-EditPen',
|
||||||
|
render: 'tipButton',
|
||||||
|
click: row => {
|
||||||
|
popupVersionRef.value.open('编辑版本', row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '启用',
|
||||||
|
type: 'success',
|
||||||
|
icon: 'el-icon-Open',
|
||||||
|
render: 'tipButton',
|
||||||
|
disabled: row => {
|
||||||
|
return row.status == 1
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
auditEdData({
|
||||||
|
id: row.id,
|
||||||
|
status: 1
|
||||||
|
}).then((res: any) => {
|
||||||
|
ElMessage.success('启用成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'del',
|
||||||
|
title: '禁用',
|
||||||
|
type: 'danger',
|
||||||
|
icon: 'el-icon-SwitchButton',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'danger',
|
||||||
|
title: '确定禁用吗?'
|
||||||
|
},
|
||||||
|
disabled: row => {
|
||||||
|
return row.status == 0
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
auditEdData({
|
||||||
|
id: row.id,
|
||||||
|
status: 0
|
||||||
|
}).then((res: any) => {
|
||||||
|
ElMessage.success('禁用成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
loadCallback: () => {
|
||||||
|
tableStore.table.data.forEach((item: any) => {
|
||||||
|
item.statusName = item.status === 1 ? '启用' : '禁用'
|
||||||
|
for (let key in item) {
|
||||||
|
if (typeof item[key] !== 'number') {
|
||||||
|
item[key] = item[key] || '/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
tableStore.table.params.devType = ''
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
tableStore.table.params.searchState = 0
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableHeaderRef.value.onComSearch()
|
||||||
})
|
})
|
||||||
const addMenu = () => {}
|
const addMenu = () => {
|
||||||
|
popupVersionRef.value.open('新增版本')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
:on-change="chooseImage"
|
:on-change="chooseImage"
|
||||||
>
|
>
|
||||||
<el-button type="primary" icon="el-icon-Plus">新增拓扑图</el-button>
|
<el-button :icon="Plus" type="primary" class="ml10">新增拓扑图</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|||||||
Reference in New Issue
Block a user