Skip to content

model对象转换 #13

Description

@wlchair

位置: store/modules/rows/mutation.js -> ADD_ROW里面

后台返回的数据:

{
	"aliasY": "6",
	"height": 20,
	"hidden": false,

	// 这个index和sort是什么关系?

	"index": 5,

	//oprProp 拼写错误

	"operProp": {
		"border": {},
		"content": {

			// 这个alignLine是什么?对齐不是alignRow和alignClo吗?

			"alignLine": "bottom"
		},
		"customProp": {
			"isValid": true
		},
		"formate": {
			"isValid": true
		}

		// isValid是表示什么?怎么还出现了两个地方?
	},
	"originHeight": 0,
	"top": 105,
	"sort": 5,
	"displayName": "6",
	
	// 这个跟aliasY重复了吧?

	"alias": "6"

}

这个数据的返回顺序很容易乱,没有规律

这是模板中的数据结构

{
	sort: 0,
	alias: '',
	top: 0,
	height: cfg.rowHeight,
	displayName: '',

	// 这个activeState和是否隐藏列效果,都是属于效果作用,
	// 是不是应该归并到一个属性里面 ?

	后台也不应该返回这个属性!!

	activeState: false,

	// 列隐藏只有一种效果,也就是前面邻居处理隐藏效果
	// 怎么来的两个属性?

	/**
	 * 上方为隐藏列(用于效果显示)
	 * @type {Boolean}
	 */
	topAjacentHide: false,
	/**
	 * 下方为隐藏列(用于效果显示)
	 * @type {Boolean}
	 */
	bottomAjacentHide: false,
	hidden: false,
	/**
	 * 正行操作属性
	 * @type {Object}
	 */

	//跟后台返回的数据结构不一致,这里属性没用上

	oprProp: {}
};

转换之后的数据结构
这个数据结构,只是在原来的数据结构上进行了补充,
并没有进行对应的业务处理,判断哪些属性需要改变!!

{
	"sort": 5,
	"alias": "6",
	"top": 105,
	"height": 20,
	"displayName": "6",
	"activeState": false,
	"topAjacentHide": false,
	"bottomAjacentHide": false,
	"hidden": false,
	"oprProp": {},
	"aliasY": "6",
	"index": 5,
	"operProp": {
		"border": {},
		"content": {
			"alignLine": "bottom"
		},
		"customProp": {
			"isValid": true
		},
		"formate": {
			"isValid": true
		}
	},
	"originHeight": 0
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions