This commit is contained in:
weipengfei 2023-09-02 10:56:15 +08:00
parent 79461fac92
commit 8dab625adc
7 changed files with 44 additions and 20 deletions

View File

@ -4,6 +4,7 @@ import install from './install'
import './permission' import './permission'
import './styles/index.scss' import './styles/index.scss'
import 'virtual:svg-icons-register' import 'virtual:svg-icons-register'
import configs from './config/index'
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode:'e8b6cb44e8e431d68052c8e10db99264', securityJsCode:'e8b6cb44e8e431d68052c8e10db99264',
@ -11,5 +12,6 @@ window._AMapSecurityConfig = {
const app = createApp(App) const app = createApp(App)
app.use(install) app.use(install)
app.provide('base_url', configs.baseUrl+configs.urlPrefix);
app.mount('#app') app.mount('#app')
app.config.warnHandler = () => null app.config.warnHandler = () => null

View File

@ -54,9 +54,11 @@
style="width: 100%" style="width: 100%"
drag drag
:headers="{ Token: userStore.token }" :headers="{ Token: userStore.token }"
action="https://worker-task.lihaink.cn/adminapi/upload/file" :action="base_url + '/upload/file'"
:limit="1" :limit="1"
:on-success="handleFile" :on-success="handleFile"
:on-exceed="handleExceed"
ref="upload"
> >
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">文件拖入或点击上传</div> <div class="el-upload__text">文件拖入或点击上传</div>
@ -100,6 +102,7 @@
<script lang="ts" setup name="appUpdateEdit"> <script lang="ts" setup name="appUpdateEdit">
import type { FormInstance } from "element-plus"; import type { FormInstance } from "element-plus";
import { genFileId } from "element-plus";
import Popup from "@/components/popup/index.vue"; import Popup from "@/components/popup/index.vue";
import { import {
apiAppUpdateAdd, apiAppUpdateAdd,
@ -109,6 +112,8 @@ import {
import { timeFormat } from "@/utils/util"; import { timeFormat } from "@/utils/util";
import type { PropType } from "vue"; import type { PropType } from "vue";
import useUserStore from "@/stores/modules/user"; import useUserStore from "@/stores/modules/user";
import { inject } from "vue";
const base_url: any = inject("base_url");
defineProps({ defineProps({
dictData: { dictData: {
type: Object as PropType<Record<string, any[]>>, type: Object as PropType<Record<string, any[]>>,
@ -126,6 +131,15 @@ const handleFile = (e: any) => {
formData.dow_url = e.data.uri; formData.dow_url = e.data.uri;
}; };
const upload = ref(null);
const handleExceed = (files: any) => {
upload.value!.clearFiles();
const file = files[0] as UploadRawFile;
file.uid = genFileId();
upload.value!.handleStart(file);
upload.value!.submit();
};
// //
const popupTitle = computed(() => { const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑app更新" : "新增app更新"; return mode.value == "edit" ? "编辑app更新" : "新增app更新";

View File

@ -258,7 +258,7 @@
v-model="formData.avatar" v-model="formData.avatar"
class="avatar-uploader-head" class="avatar-uploader-head"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessAvatar" :on-success="handleAvatarSuccessAvatar"
> >
@ -446,7 +446,7 @@
v-model="formData.qualification.business_license" v-model="formData.qualification.business_license"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
> >
@ -473,7 +473,7 @@
:disabled="isDisabled" :disabled="isDisabled"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess_two" :on-success="handleAvatarSuccess_two"
style="margin-bottom: 12px" style="margin-bottom: 12px"
@ -491,7 +491,7 @@
v-model="formData.qualification.business_licenseB" v-model="formData.qualification.business_licenseB"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessB" :on-success="handleAvatarSuccessB"
> >
@ -600,7 +600,7 @@
v-model:file-list="fileList" v-model:file-list="fileList"
:headers="{ Token: userStore.token }" :headers="{ Token: userStore.token }"
class="upload-demo" class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file" :action="base_url+ '/upload/image'"
multiple multiple
:limit="1" :limit="1"
:on-success="handleAvatarSuccess_three" :on-success="handleAvatarSuccess_three"
@ -674,6 +674,8 @@ import DialogIndexMan from "./dialog_index_man.vue";
import type { PropType } from "vue"; import type { PropType } from "vue";
import useMultipleTabs from "@/hooks/useMultipleTabs"; import useMultipleTabs from "@/hooks/useMultipleTabs";
import useUserStore from "@/stores/modules/user"; import useUserStore from "@/stores/modules/user";
import { inject } from "vue";
const base_url: any = inject("base_url");
const userStore = useUserStore(); const userStore = useUserStore();
const { removeTab } = useMultipleTabs(); const { removeTab } = useMultipleTabs();
const router = useRouter(); const router = useRouter();

View File

@ -12,7 +12,7 @@
class="avatar-uploader-head" class="avatar-uploader-head"
:disabled="flag" :disabled="flag"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessAvatar" :on-success="handleAvatarSuccessAvatar"
> >
@ -180,7 +180,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessIdA" :on-success="handleAvatarSuccessIdA"
> >
@ -198,7 +198,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessIdB" :on-success="handleAvatarSuccessIdB"
> >
@ -220,7 +220,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessCarA" :on-success="handleAvatarSuccessCarA"
> >
@ -238,7 +238,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessCarB" :on-success="handleAvatarSuccessCarB"
:before-upload="beforeAvatarUpload_two" :before-upload="beforeAvatarUpload_two"
@ -261,7 +261,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessBankA" :on-success="handleAvatarSuccessBankA"
:before-upload="beforeAvatarUpload_three" :before-upload="beforeAvatarUpload_three"
@ -280,7 +280,7 @@
:disabled="flag" :disabled="flag"
class="avatar-uploader pl-3" class="avatar-uploader pl-3"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessBankB" :on-success="handleAvatarSuccessBankB"
:before-upload="beforeAvatarUpload_three" :before-upload="beforeAvatarUpload_three"
@ -373,7 +373,7 @@
:headers="{ Token: userStore.token }" :headers="{ Token: userStore.token }"
v-model:file-list="fileList" v-model:file-list="fileList"
class="upload-demo" class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" :on-success="handleAvatarSuccess_four"
multiple multiple
:limit="1" :limit="1"
@ -468,6 +468,8 @@ import AccountAdjust from "../components/account-adjust.vue";
import useMultipleTabs from "@/hooks/useMultipleTabs"; import useMultipleTabs from "@/hooks/useMultipleTabs";
import useUserStore from "@/stores/modules/user"; import useUserStore from "@/stores/modules/user";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
import { inject } from "vue";
const base_url: any = inject("base_url");
const { removeTab } = useMultipleTabs(); const { removeTab } = useMultipleTabs();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -662,8 +664,7 @@ const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
} }
formData.file = response.data.uri; formData.file = response.data.uri;
upContact({ file: formData.file, id: route.query.mdoeid }).then((res) => [ upContact({ file: formData.file, id: route.query.mdoeid }).then((res) => [
mode.value=false (mode.value = false),
]); ]);
}; };
const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => { const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {

View File

@ -385,7 +385,7 @@
:headers="{ Token: userStore.token }" :headers="{ Token: userStore.token }"
v-model:file-list="fileList" v-model:file-list="fileList"
class="upload-demo" class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" :on-success="handleAvatarSuccess_four"
multiple multiple
:limit="1" :limit="1"
@ -427,7 +427,7 @@ import {
type UploadUserFile, type UploadUserFile,
} from "element-plus"; } from "element-plus";
import { apiContractDetail } from "@/api/contract"; import { apiContractDetail } from "@/api/contract";
import { ref, reactive, defineExpose, computed } from "vue"; import { ref, reactive, defineExpose, computed, inject } from "vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { dictDataLists } from "@/api/setting/dict"; import { dictDataLists } from "@/api/setting/dict";
import { upContact } from "@/api/consumer"; import { upContact } from "@/api/consumer";
@ -435,6 +435,7 @@ const { query } = useRoute();
import useUserStore from "@/stores/modules/user"; import useUserStore from "@/stores/modules/user";
import useMultipleTabs from "@/hooks/useMultipleTabs"; import useMultipleTabs from "@/hooks/useMultipleTabs";
const { removeTab } = useMultipleTabs(); const { removeTab } = useMultipleTabs();
const base_url: any = inject("base_url");
const formData = reactive({ const formData = reactive({
id: "", id: "",

View File

@ -21,7 +21,7 @@
v-model="formData.avatar" v-model="formData.avatar"
class="avatar-uploader-head" class="avatar-uploader-head"
:data="{ cid: 1 }" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccessAvatar" :on-success="handleAvatarSuccessAvatar"
> >
@ -231,6 +231,8 @@ import {
import { dictDataLists } from "@/api/setting/dict"; import { dictDataLists } from "@/api/setting/dict";
import DialogIndex from "./dialog_index.vue"; import DialogIndex from "./dialog_index.vue";
import useUserStore from "@/stores/modules/user"; import useUserStore from "@/stores/modules/user";
import { inject } from "vue";
const base_url: any = inject("base_url");
const disabledPartyA = ref(true); const disabledPartyA = ref(true);
const isCheck = ref(false); const isCheck = ref(false);
const isCheckFn = (flag: boolean) => { const isCheckFn = (flag: boolean) => {

View File

@ -51,7 +51,7 @@
overflow: hidden; overflow: hidden;
" "
v-model="formData.icon" v-model="formData.icon"
action="https://worker-task.lihaink.cn/api/upload/image" :action="base_url + '/upload/image'"
:show-file-list="false" :show-file-list="false"
:data="{ cid: 1 }" :data="{ cid: 1 }"
:on-success="handleMenuIcon" :on-success="handleMenuIcon"
@ -118,6 +118,8 @@ import {
import { timeFormat } from "@/utils/util"; import { timeFormat } from "@/utils/util";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { MenuEnum } from "@/enums/appEnums"; import { MenuEnum } from "@/enums/appEnums";
import { inject } from "vue";
const base_url: any = inject("base_url");
const props = defineProps({ const props = defineProps({
dictData: { dictData: {
type: Object as PropType<Record<string, any[]>>, type: Object as PropType<Record<string, any[]>>,