Skip to content

Commit

Permalink
+ 文件内容同步替换添加到生命周期
Browse files Browse the repository at this point in the history
  • Loading branch information
nullice committed May 8, 2017
1 parent 8e08ed2 commit afef771
Show file tree
Hide file tree
Showing 9 changed files with 274 additions and 220 deletions.
349 changes: 166 additions & 183 deletions DVE/.idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions DVE/Caryon/appCaryon.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,22 +461,30 @@ AppCaryon.prototype.DNASyncReplace = async function (filePath)
}


AppCaryon.prototype.DNASyncReplace_bySetting= function ()
AppCaryon.prototype.DNASyncReplace_bySetting= async function ()
{
console.group("DNASyncReplace")
console.time("DNASyncReplace 耗时:")
if( dataCaryon.doc.syncReplace!=undefined)
{
for (var i = 0; i < dataCaryon.doc.syncReplace.fileList; i++)

var fileList = dataCaryon.doc.syncReplace.fileList.split("\n")

for (var i = 0; i < fileList.length; i++)
{
var filePath = dataCaryon.doc.syncReplace.fileList[i]
var filePath = fileList[i]
try {
this.DNASyncReplace(filePath)
console.log("filePath",filePath)
await this.DNASyncReplace(filePath)
}catch (e)
{
console.error("AppCaryon.DNASyncReplace_bySetting filePath:",filePath,e)
}

}
}
console.timeEnd("DNASyncReplace 耗时:")
console.groupEnd("DNASyncReplace")
}


Expand Down
16 changes: 11 additions & 5 deletions DVE/Caryon/renderCaryon.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,19 +817,25 @@ RenderCaryon.prototype.renderDocument = async function (varUpdateMode, varUpdate
console.log("3、ExtendScript 端渲染")
console.log("DNAExpress:", mRNA_DataLayers)

await enzymes.DNAExpress(mRNA_DataLayers)
this.status.rendering = false;

try
{
await enzymes.DNAExpress(mRNA_DataLayers)

console.timeEnd("渲染文档耗时")
logger.groupEnd("----------------START【renderDocument】----------------")
} catch (e)
{
console.error(" await enzymes.DNAExpress", e)
}


appCaryon.DNASyncReplace_bySetting()
this.status.rendering = false;


console.timeEnd("渲染文档耗时")
logger.groupEnd("----------------START【renderDocument】----------------")


appCaryon.DNASyncReplace_bySetting()


}
Expand Down
90 changes: 73 additions & 17 deletions DVE/bin/JS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9984,9 +9984,9 @@ var asyncTask = function () {

var UIDNA = {
name: "UI-DNA",
version: "0.0.11",
verIndex: 11,
varData: "2017/05/07",
version: "0.0.12",
verIndex: 12,
varData: "2017/05/08",
codename: ["Euglena"][0],
author: "nullice",
website: "http:https://design-enzyme.com/UI-DNA",
Expand Down Expand Up @@ -10724,18 +10724,62 @@ AppCaryon.prototype.DNASyncReplace = function () {
};
}();

AppCaryon.prototype.DNASyncReplace_bySetting = function () {
if (dataCaryon.doc.syncReplace != undefined) {
for (var i = 0; i < dataCaryon.doc.syncReplace.fileList; i++) {
var filePath = dataCaryon.doc.syncReplace.fileList[i];
try {
this.DNASyncReplace(filePath);
} catch (e) {
console.error("AppCaryon.DNASyncReplace_bySetting filePath:", filePath, e);
AppCaryon.prototype.DNASyncReplace_bySetting = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_asyncToGenerator___default()(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function _callee5() {
var fileList, i, filePath;
return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
console.group("DNASyncReplace");
console.time("DNASyncReplace 耗时:");

if (!(dataCaryon.doc.syncReplace != undefined)) {
_context5.next = 19;
break;
}

fileList = dataCaryon.doc.syncReplace.fileList.split("\n");
i = 0;

case 5:
if (!(i < fileList.length)) {
_context5.next = 19;
break;
}

filePath = fileList[i];
_context5.prev = 7;

console.log("filePath", filePath);
_context5.next = 11;
return this.DNASyncReplace(filePath);

case 11:
_context5.next = 16;
break;

case 13:
_context5.prev = 13;
_context5.t0 = _context5["catch"](7);

console.error("AppCaryon.DNASyncReplace_bySetting filePath:", filePath, _context5.t0);

case 16:
i++;
_context5.next = 5;
break;

case 19:
console.timeEnd("DNASyncReplace 耗时:");
console.groupEnd("DNASyncReplace");

case 21:
case "end":
return _context5.stop();
}
}
}
};
}, _callee5, this, [[7, 13]]);
}));

