|
@@ -88,10 +88,6 @@
|
|
|
|
|
|
<!-- 标签栏(按钮) -->
|
|
<!-- 标签栏(按钮) -->
|
|
<div style="text-align:center; margin-bottom: 10px" id='list-btn-div'>
|
|
<div style="text-align:center; margin-bottom: 10px" id='list-btn-div'>
|
|
- <!-- <b-button size="sm" pill variant="outline-success" @click="getNoticeList()">通知</b-button>
|
|
|
|
- <b-button size="sm" pill variant="outline-success" @click="getReportList()">报道</b-button>
|
|
|
|
- <b-button size="sm" pill variant="outline-success" @click="getCultureList()">文化</b-button>
|
|
|
|
- <b-button size="sm" pill variant="outline-success" @click="getOthersList()">更多</b-button> -->
|
|
|
|
<b-form-radio-group
|
|
<b-form-radio-group
|
|
id="btn-radios-2"
|
|
id="btn-radios-2"
|
|
v-model="selected"
|
|
v-model="selected"
|
|
@@ -236,7 +232,7 @@ export default {
|
|
this.$axios
|
|
this.$axios
|
|
.get('/notice/list')
|
|
.get('/notice/list')
|
|
.then(function (response) {
|
|
.then(function (response) {
|
|
- that.listData.notice = response.data
|
|
|
|
|
|
+ that.listData.notice = response.data.sort(that.compare('level'))
|
|
// 浅拷贝到当前的通知列表数组
|
|
// 浅拷贝到当前的通知列表数组
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.notice))
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.notice))
|
|
that.currentMsgType = 'notice'
|
|
that.currentMsgType = 'notice'
|
|
@@ -252,7 +248,7 @@ export default {
|
|
this.$axios
|
|
this.$axios
|
|
.get('/report/list')
|
|
.get('/report/list')
|
|
.then(function (response) {
|
|
.then(function (response) {
|
|
- that.listData.report = response.data
|
|
|
|
|
|
+ that.listData.report = response.data.sort(that.compare('level'))
|
|
// 浅拷贝到当前的通知列表数组
|
|
// 浅拷贝到当前的通知列表数组
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.report))
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.report))
|
|
that.currentMsgType = 'report'
|
|
that.currentMsgType = 'report'
|
|
@@ -267,7 +263,7 @@ export default {
|
|
this.$axios
|
|
this.$axios
|
|
.get('/culture/list')
|
|
.get('/culture/list')
|
|
.then(function (response) {
|
|
.then(function (response) {
|
|
- that.listData.culture = response.data
|
|
|
|
|
|
+ that.listData.culture = response.data.sort(that.compare('level'))
|
|
// 浅拷贝到当前的通知列表数组
|
|
// 浅拷贝到当前的通知列表数组
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.culture))
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.culture))
|
|
that.currentMsgType = 'culture'
|
|
that.currentMsgType = 'culture'
|
|
@@ -282,13 +278,22 @@ export default {
|
|
this.$axios
|
|
this.$axios
|
|
.get('/others/list')
|
|
.get('/others/list')
|
|
.then(function (response) {
|
|
.then(function (response) {
|
|
- that.listData.others = response.data
|
|
|
|
|
|
+ that.listData.others = response.data.sort(that.compare('level'))
|
|
// 浅拷贝到当前的通知列表数组
|
|
// 浅拷贝到当前的通知列表数组
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.others))
|
|
that.listData.current = JSON.parse(JSON.stringify(that.listData.others))
|
|
- that.currentMsgType = 'other'
|
|
|
|
|
|
+ that.currentMsgType = 'others'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 比较重要级 property:为比较的字段 代码修改
|
|
|
|
+ compare(property){
|
|
|
|
+ return function(a,b){
|
|
|
|
+ var value1 = a[property];
|
|
|
|
+ var value2 = b[property];
|
|
|
|
+ return value2 - value1 ;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
// 按钮点击事件,更新列表
|
|
// 按钮点击事件,更新列表
|
|
updateList: function (value) {
|
|
updateList: function (value) {
|
|
switch (value) {
|
|
switch (value) {
|