修改列设置点击问题
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
</el-form>
|
||||
<template v-if="$slots.select || datePicker || showSearch">
|
||||
<el-button type="primary" @click="showSelectChange" v-if="showUnfoldButton">
|
||||
<Icon size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
|
||||
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
|
||||
<Icon :size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
|
||||
<Icon :size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onComSearch"
|
||||
@@ -57,7 +57,14 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<slot name="operation"></slot>
|
||||
<el-button class="ml10" v-if="showCustomColumn" :icon="Setting" @click="openCustomColumn">列设置</el-button>
|
||||
<el-button
|
||||
class="ml10 vxe-toolbar-custom-target"
|
||||
v-if="showCustomColumn"
|
||||
:icon="Setting"
|
||||
@click="openCustomColumn"
|
||||
>
|
||||
列设置
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form
|
||||
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||
@@ -125,7 +132,13 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
})
|
||||
|
||||
const openCustomColumn = () => {
|
||||
tableStore?.table?.ref?.openCustom?.()
|
||||
const tableRef = tableStore?.table?.ref
|
||||
if (!tableRef) return
|
||||
if (tableRef.getCustomVisible?.()) {
|
||||
tableRef.closeCustom?.()
|
||||
} else {
|
||||
tableRef.openCustom?.()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理 DatePicker 值变化事件
|
||||
|
||||
@@ -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="Setting" @click="openCustomColumn">列设置</el-button>
|
||||
<el-button class="vxe-toolbar-custom-target" :icon="Setting" @click="openCustomColumn">列设置</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
@@ -66,7 +66,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, inject, computed, onMounted, watch, useAttrs } from 'vue'
|
||||
import type { ElTable } from 'element-plus'
|
||||
import { VxeTableEvents, VxeTableInstance } from 'vxe-table'
|
||||
import { Setting } from '@element-plus/icons-vue'
|
||||
import FieldRender from '@/components/table/fieldRender/index.vue'
|
||||
@@ -87,7 +86,7 @@ const tableRef = ref<VxeTableInstance>()
|
||||
const tableStore = inject('tableStore') as TableStoreClass
|
||||
const router = useRouter()
|
||||
const key = ref(0)
|
||||
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
||||
interface Props extends /* @vue-ignore */ Partial<VxeTableInstance> {
|
||||
isGroup?: boolean
|
||||
showOverflow?: boolean | 'ellipsis' | 'title' | 'tooltip'
|
||||
showCustomColumn?: boolean
|
||||
@@ -109,7 +108,12 @@ const tableBindProps = computed(() => {
|
||||
})
|
||||
})
|
||||
const openCustomColumn = () => {
|
||||
tableRef.value?.openCustom?.()
|
||||
if (!tableRef.value) return
|
||||
if (tableRef.value.getCustomVisible?.()) {
|
||||
tableRef.value.closeCustom?.()
|
||||
} else {
|
||||
tableRef.value.openCustom?.()
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
if (!tableStore?.table) return
|
||||
@@ -137,7 +141,7 @@ const handleSortChange = ({ field, order }: any) => {
|
||||
// console.log('🚀 ~ handleSortChange ~ prop, order :', field, order)
|
||||
if (field && order) {
|
||||
// 根据当前排序条件对所有数据进行排序
|
||||
const list = tableStore.table.copyData.sort((a, b) => {
|
||||
const list = tableStore.table.copyData.sort((a: any, b: any) => {
|
||||
if (order === 'asc') {
|
||||
return a[field] > b[field] ? 1 : -1
|
||||
} else {
|
||||
|
||||
@@ -189,7 +189,7 @@ const setData = (data: any) => {
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
formatter: function (params) {
|
||||
formatter: function (params: any) {
|
||||
// console.log("🚀 ~ data.forEach ~ params:", params)
|
||||
let tip = ''
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
@@ -378,10 +378,10 @@ const changeDataType = () => {
|
||||
let flag = dataType.value.includes(0) || dataType.value.includes(1)
|
||||
if (flag) {
|
||||
let data1 = dataType.value.includes(0)
|
||||
? loadList.map(k => (k.data == 3.14159 ? null : k.data))
|
||||
? loadList.map((k: any) => (k.data == 3.14159 ? null : k.data))
|
||||
: []
|
||||
let data2 = dataType.value.includes(1)
|
||||
? modOutList.map(k => (k.data == 3.14159 ? null : k.data))
|
||||
? modOutList.map((k: any) => (k.data == 3.14159 ? null : k.data))
|
||||
: []
|
||||
let [modOuMin, modOuMax] = yMethod([...data1, ...data2])
|
||||
|
||||
@@ -476,7 +476,7 @@ const changeDataType = () => {
|
||||
}
|
||||
if (dataType.value.includes(2)) {
|
||||
let [temperatureMin, temperatureMax] = yMethod(
|
||||
temperatureList.map(k => (k.data == 3.14159 ? 0 : k.data))
|
||||
temperatureList.map((k: any) => (k.data == 3.14159 ? 0 : k.data))
|
||||
)
|
||||
echartsData.value.yAxis[flag ? 1 : 0] = {
|
||||
name: '℃',
|
||||
@@ -508,7 +508,7 @@ const changeDataType = () => {
|
||||
}
|
||||
key.value += 1
|
||||
}
|
||||
function renderItem(params, api) {
|
||||
function renderItem(params: any, api: any) {
|
||||
var categoryIndex = api.value(0)
|
||||
var start = api.coord([api.value(1), categoryIndex])
|
||||
var end = api.coord([api.value(2), categoryIndex])
|
||||
@@ -538,7 +538,7 @@ function renderItem(params, api) {
|
||||
)
|
||||
}
|
||||
// 三角形标记渲染函数
|
||||
function renderMarker(params, api) {
|
||||
function renderMarker(params: any, api: any) {
|
||||
var point = api.coord([api.value(0), 0])
|
||||
var symbolSize = 8
|
||||
var offsetY = 40
|
||||
|
||||
@@ -160,7 +160,7 @@ const handleaddDevice = () => {
|
||||
query: {
|
||||
activeName: '0',
|
||||
id: lineId.value,
|
||||
ndid: deviceData.value?.ndid,
|
||||
ndid: (deviceData.value as any)?.ndid || '',
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@ import { saveLogParam } from '@/api/common'
|
||||
defineOptions({
|
||||
name: 'comptroller/list'
|
||||
})
|
||||
const tableStore = new TableStore({
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/system-boot/audit/getAuditLog',
|
||||
method: 'POST',
|
||||
column: [
|
||||
|
||||
@@ -47,7 +47,7 @@ defineOptions({
|
||||
const dictData = useDictData()
|
||||
const manufacturer = dictData.getBasicData('Dev_Manufacturers')
|
||||
const manufacturerForm = ref<string[]>([])
|
||||
const tableStore = new TableStore({
|
||||
const tableStore: any = new TableStore({
|
||||
isWebPaging: true,
|
||||
url: '/device-boot/runManage/getRuntimeData',
|
||||
method: 'POST',
|
||||
|
||||
@@ -47,7 +47,7 @@ const interferenceSource = dictData.getBasicData('Interference_Source')
|
||||
const level = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const interferenceSourceForm = ref<string[]>([])
|
||||
const scaleForm = ref<string[]>([])
|
||||
const tableStore = new TableStore({
|
||||
const tableStore: any = new TableStore({
|
||||
isWebPaging: true,
|
||||
url: '/device-boot/runManage/getLineLedger',
|
||||
method: 'POST',
|
||||
|
||||
@@ -32,7 +32,7 @@ defineOptions({
|
||||
})
|
||||
const popupEditRef = ref()
|
||||
const detail = ref<anyObj | null>(null)
|
||||
const tableStore = new TableStore({
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/system-boot/dictType/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
|
||||
@@ -102,7 +102,7 @@ const rules = {
|
||||
iosPath: [{ required: true, message: '请输入IOS路径', trigger: 'blur' }]
|
||||
}
|
||||
const formRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-system-boot/appVersion/getAllData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
|
||||
@@ -105,12 +105,12 @@ const tableStore: any = new TableStore({
|
||||
onChangeField: (row: any, value: any) => {
|
||||
if (row.jobStatus == 1) {
|
||||
stop({ id: row.id }).then(res => {
|
||||
ElMessage.success(res.message)
|
||||
ElMessage.success((res as any).message)
|
||||
tableStore.index()
|
||||
})
|
||||
} else {
|
||||
start({ id: row.id }).then(res => {
|
||||
ElMessage.success(res.message)
|
||||
ElMessage.success((res as any).message)
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"useDefineForClassFields": true,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
// "suppressImplicitAnyIndexErrors": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"removeComments": false,
|
||||
|
||||
Reference in New Issue
Block a user