|
|
|
@ -2,9 +2,9 @@
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="left-board">
|
|
|
|
|
<div class="logo-wrapper">
|
|
|
|
|
<div class="logo">
|
|
|
|
|
<!-- <div class="logo">
|
|
|
|
|
<img :src="logo" alt="logo"> Form Generator
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<el-scrollbar class="left-scrollbar">
|
|
|
|
|
<div class="components-list">
|
|
|
|
@ -137,7 +137,7 @@
|
|
|
|
|
<input id="copyNode" type="hidden">
|
|
|
|
|
|
|
|
|
|
<!-- 新增模板 -->
|
|
|
|
|
<el-dialog title="创建新模板" :visible.sync="createTemplate" width="680px" append-to-body :close-on-click-modal="false">
|
|
|
|
|
<el-dialog title="修改模板" :visible.sync="createTemplate" width="680px" append-to-body :close-on-click-modal="false">
|
|
|
|
|
<el-form ref="form" :model="dialogForm" :rules="rules" label-width="120px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
@ -441,7 +441,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
open(){
|
|
|
|
|
this.createTemplate = true;
|
|
|
|
|
this.createTemplate = false;
|
|
|
|
|
},
|
|
|
|
|
getDataList(){
|
|
|
|
|
getAllList({dictType:"project_categories"}).then(res=>{
|
|
|
|
@ -491,6 +491,34 @@ export default {
|
|
|
|
|
submitForm: function() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// 级别,责任单位,模板使用有效期开始时间,模板使用有效期结束时间,模板名称
|
|
|
|
|
const { level, responsibilityUnit, useStart, useEnd, templateName } = this.dialogForm;
|
|
|
|
|
if(this.dialogForm.id) {
|
|
|
|
|
templateInfoChange({...this.dialogForm, templateJson: JSON.stringify(this.formData)}).then(res=>{
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
// this.$router.push({
|
|
|
|
|
// name: 'Template',
|
|
|
|
|
// params: {code:800},
|
|
|
|
|
// })
|
|
|
|
|
this.$emit("successCode",800)
|
|
|
|
|
this.reset()
|
|
|
|
|
this.drawingList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if(level && responsibilityUnit && useStart && useEnd && templateName) {
|
|
|
|
|
templateInfo({level, responsibilityUnit, templateName, useStart, useEnd, projectBigType:this.projectBigType, projectMiddleType:this.projectMiddleType, projectSmallType:this.projectSmallType,templateJson: JSON.stringify(this.formData)}).then(res=>{
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
// this.$router.push({
|
|
|
|
|
// name: 'Template',
|
|
|
|
|
// params: {code:200},
|
|
|
|
|
// })
|
|
|
|
|
this.$emit("successCode",200)
|
|
|
|
|
this.reset()
|
|
|
|
|
this.drawingList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.createTemplate = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -596,36 +624,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
showJson() {
|
|
|
|
|
this.AssembleFormData()
|
|
|
|
|
// 级别,责任单位,模板使用有效期开始时间,模板使用有效期结束时间,模板名称
|
|
|
|
|
const { level, responsibilityUnit, useStart, useEnd, templateName } = this.dialogForm;
|
|
|
|
|
if(this.dialogForm.id) {
|
|
|
|
|
templateInfoChange({...this.dialogForm, templateJson: JSON.stringify(this.formData)}).then(res=>{
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
// this.$router.push({
|
|
|
|
|
// name: 'Template',
|
|
|
|
|
// params: {code:800},
|
|
|
|
|
// })
|
|
|
|
|
this.$emit("successCode",800)
|
|
|
|
|
this.reset()
|
|
|
|
|
this.drawingList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if(level && responsibilityUnit && useStart && useEnd && templateName) {
|
|
|
|
|
templateInfo({level, responsibilityUnit, templateName, useStart, useEnd, projectBigType:this.projectBigType, projectMiddleType:this.projectMiddleType, projectSmallType:this.projectSmallType,templateJson: JSON.stringify(this.formData)}).then(res=>{
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
// this.$router.push({
|
|
|
|
|
// name: 'Template',
|
|
|
|
|
// params: {code:200},
|
|
|
|
|
// })
|
|
|
|
|
this.$emit("successCode",200)
|
|
|
|
|
this.reset()
|
|
|
|
|
this.drawingList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.createTemplate = true;
|
|
|
|
|
}
|
|
|
|
|
this.createTemplate = true;
|
|
|
|
|
},
|
|
|
|
|
download() {
|
|
|
|
|
this.dialogVisible = true
|
|
|
|
|