| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- <template>
- <view class="taskBoardAddress">
- <!-- 查看巡检点详情时隐藏本页导航栏,由详情页展示自己的标题与返回键 -->
- <u-navbar
- v-if="!toComponent"
- :title="gasTitle"
- :safeAreaInsetTop="true"
- :fixed="true"
- height="50px"
- bgColor="#afc3fc"
- leftIcon="arrow-left"
- @leftClick="handlerToggle"
- >
- </u-navbar>
- <view>
- <u-button
- v-if="showBtn"
- icon="eye"
- type="primary"
- size="small"
- loadingText="识别中"
- style="width: 100%; margin-top: 20px"
- @click="getYjsb"
- >一键识别</u-button
- >
- </view>
- <u-list :height="666" :scrollTop="topH" v-if="isShow">
- <u-list-item v-for="(item, index) in indexList" :key="index">
- <u-cell icon="share">
- <view slot="title" class="u-slot-title">
- <text class="u-cell-text">{{
- `${item.deviceName} (${
- item.checkNum == "1"
- ? "第一次"
- : item.checkNum == "2"
- ? "第二次"
- : ""
- })`
- }}</text>
- <!-- <u-tag text="查看" plain size="mini" type="warning">
- </u-tag> -->
- </view>
- <view slot="value" style="display: flex; align-items: center">
- <u-icon
- :name="item.checkState == '0' ? 'plus' : 'checkmark'"
- size="16"
- @click="getBoradAddress(item, index)"
- ></u-icon>
- <u-icon
- v-if="item.zcShow"
- style="margin-left: 10px"
- name="photo"
- size="16"
- ></u-icon>
- </view>
- </u-cell>
- </u-list-item>
- </u-list>
- <!-- 一键识别List -->
- <view v-if="sbShow">
- <Recognition
- :recognitionData="recognitionData"
- @getRepport="getRepport"
- ></Recognition>
- </view>
- <component
- :is="toComponent"
- :Ids="Ids"
- :checkNum="checkNum"
- :classType="classType"
- :isSensor="isSensor"
- :deviceID="deviceID"
- :deviceName="deviceName"
- :saveImg="saveImg"
- :checkState="checkState"
- :sbData="sbData"
- :urlData="urlData"
- @getBackAddress="getBackAddress"
- @clearImg="clearImg"
- >
- </component>
- </view>
- </template>
- <script>
- import api from "@/api/api";
- import gasImgIdentify from "./gasImgIdentify.vue";
- import Recognition from "./Recognition.vue";
- export default {
- name: "taskBoardAddress",
- components: { gasImgIdentify, Recognition },
- props: {
- taskId: {
- type: String,
- default: "",
- },
- },
- data() {
- return {
- saveImg: "",
- // imgList: [],
- topH: 0,
- activeIndex: 0,
- Ids: "",
- checkNum: "", //巡检次数
- classType: "",
- isSensor: "",
- deviceID: "",
- deviceName: "",
- checkState: "",
- isShow: true,
- toComponent: "",
- indexList: [],
- gasTitle: "任务明细", //标题
- sbShow: false,
- sbData: [],
- urlData: "",
- showBtn: true,
- };
- },
- computed: {
- searchTime: function () {
- return uni.getStorageSync("searchTime");
- },
- //一键识别列表
- recognitionData: function () {
- let list = [];
- this.indexList.forEach((el) => {
- if (uni.getStorageSync(el.deviceId)) {
- el.img = uni.getStorageSync(el.deviceId);
- el.status = "";
- list.push(el);
- }
- });
- return list;
- },
- },
- mounted() {
- this.taskDetailsLists();
- },
- methods: {
- //点击返回上一级
- handlerToggle() {
- this.$emit("getBackBoard");
- },
- //暂存图片预览
- // getView(item) {
- // let imgList = []
- // imgList.push(uni.getStorageSync(item.deviceId))
- // // 预览图片
- // uni.previewImage({
- // urls: imgList,
- // current: 0
- // });
- // },
- //清除暂存图片
- clearImg(data) {
- if (data) {
- this.saveImg = "";
- }
- },
- //一键识别
- getYjsb() {
- let that = this;
- that.isShow = false;
- that.sbShow = true;
- that.showBtn = false;
- if (that.recognitionData.length != 0) {
- uni.showLoading({
- title: "批量识别中...",
- mask: true,
- });
- }
- },
- //批量识别后跳转到填报页面
- getRepport(param) {
- let that = this;
- that.sbShow = false;
- that.showBtn = false;
- console.log(param, "param------");
- that.Ids = param.id;
- that.checkNum = param.checkNum;
- that.classType = param.classType_dictText;
- that.checkState = param.checkState;
- that.isSensor = param.isSensor;
- that.deviceID = param.deviceId;
- that.deviceName = param.deviceName;
- that.sbData = param.sbList;
- that.urlData = param.img;
- that.toComponent = "gasImgIdentify";
- },
- getBoradAddress(item, index) {
- let that = this;
- that.activeIndex = index;
- that.isShow = false;
- that.showBtn = false;
- if (item.checkState == "0") {
- that.Ids = item.id;
- that.isSensor = item.isSensor;
- }
- that.checkNum = item.checkNum;
- that.classType = item.classType_dictText;
- that.checkState = item.checkState;
- that.deviceID = item.deviceId;
- that.deviceName = item.deviceName;
- that.saveImg = uni.getStorageSync(item.deviceId);
- that.toComponent = "gasImgIdentify";
- },
- getBackAddress() {
- this.isShow = true;
- this.showBtn = true;
- this.sbShow = false;
- this.toComponent = "";
- this.urlData = "";
- this.topH = 39 * this.activeIndex;
- this.taskDetailsLists();
- },
- taskDetailsLists() {
- let that = this;
- new Promise((resolve, reject) => {
- api
- .taskDetailsList({
- pageNo: 1,
- pageSize: 100,
- taskId: that.taskId,
- taskTime: that.searchTime,
- })
- .then((response) => {
- if (response.data.code == 200) {
- console.log(response, "地点列表---");
- // that.indexList = response.data.result.records || [];
- that.indexList = [
- {
- id: "2117091338227367937",
- taskTime: "2026-11-02",
- deviceId: "2117091338189619201",
- deviceName: "12406胶运顺槽掘进工作面风流",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "1",
- checkReg: "12406胶运顺槽掘进工作面",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 1,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338294476802",
- taskTime: "2026-11-02",
- deviceId: "2117091338248339458",
- deviceName: "12406胶运顺槽掘进工作面回风流",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "1",
- checkReg: "12406胶运顺槽掘进工作面",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 2,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338349002753",
- taskTime: "2026-11-02",
- deviceId: "2117091338319642626",
- deviceName: "22煤新建南回风井下部",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "22煤系统",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 3,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338420305922",
- taskTime: "2026-11-02",
- deviceId: "2117091338390945794",
- deviceName: "22煤新建南进风井下部",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "22煤系统",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 4,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338470637569",
- taskTime: "2026-11-02",
- deviceId: "2117091338449666050",
- deviceName: "22煤北翼辅运顶头",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "22煤系统",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 5,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338529357825",
- taskTime: "2026-11-02",
- deviceId: "2117091338499997698",
- deviceName: "22煤北翼集中辅运巷2联",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "22煤北翼集中主、辅运巷",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 6,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338571300865",
- taskTime: "2026-11-02",
- deviceId: "2117091338550329346",
- deviceName: "22煤北翼集中辅运巷6联水仓",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "22煤北翼集中主、辅运巷",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 7,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338630021122",
- taskTime: "2026-11-02",
- deviceId: "2117091338604855298",
- deviceName: "12404综采工作面进风流",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "0",
- checkReg: "12404综采工作面",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 8,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338692935682",
- taskTime: "2026-11-02",
- deviceId: "2117091338667769858",
- deviceName: "12404综采工作面风流",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "1",
- checkReg: "12404综采工作面",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 9,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- {
- id: "2117091338747461634",
- taskTime: "2026-11-02",
- deviceId: "2117091338722295809",
- deviceName: "12404综采工作面回风隅角",
- checkNum: "1",
- taskId: "2117091338147676162",
- checkState: "0",
- isSensor: "1",
- checkReg: "12404综采工作面",
- checkPerson: null,
- sysOrgCode: "A02A02",
- orgCode: null,
- createBy: "admin",
- createTime: "2026-11-02 11:08:03",
- updateBy: null,
- updateTime: null,
- orderNum: 10,
- taskName: "夜班瓦检10.1 (1)",
- classType: "night",
- classType_dictText: "晚班",
- },
- ];
- if (that.indexList.length != 0) {
- that.indexList.forEach((el) => {
- if (uni.getStorageSync(el.deviceId)) {
- el.zcShow = true;
- } else {
- el.zcShow = false;
- }
- });
- }
- } else {
- reject(response);
- }
- })
- .catch((error) => {
- console.log("catch===>response", response);
- reject(error);
- });
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .taskBoardAddress {
- position: relative;
- width: 100%;
- height: 100%;
- padding: 0px 10px;
- box-sizing: border-box;
- }
- ::v-deep .u-slot-title {
- display: flex;
- }
- </style>
|