提交
This commit is contained in:
1 parent
22be6d8b36
commit
ec4b9438b4
79 files changed
+12607
-8922
No files matched your search
@@ -1,15 +1,7 @@
|
||||
<!-- FormCreate 自定义控件:部门选择(Fresh Mint · PC 树选 + 窄屏抽屉) -->
|
||||
<template>
|
||||
<div class="oa-dept-select">
|
||||
<!-- 设计器 iframe 无 Pinia/鉴权,仅展示占位,避免拖入时打接口报错 -->
|
||||
<template v-if="isDesignerHost">
|
||||
<div class="oa-dept-select__preview">
|
||||
<span class="oa-dept-select__placeholder">请选择部门</span>
|
||||
<span class="oa-dept-select__chev">▾</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else-if="disabled">
|
||||
<template v-if="disabled">
|
||||
<span class="oa-dept-select__readonly">{{ displayText || '—' }}</span>
|
||||
</template>
|
||||
|
||||
@@ -75,7 +67,6 @@
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择部门"
|
||||
style="width: 100%"
|
||||
@update:model-value="onTreeSelectChange"
|
||||
>
|
||||
<template #default="{ data }">
|
||||
@@ -117,17 +108,6 @@
|
||||
|
||||
type TreeNode = { value: string; label: string; children?: TreeNode[] }
|
||||
|
||||
/** 表单设计器隔离宿主(无 Pinia / Token,禁止打业务 API) */
|
||||
function detectDesignerHost() {
|
||||
try {
|
||||
return /oa-fc-host\.html/i.test(String(window.location?.pathname || ''))
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const isDesignerHost = detectDesignerHost()
|
||||
|
||||
const pathMap = ref(new Map<string, string>())
|
||||
const treeSelectData = ref<TreeNode[]>([])
|
||||
const isNarrow = ref(false)
|
||||
@@ -246,7 +226,6 @@
|
||||
})
|
||||
|
||||
async function loadTree() {
|
||||
if (isDesignerHost) return
|
||||
try {
|
||||
const tree = (await fetchDeptTree()) || []
|
||||
pathMap.value = buildPathLabelMapFromTreeRoots(tree, { nameKey: 'deptName' })
|
||||
@@ -276,25 +255,38 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.oa-dept-select {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.oa-dept-select__preview,
|
||||
.oa-dept-select__trigger {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-height: 36px;
|
||||
padding: 4px 12px;
|
||||
border: 1px solid var(--mint-border, #cbd5e1);
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.oa-dept-select__trigger {
|
||||
cursor: pointer;
|
||||
.oa-dept-select__tree-select {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.oa-dept-select__tree-select :deep(.el-select),
|
||||
.oa-dept-select__tree-select :deep(.el-select__wrapper),
|
||||
.oa-dept-select__tree-select :deep(.el-tooltip__trigger) {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.oa-dept-select__readonly {
|
||||
@@ -309,11 +301,13 @@
|
||||
}
|
||||
|
||||
.oa-dept-select__trigger-text {
|
||||
min-width: 0;
|
||||
color: var(--mint-text, #0f172a);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.oa-dept-select__chev {
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 11px;
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
<!-- FormCreate 自定义控件:金额(数字 + 可选人民币大写;窄屏/手机预览友好) -->
|
||||
<template>
|
||||
<div class="oa-money-field">
|
||||
<template v-if="isDesignerHost">
|
||||
<el-input
|
||||
model-value=""
|
||||
:placeholder="placeholder || '请输入金额'"
|
||||
inputmode="decimal"
|
||||
disabled
|
||||
/>
|
||||
<div v-if="showUpper" class="oa-money-field__upper">大写金额预览</div>
|
||||
</template>
|
||||
<template v-else-if="disabled">
|
||||
<template v-if="disabled">
|
||||
<div class="oa-money-field__readonly">
|
||||
<span class="oa-money-field__num">{{ displayNumber || '—' }}</span>
|
||||
<div v-if="showUpper && upperText" class="oa-money-field__upper">{{ upperText }}</div>
|
||||
@@ -54,16 +45,6 @@
|
||||
(e: 'change', v: number | null): void
|
||||
}>()
|
||||
|
||||
/** 表单设计器隔离宿主(无 Pinia / Token) */
|
||||
function detectDesignerHost() {
|
||||
try {
|
||||
return /oa-fc-host\.html/i.test(String(window.location?.pathname || ''))
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
const isDesignerHost = detectDesignerHost()
|
||||
|
||||
function toNum(v: unknown): number | null {
|
||||
if (v == null || v === '') return null
|
||||
const n = typeof v === 'number' ? v : Number(String(v).replace(/,/g, ''))
|
||||
@@ -88,7 +69,10 @@
|
||||
|
||||
<style scoped>
|
||||
.oa-money-field {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* 窄屏/手机预览:触控高度与全宽 */
|
||||
|
||||
Reference in new issue
Block a user