吉安感知网项目-前端
张含笑
2026-01-08 41ee773916184cf21e0687b7c73b954ad320fe48
feat:代码合并
4 files modified
795 ■■■■ changed files
uniapps/work-app/src/pages.json 261 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/pages/work/index.vue 199 ●●●●● patch | view | raw | blame | history
uniapps/work-app/src/subPackages/workDetail/index.vue 322 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/subPackages/workDetail/mapWork/index.vue 13 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/pages.json
@@ -1,137 +1,130 @@
{
    "easycom": {
        "custom": {
            "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
            "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
            "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
            "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
        }
    },
    "pages": [
        {
            "path": "pages/work/index",
            "style": {
                "navigationBarTitleText": "事件工单",
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/voiceCall/index",
            "style": {
                "navigationBarTitleText": "通话",
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/map/index",
            "style": {
                "navigationBarTitleText": "地图",
                "navigationStyle": "custom"
            }
        },
  "easycom": {
    "custom": {
      "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
      "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
      "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
      "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
    }
  },
  "pages": [
    {
      "path": "pages/work/index",
      "style": {
        "navigationBarTitleText": "事件工单",
        "navigationStyle": "custom"
      }
    },
    {
      "path": "pages/voiceCall/index",
      "style": {
        "navigationBarTitleText": "通话",
        "navigationStyle": "custom"
      }
    },
    {
      "path": "pages/map/index",
      "style": {
        "navigationBarTitleText": "地图",
        "navigationStyle": "custom"
      }
    },
        {
            "path": "pages/user/index",
            "style": {
                "navigationBarTitleText": "我的",
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/login/index",
            "style": {
                "navigationBarTitleText": "登录页",
                "navigationStyle": "custom"
            }
        }
    ],
    "subPackages": [
        {
            "root": "subPackages",
            "pages": [
                {
                    "path": "404/index",
                    "style": {
                        "navigationBarTitleText": "404",
                        "navigationStyle": "custom"
                    }
                },
                {
                    "path": "workDetail/index",
                    "style": {
                        "navigationBarTitleText": "工单详情"
                    }
                },
                {
                    "path": "workDetail/addWork/index",
                    "style": {
                        "navigationBarTitleText": "新建工单"
                    }
                },
                {
                    "path": "workDetail/mapWork/index",
                    "style": {
                        "navigationBarTitleText": "地图展示",
                        "navigationStyle": "custom"
                    }
                },
                {
                    "path": "userDetail/infos/index",
                    "style": {
                        "navigationBarTitleText": "个人资料"
                    }
                },
                {
                    "path": "userDetail/password/index",
                    "style": {
                        "navigationBarTitleText": "修改密码"
                    }
                },
                {
                    "path": "browser/index",
                    "style": {
                        "navigationBarTitleText": "地图"
                    }
                }
            ]
        }
    ],
    "tabBar": {
        "color": "#8c8c8c",
        "selectedColor": "#1D6FE9",
        "borderStyle": "black",
        "backgroundColor": "#ffffff",
        "list": [
            {
                "iconPath": "static/images/tabbar/icon_order.png",
                "selectedIconPath": "static/images/tabbar/icon_order_selected.png",
                "pagePath": "pages/work/index",
                "text": "工单"
            },
            {
                "iconPath": "static/images/tabbar/icon_order.png",
                "selectedIconPath": "static/images/tabbar/icon_order_selected.png",
                "pagePath": "pages/voiceCall/index",
                "text": "通话"
            },
            {
                "iconPath": "static/images/tabbar/icon_home1.png",
                "selectedIconPath": "static/images/tabbar/icon_home_selected.png",
                "pagePath": "pages/map/index",
                "text": "地图"
            },
            {
                "iconPath": "static/images/tabbar/icon_me.png",
                "selectedIconPath": "static/images/tabbar/icon_me_selected.png",
                "pagePath": "pages/user/index",
                "text": "我的"
            }
        ]
    },
    "globalStyle": {
        "navigationBarTextStyle": "black",
        "navigationBarTitleText": "uni-app",
        "navigationBarBackgroundColor": "#F8F8F8",
        "backgroundColor": "#F8F8F8"
    }
    {
      "path": "pages/user/index",
      "style": {
        "navigationBarTitleText": "我的",
        "navigationStyle": "custom"
      }
    },
    {
      "path": "pages/login/index",
      "style": {
        "navigationBarTitleText": "登录页",
        "navigationStyle": "custom"
      }
    }
  ],
  "subPackages": [
    {
      "root": "subPackages",
      "pages": [
        {
          "path": "404/index",
          "style": {
            "navigationBarTitleText": "404",
            "navigationStyle": "custom"
          }
        },
        {
          "path": "workDetail/index",
          "style": {
            "navigationBarTitleText": "工单详情"
          }
        },
        {
          "path": "workDetail/mapWork/index",
          "style": {
            "navigationBarTitleText": "工单位置"
          }
        },
        {
          "path": "userDetail/infos/index",
          "style": {
            "navigationBarTitleText": "个人资料"
          }
        },
        {
          "path": "userDetail/password/index",
          "style": {
            "navigationBarTitleText": "修改密码"
          }
        },
        {
          "path": "browser/index",
          "style": {
            "navigationBarTitleText": "地图"
          }
        }
      ]
    }
  ],
  "tabBar": {
    "color": "#8c8c8c",
    "selectedColor": "#1D6FE9",
    "borderStyle": "black",
    "backgroundColor": "#ffffff",
    "list": [
      {
        "iconPath": "static/images/tabbar/icon_order.png",
        "selectedIconPath": "static/images/tabbar/icon_order_selected.png",
        "pagePath": "pages/work/index",
        "text": "工单管理"
      },
      {
        "iconPath": "static/images/tabbar/icon_order.png",
        "selectedIconPath": "static/images/tabbar/icon_order_selected.png",
        "pagePath": "pages/voiceCall/index",
        "text": "语音通话"
      },
      {
        "iconPath": "static/images/tabbar/icon_home1.png",
        "selectedIconPath": "static/images/tabbar/icon_home_selected.png",
        "pagePath": "pages/map/index",
        "text": "地图"
      },
      {
        "iconPath": "static/images/tabbar/icon_me.png",
        "selectedIconPath": "static/images/tabbar/icon_me_selected.png",
        "pagePath": "pages/user/index",
        "text": "我的"
      }
    ]
  },
  "globalStyle": {
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "uni-app",
    "navigationBarBackgroundColor": "#F8F8F8",
    "backgroundColor": "#F8F8F8"
  }
}
uniapps/work-app/src/pages/work/index.vue
@@ -1,16 +1,207 @@
<template>
  <view class="eventTickets">
    工单
  </view>
  <div class="eventTickets" :style="{ paddingTop: topMargin + 'px' }">
    <div class="searchTop">
      <up-search placeholder="请输入关键字搜索"  :animation="true"  v-model="listParams.keyword" :show-action="false"></up-search>
    </div>
    <div class="listBox">
      <div class="tabs-container">
        <up-tabs :list="tabList" @click="handleClick"></up-tabs>
      </div>
      <div class="eventBox">
        <div class="eventItem"  v-for="(item,index) in dataList" :key="index">
          <img :src="item.photo_url" alt="" @click="detailHandle(item)" />
          <div class="informationDisplay">
            <div class="itemTitle">{{item.event_name}}</div>
            <div class="itemContent">{{formatDate(item.create_time) }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { useUserStore } from '@/store/index.js'
import {getList,getstatusCount} from '/src/api/work/index.js'
import dayjs from 'dayjs';
import { getStatusBarHeight } from '@/utils/common';
const userStore = useUserStore()
const userInfo = userStore.userInfo
const dataList = ref([])
const currentTab=ref('all')
const tabList = ref([
  {
    name: '全部工单',
    key: 'all',
    badge: {
      value: 2
    },
    status: null
  },
  {
    name: '我的工单',
    key: 'myTickets',
    badge: {
      value: 1
    }
  },
])
const formatDate = (dateString) => {
  return dayjs(dateString).format('MM/DD HH:mm');
};
const listParams = ref({
  status: null,
  current: 1,
  size: 9999,
  source: 1,
  department:'',
  keyword:''
})
const getDataList = () => {
  const params = {
    current: 1,
    size: 9999,
    source: 1,
    status:listParams.value.status,
    event_name:listParams.value.keyword,
    user_id:currentTab.value=== 'myTickets' ?userInfo.user_id : undefined
  }
  getList(params).then(res => {
    const response = res.data.data.records
    dataList.value = response
  })
}
// const getstatusCountData=()=>{
//     getstatusCount().then(res=>{
//         const response = res.data.data
//          const { statusCount, totalCount, userCount } = response
//         tabList.value.forEach(tab=>{
//
//             if(tab.key === 'all'){
//                 tab.badge.value = totalCount || 0
//
//             }else if(tab.key === 'myTickets'){
//                 tab.badge.value = userCount || 0
//             }else{
//                 tab.badge.value=statusCount[String(tab.status)] || 0
//             }
//         })
//
//     })
// }
const handleClick = (item) => {
  currentTab.value = item.key
  listParams.value.status = item.status
  getDataList()
}
const detailHandle = (val) => {
  uni.navigateTo({
    url: `/subPackages/workDetail/index?eventNum=${val.event_num}`,
  })
}
const topMargin = getStatusBarHeight()
onShow(() => {
  getDataList()
})
</script>
<style scoped lang="scss">
.eventTickets {
  width: 100%;
  padding: 0 20rpx;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  .searchTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 24rpx;
    width: 100%;
    height: 108rpx;
  }
  :deep(){
    .u-tabs__wrapper__nav__line{
      width: 80rpx !important;
      background: #1D6FE9 !important;
    }
    .u-badge {
      background-color: #1d6fe9 !important;
    }
  }
  .tabs-container{
    display: flex;
    justify-content: center;
    height: 98rpx;
  }
  .listBox {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .eventBox {
    display: flex;
    flex-wrap: wrap;
    gap: 20rpx;
    padding: 20rpx 0;
    overflow-y: auto;
    height: 0;
    flex-grow: 1;
    align-content: flex-start;
    .eventItem {
      width: calc(50% - 10rpx);
      background-color: #fff;
      border-radius: 12rpx;
      overflow: hidden;
      img {
        width: 341rpx;
        height: 196rpx;
        border-radius: 12rpx;
        overflow: hidden;
      }
      .informationDisplay{
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10rpx 20rpx 10rpx 12rpx;
        .itemTitle {
          width: 144rpx;
          font-family: Source Han Sans CN, Source Han Sans CN;
          font-weight: 500;
          font-size: 28rpx;
          color: #000000;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .itemContent {
          font-family: Source Han Sans CN, Source Han Sans CN;
          font-weight: 400;
          font-size: 24rpx;
          color: rgba(0,0,0,0.5);
        }
      }
    }
  }
}
</style>
uniapps/work-app/src/subPackages/workDetail/index.vue
@@ -1,68 +1,282 @@
<!-- 工单详情 - 包含待审核、待处理、处理中、已完成 -->
<!-- 工单详情 -->
<template>
  <div class="workDetailContainer">
    <WebViewPlus
      ref="sWebViewRef"
      :src="`${viewUrl}`"
      @webMessage="onPostMessage"
    />
    <div class="detailTop">
      <div class="image-container">
        <u-swiper
          class="detailImage"
          :list="getImageList"
          mode="round"
          indicator
          indicatorMode="dot"
          indicatorActiveColor="#4C85FF"
          indicatorInactiveColor="#fff"
          indicatorPosition="center"
          height="410rpx"
          @click="previewImage"
        ></u-swiper>
        <!--                <div class="detailTitle">-->
        <!--                    <div class="titleText">-->
        <!--                        <div class="itemName">{{workDetailData.event_name}}</div>-->
        <!--                        <div class="itemTime">{{formatDate(workDetailData.create_time)}}</div>-->
        <!--                    </div>-->
        <!--                </div>-->
      </div>
    </div>
    <!-- 工单内容 -->
    <div class="worderContainer">
      <div class="workOrderContent">
        <div class="workOrderTitle">工单内容</div>
        <div class="workOrderContainer">
          <div class="orderRow">
            <div class="rowTitle">工单编号</div>
            <div>{{workDetailData.event_num}}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">工单处置人</div>
            <div>{{workDetailData.event_num?.slice(0, 2) === 'AI' ? 'AI 小飞':workDetailData.creator}}
            </div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">处置部门</div>
            <div>{{ workDetailData.dept_name }}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">拍摄时间</div>
            <div>{{ workDetailData.create_time }}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">分发人员</div>
            <div>{{ workDetailData.remark }}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">分发部门</div>
            <div>{{ workDetailData.remark }}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">分发时间</div>
            <div>{{ workDetailData.create_time }}</div>
          </div>
          <div class="orderRow">
            <div class="rowTitle">工单位置</div>
            <div class="rowAddress" @click="jumpMap(workDetailData)">{{ workDetailData.address }}</div>
          </div>
        </div>
      </div>
    </div>
    <!-- 操作按钮 -->
    <div class="actionButton">
      <div class="btngroups" >
        <up-button type="primary" color="#AEAEAE" text="退回"></up-button>
        <up-button type="primary" color="#1D6FE9" text="确认"></up-button>
      </div>
    </div>
  </div>
</template>
<script setup>
import { getWebViewUrl } from "@/utils/index.js";
import { onLoad } from "@dcloudio/uni-app";
import { useUserStore } from "@/store/index.js";
const userStore = useUserStore();
const userInfo = userStore.userInfo;
const sWebViewRef = ref(null);
const viewUrl = ref("");
onLoad((options) => {
  const eventNum = options.eventNum;
  viewUrl.value = getWebViewUrl("/workDetail", {
    eventNum: eventNum,
    totalNum: options.totalNum,
    keyword: options.keyword,
    aiType: options.aiType,
    wLJobInfoId: options.wLJobInfoId,
    status: options.status,
    current: options.current,
  });
// import { getShowImg, getSmallImg } from '@/utils/util'
import {getList,flowEvent} from '/src/api/work/index.js'
import dayjs from 'dayjs'
const formatDate = dateString => {
  return dayjs(dateString).format('MM/DD HH:mm')
}
const eventNum = ref('');
// 工单内容
const workDetailData = ref({})
onLoad(async (options) => {
  eventNum.value = options.eventNum;
  await getDataList(eventNum.value);
});
function onPostMessage(data) {
  if (data.type === "workback") {
    // #ifdef MP-WEIXIN
    if ("fun" in data && data.fun === "add") {
      uni.setStorageSync("joinParams", {
        type: "add",
      });
    }
    // #endif
    // #ifndef MP-WEIXIN
    uni.setStorageSync("joinParams", {
      type: "add",
    });
    uni.switchTab({
      url: `/pages/work/index?addLog=111`,
      // url: '/pages/work/index'
    });
    // #endif
  } else if (data.type === "jumpMapNav") {
    // #ifndef MP-WEIXIN
    uni.navigateTo({
      url: `/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}`,
    });
    // #endif
const getDataList = async (val) => {
  const params = {
    current: 1,
    size: 9999,
    source: 1,
    event_name: val
  }
  const res = await getList(params);
  const response = res.data.data.records;
  workDetailData.value = response[0];
  console.log('详情',response);
}
// 图片预览
const previewImage = (index) => {
  if (getImageList.value.length === 0) return;
  const currentIndex = typeof index === 'number' ? index : 0;
  uni.previewImage({
    urls: getImageList.value,
    current: currentIndex
  });
};
const getImageList =computed(()=>{
  const imageArr = []
  const detail = workDetailData.value
  if (detail.photo_url) {
    const smallUrl = detail.photo_url
    imageArr.push(smallUrl)
  }
  if (detail.update_photo_url) {
    const smallUrl =detail.update_photo_url
    imageArr.push(smallUrl)
  }
  return imageArr
})
// 跳转地图
const jumpMap = item => {
  uni.navigateTo({
    url: `/subPackages/workDetail/mapWork/index?eventNum=${item.event_num}`,
  })
}
</script>
<style lang="scss" scoped>
.workDetailContainer {
  width: 100%;
  height: 100%;
  background-size: cover;
  .detailTop {
    .image-container {
      position: relative;
      width: 100%;
      height: 410rpx;
      .detailImage {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
      }
      // 轮播图容器
      :deep(.u-swiper) {
        // 指示器容器 - 修改为居中对齐
        .u-swiper__indicator {
          position: absolute;
          left: 50%;
          transform: translateX(-50%);
          bottom: 20rpx;
          display: flex;
          justify-content: center;
          align-items: center;
          z-index: 10;
        }
        .u-swiper-indicator__wrapper__dot--active{
          width: 5px !important;
        }
      }
      .detailTitle {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 60rpx;
        line-height: 60rpx;
        background: rgba(7, 7, 7, 0.4);
      }
      .titleText {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        color: #fff;
        .itemName, .itemTime {
          font-family: Source Han Sans CN, Source Han Sans CN;
          font-weight: 400;
          font-size: 28rpx;
          color: #FFFFFF;
        }
        .itemName {
          padding-left: 20rpx;
        }
        .itemTime{
          padding-right: 20rpx;
        }
      }
    }
  }
  .worderContainer {
    padding: 0 24rpx;
    padding-bottom: 4rpx;
    background: #f6f6f6;
    margin-top: 20rpx;
  }
  .workOrderContent {
    margin-top: 30epx;
    background-color: #fff;
    border-radius: 12rpx;
    padding: 20rpx;
    margin-bottom: 34rpx;
    .workOrderTitle {
      font-family: Source Han Sans CN, Source Han Sans CN;
      font-weight: bold;
      font-size: 32rpx;
      color: #222324;
    }
    .workOrderContainer {
      .orderRow {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 96rpx;
        border-bottom: 1px solid #f5f5f5;
        color: #7b7b7b;
        .rowTitle {
          font-family: Source Han Sans CN, Source Han Sans CN;
          font-weight: 400;
          font-size: 30rpx;
          color: #222324;
          white-space: nowrap;
        }
        .rowAddress {
          font-family: Source Han Sans CN, Source Han Sans CN;
          font-weight: 400;
          font-size: 28rpx;
          color: #1D6FE9;
          //white-space: nowrap;
          ///* 禁止换行 */
          //overflow: hidden;
          //text-overflow: ellipsis;
          // max-width: 74%;
          padding-top: 1px;
          padding-left: 5px;
          padding-right: 2px;
        }
      }
    }
  }
  .actionButton {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 61px;
    border-radius: 6px 6px 6px 6px;
    .btngroups {
      display: flex;
      justify-content: space-between;
      align-items: center;
      :deep(.u-button){
        width: 276rpx !important;
        height: 100rpx !important;
        &:last-child {
          margin-left: 30rpx;
        }
      }
    }
  }
}
</style>
uniapps/work-app/src/subPackages/workDetail/mapWork/index.vue
@@ -1,13 +1,4 @@
<!--
 * @Author       : yuan
 * @Date         : 2025-10-22 14:59:10
 * @LastEditors  : yuan
 * @LastEditTime : 2025-12-19 14:52:54
 * @FilePath     : \src\subPackages\workDetail\mapWork\index.vue
 * @Description  :
 * Copyright 2025 OBKoro1, All Rights Reserved.
 * 2025-10-22 14:59:10
-->
<!-- 地图展示 -->
<template>
  <WebViewPlus
@@ -25,7 +16,7 @@
const viewUrl = ref("");
onLoad((options) => {
  const currentItem = options.currentItem;
  const currentItem = options.eventNum;
  viewUrl.value = getWebViewUrl("/mapWork", { currentItem: currentItem });
});
function onPostMessage(data) {