-
-
xiao12 数据达人Lv4
发表于2020-7-30 17:47
悬赏10
已解决
楼主
移动端的脚本有没有人知道使用方法类型等等,有没有文档之类的
最佳答案
本帖最后由 xxxl 于 2020-7-31 16:28 编辑
1.脚本调整移动端报表样式方法
2.使用示例
2.1注入脚本格式如下
复制代码2.2表格不分页,一屏宽
复制代码2.3tab标签头样式修改
复制代码2.4报表下拉框样式
复制代码这里展示部分示例给您作参考看一下
xiao12 发表于 2020-7-31 11:06
他的脚本我看了,有一部分要自己改,现在怎么改也不清楚
1.脚本调整移动端报表样式方法
组件 | 脚本方法 |
调整计算参数位置 | function adjustCalcparamPosition() |
WidgetsBuilder 报表加载完毕后的事件,可以调整样式 | function adjustWidgetBuilder(bodyarea) |
WidgetObj 统计图或其他组件样式调整 | function adjustWidgetObj(className,bodyarea,basedom) |
WidgetObj 调整高度 | function adjustWidgetObj_getChildMaxHeight(childnodes,max) |
WidgetParamComboBox 下拉框样式 | function adjustWidgetCombox(basedom,pnode,edit,label) |
WidgetParamComboBox 加载前 | function adjustWidgetCombox_initDom(basedom,pnode,edit,label) |
WidgetParamComboBoxTree 下拉树组件 | function adjustWidgetComboxTree(basedom,pnode,edit,label) |
WidgetParamComboBoxTree 加载前 | function adjustWidgetComboxTree_initDom(basedom,pnode,edit,label) |
WidgetParamDate 日期组件 | function adjustWidgetDate(basedom,pnode,edit,label) |
WidgetParamDate 加载前 | function adjustWidgetDate_initDom(basedom,pnode,edit,label) |
WidgetParamEdit 输入框组件 | function adjustWidgetEdit(basedom,pnode,edit,label) |
WidgetParamEdit 加载前 | function adjustWidgetEdit_initDom(basedom,pnode,edit,label) |
WidgetTab tab组件样式 | function adjustWidgetTab(tab) |
WidgetTab 切换tab页 active 页 | function adjustWidgetTabActive(active,tab) |
WidgetContainer 容器布局 | function adjustWidgetContainer(basedom) |
WidgetContainer 加载前 | function adjustWidgetContainer_initDom(basedom) |
WidgetContainer 渲染完成后 | function adjustWidgetContainer_delayInit(basedom) |
WidgetLayout sheet容器调整 | function adjustAddSheet(widget) |
WidgetResultGrid 表格样式 | function adjustWidgetResultGrid(basedom,table) |
统计图参数设置调整(这里可以看下echart官网配置项 ,datajson里面可以修改,添加属性) | function renderChart(datajson){ return datajson; } |
2.1注入脚本格式如下
- //提前注入移动端脚本
- if((typeof(isInjectionMobileJs)!="undefined")&&!isInjectionMobileJs){
- //不显示钻取等待框
- isShowZqWaitToast = false;
- //固定tab标签页+调整参数框位置
- function adjustWidgetTab() {
- ......
- }
- }
1、设置表格外容器|布局,取消勾选【手机自适应】选择
2、适当调整表格中文字大小,12px以上比较好
3、报表添加脚本- function adjustWidgetResultGrid(basedom,table){
- var width = this.document.body.clientWidth;
- var tableWidth = table.clientWidth;
- var scalenum = width/basedom.clientWidth;
- if(tableWidth > basedom.clientWidth){
- scalenum = width/tableWidth;
- }
- basedom.style.top= "-"+table.clientHeight*(1-scalenum)/2+"px";
- basedom.style.transform="scale("+scalenum +")";
- basedom.style.transformOrigin="left";
- }
- function adjustWidgetTab() {
- //标签头字号
- $(".headcontainer .subhead, .headcontainer .subhead_active").css("font-size", "10px");
- //标签头高度
- $(".headcontainer").css({"height":"35px","line-height":"32px"});
- $(".bodycontainer").css({"top":"35px"});
- }
- function adjustWidgetCombox(basedom, pnode, editinput, editlabel) {
- //是否是横屏
- var isHorScreen = false;
- if (window.screen.width > window.screen.height) {
- isHorScreen = true;
- } else {
- if (window.orientation == 90 || window.orientation == -90) {//ios
- isHorScreen = true;
- }
- }
- if(isHorScreen){//横屏情况下下拉框 左右间距20px 宽度占屏幕宽度的三分之一
- basedom.style.left = "0px";
- basedom.style.width = (window.screen.width - 40) / 3 + "px";
- }else{//竖屏情况下下拉框 宽度占屏幕宽度的二分之一
- basedom.style.width = (window.screen.width) / 2 + "px";
- }
-
- }
7个回答
本帖最后由 xxxl 于 2020-7-31 16:28 编辑
xiao12 发表于 2020-7-31 11:06
他的脚本我看了,有一部分要自己改,现在怎么改也不清楚
1.脚本调整移动端报表样式方法
组件 | 脚本方法 |
调整计算参数位置 | function adjustCalcparamPosition() |
WidgetsBuilder 报表加载完毕后的事件,可以调整样式 | function adjustWidgetBuilder(bodyarea) |
WidgetObj 统计图或其他组件样式调整 | function adjustWidgetObj(className,bodyarea,basedom) |
WidgetObj 调整高度 | function adjustWidgetObj_getChildMaxHeight(childnodes,max) |
WidgetParamComboBox 下拉框样式 | function adjustWidgetCombox(basedom,pnode,edit,label) |
WidgetParamComboBox 加载前 | function adjustWidgetCombox_initDom(basedom,pnode,edit,label) |
WidgetParamComboBoxTree 下拉树组件 | function adjustWidgetComboxTree(basedom,pnode,edit,label) |
WidgetParamComboBoxTree 加载前 | function adjustWidgetComboxTree_initDom(basedom,pnode,edit,label) |
WidgetParamDate 日期组件 | function adjustWidgetDate(basedom,pnode,edit,label) |
WidgetParamDate 加载前 | function adjustWidgetDate_initDom(basedom,pnode,edit,label) |
WidgetParamEdit 输入框组件 | function adjustWidgetEdit(basedom,pnode,edit,label) |
WidgetParamEdit 加载前 | function adjustWidgetEdit_initDom(basedom,pnode,edit,label) |
WidgetTab tab组件样式 | function adjustWidgetTab(tab) |
WidgetTab 切换tab页 active 页 | function adjustWidgetTabActive(active,tab) |
WidgetContainer 容器布局 | function adjustWidgetContainer(basedom) |
WidgetContainer 加载前 | function adjustWidgetContainer_initDom(basedom) |
WidgetContainer 渲染完成后 | function adjustWidgetContainer_delayInit(basedom) |
WidgetLayout sheet容器调整 | function adjustAddSheet(widget) |
WidgetResultGrid 表格样式 | function adjustWidgetResultGrid(basedom,table) |
统计图参数设置调整(这里可以看下echart官网配置项 ,datajson里面可以修改,添加属性) | function renderChart(datajson){ return datajson; } |
2.1注入脚本格式如下
- //提前注入移动端脚本
- if((typeof(isInjectionMobileJs)!="undefined")&&!isInjectionMobileJs){
- //不显示钻取等待框
- isShowZqWaitToast = false;
- //固定tab标签页+调整参数框位置
- function adjustWidgetTab() {
- ......
- }
- }
1、设置表格外容器|布局,取消勾选【手机自适应】选择
2、适当调整表格中文字大小,12px以上比较好
3、报表添加脚本- function adjustWidgetResultGrid(basedom,table){
- var width = this.document.body.clientWidth;
- var tableWidth = table.clientWidth;
- var scalenum = width/basedom.clientWidth;
- if(tableWidth > basedom.clientWidth){
- scalenum = width/tableWidth;
- }
- basedom.style.top= "-"+table.clientHeight*(1-scalenum)/2+"px";
- basedom.style.transform="scale("+scalenum +")";
- basedom.style.transformOrigin="left";
- }
- function adjustWidgetTab() {
- //标签头字号
- $(".headcontainer .subhead, .headcontainer .subhead_active").css("font-size", "10px");
- //标签头高度
- $(".headcontainer").css({"height":"35px","line-height":"32px"});
- $(".bodycontainer").css({"top":"35px"});
- }
- function adjustWidgetCombox(basedom, pnode, editinput, editlabel) {
- //是否是横屏
- var isHorScreen = false;
- if (window.screen.width > window.screen.height) {
- isHorScreen = true;
- } else {
- if (window.orientation == 90 || window.orientation == -90) {//ios
- isHorScreen = true;
- }
- }
- if(isHorScreen){//横屏情况下下拉框 左右间距20px 宽度占屏幕宽度的三分之一
- basedom.style.left = "0px";
- basedom.style.width = (window.screen.width - 40) / 3 + "px";
- }else{//竖屏情况下下拉框 宽度占屏幕宽度的二分之一
- basedom.style.width = (window.screen.width) / 2 + "px";
- }
-
- }