/* harmony default export */ __webpack_exports__["a"] = (AppCaryon);

Expand Down Expand Up @@ -15058,23 +15102,35 @@ RenderCaryon.prototype.renderDocument = function () {
console.log("3、ExtendScript 端渲染");
console.log("DNAExpress:", mRNA_DataLayers);

_context8.next = 72;
_context8.prev = 70;
_context8.next = 73;
return enzymes.DNAExpress(mRNA_DataLayers);

case 72:
case 73:
_context8.next = 78;
break;

case 75:
_context8.prev = 75;
_context8.t4 = _context8["catch"](70);

console.error(" await enzymes.DNAExpress", _context8.t4);

case 78:

this.status.rendering = false;

console.timeEnd("渲染文档耗时");
logger.groupEnd("----------------START【renderDocument】----------------");

appCaryon.DNASyncReplace_bySetting();

case 76:
case 82:
case "end":
return _context8.stop();
}
}
}, _callee8, this);
}, _callee8, this, [[70, 75]]);
}));

return function (_x15, _x16) {
Expand Down
2 changes: 1 addition & 1 deletion DVE/bin/JS/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

//基础版本
window.UIDNA_BASE_VERINNDEX = 11;
window.UIDNA_BASE_VERINNDEX = 12;


(function ()
Expand Down
1 change: 0 additions & 1 deletion DVE/components/ExpressionPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@
dataCaryon.doc.syncReplace = {fileList: "", mode: "all"}
}
var data = [
{name: "用变量替换下列文件中的文本", type: "note"},
{name: "", type: "textarea", cows: 2, value: dataCaryon.doc.syncReplace.fileList},
Expand Down
6 changes: 3 additions & 3 deletions DVE/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ import App from "./components/area.vue";
//重要信息
var UIDNA = {
name: "UI-DNA",
version: "0.0.11",
verIndex: 11,
varData: "2017/05/07",
version: "0.0.12",
verIndex: 12,
varData: "2017/05/08",
codename: ["Euglena"][0],
author: "nullice",
website: "http:https://design-enzyme.com/UI-DNA",
Expand Down
1 change: 0 additions & 1 deletion DVE/test/SyncReplace/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<link rel="stylesheet" href="style.css">
</head>
<body>

<h1>标题</h1>
<div class="box"></div>

Expand Down
13 changes: 8 additions & 5 deletions DVE/test/SyncReplace/style.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@




body{
text-align: center;
background: qwer;/*UI-DNA: {{bk}}*/
color: #5EAEFC;
background: #2c2f59;/*UI-DNA: {{bk}}*/
color: #d1d1d1;/*UI-DNA: {{font_color}}*/
}

.box{
display: inline-block;
width: wwpx;/*UI-DNA: {{ww}}px*/
height: hhpx;/*UI-DNA: {{hh}}px*/
box_bk/*UI-DNA= {{box_bk}}*/
width: 102px;/*UI-DNA: {{ww}}px*/
height: 167px;/*UI-DNA: {{hh}}px*/
background:#fffc01;/*UI-DNA= background:{{box_bk}};*/
}

0 comments on commit afef771

Please sign in to comment.