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