<template>
|
<view class="uni-project-event-container"> <!-- :style="{height:safeAreaHeight+ 'px'}" -->
|
<!-- #ifdef MP-DINGTALK-->
|
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" color="#fff" status-bar
|
:left-icon="apptype == 'HangChaTesting' ? '' : 'list'" right-icon="search" right-text="" left-text=""
|
:leftWidth="apptype == 'HangChaTesting' ? '0' : '24px'" rightWidth="24px" :title="navigationBarTitle"
|
@clickLeft="clickBarLeft" @clickRight="clickBarRight" @clickTitle="clickBarTitle">
|
<view class="uni-navbar-container-inner">
|
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
|
</view>
|
<template v-slot:right>
|
<view :style="{'color':isSearchMenuOpen?'#88ddff':'#fff'}" class="uni-panel-bar-icon fu-list"
|
size="22" />
|
|
</template>
|
</uni-nav-bar>
|
<!-- #endif-->
|
<!-- #ifdef MP-WEIXIN || MP-LARK -->
|
<uni-nav-bar :fixed="true" status-bar :left-icon="apptype == 'HangChaTesting' ? '' : 'list'" right-icon="search"
|
right-text="" left-text="" :leftWidth="apptype == 'HangChaTesting' ? '0' : '24px'" rightWidth="24px"
|
:title="navigationBarTitle" @clickLeft="clickBarLeft" @clickRight="clickBarRight"
|
@clickTitle="clickBarTitle">
|
<view class="uni-navbar-container-inner">
|
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
|
</view>
|
<template v-slot:right>
|
<view>
|
<view :style="{'color':isSearchMenuOpen?'#00aaff':'#333'}" class="uni-panel-bar-icon fu-list"
|
size="22" />
|
</view>
|
</template>
|
</uni-nav-bar>
|
<!-- #endif-->
|
<view class="uni-panel" :style="{'height':containerHeight + 'px;padding: 5px 0'}">
|
<EventList ref="refPrjList" :listType="eventListParam.listType" :sql="eventListParam.sql"
|
:order="eventListParam.order" :type="eventListParam.type" :status="eventListParam.status"
|
:quadrant="eventListParam.quadrant"></EventList>
|
</view>
|
<view class="uni-panel-button-add fs-CirclPlus" v-if="apptype != 'HangChaTesting'" @click="clickAddPrjEvent"
|
@touchstart='btnTouchStart' @touchmove='btnTouchMove'
|
:style="{transform:`translate(${btninfo.x}px,${btninfo.y}px) scale(1)`}"></view>
|
<view>
|
<!-- 普通弹窗 -->
|
<uni-popup ref="refPopupLeft" background-color="#fff">
|
<view class="popup-content"
|
:style="{'height':containerHeight + 'px;padding: 2px 4px 12px;margin-top:'+navigationBarHeight + 'px;'}">
|
<EventMenu style="display: flex;" :myPrjList="myPrjList" @selFactor="clickFactor"></EventMenu>
|
</view>
|
</uni-popup>
|
<uni-popup ref="refPopupRight" background-color="#fff" @change="changeRightMenu">
|
<view class="popup-content2"
|
:style="{height:`${containerHeight}px`,padding:'2px 4px 12px','margin-top':`${navigationBarHeight}px`}">
|
<EventSearchMenu style="height:100%" :searchKey="eventListParam.key" :type="eventListParam.type"
|
:sort="eventListParam.sort" :status="eventListParam.status" :quadrant="eventListParam.quadrant"
|
@selFactor="clickProjEventSearch"></EventSearchMenu>
|
</view>
|
</uni-popup>
|
</view>
|
<view class="clearfix"></view>
|
</view>
|
</template>
|
|
<script>
|
import EventList from "./infos/list.vue"
|
import EventMenu from './infos/menu.vue'
|
import EventSearchMenu from './infos/menu-search.vue'
|
import TaskInit from "@/common/extend.js"
|
import Session from "@/common/utils.js"
|
import {
|
showModal,
|
showToast
|
} from "@/common/Page.js"
|
import {
|
getAnalysisList as projectGetAnalysisList,
|
} from "@/api/gungho/project.js"
|
export default {
|
components: {
|
EventList,
|
EventMenu,
|
EventSearchMenu,
|
},
|
name: "pageProjectEvent",
|
data() {
|
return {
|
//safeAreaHeight:getApp().globalData.safeAreaHeight,
|
apptype: getApp().globalData.apptype,
|
navigationBarHeight: 0,
|
containerHeight: 0,
|
navigationBarTitle: "项目反馈",
|
eventListParam: {
|
sql: "",
|
order: "",
|
listType: "",
|
type: [],
|
status: [],
|
quadrant: [],
|
proj: {},
|
key: "",
|
sort: ""
|
},
|
|
myPrjList: [],
|
btninfo: {
|
lx: 0,
|
ly: 0,
|
x: 0,
|
y: 0
|
},
|
isSearchMenuOpen: false,
|
};
|
},
|
methods: {
|
setData: function(obj) {
|
let that = this;
|
let keys = [];
|
let val, data;
|
|
Object.keys(obj).forEach(function(key) {
|
keys = key.split(".");
|
val = obj[key];
|
data = that.$data;
|
keys.forEach(function(key2, index) {
|
if (index + 1 == keys.length) {
|
that.$set(data, key2, val);
|
} else {
|
if (!data[key2]) {
|
that.$set(data, key2, {});
|
}
|
}
|
data = data[key2];
|
});
|
});
|
},
|
clickBarLeft() {
|
if (this.apptype == 'HangChaTesting') {
|
return
|
}
|
// console.log("tasks clickBarLeft",this,this.$refs,this.$refs.refPopupRight)
|
this.$refs.refPopupRight.close()
|
this.$refs.refPopupLeft.open("left")
|
|
|
},
|
clickBarRight() {
|
this.$refs.refPopupLeft.close()
|
|
this.$refs.refPopupRight.open("right")
|
},
|
clickBarTitle() {
|
if (this.$refs.refPopupLeft.showPopup)
|
this.$refs.refPopupLeft.close()
|
if (this.$refs.refPopupRight.showPopup)
|
this.$refs.refPopupRight.close()
|
},
|
clickFactor(item) {
|
this.$refs.refPopupLeft.close()
|
const prj = {
|
id: item.prjId || "",
|
name: item.prjName || "",
|
}
|
const param = {
|
listType: item.listType,
|
type: this.eventListParam.type,
|
status: item.status,
|
quadrant: this.eventListParam.quadrant,
|
proj: prj,
|
key: "",
|
sort: ""
|
}
|
Session.setValue("page_prjevent", param)
|
param.ket = ""
|
const {
|
sql,
|
order,
|
title
|
} = this.getPrjEventQuerySql(param.listType, param.type, param.status, param.quadrant, "", "", param.proj)
|
param.sql = sql
|
param.order = order
|
this.setData({
|
eventListParam: param,
|
navigationBarTitle: title
|
})
|
|
},
|
getPrjEventQuerySql(type, eventType, eventStatus, quadrants, eventSort, eventKey, proj) {
|
let sqlStatus = ""
|
let sqlUser = ""
|
let order = ""
|
let sql = ""
|
let title = ""
|
const app = getApp()
|
const token = app.globalData.userdata.user_login;
|
|
order = " CN_T_CREATE desc";
|
if (Array.isArray(eventStatus)) {
|
if (eventStatus.length > 0) {
|
let sqlStatusTemp = ""
|
for (let i = 0; i < eventStatus.length; i++) {
|
|
if (eventStatus[i]) {
|
if (sqlStatusTemp != "") {
|
sqlStatusTemp += " OR "
|
}
|
if (eventStatus[i] == '未关闭') {
|
sqlStatusTemp += `CN_S_STATE not in ('关闭','不处理','删除')`
|
} else {
|
sqlStatusTemp += `CN_S_STATE ='${eventStatus[i]}'`
|
}
|
|
}
|
}
|
if (sqlStatusTemp)
|
sqlStatus = `(${sqlStatusTemp})`;
|
} else {
|
sqlStatus =`CN_S_STATE not in ('关闭','不处理','删除')`
|
}
|
} else {
|
sqlStatus = `CN_S_STATE not in ('关闭','不处理','删除')`
|
}
|
|
let sqlType = ""
|
if (Array.isArray(eventType)) {
|
if (eventType.length > 0) {
|
let sqlEventTypeTemp = ""
|
for (let i = 0; i < eventType.length; i++) {
|
|
if (eventType[i]) {
|
let sqlTemp = `CN_S_E_TYPE ='${eventType[i]}'`;
|
if (sqlEventTypeTemp != "") {
|
sqlEventTypeTemp += " OR "
|
}
|
sqlEventTypeTemp += sqlTemp
|
}
|
|
}
|
if (sqlEventTypeTemp)
|
sqlType = `(${sqlEventTypeTemp})`;
|
}
|
}
|
let sqlQuadrant = ""
|
if (Array.isArray(quadrants)) {
|
if (quadrants.length > 0) {
|
let sqlQuadrantTemp = ""
|
for (let i = 0; i < quadrants.length; i++) {
|
|
let quadrant = quadrants[i]
|
if (quadrant) {
|
let sqlTemp = `CN_N_QUADRANT ='${quadrant}'`;
|
if (sqlQuadrantTemp != "") {
|
sqlQuadrantTemp += " OR "
|
}
|
sqlQuadrantTemp += sqlTemp
|
}
|
|
}
|
if (sqlQuadrantTemp)
|
sqlQuadrant = `(${sqlQuadrantTemp})`;
|
}
|
}
|
|
if (eventSort) {
|
order = `${eventSort} desc`;
|
}
|
title = type
|
if (type == "我创建的") {
|
sqlUser = "CN_S_CREATOR_ID='" + token + "'";
|
} else if (type == "我相关的") {
|
sqlUser =
|
` CN_G_ID in (select CN_G_PRJE_ID FROM OI_PM_PRJE_RELATION_PERSON where CN_S_PERSON_ID='${token}')`
|
} else if (type == "我的项目") {
|
if (proj.id) {
|
title = proj.name;
|
let prjId = proj.id
|
prjId = prjId.replace("{", "")
|
prjId = prjId.replace("}", "")
|
sqlUser = " CN_G_PRJ_ID ='" + prjId + "' ";
|
} else {
|
sqlUser = "CN_S_TAKEON_ID ='" + token + "' ";
|
title = "我负责的";
|
sqlStatus = `CN_S_STATE not in ('关闭','不处理')`
|
}
|
|
} else //我负责的
|
{
|
sqlUser = "CN_S_TAKEON_ID ='" + token + "' ";
|
}
|
sql = sqlUser
|
if (sqlType != "")
|
sql += " AND " + sqlType
|
if (sqlStatus != "")
|
sql += " AND " + sqlStatus
|
if (eventKey != "")
|
sql += " AND CN_S_TITLE LIKE '%%" + eventKey + "%%' ";
|
if (sqlQuadrant != "")
|
sql += " AND " + sqlQuadrant
|
console.log(sql)
|
return {
|
sql,
|
order,
|
title: title + "事件"
|
}
|
|
|
},
|
clickProjEventSearch(item) {
|
|
this.$refs.refPopupRight.close()
|
|
|
const param = {
|
listType: this.eventListParam.listType,
|
type: item.type,
|
status: item.status,
|
quadrant: item.quadrant,
|
proj: this.eventListParam.proj,
|
sort: item.sort,
|
}
|
Session.setValue("page_prjevent", param)
|
param.key = item.key
|
const {
|
sql,
|
order,
|
title
|
} = this.getPrjEventQuerySql(param.listType, param.type, param.status, param.quadrant, param.sort,
|
param.key, param.proj)
|
param.sql = sql
|
param.order = order
|
this.setData({
|
eventListParam: param,
|
})
|
|
|
},
|
btnTouchStart(e) {
|
this.btninfo.lx = e.touches[0].clientX;
|
this.btninfo.ly = e.touches[0].clientY;
|
},
|
btnTouchMove(e) {
|
this.btninfo.x += (e.touches[0].clientX - this.btninfo.lx)
|
this.btninfo.y += (e.touches[0].clientY - this.btninfo.ly)
|
this.btninfo.lx = e.touches[0].clientX;
|
this.btninfo.ly = e.touches[0].clientY;
|
Session.setValue('prjevent_btninfo', this.btninfo)
|
},
|
clickAddPrjEvent() {
|
let prjId = this.eventListParam.proj?.id || "";
|
let prjName = this.eventListParam.proj?.name || ""
|
uni.navigateTo({
|
url: `/pages/project/event/create?prjId=${prjId}&prjName=${prjName}`
|
})
|
},
|
changeRightMenu(evt) {
|
// console.log("changeRightMenu", evt)
|
this.isSearchMenuOpen = evt.show
|
},
|
|
showError(ex) {
|
let tip = typeof ex === 'string' ? ex :( ex.message || ex.err_msg || ex.errMsg || ex.err_info || "")
|
|
showModal(tip, "提示", false)
|
},
|
|
},
|
onTabItemTap(item) {
|
//console.log("tasks onTabItemTap",item)
|
let default_pageinfo = {}
|
default_pageinfo.pagePath = item.pagePath
|
Session.setDefaultPageInfo(default_pageinfo)
|
projectGetAnalysisList({
|
PrjRel: 0,
|
NumPerPage: 999
|
}).then((res) => {
|
this.myPrjList = res ? (res.PrjList || []) : [];
|
})
|
},
|
onPullDownRefresh() {
|
if (this.eventListParam.sql)
|
this.$refs.refPrjList.onRefresh()
|
uni.stopPullDownRefresh()
|
},
|
|
onLoad() {
|
const res = uni.getSystemInfoSync();
|
// vue3 要减去导航栏和状态栏高度
|
|
// #ifdef MP-DINGTALK
|
|
this.navigationBarHeight = res.statusBarHeight + res.titleBarHeight
|
if (res.platform == "devtools")
|
this.containerHeight = res.windowHeight
|
else
|
this.containerHeight = res.windowHeight - this.navigationBarHeight
|
// #endif
|
// #ifndef MP-DINGTALK
|
this.containerHeight = res.windowHeight - 50 - res.statusBarHeight;
|
if (res.windowHeight == res.screenHeight)
|
this.containerHeight -= 50;
|
this.navigationBarHeight = res.statusBarHeight + 50
|
// #endif
|
this.containerHeight -= 10
|
//let sText= "tasks onload" + this.containerHeight+ JSON.stringify(res)
|
|
let btninfo = Session.getValue('prjevent_btninfo')
|
if (btninfo) {
|
|
if (btninfo.x > 10) {
|
btninfo.x = 10
|
}
|
if (btninfo.x > 40) {
|
btninfo.x = 40
|
}
|
this.btninfo = btninfo
|
}
|
|
let default_pageinfo = Session.getValue("page_prjevent")
|
|
const param = {
|
listType: "我负责的",
|
type: [],
|
status: [],
|
quadrant: [],
|
proj: {},
|
key: "",
|
sort: ""
|
}
|
// if (default_pageinfo) {
|
|
// param.listType = default_pageinfo.listType || "我负责的",
|
// param.type = default_pageinfo.type || [],
|
// param.status = default_pageinfo.status || [],
|
// param.quadrant = default_pageinfo.quadrant || [],
|
// param.proj = default_pageinfo.proj || {},
|
// param.sort = default_pageinfo.sort || ""
|
|
|
// } else
|
// {
|
// default_pageinfo = {}
|
// var pages = getCurrentPages()
|
// default_pageinfo.pagePath = pages[0].route
|
// Session.setDefaultPageInfo(default_pageinfo)
|
// }
|
const {
|
sql,
|
order,
|
title
|
} = this.getPrjEventQuerySql(param.listType, param.type, param.status, param.quadrant, param
|
.sort, "", param.proj)
|
param.sql = sql
|
param.order = order
|
this.setData({
|
eventListParam: param,
|
navigationBarTitle: title
|
})
|
},
|
setup() {
|
|
},
|
}
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #f3f6f7;
|
}
|
|
.uni-project-event-container {
|
height: 100vh;
|
width: 750rpx;
|
font-size: 14px;
|
|
|
.uni-navbar-container-inner {
|
display: flex;
|
flex: 1;
|
flex-direction: row;
|
align-items: center;
|
font-size: 16px;
|
overflow: hidden;
|
|
/* #ifdef MP-DINGTALK */
|
font-weight: 600;
|
color: #fff;
|
/* #endif */
|
/* #ifdef MP-WEIXIN || MP-LARK */
|
justify-content: center;
|
color: #333;
|
/* #endif */
|
}
|
|
.uni-nav-bar-text {
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
|
|
}
|
|
.uni-panel {
|
background-color: #e8ebec;
|
}
|
|
.uni-panel-body {
|
height: 100%;
|
}
|
|
.clearfix {
|
content: " ";
|
box-sizing: border-box;
|
}
|
|
.uni-panel-event-condition {
|
display: flex;
|
flex-direction: row !important;
|
align-items: center !important;
|
padding: 8px 10px 8px 12px;
|
font-size: 14px;
|
}
|
|
.uni-panel-text {
|
flex: 1;
|
color: #000000;
|
font-weight: normal;
|
}
|
|
.uni-panel-bar-icon {
|
font-weight: normal;
|
font-size: 20px;
|
color: #505050;
|
cursor: pointer;
|
}
|
|
.uni-panel-down-arrow {
|
margin-left: 8px;
|
margin-top: 5px;
|
border: 7px solid #ffffff;
|
border-color: transparent;
|
border-top-color: #000000
|
}
|
|
.popup-content {
|
display: flex;
|
justify-content: center;
|
flex-direction: column;
|
background-color: transparent;
|
}
|
|
.popup-content2 {
|
display: flex;
|
flex-direction: column;
|
background-color: transparent;
|
}
|
|
.uni-panel-radius2 {
|
display: flex;
|
margin: 0px 8px 0px 2px;
|
width: 16px;
|
height: 16px;
|
border-radius: 5px;
|
background-color: #000;
|
}
|
|
.uni-panel-button-add {
|
font-size: 40px;
|
border-radius: 50%;
|
position: fixed;
|
z-index: 15;
|
bottom: 40px;
|
right: 10px;
|
color: #00aaff;
|
background: #fff;
|
box-shadow: 0 1px 5px 2px rgb(0 0 0 / 30%);
|
}
|
|
.uni-navbar__header {
|
/* #ifdef MP-WEIXIN || MP-DINGTALK */
|
padding-right: 112px !important;
|
/* #endif */
|
/* #ifdef MP-LARK */
|
padding-right: 75px !important;
|
/* #endif */
|
}
|
}
|
</style>
|