diff --git a/pages/addressBook/addressBook.vue b/pages/addressBook/addressBook.vue index d513eba..7584557 100644 --- a/pages/addressBook/addressBook.vue +++ b/pages/addressBook/addressBook.vue @@ -22,7 +22,7 @@
-
-
+
{{item.userName.slice(0, 1)}}
-
{{item.userName}}
-
{{item.phone}}
+ +
{{item.duty}} @@ -90,22 +91,47 @@ watch: { treePath(newData,oldData){ const last = this.treePath[this.treePath.length-1] - if(last.data.children === null){ - this.getPerson({code:last.code}) + if(this.keyword){ + this.getPerson({code:last.code, name:this.keyword}) }else{ - this.personList = [] + if(last.data.children === null){ + this.getPerson({code:last.code}) + }else{ + this.personList = [] + } } } }, + onShow() { + this.getSearch(this.keyword) + }, methods: { + getHighlight(val) { + const keyword = this.keyword + if (keyword && val.indexOf(keyword) !== -1) { + const text = val.replace(keyword, `${keyword}`) + console.log(text) + return text + } else { + return val + } + }, + highlightKeyword(text, keyword) { + const highlightedText = text.replace(new RegExp(keyword, 'gi'), match => { + return `${match}`; + }); + return highlightedText; + }, getSearch(e) { if(e){ - this.getPerson({name:e}) + const last = this.treePath[this.treePath.length-1] + this.getPerson({name:e, code:last.code}) }else{ const last = this.treePath[this.treePath.length-1] if(last.data.children === null){ this.getPerson({code:last.code}) }else{ + // this.getPerson({code:last.code,name:'不可能查到的值'}) this.personList = [] } } @@ -116,14 +142,15 @@ let url = '/gunshiApp/xfflood/addressbook/list/query' if(name){ //搜索名字 - url = '/gunshiApp/xfflood/addressbook/list/query?args='+name + url = '/gunshiApp/xfflood/addressbook/list/query?args='+name+'&departmentCode='+code }else{ //搜索code url = '/gunshiApp/xfflood/addressbook/list/query?departmentCode='+code } + console.log('查询的url',url) const res = await uni.$http.get(url) this.personList = res.data.data - console.log('查询的人员',res.data.data) + console.log('查询的人员',res) }catch(e){ this.personList = [] //TODO handle the exception @@ -235,6 +262,7 @@ } .breadcrumb_item{ padding: 8px; + padding-right: 0px; font-size: 14px; } .deptItem{ diff --git a/pages/addressBook/follow.vue b/pages/addressBook/follow.vue index 437d393..de2078d 100644 --- a/pages/addressBook/follow.vue +++ b/pages/addressBook/follow.vue @@ -29,8 +29,8 @@
{{item.userName.slice(0, 1)}}
-
{{item.userName}}
-
{{item.phone}}
+ +
{{item.duty}} @@ -67,6 +67,12 @@ } }, methods: { + highlightKeyword(text, keyword) { + const highlightedText = text.replace(new RegExp(keyword, 'gi'), match => { + return `${match}`; + }); + return highlightedText; + }, async getData () { try { const res = await uni.$http.get('/gunshiApp/xfflood/addressbook/my/attendee') diff --git a/pages/addressBook/myDept.vue b/pages/addressBook/myDept.vue index 35fb360..6933159 100644 --- a/pages/addressBook/myDept.vue +++ b/pages/addressBook/myDept.vue @@ -22,15 +22,23 @@ v-model="keyword" >
- +
{{item.userName.slice(0, 1)}}
-
{{item.userName}}
-
{{item.phone}}
+ +
{{item.duty}} @@ -54,23 +62,40 @@ data() { return { keyword:'', - list:[] + list:[], + deptList:[] }; }, computed: { getList() { if(this.keyword){ - return [...this.list].filter(o=>o.userName.indexOf(this.keyword)!==-1) + return [...this.list].filter(o=>o.userName.indexOf(this.keyword)!==-1||o.phone.indexOf(this.keyword)!==-1) }else{ return [...this.list] } } }, methods: { + highlightKeyword(text, keyword) { + const highlightedText = text.replace(new RegExp(keyword, 'gi'), match => { + return `${match}`; + }); + return highlightedText; + }, async getData () { try { const res = await uni.$http.get('/gunshiApp/xfflood/addressbook/my/department') - this.list = res.data.data + console.log('人员信息',res) + this.list = [...res.data.data,...res.data.data,...res.data.data,...res.data.data] + } catch (e) { + uni.$showMsg() + } + }, + async getDept () { + try { + const res = await uni.$http.get('/gunshiApp/xfflood/addressbook/my/department/super') + console.log('部门信息',res) + this.deptList = res.data.data } catch (e) { uni.$showMsg() } @@ -99,6 +124,7 @@ }, created() { this.getData() + this.getDept() } } @@ -115,7 +141,7 @@ } .mybody{ background-color: #ffffff; - margin: 5px 5px; + // margin: 5px 5px; padding: 5px 0px; height: calc( 100vh - 100px ); overflow: scroll; @@ -150,4 +176,14 @@ display: flex; justify-content: flex-start } +.breadcrumb{ + padding: 10px; + background-color: #ffffff; + border-bottom: 1px solid #eee; +} +.breadcrumb_item{ + padding: 8px; + padding-right: 0px; + font-size: 14px; +} diff --git a/pages/homeIndex/index.vue b/pages/homeIndex/index.vue index 2369415..5dbfef4 100644 --- a/pages/homeIndex/index.vue +++ b/pages/homeIndex/index.vue @@ -5,9 +5,9 @@
@@ -286,6 +286,7 @@ import moment from 'moment' import {level} from "../../pages/utils/dicType" import {disType} from "../utils/dicType.js" import drpOption from "./chartOption.js" +import default_img from "../../static/tabs/touxiang.png" export default { data () { return { @@ -332,7 +333,9 @@ export default { hdList:[], skList:[], readStatus:false, - readYjStatus:false + readYjStatus:false, + default_src: uni.getStorageSync('avatar'), + default_img } }, computed: { diff --git a/pages/rain/Table.vue b/pages/rain/Table.vue index 13c97cd..f75a327 100644 --- a/pages/rain/Table.vue +++ b/pages/rain/Table.vue @@ -1,32 +1,32 @@