| | |
| | | <script> |
| | | import axiosInstancePy from '../../utils/requestPy' |
| | | // import ShopNameSelect from '../sfc/ShopNameSelect.vue' |
| | | import ShopNameCheckBox from '../../sfc/ShopNameCheckBox.vue'; |
| | | import TimeSelectCrawling from '../../sfc/TimeSelectCrawling.vue'; |
| | | |
| | |
| | | // 模拟登陆按钮加载中状态 |
| | | login_loading:false, |
| | | // 无数据时的图片 |
| | | isNoData:false |
| | | isNoData:true |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | autoLogin(){ |
| | | this.login_loading = true |
| | | axiosInstancePy.get('/autologin').then(response =>{ |
| | | console.log('登陆结果为:',response.data); |
| | | ElMessage.success(response.data) |
| | | this.login_loading = false |
| | | }) |
| | |
| | | this.loading = true; |
| | | // 得到反馈信息 所有数据 |
| | | axiosInstancePy.post('/getData', form).then((response) => { |
| | | console.log(response.data); |
| | | if(response.data == '-1'){ |
| | | this.loading = false; |
| | | // ElMessage.warning('请先点击登陆') |
| | |
| | | this.result = this.result + item + '\n'; |
| | | }); |
| | | |
| | | // response.data.allData.forEach(item=>{ |
| | | // this.allData =this.allData+item+'\n' |
| | | // this.allData =this.allData+'\n' |
| | | // }); |
| | | |
| | | this.allData = response.data.allData; |
| | | this.duplicateData = response.data.duplicate; |
| | | console.log('重复的数据为:', this.duplicateData); |
| | | this.newData = response.data.newData; |
| | | console.log('新数据条数为:',this.newData.length); |
| | | this.loading = false; |
| | | |
| | | this.displayData = this.arrToObject(this.duplicateData); |
| | | console.log('转换后的对象数组为:',this.displayData); |
| | | |
| | | this.result=this.result+'\n重复的数量为:'+this.duplicateData.length |
| | | }); |
| | |
| | | } |
| | | this.openFullScreen() |
| | | axiosInstancePy.post('/store', {'allData':this.allData}).then((response) => { |
| | | console.log(response.data); |
| | | ElMessage.success(response.data) |
| | | this.loadingToMysql.close() |
| | | }) |
| | |
| | | axiosInstancePy |
| | | .post('/store', { 'allData': this.newData }) |
| | | .then((response) => { |
| | | console.log(response.data); |
| | | ElMessage.success(response.data) |
| | | this.loadingToMysql.close() |
| | | }); |
| | |
| | | axiosInstancePy |
| | | .post('/store', { 'allData': this.newData }) |
| | | .then((response) => { |
| | | console.log(response.data); |
| | | ElMessage.success(response.data) |
| | | this.loadingToMysql.close() |
| | | }); |
| | |
| | | </div> |
| | | |
| | | <el-card> |
| | | <!-- <ShopNameSelect @submit-shops="(n)=>selectedShopNames=n"></ShopNameSelect> --> |
| | | |
| | | <ShopNameCheckBox |
| | | @submit-shops="(n) => (form.selectedShopNames = n)" |
| | | ></ShopNameCheckBox> |
| | | <!-- {{ selectedShopNames }} --> |
| | | |
| | | </el-card> |
| | | |
| | | |
| | |
| | | placeholder="爬取结果" |
| | | autosize |
| | | ></el-input> |
| | | <!-- rows="6" --> |
| | | |
| | | </div> |
| | | |
| | | <!-- <div class="progress-percentage"> |
| | | <el-progress :text-inside="true" :percentage="percentage" stroke-width="15" status="warning" striped striped-flow duration="5"></el-progress> |
| | | </div> |
| | | |
| | | |
| | | <div class="countdown-time"> |
| | | <el-countdown |
| | | title="预计还需要爬取的时间" |
| | | format="HH:mm:ss" |
| | | :value="countdownTime" |
| | | /> |
| | | </div> --> |
| | | |
| | | <!-- <div class="result-textarea-data" v-loading="loading"> |
| | | <div>数据</div> |
| | | <el-input v-model="allData" rows="6" type="textarea" class="result-textarea-textarea" placeholder="数据"></el-input> |
| | | <div>获取的数据数为:{{ allData.length }}</div> |
| | | </div> --> |
| | | |
| | | <div class="result-textarea-duplication"> |
| | | <div>重复的数据</div> |
| | | <!-- <div></div> --> |
| | | <el-table :data="displayData" height="250" style="width: 100%"> |
| | | <div>重复的数据:</div> |
| | | <div v-show="!isNoData"> |
| | | <el-table :data="displayData" height="200" style="width: 100%"> |
| | | <el-table-column prop="餐饮店" label="餐饮店" width="180" fixed show-overflow-tooltip="true"/> |
| | | <el-table-column prop="供应商" label="供应商" width="180" show-overflow-tooltip="true"/> |
| | | <el-table-column prop="设备编号" label="设备编号" show-overflow-tooltip="true"/> |
| | |
| | | <el-table-column prop="数据时间" label="数据时间" show-overflow-tooltip="true"/> |
| | | <el-table-column prop="重复次数" label="重复次数" show-overflow-tooltip="true"/> |
| | | </el-table> |
| | | |
| | | <el-empty v-show="isNoData" :image-size="200" /> |
| | | </div> |
| | | <el-empty v-show="isNoData" :image-size="150" /> |
| | | </div> |
| | | |
| | | <!-- <div class="result-textarea"> |
| | | <span >重复数量为:{{ duplicateData.length }}</span> |
| | | </div> --> |
| | | |
| | | |
| | | <div class="store-button" > |
| | | <el-button |
| | |
| | | margin-top: 20px; |
| | | width: 50%; |
| | | } |
| | | // .result-textarea-textarea { |
| | | // // width: 50%; |
| | | // } |
| | | |
| | | .progress-percentage { |
| | | width: 50%; |
| | | margin-top: 20px; |