index.vue 17 KB

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