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

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

parent cbd6cce2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-19 11:20:56 * @LastEditTime: 2024-09-19 15:34:42
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-日期组件 * @Description: 动态渲染-日期组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</template> </template>
</van-field> </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 <van-datetime-picker
v-model="pickerValue" v-model="pickerValue"
:type="dateType[type]" :type="dateType[type]"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-19 15:26:43 * @LastEditTime: 2024-09-19 15:34:48
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-Lov * @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</template> </template>
</van-field> </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"> <div class="title">
<span></span> <span></span>
<span class="title-label">{{fieldConfig.description}}</span> <span class="title-label">{{fieldConfig.description}}</span>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-27 17:45:39 * @LastEditTime: 2024-09-19 15:34:53
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-Select * @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</van-field> </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"> <div class="title">
<span class="cancel" @click="showSelectOption(false)">取消</span> <span class="cancel" @click="showSelectOption(false)">取消</span>
<span class="title-label">请选择{{fieldConfig.description}}</span> <span class="title-label">请选择{{fieldConfig.description}}</span>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56 * @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20 22:51:47 * @LastEditTime: 2024-09-19 15:37:07
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 查询表单渲染 * @Description: 查询表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</template> </template>
</van-search> </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"> <div class="query-form">
<DForm :fields="fields" :originFields="originFields" ref="dformRef" formType="query" :showTitle="false" /> <DForm :fields="fields" :originFields="originFields" ref="dformRef" formType="query" :showTitle="false" />
</div> </div>
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style lang="less">
.query-form-popup { .query-form-popup {
max-height: 60%; max-height: 60%;
display: flex; display: flex;
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-31 15:09:30 * @Date: 2024-07-31 15:09:30
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:15:19 * @LastEditTime: 2024-09-19 15:40:34
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 页面按钮渲染 * @Description: 页面按钮渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
--> -->
<template> <template>
<div class="layout-buttons" :id="id" v-if="!readOnly && layoutButtons.length"> <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 <van-popover
v-if="layoutButtons.length > num" v-if="layoutButtons.length > num"
v-model="moreVisible" v-model="moreVisible"
...@@ -38,12 +39,12 @@ ...@@ -38,12 +39,12 @@
v-for="btn in defaultBtns" v-for="btn in defaultBtns"
round round
:key="btn.name" :key="btn.name"
:type="btn.name === 'save' ? 'info' : ''" :type="(btn.name==='save' || defaultBtns.length === 1) ? 'info' : ''"
:icon="buttonIcon[btn.name]"
class="layout-button" class="layout-button"
@click="handlClick(btn)" @click="handlClick(btn)"
>{{btn.description}}</van-button> >{{btn.description}}</van-button>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -64,6 +65,10 @@ export default { ...@@ -64,6 +65,10 @@ export default {
parentContext: { // 是否需要返回键 parentContext: { // 是否需要返回键
type: Object, type: Object,
default: () => ({}) default: () => ({})
},
safeArea: {
type: Boolean,
default: true
}, },
layoutButtonsFun: { // 自定义按钮方法 layoutButtonsFun: { // 自定义按钮方法
type: Array, type: Array,
...@@ -226,13 +231,14 @@ export default { ...@@ -226,13 +231,14 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.layout-buttons { .layout-buttons {
background: #FAFAFA;
box-shadow: 0px -2px 9px 0px rgba(226,226,226,1);
.layout-buttons-content {
padding: 10px; padding: 10px;
display: flex; display: flex;
position: relative; position: relative;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
background: #FAFAFA;
box-shadow: 0px -2px 9px 0px rgba(226,226,226,1);
.layout-button { .layout-button {
min-width: 90px; min-width: 90px;
...@@ -275,5 +281,6 @@ export default { ...@@ -275,5 +281,6 @@ export default {
// box-shadow: 0px 2px 2px 0px #3789ff; // box-shadow: 0px 2px 2px 0px #3789ff;
} }
} }
}
} }
</style> </style>
...@@ -24,9 +24,9 @@ export default { ...@@ -24,9 +24,9 @@ export default {
} }
}, },
mounted () { mounted () {
if (this.calContent) { // if (this.calContent) {
this.resizeHeight() // this.resizeHeight()
} // }
}, },
update () { update () {
// if (this.calContent) { // if (this.calContent) {
......
...@@ -2,52 +2,24 @@ ...@@ -2,52 +2,24 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 11:26:14 * @Date: 2024-08-16 11:26:14
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-16 11:30:27 * @LastEditTime: 2024-09-19 15:42:47
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
--> -->
<template> <template>
<div :class="{'h-ios': isIos}" class="h-view"> <div class="d-view">
<slot/> <slot/>
</div> </div>
</template> </template>
<script> <script>
import { detectOS } from '../../utils/utils';
export default { export default {
name: 'DView', name: 'DView',
props: {
fullScreen: {
// 是否为全屏应用,全屏子应用此项需设为true
type: Boolean,
default: true,
},
title: {
type: String,
default: '',
},
},
data () { data () {
return { 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> </script>
...@@ -59,37 +31,14 @@ export default { ...@@ -59,37 +31,14 @@ export default {
input:hover ,input:focus{ input:hover ,input:focus{
caret-color: #3367d6; caret-color: #3367d6;
} }
.h-view { .d-view {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; // overflow: hidden;
// padding-bottom: 44px; // padding-bottom: 44px;
// background-color: $bgColor; background-color: #fafafa;
} box-sizing: border-box;
.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;
}
}
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56 * @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:53:19 * @LastEditTime: 2024-09-19 15:52:43
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
:layoutButtonsFun="layoutButtons" :layoutButtonsFun="layoutButtons"
:headerButtons="headerButtons" :headerButtons="headerButtons"
:layoutButtonsDefaultFun="layoutButtonsDefaultFun" :layoutButtonsDefaultFun="layoutButtonsDefaultFun"
:safeArea="safeArea"
/> />
</d-view> </d-view>
</template> </template>
...@@ -43,7 +44,7 @@ import ConfigRenderComponent from './ConfigRenderComponent/index.jsx'; ...@@ -43,7 +44,7 @@ import ConfigRenderComponent from './ConfigRenderComponent/index.jsx';
import {query, queryRoute, save} from './service' import {query, queryRoute, save} from './service'
import './index.less' import './index.less'
import EventBus from './utils/eventBus'; import EventBus from './utils/eventBus';
import {getLayoutSaveData} from './utils/utils'; import {getLayoutSaveData, reloadData} from './utils/utils';
export default { export default {
name: 'Dynamic', name: 'Dynamic',
...@@ -99,6 +100,10 @@ export default { ...@@ -99,6 +100,10 @@ export default {
type: Function, type: Function,
default: () => {} default: () => {}
}, },
safeArea: { // 是否显示安全区域
type: Boolean,
default: true
},
routeParams: { routeParams: {
type: Object, type: Object,
default: null default: null
...@@ -213,16 +218,23 @@ export default { ...@@ -213,16 +218,23 @@ export default {
} }
}, },
// 布局按钮保存 // 布局按钮保存
async layoutSave() { async layoutSave(needReload = true) {
const data = await getLayoutSaveData(this.getDynamicInfo()); const data = await getLayoutSaveData(this.getDynamicInfo());
try { try {
const res = await save(data); const res = await save(data);
Toast.success('保存成功!'); Toast.success('保存成功!');
if (needReload) {
reloadData(this.dataSetObject, 'Form')
}
return true; return true;
} catch(err) { } catch(err) {
throw new Error("保存失败"); throw new Error("保存失败");
} }
}, },
// 整个页面数据重加载
reload(type) {
reloadData(this.dataSetObject, type)
},
backClick() { backClick() {
if (this.$attrs['onGoBack']) { if (this.$attrs['onGoBack']) {
this.$emit('goBack'); this.$emit('goBack');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 14:39:47 * @Date: 2024-07-30 14:39:47
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:24:17 * @LastEditTime: 2024-09-19 15:45:12
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 工具类 * @Description: 工具类
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -259,6 +259,31 @@ const getDataSets = (dynamicInfo, dataSetTree) => { ...@@ -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 { export {
getCustomizedProp, getCustomizedProp,
...@@ -272,5 +297,6 @@ export { ...@@ -272,5 +297,6 @@ export {
getOrganizationId, getOrganizationId,
getCurrentUser, getCurrentUser,
isTenantRoleLevel, isTenantRoleLevel,
getLayoutSaveData getLayoutSaveData,
reloadData
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 09:39:36 * @Date: 2024-08-16 09:39:36
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 17:37:33 * @LastEditTime: 2024-09-19 15:35:34
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 商机维护详情 * @Description: 商机维护详情
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
style="width: 100%; height: 50%; padding: 15px; box-sizing: border-box;" style="width: 100%; height: 50%; padding: 15px; box-sizing: border-box;"
position="bottom" position="bottom"
closeable closeable
get-container="body"
> >
<div style="text-align: center;margin-bottom: 15px">附件信息</div> <div style="text-align: center;margin-bottom: 15px">附件信息</div>
<DAttachment <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