Commit 2bc8d1bb by lixinyi

模板保存逻辑修改

parent 8b977bcd
......@@ -18,6 +18,11 @@
</template>
<script>
import send from "../Service/post";
import {
deleteEmptyProperty,
appendTreeChild,
deepClone,
} from "../script/MsgJson/MsgHander";
export default {
props:["mty","obj","loginUser"],
data:function() {
......
......@@ -253,6 +253,7 @@ export default {
}
var dataArray = deepClone(this.treeModel.treeNodeArry);
dataArray = appendTreeChild(dataArray);
deleteEmptyProperty(dataArray);
this.templateData = JSON.stringify(dataArray);
this.$refs.templateInfos.showDialog();
console.log("-----json-----")
......@@ -613,6 +614,8 @@ export default {
job.value = value;
} else {
console.log("child2");
job.children = job._children;
job._children = null;
this.setValue2JsonArry(children2, value, flag);
}
} else {
......@@ -749,25 +752,25 @@ export default {
}
},
checkChoice:function(obj){
for (var key in obj.children) {
if(isNotEmpty(obj.children[key].children) && obj.children[key].type!='Choice'){
if(isNotEmpty(obj.children) && obj.type!='Choice'){
for (var key in obj.children){
this.checkChoice(obj.children[key]);
}
if(obj.children[key].type=='Choice' && isNotEmpty(obj.children[key].children)){
}
if(obj.type=='Choice'){
var flag = false;
for (var child in obj.children[key].children){
if(obj.children[key].children[child].disabled==false){
console.log("Choice: "+obj.children[key].label+" children: "+obj.children[key].children[child].label);
flag = this.isChoiceEmpty(obj.children[key].children[child],false);
for (var child in obj.children){
if(obj.children[child].disabled==false){
console.log("Choice: "+obj.label+" children: "+obj.children[child].label);
flag = this.isChoiceEmpty(obj.children[child],false);
console.log("flag="+flag);
if(flag == false){
this.$set(obj.children[key].children[child],"disabled",true);
this.$set(obj.children[child],"disabled",true);
}
}
}
}
}
},
isChoiceEmpty:function(obj,flag){
if(isNotEmpty(obj.value)){
......@@ -775,7 +778,7 @@ export default {
return true;
}
for (var child in obj.children){
flag = this.isChoiceEmpty(obj.children[child],false);
flag = this.isChoiceEmpty(obj.children[child],flag);
}
return flag;
},
......
......@@ -470,6 +470,7 @@ export default[
label: "Creation Date",
tag: "creDt",
type: "DateTime",
defaultValue: "disabled",
status: "M",
},
{
......
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.dbe64cdc.js"></script><script defer="defer" src="js/app.cf67a6c9.js"></script><script defer="defer" src="js/main.59945214.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.b05b70f2.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.23ee7bd5.js"></script><script defer="defer" src="js/app.feb464e9.js"></script><script defer="defer" src="js/main.59945214.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.acd80123.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment