看起来挺酷的。
看了下 mac 版本,细节有些可以再优化,可能工程遗留的问题了。
很多代码感觉有点怪,太依赖状态了,估计接手不是很好维护。
路由有 340 多行。。。。
<script type="text/javascript" src="assest/nw.js"></script>
<script type="text/javascript" src="assest/plugins/lodash.min.js"></script>
<script type="text/javascript" src="assest/plugins/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="assest/plugins/ueditor/ue.config.js"></script>
<script type="text/javascript" src="assest/plugins/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="assest/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="assest/plugins/ueditor/plus/section.js?v=2"></script>
<script type="text/javascript" src="assest/plugins/ueditor/plus/editor-extend.js"></script>
<script type="text/javascript" src="assest/plugins/ueditor/plus/btns-extend.js"></script>
const response = yield AccountModel.getAccountList();
const list = [];
const detail = {};
const detailList = [];
const platformCount = {}; // 已有账号的平台列表
for (let i = 0; i < response.rows.length; i++) {
const row = response.rows[i];
const doc = row.doc;
doc.data._id = doc._id;
doc.data._rev = doc._rev;
detail[
row.id] = doc;
detailList.push(doc);
if (platformCount[doc.type]) {
platformCount[doc.type]++;
} else {
platformCount[doc.type] = 1;
}
}
// a-b < 0, a 在前
detailList.sort(function (a, b) {
return -((a.data.order || 0) - (b.data.order || 0));
});