您好,看了您的Demo,发现在代码中有一些问题,在执行恢复动作的record方法中,箭头函数中引用了this,这里会报异常,但由于框架的拦截,不会抛出来。我改动了一下,目前基本上没发现有问题的地方(搜索框回显Demo里没实现,不过也很容易实现)
关键代码我截下来:
- } else {
- var that = this;
- this.$http.post('sysUsers/querydatacondition', {
- userid: sessionStorage.getItem("userid"),
- model: 'Data Warehouse_DW MDM Console_Target_Target Table',
- drop_down_box: '', //下拉框
- }).then(res => {
- if(res.data.length != 0 && res.data[0]['m' + index + '_condition']) {
- that.filterField = JSON.parse(res.data[0]['m' + index + '_condition']).Serch; //搜索框回显
- that.note = JSON.parse(res.data[0]['m' + index + '_condition']).note;
- setTimeout(() => {
- let groupings = JSON.parse(res.data[0]['m' + index + '_condition']).grouping; //分组回显
- that.view.groupDescriptions.clear();
- that.view.sortDescriptions.clear();
- groupings.forEach(item => {
- that.view.groupDescriptions.push(new wijmo.PropertyGroupDescription(item))
- })
- let sort = JSON.parse(res.data[0]['m' + index + '_condition']).Sort; //排序回显
- if(sort != '') {
- that.view.sortDescriptions.push(new wijmo.SortDescription(sort.name, sort.Y ? sort.Y : false));
- }
- that.filterData1.filterDefinition = JSON.parse(res.data[0]['m' + index + '_condition']).filterDown;
- }, 600)
- } else that.$message('No related state has been stored');
- })
- }
- },
复制代码
|