|
|
@ -33,6 +33,7 @@ |
|
|
|
v-model="queryParams.params.fromTime" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
:picker-options="pickerOptions" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
/> |
|
|
@ -41,6 +42,7 @@ |
|
|
|
v-model="queryParams.params.endTime" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
:picker-options="pickerOptions" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
/> |
|
|
@ -198,24 +200,22 @@ |
|
|
|
:title="dialogTitle + '数据'" |
|
|
|
:visible.sync="captrue" |
|
|
|
width="40%"> |
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|
|
|
<el-form-item label="活动时间" required> |
|
|
|
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|
|
|
<el-form-item label="抓取时间" required> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-form-item> |
|
|
|
<el-date-picker type="date" value-format="yyyy-MM-dd" placeholder="选择日期" v-model="ruleForm.time" style="width: 100%;"></el-date-picker> |
|
|
|
<el-form-item > |
|
|
|
<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions" v-model="ruleForm.time" style="width: 100%;"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="活动性质" prop="type"> |
|
|
|
<el-checkbox-group v-model="ruleForm.type"> |
|
|
|
<el-checkbox label="美食/餐厅线上活动" name="salesAmount"></el-checkbox> |
|
|
|
<el-checkbox label="地推活动" name="purchase"></el-checkbox> |
|
|
|
<el-checkbox label="线下主题活动" name="salesDishes"></el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
<el-form-item label="抓取内容" required> |
|
|
|
<el-checkbox label="抓取实时金额" v-model="ruleForm.data.salesAmount"></el-checkbox> |
|
|
|
<el-checkbox label="抓取采购信息" v-model="ruleForm.data.purchase"></el-checkbox> |
|
|
|
<el-checkbox label="抓取菜品销量信息" v-model="ruleForm.data.salesDishes"></el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button> |
|
|
|
<el-button @click="resetForm('ruleForm')">重置</el-button> |
|
|
|
<el-button type="primary" @click="submitForm()">立即抓取</el-button> |
|
|
|
<el-button @click="resetForm()">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-dialog> |
|
|
@ -248,13 +248,14 @@ export default { |
|
|
|
tableXiaoshou:[], |
|
|
|
student: {}, |
|
|
|
captrueData:{}, |
|
|
|
ruleForm:{ |
|
|
|
time:'', |
|
|
|
type:{ |
|
|
|
salesAmount:'',purchase:'', |
|
|
|
salesDishes:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
ruleForm: { |
|
|
|
time: '', |
|
|
|
data:{ |
|
|
|
salesAmount:'', |
|
|
|
purchase:'', |
|
|
|
salesDishes:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
queryParams: { |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
@ -266,11 +267,11 @@ export default { |
|
|
|
endTime: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
type: [ |
|
|
|
{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' } |
|
|
|
], |
|
|
|
} |
|
|
|
pickerOptions:{ |
|
|
|
disabledDate(time){ |
|
|
|
return time.getTime()> Date.now()- 8.64e7;// 如果没有后面的-8.64e7就是不可以选择今天的 |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -388,17 +389,41 @@ export default { |
|
|
|
this.dialogTitle = "抓取"; |
|
|
|
this.captrue=true |
|
|
|
}, |
|
|
|
submitForm(formName) { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
handCrawl(this.ruleForm).then((res)=>{ |
|
|
|
console.log(this.ruleForm); |
|
|
|
console.log(res); |
|
|
|
}) |
|
|
|
submitForm() { |
|
|
|
if(this.ruleForm.time===''){ |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择时间', |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
}else if(this.ruleForm.data.salesAmount || this.ruleForm.data.purchase || this.ruleForm.data.salesDishes){ |
|
|
|
this.captrue=false |
|
|
|
handCrawl(this.ruleForm).then((res)=>{ |
|
|
|
this.$message({ |
|
|
|
message: '抓取成功', |
|
|
|
type: 'success' |
|
|
|
}); |
|
|
|
this.resetForm() |
|
|
|
this.getPageList(); |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请至少选择一条数据', |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
}, |
|
|
|
resetForm(formName) { |
|
|
|
this.$refs[formName].resetFields(); |
|
|
|
} |
|
|
|
}, |
|
|
|
resetForm() { |
|
|
|
this.ruleForm= { |
|
|
|
time: '', |
|
|
|
data:{ |
|
|
|
salesAmount:'', |
|
|
|
purchase:'', |
|
|
|
salesDishes:'' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|