清理组件残余

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"/>
</u-form-item>
<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>
<div bottom>

View File

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

View File

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

View File

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

View File

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