index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <template>
  2. <u-sticky class="shadow-default" bgColor="#fff">
  3. <u-tabs :list="list" :current="current" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }"></u-tabs>
  4. </u-sticky>
  5. <oa-touch class="bg-white informationSelect" @change="touchChange">
  6. <template #content>
  7. <uni-swipe-action>
  8. <uni-swipe-action-item>
  9. <!-- 各类查询 start -->
  10. <view class="tableType3">
  11. <u-input style="margin-bottom: 10px" v-model="dataInput" :placeholder="placeholderText" @blur="blur" shape="circle" prefixIcon="search" prefixIconStyle="color: #0c7bf9"> </u-input>
  12. <u-empty v-if="!dataRes" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
  13. <view v-if="current == 8">
  14. <view class="con">
  15. <view class="time">{{ newTime }}</view>
  16. <video src="https://mbsvod.oss-cn-beijing.aliyuncs.com/cy-video.mp4" autoplay :controls="false" :show-center-play-btn="false" :loop="true" style="width: 100%"></video>
  17. </view>
  18. </view>
  19. <view v-else>
  20. <u-row v-for="po in classifyData" :key="po">
  21. <u-col span="4">
  22. <view style="text-align: right; padding: 0px 5px 0px 5px">{{ po.title }}</view>
  23. </u-col>
  24. <u-col span="8">
  25. <view style="text-align: left; padding: 0px 5px 0px 5px">{{ po.value }}</view>
  26. </u-col>
  27. </u-row>
  28. </view>
  29. </view>
  30. <!-- 各类查询 end -->
  31. </uni-swipe-action-item>
  32. </uni-swipe-action>
  33. </template>
  34. </oa-touch>
  35. </template>
  36. <script setup>
  37. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  38. import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance } from "vue";
  39. import { publicStores, useStores } from "@/store/modules/index";
  40. import { dataList } from "@/api/business/mhxf/informationSelect";
  41. const publicStore = publicStores(); //全局公共Stores
  42. const { proxy } = getCurrentInstance();
  43. const dataInput = ref("");
  44. const current = ref(0);
  45. const classifyUrl = ref("");
  46. const classifyCode = ref("");
  47. const placeholderText = ref("");
  48. const dataRes = ref(1);
  49. const list = ref([
  50. {
  51. id: 1,
  52. name: "警情查询",
  53. },
  54. {
  55. id: 2,
  56. name: "火灾查询",
  57. },
  58. {
  59. id: 3,
  60. name: "人员查询",
  61. badge: {
  62. // isDot: true,
  63. // value: 5,
  64. },
  65. },
  66. {
  67. id: 4,
  68. name: "车辆查询",
  69. badge: {
  70. // value: 5,
  71. },
  72. },
  73. {
  74. id: 5,
  75. name: "站点查询",
  76. badge: {
  77. // value: 5,
  78. },
  79. },
  80. {
  81. id: 6,
  82. name: "消火栓",
  83. badge: {
  84. // value: 5,
  85. },
  86. },
  87. {
  88. id: 7,
  89. name: "重点单位",
  90. badge: {
  91. // value: 5,
  92. },
  93. },
  94. {
  95. id: 8,
  96. name: "消防检查信息",
  97. badge: {
  98. // value: 5,
  99. },
  100. },
  101. {
  102. id: 9,
  103. name: "视频监控",
  104. badge: {
  105. // value: 5,
  106. },
  107. },
  108. ]);
  109. /**
  110. * @滑动change事件
  111. */
  112. function touchChange(e) {
  113. if (e == "右滑") {
  114. if (current.value >= 1) {
  115. current.value--;
  116. } else {
  117. current.value = list.value.length - 1;
  118. }
  119. } else if (e == "左滑") {
  120. if (current.value < list.value.length - 1) {
  121. current.value++;
  122. } else {
  123. current.value = 0;
  124. }
  125. }
  126. }
  127. function blur(e) {
  128. if (dataInput.value) {
  129. goSearch();
  130. }
  131. }
  132. /**
  133. * @tabs点击事件
  134. */
  135. function tabsClick(e) {
  136. current.value = e.index;
  137. console.log(current.value);
  138. dataInput.value = "";
  139. dataRes.value = 1;
  140. }
  141. function goSearch() {
  142. if (current.value == 0) {
  143. //警情查询
  144. classifyUrl.value = "/service-fire/demPoliceInfo/page";
  145. placeholderText.value = "请输入案件编号";
  146. classifySearch(classifyUrl.value, {
  147. caseCode: dataInput.value,
  148. });
  149. } else if (current.value == 1) {
  150. //火灾查询
  151. placeholderText.value = "请输入火灾地址";
  152. classifyUrl.value = "/service-fire/demFireStatisticsAttach/page";
  153. classifySearch(classifyUrl.value, {
  154. address: dataInput.value,
  155. });
  156. } else if (current.value == 2) {
  157. //人员查询
  158. placeholderText.value = "请输入值班人员名称";
  159. classifyUrl.value = "/service-fire/unitBeOnDuty/list";
  160. classifySearch(classifyUrl.value, {
  161. name: dataInput.value,
  162. });
  163. } else if (current.value == 3) {
  164. //车辆信息
  165. placeholderText.value = "请输入车牌号";
  166. classifyUrl.value = "/service-fire/unitBeOnDuty/vehiclelist";
  167. classifySearch(classifyUrl.value, {
  168. licensePlate: dataInput.value,
  169. });
  170. } else if (current.value == 4) {
  171. //站点查询
  172. placeholderText.value = "请输入站点名称";
  173. classifyUrl.value = "/service-fire/unitBeOnDuty/page";
  174. classifySearch(classifyUrl.value, {
  175. stationName: dataInput.value,
  176. });
  177. } else if (current.value == 5) {
  178. //消火栓
  179. placeholderText.value = "请输入水源名称";
  180. classifyUrl.value = "/service-fire/demWaterSource/waterSourceList";
  181. classifySearch(classifyUrl.value, {
  182. waterName: dataInput.value,
  183. });
  184. } else if (current.value == 6) {
  185. //重点单位
  186. placeholderText.value = "请输入单位名称";
  187. classifyUrl.value = "/service-fire/baseCompany/companyList";
  188. classifySearch(classifyUrl.value, {
  189. companyName: dataInput.value,
  190. });
  191. } else if (current.value == 7) {
  192. //消防检查信息
  193. placeholderText.value = "请输入单位ID";
  194. classifyUrl.value = "/service-fire/demFireInspect/fireInspectList";
  195. classifySearch(classifyUrl.value, {
  196. companyId: dataInput.value,
  197. });
  198. } else if (current.value == 8) {
  199. //消防检查信息
  200. placeholderText.value = "";
  201. // classifyUrl.value = "/service-fire/demFireInspect/fireInspectList";
  202. // classifySearch(classifyUrl.value, {
  203. // companyId: dataInput.value,
  204. // });
  205. }
  206. }
  207. //分类信息查询 start
  208. async function classifySearch(URL, params) {
  209. proxy.$modal.loading("加载中");
  210. classifyData.value = [];
  211. dataList(URL, params).then((res) => {
  212. proxy.$modal.closeLoading();
  213. if (res.status == "SUCCESS") {
  214. if (current.value == 2) {
  215. if (res.data.length) {
  216. dataRes.value = 1;
  217. } else {
  218. dataRes.value = 0;
  219. }
  220. var records = res.data[0][0];
  221. } else if (current.value == 3) {
  222. if (res.data.length) {
  223. dataRes.value = 1;
  224. } else {
  225. dataRes.value = 0;
  226. }
  227. var records = res.data[0];
  228. } else {
  229. // console.log('111111111')
  230. // console.log(res.data.records.length)
  231. // console.log('111222')
  232. if (res.data.total) {
  233. dataRes.value = 1;
  234. } else {
  235. dataRes.value = 0;
  236. }
  237. var records = res.data.records[0];
  238. }
  239. console.log(dataRes.value + "------1");
  240. switch (current.value) {
  241. case 0: //警情查询
  242. var classifyTitle = [
  243. "案件编号",
  244. "主管支队",
  245. "案件时间段",
  246. "通知到场时间",
  247. "通知出水时间",
  248. "通知控制时间",
  249. "通知熄火时间",
  250. "通知返队时间",
  251. "区域",
  252. "案件类型",
  253. "案发地址",
  254. "立案时间",
  255. "立案日期",
  256. "处置对象",
  257. "案件等级",
  258. "主管中队",
  259. "区县",
  260. "案件状态",
  261. "案件性质",
  262. "填表时间",
  263. "街镇",
  264. "创建时间",
  265. ];
  266. var classifyValue = [
  267. records.caseCode,
  268. records.branch,
  269. records.timeSlot,
  270. records.noticeArrivalTime,
  271. records.noticeEffluentTime,
  272. records.controlTime,
  273. records.quenchTime,
  274. records.returnTime,
  275. records.caseArea,
  276. records.caseTypeCode,
  277. records.address,
  278. records.filingTime,
  279. records.filingDate,
  280. records.handleObject,
  281. records.caseLevel,
  282. records.squadron,
  283. records.district,
  284. records.caseStatus,
  285. records.caseNature,
  286. records.bdpAudit,
  287. records.streetTown,
  288. records.createTime,
  289. ];
  290. break;
  291. case 1: //火灾查询
  292. var classifyTitle = [
  293. "地区",
  294. "街镇",
  295. "经度",
  296. "维度",
  297. "平台ID",
  298. "火灾地址",
  299. "过火面积",
  300. "直接财产损失",
  301. "死亡人数",
  302. "受伤人数",
  303. "受灾户数",
  304. "火灾原因",
  305. "火灾等级",
  306. "场所一级",
  307. "场所二级",
  308. "起火物一级",
  309. "起火物二级",
  310. "性质",
  311. ];
  312. var classifyValue = [
  313. records.district,
  314. records.street,
  315. records.longitude,
  316. records.latitude,
  317. records.id,
  318. records.address,
  319. records.burnedArea,
  320. records.propertyLoss,
  321. records.deathToll,
  322. records.nonFatal,
  323. records.disasterHome,
  324. records.fireCause,
  325. records.fireLevel,
  326. records.placeOne,
  327. records.placeTwo,
  328. records.fireGoodsOne,
  329. records.fireGoodsTwo,
  330. records.nature,
  331. ];
  332. break;
  333. case 2: //人员查询
  334. var classifyTitle = ["值班人员信息", "岗位名称", "机构名称", "机构简称", "机构地址", "值班日期"];
  335. var classifyValue = [records.name, records.postName, records.organizationName, records.organizationShort, records.organizationAddress, records.time];
  336. break;
  337. case 3: //车辆查询
  338. var classifyTitle = [
  339. "车辆信息",
  340. "单件装备编码",
  341. "装备名称",
  342. "装备编码",
  343. "上级装备编码",
  344. "所属消防机构",
  345. "车牌号码",
  346. "资产编号",
  347. "商标",
  348. "颜色",
  349. "生产厂家名称",
  350. "有效期至",
  351. "车架号",
  352. "发动机编号",
  353. "批次号",
  354. "电台呼号",
  355. "车辆简称",
  356. "电台频道",
  357. "指挥员姓名",
  358. "驾驶员",
  359. ];
  360. var classifyValue = [
  361. records.vehicleId,
  362. records.singleEquipCode,
  363. records.equipName,
  364. records.equipCode,
  365. records.superiorEquipCode,
  366. records.fireOrga,
  367. records.licensePlate,
  368. records.assetCode,
  369. records.assetCode,
  370. records.colour,
  371. records.productName,
  372. records.validityTime,
  373. records.frameCode,
  374. records.engineCode,
  375. records.batchCode,
  376. records.radioCallSign,
  377. records.vehicleAbbreviat,
  378. records.radioChannel,
  379. records.commanderName,
  380. records.driver,
  381. ];
  382. break;
  383. case 4: //站点查询
  384. var classifyTitle = [
  385. "平台ID",
  386. "支队名称",
  387. "所属辖区中队",
  388. "消防站名称",
  389. "单位性质",
  390. "地址",
  391. "所在位置",
  392. "联动固定电话",
  393. "负责人姓名",
  394. "负责人手机号码",
  395. "备注",
  396. "消防站类型",
  397. "经度",
  398. "维度",
  399. "创建时间",
  400. "更新时间",
  401. "支队id",
  402. "中队id",
  403. "编号",
  404. "原单位性质",
  405. ];
  406. var classifyValue = [
  407. records.id,
  408. records.branchName,
  409. records.squadron,
  410. records.stationName,
  411. records.companyNature,
  412. records.address,
  413. records.location,
  414. records.fixedPhone,
  415. records.chargeName,
  416. records.chargePhone,
  417. records.remark,
  418. records.stationType,
  419. records.longitude,
  420. records.dimension,
  421. records.createTime,
  422. records.updateTime,
  423. records.branchId,
  424. records.squadronId,
  425. records.number,
  426. records.primaryCompanyNature,
  427. ];
  428. break;
  429. case 5: //消火栓
  430. var classifyTitle = [
  431. "可用状态名称",
  432. "消防站简介",
  433. "水源地址",
  434. "建造时间",
  435. "消火栓接口形式",
  436. "水源类型",
  437. "管辖机构名称",
  438. "取水形式",
  439. "联系方式",
  440. "可用状态",
  441. "水源性质",
  442. "水源名称",
  443. "管网单位",
  444. "管网压力",
  445. ];
  446. var classifyValue = [
  447. records.availableStatusName,
  448. records.fireAbbreviat,
  449. records.waterAddress,
  450. records.buildTime,
  451. records.hydrantInterface,
  452. records.waterType,
  453. records.organizateName,
  454. records.waterForm,
  455. records.contactMode,
  456. records.availableStatus,
  457. records.waterNature,
  458. records.waterName,
  459. records.pipeCompany,
  460. records.pipePressure,
  461. ];
  462. break;
  463. case 6: //重点单位
  464. var classifyTitle = [
  465. "单位联系电话",
  466. "单位详细地址",
  467. "职工人数",
  468. "单位类型",
  469. "消防安全责任人姓名",
  470. "法人代表姓名",
  471. "单位名称",
  472. "消防安全管理人姓名",
  473. "单位主属性",
  474. "建筑面积",
  475. "行政区域",
  476. "单位成立时间",
  477. "占地面积",
  478. "火灾危险性",
  479. "创建时间",
  480. "单位性质",
  481. "固定资产(单位:万元)",
  482. ];
  483. var classifyValue = [
  484. records.linkPhone,
  485. records.address,
  486. records.employeeNum,
  487. records.companyType,
  488. records.fireDutyName,
  489. records.delegateName,
  490. records.companyName,
  491. records.fireManageName,
  492. records.mainAttribute,
  493. records.buildArea,
  494. records.administrativeDivision,
  495. records.foundTimecoverArea,
  496. records.coverArea,
  497. records.fireHazard,
  498. records.createTime,
  499. records.companyNature,
  500. records.fixedAssets,
  501. ];
  502. break;
  503. case 7: //消防检查信息
  504. var classifyTitle = ["单位ID", "检查人员ID", "计划生成时间", "检查结果", "创建人", "创建时间", "检查员名称", "检查员职位", "单位电话"];
  505. var classifyValue = [
  506. records.companyId,
  507. records.personId,
  508. records.planTime,
  509. records.inspectResult,
  510. records.creator,
  511. records.createTime,
  512. records.personName,
  513. records.personPosition,
  514. records.linkPhone,
  515. ];
  516. break;
  517. // default:
  518. // 默认代码块
  519. }
  520. for (var i = 0; i < classifyTitle.length; i++) {
  521. var obj = {};
  522. obj.title = classifyTitle[i];
  523. obj.value = classifyValue[i];
  524. classifyData.value.push(obj);
  525. // console.log(classifyData.value);
  526. }
  527. } else {
  528. }
  529. });
  530. }
  531. // end
  532. watchEffect(() => {
  533. goSearch();
  534. });
  535. // start
  536. const newTime = ref("");
  537. function getNowTime() {
  538. var date = new Date();
  539. var time =
  540. addZero(date.getFullYear()) +
  541. "-" +
  542. addZero(date.getMonth() + 1) +
  543. "-" +
  544. addZero(date.getDate()) +
  545. " " +
  546. addZero(date.getHours()) +
  547. ":" +
  548. addZero(date.getMinutes()) +
  549. ":" +
  550. addZero(date.getSeconds());
  551. newTime.value = time;
  552. }
  553. //根据自己的需求,看要不要在时间不大于10的时候在前面补0,如果需要直接addZero(date.getMinutes()),其它与之相同,如果不需要删掉addZero()方法即可。
  554. //小于10的拼接上0字符串
  555. function addZero(s) {
  556. return s < 10 ? "0" + s : s;
  557. }
  558. // end
  559. // 自定义导航事件
  560. onNavigationBarButtonTap((e) => {
  561. if (e.float == "right") {
  562. uni.navigateTo({
  563. url: "/pages/business/mhxf/xunJian/collect/components/collectRecord",
  564. });
  565. } else {
  566. }
  567. });
  568. onLoad((options) => {
  569. getNowTime(); //进入页面调用该方法获取当前时间
  570. clearInterval(myTimeDisplay); //销毁之前定时器
  571. var myTimeDisplay = setInterval(() => {
  572. getNowTime(); //每秒更新一次时间
  573. }, 1000);
  574. });
  575. onReady(() => {});
  576. onMounted(() => {});
  577. </script>
  578. <style lang="scss">
  579. .uni-swipe {
  580. overflow: visible;
  581. }
  582. body {
  583. background: #fff;
  584. }
  585. .is-selected {
  586. color: #1989fa;
  587. }
  588. .informationSelect {
  589. height: calc(100vh - 88px);
  590. background-color: #ffffff;
  591. .content {
  592. padding: 10px;
  593. .u-row {
  594. height: 36px;
  595. line-height: 36px;
  596. .u-col {
  597. border: 1px #e4e3e3 solid;
  598. border-right: 0px;
  599. border-bottom: 0px;
  600. text-align: center;
  601. view {
  602. padding: 0 10px;
  603. min-height: 36px;
  604. overflow: hidden; //超出的文本隐藏
  605. // text-overflow: ellipsis; //溢出用省略号显示
  606. overflow: auto;
  607. white-space: nowrap; // 默认不换行;
  608. font-size: 14px;
  609. }
  610. }
  611. .u-col:last-child {
  612. border-right: 1px #e4e3e3 solid;
  613. }
  614. }
  615. .u-row:last-child {
  616. .u-col {
  617. border-bottom: 1px #e4e3e3 solid;
  618. }
  619. }
  620. }
  621. }
  622. </style>
  623. <style scoped>
  624. body,
  625. uni-page-body,
  626. uni-page-refresh,
  627. .grayBackgroundColor {
  628. background: rgb(241, 241, 241);
  629. }
  630. .time {
  631. position: absolute;
  632. z-index: 99999;
  633. top: 3px;
  634. left: 3px;
  635. display: inline-block;
  636. color: #fff;
  637. }
  638. .con {
  639. text-align: center;
  640. position: relative;
  641. }
  642. .bg-white {
  643. background-color: #ffffff;
  644. }
  645. body {
  646. background: #fff;
  647. }
  648. </style>