diff --git a/super-screen/client/src/sections/fire-control/components/item-right.js b/super-screen/client/src/sections/fire-control/components/item-right.js index 165d68d..3838b9c 100644 --- a/super-screen/client/src/sections/fire-control/components/item-right.js +++ b/super-screen/client/src/sections/fire-control/components/item-right.js @@ -3,60 +3,68 @@ import { Box, AutoRollComponent } from '$components'; import { getName, getPhone } from '$utils'; import './style.less'; -function CitySafty(props) { - const { emengencyTab, emergencyList } = props; - const tab_name = { - xfyjwz: { name: '应急物资', items: [{ key: 'name', name: '名称' }, { key: 'type', name: '类别' }, { key: 'count', name: '数量' }, { key: 'purpose', name: '用途' }] }, - xfjy: { name: '消防救援', items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, - rmwzb: { name: '人民武装部', items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, - yljy: { name: '医疗救援', items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, - yjbns: { name: '应急避难场所', items: [{ key: 'shelterName', name: '场所全称' }, { key: 'address', name: '场所地址' }, { key: 'eventType', name: '事件类型' }, { key: 'capacity', name: '容纳人数' }] }, - } +function CitySafty (props) { + const { emengencyTab, emergencyList } = props; + console.log(1111); + const tab_name = { + xfyjwz: { name: '应急物资', subscript: "物资", img: 'supply', items: [{ key: 'name', name: '名称' }, { key: 'type', name: '类别' }, { key: 'count', name: '数量' }, { key: 'purpose', name: '用途' }] }, + xfjy: { name: '消防救援', subscript: "队伍", img: "fire", items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, + rmwzb: { name: '人民武装部', subscript: "队伍", img: "arm", items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, + yljy: { name: '医疗救援', subscript: "队伍", img: "medical", items: [{ key: 'teamName', name: '队伍名称' }, { key: 'supervisoryUnit', name: '主管单位' }, { key: 'emergencyContactPhone', name: '联系人' }, { key: 'emergencyContactPhone', name: '联系电话' }, { key: 'totalMembers', name: '总人数' }, { key: 'baseAddress', name: '驻地地址' }] }, + yjbns: { name: '应急避难场所', subscript: "场所", img: "refuge", items: [{ key: 'shelterName', name: '场所全称' }, { key: 'address', name: '场所地址' }, { key: 'eventType', name: '事件类型' }, { key: 'capacity', name: '容纳人数' }] }, + } - const getContent = () => { - return
- { - emergencyList[emengencyTab]?.map((s, index) => { - return
-
-
- { - tab_name[emengencyTab]?.items?.map(x => { - let value = s[x.key] || '--' - if (x.name == '联系人' && s[x.key]) { - if (x.key == 'emergencyContactPhone') { - value = value.substring(0, value.length - 11) - } - value = getName(value) - } else if (x.name == '联系电话' && s[x.key]) { - if (x.key == 'emergencyContactPhone') { - value = value.substring(value.length - 11, value.length) - } - value = getPhone(value) - } else if (x.name == '数量' && s[x.key]) { + const getContent = () => { + return
+ { + emergencyList[emengencyTab]?.map((s, index) => { + return
+
+
+ { + tab_name[emengencyTab]?.items?.map(x => { + let value = s[x.key] || '--' + if (x.name == '联系人' && s[x.key]) { + if (x.key == 'emergencyContactPhone') { + value = value.substring(0, value.length - 11) + } + value = getName(value) + } else if (x.name == '联系电话' && s[x.key]) { + if (x.key == 'emergencyContactPhone') { + value = value.substring(value.length - 11, value.length) + } + value = getPhone(value) + } else if (x.name == '数量' && s[x.key]) { - value = s[x.key] + ' ' + s['unit'] - } - return
-
{x.name}
-
{value} - {x.name.indexOf('人数') > -1 && } -
-
- }) - } -
-
场所{index + 1}
-
- }) - } + value = s[x.key] + ' ' + s['unit'] + } + return
+
{x.name}
+
{value} + {x.name.indexOf('人数') > -1 && } +
+
+ }) + } +
+
{tab_name[emengencyTab]?.subscript}{index + 1}
+
+ }) + } -
- } +
+ } - return - 3} content={getContent()} divHeight={860} divId={`fire-left-bottom${emengencyTab}`} /> - + return + 3} content={getContent()} divHeight={860} divId={`fire-left-bottom${emengencyTab}`} /> + } export default CitySafty; diff --git a/super-screen/client/src/sections/water-prevention/components/emergency-right-top.js b/super-screen/client/src/sections/water-prevention/components/emergency-right-top.js index df1a6f9..dbfd449 100644 --- a/super-screen/client/src/sections/water-prevention/components/emergency-right-top.js +++ b/super-screen/client/src/sections/water-prevention/components/emergency-right-top.js @@ -19,11 +19,13 @@ function CitySafty (props) { emergencyList[emengencyTab]?.map((s, index) => { return
-
+
{ tab_name[emengencyTab]?.items?.map(x => { diff --git a/super-screen/client/src/sections/water-prevention/components/style.less b/super-screen/client/src/sections/water-prevention/components/style.less index 9f25f6b..ef92418 100644 --- a/super-screen/client/src/sections/water-prevention/components/style.less +++ b/super-screen/client/src/sections/water-prevention/components/style.less @@ -21,12 +21,12 @@ position: relative; margin-bottom: 20px; - // .item_left { - // width: 50px; - // height: 50px; - // background: url('/assets/images/homepage/fire/iconhome.png') no-repeat; - // background-size: 100% 100%; - // } + .item_left { + width: 50px; + height: 50px; + background: url('/assets/images/homepage/fire/iconhome.png') no-repeat; + background-size: 100% 100%; + } .item_right { width: calc(100% - 100px);