Commit 34795b41 by 胡悦

提交

1 parent d2ee5551
......@@ -3,12 +3,13 @@
* @Author: huyue
* @Date: 2024-07-24 17:47:51
* @LastEditors: huyue
* @LastEditTime: 2024-07-30 18:16:15
* @LastEditTime: 2024-07-30 18:24:24
-->
<script lang="ts" setup>
import { ref, reactive } from 'vue'
import { inject, reactive } from 'vue'
import { useRouter } from 'vue-router';
// 获取全局对象
const global: any = inject("global");
const router = useRouter();
const userInfo = reactive({
account: '管理员'
......@@ -19,7 +20,7 @@ const logout = () => {
console.log('退出登录')
}
const getImageUrl = (name: any) => {
return new URL(`../../assets/images/` + name + ".png", import.meta.url).href;
return new URL(`./images/${name}.png`, global.$imgUrl).href;
};
</script>
......
......@@ -18,7 +18,7 @@ const app = createApp(App)
let vConsole: object = {}
fetchConfig().then(res => {
app.provide('global', {
$imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/h5-posters/',
$imgUrl: 'https://img02.glsx.com.cn/weapp/resource/shuke/',
version: res.version
})
localStorage.setItem('config', JSON.stringify(res))
......
......@@ -6,13 +6,15 @@
* @LastEditTime: 2024-07-30 18:15:41
-->
<script lang="ts" setup>
import { reactive, ref, nextTick, toRefs, onBeforeMount } from "vue";
import { reactive, ref, nextTick, toRefs, onBeforeMount, inject } from "vue";
import { DataInfo } from "../addInterface";
import { RequestOption, FileItem } from "@arco-design/web-vue";
import { req, uploadReq, uploadFile } from "../../../utils/request";
import { Message } from "@arco-design/web-vue";
import { useRoute, useRouter } from "vue-router";
import dayjs from "dayjs";
// 获取全局对象
const global: any = inject("global");
let route = useRoute();
const router = useRouter();
let { query } = toRefs(route);
......@@ -113,7 +115,7 @@ const handleSubmit = async () => {
formRef.value.clearValidate("invnoticeProductList");
};
const getImageUrl = (name: any) => {
return new URL(`../../../assets/images/` + name + ".png", import.meta.url).href;
return new URL(`./images/${name}.png`, global.$imgUrl).href;
};
const getParams = () => {
const len = list.value.length;
......
......@@ -3,21 +3,16 @@
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-07-30 18:15:15
-->
<!--
* @Description:
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditTime: 2024-07-29 15:46:54
-->
<script lang="ts" setup>
import { h, reactive, ref } from "vue";
import { h, reactive, inject } from "vue";
import { useRouter } from "vue-router";
import { DataInfo, TableItem, BasicItem } from "./interface";
import { req } from "../../utils/request";
const router = useRouter();
// 获取全局对象
const global: any = inject("global");
const data = reactive<Partial<DataInfo>>({
tabList: [],
tableData: [],
......@@ -140,7 +135,7 @@ const changeSize = (size: number) => {
getTableData()
}
const getImageUrl = (name: any) => {
return new URL(`../../assets/images/` + name + ".png", import.meta.url).href;
return new URL(`./images/${name}.png`, global.$imgUrl).href;
};
/** 操作类 */
const publishOrDown = async(record: Partial<TableItem>) => {
......
......@@ -3,14 +3,16 @@
* @Author: huyue
* @Date: 2024-07-23 16:28:15
* @LastEditors: huyue
* @LastEditTime: 2024-07-30 18:13:46
* @LastEditTime: 2024-07-30 18:25:37
-->
<script lang="ts" setup>
import {ref, reactive} from 'vue'
import {ref, reactive, inject} from 'vue'
import { useRouter } from "vue-router";
import { ValidatedError } from '@arco-design/web-vue';
import { Message } from '@arco-design/web-vue';
const router = useRouter();
// 获取全局对象
const global: any = inject("global");
/**
* 变量定义
*/
......@@ -62,7 +64,7 @@ const handleLogin = ({values, errors}: {
}
};
const getImageUrl = (name: any) => {
return new URL(`../../assets/images/` + name + ".png", import.meta.url).href;
return new URL(`./images/${name}.png`, global.$imgUrl).href;
};
</script>
<template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!