Commit 8baea3e6 authored by 王纵's avatar 王纵

低代码组件增加iOS安全区域、弹出框在ios上无法显示、页面保存后刷新数据

parent cbd6cce2
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-19 11:20:56
* @LastEditTime: 2024-09-19 15:34:42
* @Version: 1.0.0
* @Description: 动态渲染-日期组件
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -39,7 +39,7 @@
</template>
</van-field>
<van-popup v-model="visible" round position="bottom" class="d-date-popup">
<van-popup v-model="visible" round position="bottom" class="d-date-popup" get-container="body">
<van-datetime-picker
v-model="pickerValue"
:type="dateType[type]"
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-19 15:26:43
* @LastEditTime: 2024-09-19 15:34:48
* @Version: 1.0.0
* @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -47,7 +47,7 @@
</template>
</van-field>
<van-popup v-model="visible" round position="bottom" class="d-lov-popup">
<van-popup v-model="visible" round position="bottom" class="d-lov-popup" get-container="body">
<div class="title">
<span></span>
<span class="title-label">{{fieldConfig.description}}</span>
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-27 17:45:39
* @LastEditTime: 2024-09-19 15:34:53
* @Version: 1.0.0
* @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -45,7 +45,7 @@
</van-field>
<van-popup v-model="visible" round position="bottom" class="d-select-popup">
<van-popup v-model="visible" round position="bottom" class="d-select-popup" get-container="body">
<div class="title">
<span class="cancel" @click="showSelectOption(false)">取消</span>
<span class="title-label">请选择{{fieldConfig.description}}</span>
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20 22:51:47
* @LastEditTime: 2024-09-19 15:37:07
* @Version: 1.0.0
* @Description: 查询表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -22,7 +22,7 @@
</template>
</van-search>
<van-popup v-model="show" position="top" class="query-form-popup">
<van-popup v-model="show" position="top" class="query-form-popup" get-container="body" safe-area-inset-top safe-area-inset-bottom>
<div class="query-form">
<DForm :fields="fields" :originFields="originFields" ref="dformRef" formType="query" :showTitle="false" />
</div>
......@@ -126,7 +126,7 @@ export default {
}
</script>
<style scoped lang="less">
<style lang="less">
.query-form-popup {
max-height: 60%;
display: flex;
......
......@@ -2,47 +2,48 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-31 15:09:30
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:15:19
* @LastEditTime: 2024-09-19 15:40:34
* @Version: 1.0.0
* @Description: 页面按钮渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
-->
<template>
<div class="layout-buttons" :id="id" v-if="!readOnly && layoutButtons.length">
<van-popover
v-if="layoutButtons.length > num"
v-model="moreVisible"
trigger="click"
placement="top-start"
class="test"
:get-container="`#${id}`"
>
<div class="layout-button-more-content">
<van-button
v-for="btn in hideBtns"
round
:key="btn.name"
:type="btn.name === 'save' ? 'info' : ''"
:icon="buttonIcon[btn.name]"
class="layout-button"
@click="handlClick(btn)"
>{{btn.description}}</van-button>
</div>
<div :class="safeArea ? 'van-safe-area-bottom layout-buttons' : 'layout-buttons'" v-if="!readOnly && layoutButtons.length">
<div class="layout-buttons-content" :id="id" >
<van-popover
v-if="layoutButtons.length > num"
v-model="moreVisible"
trigger="click"
placement="top-start"
class="test"
:get-container="`#${id}`"
>
<div class="layout-button-more-content">
<van-button
v-for="btn in hideBtns"
round
:key="btn.name"
:type="btn.name === 'save' ? 'info' : ''"
:icon="buttonIcon[btn.name]"
class="layout-button"
@click="handlClick(btn)"
>{{btn.description}}</van-button>
</div>
<template #reference>
<span class="layout-button-more"><van-icon name="more-o" />更多</span>
</template>
</van-popover>
<template #reference>
<span class="layout-button-more"><van-icon name="more-o" />更多</span>
</template>
</van-popover>
<van-button
v-for="btn in defaultBtns"
round
:key="btn.name"
:type="btn.name === 'save' ? 'info' : ''"
:icon="buttonIcon[btn.name]"
class="layout-button"
@click="handlClick(btn)"
>{{btn.description}}</van-button>
<van-button
v-for="btn in defaultBtns"
round
:key="btn.name"
:type="(btn.name==='save' || defaultBtns.length === 1) ? 'info' : ''"
class="layout-button"
@click="handlClick(btn)"
>{{btn.description}}</van-button>
</div>
</div>
</template>
......@@ -64,6 +65,10 @@ export default {
parentContext: { // 是否需要返回键
type: Object,
default: () => ({})
},
safeArea: {
type: Boolean,
default: true
},
layoutButtonsFun: { // 自定义按钮方法
type: Array,
......@@ -226,53 +231,55 @@ export default {
<style scoped lang="less">
.layout-buttons {
padding: 10px;
display: flex;
position: relative;
align-items: center;
justify-content: space-around;
background: #FAFAFA;
box-shadow: 0px -2px 9px 0px rgba(226,226,226,1);
.layout-button {
min-width: 90px;
margin: 0 6px;
font-family: PingFangSC-Semibold;
font-size: 16px;
font-weight: 600;
flex: 1;
}
.layout-button-more {
color: #666666;
font-size: 12px;
line-height: 17px;
.layout-buttons-content {
padding: 10px;
display: flex;
color: #666;
margin: 0 6px;
flex-direction: column;
position: relative;
align-items: center;
.van-icon-more-o {
justify-content: space-around;
.layout-button {
min-width: 90px;
margin: 0 6px;
font-family: PingFangSC-Semibold;
font-size: 16px;
font-weight: 600;
flex: 1;
}
}
.layout-button-more-content {
z-index: 1;
position: absolute;
left: -12px;
bottom: 100%;
display: flex;
flex-direction: column;
padding: 0 12px;
margin-bottom: 24px;
.layout-button {
margin-top: 12px;
min-width: 120px;
box-shadow: 0px 0px 18px 0px rgba(0,0,0,0.2);
border-radius: 20px;
white-space: nowrap;
padding: 10px;
// margin: 6px 0;
// box-shadow: 0px 2px 2px 0px #3789ff;
.layout-button-more {
color: #666666;
font-size: 12px;
line-height: 17px;
display: flex;
color: #666;
margin: 0 6px;
flex-direction: column;
align-items: center;
.van-icon-more-o {
font-size: 16px;
}
}
.layout-button-more-content {
z-index: 1;
position: absolute;
left: -12px;
bottom: 100%;
display: flex;
flex-direction: column;
padding: 0 12px;
margin-bottom: 24px;
.layout-button {
margin-top: 12px;
min-width: 120px;
box-shadow: 0px 0px 18px 0px rgba(0,0,0,0.2);
border-radius: 20px;
white-space: nowrap;
padding: 10px;
// margin: 6px 0;
// box-shadow: 0px 2px 2px 0px #3789ff;
}
}
}
}
......
......@@ -24,9 +24,9 @@ export default {
}
},
mounted () {
if (this.calContent) {
this.resizeHeight()
}
// if (this.calContent) {
// this.resizeHeight()
// }
},
update () {
// if (this.calContent) {
......
......@@ -2,52 +2,24 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 11:26:14
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-16 11:30:27
* @LastEditTime: 2024-09-19 15:42:47
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
-->
<template>
<div :class="{'h-ios': isIos}" class="h-view">
<div class="d-view">
<slot/>
</div>
</template>
<script>
import { detectOS } from '../../utils/utils';
export default {
name: 'DView',
props: {
fullScreen: {
// 是否为全屏应用,全屏子应用此项需设为true
type: Boolean,
default: true,
},
title: {
type: String,
default: '',
},
},
data () {
return {
isIos: false,
}
},
mounted () {
if (this.title) {
document.title = this.title
}
},
activated () {
if (this.title) {
document.title = this.title
}
},
created () {
this.fullScreen && detectOS() === 'ios' && (this.isIos = true)
document.body.classList.add('platform-' + detectOS())
},
}
</script>
......@@ -59,37 +31,14 @@ export default {
input:hover ,input:focus{
caret-color: #3367d6;
}
.h-view {
.d-view {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: hidden;
// overflow: hidden;
// padding-bottom: 44px;
// background-color: $bgColor;
}
.platform-ios {
.h-view {
// padding-bottom: 64px;
}
}
// iPhoneX适配
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
.platform-ios {
.h-view {
// padding-bottom: 120px;
}
}
}
// iPhoneX Max适配
@media only screen and (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.h-view {
// padding-bottom: 120px;
}
}
background-color: #fafafa;
box-sizing: border-box;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:53:19
* @LastEditTime: 2024-09-19 15:52:43
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -31,6 +31,7 @@
:layoutButtonsFun="layoutButtons"
:headerButtons="headerButtons"
:layoutButtonsDefaultFun="layoutButtonsDefaultFun"
:safeArea="safeArea"
/>
</d-view>
</template>
......@@ -43,7 +44,7 @@ import ConfigRenderComponent from './ConfigRenderComponent/index.jsx';
import {query, queryRoute, save} from './service'
import './index.less'
import EventBus from './utils/eventBus';
import {getLayoutSaveData} from './utils/utils';
import {getLayoutSaveData, reloadData} from './utils/utils';
export default {
name: 'Dynamic',
......@@ -99,6 +100,10 @@ export default {
type: Function,
default: () => {}
},
safeArea: { // 是否显示安全区域
type: Boolean,
default: true
},
routeParams: {
type: Object,
default: null
......@@ -213,16 +218,23 @@ export default {
}
},
// 布局按钮保存
async layoutSave() {
async layoutSave(needReload = true) {
const data = await getLayoutSaveData(this.getDynamicInfo());
try {
const res = await save(data);
Toast.success('保存成功!');
if (needReload) {
reloadData(this.dataSetObject, 'Form')
}
return true;
} catch(err) {
throw new Error("保存失败");
}
},
// 整个页面数据重加载
reload(type) {
reloadData(this.dataSetObject, type)
},
backClick() {
if (this.$attrs['onGoBack']) {
this.$emit('goBack');
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 14:39:47
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:24:17
* @LastEditTime: 2024-09-19 15:45:12
* @Version: 1.0.0
* @Description: 工具类
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -259,6 +259,31 @@ const getDataSets = (dynamicInfo, dataSetTree) => {
}
}
const reloadData = (dataSets, type = 'all') => {
for (let key in dataSets) {
if (dataSets.hasOwnProperty(key)) {
const {instanceRef} = dataSets[key];
if(instanceRef) {
if (type === 'all') {
if (dataSets[key].tabType==='Form') {
instanceRef.loadData();
} else if (dataSets[key].tabType==='Table') {
instanceRef.refresh();
}
} else {
if (type === 'Form' && dataSets[key].tabType==='Form') {
instanceRef.loadData();
}
if (type === 'Table' && dataSets[key].tabType==='Table') {
instanceRef.refresh();
}
}
}
}
}
}
export {
getCustomizedProp,
......@@ -272,5 +297,6 @@ export {
getOrganizationId,
getCurrentUser,
isTenantRoleLevel,
getLayoutSaveData
getLayoutSaveData,
reloadData
};
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 09:39:36
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 17:37:33
* @LastEditTime: 2024-09-19 15:35:34
* @Version: 1.0.0
* @Description: 商机维护详情
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -24,6 +24,7 @@
style="width: 100%; height: 50%; padding: 15px; box-sizing: border-box;"
position="bottom"
closeable
get-container="body"
>
<div style="text-align: center;margin-bottom: 15px">附件信息</div>
<DAttachment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment