|
|
@@ -60,10 +60,18 @@
|
|
|
<span>{{ getDisasterLevel(scope.row.disasterLevel) }}</span>
|
|
|
</template>
|
|
|
<template #content="scope">
|
|
|
- <div class="content--div">
|
|
|
- <el-tooltip :content="scope.row.content" placement="top" popper-class="custom-tooltip" effect="light">
|
|
|
+ <div class="content--div" :style="{ maxHeight: contentMaxHeight + 'px' }">
|
|
|
+ <el-tooltip
|
|
|
+ :content="scope.row.content"
|
|
|
+ placement="top"
|
|
|
+ popper-class="custom-tooltip"
|
|
|
+ effect="light"
|
|
|
+ :hide-after="0"
|
|
|
+ v-if="scope.row.contentEltooptip"
|
|
|
+ >
|
|
|
<span>{{ scope.row.content }}</span>
|
|
|
</el-tooltip>
|
|
|
+ <span v-else>{{ scope.row.content }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #effectState="scope">
|
|
|
@@ -76,34 +84,36 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #action="scope">
|
|
|
- <ActionButton
|
|
|
- text="编辑"
|
|
|
- @click="handleEditWarningInfo(scope.row.id)"
|
|
|
- v-if="scope.row.effectState === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
- />
|
|
|
- <ActionButton
|
|
|
- text="发布"
|
|
|
- :popconfirm="{
|
|
|
- title: '确定要发布?',
|
|
|
- }"
|
|
|
- v-if="scope.row.effectState === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
- @confirm="handlePublishWarningInfo(scope.row.id, scope.row.effectState)"
|
|
|
- />
|
|
|
- <ActionButton
|
|
|
- text="撤回"
|
|
|
- :popconfirm="{
|
|
|
- title: '确定要撤回?',
|
|
|
- }"
|
|
|
- v-else-if="scope.row.effectState === ACTIVE_STATUS.ACTIVE"
|
|
|
- @confirm="handlePublishWarningInfo(scope.row.id, scope.row.effectState)"
|
|
|
- />
|
|
|
- <ActionButton
|
|
|
- text="删除"
|
|
|
- :popconfirm="{
|
|
|
- title: '确定要删除?',
|
|
|
- }"
|
|
|
- @confirm="handleDeleteWarningInfo(scope.row.id)"
|
|
|
- />
|
|
|
+ <div class="action-container--div">
|
|
|
+ <ActionButton
|
|
|
+ text="编辑"
|
|
|
+ @click="handleEditWarningInfo(scope.row.id)"
|
|
|
+ v-if="scope.row.effectState === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ text="发布"
|
|
|
+ :popconfirm="{
|
|
|
+ title: '确定要发布?',
|
|
|
+ }"
|
|
|
+ v-if="scope.row.effectState === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
+ @confirm="handlePublishWarningInfo(scope.row.id, scope.row.effectState)"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ text="撤回"
|
|
|
+ :popconfirm="{
|
|
|
+ title: '确定要撤回?',
|
|
|
+ }"
|
|
|
+ v-else-if="scope.row.effectState === ACTIVE_STATUS.ACTIVE"
|
|
|
+ @confirm="handlePublishWarningInfo(scope.row.id, scope.row.effectState)"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ text="删除"
|
|
|
+ :popconfirm="{
|
|
|
+ title: '确定要删除?',
|
|
|
+ }"
|
|
|
+ @confirm="handleDeleteWarningInfo(scope.row.id)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
@@ -112,7 +122,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
- import { ref, onMounted, reactive } from 'vue';
|
|
|
+ import { ref, onMounted, reactive, nextTick } from 'vue';
|
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
@@ -149,10 +159,11 @@
|
|
|
useDisasterWarningHook();
|
|
|
|
|
|
const router = useRouter();
|
|
|
+ const contentMaxHeight = 50;
|
|
|
const searchData = reactive({
|
|
|
- disasterType: '',
|
|
|
- disasterLevel: '',
|
|
|
- effectState: '',
|
|
|
+ disasterType: null,
|
|
|
+ disasterLevel: null,
|
|
|
+ effectState: null,
|
|
|
});
|
|
|
const getWarningIcon = (disasterCode: string) => {
|
|
|
const icon = warningTypeDice.value.find((item) => item.itemCode === disasterCode)?.imageUrl;
|
|
|
@@ -201,13 +212,13 @@
|
|
|
};
|
|
|
const handleSearch = () => {
|
|
|
wanrningInfoListQuery.queryParam = {};
|
|
|
- if (searchData.disasterLevel !== '') {
|
|
|
+ if (searchData.disasterLevel) {
|
|
|
wanrningInfoListQuery.queryParam.disasterLevel = searchData.disasterLevel;
|
|
|
}
|
|
|
- if (searchData.disasterType !== '') {
|
|
|
+ if (searchData.disasterType) {
|
|
|
wanrningInfoListQuery.queryParam.disasterType = searchData.disasterType;
|
|
|
}
|
|
|
- if (searchData.effectState !== '') {
|
|
|
+ if (searchData.effectState) {
|
|
|
wanrningInfoListQuery.queryParam.effectState = searchData.effectState;
|
|
|
}
|
|
|
if (Object.keys(wanrningInfoListQuery.queryParam).length > 0) {
|
|
|
@@ -232,6 +243,15 @@
|
|
|
tableData.value = res.records;
|
|
|
pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
|
+
|
|
|
+ nextTick(() => {
|
|
|
+ const contentDivs = document.querySelectorAll('.content--div');
|
|
|
+ contentDivs.forEach((div, index) => {
|
|
|
+ if (div.scrollHeight > contentMaxHeight) {
|
|
|
+ tableData.value[index - 1].contentEltooptip = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
getTableData();
|
|
|
@@ -256,7 +276,6 @@
|
|
|
}
|
|
|
.content--div {
|
|
|
width: 100%;
|
|
|
- max-height: 50px;
|
|
|
overflow-y: hidden;
|
|
|
}
|
|
|
</style>
|