blocked sending SMS
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
class="w-[96px] h-[96px] overflow-hidden border border-solid border-blue-600 bg-gray-50 rounded-md p-2"
|
||||
>
|
||||
<AUpload
|
||||
accept=".jpg,.jpeg,.png,.webp"
|
||||
class="fix-capture"
|
||||
accept="image/*"
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
list-type="picture-card"
|
||||
@@ -12,7 +13,6 @@
|
||||
:multiple="false"
|
||||
:max-count="1"
|
||||
:action="uploadURL"
|
||||
:capture="undefined"
|
||||
:headers="fileHeader"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange"
|
||||
@@ -38,8 +38,9 @@ import { LoadingOutlined } from '@ant-design/icons-vue'
|
||||
import { usePrefix } from '@core/composable/usePrefix'
|
||||
import { uploadURL } from '@root/config'
|
||||
import { getToken } from '@/utils'
|
||||
import { fixFileCapture } from '@/utils/fixFileCapture'
|
||||
import { normalizeUploadFileResponse } from '@/utils/file'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const { prefixCls } = usePrefix('index-image-uploader')
|
||||
const previewVisible = ref(false)
|
||||
@@ -93,6 +94,8 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||
}
|
||||
|
||||
function handleChange(info: UploadChangeParam) {
|
||||
fixFileCapture()
|
||||
|
||||
if (info.file.status === 'uploading') {
|
||||
loading.value = true
|
||||
return
|
||||
@@ -130,6 +133,10 @@ function handleChange(info: UploadChangeParam) {
|
||||
emits('delete', info.file.uid)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixFileCapture()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class="border border-solid border-blue-600 bg-gray-50 w-full rounded-md p-2">
|
||||
<div class="flex">
|
||||
<AUpload
|
||||
accept=".jpg,.jpeg,.png,.webp"
|
||||
class="fix-capture"
|
||||
accept="image/*"
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
list-type="picture-card"
|
||||
:show-upload-list="false"
|
||||
:action="uploadURL"
|
||||
:capture="undefined"
|
||||
:headers="fileHeader"
|
||||
:showUploadList="true"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -29,8 +29,10 @@
|
||||
import type {UploadChangeParam, UploadProps} from 'ant-design-vue'
|
||||
import {uploadURL} from '@root/config'
|
||||
import {getToken} from '@/utils'
|
||||
import {fixFileCapture} from '@/utils/fixFileCapture'
|
||||
import {usePrefix} from '@core/composable/usePrefix'
|
||||
import {message} from 'ant-design-vue'
|
||||
import {onMounted} from 'vue'
|
||||
|
||||
const {prefixCls} = usePrefix('product-image-uploader')
|
||||
const loading = ref<boolean>(false)
|
||||
@@ -65,6 +67,8 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||
}
|
||||
|
||||
function handleChange(info: UploadChangeParam) {
|
||||
fixFileCapture()
|
||||
|
||||
if (info.file.status === 'uploading') {
|
||||
loading.value = true
|
||||
return
|
||||
@@ -84,6 +88,10 @@ function handleChange(info: UploadChangeParam) {
|
||||
emits('delete', info.file.uid)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixFileCapture()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -42,6 +42,7 @@ import { onMounted, ref, watch, computed } from 'vue'
|
||||
import { LoadingOutlined } from '@ant-design/icons-vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { getToken } from '@/utils'
|
||||
import { fixFileCapture } from '@/utils/fixFileCapture'
|
||||
|
||||
const loading = ref<boolean>(false)
|
||||
const percent = ref<number>(0)
|
||||
@@ -71,7 +72,7 @@ function handelChange({ file, fileList }) {
|
||||
if (Object.hasOwn(file, 'percent')) {
|
||||
percent.value = Math.floor(file.percent)
|
||||
}
|
||||
fixUpload()
|
||||
fixFileCapture()
|
||||
|
||||
if (file.status === 'uploading') {
|
||||
loading.value = true
|
||||
@@ -93,14 +94,8 @@ function handelChange({ file, fileList }) {
|
||||
}
|
||||
}
|
||||
|
||||
function fixUpload() {
|
||||
document.querySelectorAll('.fix-capture input').forEach((item) => {
|
||||
item.removeAttribute('capture')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixUpload()
|
||||
fixFileCapture()
|
||||
})
|
||||
|
||||
function deleteAvatar(e) {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<template>
|
||||
<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden">
|
||||
<BasicShowContext title="لیست پیامک ها">
|
||||
<template v-if="!mobile && isMobileScreen" #extra>
|
||||
<!-- <template v-if="!mobile && isMobileScreen" #extra>
|
||||
<BaseButton type="primary" size="small" icon="vuesax-linear:sms" @click="emits('add')">
|
||||
ارسال پیامک
|
||||
</BaseButton>
|
||||
</template>
|
||||
</template>-->
|
||||
|
||||
<div class="flex h-full min-h-0 flex-col">
|
||||
<BaseTable v-if="!isMobileScreen" class="h-full min-h-0 min-w-0" v-bind="tblProps" @register="submit" ref="tbl">
|
||||
<template #extraHeader>
|
||||
<!-- <template #extraHeader>
|
||||
<BaseButton v-if="!mobile" type="primary" size="small" icon="vuesax-linear:sms" @click="emits('add')">
|
||||
ارسال پیامک
|
||||
</BaseButton>
|
||||
</template>
|
||||
</template>-->
|
||||
<template #action="{ column, record }">
|
||||
<!-- <div class="gap-2 flex justify-center">
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/** جلوگیری از باز شدن مستقیم دوربین روی موبایل — انتخاب از گالری */
|
||||
export function fixFileCapture(root: ParentNode | Document = document): void {
|
||||
root.querySelectorAll<HTMLInputElement>('.fix-capture input[type="file"]').forEach((input) => {
|
||||
input.removeAttribute('capture')
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user