前端开发、easyUI+vue+uView开发问题记录

Easy-UI语法

1.table-时间列格式转换

复制代码
formatter:function (value,row,index) {
      var oldTime = (new Date(value)).getTime();
      return new Date(oldTime).format("yyyy-MM-dd");
  }

2.按钮图片样式存储

复制代码
static\plugins\font-awesome-4.7.0\css\font-awesome.css

3.防止table加载两次

复制代码
1.table定义不加url
2.加载时:
    grid.datagrid('options').url = "/repairExtraCost/list";
    grid.datagrid('load', { planId: data.id});

4.dialog弹出框无法垂直居中

复制代码
$('#toRepairDlg').window('hcenter');

5.输入条件查询easyUI表格,出现N行空表格数据

复制代码
//系上一次查询的5条数据,这次查询为空,并且返回格式不符合DataGrid格式,查看page返回的格式
//如果未空,可以这么返回
    return RespTable.ok(RespTable.getPage(InstanceVO.class, request));

6.树形结构 treegrid弹出框保存后,不刷新问题

复制代码
//重点在此 openner_template_datagrid
$.modalDialog.openner_template_datagrid = materialTypeTabGrid;
​
edit.html中save方法:
$.modalDialog.openner_template_datagrid.treegrid("reload");

7.可编辑combogrid字段选择后,空白处弹出数据表格

复制代码
//先结束编辑,再更新行
supplierPriceGrid.datagrid('endEdit', editIndex);
supplierPriceGrid.datagrid('updateRow', {index:x,row:{...}});

8.date-box不可选当前时间之后的日期

复制代码
    $('#applyDate').datebox().datebox('calendar').calendar({
        validator : function(date){
            var now = new Date();
            var d1 = new Date(now.getFullYear(),now.getMonth(),now.getDate());
            return d1 >= date;
        }
    });

9.输入后远程自动刷新查询数据remote

复制代码
js: mode: 'remote',
java: @RequestParam(name = "q", defaultValue = "") String keyword
备注:如果是combotree等部分组件,不需要访问后台就可以自动过滤

10.点击复选框行中某一列,会自动取消/勾选复选框(比如只想要查看图片)

复制代码
//定义变量lookImg;
var lookImg = true;
//datagrid定义勾选、取消勾选的方法
onBeforeCheck: function (index, row) {
                if (lookImg) {
                    return lookImg;
                }
                lookImg = true;
​
                return false;
            },
            onBeforeUncheck: function (index, row) {
                if (lookImg) {
                    return lookImg;
                }
                lookImg = true;
​
                return false;
            }
//特定单元格的点击时间中, 做lookImg变量处理
function xxxx(){
    lookImg = false;
    ...
    ...
}
​

10. treegrid多选框,仅选择一部分数据,没上传父节点问题

复制代码
var inNodes = componentsTempGrid.treegrid('getCheckedNodes', 'indeterminate');
var chkNodes = componentsTempGrid.treegrid('getCheckedNodes', 'checked');
var rows = inNodes.concat(chkNodes);

uView开发

1.富文本框输入

复制代码
<u-input input-align='right' type="textarea" height="100" v-model="value" />
​
return{textarea:'textarea'}

2.页面下拉刷新

复制代码
onPullDownRefresh(){
}

3.swiper轮播图图片展示不全问题

复制代码
增加属性:
:img-mode="aspectFit"
​
声明变量:aspectFit:‘aspectFit’

4.vue时间不能超过当前时间

复制代码
if(Date.parse(problemObj.problemTime) > new Date()){
    this.$u.toast("故障时间不能超过当前时间!")
    return
}
相关推荐
wefly201735 分钟前
jsontop.cn:一站式 JSON 全能工具集,开发全流程效率神器
前端·javascript·python·django·json·json在线转换
XDHCOM2 小时前
Redis远程连接命令详解,分享高效配置与安全实践技巧
前端·redis·安全
YAY_tyy3 小时前
Vue3 + Three.js 实战:自定义 3D 模型加载与交互全流程
前端·javascript·vue.js·threejs
星河耀银海3 小时前
3D效果:HTML5 WebGL结合AI实现智能3D场景渲染
前端·人工智能·深度学习·3d·html5·webgl
美狐美颜sdk9 小时前
从人脸关键点到动态贴图:面具特效在美颜SDK中的实现原理
前端·图像处理·人工智能·直播美颜sdk·美颜api
我命由我123459 小时前
React Router 6 - 编程式路由导航、useInRouterContext、useNavigationType
前端·javascript·react.js·前端框架·html·ecmascript·js
威联通网络存储9 小时前
告别掉帧与素材损毁:威联通 QuTS hero 如何重塑影视后期协同工作流
前端·网络·人工智能·python
anOnion9 小时前
构建无障碍组件之Tabs Pattern
前端·html·交互设计
一招定胜负10 小时前
课堂教学质量综合评分系统
java·linux·前端
2301_7806698610 小时前
前端logo替换开发
前端·vue.js