index.vue 15 KB

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