|
@@ -60,6 +60,7 @@
|
|
|
<!-- <DragBall ref="DragBallRef" @setting="OpenSettingHomeWidget" /> -->
|
|
<!-- <DragBall ref="DragBallRef" @setting="OpenSettingHomeWidget" /> -->
|
|
|
</el-container>
|
|
</el-container>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <SysPostEditorDialog ref="SysPostEditorRef" @confirm="onSysPostConfirm" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts" name="home">
|
|
<script setup lang="ts" name="home">
|
|
@@ -77,7 +78,7 @@ import {
|
|
|
watch,
|
|
watch,
|
|
|
inject
|
|
inject
|
|
|
} from "vue";
|
|
} from "vue";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
|
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { streamlineFunc } from "@/utils";
|
|
import { streamlineFunc } from "@/utils";
|
|
|
import { useLayoutLocalStore } from "@/stores/modules/layoutLocal";
|
|
import { useLayoutLocalStore } from "@/stores/modules/layoutLocal";
|
|
|
import { useLayoutStore } from "@/stores/modules/layout";
|
|
import { useLayoutStore } from "@/stores/modules/layout";
|
|
@@ -95,6 +96,8 @@ import { CommonDynamicSelect } from "@/api/modules/common";
|
|
|
import { useUserStore } from "@/stores/modules/user";
|
|
import { useUserStore } from "@/stores/modules/user";
|
|
|
import type { Menu } from "@/typings/global";
|
|
import type { Menu } from "@/typings/global";
|
|
|
import { useAuthStore } from "@/stores/modules/auth";
|
|
import { useAuthStore } from "@/stores/modules/auth";
|
|
|
|
|
+import SysPostEditorDialog from "@/views/system/syspost-editor/index.vue";
|
|
|
|
|
+import { saveSysPost, deleteSysPost } from "@/api/modules/basicinfo";
|
|
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
|
|
|
|
@@ -136,6 +139,7 @@ const layoutStore = useLayoutStore();
|
|
|
const globalStore = useGlobalStore();
|
|
const globalStore = useGlobalStore();
|
|
|
const dwLayout = ref<any>({});
|
|
const dwLayout = ref<any>({});
|
|
|
const LayoutSettingRef = ref();
|
|
const LayoutSettingRef = ref();
|
|
|
|
|
+const SysPostEditorRef = ref();
|
|
|
// const dialogOutwareRef = ref();
|
|
// const dialogOutwareRef = ref();
|
|
|
const DragBallRef = ref();
|
|
const DragBallRef = ref();
|
|
|
const iframeRefs: any = {};
|
|
const iframeRefs: any = {};
|
|
@@ -158,6 +162,9 @@ const rightLayoutSpan = ref(6);
|
|
|
const sysPostList = ref<any>([]);
|
|
const sysPostList = ref<any>([]);
|
|
|
provide("sysPostList", sysPostList);
|
|
provide("sysPostList", sysPostList);
|
|
|
|
|
|
|
|
|
|
+const sysPostUserList = ref<any>([]);
|
|
|
|
|
+provide("sysPostUserList", sysPostUserList);
|
|
|
|
|
+
|
|
|
const initComponetList = ["QuickEnter", "SysPost", "UserPost"];
|
|
const initComponetList = ["QuickEnter", "SysPost", "UserPost"];
|
|
|
/**
|
|
/**
|
|
|
* @description 功能展示布局,默认设置
|
|
* @description 功能展示布局,默认设置
|
|
@@ -423,29 +430,83 @@ const comEvent = {
|
|
|
* @param callback 回调函数
|
|
* @param callback 回调函数
|
|
|
*/
|
|
*/
|
|
|
async getSysPostList(callback?: any) {
|
|
async getSysPostList(callback?: any) {
|
|
|
- // let data = await getSysPostData();
|
|
|
|
|
- // sysPostList.value = data.datatable ?? [];
|
|
|
|
|
|
|
+ let data = await getSysPostData();
|
|
|
|
|
+ sysPostList.value = data.datatable ?? [];
|
|
|
callback && callback();
|
|
callback && callback();
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* @description 发送公告栏
|
|
* @description 发送公告栏
|
|
|
*/
|
|
*/
|
|
|
- async sendSysPost() {
|
|
|
|
|
- alert("功能维护中,敬请期待!");
|
|
|
|
|
|
|
+ async sendSysPost(type) {
|
|
|
|
|
+ // alert("功能维护中,敬请期待!");
|
|
|
|
|
+ SysPostEditorRef.value.show(type);
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @description 获取公告栏信息
|
|
|
|
|
+ * @param callback 回调函数
|
|
|
|
|
+ */
|
|
|
|
|
+ async getSysPostUserList(callback?: any) {
|
|
|
|
|
+ let data = await getSysPostUserData();
|
|
|
|
|
+ sysPostUserList.value = data.datatable ?? [];
|
|
|
|
|
+ callback && callback();
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @description 删除公告栏提醒
|
|
|
|
|
+ * @param callback 回调函数
|
|
|
|
|
+ */
|
|
|
|
|
+ async deleteSysPost(postid: number, type: number) {
|
|
|
|
|
+ ElMessageBox.confirm(`是否删除公告?`, "温馨提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ draggable: true
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+ await deleteSysPost({ postid });
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: `删除公告成功!`
|
|
|
|
|
+ });
|
|
|
|
|
+ if (type === 1) {
|
|
|
|
|
+ comEvent.getSysPostUserList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ comEvent.getSysPostList();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getSysPostData = () => {
|
|
const getSysPostData = () => {
|
|
|
let newParams = {
|
|
let newParams = {
|
|
|
- dsname: "L1WEB_GetSysPostList",
|
|
|
|
|
|
|
+ dsname: "web_sys_post_list",
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ scid: userInfo.scid,
|
|
|
|
|
+ type: 0
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ return CommonDynamicSelect(newParams);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const getSysPostUserData = () => {
|
|
|
|
|
+ let newParams = {
|
|
|
|
|
+ dsname: "web_sys_post_list",
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
scid: userInfo.scid,
|
|
scid: userInfo.scid,
|
|
|
- deptid: userInfo.deptid
|
|
|
|
|
|
|
+ empid: userInfo.empid,
|
|
|
|
|
+ type: 1
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
return CommonDynamicSelect(newParams);
|
|
return CommonDynamicSelect(newParams);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const onSysPostConfirm = async (type: number, postMessage: any) => {
|
|
|
|
|
+ await saveSysPost({ postMessage });
|
|
|
|
|
+
|
|
|
|
|
+ if (type === 1) {
|
|
|
|
|
+ comEvent.getSysPostUserList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ comEvent.getSysPostList();
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @description 点击设置按钮
|
|
* @description 点击设置按钮
|
|
|
*/
|
|
*/
|