mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 16:56:40 +08:00
refactor: replace lodash with lodash-es
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import { CustomRule } from '@/api/types'
|
import { CustomRule } from '@/api/types'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import filter_svg from '@images/svg/filter.svg'
|
import filter_svg from '@images/svg/filter.svg'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import { innerFilterRules } from '@/api/constants'
|
import { innerFilterRules } from '@/api/constants'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useToast } from 'vue-toast-notification'
|
|||||||
import type { DownloaderInfo } from '@/api/types'
|
import type { DownloaderInfo } from '@/api/types'
|
||||||
import qbittorrent_image from '@images/logos/qbittorrent.png'
|
import qbittorrent_image from '@images/logos/qbittorrent.png'
|
||||||
import transmission_image from '@images/logos/transmission.png'
|
import transmission_image from '@images/logos/transmission.png'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 定义输入
|
// 定义输入
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -104,7 +104,7 @@ function saveDownloaderInfo() {
|
|||||||
props.downloaders.forEach(item => {
|
props.downloaders.forEach(item => {
|
||||||
if (item.default && item !== props.downloader) {
|
if (item.default && item !== props.downloader) {
|
||||||
item.default = false
|
item.default = false
|
||||||
$toast.info(`【${item.name}】存在默认下载器,已替换成【${downloaderInfo.value.name}】`)
|
$toast.info(`存在默认下载器【${item.name}】,已替换成【${downloaderInfo.value.name}】`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { innerFilterRules } from '@/api/constants'
|
import { innerFilterRules } from '@/api/constants'
|
||||||
import { CustomRule } from '@/api/types'
|
import { CustomRule } from '@/api/types'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import FilterRuleCard from '@/components/cards/FilterRuleCard.vue'
|
|||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import ImportCodeDialog from '@/components/dialog/ImportCodeDialog.vue'
|
import ImportCodeDialog from '@/components/dialog/ImportCodeDialog.vue'
|
||||||
import filter_group_svg from '@images/svg/filter-group.svg'
|
import filter_group_svg from '@images/svg/filter-group.svg'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import emby_image from '@images/logos/emby.png'
|
|||||||
import jellyfin_image from '@images/logos/jellyfin.png'
|
import jellyfin_image from '@images/logos/jellyfin.png'
|
||||||
import plex_image from '@images/logos/plex.png'
|
import plex_image from '@images/logos/plex.png'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 定义输入
|
// 定义输入
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import synologychat_image from '@images/logos/synologychat.png'
|
|||||||
import slack_image from '@images/logos/slack.webp'
|
import slack_image from '@images/logos/slack.webp'
|
||||||
import chrome_image from '@images/logos/chrome.png'
|
import chrome_image from '@images/logos/chrome.png'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 定义输入
|
// 定义输入
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { debounce } from 'lodash'
|
import { debounce } from 'lodash-es'
|
||||||
import { VForm } from 'vuetify/components/VForm'
|
import { VForm } from 'vuetify/components/VForm'
|
||||||
import { useAuthStore, useUserStore } from '@/stores'
|
import { useAuthStore, useUserStore } from '@/stores'
|
||||||
import { authState, userState } from '@/stores/types'
|
import { authState, userState } from '@/stores/types'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { DiscoverSource } from '@/api/types'
|
import { DiscoverSource } from '@/api/types'
|
||||||
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
||||||
import FormRender from '@/components/render/FormRender.vue'
|
import FormRender from '@/components/render/FormRender.vue'
|
||||||
import { cloneDeep, isNull } from 'lodash'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { debounce } from 'lodash'
|
import { debounce } from 'lodash-es'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { TransferHistory } from '@/api/types'
|
import type { TransferHistory } from '@/api/types'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import _ from 'lodash'
|
import { cloneDeepWith } from 'lodash-es'
|
||||||
import type { Context } from '@/api/types'
|
import type { Context } from '@/api/types'
|
||||||
import TorrentCard from '@/components/cards/TorrentCard.vue'
|
import TorrentCard from '@/components/cards/TorrentCard.vue'
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ function filterData() {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
if (matchData.length > 0) {
|
if (matchData.length > 0) {
|
||||||
const firstData = _.cloneDeepWith(matchData[0]) as SearchTorrent
|
const firstData = cloneDeepWith(matchData[0]) as SearchTorrent
|
||||||
if (matchData.length > 1) firstData.more = matchData.slice(1)
|
if (matchData.length > 1) firstData.more = matchData.slice(1)
|
||||||
|
|
||||||
// 显示前20个,4行左右。
|
// 显示前20个,4行左右。
|
||||||
|
|||||||
Reference in New Issue
Block a user