初始提交
This commit is contained in:
103
pages/workFlow/operate/components/CommonList.vue
Normal file
103
pages/workFlow/operate/components/CommonList.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<view class="common-list-v" v-if="show">
|
||||
<view class="common-list-contain">
|
||||
<view class="common-list-main u-p-20 u-flex-col">
|
||||
<view class="common-list-search" style=" ">
|
||||
<uni-search-bar radius="100" placeholder="请输入" clearButton="always" cancelButton="always"
|
||||
@cancel="cancel" v-model="searchValue" focus />
|
||||
</view>
|
||||
<view class="" style="flex: 1;margin-top: 10rpx; overflow-y: scroll;" v-if="columnList.length">
|
||||
<view class="u-line-1" style="width: 100%;height:68rpx;line-height: 68rpx;"
|
||||
v-for="(item,index) in columnList" :key="index" @click.stop="selectConfirm(item)">
|
||||
{{item.commonWordsText}}
|
||||
</view>
|
||||
</view>
|
||||
<JnpfEmpty v-else />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getSelector
|
||||
} from "@/api/commonWords.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
commonWordsList: [],
|
||||
searchValue: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
columnList() {
|
||||
return this.commonWordsList.filter((o) => (o.commonWordsText && o.commonWordsText.match(this.searchValue)))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.show = true
|
||||
this.getCommonList()
|
||||
},
|
||||
cancel() {
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.searchValue = ""
|
||||
this.show = false
|
||||
},
|
||||
selectConfirm(item) {
|
||||
this.$emit('confirm', item)
|
||||
|
||||
this.close()
|
||||
},
|
||||
getCommonList() {
|
||||
getSelector().then((res) => {
|
||||
let list = JSON.parse(JSON.stringify(res.data.list)) || []
|
||||
this.commonWordsList = list
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.common-list-v {
|
||||
z-index: 9000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh !important;
|
||||
|
||||
|
||||
|
||||
|
||||
.common-list-contain {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.common-list-main {
|
||||
background: white;
|
||||
|
||||
height: 100%;
|
||||
|
||||
|
||||
.common-list-search {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
|
||||
.uni-searchbar {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
|
||||
.uni-searchbar__box {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
130
pages/workFlow/operate/components/HandleOpinion.vue
Normal file
130
pages/workFlow/operate/components/HandleOpinion.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="opinion">
|
||||
<view class="opinion-box">
|
||||
<u-input type="textarea" v-model="handleOpinion" placeholder="请输入" :inputBorder='false' @input="onInput"
|
||||
class="easyinput" :clearable="true" focus></u-input>
|
||||
<view class="u-m-t-10 u-flex opinion-inner" v-if="showCommon">
|
||||
<view class="u-flex opinion-l" v-if="commonList.length">
|
||||
<text class="u-line-1 common-txt" v-if="commonList[0]"
|
||||
@click.stop="addTextareaValue(0)">{{commonList[0].commonWordsText}}</text>
|
||||
<text class="common-txt u-m-l-10 u-line-1" v-if="commonList[1]"
|
||||
@click.stop="addTextareaValue(1)">{{commonList[1].commonWordsText}}</text>
|
||||
</view>
|
||||
<view class="u-flex opinion-r">
|
||||
<text class="txt" @click.stop="addCommonWords">设为常用语</text>
|
||||
<view class="icon-box" @click="showCommonList">
|
||||
<u-icon name="search" color="#565656" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<CommonList ref="CommonList" @confirm="confirmCommonWord"></CommonList>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CommonList from './CommonList'
|
||||
export default {
|
||||
emits: ['addCommonWords', 'update:modelValue'],
|
||||
name: 'handle-opinion',
|
||||
components: {
|
||||
CommonList
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [String, Number]
|
||||
},
|
||||
commonList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
showCommon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue: {
|
||||
handler(val) {
|
||||
this.handleOpinion = val
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
handleOpinion: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirmCommonWord(e) {
|
||||
this.handleOpinion = e.commonWordsText
|
||||
this.$emit('update:modelValue', this.handleOpinion)
|
||||
},
|
||||
addCommonWords() {
|
||||
if (!this.handleOpinion) return this.$u.toast('请输入意见');
|
||||
this.$emit('addCommonWords')
|
||||
},
|
||||
onInput(e) {
|
||||
this.$emit('update:modelValue', e)
|
||||
},
|
||||
addTextareaValue(i) {
|
||||
this.handleOpinion += this.commonList[i].commonWordsText
|
||||
this.$emit('update:modelValue', this.handleOpinion)
|
||||
},
|
||||
showCommonList() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.CommonList.open();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.opinion {
|
||||
width: 100%;
|
||||
|
||||
.opinion-box {
|
||||
border-radius: 8rpx;
|
||||
padding: 0 20rpx 10rpx 20rpx;
|
||||
background: #f5f5f5 !important;
|
||||
|
||||
.opinion-inner {
|
||||
|
||||
|
||||
.opinion-l {
|
||||
max-width: 62%;
|
||||
|
||||
.common-txt {
|
||||
max-width: 240rpx;
|
||||
display: inline-block;
|
||||
border: 1rpx dashed #dcdfe6;
|
||||
padding: 0 10rpx;
|
||||
background-color: #fff;
|
||||
color: #303133;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.opinion-r {
|
||||
flex: 1;
|
||||
justify-content: flex-end;
|
||||
|
||||
.txt {
|
||||
padding: 0 10rpx;
|
||||
color: #0177FF;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
width: 60rpx;
|
||||
text-align: center;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user