From 1500a4a99ef29cbc472cedbee96e679c9f64b5e3 Mon Sep 17 00:00:00 2001 From: liyuanchao <438964165@qq.com> Date: Wed, 13 Aug 2025 17:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 4 +- common/http.api.js | 12 +- pages.json | 21 + pages/sys/user/myVisitor/myVisitor.vue | 2 +- .../workbench/earlyWarning/earlyWarning.vue | 246 ++++++++++++ pages/sys/workbench/order/order.vue | 371 +++++++++++------- pages/sys/workbench/order/orderDetail.vue | 130 +++--- pages/sys/workbench/workbench.vue | 4 +- 8 files changed, 589 insertions(+), 201 deletions(-) create mode 100644 pages/sys/workbench/earlyWarning/earlyWarning.vue diff --git a/common/config.js b/common/config.js index 5841e5c..4d73a40 100644 --- a/common/config.js +++ b/common/config.js @@ -24,7 +24,7 @@ const config = { } // 设置后台接口服务的基础地址 -// config.baseUrl = 'http://tc.cqsznc.com:7080/api'; -config.baseUrl = 'http://183.230.235.66:11010/api'; +config.baseUrl = 'http://tc.cqsznc.com:7080/api'; +// config.baseUrl = 'http://183.230.235.66:11010/api'; export default config; \ No newline at end of file diff --git a/common/http.api.js b/common/http.api.js index 85a4e1d..c5b828f 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -20,12 +20,17 @@ const install = (Vue, vm) => { //新增访客 addVisitor:(params = {})=>vm.$u.post(config.adminPath+'/property/visitorManagement',params), - //报事报修 + //订单报事报修 getOrderList:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrders/list',params), + //订单类型 getOrdersType:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/list',params), + //报事报修订单类型 getRepairTypes:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/queryList',params), + //新增订单 addOrder:(params = {})=>vm.$u.post(config.adminPath+'/property/workOrders',params), + //新增报事报修 addOrder2:(params = {})=>vm.$u.post(config.adminPath+'/property/mobile/workOrders',params), + //修改订单 updateOrder:(params = {})=>vm.$u.put(config.adminPath+'/property/workOrders',params), //会议列表 @@ -34,8 +39,13 @@ const install = (Vue, vm) => { //监控列表 getMonitors:(params = {})=>vm.$u.get(config.adminPath+'/sis/deviceChannel/treeList',params), + //获取播放地址 getPlay:(params = {})=>vm.$u.post(config.adminPath+'/sis/stream/realtime/add',params), + //获取预警列表 + getWarns:(params = {})=>vm.$u.get(config.adminPath+'/property/warning/list',params), + + // 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等 lang: (params = {}) => vm.$u.get('/lang/'+params.lang), index: (params = {}) => vm.$u.get(config.adminPath+'/mobile/index', params), diff --git a/pages.json b/pages.json index 7ea8fa2..e078463 100644 --- a/pages.json +++ b/pages.json @@ -444,6 +444,27 @@ { "navigationStyle": "custom" } + }, + { + "path" : "pages/sys/workbench/earlyWarning/earlyWarning", + "style" : + { + "navigationStyle": "custom" + } + }, + { + "path" : "pages/sys/workbench/earlyWarning/warnDetail", + "style" : + { + "navigationBarTitleText" : "预警详情" + } + }, + { + "path" : "pages/sys/workbench/earlyWarning/warnStatistics", + "style" : + { + "navigationBarTitleText" : "预警统计" + } } ], "tabBar": { diff --git a/pages/sys/user/myVisitor/myVisitor.vue b/pages/sys/user/myVisitor/myVisitor.vue index 1fe1917..c3ce041 100644 --- a/pages/sys/user/myVisitor/myVisitor.vue +++ b/pages/sys/user/myVisitor/myVisitor.vue @@ -52,7 +52,7 @@ data() { return { tabs: ['我的预约', '我的邀约', '全部记录'], - activeTab: 1, + activeTab: 0, tabData: [ [], [], diff --git a/pages/sys/workbench/earlyWarning/earlyWarning.vue b/pages/sys/workbench/earlyWarning/earlyWarning.vue new file mode 100644 index 0000000..0bbf9d7 --- /dev/null +++ b/pages/sys/workbench/earlyWarning/earlyWarning.vue @@ -0,0 +1,246 @@ + + + + + \ No newline at end of file diff --git a/pages/sys/workbench/order/order.vue b/pages/sys/workbench/order/order.vue index 502226e..843e6a9 100644 --- a/pages/sys/workbench/order/order.vue +++ b/pages/sys/workbench/order/order.vue @@ -1,25 +1,61 @@ @@ -67,27 +88,37 @@ export default { data() { return { - tabs: ['待办', '全部'], - activeTab: 1, + tabs: ["待办", "全部"], + activeTab: 0, tabData: [ [], [] - ], // 每个tab的数据 - tabLoaded: [false, false], // 每个tab是否已加载 + ], + tabLoaded: [false, false], loading: false, lastScrollTop: 0, isAddBtnHidden: false, - showPopup: false, - selectedType: '' - } + activePopup: null, // 当前显示哪个弹窗,null表示都关闭 + selectedFilters: { + type: null, + status: null, + handler: null, + }, + typeList: [{ + 'orderTypeName': '全部' + }], + statusList: [], + handlerList: [], + }; }, computed: { list() { return this.tabData[this.activeTab]; - } + }, }, created() { - this.loadTabData(this.activeTab); // 初始化加载当前tab数据 + this.loadTabData(this.activeTab); + this.loadFilterData(); }, methods: { goBack() { @@ -95,22 +126,13 @@ }, addOrder() { uni.navigateTo({ - url: '/pages/sys/workbench/order/addOrder' + url: "/pages/sys/workbench/order/addOrder", }); }, handleScroll(e) { const scrollTop = e.detail.scrollTop; - // 为了避免过于频繁的触发,可以设置一个阈值 - if (Math.abs(scrollTop - this.lastScrollTop) < 20) { - return; - } - if (scrollTop > this.lastScrollTop && scrollTop > 50) { - // 向下滚动,隐藏按钮 - this.isAddBtnHidden = true; - } else { - // 向上滚动,显示按钮 - this.isAddBtnHidden = false; - } + if (Math.abs(scrollTop - this.lastScrollTop) < 20) return; + this.isAddBtnHidden = scrollTop > this.lastScrollTop && scrollTop > 50; this.lastScrollTop = scrollTop; }, async changeTab(idx) { @@ -121,69 +143,126 @@ }, async loadTabData(idx) { this.loading = true; - // 模拟接口请求,不同tab返回不同mock数据 - let params = {} - if (idx === 0) { - params = {} + let params = {}; + if (this.selectedFilters.type && this.selectedFilters.type.id) { + params.type = this.selectedFilters.type.id } - - let data = []; let res = await this.$u.api.getOrderList(params); - - if (res.code == '200') { - data = res.rows + if (res.code == "200") { + this.$set(this.tabData, idx, res.rows); } - - this.$set(this.tabData, idx, data); this.$set(this.tabLoaded, idx, true); this.loading = false; }, - getStatusLabel(status) { const statusMap = { - 0: '创建工单', - 1: '已接单', - 2: '已接单', - 3: '处理中', - 4: '已完成' + 0: "创建工单", + 1: "已接单", + 2: "已接单", + 3: "处理中", + 4: "已完成", }; - return statusMap[status] || ''; + return statusMap[status] || ""; }, getStatusColor(status) { const statusMap = { - 0: 'orange', - 1: 'doing', - 2: 'doing', - 3: 'doing', - 4: 'done' + 0: "orange", + 1: "doing", + 2: "doing", + 3: "doing", + 4: "done", }; - return statusMap[status] || ''; + return statusMap[status] || ""; }, goDetail(item) { - // 将item对象转换为JSON字符串并进行编码,然后通过URL参数传递 const itemStr = encodeURIComponent(JSON.stringify(item)); uni.navigateTo({ - url: '/pages/sys/workbench/order/orderDetail?item=' + itemStr + url: "/pages/sys/workbench/order/orderDetail?item=" + itemStr, }); }, - togglePopup() { - this.showPopup = !this.showPopup; - }, - selectType(type) { - this.selectedType = type; - }, - closePopup() { - this.showPopup = false; - }, - confirmSelection() { - if (this.selectedType) { - // 处理确认逻辑,例如更新筛选条件 - console.log('Selected type:', this.selectedType); + togglePopup(name) { + if (this.activePopup === name) { + this.activePopup = null; + } else { + this.activePopup = name; } - this.showPopup = false; - } - } - } + }, + selectFilter(name, value) { + this.selectedFilters[name] = value; + this.activePopup = null; + this.loadTabData(this.activeTab) + }, + handleOutsideClick() { + if (this.activePopup !== null) { + this.activePopup = null; + } + }, + async loadFilterData() { + // 工单类型 + + let resType = await this.$u.api.getOrdersType(); + if (resType.code === 200) { + this.typeList = [...this.typeList, ...resType.rows]; + } + + + this.statusList = [{ + name: "全部" + }, + { + name: "创建工单" + }, + { + name: "已接单" + }, + { + name: "处理中" + }, + { + name: "已完成" + }, + ]; + + + + // 处理人 + try { + let resHandler = await this.$u.api.getHandlers(); + if (resHandler.code === "200" && Array.isArray(resHandler.data)) { + this.handlerList = resHandler.data; + } else { + this.handlerList = [{ + name: "全部" + }, + { + name: "张三" + }, + { + name: "李四" + }, + { + name: "王五" + }, + ]; + } + } catch { + this.handlerList = [{ + name: "全部" + }, + { + name: "张三" + }, + { + name: "李四" + }, + { + name: "王五" + }, + ]; + } + }, + }, + }; \ No newline at end of file diff --git a/pages/sys/workbench/order/orderDetail.vue b/pages/sys/workbench/order/orderDetail.vue index 1ac5fac..5584d49 100644 --- a/pages/sys/workbench/order/orderDetail.vue +++ b/pages/sys/workbench/order/orderDetail.vue @@ -1,6 +1,6 @@ - @@ -130,11 +138,13 @@ .page-container { background: #fff; } - .top-line{ + + .top-line { width: 100vw; height: 3rpx; background: #ECECEC; } + .repair-detail-progress-box { height: 107rpx; margin-bottom: 41rpx; @@ -214,10 +224,10 @@ margin-left: 40rpx; } - .detail-key{ + .detail-key { color: #595858; } - + .detail-value { margin-bottom: 30rpx; color: ##2F2F2F; @@ -237,7 +247,7 @@ flex-wrap: wrap; margin-top: 20rpx; } - + .image-item { width: 200rpx; height: 200rpx; diff --git a/pages/sys/workbench/workbench.vue b/pages/sys/workbench/workbench.vue index 771d73d..1cb2dd7 100644 --- a/pages/sys/workbench/workbench.vue +++ b/pages/sys/workbench/workbench.vue @@ -64,7 +64,9 @@ }, { icon: 'https://picsum.photos/80/80?random=3', - text: '停车' + text: '预警处理', + url:'/pages/sys/workbench/earlyWarning/earlyWarning' + }, { icon: 'https://picsum.photos/80/80?random=3',