+
+ 删除
+
+
+
+
+
+
+
+
+
@@ -34,7 +121,6 @@
{
required: true,
message: '抓取文件名不能为空',
- trigger: 'blur',
},
]">
@@ -45,7 +131,6 @@
{
required: true,
message: '开始抓取字段不能为空',
- trigger: 'blur',
},
]">
@@ -56,7 +141,6 @@
{
required: true,
message: '结束抓取字段不能为空',
- trigger: 'blur',
},
]">
@@ -80,25 +164,30 @@ import {
} from "@/api/officialSeal/officialSeal.js";
export default {
props: ["rulesVisable", "rulesData", "queryParams"],
+ dicts: ["case_built_type"],
data() {
return {
formData: {
forms: [{
- fileName: "",
- startContent: '',
- endContent: '',
- column: "",
- columnName: "",
- key: Date.now()
+ // fileName: "",
+ // startContent: '',
+ // endContent: '',
+ // column: "",
+ // columnName: "",
}]
},
+ formData_custom: {
+ forms: []
+ },
+ // selectList: []
};
},
watch: {
rulesData(val) {
if (val) {
- console.log(val, "llllllllllllllll");
- this.getFatchRuleByTemplateidFn({ id: val.id })
+ this.formData.forms = [];
+ this.formData_custom.forms = [];
+ // this.getFatchRuleByTemplateidFn({ id: val.id })
}
}
},
@@ -115,32 +204,66 @@ export default {
startContent: '',
endContent: '',
column: "",
- columnName: ""
+ columnName: "",
+ isDefault: 0
});
},
+ deleteForm(item) {
+ var index = this.formData.forms.indexOf(item)
+ if (index !== -1) {
+ this.formData.forms.splice(index, 1)
+ }
+ },
+ deleteFormCustom(item) {
+ var index = this.formData_custom.forms.indexOf(item)
+ if (index !== -1) {
+ this.formData_custom.forms.splice(index, 1)
+ }
+ },
+ addFormCustom() {
+ this.formData_custom.forms.push({
+ fileName: "",
+ startContent: '',
+ endContent: '',
+ column: "",
+ columnName: "",
+ isDefault: 1
+ });
+ },
+ columnNameChange(item){
+ let result = this.dict.type.case_built_type.find((data=>{
+ return data.label == item.columnName
+ }))
+ item.column = result.value;
+ },
submitRules() {
this.$refs['form'].validate((valid) => {
if (valid) {
- this.saveFatchRulesFn({
- id:this.rulesData.id,
- fatchRules:this.formData.forms
- })
+ this.$refs['form_custom'].validate((valid_custom) => {
+ if (valid_custom) {
+ let paramsList = this.formData.forms.concat(this.formData_custom.forms)
+ this.saveFatchRulesFn({
+ id: this.rulesData.id,
+ fatchRules: paramsList
+ })
+ }
+ })
}
});
},
// 根据id获取抓取规则
- getFatchRuleByTemplateidFn(data) {
- getFatchRuleByTemplateid(data).then(res => {
- this.formData.forms = res.data;
- })
- },
+ // getFatchRuleByTemplateidFn(data) {
+ // getFatchRuleByTemplateid(data).then(res => {
+ // // this.formData.forms = res.data;
+ // this.selectList = res.data
+ // })
+ // },
// 提交抓取规则
saveFatchRulesFn(data) {
saveFatchRules(data).then(res => {
this.$message.success('提交成功');
this.$emit("cancelRules");
- this
- .$emit('getList', that.queryParams);
+ this.$emit('getList', that.queryParams);
})
}
},
@@ -152,7 +275,7 @@ export default {
border: 1px solid #c2bcbc;
padding: 20px;
margin-bottom: 15px;
- max-height: 700px;
+ max-height: 300px;
overflow-y: scroll;
}
\ No newline at end of file