Commit bceef011 authored by 刘怀志's avatar 刘怀志

banner暂存-6

parent 841345c0
......@@ -231,36 +231,31 @@
width="30%"
title="小程序"
:visible.sync="innerVisible"
append-to-body>
<img id="crawlerImage" v-show="src" :src="src" alt="Crawler Image">
append-to-body
>
<img v-show="src" id="crawlerImage" :src="src" alt="Crawler Image">
<el-checkbox-group v-model="souceList">
<el-checkbox label="慧保天下" />
<el-checkbox label="中国银行保险报" />
<el-checkbox label="今日保条" />
<el-checkbox label="陈果 George" />
</el-checkbox-group>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false">取 消</el-button>
<el-button type="primary" @click="startImage">抓取</el-button>
<el-button type="primary" :loading="imgLoading" @click="startImage">抓取</el-button>
</div>
</el-dialog>
</el-dialog>
<el-row>
<el-col :span="12" style="margin-bottom: 15px">
<el-button @click="innerVisible = true,loadImage2()">小程序</el-button>
<el-button :loading="webLoading" @click="crawlerData">中国保险行业协会 行业要闻</el-button>
</el-col>
</el-row>
<el-divider />
<el-row>
<el-col :span="12" style="margin-bottom: 15px">
<el-button @click="crawlerData">中国保险行业协会 行业要闻</el-button>
<el-button @click="innerVisible = true,loadImage2()">小程序</el-button>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" style="margin-bottom: 15px">
<el-button>慧保天下</el-button>
</el-col>
<el-col :span="12" style="margin-bottom: 15px">
<el-button>中国银行保险报</el-button>
</el-col>
<el-col :span="12" style="margin-bottom: 15px">
<el-button>今日保条</el-button>
</el-col>
<el-col :span="12" style="margin-bottom: 15px">
<el-button>陈果 George</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
......@@ -282,6 +277,10 @@ export default {
// },
data() {
return {
imgLoading: false,
webLoading: false,
intervalId: null,
souceList: [],
innerVisible: false,
src: '',
rules: {
......@@ -422,16 +421,39 @@ export default {
})
},
startImage() {
scanCrawlerPicture('CodeSheep')
this.imgLoading = true
console.log(this.souceList.join(','))
scanCrawlerPicture(this.souceList.join(',')).then(res => {
this.checkId = '1'
this.checkStatus()
}).catch(err => {
this.$message.warning(err.message)
this.imgLoading = false
})
},
checkStatus() {
this.webLoading = false
this.intervalId = setInterval(() => {
crawler({ id: this.checkId }).then(res => {
if (res.status === '1') {
this.$message.success('抓取成功')
this.webLoading = false
this.imgLoading = false
this.loadData()
clearInterval(this.intervalId)
}
})
}, 1000)
},
// 测试定时爬虫
crawlerData() {
this.webLoading = true
crawler().then(res => {
this.$message({
message: '爬取成功',
type: 'success'
})
this.resetQuery()
this.checkId = '1'
this.checkStatus()
}).catch(err => {
this.$message.warning(err.message)
this.webLoading = false
})
},
/** 修改密码确定操作*/
......
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