应急通讯录-导航

This commit is contained in:
lijianzhong 2024-01-30 16:35:55 +08:00
parent 7352ee3060
commit eab48361d2
42 changed files with 600 additions and 1505 deletions

27
app.js
View File

@ -63,27 +63,14 @@ App({
resumptionAcs: "WorkFile", // 履职附件
taskAcs: "TaskAttachment", // 任务附件
msgAcs: "MsgAcs", // 消息附件
checkMethodPic: "checkMethodPic", //检查方法图片
userSign: "UserSign", //用户签名
entSign: "entSign", //企业签名
buildImg: "buildImg", //建筑体图片
buildDesignImg: "buildDesignImg", //建筑体总平图
dangerBefore: "APPRectifyImgBefore", //整改前
dangerAfter: "APPRectifyImgAfter", //整改后
eventAcs: "eventAcs", //突发事件上报
userSign: "UserSign", //用户签名
entEmResourse: "entEmResourse", //应急物资台账
EmergencyImg: "Content", // 应急预案---一图一表
EmergencyFile: "EmergencyFile", // 应急预案---文件
EmergencyPlanFile: "EmergencyPlanFile", // 应急演练---文件
checkEnclosure: "CheckEnclosure", // 检查附件
},
// 接口类型
ApiFileType: {
GET: "/getFile",
POST: "/uploadFile",
DELETE: "/delFile",
},
// 请求函数封装
@ -120,16 +107,16 @@ App({
},
/** 上传文件 */
uploadFile: function (OTCId, OTCType, filePath) {
uploadFile: function (otcid, otctype, filePath) {
let params = {
OTCId,
OTCType,
otcid,
otctype,
userId: this.globalData.userInfo.userId,
}
console.info(params)
return new Promise((resolve, reject) => {
wx.uploadFile({
url: this.FILE_SERVER_UP_URL + this.ApiFileType.POST,
url: this.FILE_SERVER_UP_URL + 'common/upload/uploadFile',
filePath: filePath,
name: 'file',
formData: params,

View File

@ -6,8 +6,6 @@
"pages/task/file/index/index",
"pages/task/index/index",
"pages/task/check/index/index",
"pages/emergency/index/index",
"pages/emergency/suddenly-up/up/index",
"pages/msg/index/index",
"pages/msg/push-index/index",
"pages/msg/push/index",
@ -25,7 +23,7 @@
"pages/g-z-t/d-b-s-x/detail/index",
"pages/y-j/y-a/index/index",
"pages/y-j/z-h/index/index",
"pages/y-j/s-b/index/index",
"pages/y-j/t-x/index/index"
],
"window": {

View File

@ -1,85 +0,0 @@
// pages/emergency/index/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
curTab: 0,
tabs: [{
lab: '突发事件',
val: 0
}, {
lab: '应急资源',
val: 1
}],
},
/**
* 切换筛选
*/
tabSelect: function (params) {
const index = Number.parseInt(params.currentTarget.dataset.index) || Number.parseInt(params.detail.current);
this.data.curTab = index;
this.setData(this.data)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -1,7 +0,0 @@
{
"usingComponents": {
"suddenly": "../suddenly-up/index/index",
"resourse": "../resourse/index/index"
},
"navigationStyle": "custom"
}

View File

@ -1,18 +0,0 @@
<!--pages/emergency/index/index.wxml-->
<title-bar title="应急管理"></title-bar>
<!-- 筛选 -->
<scroll-view scroll-x class="bg-white nav">
<view class="flex text-center">
<view class="cu-item flex-sub {{index==curTab?'text-blue cur':''}}" wx:for="{{tabs}}" wx:key catchtap="tabSelect" data-index="{{index}}">
{{item.lab}}
</view>
</view>
</scroll-view>
<swiper style="height: calc(100vh - 90rpx - {{topBarH}}px);" current="{{curTab}}" bindanimationfinish="tabSelect">
<swiper-item>
<suddenly></suddenly>
</swiper-item>
<swiper-item>
<resourse></resourse>
</swiper-item>
</swiper>

View File

@ -1,9 +0,0 @@
/* pages/emergency/index/index.wxss */
page {
background-color: #f5f5f5;
}
.cu-item {
font-size: 30rpx;
font-weight: bold;
}

View File

@ -1,111 +0,0 @@
// pages/emergency/resourse/index/index.js
const app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
condition: '',
curTab: 0,
tabs: [{
lab: '应急物资',
val: 0
}, {
lab: '应急专家',
val: 0
}, {
lab: '救援队伍',
val: 0
}],
canChange: false,
freshIng: false,
page: 1,
pageSize: 10,
list: []
},
pageLifetimes: {
show: function () {
this.getList();
},
},
/**
* 组件的方法列表
*/
methods: {
/**
* 搜索
*/
inputSearch: function (e) {
this.data.condition = e.detail.value;
this.refresh();
},
/**
* 切换筛选
*/
tabSelect: function (params) {
if (!this.data.canChange) return
this.data.canChange = false;
const index = Number.parseInt(params.currentTarget.dataset.index);
this.data.curTab = index;
this.setData(this.data)
this.refresh()
},
/**
* 刷新
* @param {*} params
*/
refresh: function (params) {
this.data.page = 1;
this.data.list = [];
this.setData(this.data)
this.getList();
},
/**
* 获取列表
*/
getList: function () {
let url = ""
const params = {
page: this.data.page,
pageSize: this.data.pageSize,
}
switch (this.data.curTab) {
case 0:
url = "/OtheWareHouse/getOtheWareHousePage"
params.houseName = this.data.condition;
break;
case 1:
url = "/Othexpert/getOthexpertPage"
params.othname = this.data.condition;
break;
case 2:
url = "/Othteam/getOthteamPage"
params.teamname = this.data.condition;
break;
}
app.axios("GET", "app", url, params, true).then(res => {
this.data.canChange = true;
if (res.code == 1) {
this.data.list = [...this.data.list, ...res.data.rows];
if (res.data.rows.length != 0) this.data.page = res.data.pageNum + 1
}
this.setData(this.data)
})
}
}
})

View File

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -1,104 +0,0 @@
<!--pages/emergency/resourse/index/index.wxml-->
<!-- 搜索 -->
<view class="cu-bar search">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input value="{{condition}}" bindinput="inputSearch" type="text" placeholder="请输入关键字" confirm-type="search"></input>
</view>
</view>
<!-- 筛选 -->
<scroll-view scroll-x class="filter">
<view class="tag text-blue {{index==curTab?'cur':''}}" wx:for="{{tabs}}" wx:key catchtap="tabSelect" data-index="{{index}}">
{{item.lab}}
</view>
</scroll-view>
<scroll-view scroll-y style="height: calc(100% - 170rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
<!-- 列表 -->
<view class="item-bg" wx:for="{{list}}">
<!-- 应急资源 -->
<view wx:if="{{curTab == 0}}" catchtap="toDetail" data-item="{{item}}" class="item">
<view class="h-div v-center">
<view class="lab flex">{{item.houseName||''}}</view>
<image class="guide" src="/images/emergency/icon-guide.png" />
<view class="phone">导航</view>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">所属单位:</text>
<text class="val">{{item.possession||''}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">管理员:</text>
<text class="val flex">{{item.nameText||''}}</text>
<text class="phone">{{item.telephone|''}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">物资数量:</text>
<text class="val">{{item.houseTotal}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center" style="color: #999999; font-size: 26rpx;">
<text class="cuIcon-location"></text>
<text class="address">316m</text>
<text style="margin: 0 20rpx;">|</text>
<text class="address">{{item.address}}</text>
</view>
</view>
<!-- 应急专家 -->
<view wx:if="{{curTab == 1}}" catchtap="toDetail" data-item="{{item}}" class="item">
<view class="h-div v-center">
<view class="lab">{{item.othname}}</view>
<view class="lab age flex">{{item.othage}}岁</view>
<image class="guide" src="/images/emergency/icon-guide.png" />
<view class="phone">导航</view>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">职称:</text>
<text class="val">{{item.othmajor}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">任职单位:</text>
<text class="val">{{item.othcompany||''}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">联系电话:</text>
<text class="phone">{{item.othphone}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">专业领域:</text>
<text class="val">{{item.othmajortype}}</text>
</view>
</view>
<!-- 救援队伍 -->
<view wx:if="{{curTab == 2}}" catchtap="toDetail" data-item="{{item}}" class="item">
<view class="h-div v-center">
<view class="lab flex">{{item.teamname}}</view>
<image class="guide" src="/images/emergency/icon-guide.png" />
<view class="phone">导航</view>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">所属单位:</text>
<text class="val">{{item.unitname||''}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">联系人:</text>
<text class="val flex">{{item.principal}}</text>
<text class="phone">{{item.principaltel}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">队伍人数:</text>
<text class="val">{{item.personnum||'0'}}</text>
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>

View File

@ -1,129 +0,0 @@
/* pages/emergency/resourse/index/index.wxss */
@import "../../../../colorui/main.wxss";
@import "../../../../colorui/icon.wxss";
page {
background-color: #f5f5f5;
}
.v-div {
display: flex;
display: -webkit-flex;
flex-direction: column;
}
.h-div {
display: flex;
display: -webkit-flex;
flex-direction: row;
}
.v-center {
align-items: center;
}
.h-center {
justify-content: center;
}
.flex {
flex: 1;
}
.space-between {
justify-content: space-between;
}
.cu-item {
font-size: 30rpx;
font-weight: bold;
}
.filter {
height: 60rpx;
margin-bottom: 10rpx;
min-width: 100%;
white-space: nowrap;
}
.filter .tag {
background: #CEDFFD;
border-radius: 46rpx;
padding: 2rpx 40rpx;
margin-left: 20rpx;
display: inline-block;
}
.filter .cur {
background: #FFFFFF;
border: 2rpx solid #417AFF;
}
.filter view {
width: fit-content;
}
.search {
background-color: #f5f5f5;
position: sticky;
top: 0;
z-index: 10;
}
.cu-bar .search-form {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
border-radius: 12rpx;
}
.item-bg {
padding: 0 20rpx;
/* background-color: #f5f5f5; */
}
.item {
background-color: #ffffff;
padding: 20rpx;
position: relative;
border-radius: 10rpx;
z-index: 2;
margin-bottom: 20rpx;
}
.item .lab {
font-size: 32rpx;
font-weight: bold;
color: #222222;
}
.item .val {
font-size: 32rpx;
color: #222222;
}
.item .age {
font-size: 32rpx;
margin-left: 30rpx;
}
.item .phone {
font-size: 32rpx;
color: var(--blue);
}
.item .guide {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.item .line {
margin: 20rpx -20rpx;
border-top: 2rpx dashed #f5f5f5;
}
.space {
height: calc(constant(safe-area-inset-bottom) + 30rpx);
height: calc(env(safe-area-inset-bottom) + 30rpx);
}

View File

@ -1,30 +0,0 @@
// pages/emergency/suddenly-up/index/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
list: [{}, {}, {}, {}, {}]
},
/**
* 组件的方法列表
*/
methods: {
/**
* 上报事件
*/
push: function (params) {
wx.navigateTo({
url: '/pages/emergency/suddenly-up/up/index',
})
}
}
})

View File

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -1,31 +0,0 @@
<!--pages/emergency/suddenly-up/index/index.wxml-->
<!-- 搜索 -->
<view class="cu-bar search">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search"></input>
</view>
</view>
<scroll-view scroll-y style="height: calc(100% - 100rpx)" refresher-enabled>
<!-- 列表 -->
<view class="item-bg" wx:for="{{list}}">
<view catchtap="toDetail" data-item="{{item}}" class="item">
<view class="head h-div v-center">
<view class="single"></view>
<view class="title ellipsis">文件签批流转任务</view>
</view>
<view class="tv">关于某某某某某某某某某某某项工作的任务要求,关于某某某某某某某某工作的任务要求。
</view>
<view class="line"></view>
<view class="h-div bottom">
<text class="flex">发布人:某某人</text>
<text>发布时间2022-09-15</text>
</view>
<image class="bottom-img" src="/images/task/icon-bottom-line.png" mode="aspectFill" />
</view>
</view>
<view class="space"></view>
</scroll-view>
<view class="option">
<view catchtap="push" class="btn">上报事件</view>
</view>

View File

@ -1,162 +0,0 @@
/* pages/emergency/suddenly-up/index/index.wxss */
@import "../../../../colorui/main.wxss";
@import "../../../../colorui/icon.wxss";
page {
background-color: #f5f5f5;
}
.v-div {
display: flex;
display: -webkit-flex;
flex-direction: column;
}
.h-div {
display: flex;
display: -webkit-flex;
flex-direction: row;
}
.v-center {
align-items: center;
}
.h-center {
justify-content: center;
}
.flex {
flex: 1;
}
.space-between {
justify-content: space-between;
}
.cu-item {
font-size: 30rpx;
font-weight: bold;
}
.search {
background-color: #f5f5f5;
position: sticky;
top: 0;
z-index: 10;
}
.cu-bar .search-form {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
border-radius: 12rpx;
}
.item-bg {
padding: 0 32rpx 20rpx 32rpx;
background-color: #f5f5f5;
}
.item {
background-color: #ffffff;
padding: 32rpx 20rpx 20rpx 20rpx;
position: relative;
border-radius: 10rpx;
z-index: 2;
}
.item .head {
margin: 0 -20rpx;
margin-top: -32rpx;
background-color: #CDE5FC;
padding: 16rpx;
border-radius: 10rpx 10rpx 0 0;
}
.item .head .single {
width: 8rpx;
height: 36rpx;
background: #4882EE;
border-radius: 4rpx;
}
.item .head .title {
flex: 1;
margin-left: 16rpx;
font-size: 28rpx;
font-weight: bold;
color: #4882EE;
}
.item .head .status {
font-weight: bold;
font-size: 28rpx;
}
.item .tv {
font-size: 28rpx;
font-weight: 500;
color: #222222;
padding-top: 20rpx;
}
.item .bottom {
font-size: 26rpx;
font-weight: bold;
color: #222222;
}
.item .val {
font-size: 26rpx;
font-weight: 500;
color: #222222;
margin-left: 20rpx;
}
.item .line {
margin: 20rpx -20rpx;
border-top: 2rpx dashed #f5f5f5;
}
.item .bottom-img {
width: calc(100vw - 65rpx);
max-width: calc(100vw - 65rpx);
height: 40rpx;
margin: 0 -20rpx;
position: absolute;
bottom: 0;
z-index: -1;
}
.option {
position: fixed;
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
left: 0;
right: 0;
margin-top: 30rpx;
padding: 16rpx 32rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
z-index: 10;
}
.option .btn {
padding: 14rpx;
display: flex;
align-items: center;
justify-content: center;
background: #409CFF;
color: #FFFFFF;
border-radius: 12rpx;
}
.option .btn:active {
opacity: 0.8;
}
.space {
height: calc(constant(safe-area-inset-bottom) + 150rpx);
height: calc(env(safe-area-inset-bottom) + 150rpx);
}

View File

@ -1,68 +0,0 @@
// pages/emergency/suddenly-up/up/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -1,4 +0,0 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -1,36 +0,0 @@
<!--pages/emergency/suddenly-up/up/index.wxml-->
<title-bar title="突发事件上报"></title-bar>
<scroll-view scroll-y refresher-enabled style="height: calc(100vh - {{topBarH}}px);">
<view class="item">
<!-- 内容 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">事件内容</text>
</view>
<textarea style="color: #333333;" class="put v-div" placeholder-class="put" placeholder="请输入通知内容"></textarea>
<!-- 附件 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">位置信息</text>
</view>
<view class="file h-div v-center">
<text class="cuIcon-location"></text>
<text class="address">成都市某某区某某街道某某详细的事件地址</text>
</view>
<!-- 接收人 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">接收人</text>
</view>
<view style="flex-wrap: wrap;">
<view wx:for="{{10}}" class="v-div v-center people">
<image class="avatar" src="/images/task/icon-cloud.png" />
<text class="name">某某人</text>
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>
<view class="option">
<view catchtap="push" class="btn">上 报</view>
</view>

View File

@ -1,111 +0,0 @@
/* pages/emergency/suddenly-up/up/index.wxss */
scroll-view {
background-color: #f5f5f5;
box-sizing: border-box;
}
.item {
background-color: #ffffff;
margin: 32rpx 20rpx 20rpx 20rpx;
padding: 20rpx;
position: relative;
border-radius: 10rpx;
z-index: 2;
}
.item .header {
margin-top: 16rpx;
}
.item .header .single {
width: 8rpx;
height: 36rpx;
background: #4882EE;
border-radius: 4rpx;
margin-right: 10rpx;
}
.item .header .title {
font-size: 30rpx;
font-weight: bold;
color: #222222;
}
.item .put {
width: 100%;
background: #F5F7FC;
border-radius: 12rpx;
min-height: 72rpx;
padding: 15rpx;
margin-top: 16rpx;
color: #999999;
font-size: 28rpx;
}
.item .cloud {
width: 40rpx;
height: 40rpx;
margin-left: 20rpx;
}
.item .file {
padding: 15rpx 0;
border-bottom: 1rpx dashed #f5f5f5;
}
.item .address {
font-size: 28rpx;
color: #222222;
margin-left: 10rpx;
}
.item .people {
display: inline-flex;
width: calc((100vw - 100rpx) / 4);
margin-top: 20rpx;
}
.item .people .avatar {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
background-color: #f5f5f5;
}
.item .people .name {
font-size: 28rpx;
font-weight: bold;
color: #222222;
}
.option {
position: fixed;
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
left: 0;
right: 0;
margin-top: 30rpx;
padding: 16rpx 32rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
z-index: 10;
}
.option .btn {
padding: 14rpx;
display: flex;
align-items: center;
justify-content: center;
background: #409CFF;
color: #FFFFFF;
border-radius: 12rpx;
}
.option .btn:active {
opacity: 0.8;
}
.space {
height: calc(constant(safe-area-inset-bottom) + 150rpx);
height: calc(env(safe-area-inset-bottom) + 150rpx);
}

View File

@ -9,13 +9,34 @@ Page({
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
dateFilter: Utils.formatTime(new Date(), '-'),
showTypePop: false,
TypeData: ['常规工作', '督办工作'],
showTaskPop: false,
TypeData: [],
postData: {}
},
/**
* 时间
*/
bindDateChange: function (params) {
const name = params.currentTarget.dataset.name;
this.data.postData[name] = params.detail.value;
this.setData(this.data)
console.info(this.data.postData)
},
/**
* 显示/关闭任务弹窗
*/
popTaskModal: function (params) {
const type = params.currentTarget.dataset.type;
this.data[type] = !this.data[type];
this.setData(this.data)
},
/**
* 显示/关闭弹窗
*/
@ -31,30 +52,17 @@ Page({
typeChange: function (params) {
const index = params.currentTarget.dataset.index;
this.data.postData.type = index + 1;
this.data.postData.typeId = this.data.TypeData[index].typeId;
this.data.showTypePop = false;
this.setData(this.data)
},
/**
* 通知内容
* 输入内容
*/
inputContent: function (e) {
this.data.postData.content = e.detail.value;
},
/**
* 获取接收人员
*/
getWorker: function (params) {
app.axios("GET", "app", "/notice/getNoticePerformList", {
govNoticeId: this.data.uuid,
userId: app.globalData.userInfo.userId
}).then(res => {
if (res.code == 1) {
this.data.workers = res.data;
this.setData(this.data)
}
})
const name = e.currentTarget.dataset.name;
this.data.postData[name] = e.detail.value;
},
/**
@ -72,6 +80,20 @@ Page({
})
},
/**
* 获取工作类型
*/
getType: function () {
app.axios("GET", "app", "/work/wkTypes", {
classify: 1
}).then(res => {
if (res.code == 1) {
this.data.TypeData = res.data;
this.setData(this.data)
}
})
},
/**
* 上传图片
*/
@ -79,19 +101,19 @@ Page({
wx.showLoading({
title: '文件上传中...',
})
app.uploadFile(this.data.uuid, app.FileType.msgAcs, filePath).then(res => {
app.uploadFile(this.data.uuid, app.FileType.resumptionAcs, filePath).then(res => {
wx.hideLoading();
this.getFiles();
})
},
/**
* 获取整改前图片
* 获取图片
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
OTCId: this.data.uuid,
OTCType: app.FileType.msgAcs
otcid: this.data.uuid,
otctype: app.FileType.resumptionAcs
}).then(res => {
if (res.code == 1) {
this.data.files = res.data;
@ -111,8 +133,8 @@ Page({
content: '是否要删除该附件?',
success: (res) => {
if (res.confirm) {
app.axios("GET", '', "/delFile", {
deletedId: id,
app.axios("GET", 'common', "/upload/delFile", {
documentId: id,
}).then(res => {
if (res.code == 1) {
this.getFiles();
@ -124,35 +146,41 @@ Page({
},
/**
* 发布通知
* 发布
*/
pushMsg: function (params) {
const childComponent = this.selectComponent('#tree');
push: function () {
this.data.postData.userId = app.globalData.userInfo.userId;
this.data.postData.govNoticeId = this.data.uuid;
this.data.postData.listperformids = childComponent.data.allChoiceIdList;
if (!this.data.postData.type) {
this.data.postData.workId = this.data.uuid;
this.data.postData.listperformid = '';
if (!this.data.postData.title) {
wx.showToast({
title: '请选择通知类型',
title: '请输入工作标题',
icon: 'none'
})
return
}
if (!this.data.postData.typeId) {
wx.showToast({
title: '请选择工作类型',
icon: 'none'
})
return
}
if (!this.data.postData.content) {
wx.showToast({
title: '请选择通知内容',
title: '请输入内容',
icon: 'none'
})
return
}
if (!this.data.postData.listperformids) {
if (!this.data.postData.startTime || !this.data.postData.endTime) {
wx.showToast({
title: '请选择接收对象',
title: '请设置时间',
icon: 'none'
})
return
}
app.axios("POST", "app", "/notice/addGovNotice", this.data.postData).then(res => {
app.axios("POST", "app", "/work/workAdd", this.data.postData).then(res => {
if (res.code == 1) {
wx.showToast({
title: '发布成功',
@ -170,33 +198,18 @@ Page({
})
},
/**
* 获取通知详情
*/
getDetail: function () {
app.axios('GET', 'admin', `/notice/getGovNotice/${this.data.uuid}`, {}, false).then(res => {
if (res.code == 1) {
this.data.postData = res.data;
this.setData(this.data);
this.getFiles();
}
})
},
/**
* 预览文件
*/
filePre: function (params) {
const url = params.currentTarget.dataset.url;
wx.downloadFile({
url: this.data.baseUrl + url,
success: res => {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {}
})
}
const imgs = [];
this.data.files.forEach(item => {
imgs.push(this.data.baseUrl + item.filepath)
})
wx.previewImage({
urls: imgs,
current: this.data.baseUrl + url
})
},
@ -205,13 +218,9 @@ Page({
*/
onLoad(options) {
this.data.isUserDetail = options.user;
this.data.uuid = options.uuid || utils.uuid();
this.data.isDetail = options.uuid || false;
this.getWorker();
if (this.data.isDetail) {
this.getDetail();
}
this.data.uuid = Utils.uuid();
this.setData(this.data)
this.getType();
},
/**

View File

@ -7,46 +7,59 @@
<text class="single"></text>
<text class="title">工作标题</text>
</view>
<input data-type="title" class="put v-div h-center" placeholder="请输入标题" value="{{postData.title}}"></input>
<input bindinput="inputContent" data-name="title" value="{{postData.title}}" class="put v-div h-center" placeholder="请输入标题"></input>
<!-- 类型 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作类型</text>
</view>
<input catchtap="popModal" data-type="showTypePop" disabled class="put v-div h-center" placeholder="请选择" value="{{TypeData[postData.type-1]}}"></input>
<input catchtap="popModal" data-type="showTypePop" disabled class="put v-div h-center" placeholder="请选择" value="{{TypeData[postData.type-1].typeName}}"></input>
<!-- 内容 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作内容</text>
</view>
<textarea bindinput="inputContent" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
<textarea bindinput="inputContent" data-name="content" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
<!-- 时间 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作时间</text>
</view>
<view class="filter">
<picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange">
<picker mode="date" value="{{postData.startTime}}" data-name="startTime" bindchange="bindDateChange">
<view class="picker">
选择时间: {{dateFilter}}
开始时间: {{postData.startTime||'-'}}
</view>
</picker>
<picker mode="date" value="{{postData.endTime}}" data-name="endTime" bindchange="bindDateChange">
<view class="picker">
结束时间: {{postData.endTime||'-'}}
</view>
</picker>
</view>
<!-- 关闭任务 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">关闭任务</text>
</view>
<input catchtap="popTaskModal" data-type="showTaskPop" disabled class="put v-div h-center" placeholder="请选择"></input>
<!-- 附件 -->
<view wx:if="{{!isUserDetail}}" class="h-div v-center header">
<view class="h-div v-center header">
<text class="single"></text>
<text class="title flex">附件</text>
<text wx:if="{{!isDetail}}" catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加附件</text>
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
</view>
<view catchtap="filePre" data-url="{{item.FilePath}}" wx:for="{{files}}" class="file h-div v-center">
<text class="ellipsis flex">{{item.realfilename}}</text>
<text wx:if="{{!isDetail}}" catchtap="deleteFile" data-id="{{item.SysDocumentId}}" class="cuIcon-delete cloud" style="color:red;"></text>
<view class="grid">
<view class="img" wx:for="{{files}}" style="position: relative;">
<text catchtap="deleteFile" data-id="{{item.sysdocumentid}}" class="cuIcon-delete del" style="color:red;"></text>
<image class="img" src="{{baseUrl+item.filepath}}" catchtap="filePre" data-url="{{item.filepath}}" />
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>
<view class="option" wx:if="{{!isDetail}}">
<view catchtap="pushMsg" class="btn">上报</view>
<view class="option">
<view catchtap="push" class="btn">上报</view>
</view>
<!-- 选择通知类型 -->
@ -62,7 +75,27 @@
<view class="cu-list menu text-left">
<view class="cu-item" wx:for="{{TypeData}}" wx:key>
<label catchtap="typeChange" data-index="{{index}}" class="flex justify-between align-center flex-sub">
<view class="flex-sub">{{item}}</view>
<view class="flex-sub">{{item.typeName}}</view>
</label>
</view>
</view>
</radio-group>
</view>
</view>
<!-- 选择任务 -->
<view class="cu-modal {{showTaskPop?'show':''}}">
<view class="cu-dialog pop" catchtap>
<view class="cu-bar justify-end pop-header">
<view class="content">选择需要完成的任务</view>
<view class="action" catchtap="popTaskModal" data-type="showTaskPop">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<radio-group class="block" style="max-height: 50vh;overflow-y: scroll;">
<view class="cu-list menu text-left">
<view class="cu-item" wx:for="{{TypeData}}" wx:key>
<label catchtap="typeChange" data-index="{{index}}" class="flex justify-between align-center flex-sub">
<view class="flex-sub">{{item.typeName}}</view>
</label>
</view>
</view>

View File

@ -58,44 +58,26 @@ scroll-view {
font-size: 28rpx;
}
.item .cloud {
width: 40rpx;
height: 40rpx;
margin-left: 20rpx;
}
.item .file::before {
display: block;
content: ' ';
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
border-radius: 50%;
background-color: var(--blue);
}
.item .file {
padding: 15rpx 0;
border-bottom: 1rpx dashed #f5f5f5;
}
.item .people {
display: inline-flex;
width: calc((100vw - 100rpx) / 4);
.grid {
margin-top: 20rpx;
display: grid;
grid-gap: 20rpx 20rpx;
grid-template-columns: calc((100vw - 140rpx)/3) auto auto;
}
.item .people .avatar {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
.grid .img {
width: calc((100vw - 140rpx)/3);
height: calc((100vw - 140rpx)/3);
background-color: #f5f5f5;
border-radius: 10rpx;
}
.item .people .name {
font-size: 28rpx;
font-weight: bold;
color: #222222;
.grid .del {
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
font-size: 40rpx;
}
.option {

View File

@ -221,7 +221,7 @@ Page({
{
icon: "icon_tab5",
name: "事件上报",
href: "/pages/y-j/z-h/index/index"
href: "/pages/y-j/s-b/index/index"
},
{
icon: "icon_tab5",
@ -259,113 +259,24 @@ Page({
},
/**
* 跳转学习专栏
* 获取banner
*/
studyMore: function (prams) {
wx.navigateTo({
url: '/pages/study/index/index',
})
},
/**
* 统计数据类型筛选
*/
changeType: function (params) {
const type = params.currentTarget.dataset.type;
this.data.nineType = type;
this.setData(this.data)
this.getStatic();
},
/**
* 获取消息列表
*/
getMsgList: function () {
const params = {
userId: app.globalData.userInfo.userId,
getBanner: function () {
app.axios("GET", "app", "/work/wkDynamicsPage", {
page: 1,
pageSize: 1
}
app.axios('GET', 'app', '/notice/getGovNoticeUserPage', params, false).then(res => {
limit: 4,
userId: app.globalData.userInfo.userId
}, false).then(res => {
if (res.code == 1) {
const list = res.data.rows;
if (list.length > 0) {
const item = list[0];
if (item.isRead == 0) {
this.data.msgData = item;
this.data.showPop = true;
this.handleRead();
}
}
this.setData(this.data)
// this.data.notice = res.data.list;
// this.setData(this.data)
}
})
},
/**
* 获取通知详情
*/
handleRead: function (id) {
app.axios('GET', 'admin', `/notice/getGovNotice/${id}`, {}, false);
},
handldePop: function () {
this.data.showPop = !this.data.showPop;
this.data.msgData = null;
this.setData(this.data)
},
/**
* 获取统计数据
*/
getStatic: function () {
setTimeout(() => {
initChart({
resolving: 1,
unresolved: 1,
resolved: 1,
dangerTotal: 3
})
}, 500);
this.data.dLegend[0].num = 1;
this.data.dLegend[1].num = 1;
this.data.dLegend[2].num = 1;
return
const timeDate = getMonthStartEnd(new Date());
const params = {
userId: app.globalData.userInfo.userId,
startTime: this.data.filterIndex == 0 ? formatTime(new Date(), '-') : formatTime(timeDate.startTime, '-'),
endTime: this.data.filterIndex == 0 ? formatTime(new Date(), '-') : formatTime(timeDate.endTime, '-'),
smallType: this.data.nineType
}
app.axios('GET', 'app', `/Danger/dangerNumber`, params, false).then(res => {
if (res.code == 1) {
this.data.checkInfo = res.data;
this.data.dLegend[0].num = res.data.dangerCount.resolved;
this.data.dLegend[1].num = res.data.dangerCount.resolving;
this.data.dLegend[2].num = res.data.dangerCount.unresolved;
this.setData(this.data)
initChart(this.data.checkInfo.dangerCount)
}
});
},
/**
* 统计数据筛选
*/
changeFilter: function (params) {
const index = params.currentTarget.dataset.index;
this.data.filterIndex = index;
this.setData(this.data)
this.getStatic();
},
onLoad(option) {
this.data.userInfo = app.globalData.userInfo;
this.getMsgList();
this.getStatic();
this.getBanner();
},
onReady() {

View File

@ -71,11 +71,11 @@ Page({
key: 'userInfo',
data: res.data,
})
// if (!res.data.openid) {
// this.data.showPop = true;
// this.setData(this.data)
// return
// }
if (!res.data.openid) {
this.data.showPop = true;
this.setData(this.data)
return
}
wx.reLaunch({
url: '/pages/index/index',
})

View File

@ -13,8 +13,8 @@
</view>
<view catchtap="login" class="btn" data-type="{{1}}">登录</view>
<!-- <text class="tag">或</text>
<view catchtap="login" class="wx-login" data-type="{{2}}">微信登录</view> -->
<text class="tag">或</text>
<view catchtap="login" class="wx-login" data-type="{{2}}">微信登录</view>
</view>
</view>

View File

@ -22,7 +22,7 @@ page {
margin: 0 5%;
width: 90%;
padding: 30rpx 16rpx;
background: rgba(255, 255, 255, 0.8);
background: rgba(255, 255, 255, 0.7);
box-shadow: 0px 0px 12rpx 1rpx #b6c7e4;
border-radius: 20rpx;
margin-top: 30rpx;

View File

@ -103,8 +103,8 @@ Page({
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
OTCId: this.data.uuid,
OTCType: app.FileType.msgAcs
otcid: this.data.uuid,
otctype: app.FileType.msgAcs
}).then(res => {
if (res.code == 1) {
this.data.files = res.data;

View File

@ -21,9 +21,9 @@
<text class="title flex">附件</text>
<text wx:if="{{!isDetail}}" catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加附件</text>
</view>
<view catchtap="filePre" data-url="{{item.FilePath}}" wx:for="{{files}}" class="file h-div v-center">
<view catchtap="filePre" data-url="{{item.filepath}}" wx:for="{{files}}" class="file h-div v-center">
<text class="ellipsis flex">{{item.realfilename}}</text>
<text wx:if="{{!isDetail}}" catchtap="deleteFile" data-id="{{item.SysDocumentId}}" class="cuIcon-delete cloud" style="color:red;"></text>
<text wx:if="{{!isDetail}}" catchtap="deleteFile" data-id="{{item.sysdocumentid}}" class="cuIcon-delete cloud" style="color:red;"></text>
</view>
<!-- 接收人 -->
<view wx:if="{{!isUserDetail}}" class="h-div v-center header">

View File

@ -8,6 +8,8 @@ Page({
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
freshIng: false,
id: "",
detail: {},
@ -15,20 +17,17 @@ Page({
},
/**
* 下载文件
* 预览文件
*/
downFile: function (params) {
const item = params.currentTarget.dataset.item;
console.info(app.FILE_SERVER_URL + item.FilePath)
wx.downloadFile({
url: app.FILE_SERVER_URL + item.FilePath, //仅为示例,并非真实的资源
success(res) {
if (res.statusCode === 200) {
wx.openDocument({
filePath: res.tempFilePath,
})
}
}
filePre: function (params) {
const url = params.currentTarget.dataset.url;
const imgs = [];
this.data.enclosurelist.forEach(item => {
imgs.push(this.data.baseUrl + item.filepath)
})
wx.previewImage({
urls: imgs,
current: this.data.baseUrl + url
})
},
@ -37,8 +36,8 @@ Page({
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
OTCId: this.data.id,
OTCType: app.FileType.resumptionAcs
otcid: this.data.detail.workId,
otctype: app.FileType.resumptionAcs
}).then(res => {
if (res.code == 1) {
this.data.enclosurelist = res.data;
@ -47,32 +46,15 @@ Page({
})
},
/**
* 获取详情
*/
getData: function (params) {
app.axios("GET", "app", "/performDuties/getListdetail", {
listdetailid: this.data.id
}).then(res => {
this.data.freshIng = false;
if (res.code == 1) {
this.data.detail = res.data
this.getFiles();
}
this.setData(this.data)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('getItemId', (id) => {
this.setData({
id
})
this.getData();
eventChannel.on('getItem', (item) => {
this.data.detail = item;
this.setData(this.data)
this.getFiles();
})
},

View File

@ -4,26 +4,24 @@
<view class="item">
<view class="record-modeul">
<text class="title"> 工作标题 </text>
<textarea disabled class="textarea" value="{{detail.workcnt}}" placeholder="工作标题" placeholder-class="placeholder"></textarea>
<textarea disabled class="textarea" value="{{detail.title}}" placeholder="工作标题" placeholder-class="placeholder"></textarea>
</view>
<view class="record-modeul">
<text class="title"> 工作内容 </text>
<textarea disabled class="textarea" value="{{detail.workcnt}}" placeholder="工作内容" placeholder-class="placeholder"></textarea>
<textarea disabled class="textarea" value="{{detail.content}}" placeholder="工作内容" placeholder-class="placeholder"></textarea>
</view>
<view class="record-modeul">
<text class="title"> 时间 </text>
<view class="record-time">
<text class="time">{{detail.starttime||'-'}}</text>
<text class="time">{{detail.startTime+' 至 '+detail.endTime}}</text>
</view>
</view>
<view class="record-modeul">
<view class="enclosure-top">
<text class="title"> 工作附件 </text>
</view>
<view catchtap="downFile" data-item="{{item}}" wx:for="{{enclosurelist}}" class="content h-div v-center" style="border-bottom:{{index==files.length-1?'none':''}}">
<text class="file"></text>
<view class="flex file-name">{{item.realfilename}}</view>
<image class="cloud" src="/images/task/icon-cloud.png" />
<view class="grid">
<image class="img" catchtap="filePre" src="{{baseUrl+item.filepath}}" data-url="{{item.filepath}}" data-item="{{item}}" wx:for="{{enclosurelist}}" />
</view>
</view>
</view>

View File

@ -121,17 +121,6 @@ scroll-view {
align-items: center;
}
.img-add {
width: 28rpx;
height: 28rpx;
}
.progress-add-text {
font-size: 30rpx;
color: #5DA6F4;
margin-left: 6rpx;
}
.d-f {
display: flex;
align-items: center;
@ -142,41 +131,17 @@ scroll-view {
height: 40rpx;
}
.item .content {
overflow: hidden;
padding: 15rpx 0;
border-bottom: 1rpx dashed #f5f5f5;
.grid {
margin-top: 20rpx;
display: grid;
grid-gap: 20rpx 20rpx;
grid-template-columns: calc((100vw - 140rpx)/3) auto auto;
}
.item .content .file-name {
font-size: 30rpx;
text-overflow: ellipsis;
word-break: break-all;
}
.item .file::before {
display: block;
content: ' ';
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
border-radius: 50%;
background-color: var(--blue);
}
.item .lab {
font-size: 30rpx;
font-weight: bold;
color: #222222;
}
.item .val {
font-size: 30rpx;
color: #222222;
}
.item .cloud {
width: 40rpx;
height: 40rpx;
margin-left: 20rpx;
.grid .img {
width: calc((100vw - 140rpx)/3);
height: calc((100vw - 140rpx)/3);
background-color: #f5f5f5;
margin-bottom: 20rpx;
border-radius: 10rpx;
}

View File

@ -1,6 +1,10 @@
// pages/duty/index/index.js
const app = getApp();
import {
formatTime
} from "../../../../utils/util"
Page({
/**
@ -14,8 +18,11 @@ Page({
}, {
lab: '历史工作'
}],
page: 1,
pageSize: 10,
list: [],
dateFilter: ''
dateFilter: formatTime(new Date(), '-')
},
/**
@ -23,6 +30,7 @@ Page({
*/
tabSelect: function (params) {
this.data.currentIndex = params.currentTarget.dataset.index;
this.data.freshIng = true;
this.setData(this.data)
},
@ -31,23 +39,42 @@ Page({
*/
bindDateChange: function (params) {
this.data.dateFilter = params.detail.value;
this.data.freshIng = true;
this.setData(this.data);
},
/**
* 刷新
*/
refresh: function (params) {
this.data.page = 1;
this.getList();
},
/**
* 获取日志列表
*/
getList: function () {
app.axios("GET", "app", "/performDuties/factorList", {
const time = this.data.currentIndex == 0 ? formatTime(new Date(), '-') : this.data.dateFilter
app.axios("GET", "app", "/work/sendWorkPage", {
page: this.data.page,
limit: this.data.pageSize,
startTime: time,
endTime: time,
userId: app.globalData.userInfo.userId
}, false).then(res => {
this.data.freshIng = false;
if (res.code == 1) {
this.data.list = res.data;
this.data.list.forEach(item => {
item.rote = (item.factorNum / item.factorTotal * 100).toFixed(0)
})
this.setData(this.data)
let page = Number.parseInt(res.data.pageNum);
if (this.data.page == 1) {
this.data.list = res.data.list;
} else {
var list = this.data.list;
if (this.data.page == page) this.data.list = [...list, ...res.data.list]
}
if (res.data.list?.length > 0) this.data.page = page + 1
}
this.setData(this.data)
})
},
@ -59,7 +86,7 @@ Page({
wx.navigateTo({
url: '/pages/t-j/g-z-r-z/detail/index',
success: res => {
res.eventChannel.emit('getItemId', item.listfactorid)
res.eventChannel.emit('getItem', item)
}
})
},

View File

@ -8,7 +8,7 @@
</view>
</view>
</scroll-view>
<scroll-view scroll-y style="height: calc(100vh - 90rpx - {{topBarH}}px);" refresher-enabled>
<scroll-view scroll-y style="height: calc(100vh - 90rpx - {{topBarH}}px);" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" lower-threshold="300" refresher-triggered="{{freshIng}}">
<picker wx:if="{{currentIndex!=0}}" mode="date" value="{{dateFilter}}" bindchange="bindDateChange">
<view class="picker">
选择时间: {{dateFilter}}
@ -16,10 +16,11 @@
</picker>
<view catchtap="toDetail" data-item="{{item}}" class="item h-div" wx:for="{{list}}">
<view class="content">
<view class="title">标题</view>
<view class="des">{{item.factorcnt}}</view>
<view class="time">时间:2024-01-26</view>
<view class="title">{{item.title}}</view>
<view class="des">{{item.detail}}</view>
<view class="time">时间:{{item.createTime}}</view>
</view>
</view>
<empty wx:if="{{list.length==0}}" />
<view class="space"></view>
</scroll-view>

View File

@ -0,0 +1,214 @@
// 上报动态
import Utils from "../../../../utils/util"
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
dateFilter: Utils.formatTime(new Date(), '-'),
showTypePop: false,
showAdvicePop: false,
TypeData: ['火灾', '洪涝', '民事纠纷'],
postData: {},
files: []
},
/**
* 显示/关闭弹窗
*/
popModal: function (params) {
const type = params.currentTarget.dataset.type;
this.data[type] = !this.data[type];
this.setData(this.data)
},
/**
* 事件类型
*/
typeChange: function (params) {
const index = params.currentTarget.dataset.index;
this.data.postData.type = index + 1;
this.data.showTypePop = false;
this.setData(this.data)
},
/**
* 事件描述
*/
inputContent: function (e) {
this.data.postData.content = e.detail.value;
},
/**
* 发布
*/
push: function (params) {
},
/**
* 选择文件
*/
chooseFile: function () {
wx.chooseImage({
count: 1,
type: 'all',
success: (res) => {
const tempFilePaths = res.tempFiles;
const path = tempFilePaths[0].path;
this.postImg(path)
}
})
},
/**
* 上传图片
*/
postImg(filePath) {
wx.showLoading({
title: '文件上传中...',
})
app.uploadFile(this.data.uuid, app.FileType.eventAcs, filePath).then(res => {
wx.hideLoading();
this.getFiles();
})
},
/**
* 获取图片
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
otcid: this.data.uuid,
otctype: app.FileType.eventAcs
}).then(res => {
if (res.code == 1) {
this.data.files = res.data;
this.setData(this.data)
}
})
},
/**
* 删除图片
* @param {*} params
*/
deleteFile: function (e) {
var id = e.currentTarget.dataset.id;
wx.showModal({
title: '删除提示',
content: '是否要删除该附件?',
success: (res) => {
if (res.confirm) {
app.axios("GET", 'common', "/upload/delFile", {
documentId: id,
}).then(res => {
if (res.code == 1) {
this.getFiles();
}
})
}
}
})
},
/**
* 预览文件
*/
filePre: function (params) {
const url = params.currentTarget.dataset.url;
const imgs = [];
this.data.files.forEach(item => {
imgs.push(this.data.baseUrl + item.filepath)
})
wx.previewImage({
urls: imgs,
current: this.data.baseUrl + url
})
},
/**
* 时间
*/
bindDateChange: function (params) {
this.data.postData.time = params.detail.value;
this.setData(this.data)
},
/**
* 选择位置
*/
chooseAddress: function (params) {
wx.chooseLocation({
success: (res) => {
this.data.postData.lat = res.latitude;
this.data.postData.lng = res.longitude;
this.data.postData.address = res.address;
this.setData(this.data)
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.uuid = Utils.uuid();
this.setData(this.data)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -2,12 +2,20 @@
<title-bar title="突发事件上报"></title-bar>
<scroll-view scroll-y refresher-enabled style="height: calc(100vh - {{topBarH}}px);">
<view class="item">
<!-- 时间 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">事发时间</text>
</view>
<picker mode="date" value="{{postData.time}}" bindchange="bindDateChange">
<input disabled class="put v-div h-center" placeholder="请选择" value="{{postData.time}}"></input>
</picker>
<!-- 类型 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">发生地点</text>
<text class="title">发地点</text>
</view>
<input class="put v-div h-center" placeholder="请输入" value="{{postData.address}}"></input>
<input catchtap="chooseAddress" class="put v-div h-center" disabled placeholder="请输入" value="{{postData.address}}"></input>
<!-- 类型 -->
<view class="h-div v-center header">
<text class="single"></text>
@ -20,6 +28,18 @@
<text class="title">事件描述</text>
</view>
<textarea bindinput="inputContent" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
<!-- 附件 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title flex">附件</text>
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
</view>
<view class="grid">
<view class="img" wx:for="{{files}}" style="position: relative;">
<text catchtap="deleteFile" data-id="{{item.sysdocumentid}}" class="cuIcon-delete del" style="color:red;"></text>
<image class="img" src="{{baseUrl+item.filepath}}" catchtap="filePre" data-url="{{item.filepath}}" />
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>
@ -46,24 +66,4 @@
</view>
</radio-group>
</view>
</view>
<!-- 事件解决建议 -->
<view class="cu-modal {{showAdvicePop?'show':''}}">
<view class="cu-dialog pop" catchtap>
<view class="cu-bar justify-end pop-header">
<view class="content">解决方案</view>
<view class="action" catchtap="popModal" data-type="showAdvicePop">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<radio-group class="block" style="max-height: 50vh;overflow-y: scroll;">
<view class="cu-list menu text-left">
<view class="cu-item" wx:for="{{AdviceData}}" wx:key>
<label catchtap="typeChange" data-index="{{index}}" class="flex justify-between align-center flex-sub">
<view class="flex-sub">{{item}}</view>
</label>
</view>
</view>
</radio-group>
</view>
</view>

View File

@ -58,44 +58,26 @@ scroll-view {
font-size: 28rpx;
}
.item .cloud {
width: 40rpx;
height: 40rpx;
margin-left: 20rpx;
}
.item .file::before {
display: block;
content: ' ';
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
border-radius: 50%;
background-color: var(--blue);
}
.item .file {
padding: 15rpx 0;
border-bottom: 1rpx dashed #f5f5f5;
}
.item .people {
display: inline-flex;
width: calc((100vw - 100rpx) / 4);
.grid {
margin-top: 20rpx;
display: grid;
grid-gap: 20rpx 20rpx;
grid-template-columns: calc((100vw - 140rpx)/3) auto auto;
}
.item .people .avatar {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
.grid .img {
width: calc((100vw - 140rpx)/3);
height: calc((100vw - 140rpx)/3);
background-color: #f5f5f5;
border-radius: 10rpx;
}
.item .people .name {
font-size: 28rpx;
font-weight: bold;
color: #222222;
.grid .del {
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
font-size: 40rpx;
}
.option {

View File

@ -14,16 +14,18 @@ Component({
*/
data: {
condition: '',
canChange: false,
freshIng: false,
latlng: {},
page: 1,
pageSize: 10,
list: [{}]
list: []
},
pageLifetimes: {
show: function () {
this.getList();
this.getLoc();
},
},
@ -58,14 +60,71 @@ Component({
*/
refresh: function (params) {
this.data.page = 1;
// this.data.list = [];
this.data.list = [];
this.setData(this.data)
this.getList();
},
/**
* 获取定位
*/
getLoc: function () {
wx.getLocation({
altitude: true,
highAccuracyExpireTime: 0,
isHighAccuracy: true,
type: 'type',
success: (result) => {
this.data.latlng = result;
},
complete: () => {
this.getList();
}
})
},
toGuid: function (params) {
const item = params.currentTarget.dataset.item;
if (!item.latitude || !item.longitude) {
wx.showToast({
title: '未采集位置',
icon: 'none',
duration: 2000
})
return
}
wx.openLocation({
latitude: item.latitude,
longitude: item.longitude,
scale: 18,
});
},
/**
* 获取列表
*/
getList: function () {}
getList: function () {
const params = {
page: this.data.page,
limit: this.data.pageSize,
lat: this.data.latlng.latitude,
lon: this.data.latlng.longitude,
teamname: this.data.condition
}
app.axios("GET", "app", "/Othteam/getOthteamPage", params, false).then(res => {
this.data.freshIng = false;
if (res.code == 1) {
let page = Number.parseInt(res.data.pageNum);
if (this.data.page == 1) {
this.data.list = res.data.list;
} else {
var list = this.data.list;
if (this.data.page == page) this.data.list = [...list, ...res.data.list]
}
if (res.data.list?.length > 0) this.data.page = page + 1
}
this.setData(this.data)
})
},
}
})

View File

@ -7,30 +7,30 @@
<input value="{{condition}}" bindinput="inputSearch" type="text" placeholder="请输入关键字" confirm-type="search"></input>
</view>
</view>
<scroll-view scroll-y style="height: calc(100% - 170rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
<scroll-view scroll-y style="height: calc(100vh - 170rpx - 100rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
<!-- 列表 -->
<view class="item-bg" wx:for="{{list}}">
<view catchtap="toDetail" data-item="{{item}}" class="item">
<view class="h-div v-center">
<view class="lab flex">应急队伍名称</view>
<view class="lab flex">{{item.teamname}}</view>
<image class="guide" src="/images/emergency/icon-guide.png" />
<view class="phone">导航 3km</view>
<view catchtap="toGuid" data-item="{{item}}" class="phone">导航 {{item.distance}}</view>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">联系人:</text>
<text class="val flex">张三</text>
<text class="phone">18325456264</text>
<text class="val flex">{{item.principal}}</text>
<text class="phone">{{item.principaltel}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">队伍人数:</text>
<text class="val">20</text>
<text class="val">{{item.personnum}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">职责范围</text>
<text class="val">-</text>
<text class="lab">队伍介绍</text>
<text class="val">{{item.introduction}}</text>
</view>
</view>
</view>

View File

@ -15,42 +15,18 @@ Component({
data: {
condition: '',
curTab: 0,
tabs: [{
lab: '全部',
val: 0
}, {
lab: '火灾',
val: 0
}, {
lab: '地震',
val: 0
}, {
lab: '暴雨',
val: 0
}],
tabs: [],
canChange: false,
freshIng: false,
page: 1,
pageSize: 10,
list: [{
name: 'xxxxxx预案名称',
type: '火灾',
val: ''
}, {
name: 'xxxxxx预案名称',
type: '地震',
val: ''
}, {
name: 'xxxxxx预案名称',
type: '暴雨',
val: ''
}]
list: []
},
pageLifetimes: {
show: function () {
this.getList();
this.getType();
},
},
@ -74,6 +50,7 @@ Component({
const index = Number.parseInt(params.currentTarget.dataset.index);
this.data.curTab = index;
this.setData(this.data)
this.refresh();
},
/**
@ -82,7 +59,7 @@ Component({
*/
refresh: function (params) {
this.data.page = 1;
// this.data.list = [];
this.data.list = [];
this.setData(this.data)
this.getList();
},
@ -91,11 +68,39 @@ Component({
* 获取列表
*/
getList: function () {
let url = ""
const params = {
page: this.data.page,
pageSize: this.data.pageSize,
limit: this.data.pageSize,
othtypeid: this.data.tabs[this.data.curTab].othtypeid,
planname: this.data.condition
}
app.axios("GET", "app", "/Othplan/getOthplanPage", params, false).then(res => {
this.data.freshIng = false;
if (res.code == 1) {
let page = Number.parseInt(res.data.pageNum);
if (this.data.page == 1) {
this.data.list = res.data.list;
} else {
var list = this.data.list;
if (this.data.page == page) this.data.list = [...list, ...res.data.list]
}
if (res.data.list?.length > 0) this.data.page = page + 1
}
this.setData(this.data)
})
},
/**
* 获取预案类型
*/
getType: function () {
app.axios("GET", "app", "/Othplan/getOthtypeList", {}, false).then(res => {
if (res.code == 1) {
this.data.tabs = res.data;
this.setData(this.data)
}
this.setData(this.data)
})
}
}
})

View File

@ -1,9 +1,9 @@
<!-- 应急预案 -->
<title-bar title="应急预案"></title-bar>
<scroll-view scroll-y style="height: calc(100% - 170rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
<scroll-view scroll-y style="height: calc(100vh - 170rpx)" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" refresher-triggered="{{freshIng}}">
<scroll-view scroll-x class="filter">
<view class="tag text-blue {{index==curTab?'cur':''}}" wx:for="{{tabs}}" wx:key catchtap="tabSelect" data-index="{{index}}">
{{item.lab}}
{{item.othtypename}}
</view>
</scroll-view>
<view class="cu-bar search">
@ -16,17 +16,17 @@
<view catchtap="toDetail" data-item="{{item}}" class="item">
<view class="h-div v-center">
<text class="lab">预案名称:</text>
<text class="val">{{item.name}}</text>
<text class="val">{{item.planname}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">预案类型:</text>
<text class="val">{{item.type}}</text>
<text class="val">{{item.othtypename}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
<text class="lab">备注</text>
<text class="val">-</text>
<text class="lab">简介</text>
<text class="val">{{item.introduction}}</text>
</view>
<view class="line"></view>
<view class="h-div v-center">
@ -34,5 +34,6 @@
</view>
</view>
</view>
<empty wx:if="{{list.length==0}}" />
<view class="space"></view>
</scroll-view>

View File

@ -60,6 +60,7 @@ page {
padding: 2rpx 40rpx;
margin-left: 20rpx;
display: inline-block;
border: 2rpx solid transparent;
}
.filter .cur {

View File

@ -1,147 +0,0 @@
// 上报动态
import Utils from "../../../../utils/util"
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
dateFilter: Utils.formatTime(new Date(), '-'),
showTypePop: false,
showAdvicePop: false,
TypeData: ['常规工作', '督办工作'],
AdviceData: ['处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议处理建议'],
postData: {}
},
/**
* 显示/关闭弹窗
*/
popModal: function (params) {
const type = params.currentTarget.dataset.type;
this.data[type] = !this.data[type];
this.setData(this.data)
},
/**
* 通知类型
*/
typeChange: function (params) {
const index = params.currentTarget.dataset.index;
this.data.postData.type = index + 1;
this.data.showTypePop = false;
this.setData(this.data)
},
/**
* 通知内容
*/
inputContent: function (e) {
this.data.postData.content = e.detail.value;
},
/**
* 发布
*/
push: function (params) {
this.data.showAdvicePop = !this.data.showAdvicePop;
this.setData(this.data)
},
/**
* 获取通知详情
*/
getDetail: function () {
app.axios('GET', 'admin', `/notice/getGovNotice/${this.data.uuid}`, {}, false).then(res => {
if (res.code == 1) {
this.data.postData = res.data;
this.setData(this.data);
this.getFiles();
}
})
},
/**
* 预览文件
*/
filePre: function (params) {
const url = params.currentTarget.dataset.url;
wx.downloadFile({
url: this.data.baseUrl + url,
success: res => {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {}
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.isUserDetail = options.user;
this.data.uuid = options.uuid || utils.uuid();
this.data.isDetail = options.uuid || false;
this.getWorker();
if (this.data.isDetail) {
this.getDetail();
}
this.setData(this.data)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})