ygp-gdzwfw-gov-cn/assets/JyggDateFilter-b9da602b.js
秦秋旭 5acb847bc1 优化爬虫:增量爬取、API参数优化、Excel兼容
主要变更:
1. 重命名 ygp_crawler.py -> main.py
2. API参数优化:
   - tradingProcess 固定传 "513,2C52,3C52" 精准筛选中标结果
   - pageSize 固定为 50 提高抓取效率
   - 通过 publishStartTime/publishEndTime 传入时间范围
3. 默认查询最近3个月(原为当天)
4. 增量爬取改为默认开启(移除 -i 参数)
5. CSV文件添加 UTF-8 BOM,Excel可直接打开
6. 更新 README.md 文档
7. 添加前端 JS 代码参考文件到 assets/ 目录

使用方法:
- 增量更新:python main.py
- 全量查询:rm results.csv && python main.py

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 00:37:07 +08:00

2 lines
2.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{l as x,r as _,o as y,b as f,e as t,F as C,D as M,E as g,t as B,p,d as i,M as I,O as S,n as V,j as T,V as l,Q as h,Y as $,cA as A,Z as F,q as N,v as E}from"./index-f1c6abff.js";const j=o=>(N("data-v-a44551b8"),o=o(),E(),o),J={class:"list mt-1"},U=["onClick"],q={class:"rang-date"},z={class:"date"},L={class:"flex items-center mt-5"},O=j(()=>t("p",{class:"mb-0 opacity-50 text-black"},"请注意时间跨度最多支持1年",-1)),Q={key:0,class:"mb-0 opacity-70"},R={__name:"JyggDateFilter",props:{modelValue:{type:Array,default:()=>[]},defaultType:{type:String,default:"month"},name:{type:String,default:"最近1个月"},showTips:{type:Boolean,default:!0}},emits:["update:modelValue","update:name"],setup(o,{expose:w,emit:D}){const b=o,n=_(""),d=_(""),r=_(!1),k=[{label:"最近1年",type:"all"},{label:"最近7天",type:"week",days:-7},{label:"最近15天",type:"two_week",days:-15},{label:"最近1个月",type:"month",days:-31},{label:"最近3个月",type:"three_month",days:-90}],v=_(b.defaultType);function m(u){const{type:e}=u;v.value=e;let c,s;switch(e){case"all":c="",s="";break;case"custom":if(!n.value||!d.value)return;if(c=l(n.value).format("YYYYMMDD000000"),s=l(d.value).format("YYYYMMDD235959"),l(d.value).isBefore(l(n.value),"day")){h.error({msg:"结束日期不能小于开始日期"});return}if(l(d.value).diff(l(n.value),"year",!0)>1){h.error({msg:"最多只能选择跨度为1年"});return}break;default:c=l().add(u.days,"day").format("YYYYMMDD000000"),s=l().format("YYYYMMDD235959");break}r.value=!1,D("update:name",u.label),D("update:modelValue",[c,s])}return m(k.find(u=>u.type===b.defaultType)),w({handleItemClick:m}),(u,e)=>{const c=$,s=A,Y=F;return y(),f("div",null,[t("ul",J,[(y(),f(C,null,M(k,a=>t("li",{onClick:Z=>m(a),class:g(["item",{active:v.value===a.type}]),key:a.type},B(a.label),11,U)),64)),t("li",{class:g(["item",{active:v.value==="custom"}])},[t("span",{onClick:e[0]||(e[0]=a=>r.value=!r.value)},[p("自定义 "),i(c,{class:"ml-1",icon:"down"})]),I(t("div",q,[t("div",z,[t("div",null,[p(" 开始日期 "),i(s,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),class:"ml-1"},null,8,["modelValue"])]),t("div",null,[p(" 结束日期 "),i(s,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=a=>d.value=a),class:"ml-1"},null,8,["modelValue"])])]),t("div",L,[O,i(Y,{class:"ml-auto",type:"primary",color:"#0B68DA",onClick:e[3]||(e[3]=a=>m({type:"custom",label:"自定义"}))},{default:V(()=>[p("确认")]),_:1}),i(Y,{color:"#0B68DA",plain:"",onClick:e[4]||(e[4]=a=>r.value=!1),class:"ml-5"},{default:V(()=>[p("取消")]),_:1})])],512),[[S,r.value]])],2)]),o.showTips?(y(),f("p",Q,"温馨提醒平台默认展示或搜索最近1年交易公开数据选择【自定义】时间可查询更多公告信息。")):T("",!0)])}}},H=x(R,[["__scopeId","data-v-a44551b8"]]);export{H as _};