Commit 29a6cea6 authored by chenqikuai's avatar chenqikuai

messageBox

parent 7ceb4ee8
<script setup lang="ts"> <script setup lang="ts">
import { GO_URLS } from 'cqk-sy-ui'; import { GO_URLS } from "cqk-sy-ui";
import { onMounted } from 'vue'; import { onMounted } from "vue";
import { $ajax } from './service'; import { $ajax } from "./service";
import { setUrlList } from './store/mutations'; import { setUrlList } from "./store/mutations";
import globalMount from "@/components/GlobalMount/index.vue";
onMounted(async () => { onMounted(async () => {
const res = await $ajax({ const res = await $ajax({
type: "get", type: "get",
url: GO_URLS.config url: GO_URLS.config,
}); });
if (res) { if (res) {
setUrlList(res.data.frontend) setUrlList(res.data.frontend);
} }
}) });
</script> </script>
<template> <template>
<router-view></router-view> <router-view></router-view>
<globalMount />
</template> </template>
import { globalState } from "@/store/state";
export const showTip = (
tip: string,
handleConfirm: () => void,
handleCancel?: () => void
) => {
globalState.syMessageBoxConfig = {
visible: true,
tip,
handleConfirm,
handleCancel,
};
};
<template>
<syMessageBox
v-model:visible="state.visible"
:tip="state.tip"
:handle-confirm="state.handleConfirm"
:handle-cancel="state.handleCancel"
></syMessageBox>
</template>
<script lang="ts" setup>
import { globalState } from "@/store/state";
import { syMessageBox } from "cqk-sy-ui";
const state = globalState.syMessageBoxConfig;
</script>
...@@ -9,6 +9,12 @@ export const globalState = reactive({ ...@@ -9,6 +9,12 @@ export const globalState = reactive({
base_id: 0, base_id: 0,
base_hash: "", base_hash: "",
}, },
syMessageBoxConfig: {
visible: false,
tip: "",
handleConfirm: () => {},
handleCancel: (() => {}) as (() => void) | undefined,
},
listOfInformation: [] as any[], listOfInformation: [] as any[],
page: 1, page: 1,
existingEvidenceList: [] as any[], existingEvidenceList: [] as any[],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment