!862 fix: 完成 review c153ff93 的所有 TODO 修复

Merge pull request !862 from puhui999/master-dev
pull/869/head
芋道源码 2026-03-07 03:56:34 +00:00 committed by Gitee
commit f29a384904
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 23 additions and 27 deletions

View File

@ -18,8 +18,7 @@
<script lang="ts" setup>
import { onMounted, ref, watch } from 'vue'
import { getAreaTree } from '@/api/system/area'
// TODO @puhui999 handleTree
import { handleTree } from '@/utils/tree'
import { AreaLevelEnum } from '@/utils/constants'
defineOptions({ name: 'AreaSelect' })
@ -35,7 +34,7 @@ interface AreaVO {
interface Props {
modelValue?: number[] | string[]
level?: 1 | 2 | 3 // 1- 2- 3- TODO @puhui999
level?: typeof AreaLevelEnum[keyof typeof AreaLevelEnum]
disabled?: boolean
placeholder?: string
clearable?: boolean
@ -46,7 +45,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {
modelValue: undefined,
level: 3, // TODO @puhui999
level: AreaLevelEnum.DISTRICT,
disabled: false,
placeholder: '请选择省市区',
clearable: true,

View File

@ -23,8 +23,8 @@
</template>
<script lang="ts" setup>
// TODO @AI
import { computed, ref, watch } from 'vue'
import { computed } from 'vue'
import { isUrl } from '@/utils/is'
defineOptions({ name: 'IframeComponent' })
@ -51,27 +51,11 @@ const props = withDefaults(defineProps<Props>(), {
sandbox: ''
})
// TODO @puhui999
const emit = defineEmits<{
(e: 'update:modelValue', value: string): void
}>()
const displayUrl = computed(() => props.url || props.modelValue || '') // URL使 url prop使 modelValue
const showPreview = computed(() => {
return displayUrl.value && isValidUrl(displayUrl.value)
return displayUrl.value && isUrl(displayUrl.value)
}) //
// TODO @puhui999
/** URL 验证 */
function isValidUrl(url: string): boolean {
if (!url || url.trim() === '') return false
try {
const urlObj = new URL(url)
return urlObj.protocol === 'http:' || urlObj.protocol === 'https:'
} catch {
return false
}
}
</script>
<style scoped>

View File

@ -1,5 +1,6 @@
import { generateUUID } from '@/utils'
import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils'
import { AreaLevelEnum } from '@/utils/constants'
/**
*
@ -7,6 +8,7 @@ import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils
export const useAreaSelectRule = () => {
const label = '省市区选择器'
const name = 'AreaSelect'
return {
icon: 'icon-location',
label,
@ -27,11 +29,11 @@ export const useAreaSelectRule = () => {
type: 'select',
field: 'level',
title: '选择层级',
value: 3,
value: AreaLevelEnum.DISTRICT,
options: [
{ label: '省', value: 1 },
{ label: '省/市', value: 2 },
{ label: '省/市/区', value: 3 }
{ label: '省', value: AreaLevelEnum.PROVINCE },
{ label: '省/市', value: AreaLevelEnum.CITY },
{ label: '省/市/区', value: AreaLevelEnum.DISTRICT }
],
info: '限制可选择的地区层级'
},

View File

@ -7,6 +7,7 @@ import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils
export const useIframeRule = () => {
const label = '网页 iframe'
const name = 'IframeComponent'
return {
icon: 'icon-link',
label,

View File

@ -463,3 +463,13 @@ export const BpmAutoApproveType = {
APPROVE_ALL: 1, // 仅审批一次,后续重复的审批节点均自动通过
APPROVE_SEQUENT: 2 // 仅针对连续审批的节点自动通过
}
// ========== SYSTEM - 地区模块 ==========
/**
*
*/
export const AreaLevelEnum = {
PROVINCE: 1, // 省
CITY: 2, // 市
DISTRICT: 3 // 区
}