|  |  | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  | <script> | 
 |  |  | import { listSvytopic, getSvytopic, delSvytopic, addSvytopic, updateSvytopic } from "@/api/smartor/svytopic"; | 
 |  |  |  | 
 |  |  | export default { | 
 |  |  |   components: {}, | 
 |  |  |   props: [], | 
 |  |  |   name: "SvytopicBase", | 
 |  |  |   dicts: ['sys_yes_no'], | 
 |  |  |   data() { | 
 |  |  |     return { | 
 |  |  |       formData: { | 
 |  |  |         field101: undefined, | 
 |  |  |       }, | 
 |  |  |       total: 0, | 
 |  |  |       // 弹出层标题 | 
 |  |  |       title: "", | 
 |  |  |       // 表单参数 | 
 |  |  |       form: {}, | 
 |  |  |       // 表单校验 | 
 |  |  |       rules: { | 
 |  |  |         field101: [{ | 
 |  |  |           required: true, | 
 |  |  |           message: '请选择下拉选择', | 
 |  |  |           trigger: 'change' | 
 |  |  |         }], | 
 |  |  |       }, | 
 |  |  |       field101Options: [{ | 
 |  |  |         "label": "单选项", | 
 |  |  |         "value": 1 | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         "label": "多选项", | 
 |  |  |         "value": 2 | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         "label": "直接填写", | 
 |  |  |         "value": 3 | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         "label": "日期范围", | 
 |  |  |         "value": 4 | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         "label": "数值范围", | 
 |  |  |         "value": 5 | 
 |  |  |         delFlag: [ | 
 |  |  |           { required: true, message: " 删除标记 不能为空", trigger: "change" } | 
 |  |  |         ], | 
 |  |  |         isupload: [ | 
 |  |  |           { required: true, message: " 上传标记 不能为空", trigger: "change" } | 
 |  |  |         ], | 
 |  |  |       } | 
 |  |  |       ], | 
 |  |  |     } | 
 |  |  |     }; | 
 |  |  |   }, | 
 |  |  |   computed: {}, | 
 |  |  |   watch: {}, | 
 |  |  |   created() { }, | 
 |  |  |   mounted() { }, | 
 |  |  |   created() { | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     submitForm1() { | 
 |  |  |       this.$refs['elForm'].validate(valid => { | 
 |  |  |         if (!valid) return | 
 |  |  |         // TODO 提交表单 | 
 |  |  |       }) | 
 |  |  |     // 表单重置 | 
 |  |  |     reset() { | 
 |  |  |       this.form = { | 
 |  |  |         topicid: null, | 
 |  |  |         oldid: null, | 
 |  |  |         svyid: null, | 
 |  |  |         topictype: null, | 
 |  |  |         topiccode: null, | 
 |  |  |         topic: null, | 
 |  |  |         sort: null, | 
 |  |  |         ismandatory: null, | 
 |  |  |         ishide: null, | 
 |  |  |         delFlag: null, | 
 |  |  |         orgid: null, | 
 |  |  |         createBy: null, | 
 |  |  |         createTime: null, | 
 |  |  |         updateBy: null, | 
 |  |  |         updateTime: null, | 
 |  |  |         isupload: null, | 
 |  |  |         uploadTime: null | 
 |  |  |       }; | 
 |  |  |       this.resetForm("form"); | 
 |  |  |     }, | 
 |  |  |     resetForm1() { | 
 |  |  |       this.$refs['elForm'].resetFields() | 
 |  |  |      /** 修改按钮操作 */ | 
 |  |  |     Retrieve(topicid) { | 
 |  |  |       this.reset(); | 
 |  |  |       getSvytopic(topicid).then(response => { | 
 |  |  |         this.form = response.data; | 
 |  |  |         this.title = "修改问卷题目"; | 
 |  |  |       }); | 
 |  |  |     }, | 
 |  |  |     /** 提交按钮 */ | 
 |  |  |     submitForm() { | 
 |  |  |       this.$refs["form"].validate(valid => { | 
 |  |  |         if (valid) { | 
 |  |  |           if (this.form.topicid != null) { | 
 |  |  |             updateSvytopic(this.form).then(response => { | 
 |  |  |               this.$modal.msgSuccess("修改成功"); | 
 |  |  |               this.open = false; | 
 |  |  |               this.getList(); | 
 |  |  |             }); | 
 |  |  |           } else { | 
 |  |  |             addSvytopic(this.form).then(response => { | 
 |  |  |               this.$modal.msgSuccess("新增成功"); | 
 |  |  |               this.open = false; | 
 |  |  |               this.getList(); | 
 |  |  |             }); | 
 |  |  |           } | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     }, | 
 |  |  |   } | 
 |  |  | } | 
 |  |  |  | 
 |  |  | }; | 
 |  |  | </script> | 
 |  |  | <style></style> | 
 |  |  |    |