-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove AppFormSearch.vue * Add `@keydown.enter` * Remove AppFormUser.vue * Update help * Remove AppFormDate.vue * Remove AppFormKeyword.vue * Fix `@keydown.enter` event * Remove AppFormIncludesRetweets.vue * Remove AppFormTwilogDate.vue * Remove AppFormTwilogSearch.vue * Update style * Remove AppFormTwisaveDate.vue * Remove AppFormTwisaveSearch.vue * Update help * Update help
- Loading branch information
Showing
13 changed files
with
177 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,161 @@ | ||
<script lang="ts" setup> | ||
import { | ||
parseISO, | ||
subDays, | ||
subYears | ||
} from 'date-fns' | ||
const form = useFormStore() | ||
const now = new Date() | ||
const setToToday = () => { | ||
form.date = formatISODate(now) | ||
} | ||
const setToYesterday = () => { | ||
form.date = formatISODate(subDays(now, 1)) | ||
} | ||
const setToOneYearAgo = () => { | ||
form.date = formatISODate(subYears(now, 1)) | ||
} | ||
const openTwitter = () => { | ||
const url = createTwitterSearchURL({ | ||
user: form.user, | ||
date: parseISO(form.date), | ||
keyword: form.keyword, | ||
includesRetweets: form.includesRetweets | ||
}) | ||
window.open(url) | ||
} | ||
const handleEnter = (event: KeyboardEvent | Event) => { | ||
if (event instanceof KeyboardEvent && event.keyCode === 13) { | ||
openTwitter() | ||
} | ||
} | ||
const openTwilogDate = () => { | ||
const url = createTwilogDateURL({ | ||
user: form.user, | ||
date: parseISO(form.date) | ||
}) | ||
window.open(url) | ||
} | ||
const openTwilogSearch = () => { | ||
const url = createTwilogKeywordSearchURL({ | ||
user: form.user, | ||
keyword: form.keyword | ||
}) | ||
window.open(url) | ||
} | ||
const openTwisaveDate = () => { | ||
const url = createTwisaveDateURL({ | ||
user: form.user, | ||
date: parseISO(form.date) | ||
}) | ||
window.open(url) | ||
} | ||
const openTwisaveSearch = () => { | ||
const url = createTwisaveKeywordSearchURL({ | ||
user: form.user, | ||
keyword: form.keyword | ||
}) | ||
window.open(url) | ||
} | ||
</script> | ||
|
||
<template> | ||
<el-form label-position="top"> | ||
<AppFormUser /> | ||
<AppFormDate /> | ||
<AppFormKeyword /> | ||
<AppFormIncludesRetweets /> | ||
<AppFormSearch /> | ||
<AppFormTwilogDate /> | ||
<AppFormTwilogSearch /> | ||
<AppFormTwisaveDate /> | ||
<AppFormTwisaveSearch /> | ||
<el-form-item label="ユーザー"> | ||
<el-input | ||
v-model="form.user" | ||
placeholder="munieru_jp" | ||
clearable | ||
autofocus | ||
@keydown.enter="handleEnter" | ||
/> | ||
</el-form-item> | ||
<el-form-item label="日付"> | ||
<el-date-picker | ||
v-model="form.date" | ||
type="date" | ||
value-format="YYYY-MM-DD" | ||
clearable | ||
@keydown.enter="handleEnter" | ||
/> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
size="small" | ||
:circle="false" | ||
@click="setToToday" | ||
> | ||
今日 | ||
</el-button> | ||
<el-button | ||
size="small" | ||
:circle="false" | ||
@click="setToYesterday" | ||
> | ||
昨日 | ||
</el-button> | ||
<el-button | ||
size="small" | ||
:circle="false" | ||
@click="setToOneYearAgo" | ||
> | ||
1年前 | ||
</el-button> | ||
</el-form-item> | ||
<el-form-item label="キーワード"> | ||
<el-input | ||
v-model="form.keyword" | ||
clearable | ||
@keydown.enter="handleEnter" | ||
/> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-checkbox | ||
v-model="form.includesRetweets" | ||
label="リツイートを含む" | ||
/> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
type="primary" | ||
:circle="false" | ||
@click="openTwitter" | ||
> | ||
検索 | ||
</el-button> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
:circle="false" | ||
@click="openTwilogDate" | ||
> | ||
Twilog(日付) | ||
</el-button> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
:circle="false" | ||
@click="openTwilogSearch" | ||
> | ||
Twilog(検索) | ||
</el-button> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
:circle="false" | ||
@click="openTwisaveDate" | ||
> | ||
ツイセーブ(日付) | ||
</el-button> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button | ||
:circle="false" | ||
@click="openTwisaveSearch" | ||
> | ||
ツイセーブ(検索) | ||
</el-button> | ||
</el-form-item> | ||
</el-form> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.