|
@@ -1,5 +1,5 @@
|
|
import Card from '@/components/Card';
|
|
import Card from '@/components/Card';
|
|
-import { defineComponent } from 'vue-demi';
|
|
|
|
|
|
+import { computed, defineComponent } from 'vue-demi';
|
|
|
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
import IconLevel from '@/assets/icons/detail/level@2x.png';
|
|
import IconLevel from '@/assets/icons/detail/level@2x.png';
|
|
@@ -9,9 +9,9 @@ import IconSource from '@/assets/icons/detail/source@2x.png';
|
|
import IconStyle from '@/assets/icons/detail/style@2x.png';
|
|
import IconStyle from '@/assets/icons/detail/style@2x.png';
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
import IconTitle from '@/assets/icons/detail/title@2x.png';
|
|
import IconTitle from '@/assets/icons/detail/title@2x.png';
|
|
-import { useIncidentStore } from '@/store';
|
|
|
|
|
|
+import { useCommonStore, useIncidentStore } from '@/store';
|
|
|
|
|
|
-const list = [
|
|
|
|
|
|
+const listss = [
|
|
{ label: '事件标题', icon: IconTitle, prop: 'name' as const },
|
|
{ label: '事件标题', icon: IconTitle, prop: 'name' as const },
|
|
{ label: '事件类型', icon: IconStyle, prop: 'type' as const },
|
|
{ label: '事件类型', icon: IconStyle, prop: 'type' as const },
|
|
{ label: '事件来源', icon: IconSource, prop: 'source' as const },
|
|
{ label: '事件来源', icon: IconSource, prop: 'source' as const },
|
|
@@ -22,19 +22,55 @@ export default defineComponent({
|
|
name: 'IncidentInfoCard',
|
|
name: 'IncidentInfoCard',
|
|
setup(props) {
|
|
setup(props) {
|
|
const store = useIncidentStore();
|
|
const store = useIncidentStore();
|
|
|
|
+ const commonStore = useCommonStore();
|
|
|
|
+ const list = computed(() => [
|
|
|
|
+ {
|
|
|
|
+ label: '事件标题',
|
|
|
|
+ icon: IconTitle,
|
|
|
|
+ prop: 'name' as const,
|
|
|
|
+ value: store.incidentDetail?.baseInfo?.name,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '事件类型',
|
|
|
|
+ icon: IconStyle,
|
|
|
|
+ prop: 'type' as const,
|
|
|
|
+ dict: 'zhdd_incident_type' as const,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '事件来源',
|
|
|
|
+ icon: IconSource,
|
|
|
|
+ prop: 'source' as const,
|
|
|
|
+ dict: 'zhdd_incident_source' as const,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '事件等级',
|
|
|
|
+ icon: IconLevel,
|
|
|
|
+ prop: 'level' as const,
|
|
|
|
+ dict: 'zhdd_incident_level' as const,
|
|
|
|
+ },
|
|
|
|
+ ]);
|
|
|
|
|
|
return () => (
|
|
return () => (
|
|
<Card cardType="incident-info">
|
|
<Card cardType="incident-info">
|
|
<div class="info-container">
|
|
<div class="info-container">
|
|
- {list.map((item, idx) => (
|
|
|
|
|
|
+ {list.value.map((item, idx) => (
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
<div class="info-item-lebel" data-idx={idx}>
|
|
<div class="info-item-lebel" data-idx={idx}>
|
|
<img src={item.icon} alt={item.label} />
|
|
<img src={item.icon} alt={item.label} />
|
|
- <span>事件标题</span>
|
|
|
|
|
|
+ <span>{item.label}</span>
|
|
</div>
|
|
</div>
|
|
<div class="info-item-value">
|
|
<div class="info-item-value">
|
|
- {store.incidentDetail?.baseInfo?.[item.prop] ??
|
|
|
|
- item.label + 'xxxx x x '}
|
|
|
|
|
|
+ {(item.value
|
|
|
|
+ ? item.value
|
|
|
|
+ : item.dict &&
|
|
|
|
+ commonStore.globalDict[item.dict]?.find(
|
|
|
|
+ (i) =>
|
|
|
|
+ i.dictValue?.toString() ===
|
|
|
|
+ (
|
|
|
|
+ store.incidentDetail?.baseInfo
|
|
|
|
+ ?.type as unknown as string
|
|
|
|
+ )?.toString(),
|
|
|
|
+ )?.dictLabel) ?? '-'}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
))}
|
|
))}
|