mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 17:07:19 +08:00
refactor: use setup refactor
This commit is contained in:
parent
8f6986608d
commit
d4302627e8
33
src/App.vue
33
src/App.vue
@ -1,28 +1,25 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<el-config-provider :locale="currentLocale">
|
import { getCurrentInstance } from "vue";
|
||||||
<router-view />
|
|
||||||
</el-config-provider>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { ElConfigProvider } from "element-plus";
|
import { ElConfigProvider } from "element-plus";
|
||||||
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
||||||
import en from "element-plus/lib/locale/lang/en";
|
import en from "element-plus/lib/locale/lang/en";
|
||||||
export default {
|
|
||||||
name: "app",
|
let locale: string =
|
||||||
components: {
|
getCurrentInstance().appContext.config.globalProperties.$storage?.locale
|
||||||
[ElConfigProvider.name]: ElConfigProvider
|
?.locale;
|
||||||
},
|
|
||||||
computed: {
|
let currentLocale = () => {
|
||||||
// eslint-disable-next-line vue/return-in-computed-property
|
switch (locale) {
|
||||||
currentLocale() {
|
|
||||||
switch (this.$storage.locale?.locale) {
|
|
||||||
case "zh":
|
case "zh":
|
||||||
return zhCn;
|
return zhCn;
|
||||||
case "en":
|
case "en":
|
||||||
return en;
|
return en;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-config-provider :locale="currentLocale()">
|
||||||
|
<router-view />
|
||||||
|
</el-config-provider>
|
||||||
|
</template>
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useFullscreen } from "@vueuse/core";
|
||||||
|
|
||||||
|
const { isFullscreen, toggle } = useFullscreen();
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="screen-full" @click="toggle">
|
<div class="screen-full" @click="toggle">
|
||||||
<i
|
<i
|
||||||
@ -15,23 +21,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { useFullscreen } from "@vueuse/core";
|
|
||||||
import { defineComponent } from "vue";
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "screenfull",
|
|
||||||
setup() {
|
|
||||||
const { isFullscreen, toggle } = useFullscreen();
|
|
||||||
|
|
||||||
return {
|
|
||||||
isFullscreen,
|
|
||||||
toggle
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.screen-full {
|
.screen-full {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
@ -1,29 +1,23 @@
|
|||||||
<template>
|
<script lang="ts">
|
||||||
<div>
|
export default {
|
||||||
<div ref="editor"></div>
|
name: "reEditor"
|
||||||
<div :innerHTML="content.html"></div>
|
};
|
||||||
</div>
|
</script>
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
import { onMounted, onBeforeUnmount, ref, reactive } from "vue";
|
import { onMounted, onBeforeUnmount, ref, unref } from "vue";
|
||||||
import WangEditor from "wangeditor";
|
import WangEditor from "wangeditor";
|
||||||
|
|
||||||
export default {
|
// eslint-disable-next-line no-undef
|
||||||
name: "reEditor",
|
const editor = ref<ComponentRef>(null);
|
||||||
setup() {
|
const html = ref<HTMLElement>(null);
|
||||||
const editor = ref();
|
let instance: WangEditor;
|
||||||
const content = reactive({
|
|
||||||
html: "",
|
|
||||||
text: ""
|
|
||||||
});
|
|
||||||
|
|
||||||
let instance;
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
instance = new WangEditor(editor.value);
|
instance = new WangEditor(unref(editor));
|
||||||
Object.assign(instance.config, {
|
Object.assign(instance.config, {
|
||||||
onchange() {
|
onchange() {
|
||||||
content.html = instance.txt.html();
|
html.value = instance.txt.html();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
instance.create();
|
instance.create();
|
||||||
@ -31,17 +25,16 @@ export default {
|
|||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
instance.destroy();
|
instance.destroy();
|
||||||
instance = null;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
editor,
|
|
||||||
content
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div ref="editor"></div>
|
||||||
|
<div :innerHTML="html"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.w-e-text-container) {
|
:deep(.w-e-text-container) {
|
||||||
z-index: 99 !important;
|
z-index: 99 !important;
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import imgs from "/@/assets/401.gif";
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
|
const img = ref(`${imgs}?${new Date()}`);
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="errPage-container">
|
<div class="errPage-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<h1 class="text-jumbo text-ginormous">CURD Admin</h1>
|
<h1 class="text-jumbo text-ginormous">Pure Admin</h1>
|
||||||
<h2>你没有权限去该页面</h2>
|
<h2>你没有权限去该页面</h2>
|
||||||
<h6>如有不满请联系你领导</h6>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<img
|
<img
|
||||||
@ -18,20 +24,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import imgs from "/@/assets/401.gif";
|
|
||||||
import { ref } from "vue";
|
|
||||||
export default {
|
|
||||||
name: "401",
|
|
||||||
setup() {
|
|
||||||
const img = ref(`${imgs}?${new Date()}`);
|
|
||||||
return {
|
|
||||||
img
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.errPage-container {
|
.errPage-container {
|
||||||
width: 800px;
|
width: 800px;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from "vue";
|
||||||
|
import four from "/@/assets/404.png";
|
||||||
|
import four_cloud from "/@/assets/404_cloud.png";
|
||||||
|
|
||||||
|
const message = computed(() => {
|
||||||
|
return "The webmaster said that you can not enter this page...";
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="wscn-http404-container">
|
<div class="wscn-http404-container">
|
||||||
<div class="wscn-http404">
|
<div class="wscn-http404">
|
||||||
@ -8,7 +18,7 @@
|
|||||||
<img class="pic-404__child right" :src="four_cloud" alt="404" />
|
<img class="pic-404__child right" :src="four_cloud" alt="404" />
|
||||||
</div>
|
</div>
|
||||||
<div class="bullshit">
|
<div class="bullshit">
|
||||||
<div class="bullshit__oops">CURD Admin</div>
|
<div class="bullshit__oops">Pure Admin</div>
|
||||||
<div class="bullshit__headline">{{ message }}</div>
|
<div class="bullshit__headline">{{ message }}</div>
|
||||||
<div class="bullshit__info">
|
<div class="bullshit__info">
|
||||||
Please check that the URL you entered is correct, or click the button
|
Please check that the URL you entered is correct, or click the button
|
||||||
@ -20,26 +30,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { computed } from "vue";
|
|
||||||
import four from "/@/assets/404.png";
|
|
||||||
import four_cloud from "/@/assets/404_cloud.png";
|
|
||||||
export default {
|
|
||||||
name: "404",
|
|
||||||
setup() {
|
|
||||||
const message = computed(() => {
|
|
||||||
return "The webmaster said that you can not enter this page...";
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
message,
|
|
||||||
four,
|
|
||||||
four_cloud
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.wscn-http404-container {
|
.wscn-http404-container {
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
|
@ -1,43 +1,18 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="logic-flow-view">
|
|
||||||
<!-- 辅助工具栏 -->
|
|
||||||
<Control
|
|
||||||
class="demo-control"
|
|
||||||
v-if="lf"
|
|
||||||
:lf="lf"
|
|
||||||
:catTurboData="false"
|
|
||||||
@catData="catData"
|
|
||||||
></Control>
|
|
||||||
<!-- 节点面板 -->
|
|
||||||
<NodePanel :lf="lf" :nodeList="nodeList"></NodePanel>
|
|
||||||
<!-- 画布 -->
|
|
||||||
<div id="LF-Turbo"></div>
|
|
||||||
<!-- 数据查看面板 -->
|
|
||||||
<el-dialog title="数据" v-model="dataVisible" width="50%">
|
|
||||||
<DataDialog :graphData="graphData"></DataDialog>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { ref, unref, onMounted } from "vue";
|
import { ref, unref, onMounted } from "vue";
|
||||||
import LogicFlow from "@logicflow/core";
|
import LogicFlow from "@logicflow/core";
|
||||||
import { Snapshot, BpmnElement, Menu } from "@logicflow/extension";
|
import { Snapshot, BpmnElement, Menu } from "@logicflow/extension";
|
||||||
import "@logicflow/core/dist/style/index.css";
|
import "@logicflow/core/dist/style/index.css";
|
||||||
import "@logicflow/extension/lib/style/index.css";
|
import "@logicflow/extension/lib/style/index.css";
|
||||||
import { Control, NodePanel, DataDialog } from "/@/components/ReFlowChart";
|
import { Control, NodePanel, DataDialog } from "/@/components/ReFlowChart";
|
||||||
|
|
||||||
import { toLogicflowData } from "/@/components/ReFlowChart/src/adpterForTurbo";
|
import { toLogicflowData } from "/@/components/ReFlowChart/src/adpterForTurbo";
|
||||||
import { BpmnNode } from "/@/components/ReFlowChart/src/config";
|
import { BpmnNode } from "/@/components/ReFlowChart/src/config";
|
||||||
import demoData from "./dataTurbo.json";
|
import demoData from "./dataTurbo.json";
|
||||||
export default {
|
|
||||||
name: "reFlowChart",
|
|
||||||
components: { NodePanel, Control, DataDialog },
|
|
||||||
setup() {
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
let lf = ref<ElRef>(null);
|
let lf = ref<ElRef>(null);
|
||||||
let graphData = ref(null);
|
let graphData = ref(null);
|
||||||
let dataVisible = ref(false);
|
let dataVisible = ref<boolean>(false);
|
||||||
let config = ref({
|
let config = ref({
|
||||||
grid: true,
|
grid: true,
|
||||||
background: {
|
background: {
|
||||||
@ -80,19 +55,29 @@ export default {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initLf();
|
initLf();
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
lf,
|
|
||||||
graphData,
|
|
||||||
dataVisible,
|
|
||||||
config,
|
|
||||||
nodeList,
|
|
||||||
catData
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="logic-flow-view">
|
||||||
|
<!-- 辅助工具栏 -->
|
||||||
|
<Control
|
||||||
|
class="demo-control"
|
||||||
|
v-if="lf"
|
||||||
|
:lf="lf"
|
||||||
|
:catTurboData="false"
|
||||||
|
@catData="catData"
|
||||||
|
></Control>
|
||||||
|
<!-- 节点面板 -->
|
||||||
|
<NodePanel :lf="lf" :nodeList="nodeList"></NodePanel>
|
||||||
|
<!-- 画布 -->
|
||||||
|
<div id="LF-Turbo"></div>
|
||||||
|
<!-- 数据查看面板 -->
|
||||||
|
<el-dialog title="数据" v-model="dataVisible" width="50%">
|
||||||
|
<DataDialog :graphData="graphData"></DataDialog>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
#LF-Turbo {
|
#LF-Turbo {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
@ -1,26 +1,11 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="login">
|
|
||||||
<info
|
|
||||||
:ruleForm="contextInfo"
|
|
||||||
@on-behavior="onLogin"
|
|
||||||
@refreshVerify="refreshVerify"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { reactive, onBeforeMount } from "vue";
|
import { reactive, onBeforeMount } from "vue";
|
||||||
import info, { ContextProps } from "../components/ReInfo/index.vue";
|
import info, { ContextProps } from "../components/ReInfo/index.vue";
|
||||||
import { getVerify, getLogin } from "/@/api/user";
|
import { getVerify, getLogin } from "/@/api/user";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { storageSession } from "/@/utils/storage";
|
import { storageSession } from "/@/utils/storage";
|
||||||
import { warnMessage, successMessage } from "/@/utils/message";
|
import { warnMessage, successMessage } from "/@/utils/message";
|
||||||
export default {
|
|
||||||
name: "login",
|
|
||||||
components: {
|
|
||||||
info
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// 刷新验证码
|
// 刷新验证码
|
||||||
@ -65,14 +50,14 @@ export default {
|
|||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
// refreshGetVerify();
|
// refreshGetVerify();
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
contextInfo,
|
|
||||||
onLogin,
|
|
||||||
router,
|
|
||||||
toPage,
|
|
||||||
refreshVerify
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="login">
|
||||||
|
<info
|
||||||
|
:ruleForm="contextInfo"
|
||||||
|
@on-behavior="onLogin"
|
||||||
|
@refreshVerify="refreshVerify"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { storageSession } from "/@/utils/storage";
|
||||||
|
|
||||||
|
const auth = ref(storageSession.getItem("info").username || "admin");
|
||||||
|
|
||||||
|
function changRole(value) {
|
||||||
|
storageSession.setItem("info", {
|
||||||
|
username: value,
|
||||||
|
accessToken: `eyJhbGciOiJIUzUxMiJ9.${value}`
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-radio-group v-model="auth" @change="changRole">
|
<el-radio-group v-model="auth" @change="changRole">
|
||||||
@ -8,30 +23,3 @@
|
|||||||
<p v-auth="'v-test'">只有test可看</p>
|
<p v-auth="'v-test'">只有test可看</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { ref } from "vue";
|
|
||||||
import { storageSession } from "/@/utils/storage";
|
|
||||||
export default {
|
|
||||||
name: "permissionButton",
|
|
||||||
setup() {
|
|
||||||
const auth = ref(storageSession.getItem("info").username || "admin");
|
|
||||||
|
|
||||||
function changRole(value) {
|
|
||||||
storageSession.setItem("info", {
|
|
||||||
username: value,
|
|
||||||
accessToken: `eyJhbGciOiJIUzUxMiJ9.${value}`
|
|
||||||
});
|
|
||||||
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
auth,
|
|
||||||
changRole
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
|
@ -1,22 +1,7 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="app-container">
|
|
||||||
<h4>
|
|
||||||
当前角色:
|
|
||||||
<span style="font-size: 26px">{{ purview }}</span>
|
|
||||||
<p style="color: #ffa500">
|
|
||||||
查看左侧菜单变化(系统管理),模拟后台根据不同角色返回对应路由
|
|
||||||
</p>
|
|
||||||
</h4>
|
|
||||||
<el-button type="primary" @click="changRole">切换角色</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { ref, unref } from "vue";
|
import { ref, unref } from "vue";
|
||||||
import { storageSession } from "/@/utils/storage";
|
import { storageSession } from "/@/utils/storage";
|
||||||
export default {
|
|
||||||
name: "permissionPage",
|
|
||||||
setup() {
|
|
||||||
let purview: string = ref(storageSession.getItem("info").username);
|
let purview: string = ref(storageSession.getItem("info").username);
|
||||||
|
|
||||||
function changRole() {
|
function changRole() {
|
||||||
@ -34,11 +19,17 @@ export default {
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
purview,
|
|
||||||
changRole
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4>
|
||||||
|
当前角色:
|
||||||
|
<span style="font-size: 26px">{{ purview }}</span>
|
||||||
|
<p style="color: #ffa500">
|
||||||
|
查看左侧菜单变化(系统管理),模拟后台根据不同角色返回对应路由
|
||||||
|
</p>
|
||||||
|
</h4>
|
||||||
|
<el-button type="primary" @click="changRole">切换角色</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div></div>
|
import { unref } from "vue";
|
||||||
</template>
|
|
||||||
<script lang="ts">
|
|
||||||
import { defineComponent, unref } from "vue";
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "redirect",
|
|
||||||
setup() {
|
|
||||||
const { currentRoute, replace } = useRouter();
|
const { currentRoute, replace } = useRouter();
|
||||||
|
|
||||||
const { params, query } = unref(currentRoute);
|
const { params, query } = unref(currentRoute);
|
||||||
@ -19,8 +13,8 @@ export default defineComponent({
|
|||||||
path: "/" + _path,
|
path: "/" + _path,
|
||||||
query
|
query
|
||||||
});
|
});
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div></div>
|
||||||
|
</template>
|
||||||
|
@ -1,25 +1,10 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="register">
|
|
||||||
<info
|
|
||||||
:ruleForm="contextInfo"
|
|
||||||
@on-behavior="onRegist"
|
|
||||||
@refreshVerify="refreshVerify"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { reactive, onBeforeMount } from "vue";
|
import { reactive, onBeforeMount } from "vue";
|
||||||
import info, { ContextProps } from "../components/ReInfo/index.vue";
|
import info, { ContextProps } from "../components/ReInfo/index.vue";
|
||||||
import { getRegist, getVerify } from "/@/api/user";
|
import { getRegist, getVerify } from "/@/api/user";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { warnMessage, successMessage } from "/@/utils/message";
|
import { warnMessage, successMessage } from "/@/utils/message";
|
||||||
export default {
|
|
||||||
name: "register",
|
|
||||||
components: {
|
|
||||||
info
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// 刷新验证码
|
// 刷新验证码
|
||||||
@ -55,13 +40,14 @@ export default {
|
|||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
// refreshGetVerify();
|
// refreshGetVerify();
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
contextInfo,
|
|
||||||
onRegist,
|
|
||||||
router,
|
|
||||||
refreshVerify
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="register">
|
||||||
|
<info
|
||||||
|
:ruleForm="contextInfo"
|
||||||
|
@on-behavior="onRegist"
|
||||||
|
@refreshVerify="refreshVerify"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
@ -1,49 +1,17 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="welcome">
|
|
||||||
<el-affix>
|
|
||||||
<div class="top-content">
|
|
||||||
<div class="left-mark">
|
|
||||||
<img
|
|
||||||
src="https://avatars.githubusercontent.com/u/44761321?s=400&u=30907819abd29bb3779bc247910873e7c7f7c12f&v=4"
|
|
||||||
title="直达仓库地址"
|
|
||||||
alt
|
|
||||||
@click="openDepot"
|
|
||||||
/>
|
|
||||||
<span>{{ greetings }}</span>
|
|
||||||
</div>
|
|
||||||
<Flop v-if="!mobile" />
|
|
||||||
</div>
|
|
||||||
</el-affix>
|
|
||||||
|
|
||||||
<!-- 图表 -->
|
|
||||||
<el-card class="box-card">
|
|
||||||
<el-skeleton style="height: 50vh" :rows="8" :loading="loading" animated>
|
|
||||||
<template #default>
|
|
||||||
<div id="brokenLine"></div>
|
|
||||||
</template>
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import Flop from "/@/components/ReFlop";
|
import Flop from "/@/components/ReFlop";
|
||||||
import { ref, computed, onMounted, nextTick } from "vue";
|
import { ref, computed, onMounted, nextTick } from "vue";
|
||||||
import { deviceDetection } from "/@/utils/deviceDetection";
|
import { deviceDetection } from "/@/utils/deviceDetection";
|
||||||
import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
|
import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
|
||||||
import { echartsJson } from "/@/api/mock";
|
import { echartsJson } from "/@/api/mock";
|
||||||
import echarts from "/@/plugins/echarts";
|
import echarts from "/@/plugins/echarts";
|
||||||
|
import { ECharts } from "echarts";
|
||||||
|
|
||||||
let brokenLine: any = null; //折线图实例
|
//折线图实例
|
||||||
export default {
|
let brokenLine: ECharts;
|
||||||
name: "welcome",
|
let mobile = ref<boolean>(deviceDetection());
|
||||||
components: {
|
|
||||||
Flop
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
let mobile = ref(deviceDetection());
|
|
||||||
let date: Date = new Date();
|
let date: Date = new Date();
|
||||||
let loading = ref(true);
|
let loading = ref<boolean>(true);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
loading.value = !loading.value;
|
loading.value = !loading.value;
|
||||||
@ -65,6 +33,7 @@ export default {
|
|||||||
function initbrokenLine() {
|
function initbrokenLine() {
|
||||||
const lineRefDom = document.getElementById("brokenLine");
|
const lineRefDom = document.getElementById("brokenLine");
|
||||||
if (!lineRefDom) return;
|
if (!lineRefDom) return;
|
||||||
|
// @ts-ignore
|
||||||
brokenLine = echarts.init(lineRefDom);
|
brokenLine = echarts.init(lineRefDom);
|
||||||
brokenLine.clear(); //清除旧画布 重新渲染
|
brokenLine.clear(); //清除旧画布 重新渲染
|
||||||
|
|
||||||
@ -194,17 +163,36 @@ export default {
|
|||||||
brokenLine.dispose();
|
brokenLine.dispose();
|
||||||
brokenLine = null;
|
brokenLine = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
greetings,
|
|
||||||
mobile,
|
|
||||||
loading,
|
|
||||||
openDepot
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="welcome">
|
||||||
|
<el-affix>
|
||||||
|
<div class="top-content">
|
||||||
|
<div class="left-mark">
|
||||||
|
<img
|
||||||
|
src="https://avatars.githubusercontent.com/u/44761321?s=400&u=30907819abd29bb3779bc247910873e7c7f7c12f&v=4"
|
||||||
|
title="直达仓库地址"
|
||||||
|
alt
|
||||||
|
@click="openDepot"
|
||||||
|
/>
|
||||||
|
<span>{{ greetings }}</span>
|
||||||
|
</div>
|
||||||
|
<Flop v-if="!mobile" />
|
||||||
|
</div>
|
||||||
|
</el-affix>
|
||||||
|
|
||||||
|
<!-- 图表 -->
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-skeleton style="height: 50vh" :rows="8" :loading="loading" animated>
|
||||||
|
<template #default>
|
||||||
|
<div id="brokenLine"></div>
|
||||||
|
</template>
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.welcome {
|
.welcome {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
"strictFunctionTypes": false,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
@ -16,27 +17,14 @@
|
|||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"resolveJsonModule": true, // 包含导入的模块。json的扩展
|
"resolveJsonModule": true, // 包含导入的模块。json的扩展
|
||||||
"lib": [
|
"lib": ["dom", "esnext"],
|
||||||
"dom",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"/@/*": [
|
"/@/*": ["src/*"],
|
||||||
"src/*"
|
"/#/*": ["types/*"]
|
||||||
],
|
|
||||||
"/#/*": [
|
|
||||||
"types/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"types": [
|
"types": ["node", "vite/client"],
|
||||||
"node",
|
"typeRoots": ["./node_modules/@types/", "./types"]
|
||||||
"vite/client"
|
|
||||||
],
|
|
||||||
"typeRoots": [
|
|
||||||
"./node_modules/@types/",
|
|
||||||
"./types"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
@ -46,9 +34,5 @@
|
|||||||
"mock/*.ts",
|
"mock/*.ts",
|
||||||
"vite.config.ts"
|
"vite.config.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": ["node_modules", "dist", "**/*.js"]
|
||||||
"node_modules",
|
|
||||||
"dist",
|
|
||||||
"**/*.js"
|
|
||||||
]
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user