|
|
@@ -54,7 +54,7 @@
|
|
|
<img :src="getWarningIcon(scope.row.disasterType)" alt="预警图标" class="weather-warning-icon" />
|
|
|
</template>
|
|
|
<template #disasterType="scope">
|
|
|
- <span>{{ getDisasterType(scope.row.disasterType) }}</span>
|
|
|
+ <span>{{ getWarningType(scope.row.disasterType) }}</span>
|
|
|
</template>
|
|
|
<template #disasterLevel="scope">
|
|
|
<span>{{ getDisasterLevel(scope.row.disasterLevel) }}</span>
|
|
|
@@ -90,6 +90,7 @@
|
|
|
@click="handleEditWarningInfo(scope.row.id)"
|
|
|
v-if="scope.row.effectState === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
/>
|
|
|
+ <ActionButton text="查看" @click="handleViewWarningInfo(scope.row.id)" />
|
|
|
<ActionButton
|
|
|
text="发布"
|
|
|
:popconfirm="{
|
|
|
@@ -152,8 +153,15 @@
|
|
|
} from './src/config';
|
|
|
|
|
|
const { permissions } = useUserInfoHook();
|
|
|
- const { warningTypeDice, disasterLevelDice, getWarningInfoDict, getDisasterLevelDict, getDisasterLevel } =
|
|
|
- useDisasterWarningHook();
|
|
|
+ const {
|
|
|
+ warningTypeDice,
|
|
|
+ disasterLevelDice,
|
|
|
+ getWarningInfoDict,
|
|
|
+ getWarningType,
|
|
|
+ getWarningIcon,
|
|
|
+ getDisasterLevelDict,
|
|
|
+ getDisasterLevel,
|
|
|
+ } = useDisasterWarningHook();
|
|
|
|
|
|
const router = useRouter();
|
|
|
const contentMaxHeight = 50;
|
|
|
@@ -162,13 +170,6 @@
|
|
|
disasterLevel: null,
|
|
|
effectState: null,
|
|
|
});
|
|
|
- const getWarningIcon = (disasterCode: string) => {
|
|
|
- const icon = warningTypeDice.value.find((item) => item.itemCode === disasterCode)?.imageUrl;
|
|
|
- return icon;
|
|
|
- };
|
|
|
- const getDisasterType = (disasterCode: string) => {
|
|
|
- return warningTypeDice.value.find((item) => item.itemCode === disasterCode)?.itemValue;
|
|
|
- };
|
|
|
const defaultName = 'warning-info-item';
|
|
|
const handleCreateWarningInfo = () => {
|
|
|
router.push({
|
|
|
@@ -187,6 +188,14 @@
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
+ const handleViewWarningInfo = (id: number) => {
|
|
|
+ router.push({
|
|
|
+ name: defaultName,
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
const handlePublishWarningInfo = async (id: number, effectState: number) => {
|
|
|
const message = effectState === ACTIVE_STATUS.ACTIVE ? '已取消发布' : '发布成功';
|
|
|
const effectStateStatus = effectState === ACTIVE_STATUS.ACTIVE ? ACTIVE_STATUS.NOT_EFFECTIVE : ACTIVE_STATUS.ACTIVE;
|