taskBoardAddress.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <view class="taskBoardAddress">
  3. <!-- 查看巡检点详情时隐藏本页导航栏,由详情页展示自己的标题与返回键 -->
  4. <u-navbar
  5. v-if="!toComponent"
  6. :title="gasTitle"
  7. :safeAreaInsetTop="true"
  8. :fixed="true"
  9. height="50px"
  10. bgColor="#afc3fc"
  11. leftIcon="arrow-left"
  12. @leftClick="handlerToggle"
  13. >
  14. </u-navbar>
  15. <view>
  16. <u-button
  17. v-if="showBtn"
  18. icon="eye"
  19. type="primary"
  20. size="small"
  21. loadingText="识别中"
  22. style="width: 100%; margin-top: 20px"
  23. @click="getYjsb"
  24. >一键识别</u-button
  25. >
  26. </view>
  27. <u-list :height="666" :scrollTop="topH" v-if="isShow">
  28. <u-list-item v-for="(item, index) in indexList" :key="index">
  29. <u-cell icon="share">
  30. <view slot="title" class="u-slot-title">
  31. <text class="u-cell-text">{{
  32. `${item.deviceName} (${
  33. item.checkNum == "1"
  34. ? "第一次"
  35. : item.checkNum == "2"
  36. ? "第二次"
  37. : ""
  38. })`
  39. }}</text>
  40. <!-- <u-tag text="查看" plain size="mini" type="warning">
  41. </u-tag> -->
  42. </view>
  43. <view slot="value" style="display: flex; align-items: center">
  44. <u-icon
  45. :name="item.checkState == '0' ? 'plus' : 'checkmark'"
  46. size="16"
  47. @click="getBoradAddress(item, index)"
  48. ></u-icon>
  49. <u-icon
  50. v-if="item.zcShow"
  51. style="margin-left: 10px"
  52. name="photo"
  53. size="16"
  54. ></u-icon>
  55. </view>
  56. </u-cell>
  57. </u-list-item>
  58. </u-list>
  59. <!-- 一键识别List -->
  60. <view v-if="sbShow">
  61. <Recognition
  62. :recognitionData="recognitionData"
  63. @getRepport="getRepport"
  64. ></Recognition>
  65. </view>
  66. <component
  67. :is="toComponent"
  68. :Ids="Ids"
  69. :checkNum="checkNum"
  70. :classType="classType"
  71. :isSensor="isSensor"
  72. :deviceID="deviceID"
  73. :deviceName="deviceName"
  74. :saveImg="saveImg"
  75. :checkState="checkState"
  76. :sbData="sbData"
  77. :urlData="urlData"
  78. @getBackAddress="getBackAddress"
  79. @clearImg="clearImg"
  80. >
  81. </component>
  82. </view>
  83. </template>
  84. <script>
  85. import api from "@/api/api";
  86. import gasImgIdentify from "./gasImgIdentify.vue";
  87. import Recognition from "./Recognition.vue";
  88. export default {
  89. name: "taskBoardAddress",
  90. components: { gasImgIdentify, Recognition },
  91. props: {
  92. taskId: {
  93. type: String,
  94. default: "",
  95. },
  96. },
  97. data() {
  98. return {
  99. saveImg: "",
  100. // imgList: [],
  101. topH: 0,
  102. activeIndex: 0,
  103. Ids: "",
  104. checkNum: "", //巡检次数
  105. classType: "",
  106. isSensor: "",
  107. deviceID: "",
  108. deviceName: "",
  109. checkState: "",
  110. isShow: true,
  111. toComponent: "",
  112. indexList: [],
  113. gasTitle: "任务明细", //标题
  114. sbShow: false,
  115. sbData: [],
  116. urlData: "",
  117. showBtn: true,
  118. };
  119. },
  120. computed: {
  121. searchTime: function () {
  122. return uni.getStorageSync("searchTime");
  123. },
  124. //一键识别列表
  125. recognitionData: function () {
  126. let list = [];
  127. this.indexList.forEach((el) => {
  128. if (uni.getStorageSync(el.deviceId)) {
  129. el.img = uni.getStorageSync(el.deviceId);
  130. el.status = "";
  131. list.push(el);
  132. }
  133. });
  134. return list;
  135. },
  136. },
  137. mounted() {
  138. this.taskDetailsLists();
  139. },
  140. methods: {
  141. //点击返回上一级
  142. handlerToggle() {
  143. this.$emit("getBackBoard");
  144. },
  145. //暂存图片预览
  146. // getView(item) {
  147. // let imgList = []
  148. // imgList.push(uni.getStorageSync(item.deviceId))
  149. // // 预览图片
  150. // uni.previewImage({
  151. // urls: imgList,
  152. // current: 0
  153. // });
  154. // },
  155. //清除暂存图片
  156. clearImg(data) {
  157. if (data) {
  158. this.saveImg = "";
  159. }
  160. },
  161. //一键识别
  162. getYjsb() {
  163. let that = this;
  164. that.isShow = false;
  165. that.sbShow = true;
  166. that.showBtn = false;
  167. if (that.recognitionData.length != 0) {
  168. uni.showLoading({
  169. title: "批量识别中...",
  170. mask: true,
  171. });
  172. }
  173. },
  174. //批量识别后跳转到填报页面
  175. getRepport(param) {
  176. let that = this;
  177. that.sbShow = false;
  178. that.showBtn = false;
  179. console.log(param, "param------");
  180. that.Ids = param.id;
  181. that.checkNum = param.checkNum;
  182. that.classType = param.classType_dictText;
  183. that.checkState = param.checkState;
  184. that.isSensor = param.isSensor;
  185. that.deviceID = param.deviceId;
  186. that.deviceName = param.deviceName;
  187. that.sbData = param.sbList;
  188. that.urlData = param.img;
  189. that.toComponent = "gasImgIdentify";
  190. },
  191. getBoradAddress(item, index) {
  192. let that = this;
  193. that.activeIndex = index;
  194. that.isShow = false;
  195. that.showBtn = false;
  196. if (item.checkState == "0") {
  197. that.Ids = item.id;
  198. that.isSensor = item.isSensor;
  199. }
  200. that.checkNum = item.checkNum;
  201. that.classType = item.classType_dictText;
  202. that.checkState = item.checkState;
  203. that.deviceID = item.deviceId;
  204. that.deviceName = item.deviceName;
  205. that.saveImg = uni.getStorageSync(item.deviceId);
  206. that.toComponent = "gasImgIdentify";
  207. },
  208. getBackAddress() {
  209. this.isShow = true;
  210. this.showBtn = true;
  211. this.sbShow = false;
  212. this.toComponent = "";
  213. this.urlData = "";
  214. this.topH = 39 * this.activeIndex;
  215. this.taskDetailsLists();
  216. },
  217. taskDetailsLists() {
  218. let that = this;
  219. new Promise((resolve, reject) => {
  220. api
  221. .taskDetailsList({
  222. pageNo: 1,
  223. pageSize: 100,
  224. taskId: that.taskId,
  225. taskTime: that.searchTime,
  226. })
  227. .then((response) => {
  228. if (response.data.code == 200) {
  229. console.log(response, "地点列表---");
  230. // that.indexList = response.data.result.records || [];
  231. that.indexList = [
  232. {
  233. id: "2117091338227367937",
  234. taskTime: "2026-11-02",
  235. deviceId: "2117091338189619201",
  236. deviceName: "12406胶运顺槽掘进工作面风流",
  237. checkNum: "1",
  238. taskId: "2117091338147676162",
  239. checkState: "0",
  240. isSensor: "1",
  241. checkReg: "12406胶运顺槽掘进工作面",
  242. checkPerson: null,
  243. sysOrgCode: "A02A02",
  244. orgCode: null,
  245. createBy: "admin",
  246. createTime: "2026-11-02 11:08:03",
  247. updateBy: null,
  248. updateTime: null,
  249. orderNum: 1,
  250. taskName: "夜班瓦检10.1 (1)",
  251. classType: "night",
  252. classType_dictText: "晚班",
  253. },
  254. {
  255. id: "2117091338294476802",
  256. taskTime: "2026-11-02",
  257. deviceId: "2117091338248339458",
  258. deviceName: "12406胶运顺槽掘进工作面回风流",
  259. checkNum: "1",
  260. taskId: "2117091338147676162",
  261. checkState: "0",
  262. isSensor: "1",
  263. checkReg: "12406胶运顺槽掘进工作面",
  264. checkPerson: null,
  265. sysOrgCode: "A02A02",
  266. orgCode: null,
  267. createBy: "admin",
  268. createTime: "2026-11-02 11:08:03",
  269. updateBy: null,
  270. updateTime: null,
  271. orderNum: 2,
  272. taskName: "夜班瓦检10.1 (1)",
  273. classType: "night",
  274. classType_dictText: "晚班",
  275. },
  276. {
  277. id: "2117091338349002753",
  278. taskTime: "2026-11-02",
  279. deviceId: "2117091338319642626",
  280. deviceName: "22煤新建南回风井下部",
  281. checkNum: "1",
  282. taskId: "2117091338147676162",
  283. checkState: "0",
  284. isSensor: "0",
  285. checkReg: "22煤系统",
  286. checkPerson: null,
  287. sysOrgCode: "A02A02",
  288. orgCode: null,
  289. createBy: "admin",
  290. createTime: "2026-11-02 11:08:03",
  291. updateBy: null,
  292. updateTime: null,
  293. orderNum: 3,
  294. taskName: "夜班瓦检10.1 (1)",
  295. classType: "night",
  296. classType_dictText: "晚班",
  297. },
  298. {
  299. id: "2117091338420305922",
  300. taskTime: "2026-11-02",
  301. deviceId: "2117091338390945794",
  302. deviceName: "22煤新建南进风井下部",
  303. checkNum: "1",
  304. taskId: "2117091338147676162",
  305. checkState: "0",
  306. isSensor: "0",
  307. checkReg: "22煤系统",
  308. checkPerson: null,
  309. sysOrgCode: "A02A02",
  310. orgCode: null,
  311. createBy: "admin",
  312. createTime: "2026-11-02 11:08:03",
  313. updateBy: null,
  314. updateTime: null,
  315. orderNum: 4,
  316. taskName: "夜班瓦检10.1 (1)",
  317. classType: "night",
  318. classType_dictText: "晚班",
  319. },
  320. {
  321. id: "2117091338470637569",
  322. taskTime: "2026-11-02",
  323. deviceId: "2117091338449666050",
  324. deviceName: "22煤北翼辅运顶头",
  325. checkNum: "1",
  326. taskId: "2117091338147676162",
  327. checkState: "0",
  328. isSensor: "0",
  329. checkReg: "22煤系统",
  330. checkPerson: null,
  331. sysOrgCode: "A02A02",
  332. orgCode: null,
  333. createBy: "admin",
  334. createTime: "2026-11-02 11:08:03",
  335. updateBy: null,
  336. updateTime: null,
  337. orderNum: 5,
  338. taskName: "夜班瓦检10.1 (1)",
  339. classType: "night",
  340. classType_dictText: "晚班",
  341. },
  342. {
  343. id: "2117091338529357825",
  344. taskTime: "2026-11-02",
  345. deviceId: "2117091338499997698",
  346. deviceName: "22煤北翼集中辅运巷2联",
  347. checkNum: "1",
  348. taskId: "2117091338147676162",
  349. checkState: "0",
  350. isSensor: "0",
  351. checkReg: "22煤北翼集中主、辅运巷",
  352. checkPerson: null,
  353. sysOrgCode: "A02A02",
  354. orgCode: null,
  355. createBy: "admin",
  356. createTime: "2026-11-02 11:08:03",
  357. updateBy: null,
  358. updateTime: null,
  359. orderNum: 6,
  360. taskName: "夜班瓦检10.1 (1)",
  361. classType: "night",
  362. classType_dictText: "晚班",
  363. },
  364. {
  365. id: "2117091338571300865",
  366. taskTime: "2026-11-02",
  367. deviceId: "2117091338550329346",
  368. deviceName: "22煤北翼集中辅运巷6联水仓",
  369. checkNum: "1",
  370. taskId: "2117091338147676162",
  371. checkState: "0",
  372. isSensor: "0",
  373. checkReg: "22煤北翼集中主、辅运巷",
  374. checkPerson: null,
  375. sysOrgCode: "A02A02",
  376. orgCode: null,
  377. createBy: "admin",
  378. createTime: "2026-11-02 11:08:03",
  379. updateBy: null,
  380. updateTime: null,
  381. orderNum: 7,
  382. taskName: "夜班瓦检10.1 (1)",
  383. classType: "night",
  384. classType_dictText: "晚班",
  385. },
  386. {
  387. id: "2117091338630021122",
  388. taskTime: "2026-11-02",
  389. deviceId: "2117091338604855298",
  390. deviceName: "12404综采工作面进风流",
  391. checkNum: "1",
  392. taskId: "2117091338147676162",
  393. checkState: "0",
  394. isSensor: "0",
  395. checkReg: "12404综采工作面",
  396. checkPerson: null,
  397. sysOrgCode: "A02A02",
  398. orgCode: null,
  399. createBy: "admin",
  400. createTime: "2026-11-02 11:08:03",
  401. updateBy: null,
  402. updateTime: null,
  403. orderNum: 8,
  404. taskName: "夜班瓦检10.1 (1)",
  405. classType: "night",
  406. classType_dictText: "晚班",
  407. },
  408. {
  409. id: "2117091338692935682",
  410. taskTime: "2026-11-02",
  411. deviceId: "2117091338667769858",
  412. deviceName: "12404综采工作面风流",
  413. checkNum: "1",
  414. taskId: "2117091338147676162",
  415. checkState: "0",
  416. isSensor: "1",
  417. checkReg: "12404综采工作面",
  418. checkPerson: null,
  419. sysOrgCode: "A02A02",
  420. orgCode: null,
  421. createBy: "admin",
  422. createTime: "2026-11-02 11:08:03",
  423. updateBy: null,
  424. updateTime: null,
  425. orderNum: 9,
  426. taskName: "夜班瓦检10.1 (1)",
  427. classType: "night",
  428. classType_dictText: "晚班",
  429. },
  430. {
  431. id: "2117091338747461634",
  432. taskTime: "2026-11-02",
  433. deviceId: "2117091338722295809",
  434. deviceName: "12404综采工作面回风隅角",
  435. checkNum: "1",
  436. taskId: "2117091338147676162",
  437. checkState: "0",
  438. isSensor: "1",
  439. checkReg: "12404综采工作面",
  440. checkPerson: null,
  441. sysOrgCode: "A02A02",
  442. orgCode: null,
  443. createBy: "admin",
  444. createTime: "2026-11-02 11:08:03",
  445. updateBy: null,
  446. updateTime: null,
  447. orderNum: 10,
  448. taskName: "夜班瓦检10.1 (1)",
  449. classType: "night",
  450. classType_dictText: "晚班",
  451. },
  452. ];
  453. if (that.indexList.length != 0) {
  454. that.indexList.forEach((el) => {
  455. if (uni.getStorageSync(el.deviceId)) {
  456. el.zcShow = true;
  457. } else {
  458. el.zcShow = false;
  459. }
  460. });
  461. }
  462. } else {
  463. reject(response);
  464. }
  465. })
  466. .catch((error) => {
  467. console.log("catch===>response", response);
  468. reject(error);
  469. });
  470. });
  471. },
  472. },
  473. };
  474. </script>
  475. <style lang="scss" scoped>
  476. .taskBoardAddress {
  477. position: relative;
  478. width: 100%;
  479. height: 100%;
  480. padding: 0px 10px;
  481. box-sizing: border-box;
  482. }
  483. ::v-deep .u-slot-title {
  484. display: flex;
  485. }
  486. </style>