Documentation ¶
Overview ¶
Package internal Time : 2022/9/5 20:51 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2022/9/7 22:01 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2022/9/11 16:24 Author : xushiyin contact : yuqingxushiyin@gmail.com
Index ¶
- Variables
- func CheckDateFormat(date string) (*time.Time, error)
- func GetDateList(start string, r int) ([]string, error)
- func GetMonthList(dates []string) []string
- func GetNowMonthNumber() string
- func SysType() string
- type OaWeb
- func (o *OaWeb) ClickBtnX(selector string) error
- func (o *OaWeb) ClickWorkingReportBtn() error
- func (o *OaWeb) ElementAttribute(selector, name string) (value *string, err error)
- func (o *OaWeb) FindDefaultBrowserPath() error
- func (o *OaWeb) GetAttrUrl(selector, name, host string) (*url.URL, error)
- func (o *OaWeb) GetCaptchaStr(u *url.URL) (string, error)
- func (o *OaWeb) GoLoginPage(ctx context.Context) error
- func (o *OaWeb) HasX(selector string) (*rod.Element, error)
- func (o *OaWeb) InputTextX(selector, input string) error
- func (o *OaWeb) LogErr(err error, message string, args ...interface{}) error
- func (o *OaWeb) LoginOa(ctx context.Context) error
- func (o *OaWeb) RetryLoginBtn(retryCnt int) error
- func (o *OaWeb) SelectCopyTo(rType ReportType, copyTo []string) error
- func (o *OaWeb) Start() error
- func (o *OaWeb) Stop() error
- func (o *OaWeb) StuffLoginInfo(ctx context.Context) error
- func (o *OaWeb) StuffReport(rType ReportType, report string, copyTo []string, autoSubmit bool) error
- type ReportType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CopyToClickXPath = map[ReportType]string{ Daily: `//*[@id="z-day-form"]//div[@_search_]`, Weekly: `//*[@id="z-week-form"]//div[@_search_]`, } ReportTypeBtnXPath = map[ReportType]string{ Daily: `//a[@href="javascript:void(0);" and string()="日报"]`, Weekly: `//a[@href="javascript:void(0);" and string()="周报"]`, } ReportTextareaXPath = map[ReportType]string{ Daily: `//label[contains(text(),'今日完成工作')]/following-sibling::textarea`, Weekly: `//label[contains(text(),'本周完成工作')]/following-sibling::textarea`, } ReportSubmitBtnXPath = map[ReportType]string{ Daily: `//*[@id="z-day-form"]/a[string()="提 交"]`, Weekly: `//*[@id="z-week-form"]/a[string()="提 交"]`, } )
Functions ¶
func GetMonthList ¶
func GetNowMonthNumber ¶
func GetNowMonthNumber() string
Types ¶
type OaWeb ¶ added in v0.2.0
type OaWeb struct { IsHeadless bool IsRemote bool BrowserPath string Logger *log.Entry Browser *rod.Browser Launcher *launcher.Launcher Page *rod.Page }
func NewOaWebLogin ¶ added in v0.2.0
func (*OaWeb) ClickWorkingReportBtn ¶ added in v0.2.0
func (*OaWeb) ElementAttribute ¶ added in v0.2.0
func (*OaWeb) FindDefaultBrowserPath ¶ added in v0.2.0
func (*OaWeb) GetAttrUrl ¶ added in v0.2.0
func (*OaWeb) GetCaptchaStr ¶ added in v0.2.0
func (*OaWeb) InputTextX ¶ added in v0.2.0
func (*OaWeb) RetryLoginBtn ¶ added in v0.2.0
func (*OaWeb) SelectCopyTo ¶ added in v0.2.0
func (o *OaWeb) SelectCopyTo(rType ReportType, copyTo []string) error
func (*OaWeb) StuffLoginInfo ¶ added in v0.2.0
func (*OaWeb) StuffReport ¶ added in v0.2.0
Directories ¶
Path | Synopsis |
---|---|
Package commands Time : 2022/9/25 23:05 Author : xushiyin contact : yuqingxushiyin@gmail.com
|
Package commands Time : 2022/9/25 23:05 Author : xushiyin contact : yuqingxushiyin@gmail.com |
Package excels Package internal Time : 2022/9/3 15:26 Author : xushiyin contact : yuqingxushiyin@gmail.com
|
Package excels Package internal Time : 2022/9/3 15:26 Author : xushiyin contact : yuqingxushiyin@gmail.com |
Click to show internal directories.
Click to hide internal directories.