<template>
|
<view class="uni-project-event-menu-search">
|
<view class="cantainer-menu-content">
|
<view class="uni-panel-line">
|
<view class="uni-panel-search-content">
|
<view class="uni-panel-search-ico">
|
<uni-icons color="#333" size="20" type="search" />
|
</view>
|
<input class="uni-panel-search-input" type="text" v-model="searchtext" placeholder="输入事件名称" />
|
<text class="uni-panel-search-ico fs-delete_solid_circle" style="color: gray;" v-if="searchtext"
|
@click="clickCancelKey"></text>
|
</view>
|
</view>
|
<view class="uni-panel-line">
|
事件排序
|
</view>
|
<view class="uni-panel-line">
|
<uni-data-select v-model="eventSortCur" :localdata="eventSortTypes" :clear="false"></uni-data-select>
|
</view>
|
<view class="uni-panel-line">
|
事件类型
|
</view>
|
<view class="uni-panel-line">
|
<uni-data-select v-model="eventTypeCur" :localdata="eventTypeGroup" clear></uni-data-select>
|
</view>
|
<view class="uni-panel-line">
|
事件状态
|
</view>
|
<view class="uni-panel-line">
|
<uni-data-select v-model="eventStatusCur" :localdata="eventStatusGroup" clear></uni-data-select>
|
</view>
|
<view class="uni-panel-line">
|
事件重要紧急度
|
</view>
|
<view class="uni-panel-line">
|
<uni-data-select v-model="eventQuadrantCur" :localdata="eventQuadrantTypes" clear></uni-data-select>
|
</view>
|
</view>
|
<view class="uni-panel-bottom">
|
<button class="uni-panel-button" @click="clickReset">清空搜索</button>
|
<button class="uni-panel-button" @click="clickFinish">搜索</button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import Session from "@/common/utils.js"
|
import {
|
showModal,
|
showToast,
|
showLoading,
|
hideLoading
|
} from "@/common/Page.js"
|
export default {
|
name: "pageProjectEventMenuSearch",
|
emits: ['selFactor'],
|
props: {
|
|
sort: {
|
type: String,
|
default () {
|
return "CN_T_CREATE"
|
}
|
},
|
searchKey: {
|
type: String,
|
default () {
|
return ""
|
}
|
},
|
type: {
|
type: Array,
|
default () {
|
return []
|
}
|
},
|
status: {
|
type: Array,
|
default () {
|
return []
|
}
|
},
|
quadrant: {
|
type: Array,
|
default () {
|
return []
|
}
|
},
|
},
|
data() {
|
return {
|
searchtext: '',
|
eventSortCur: "CN_T_CREATE",
|
eventTypeCur: "",
|
eventStatusCur: "",
|
eventQuadrantCur: "",
|
eventTypeGroup: [{
|
value: '问题',
|
text: '问题'
|
}, {
|
value: '错误',
|
text: '错误',
|
},
|
{
|
value: '需求',
|
text: '需求'
|
},
|
{
|
value: '建议',
|
text: '建议'
|
},
|
{
|
value: '讨论',
|
text: '讨论'
|
},
|
|
|
|
],
|
eventStatusGroup: [{
|
value: '未关闭',
|
text: '未关闭',
|
},
|
{
|
value: '关闭',
|
text: '关闭'
|
},
|
{
|
value: '提出',
|
text: '提出'
|
},
|
{
|
value: '确定',
|
text: '确定'
|
},
|
{
|
value: '处理中',
|
text: '处理中'
|
},
|
{
|
value: '检查',
|
text: '检查'
|
},
|
{
|
value: '暂不处理',
|
text: '暂不处理'
|
},
|
{
|
value: '不处理',
|
text: '不处理'
|
},
|
|
|
],
|
|
eventQuadrantTypes: [{
|
value: '3',
|
text: '重要紧急'
|
},
|
{
|
value: '2',
|
text: '紧急不重要'
|
},
|
{
|
value: '1',
|
text: '重要不紧急',
|
},
|
{
|
value: '0',
|
text: '不重要不紧急',
|
}
|
|
],
|
eventSortTypes: [{
|
value: 'CN_T_CREATE',
|
text: '创建时间',
|
},
|
{
|
value: 'CN_T_PLAN_CLOSE',
|
text: '要求关闭日期'
|
},
|
{
|
value: 'CN_S_STATE',
|
text: '事件状态'
|
},
|
{
|
value: 'CN_S_E_TYPE',
|
text: '事件类型',
|
},
|
{
|
value: 'CN_S_CREATOR',
|
text: '创建者'
|
},
|
|
]
|
}
|
},
|
computed: {
|
|
|
},
|
watch: {
|
searchKey(newVal) {
|
this.searchtext = `${newVal}`
|
},
|
sort(newVal) {
|
this.eventSortCur = `${newVal}`
|
},
|
type(newVal) {
|
let values = newVal
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventTypeCur = values[0]
|
}
|
}
|
|
},
|
status(newVal) {
|
let values = newVal
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventStatusCur = values[0]
|
}
|
}
|
},
|
quadrant(newVal) {
|
let values = newVal
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventQuadrantCur = values[0]
|
}
|
}
|
|
|
},
|
|
},
|
methods: {
|
setData(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];
|
});
|
});
|
},
|
clickReset() {
|
this.searchtext = ""
|
this.eventSortCur = 'CN_T_CREATE'
|
this.eventTypeCur = ''
|
this.eventStatusCur = ''
|
this.eventQuadrantCur = ''
|
this.$emit('selFactor', {
|
sort: this.eventSortCur,
|
type: [],
|
status: [],
|
quadrant: [],
|
key: "",
|
})
|
// console.log("clickReset");
|
},
|
clickFinish() {
|
this.$emit('selFactor', {
|
sort: this.eventSortCur,
|
type: this.eventTypeCur ? [this.eventTypeCur] : [],
|
status: this.eventStatusCur ? [this.eventStatusCur] : [],
|
quadrant: this.eventQuadrantCur ? [this.eventQuadrantCur] : [],
|
key:this.searchtext,
|
})
|
},
|
clickCancelKey() {
|
this.searchtext = ""
|
},
|
showError(ex) {
|
let tip = typeof ex == 'string' ? ex : typeof ex.err_msg == 'string' ? ex.err_msg : typeof ex.errMsg ==
|
'string' ? ex.errMsg : ""
|
showModal(tip, "提示", false)
|
},
|
|
},
|
mounted() {
|
this.searchtext = this.searchKey
|
|
this.eventSortCur = this.sort ? this.sort : 'CN_T_CREATE'
|
let values = this.type
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventTypeCur = values[0]
|
}
|
|
}
|
values = this.status
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventStatusCur = values[0]
|
}
|
|
}
|
values = this.quadrant
|
if (Array.isArray(values)) {
|
if (values.length > 0) {
|
this.eventQuadrantCur = values[0]
|
}
|
}
|
},
|
}
|
</script>
|
|
<style lang="scss">
|
.uni-project-event-menu-search {
|
display: flex;
|
background-color: transparent;
|
flex-direction: column !important;
|
width: 540rpx;
|
height: 100%;
|
margin-top: 10rpx;
|
|
.cantainer-menu-content {
|
display: flex;
|
flex: 1;
|
flex-direction: column !important;
|
width: 100%;
|
padding: 2px 0 8px;
|
overflow: auto;
|
bottom: 60px;
|
}
|
|
.uni-panel-bottom {
|
display: flex;
|
width: 100%;
|
height: 60px;
|
background-color: #eee;
|
}
|
|
.uni-panel-button {
|
flex: 1;
|
color: #fff;
|
margin: 6px 5px 8px;
|
border-radius: 8px;
|
background-color: #00aaff;
|
}
|
|
.uni-panel-disable-button {
|
flex: 1;
|
margin: 6px 5px 8px;
|
background-color: #fff;
|
color: #aaa;
|
}
|
|
.uni-panel-line {
|
width: calc(100% - 45rpx);
|
padding: 10rpx 30rpx 10rpx 15rpx;
|
}
|
|
.uni-panel-title {
|
font-weight: 500;
|
}
|
|
.uni-panel-search {
|
|
display: flex;
|
align-items: center !important;
|
padding: 0 4px;
|
font-size: 14px;
|
top: 0;
|
}
|
|
.uni-panel-search-content {
|
display: flex;
|
width: 100%;
|
background-color: #fff;
|
border: 1px solid #eee;
|
border-radius: 5px;
|
padding: 2px;
|
flex-direction: row !important;
|
align-items: center;
|
}
|
|
|
|
.uni-panel-search-content:focus {
|
border: 1px solid blue;
|
}
|
|
.uni-panel-search-input {
|
flex: 1;
|
margin: 4px 5px;
|
}
|
|
.uni-panel-search-ico {
|
display: flex;
|
margin: 4px 0;
|
font-size: 18px;
|
|
}
|
|
.uni-panel-search-left {
|
display: flex;
|
flex-direction: row !important;
|
justify-content: center;
|
|
.uni-down-arrow {
|
display: flex;
|
margin-left: -2px;
|
margin-top: 10px;
|
border: 7px solid #ffffff;
|
border-color: transparent;
|
border-top-color: #333
|
}
|
}
|
|
.uni-proj-content {
|
display: flex;
|
flex-direction: column !important;
|
// margin: -10rpx 30rpx 10rpx 15rpx;
|
margin-top: -20rpx;
|
border: 1px solid #eee;
|
border-top: 0;
|
width: 100%;
|
|
.uni-proj-item {
|
display: flex;
|
flex-direction: row !important;
|
align-items: center;
|
background-color: #eeeeee80;
|
font-size: 14px;
|
// height: 32px;
|
// line-height: 32px;
|
border-bottom: 1px solid #eee;
|
padding: 8px;
|
white-space: nowrap !important;
|
overflow: hidden !important;
|
text-overflow: ellipsis !important;
|
}
|
}
|
}
|
</style>
|