调整代码
This commit is contained in:
@@ -70,7 +70,15 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<slot name="operation"></slot>
|
||||
<el-button class="ml10" v-if="showCustomColumn" :icon="Setting" @click="openCustomColumn">列设置</el-button>
|
||||
<el-button
|
||||
class="ml10"
|
||||
v-if="showCustomColumn"
|
||||
:icon="Setting"
|
||||
@mousedown="onCustomColumnMousedown"
|
||||
@click="openCustomColumn"
|
||||
>
|
||||
列设置
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form
|
||||
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||
@@ -167,8 +175,26 @@ watch(
|
||||
}, 500)
|
||||
}
|
||||
)
|
||||
let customColumnVisibleOnPress = false
|
||||
const onCustomColumnMousedown = () => {
|
||||
const table = tableStore?.table?.ref as any
|
||||
if (!table) return
|
||||
customColumnVisibleOnPress = table.getCustomVisible?.() ?? !!table.reactData?.customStore?.visible
|
||||
if (table.reactData?.customStore) {
|
||||
table.reactData.customStore.activeBtn = true
|
||||
}
|
||||
}
|
||||
const openCustomColumn = () => {
|
||||
tableStore?.table?.ref?.openCustom?.()
|
||||
const table = tableStore?.table?.ref as any
|
||||
if (!table) return
|
||||
if (table.reactData?.customStore) {
|
||||
table.reactData.customStore.activeBtn = false
|
||||
}
|
||||
if (customColumnVisibleOnPress) {
|
||||
table.closeCustom?.()
|
||||
} else {
|
||||
table.openCustom?.()
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
if (props.showCustomColumn && tableStore?.table) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||
<div v-if="showCustomColumn && !tableStore?.table?.customColumnInHeader" class="table-custom-toolbar">
|
||||
<el-button icon="el-icon-Setting" @click="openCustomColumn">列设置</el-button>
|
||||
<el-button icon="el-icon-Setting" @mousedown="onCustomColumnMousedown" @click="openCustomColumn">列设置</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
@@ -135,8 +135,26 @@ const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ checked }) => {
|
||||
const records = (tableRef.value as VxeTableInstance).getCheckboxRecords()
|
||||
tableStore.onTableAction('selection-change', records)
|
||||
}
|
||||
let customColumnVisibleOnPress = false
|
||||
const onCustomColumnMousedown = () => {
|
||||
const table = tableRef.value as any
|
||||
if (!table) return
|
||||
customColumnVisibleOnPress = table.getCustomVisible?.() ?? !!table.reactData?.customStore?.visible
|
||||
if (table.reactData?.customStore) {
|
||||
table.reactData.customStore.activeBtn = true
|
||||
}
|
||||
}
|
||||
const openCustomColumn = () => {
|
||||
tableRef.value?.openCustom?.()
|
||||
const table = tableRef.value as any
|
||||
if (!table) return
|
||||
if (table.reactData?.customStore) {
|
||||
table.reactData.customStore.activeBtn = false
|
||||
}
|
||||
if (customColumnVisibleOnPress) {
|
||||
table.closeCustom?.()
|
||||
} else {
|
||||
table.openCustom?.()
|
||||
}
|
||||
}
|
||||
const getRef = () => {
|
||||
return tableRef.value
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel" v-if="information">新增</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven" v-if="information">删除</el-button>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">
|
||||
模板下载
|
||||
</el-button>
|
||||
@@ -59,6 +59,7 @@ import DetailInfo from './components/detail.vue'
|
||||
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
|
||||
import { deleteUserReport } from '@/api/device-boot/sensitiveLoadMange'
|
||||
import { download } from '@/utils/fileDownLoad'
|
||||
|
||||
const addForms = ref()
|
||||
const dictData = useDictData()
|
||||
const sensitiveUserPopup = ref()
|
||||
@@ -73,6 +74,8 @@ defineOptions({
|
||||
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const information = ref(adminInfo.roleCode.includes('business_manager'))
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/userReport/getUserLedgerPage',
|
||||
// publicHeight: 65,
|
||||
|
||||
@@ -155,6 +155,20 @@ const tableStore = new TableStore({
|
||||
|
||||
/* { field: 'comFlag', title: '通讯状态 ', minWidth: 120 },*/
|
||||
{ field: 'id', title: '监测点序号', minWidth: 90 },
|
||||
{
|
||||
field: 'comFlag',
|
||||
title: '通讯状态',
|
||||
render: 'tag',
|
||||
minWidth: 80,
|
||||
custom: {
|
||||
中断: 'danger',
|
||||
正常: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
中断: '中断',
|
||||
正常: '正常'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'runFlag',
|
||||
title: '运行状态',
|
||||
@@ -166,6 +180,13 @@ const tableStore = new TableStore({
|
||||
检修: 'warning',
|
||||
调试: 'warning',
|
||||
退运: 'danger'
|
||||
},
|
||||
replaceValue: {
|
||||
投运: '投运',
|
||||
停运: '停运',
|
||||
检修: '检修',
|
||||
调试: '调试',
|
||||
退运: '退运'
|
||||
}
|
||||
},
|
||||
{ field: 'devName', title: '监测终端编号 ', minWidth: 140 },
|
||||
|
||||
Reference in New Issue
Block a user