Commit 2bc8d1bb by lixinyi

模板保存逻辑修改

parent 8b977bcd
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
</template> </template>
<script> <script>
import send from "../Service/post"; import send from "../Service/post";
import {
deleteEmptyProperty,
appendTreeChild,
deepClone,
} from "../script/MsgJson/MsgHander";
export default { export default {
props:["mty","obj","loginUser"], props:["mty","obj","loginUser"],
data:function() { data:function() {
......
...@@ -253,6 +253,7 @@ export default { ...@@ -253,6 +253,7 @@ export default {
} }
var dataArray = deepClone(this.treeModel.treeNodeArry); var dataArray = deepClone(this.treeModel.treeNodeArry);
dataArray = appendTreeChild(dataArray); dataArray = appendTreeChild(dataArray);
deleteEmptyProperty(dataArray);
this.templateData = JSON.stringify(dataArray); this.templateData = JSON.stringify(dataArray);
this.$refs.templateInfos.showDialog(); this.$refs.templateInfos.showDialog();
console.log("-----json-----") console.log("-----json-----")
...@@ -613,6 +614,8 @@ export default { ...@@ -613,6 +614,8 @@ export default {
job.value = value; job.value = value;
} else { } else {
console.log("child2"); console.log("child2");
job.children = job._children;
job._children = null;
this.setValue2JsonArry(children2, value, flag); this.setValue2JsonArry(children2, value, flag);
} }
} else { } else {
...@@ -749,25 +752,25 @@ export default { ...@@ -749,25 +752,25 @@ export default {
} }
}, },
checkChoice:function(obj){ checkChoice:function(obj){
for (var key in obj.children) { if(isNotEmpty(obj.children) && obj.type!='Choice'){
if(isNotEmpty(obj.children[key].children) && obj.children[key].type!='Choice'){ for (var key in obj.children){
this.checkChoice(obj.children[key]); this.checkChoice(obj.children[key]);
} }
if(obj.children[key].type=='Choice' && isNotEmpty(obj.children[key].children)){ }
if(obj.type=='Choice'){
var flag = false; var flag = false;
for (var child in obj.children[key].children){ for (var child in obj.children){
if(obj.children[key].children[child].disabled==false){ if(obj.children[child].disabled==false){
console.log("Choice: "+obj.children[key].label+" children: "+obj.children[key].children[child].label); console.log("Choice: "+obj.label+" children: "+obj.children[child].label);
flag = this.isChoiceEmpty(obj.children[key].children[child],false); flag = this.isChoiceEmpty(obj.children[child],false);
console.log("flag="+flag); console.log("flag="+flag);
if(flag == false){ if(flag == false){
this.$set(obj.children[key].children[child],"disabled",true); this.$set(obj.children[child],"disabled",true);
} }
} }
} }
} }
}
}, },
isChoiceEmpty:function(obj,flag){ isChoiceEmpty:function(obj,flag){
if(isNotEmpty(obj.value)){ if(isNotEmpty(obj.value)){
...@@ -775,7 +778,7 @@ export default { ...@@ -775,7 +778,7 @@ export default {
return true; return true;
} }
for (var child in obj.children){ for (var child in obj.children){
flag = this.isChoiceEmpty(obj.children[child],false); flag = this.isChoiceEmpty(obj.children[child],flag);
} }
return flag; return flag;
}, },
......
...@@ -470,6 +470,7 @@ export default[ ...@@ -470,6 +470,7 @@ export default[
label: "Creation Date", label: "Creation Date",
tag: "creDt", tag: "creDt",
type: "DateTime", type: "DateTime",
defaultValue: "disabled",
status: "M", 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> <!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 \ 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