清理组件残余

This commit is contained in:
aixianling
2021-12-13 11:56:11 +08:00
parent 66b6f44b0d
commit ecec3a3deb
5 changed files with 651 additions and 663 deletions

View File

@@ -9,7 +9,7 @@
<ai-textarea v-model="form.content" placeholder="请输入最多500字" :maxlength="500"/> <ai-textarea v-model="form.content" placeholder="请输入最多500字" :maxlength="500"/>
</u-form-item> </u-form-item>
<u-form-item label="图片最多9张"> <u-form-item label="图片最多9张">
<ai-uploader multiple :limit="9" :def.sync="form.fileList" action="/admin/file/add2"/> <AiUploader multiple :limit="9" :def.sync="form.fileList" action="/admin/file/add2"/>
</u-form-item> </u-form-item>
</u-form> </u-form>
<div bottom> <div bottom>

View File

@@ -68,17 +68,13 @@
</template> </template>
<script> <script>
import AiAdd from "../../components/AiAdd";
import AiEmpty from "../../components/AiEmpty";
import AiTopFixed from "../../components/AiTopFixed";
import {add, detail, read} from "./components"; import {add, detail, read} from "./components";
import AiOpenData from "../../components/AiOpenData"; import {mapActions} from "vuex";
import {mapActions} from "vuex";
export default { export default {
name: "AppNotification", name: "AppNotification",
appName: "通知公告", appName: "通知公告",
components: {AiOpenData,AiAdd, AiEmpty, AiTopFixed, add, detail, read}, components: {add, detail, read},
data() { data() {
return { return {
index: 0, index: 0,
@@ -364,14 +360,14 @@ export default {
height: 36px; height: 36px;
font-size: 26px; font-size: 26px;
color: #FF8822; color: #FF8822;
background:rgba(255,136,34,.1); background: rgba(255, 136, 34, .1);
line-height: 36px; line-height: 36px;
text-align: center; text-align: center;
margin-right: 4px; margin-right: 4px;
} }
.read{ .read {
background: rgba(102,102,102,.1); background: rgba(102, 102, 102, .1);
color: #666666; color: #666666;
} }
} }

View File

@@ -12,7 +12,8 @@
</div> </div>
<div class="card"> <div class="card">
<AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片" @list="fileList" :def="form.files" action="/admin/file/add2"></AiUploader> <AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片" @list="fileList" :def="form.files"
action="/admin/file/add2"></AiUploader>
</div> </div>
<div class="card item-wrap"> <div class="card item-wrap">
@@ -23,7 +24,7 @@
<span>请选择</span> <span>请选择</span>
</template> </template>
<template v-else> <template v-else>
已选择<em>{{form.persons.map(e=>e.name).slice(0,2).join("、")}}</em><em>{{form.persons.length}}</em> 已选择<em>{{ form.persons.map(e => e.name).slice(0, 2).join("、") }}</em><em>{{ form.persons.length }}</em>
</template> </template>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</div> </div>
@@ -48,7 +49,7 @@
<span>请选择</span> <span>请选择</span>
</template> </template>
<template v-else> <template v-else>
<span>{{form.releaseTime}}</span> <span>{{ form.releaseTime }}</span>
</template> </template>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</div> </div>
@@ -66,15 +67,12 @@
</template> </template>
<script> <script>
import AiBack from "../../../components/AiBack"; import {mapActions} from "vuex";
import AiUploader from "../../../components/AiUploader";
import {mapActions} from "vuex";
export default { export default {
name: "add", name: "add",
components: {AiBack,AiUploader}, props: {
props:{ params: Object
params:Object
}, },
data() { data() {
return { return {
@@ -86,7 +84,7 @@
title: "", title: "",
content: "", content: "",
persons: [], persons: [],
releaseTime:null, releaseTime: null,
files: [], files: [],
}, },
userSelect: false, userSelect: false,
@@ -102,20 +100,20 @@
}, },
} }
}, },
watch:{ watch: {
params:{ params: {
handler:function (v) { handler: function () {
if(this.params?.id){ if (this.params?.id) {
this.form.id = this.params?.id; this.form.id = this.params?.id;
this.flag = this.params?.flag; this.flag = this.params?.flag;
} }
}, },
immediate:true immediate: true
} }
}, },
created() { created() {
document.title = "新增公告"; document.title = "新增公告";
if(this.params?.id){ if (this.params?.id) {
this.getDetail(); this.getDetail();
} }
}, },
@@ -123,36 +121,36 @@
...mapActions(['selectEnterpriseContact']), ...mapActions(['selectEnterpriseContact']),
handleSelectUser() { handleSelectUser() {
this.selectEnterpriseContact({ this.selectEnterpriseContact({
fromDepartmentId:0, fromDepartmentId: 0,
type:["user"], type: ["user"],
selectedUserIds: this.form.persons?.map(e=>e.id) selectedUserIds: this.form.persons?.map(e => e.id)
}).then(res => { }).then(res => {
console.log(res); console.log(res);
this.form.persons = res?.userList || [] this.form.persons = res?.userList || []
}) })
}, },
confirm(e){ confirm(e) {
if(e.timestamp< (Date.now()/1000)|0){ if (e.timestamp < (Date.now() / 1000) || 0) {
return this.$u.toast("发送时间不能小于当前时间"); return this.$u.toast("发送时间不能小于当前时间");
} }
this.form.releaseTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`; this.form.releaseTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
}, },
fileList(e){ fileList(e) {
this.form.files = e this.form.files = e
}, },
change(e){ change(e) {
this.form.persons = e this.form.persons = e
}, },
getDetail(){ getDetail() {
this.$http.post("/app/appannouncement/detail",null,{ this.$http.post("/app/appannouncement/detail", null, {
params:{ params: {
id:this.form.id, id: this.form.id,
detail: this.flag detail: this.flag
} }
}).then(res=>{ }).then(res => {
if (res && res.data) { if (res && res.data) {
this.form.releaseTime = res.data.releaseTime; this.form.releaseTime = res.data.releaseTime;
Object.keys(this.form).map(e=>{ Object.keys(this.form).map(e => {
this.form[e] = res.data[e]; this.form[e] = res.data[e];
}) })
this.index = res.data.releaseTime ? 1 : 0; this.index = res.data.releaseTime ? 1 : 0;
@@ -166,11 +164,11 @@
if (!this.form.content) return this.$u.toast("请输入公告内容") if (!this.form.content) return this.$u.toast("请输入公告内容")
if(!this.form.persons.length) return this.$u.toast("请选择发送对象") if (!this.form.persons.length) return this.$u.toast("请选择发送对象")
if(this.index==1 && !this.form.releaseTime) return this.$u.toast("请选择定时发送时间") if (this.index == 1 && !this.form.releaseTime) return this.$u.toast("请选择定时发送时间")
if(this.form.releaseTime && new Date(this.form.releaseTime).getTime() < Date.now()) return this.$u.toast("发送时间不能小于当前时间"); if (this.form.releaseTime && new Date(this.form.releaseTime).getTime() < Date.now()) return this.$u.toast("发送时间不能小于当前时间");
// } // }
this.$http.post("/app/appannouncement/addOrUpdate", { this.$http.post("/app/appannouncement/addOrUpdate", {
@@ -189,16 +187,16 @@
}) })
} }
}, },
computed:{ computed: {
background(){ background() {
return `url(${this.$cdn}/notice/jiaobiao.png) no-repeat; background-size: 46px 48px;position: absolute;bottom: 0;right: 0;` return `url(${this.$cdn}/notice/jiaobiao.png) no-repeat; background-size: 46px 48px;position: absolute;bottom: 0;right: 0;`
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-meeting { .add-meeting {
min-height: 100%; min-height: 100%;
background: #F5F5F5; background: #F5F5F5;
padding-bottom: 140px; padding-bottom: 140px;
@@ -284,7 +282,7 @@
} }
} }
.type{ .type {
width: 320px; width: 320px;
height: 112px; height: 112px;
background: #F5F5F5; background: #F5F5F5;
@@ -298,7 +296,7 @@
letter-spacing: 1px; letter-spacing: 1px;
position: relative; position: relative;
& > img{ & > img {
width: 46px; width: 46px;
height: 48px; height: 48px;
position: absolute; position: absolute;
@@ -306,7 +304,8 @@
bottom: 0; bottom: 0;
} }
} }
.active{
.active {
background-color: #E7F1FE; background-color: #E7F1FE;
color: #1174FE; color: #1174FE;
} }
@@ -377,5 +376,5 @@
background-color: #1365DD; background-color: #1365DD;
} }
} }
} }
</style> </style>

View File

@@ -2,7 +2,7 @@
<div class="detail" v-if="pageShow"> <div class="detail" v-if="pageShow">
<template v-if="detailObj"> <template v-if="detailObj">
<div class="card"> <div class="card">
<header>{{detailObj.title}}</header> <header>{{ detailObj.title }}</header>
<u-gap height="16"></u-gap> <u-gap height="16"></u-gap>
<u-row> <u-row>
<span>发布人</span> <span>发布人</span>
@@ -20,7 +20,7 @@
<u-gap height="8"></u-gap> <u-gap height="8"></u-gap>
<u-row> <u-row>
<span>发布日期</span> <span>发布日期</span>
<span>{{detailObj.releaseTime}}</span> <span>{{ detailObj.releaseTime }}</span>
</u-row> </u-row>
<u-gap height="8"></u-gap> <u-gap height="8"></u-gap>
</div> </div>
@@ -36,9 +36,9 @@
<u-row justify="between"> <u-row justify="between">
<label class="left"> <label class="left">
<img :src="$cdn + 'common/appendix.png'" alt=""> <img :src="$cdn + 'common/appendix.png'" alt="">
<span>{{item.name}}.{{item.postfix}}</span> <span>{{ item.name }}.{{ item.postfix }}</span>
</label> </label>
<span>{{(item.size/1024).toFixed(2)}}KB</span> <span>{{ (item.size / 1024).toFixed(2) }}KB</span>
</u-row> </u-row>
</div> </div>
</div> </div>
@@ -47,29 +47,25 @@
<u-row justify="between" class="item"> <u-row justify="between" class="item">
<span>接收对象</span> <span>接收对象</span>
<div class="right"> <div class="right">
<em>{{detailObj.readNum}}</em>已读 <em>{{ detailObj.readNum }}</em>已读
<em>{{detailObj.unReadNum}}</em>未读 <em>{{ detailObj.unReadNum }}</em>未读
<div class="arrow"></div> <div class="arrow"></div>
</div> </div>
</u-row> </u-row>
</div> </div>
</template> </template>
<AiEmpty description="该通知已撤回" v-else/> <AiEmpty description="该通知已撤回" v-else/>
<AiBack /> <AiBack/>
</div> </div>
</template> </template>
<script> <script>
import AiBack from "../../../components/AiBack"; import {mapActions} from "vuex";
import {mapActions} from "vuex";
import AiEmpty from "../../../components/AiEmpty";
import AiOpenData from "../../../components/AiOpenData";
export default { export default {
name: "detail", name: "detail",
components:{AiOpenData,AiBack,AiEmpty}, props: {
props:{ params: Object
params:Object
}, },
data() { data() {
return { return {
@@ -93,12 +89,12 @@
methods: { methods: {
...mapActions(['previewFile', 'injectJWeixin']), ...mapActions(['previewFile', 'injectJWeixin']),
preFile(e) { preFile(e) {
if([".jpg",".png",".gif"].includes(e.postfix.toLowerCase())){ if ([".jpg", ".png", ".gif"].includes(e.postfix.toLowerCase())) {
uni.previewImage({ uni.previewImage({
current: e.url, current: e.url,
urls: [e.url] urls: [e.url]
}) })
}else { } else {
this.previewFile({...e}) this.previewFile({...e})
} }
}, },
@@ -108,8 +104,8 @@
id: this.params?.id, id: this.params?.id,
detail: this.params?.flag detail: this.params?.flag
} }
}).then(res=>{ }).then(res => {
if(res && res.data){ if (res && res.data) {
this.detailObj = res.data; this.detailObj = res.data;
this.pageShow = true this.pageShow = true
this.$hideLoading() this.$hideLoading()
@@ -122,11 +118,11 @@
this.$parent.showList = false; this.$parent.showList = false;
} }
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail { .detail {
min-height: 100%; min-height: 100%;
background-color: #F5F5F5; background-color: #F5F5F5;
padding-bottom: 140px; padding-bottom: 140px;
@@ -358,5 +354,5 @@
font-size: 36px; font-size: 36px;
color: #FFFFFF; color: #FFFFFF;
} }
} }
</style> </style>

View File

@@ -14,15 +14,12 @@
</template> </template>
<script> <script>
import AiBack from "../../../components/AiBack"; import {mapActions} from "vuex";
import AiTopFixed from "../../../components/AiTopFixed";
import AiOpenData from "../../../components/AiOpenData"; export default {
import {mapActions} from "vuex";
export default {
name: "read", name: "read",
components: {AiBack, AiTopFixed, AiOpenData}, props: {
props:{ params: [String, Number]
params:[String,Number]
}, },
data() { data() {
return { return {
@@ -40,9 +37,9 @@
methods: { methods: {
...mapActions(['previewFile', 'injectJWeixin']), ...mapActions(['previewFile', 'injectJWeixin']),
getList() { getList() {
this.$http.post("/app/appannouncementreader/list-unread",null,{ this.$http.post("/app/appannouncementreader/list-unread", null, {
params:{ params: {
id:this.params id: this.params
} }
}).then(res => { }).then(res => {
if (res && res.data) { if (res && res.data) {
@@ -65,15 +62,15 @@
]; ];
} }
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.read { .read {
min-height: 100%; min-height: 100%;
background-color: #F5F5F5; background-color: #F5F5F5;
::v-deep .content{ ::v-deep .content {
padding: 0 !important; padding: 0 !important;
} }
@@ -89,7 +86,7 @@
background-color: #ffffff; background-color: #ffffff;
border-bottom: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee;
& > .name{ & > .name {
font-size: 36px; font-size: 36px;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
@@ -98,5 +95,5 @@
} }
} }
} }
} }
</style> </style>