消息管理
This commit is contained in:
parent
eb93ce4810
commit
8718413202
|
|
@ -13,9 +13,11 @@ VITE_PROXY_API = /dev-api
|
|||
|
||||
# http://42.193.40.239:8017/doc.html//线上 http://192.168.110.186:8017/doc.html//本地
|
||||
|
||||
# VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
# VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||
#
|
||||
VITE_GLOB_UPLOAD_URL=/dev-api
|
||||
VITE_UPLOAD_IMG_URL=/dev-img-api
|
||||
VITE_UPLOAD_URL = http://192.168.110.186
|
||||
# VITE_UPLOAD_URL = http://192.168.110.186
|
||||
VITE_UPLOAD_URL = http://42.193.40.239:8888
|
||||
|
||||
|
|
|
|||
|
|
@ -337,5 +337,25 @@ export function saveUser(data) {
|
|||
data:params
|
||||
});
|
||||
}
|
||||
/**
|
||||
*消息管理-通知公告详情
|
||||
*/
|
||||
export function noticeDetail(params) {
|
||||
return request({
|
||||
url: `/admin/notice/noticeDetail/${params.govNoticeId}`,
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*消息管理-通知公告删除
|
||||
*/
|
||||
export function noticeDel(params) {
|
||||
return request({
|
||||
url: `/admin/notice/noticeDel/${params.govNoticeId}`,
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ const content = ref('')
|
|||
const myQuillEditor = ref()
|
||||
watch(() => props.value, (val) => {
|
||||
// console.log(toRaw(myQuillEditor.value))
|
||||
// toRaw(myQuillEditor.value).setHTML(val)
|
||||
content.value = val
|
||||
toRaw(myQuillEditor.value).setHTML(val)
|
||||
content.value = val;
|
||||
}, { deep: true })
|
||||
const fileBtn = ref()
|
||||
const data = reactive({
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ import useUserStore from "@/store/modules/user";
|
|||
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||
import { noticeAdd } from "@/api/Sys";
|
||||
import { noticeAdd, noticeDetail } from "@/api/Sys";
|
||||
const formRef = ref<FormInstance>();
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
|
@ -88,8 +88,10 @@ const props = defineProps({
|
|||
const addMessageForm = ref<any>({ content: "",title:"" });
|
||||
const emits = defineEmits(["close", "onSubmit"]);
|
||||
//富文本
|
||||
const msgContent = ref('')
|
||||
const getMsg = (val) => {
|
||||
addMessageForm.value.content = val;
|
||||
// addMessageForm.content = val;
|
||||
msgContent.value = val;
|
||||
};
|
||||
|
||||
//保存并退出
|
||||
|
|
@ -99,8 +101,9 @@ const handleSubmit = () => {
|
|||
let params = {
|
||||
...addMessageForm.value,
|
||||
coverImg:fileList.value[0].filepath,
|
||||
govNoticeId:addMessageForm.value.govNoticeId||uuid.value,
|
||||
content : msgContent.value
|
||||
}
|
||||
console.log(params,'params===>');
|
||||
noticeAdd(params).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
|
|
@ -126,31 +129,40 @@ const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
|||
};
|
||||
//图片查询
|
||||
const getFiles = (FileType) => {
|
||||
console.log(FileType,'FileType==>');
|
||||
console.log(addMessageForm.value.govNoticeId,'addMessageForm.value.govNoticeId===>');
|
||||
|
||||
getFile(addMessageForm.value.govNoticeId || uuid.value, FileType).then(
|
||||
(res: any) => {
|
||||
console.log(res,'图片查询res==>');
|
||||
|
||||
fileList.value = res.data;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
//查询详情
|
||||
const getNoticeDetail = (id) =>{
|
||||
let params = {
|
||||
govNoticeId:id
|
||||
}
|
||||
noticeDetail(params).then(
|
||||
(res: any) => {
|
||||
addMessageForm.value = res.data;
|
||||
getFiles(FileType.messageCover);
|
||||
msgContent.value = res.data.content;
|
||||
}
|
||||
);
|
||||
}
|
||||
//关闭弹窗
|
||||
const onclone = () => {
|
||||
emits("close");
|
||||
addMessageForm.value = {};
|
||||
addMessageForm.value.content = "";
|
||||
addMessageForm.value.title = "";
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
() => {
|
||||
uuid.value = getUUID();
|
||||
addMessageForm.value = props.form;
|
||||
console.log(addMessageForm.value,'addMessageForm===>');
|
||||
|
||||
getFiles(FileType.messageCover);
|
||||
if (props.form.govNoticeId) {
|
||||
getNoticeDetail(props.form.govNoticeId);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@
|
|||
v-loading="tableDataloading"
|
||||
:data="tableData"
|
||||
header-row-class-name="el-one-header"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
|
|
@ -55,18 +54,22 @@
|
|||
{{ scope.$index + 1 + (currentPage - 1) * pageSize }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="coverImg"
|
||||
:resizable="true"
|
||||
label="封面"
|
||||
width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<img class="coverImg" :src="baseUrl+scope.row.coverImg" alt="">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
:resizable="true"
|
||||
label="标题"
|
||||
width="250"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
:resizable="true"
|
||||
align="center"
|
||||
label="内容"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
@ -94,7 +97,7 @@
|
|||
<svg-icon name="detail" class="icon"></svg-icon>
|
||||
<span class="detail">详情</span>
|
||||
</span>
|
||||
<span class="operate" @click="clickDelete(scope.row.govNoticeId)">
|
||||
<span class="operate" @click="del(scope.row.govNoticeId)">
|
||||
<svg-icon name="delete" class="icon"></svg-icon>
|
||||
<span class="delete">删除</span>
|
||||
</span>
|
||||
|
|
@ -127,7 +130,7 @@
|
|||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { noticePage } from "@/api/Sys";
|
||||
import { noticePage, noticeDel } from "@/api/Sys";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import AddModifyMessage from "./add-modify-message.vue";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
|
@ -135,6 +138,7 @@ const userStore = useUserStore();
|
|||
const user = ref(JSON.parse(userStore.userInfo));
|
||||
const userId = ref(user.value.userId);
|
||||
|
||||
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||
const search = ref('');
|
||||
const tableData = ref([]);
|
||||
const currentPage = ref(1);
|
||||
|
|
@ -162,27 +166,31 @@ const getList = () => {
|
|||
tableDataloading.value = false;
|
||||
});
|
||||
};
|
||||
const clickDelete = (govNoticeId) => {
|
||||
// ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||
// confirmButtonText: "是",
|
||||
// cancelButtonText: "否",
|
||||
// type: "warning",
|
||||
// }).then(() => {
|
||||
// delListperform(govNoticeId).then((res: any) => {
|
||||
// if (res.code == 1) {
|
||||
// ElMessage.success({
|
||||
// message: "删除成功",
|
||||
// type: "success",
|
||||
// });
|
||||
// } else {
|
||||
// ElMessage.error({
|
||||
// message: res.message,
|
||||
// type: "error",
|
||||
// });
|
||||
// }
|
||||
// getList();
|
||||
// });
|
||||
// });
|
||||
//删除列表
|
||||
const del = (id) => {
|
||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
let params = {
|
||||
govNoticeId:id
|
||||
}
|
||||
noticeDel(params).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
ElMessage.success({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
getList();
|
||||
});
|
||||
});
|
||||
};
|
||||
//关闭新增弹窗
|
||||
const onclone = () => {
|
||||
|
|
@ -211,4 +219,8 @@ onMounted(() => {
|
|||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
.coverImg {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user