|
@@ -8,11 +8,10 @@
|
|
|
<div class="username">
|
|
|
<div class="users">
|
|
|
<span class="name">{{ item.username }}</span>
|
|
|
- <span class="tag">{{ formatJobType(item.jobType) }}</span>
|
|
|
</div>
|
|
|
<div class="userTime">
|
|
|
<span class="time">{{ item.createTime }}</span>
|
|
|
- <span class="tag" v-if="item.topFlag">置顶</span>
|
|
|
+ <span class="tag" v-if="item.isTop">置顶</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -133,7 +132,7 @@
|
|
|
<div class="input-title input-slider">
|
|
|
<span>设置为置顶</span>
|
|
|
|
|
|
- <Slider :open="topFlag" @change="onTopFlag" />
|
|
|
+ <Slider :open="isTop" @change="onIsTop" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
@@ -162,6 +161,7 @@ import {
|
|
|
imGroupNoticeRemove,
|
|
|
} from "../../../../api";
|
|
|
import Slider from "../../../components/sliderTUI/index.vue";
|
|
|
+import TUIMessage from "../../../components/messageTUI/index";
|
|
|
const ManageNotification = defineComponent({
|
|
|
components: {
|
|
|
Slider,
|
|
@@ -183,7 +183,7 @@ const ManageNotification = defineComponent({
|
|
|
id: "",
|
|
|
title: "",
|
|
|
input: "",
|
|
|
- topFlag: true, // 是否置顶
|
|
|
+ isTop: true, // 是否置顶
|
|
|
loading: false,
|
|
|
groupList: [],
|
|
|
isEdit: false,
|
|
@@ -212,8 +212,8 @@ const ManageNotification = defineComponent({
|
|
|
};
|
|
|
|
|
|
const onMore = () => {
|
|
|
+ if(data.loading) return
|
|
|
data.page = data.page + 1;
|
|
|
- getNotification();
|
|
|
};
|
|
|
|
|
|
watchEffect(() => {
|
|
@@ -223,29 +223,20 @@ const ManageNotification = defineComponent({
|
|
|
getNotification();
|
|
|
});
|
|
|
|
|
|
- const formatJobType = (jobType: string) => {
|
|
|
- const template = {
|
|
|
- TEACHER: "音乐老师",
|
|
|
- ADMIN: "管理员",
|
|
|
- HEADMASTER: "校长",
|
|
|
- } as any;
|
|
|
- return template[jobType];
|
|
|
- };
|
|
|
|
|
|
|
|
|
const onOperation = async (item: any, type: string, index?: number) => {
|
|
|
try {
|
|
|
if (type === "edit") {
|
|
|
- ctx.emit("changeStatus", "edit");
|
|
|
data.isEdit = true;
|
|
|
data.title = item.title;
|
|
|
data.input = item.content;
|
|
|
- data.topFlag = item.topFlag;
|
|
|
+ data.isTop = item.isTop;
|
|
|
data.id = item.id;
|
|
|
} else if (type === "top") {
|
|
|
await imGroupNoticeUpdate({
|
|
|
groupId: data.groupProfile.groupID,
|
|
|
- topFlag: true,
|
|
|
+ isTop: true,
|
|
|
id: item.id,
|
|
|
});
|
|
|
data.page = 1;
|
|
@@ -262,12 +253,17 @@ const ManageNotification = defineComponent({
|
|
|
data.isEdit = true;
|
|
|
data.title = "";
|
|
|
data.input = "";
|
|
|
- data.topFlag = true;
|
|
|
+ data.isTop = true;
|
|
|
data.id = "";
|
|
|
ctx.emit("changeStatus", "add");
|
|
|
}
|
|
|
- } catch (e) {
|
|
|
+ } catch(e) {
|
|
|
//
|
|
|
+ TUIMessage({
|
|
|
+ message: e.message,
|
|
|
+ isH5: false,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
popoverRef.value[index]?.setShow(false);
|
|
|
};
|
|
@@ -281,7 +277,7 @@ const ManageNotification = defineComponent({
|
|
|
if (data.id) {
|
|
|
await imGroupNoticeUpdate({
|
|
|
groupId: data.groupProfile.groupID,
|
|
|
- topFlag: data.topFlag,
|
|
|
+ isTop: data.isTop,
|
|
|
title: data.title,
|
|
|
content: data.input,
|
|
|
id: data.id,
|
|
@@ -291,7 +287,7 @@ const ManageNotification = defineComponent({
|
|
|
groupId: data.groupProfile.groupID,
|
|
|
title: data.title,
|
|
|
content: data.input,
|
|
|
- topFlag: data.topFlag,
|
|
|
+ isTop: data.isTop,
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -299,15 +295,20 @@ const ManageNotification = defineComponent({
|
|
|
ctx.emit("changeStatus", "submit");
|
|
|
data.page = 1;
|
|
|
data.groupList = [];
|
|
|
+ console.log('55555555555555555')
|
|
|
getNotification();
|
|
|
- } catch {
|
|
|
+ } catch(e) {
|
|
|
//
|
|
|
+ TUIMessage({
|
|
|
+ message: e.message,
|
|
|
+ isH5: false,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const onTopFlag = (val: any) => {
|
|
|
- console.log(val, 'onTopFlag')
|
|
|
- data.topFlag = val
|
|
|
+ const onIsTop = (val: any) => {
|
|
|
+ data.isTop = val
|
|
|
}
|
|
|
|
|
|
const onCloseEdit = () => {
|
|
@@ -321,9 +322,8 @@ const ManageNotification = defineComponent({
|
|
|
return {
|
|
|
...toRefs(data),
|
|
|
popoverRef,
|
|
|
- formatJobType,
|
|
|
onMore,
|
|
|
- onTopFlag,
|
|
|
+ onIsTop,
|
|
|
// updateProfile,
|
|
|
onOperation,
|
|
|
onSubmit,
|