前端开发、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
}
相关推荐
下雪天的夏风12 分钟前
TS - tsconfig.json 和 tsconfig.node.json 的关系,如何在TS 中使用 JS 不报错
前端·javascript·typescript
青稞儿18 分钟前
面试题高频之token无感刷新(vue3+node.js)
vue.js·node.js
diygwcom24 分钟前
electron-updater实现electron全量版本更新
前端·javascript·electron
Hello-Mr.Wang40 分钟前
vue3中开发引导页的方法
开发语言·前端·javascript
程序员凡尘1 小时前
完美解决 Array 方法 (map/filter/reduce) 不按预期工作 的正确解决方法,亲测有效!!!
前端·javascript·vue.js
编程零零七4 小时前
Python数据分析工具(三):pymssql的用法
开发语言·前端·数据库·python·oracle·数据分析·pymssql
(⊙o⊙)~哦6 小时前
JavaScript substring() 方法
前端
无心使然云中漫步7 小时前
GIS OGC之WMTS地图服务,通过Capabilities XML描述文档,获取matrixIds,origin,计算resolutions
前端·javascript
Bug缔造者7 小时前
Element-ui el-table 全局表格排序
前端·javascript·vue.js
xnian_7 小时前
解决ruoyi-vue-pro-master框架引入报错,启动报错问题
前端·javascript·vue.js