forked from integrated_whb/integrated_whb_vue
通知公告、通知模板配置
parent
1fa8b0a609
commit
da2dfa5f67
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div style="flex: 1">
|
||||
<toolbar :editor="editorRef" :default-config="toolbarConfig" />
|
||||
<editor
|
||||
v-model="modelValue"
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
:width="800"
|
||||
:height="300"
|
||||
:is-crop="false"
|
||||
:is-clear-bg-color="false"
|
||||
:line-width="6"
|
||||
line-color="#000"
|
||||
bg-color="#FFFFFF"
|
||||
bg-color="#fff"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="fnReset">重签</el-button>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import { post, upload } from "@/request/axios";
|
||||
|
||||
export const getNotificationAnnouncementList = (params) =>
|
||||
post("/noticecorp/list", params); // 企业公告列表
|
||||
export const setNotificationAnnouncementChangeStatus = (params) =>
|
||||
post("/noticecorp/changeStatus", params); // 企业公告修改启用状态
|
||||
export const setNotificationAnnouncementTopping = (params) =>
|
||||
post("/noticecorp/changeIsTop", params); // 企业公告置顶
|
||||
export const setNotificationAnnouncementDelete = (params) =>
|
||||
post("/noticecorp/delete", params); // 企业公告删除
|
||||
export const setNotificationAnnouncementBatchDeletion = (params) =>
|
||||
post("/noticecorp/deleteAll", params); // 企业公告删除多选
|
||||
export const getNotificationAnnouncementViewStatusList = (params) =>
|
||||
post("/noticecorp/listUserRead", params); // 企业公告查看状态列表
|
||||
export const getSelectNotifierList = (params) =>
|
||||
post("/user/listSelect", params); // 通知人列表
|
||||
export const setNotificationAnnouncementAdd = (params) =>
|
||||
upload("/noticecorp/add", params); // 企业公告添加
|
||||
export const getNotificationTemplateConfigurationList = (params) =>
|
||||
post("/notice_management/list", params); // 通知模板配置列表
|
||||
export const setNotificationTemplateConfigurationAdd = (params) =>
|
||||
post("/notice_management/add", params); // 通知模板配置改变状态
|
||||
export const setNotificationTemplateConfigurationConfigureList = (params) =>
|
||||
post("/notice_management/userlist", params); // 通知模板配置配置列表
|
||||
export const setNotificationTemplateConfigurationConfigure = (params) =>
|
||||
post("/notice_management/editUserName", params); // 通知模板配置配置
|
|
@ -0,0 +1,102 @@
|
|||
<template>
|
||||
<layout-card>
|
||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="110px">
|
||||
<el-form-item label="公告简介" prop="SYNOPSIS">
|
||||
<el-input v-model="form.SYNOPSIS" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否全部通知" prop="ISALL">
|
||||
<el-radio-group v-model="form.ISALL">
|
||||
<el-radio :label="'yes'">全部通知</el-radio>
|
||||
<el-radio :label="'no'">部分通知</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="form.ISALL === 'no'"
|
||||
label="选择通知人"
|
||||
prop="userNames"
|
||||
>
|
||||
<div style="flex: 1; display: flex; justify-content: space-between">
|
||||
<el-input
|
||||
:model-value="form.userNames.split(',').join('、')"
|
||||
disabled
|
||||
style="flex: 1"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="ml-10"
|
||||
@click="selectNotifierDialogVisible = true"
|
||||
>
|
||||
请选择
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="CONTENT">
|
||||
<layout-editor v-model="form.CONTENT" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件路径">
|
||||
<layout-upload v-model:file-list="form.fileList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="mt-10 tc">
|
||||
<el-button type="primary" @click="fnSubmit">保存</el-button>
|
||||
</div>
|
||||
<select-notifier
|
||||
v-model:visible="selectNotifierDialogVisible"
|
||||
@confirm="fnSelectNotifierConfirm"
|
||||
/>
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import LayoutEditor from "@/components/editor/index.vue";
|
||||
import LayoutUpload from "@/components/upload/index.vue";
|
||||
import { ref } from "vue";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { setNotificationAnnouncementAdd } from "@/request/notification_announcement.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import SelectNotifier from "./components/select_notifier.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const rules = {
|
||||
SYNOPSIS: [{ required: true, message: "公告简介不能为空", trigger: "blur" }],
|
||||
CONTENT: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
||||
userNames: [{ required: true, message: "请选择通知人", trigger: "blur" }],
|
||||
};
|
||||
const form = ref({
|
||||
SYNOPSIS: "",
|
||||
ISALL: "yes",
|
||||
CONTENT: "",
|
||||
userIds: "",
|
||||
userNames: "",
|
||||
fileList: [],
|
||||
});
|
||||
const formRef = ref(null);
|
||||
const selectNotifierDialogVisible = ref(false);
|
||||
const fnSelectNotifierConfirm = (userIds, userNames) => {
|
||||
form.value.userIds = userIds;
|
||||
form.value.userNames = userNames;
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
const formData = new FormData();
|
||||
Object.keys(form.value).forEach((key) => {
|
||||
formData.append(key, form.value[key]);
|
||||
});
|
||||
formData.delete("fileList");
|
||||
for (let i = 0; i < form.value.fileList.length; i++) {
|
||||
formData.append("file", form.value.fileList[i].raw);
|
||||
formData.append("fileName", form.value.fileList[i].name);
|
||||
}
|
||||
await setNotificationAnnouncementAdd(formData);
|
||||
ElMessage.success("添加成功");
|
||||
router.back();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,78 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="选择通知人">
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="100px"
|
||||
@submit.prevent="fnResetPagination"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="用户名/姓名" prop="KEYWORDS">
|
||||
<el-input v-model="searchForm.KEYWORDS" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPagination">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<layout-table
|
||||
ref="tableRef"
|
||||
v-model:pagination="pagination"
|
||||
row-key="USER_ID"
|
||||
:data="list"
|
||||
@get-data="fnGetData"
|
||||
>
|
||||
<el-table-column reserve-selection type="selection" width="55" />
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ serialNumber(pagination, $index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="USERNAME" label="用户名" />
|
||||
<el-table-column prop="NAME" label="姓名" />
|
||||
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
|
||||
<el-table-column prop="POST_NAME" label="岗位" />
|
||||
</layout-table>
|
||||
<template #footer>
|
||||
<el-button @click="fnClose">关闭</el-button>
|
||||
<el-button type="primary" @click="fnConfirm">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useVModel } from "@vueuse/core";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { getSelectNotifierList } from "@/request/notification_announcement.js";
|
||||
import { serialNumber } from "@/assets/js/utils.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "confirm"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
const { list, searchForm, pagination, tableRef, fnResetPagination, fnGetData } =
|
||||
useListData(getSelectNotifierList, { key: "userList" });
|
||||
const fnClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
const fnConfirm = () => {
|
||||
const selectionData = tableRef.value.getSelectionRows();
|
||||
const userIds = selectionData.map((item) => item.USER_ID).join(",");
|
||||
const userNames = selectionData.map((item) => item.NAME).join(",");
|
||||
emits("confirm", userIds, userNames);
|
||||
fnClose();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,50 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="查看">
|
||||
<el-descriptions border :column="1">
|
||||
<el-descriptions-item label="发布人">
|
||||
{{ info.CREATOR }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发布时间">
|
||||
{{ info.CREATTIME }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="内容">
|
||||
<div v-html="info.CONTENT" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="info.FILEPATH" label="附件">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="useDownloadFile(info.FILEPATH)"
|
||||
>
|
||||
下载
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useVModel } from "@vueuse/core";
|
||||
import useDownloadFile from "@/assets/js/useDownloadFile.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
info: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,65 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="查看状态">
|
||||
<layout-table
|
||||
v-model:pagination="pagination"
|
||||
:data="list"
|
||||
@get-data="fnGetDataTransfer"
|
||||
>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ serialNumber(pagination, $index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="USERNAME" label="用户名" />
|
||||
<el-table-column prop="NAME" label="姓名" />
|
||||
<el-table-column label="阅读状态">
|
||||
<template #default="{ row }">
|
||||
{{ row.TYPE === 0 ? "未阅" : "已阅" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="CREATOR" label="阅读时间" />
|
||||
</layout-table>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useVModel } from "@vueuse/core";
|
||||
import { serialNumber } from "@/assets/js/utils.js";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { getNotificationAnnouncementViewStatusList } from "@/request/notification_announcement.js";
|
||||
import { watchEffect } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
const { list, pagination, fnResetPagination, fnGetData } = useListData(
|
||||
getNotificationAnnouncementViewStatusList,
|
||||
{
|
||||
immediate: false,
|
||||
}
|
||||
);
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({ NOTICECORP_ID: props.id });
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (visible.value) {
|
||||
fnResetPagination({ NOTICECORP_ID: props.id });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,238 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="80px"
|
||||
@submit.prevent="fnResetPagination"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="公告简介" prop="KEYWORDS">
|
||||
<el-input v-model="searchForm.KEYWORDS" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPagination">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<layout-card>
|
||||
<layout-table
|
||||
ref="tableRef"
|
||||
v-model:pagination="pagination"
|
||||
row-key="NOTICECORP_ID"
|
||||
:data="list"
|
||||
@get-data="fnGetData"
|
||||
>
|
||||
<el-table-column reserve-selection type="selection" width="55" />
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ serialNumber(pagination, $index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="CREATOR" label="发布人" width="200" />
|
||||
<el-table-column prop="CREATTIME" label="发布时间" width="160" />
|
||||
<el-table-column
|
||||
prop="SYNOPSIS"
|
||||
label="公告简介"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="启用状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.STATUS"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="fnChangeStatus(row.NOTICECORP_ID)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查看状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="fnViewStatus(row.NOTICECORP_ID)"
|
||||
>
|
||||
{{ row.countCk }}/{{ row.countAll }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="140">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text link @click="fnView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="buttonJurisdiction.edit"
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="fnTopping(row.NOTICECORP_ID, row.ISTOP === '0' ? 1 : 0)"
|
||||
>
|
||||
{{ row.ISTOP === "0" ? "置顶" : "取消置顶" }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="buttonJurisdiction.del"
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="fnDelete(row.NOTICECORP_ID)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #button>
|
||||
<el-button
|
||||
v-if="buttonJurisdiction.add"
|
||||
type="primary"
|
||||
@click="
|
||||
router.push({
|
||||
path: '/notification_announcement/notification_announcement/add',
|
||||
})
|
||||
"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="buttonJurisdiction.del"
|
||||
type="danger"
|
||||
@click="fnBatchDeletion"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
</layout-table>
|
||||
</layout-card>
|
||||
<view-info
|
||||
v-model:visible="data.viewDialog.visible"
|
||||
:info="data.viewDialog.info"
|
||||
/>
|
||||
<view-status
|
||||
:id="data.viewStatusDialog.id"
|
||||
v-model:visible="data.viewStatusDialog.visible"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { serialNumber } from "@/assets/js/utils";
|
||||
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
||||
import {
|
||||
getNotificationAnnouncementList,
|
||||
setNotificationAnnouncementChangeStatus,
|
||||
setNotificationAnnouncementDelete,
|
||||
setNotificationAnnouncementBatchDeletion,
|
||||
setNotificationAnnouncementTopping,
|
||||
} from "@/request/notification_announcement.js";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { useRouter } from "vue-router";
|
||||
import { reactive } from "vue";
|
||||
import ViewInfo from "./components/view.vue";
|
||||
import ViewStatus from "./components/view_status.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const { list, pagination, searchForm, tableRef, fnGetData, fnResetPagination } =
|
||||
useListData(getNotificationAnnouncementList, {
|
||||
callbackFn: (list, resData) => {
|
||||
const countNotList = resData.countNotList;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const notMap = list[i];
|
||||
const notId = notMap.NOTICECORP_ID;
|
||||
let countCk = 0;
|
||||
let countWCK = 0;
|
||||
let countAll = 0;
|
||||
for (let j = 0; j < countNotList.length; j++) {
|
||||
const countNotId = countNotList[j].noticecorp_id;
|
||||
if (notId === countNotId) {
|
||||
if (countNotList[j].type === 1) countCk = countNotList[j].count;
|
||||
if (countNotList[j].type === 0) countWCK = countNotList[j].count;
|
||||
}
|
||||
}
|
||||
countAll = countCk + countWCK;
|
||||
notMap.countCk = countCk;
|
||||
notMap.countAll = countAll;
|
||||
}
|
||||
},
|
||||
});
|
||||
const data = reactive({
|
||||
viewDialog: {
|
||||
visible: false,
|
||||
info: {},
|
||||
},
|
||||
viewStatusDialog: {
|
||||
visible: false,
|
||||
id: "",
|
||||
},
|
||||
});
|
||||
const buttonJurisdiction = await useButtonJurisdiction("noticecorp");
|
||||
const fnChangeStatus = debounce(
|
||||
1000,
|
||||
async (NOTICECORP_ID) => {
|
||||
await setNotificationAnnouncementChangeStatus({ NOTICECORP_ID });
|
||||
ElMessage.success("状态修改成功");
|
||||
fnResetPagination();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnTopping = debounce(
|
||||
1000,
|
||||
async (NOTICECORP_ID, ISTOP) => {
|
||||
const message = ISTOP === 1 ? "置顶" : "取消置顶";
|
||||
await ElMessageBox.confirm("确定要" + message + "吗?", {
|
||||
type: "warning",
|
||||
});
|
||||
await setNotificationAnnouncementTopping({ NOTICECORP_ID, ISTOP });
|
||||
ElMessage.success(message + "成功");
|
||||
fnResetPagination();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnDelete = debounce(
|
||||
1000,
|
||||
async (NOTICECORP_ID) => {
|
||||
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
|
||||
await setNotificationAnnouncementDelete({ NOTICECORP_ID });
|
||||
ElMessage.success("删除成功");
|
||||
fnResetPagination();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnBatchDeletion = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
const selectionData = tableRef.value.getSelectionRows();
|
||||
if (selectionData.length === 0) {
|
||||
ElMessage.warning("请选中要删除的项");
|
||||
return;
|
||||
}
|
||||
const DATA_IDS = selectionData.map((item) => item.NOTICECORP_ID).join(",");
|
||||
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
|
||||
await setNotificationAnnouncementBatchDeletion({ DATA_IDS });
|
||||
ElMessage.success("删除成功");
|
||||
fnResetPagination();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnView = (row) => {
|
||||
data.viewDialog.info = row;
|
||||
data.viewDialog.visible = true;
|
||||
};
|
||||
const fnViewStatus = (NOTICECORP_ID) => {
|
||||
data.viewStatusDialog.visible = true;
|
||||
data.viewStatusDialog.id = NOTICECORP_ID;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -0,0 +1,128 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="配置" :on-close="fnClose">
|
||||
<layout-table
|
||||
ref="tableRef"
|
||||
v-model:pagination="pagination"
|
||||
row-key="USER_ID"
|
||||
:data="list"
|
||||
@get-data="fnGetDataTransfer"
|
||||
>
|
||||
<el-table-column reserve-selection type="selection" width="55" />
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ serialNumber(pagination, $index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="USERNAME" label="用户名" />
|
||||
<el-table-column prop="NAME" label="姓名" />
|
||||
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
|
||||
<el-table-column prop="POST_NAME" label="岗位" />
|
||||
</layout-table>
|
||||
<template #footer>
|
||||
<el-button @click="fnClose">取消</el-button>
|
||||
<el-button type="primary" @click="fnSubmit"> 确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { serialNumber } from "@/assets/js/utils.js";
|
||||
import { useVModel } from "@vueuse/core";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { nextTick, ref, watch } from "vue";
|
||||
import {
|
||||
setNotificationTemplateConfigurationConfigure,
|
||||
setNotificationTemplateConfigurationConfigureList,
|
||||
} from "@/request/notification_announcement.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
noticeManagementId: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
noticeTemplateId: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "get-data"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
const checkUserList = ref([]);
|
||||
const { list, pagination, fnGetData, fnResetPagination, tableRef } =
|
||||
useListData(setNotificationTemplateConfigurationConfigureList, {
|
||||
immediate: false,
|
||||
clearSelection: false,
|
||||
key: "userList",
|
||||
callbackFn: (list, resData) => {
|
||||
checkUserList.value = resData.checkuserList;
|
||||
},
|
||||
});
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({ NOTICE_MANAGEMENT_ID: props.noticeManagementId });
|
||||
};
|
||||
const fnResetPaginationTransfer = async () => {
|
||||
await fnResetPagination({ NOTICE_MANAGEMENT_ID: props.noticeManagementId });
|
||||
};
|
||||
const fnInit = async () => {
|
||||
await fnResetPaginationTransfer();
|
||||
await nextTick();
|
||||
checkUserList.value.forEach((item) => {
|
||||
tableRef.value.toggleRowSelection(item);
|
||||
});
|
||||
fnResetPaginationTransfer();
|
||||
};
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
if (val) {
|
||||
fnInit();
|
||||
}
|
||||
}
|
||||
);
|
||||
const fnClose = () => {
|
||||
tableRef.value.clearSelection();
|
||||
visible.value = false;
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
const selectionData = tableRef.value.getSelectionRows();
|
||||
if (selectionData.length === 0) {
|
||||
ElMessage.warning("请选择要发送的用户");
|
||||
return;
|
||||
}
|
||||
const ADDRESSEE = selectionData.map((item) => item.USER_ID).join(",");
|
||||
const USERNAME = selectionData.map((item) => item.NAME).join(",");
|
||||
await ElMessageBox.confirm(
|
||||
`确定要发送短信给<span class="text-green">${USERNAME.split(",").join(
|
||||
"、"
|
||||
)}</span>吗?`,
|
||||
{
|
||||
type: "warning",
|
||||
dangerouslyUseHTMLString: true,
|
||||
}
|
||||
);
|
||||
await setNotificationTemplateConfigurationConfigure({
|
||||
NOTICE_MANAGEMENT_ID: props.noticeManagementId,
|
||||
NOTICETEMPLATE_ID: props.noticeTemplateId,
|
||||
ADDRESSEE,
|
||||
USERNAME,
|
||||
});
|
||||
ElMessage.success("保存成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,122 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="50px"
|
||||
@submit.prevent="fnResetPagination"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="类型" prop="KEYWORDS">
|
||||
<el-input v-model="searchForm.KEYWORDS" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPagination">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<layout-card>
|
||||
<layout-table
|
||||
v-model:pagination="pagination"
|
||||
:data="list"
|
||||
@get-data="fnGetData"
|
||||
>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ serialNumber(pagination, $index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="NAME" label="类型" />
|
||||
<el-table-column prop="USERNAME" label="抄送人员" />
|
||||
<el-table-column label="启用状态" width="150">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
:model-value="row.ISENABLE"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="
|
||||
fnChangeStatus(row.NOTICE_MANAGEMENT_ID, row.NOTICETEMPLATE_ID)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="
|
||||
fnConfigure(row.NOTICE_MANAGEMENT_ID, row.NOTICETEMPLATE_ID)
|
||||
"
|
||||
>
|
||||
配置
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</layout-table>
|
||||
</layout-card>
|
||||
<configure
|
||||
v-model:visible="data.configureDialog.visible"
|
||||
:notice-management-id="data.configureDialog.NOTICE_MANAGEMENT_ID"
|
||||
:notice-template-id="data.configureDialog.NOTICETEMPLATE_ID"
|
||||
@get-data="fnResetPagination"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from "vue";
|
||||
import { serialNumber } from "@/assets/js/utils";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import { ElMessage } from "element-plus";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import Configure from "./components/configure.vue";
|
||||
import {
|
||||
getNotificationTemplateConfigurationList,
|
||||
setNotificationTemplateConfigurationAdd,
|
||||
} from "@/request/notification_announcement.js";
|
||||
|
||||
const data = reactive({
|
||||
configureDialog: {
|
||||
visible: false,
|
||||
NOTICE_MANAGEMENT_ID: "",
|
||||
NOTICETEMPLATE_ID: "",
|
||||
},
|
||||
});
|
||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||
useListData(getNotificationTemplateConfigurationList, {
|
||||
callbackFn: (list) => {
|
||||
list.forEach((item) => {
|
||||
item.ISENABLE = item.ISENABLE || "0";
|
||||
});
|
||||
},
|
||||
});
|
||||
const fnChangeStatus = debounce(
|
||||
1000,
|
||||
async (NOTICE_MANAGEMENT_ID, NOTICETEMPLATE_ID) => {
|
||||
await setNotificationTemplateConfigurationAdd({
|
||||
NOTICE_MANAGEMENT_ID,
|
||||
NOTICETEMPLATE_ID,
|
||||
});
|
||||
ElMessage.success("状态修改成功");
|
||||
fnResetPagination();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnConfigure = async (NOTICE_MANAGEMENT_ID, NOTICETEMPLATE_ID) => {
|
||||
data.configureDialog.visible = true;
|
||||
data.configureDialog.NOTICE_MANAGEMENT_ID = NOTICE_MANAGEMENT_ID;
|
||||
data.configureDialog.NOTICETEMPLATE_ID = NOTICETEMPLATE_ID;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -4,7 +4,7 @@
|
|||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="70px"
|
||||
@submit.prevent="fnResetPaginationTransfer"
|
||||
@submit.prevent="fnGetDataTransfer"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
|
@ -42,7 +42,7 @@
|
|||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||
<el-button native-type="reset" @click="fnGetDataTransfer">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
@ -98,25 +98,26 @@ import {
|
|||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const { list, searchForm, pagination, fnResetPagination } = useListData(
|
||||
const { list, searchForm, pagination, fnGetData } = useListData(
|
||||
getDetectionSituationList,
|
||||
{
|
||||
immediate: false,
|
||||
usePagination: false,
|
||||
}
|
||||
);
|
||||
const fnResetPaginationTransfer = () => {
|
||||
fnResetPagination({
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({
|
||||
STARTTIME: searchForm.value.dates?.[0],
|
||||
ENDTIME: searchForm.value.dates?.[1],
|
||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||
});
|
||||
};
|
||||
const fnGetData = async () => {
|
||||
const fnInit = async () => {
|
||||
const resData = await getDetectionSituationListTime();
|
||||
searchForm.value.dates = [resData.pd.MINTIME, resData.pd.MAXTIME];
|
||||
fnResetPaginationTransfer();
|
||||
fnGetDataTransfer();
|
||||
};
|
||||
fnGetData();
|
||||
fnInit();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="70px"
|
||||
@submit.prevent="fnResetPaginationTransfer"
|
||||
@submit.prevent="fnGetDataTransfer"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
|
@ -48,7 +48,7 @@
|
|||
<el-col :span="4">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||
<el-button native-type="reset" @click="fnGetDataTransfer">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
@ -112,7 +112,7 @@ const achieving = ref(0);
|
|||
const listNoCheckNum = ref(0);
|
||||
const listCheckedNum = ref(0);
|
||||
const checkTheRate = ref(0);
|
||||
const { list, searchForm, pagination, fnResetPagination } = useListData(
|
||||
const { list, searchForm, pagination, fnGetData } = useListData(
|
||||
getUsageSituationList,
|
||||
{
|
||||
defaultSearchForm: {
|
||||
|
@ -128,8 +128,8 @@ const { list, searchForm, pagination, fnResetPagination } = useListData(
|
|||
},
|
||||
}
|
||||
);
|
||||
const fnResetPaginationTransfer = () => {
|
||||
fnResetPagination({
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({
|
||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue