清除异常

This commit is contained in:
aixianling
2021-11-30 15:25:24 +08:00
parent 1c3a641cf4
commit 86b7e3f190
2 changed files with 295 additions and 296 deletions

View File

@@ -68,7 +68,7 @@ const start = () => {
navigationStyle: "custom" navigationStyle: "custom"
} }
} }
findApp('src/apps', file => { findApp('src/utils', file => {
if (/.*\\.+\\App[^\\]+\.vue/g.test(file)) { if (/.*\\.+\\App[^\\]+\.vue/g.test(file)) {
let app = { let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'), name: file.replace(/.*\\([^\\]+).vue/g, '$1'),

View File

@@ -10,14 +10,14 @@
<label> <label>
<b v-if="index==0 && item.readStatus==0"></b> <b v-if="index==0 && item.readStatus==0"></b>
<div class="tag" v-if="index==1" :style="color(item.status)"> <div class="tag" v-if="index==1" :style="color(item.status)">
{{$dict.getLabel("announcementStatus",item.status)}} {{ $dict.getLabel("announcementStatus", item.status) }}
</div> </div>
{{item.title}} {{ item.title }}
</label> </label>
<u-gap height="16"></u-gap> <u-gap height="16"></u-gap>
<span class="info"> <span class="info">
<text>{{item.releaseUserName}}</text> <text>{{ item.releaseUserName }}</text>
<text>{{item.releaseTime}}</text> <text>{{ item.releaseTime }}</text>
</span> </span>
</template> </template>
<template v-else> <template v-else>
@@ -26,14 +26,14 @@
<label> <label>
<b v-if="index==0 && item.readStatus==0"></b> <b v-if="index==0 && item.readStatus==0"></b>
<div class="tag" v-if="index==1" :style="color(item.status)"> <div class="tag" v-if="index==1" :style="color(item.status)">
{{$dict.getLabel("announcementStatus",item.status)}} {{ $dict.getLabel("announcementStatus", item.status) }}
</div> </div>
{{item.title}} {{ item.title }}
</label> </label>
<u-gap height="16"></u-gap> <u-gap height="16"></u-gap>
<span class="info"> <span class="info">
<text>{{item.releaseUserName}}</text> <text>{{ item.releaseUserName }}</text>
<text>{{item.releaseTime}}</text> <text>{{ item.releaseTime }}</text>
</span> </span>
</div> </div>
<img :src="item.imgUrl" alt=""> <img :src="item.imgUrl" alt="">
@@ -51,7 +51,7 @@
<div class="colum" v-for="(item,index) in optList" :key="index" @click="handleOpt(item)"> <div class="colum" v-for="(item,index) in optList" :key="index" @click="handleOpt(item)">
<u-icon :name="item.icon" size="100" :custom-style="{backgroundColor:'#fff',borderRadius:'8px'}"></u-icon> <u-icon :name="item.icon" size="100" :custom-style="{backgroundColor:'#fff',borderRadius:'8px'}"></u-icon>
<u-gap height="16"></u-gap> <u-gap height="16"></u-gap>
{{item.name}} {{ item.name }}
</div> </div>
</u-row> </u-row>
<div class="btn" @click="show=false">关闭</div> <div class="btn" @click="show=false">关闭</div>
@@ -66,324 +66,323 @@
</template> </template>
<script> <script>
import AiAdd from "../../components/AiAdd"; import AiAdd from "../../components/AiAdd";
import AiEmpty from "../../components/AiEmpty"; import AiEmpty from "../../components/AiEmpty";
import AiTopFixed from "../../components/AiTopFixed"; import AiTopFixed from "../../components/AiTopFixed";
import {add, detail, read} from "./components" import {add, detail, read} from "./components"
export default { export default {
name: "AppNotification", name: "AppNotification",
appName: "通知公告", appName: "通知公告",
components: {AiAdd, AiEmpty, AiTopFixed, add, detail, read}, components: {AiAdd, AiEmpty, AiTopFixed, add, detail, read},
data() { data() {
return { return {
index: 0, index: 0,
show: false, show: false,
modal: false, modal: false,
content: "", content: "",
current: 1, current: 1,
dataList: [], dataList: [],
detail: {}, detail: {},
showList: true, showList: true,
comp: "", comp: "",
params: null, params: null,
status: "加载更多", status: "加载更多",
} }
},
computed: {
tabs() {
return [{name: "最新公告"}, {name: "公告管理"}];
}, },
optList() {
computed: { return [
tabs() { {
return [{name: "最新公告"}, {name: "公告管理"}]; name: "详情",
}, icon: this.$cdn + "notice/yl.png",
optList() { val: 0,
return [ show: true,
{ },
name: "详情", {
icon: this.$cdn + "notice/yl.png", name: "撤回",
val: 0, icon: this.$cdn + "notice/ch.png",
show: true, val: 1,
}, show: this.detail?.status == 1,
{ },
name: "撤回", {
icon: this.$cdn + "notice/ch.png", name: "发布",
val: 1, icon: this.$cdn + "notice/fb.png",
show: this.detail?.status == 1, val: 2,
}, show: this.detail?.status == 0,
{ },
name: "发布", {
icon: this.$cdn + "notice/fb.png", name: "编辑",
val: 2, icon: this.$cdn + "notice/bj.png",
show: this.detail?.status == 0, val: 3,
}, show: this.detail?.status == 0 || this.detail?.status == 3,
{ }, {
name: "编辑", name: "删除",
icon: this.$cdn + "notice/bj.png", icon: this.$cdn + "notice/sc.png",
val: 3, val: 4,
show: this.detail?.status == 0 || this.detail?.status == 3, show: true,
}, {
name: "删除",
icon: this.$cdn + "notice/sc.png",
val: 4,
show: true,
}
].filter(e => e.show)
}
},
created() {
this.$dict.load("announcementStatus");
},
methods: {
emitShow(){
const {id} = this.$route.query
if(id){
this.comp = "detail";
this.params = {
id,
flag: true
};
this.showList = false;
} }
this.current = 1; ].filter(e => e.show)
this.getList(); }
}, },
emitReachBottom(){
this.current = this.current + 1; created() {
this.getList() this.$dict.load("announcementStatus");
}, },
changeState() {
this.$http.post(this.content == '删除' ? '/app/appannouncement/delete' : "/app/appannouncement/update-status", null, { methods: {
params: { emitShow() {
[this.content == '删除' ? 'ids' : 'id']: this.detail.id const {id} = this.$route.query
} if (id) {
}).then(res => { this.comp = "detail";
if (res.code == 0) { this.params = {
this.$u.toast(this.content + "成功"); id,
this.modal = false; flag: true
this.getList(); };
} this.showList = false;
}) }
}, this.current = 1;
confirm() { this.getList();
},
emitReachBottom() {
this.current = this.current + 1;
this.getList()
},
changeState() {
this.$http.post(this.content == '删除' ? '/app/appannouncement/delete' : "/app/appannouncement/update-status", null, {
params: {
[this.content == '删除' ? 'ids' : 'id']: this.detail.id
}
}).then(res => {
if (res.code == 0) {
this.$u.toast(this.content + "成功");
this.modal = false;
this.getList();
}
})
},
confirm() {
this.show = false;
this.changeState();
},
handleOpt(item) {
this.content = {
1: "撤回",
2: "发布",
4: "删除",
}[item.val];
if (item.val == 0) {
this.show = false; this.show = false;
this.changeState(); this.comp = "detail";
}, this.params = {
handleOpt(item) { id: this.detail.id,
this.content = { flag: true
1: "撤回", };
2: "发布", this.showList = false;
4: "删除", return
}[item.val]; }
if (item.val == 0) { if ([1, 2, 4].includes(item.val)) {
this.show = false; return this.modal = true;
this.comp = "detail"; }
this.params = {
id: this.detail.id,
flag: true
};
this.showList = false;
return
}
if ([1, 2, 4].includes(item.val)) { if (item.val == 3) {
return this.modal = true; this.show = false;
}
if (item.val == 3) {
this.show = false;
this.comp = "add";
this.params = {
id: this.detail.id,
flag: false
};
this.showList = false;
return
}
},
color(status) {
return [
{backgroundColor: "rgba(255,136,34,0.1)", color: "#FF8822"},
{backgroundColor: "rgba(34,102,255,0.1)", color: "#2266FF"},
{backgroundColor: "rgba(102,102,102,0.1)", color: "#666666"},
{backgroundColor: "rgba(255,136,34,0.1)", color: "#FF8822"}
][status];
},
handeClick(item) {
this.detail = item;
if (this.index == 1) {
this.show = true;
} else {
this.comp = "detail";
this.params = {
id: this.detail.id,
flag: true
};
this.showList = false;
}
},
add() {
this.comp = "add"; this.comp = "add";
this.params = { this.params = {
id: null, id: this.detail.id,
flag: false flag: false
}; };
this.showList = false; this.showList = false;
},
change(val) {
this.index = val;
this.current = 1;
this.getList()
},
getList() {
this.$http.post(this.index == 0 ? "/app/appannouncement/list-latest" : "/app/appannouncement/list-mgr", null, {
params: {
size: 10,
current: this.current
}
}).then(res => {
if (res && res.data) {
if (this.current > 1 && this.current > res.data.pages) {
this.status = "已经到底啦"
}
this.dataList = this.current > 1 ? [...this.dataList, ...res.data.records] : res.data.records
}
})
} }
}, },
color(status) {
return [
{backgroundColor: "rgba(255,136,34,0.1)", color: "#FF8822"},
{backgroundColor: "rgba(34,102,255,0.1)", color: "#2266FF"},
{backgroundColor: "rgba(102,102,102,0.1)", color: "#666666"},
{backgroundColor: "rgba(255,136,34,0.1)", color: "#FF8822"}
][status];
},
handeClick(item) {
this.detail = item;
if (this.index == 1) {
this.show = true;
} else {
this.comp = "detail";
this.params = {
id: this.detail.id,
flag: true
};
this.showList = false;
}
},
add() {
this.comp = "add";
this.params = {
id: null,
flag: false
};
this.showList = false;
},
change(val) {
this.index = val;
this.current = 1;
this.getList()
},
getList() {
this.$http.post(this.index == 0 ? "/app/appannouncement/list-latest" : "/app/appannouncement/list-mgr", null, {
params: {
size: 10,
current: this.current
}
}).then(res => {
if (res && res.data) {
if (this.current > 1 && this.current > res.data.pages) {
this.status = "已经到底啦"
}
this.dataList = this.current > 1 ? [...this.dataList, ...res.data.records] : res.data.records
}
})
},
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.notification { .notification {
min-height: 100%; min-height: 100%;
background-color: #F5F5F5; background-color: #F5F5F5;
padding-bottom: 32px; padding-bottom: 32px;
::v-deep .content { ::v-deep .content {
padding: 0 !important; padding: 0 !important;
} }
.body { .body {
box-sizing: border-box;
padding: 32px;
.card {
height: 208px;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
padding: 32px; padding: 32px;
border-radius: 8px;
background-color: #ffffff;
margin-bottom: 32px;
.card { &:last-child {
height: 208px; margin-bottom: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
padding: 32px;
border-radius: 8px;
background-color: #ffffff;
margin-bottom: 32px;
&:last-child {
margin-bottom: 0;
}
& > label {
font-size: 32px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #333333;
line-height: 44px;
}
b {
display: inline-block;
font-style: normal;
width: 16px;
height: 16px;
border-radius: 50%;
background: #FF4466;
margin-right: 8px;
}
.tag {
width: 96px;
height: 44px;
display: inline-block;
border-radius: 8px;
margin-right: 16px;
font-size: 26px;
font-weight: 400;
line-height: 46px;
text-align: center;
}
.info {
font-size: 28px;
color: #999999;
line-height: 40px;
& > text:first-child {
margin-right: 32px;
}
}
& > .has-pic {
display: flex;
justify-content: space-between;
& > .left {
display: flex;
flex-direction: column;
justify-content: space-between;
& > label {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
& > img {
width: 192px;
height: 144px;
flex-shrink: 0;
margin-left: 32px;
}
}
} }
}
.popup-wrap { & > label {
height: 368px; font-size: 32px;
background-color: #F7F7F7; overflow: hidden;
text-overflow: ellipsis;
.btn { display: -webkit-box;
height: 96px; -webkit-box-orient: vertical;
display: flex; -webkit-line-clamp: 2;
align-items: center;
justify-content: center;
font-size: 30px;
font-weight: 500;
color: #333333; color: #333333;
background-color: #ffffff; line-height: 44px;
} }
& > .u-row { b {
height: 272px; display: inline-block;
box-sizing: border-box; font-style: normal;
padding: 0 46px; width: 16px;
height: 16px;
border-radius: 50%;
background: #FF4466;
margin-right: 8px;
}
& > .colum { .tag {
width: 96px;
height: 44px;
display: inline-block;
border-radius: 8px;
margin-right: 16px;
font-size: 26px;
font-weight: 400;
line-height: 46px;
text-align: center;
}
.info {
font-size: 28px;
color: #999999;
line-height: 40px;
& > text:first-child {
margin-right: 32px;
}
}
& > .has-pic {
display: flex;
justify-content: space-between;
& > .left {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; justify-content: space-between;
justify-content: center;
font-size: 26px; & > label {
color: #666666; overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
& > img {
width: 192px;
height: 144px;
flex-shrink: 0;
margin-left: 32px;
} }
} }
} }
} }
.popup-wrap {
height: 368px;
background-color: #F7F7F7;
.btn {
height: 96px;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
font-weight: 500;
color: #333333;
background-color: #ffffff;
}
& > .u-row {
height: 272px;
box-sizing: border-box;
padding: 0 46px;
& > .colum {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 26px;
color: #666666;
}
}
}
}
</style> </style>