Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{u as n,A as r}from"./index-f4927a88.js";import"./vendor-bf77f5c0.js";const i=n();i.setMiniInterface(window.innerWidth<750);window.onresize=()=>{i.setMiniInterface(window.innerWidth<750)};r.getReadConfig().then(a=>{var e=a.data.data;if(e){const t=n();let o=JSON.parse(e),s=t.config;o=Object.assign(s,o),t.setConfig(o)}});
|
||||
import{u as n,A as r}from"./index-76057bdd.js";import"./vendor-93648100.js";const i=n();i.setMiniInterface(window.innerWidth<750);window.onresize=()=>{i.setMiniInterface(window.innerWidth<750)};r.getReadConfig().then(a=>{var e=a.data.data;if(e){const t=n();let o=JSON.parse(e),s=t.config;o=Object.assign(s,o),t.setConfig(o)}});
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{u}from"./index-f4927a88.js";const f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function D(t,n,e,a){let s=t<12?"AM":"PM";return a&&(s=s.split("").reduce((l,i)=>l+=`${i}.`,"")),e?s.toLowerCase():s}function L(t,n,e={}){var a;const s=t.getFullYear(),l=t.getMonth(),i=t.getDate(),o=t.getHours(),r=t.getMinutes(),g=t.getSeconds(),m=t.getMilliseconds(),d=t.getDay(),c=(a=e.customMeridiem)!=null?a:D,M={YY:()=>String(s).slice(-2),YYYY:()=>s,M:()=>l+1,MM:()=>`${l+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(e.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(e.locales,{month:"long"}),D:()=>String(i),DD:()=>`${i}`.padStart(2,"0"),H:()=>String(o),HH:()=>`${o}`.padStart(2,"0"),h:()=>`${o%12||12}`.padStart(1,"0"),hh:()=>`${o%12||12}`.padStart(2,"0"),m:()=>String(r),mm:()=>`${r}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${m}`.padStart(3,"0"),d:()=>d,dd:()=>t.toLocaleDateString(e.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(e.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(e.locales,{weekday:"long"}),A:()=>c(o,r),AA:()=>c(o,r,!1,!0),a:()=>c(o,r,!0),aa:()=>c(o,r,!0,!0)};return n.replace(f,(S,h)=>h||M[S]())}const w=t=>/,\s*\{/.test(t)||!(t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:"));function Y(t){return location.origin+"/image?path="+encodeURIComponent(t)+"&url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))+"&width="+u().config.readWidth}const $=t=>{let n=new Date().getTime(),e=Math.floor((n-t)/1e3),a="";return e<=30?a="刚刚":e<60?a=e+"秒前":e<3600?a=Math.floor(e/60)+"分钟前":e<86400?a=Math.floor(e/3600)+"小时前":e<2592e3?a=Math.floor(e/86400)+"天前":a=L(new Date(t),"YYYY-MM-DD"),a},v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';export{$ as d,Y as g,w as i,v as l};
|
||||
import{u}from"./index-76057bdd.js";const f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function D(t,n,e,a){let s=t<12?"AM":"PM";return a&&(s=s.split("").reduce((l,i)=>l+=`${i}.`,"")),e?s.toLowerCase():s}function L(t,n,e={}){var a;const s=t.getFullYear(),l=t.getMonth(),i=t.getDate(),o=t.getHours(),r=t.getMinutes(),g=t.getSeconds(),m=t.getMilliseconds(),d=t.getDay(),c=(a=e.customMeridiem)!=null?a:D,M={YY:()=>String(s).slice(-2),YYYY:()=>s,M:()=>l+1,MM:()=>`${l+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(e.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(e.locales,{month:"long"}),D:()=>String(i),DD:()=>`${i}`.padStart(2,"0"),H:()=>String(o),HH:()=>`${o}`.padStart(2,"0"),h:()=>`${o%12||12}`.padStart(1,"0"),hh:()=>`${o%12||12}`.padStart(2,"0"),m:()=>String(r),mm:()=>`${r}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${m}`.padStart(3,"0"),d:()=>d,dd:()=>t.toLocaleDateString(e.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(e.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(e.locales,{weekday:"long"}),A:()=>c(o,r),AA:()=>c(o,r,!1,!0),a:()=>c(o,r,!0),aa:()=>c(o,r,!0,!0)};return n.replace(f,(S,h)=>h||M[S]())}const w=t=>/,\s*\{/.test(t)||!(t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:"));function Y(t){return location.origin+"/image?path="+encodeURIComponent(t)+"&url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))+"&width="+u().config.readWidth}const $=t=>{let n=new Date().getTime(),e=Math.floor((n-t)/1e3),a="";return e<=30?a="刚刚":e<60?a=e+"秒前":e<3600?a=Math.floor(e/60)+"分钟前":e<86400?a=Math.floor(e/3600)+"小时前":e<2592e3?a=Math.floor(e/86400)+"天前":a=L(new Date(t),"YYYY-MM-DD"),a},v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';export{$ as d,Y as g,w as i,v as l};
|
||||
@@ -1 +0,0 @@
|
||||
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}.error[data-v-d4c4e88b]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.tool[data-v-76d18c9a]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-76d18c9a]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-76d18c9a] .el-checkbox{margin-bottom:4px;width:100%}[data-v-fe904689] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-dc7cd0f9]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-dc7cd0f9]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-dc7cd0f9]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-dc7cd0f9]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-dc7cd0f9]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-dc7cd0f9]{margin-bottom:1em}.hotkeys-item__content span[data-v-dc7cd0f9]{margin:.5em}[data-v-2cfb5302] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-2cfb5302] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-e99e7704]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-e99e7704]{flex:1;margin-left:20px}.editor .right[data-v-e99e7704]{flex:1;width:360px;margin-right:20px}
|
||||
@@ -0,0 +1 @@
|
||||
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}[data-v-dfd5b00c] .el-checkbox__label{flex:1;display:flex;justify-content:space-between;align-items:center}.error[data-v-dfd5b00c]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.edit[data-v-dfd5b00c]{border-color:var(--el-color-dark)!important}.tool[data-v-f7855a32]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-f7855a32]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-f7855a32] .el-checkbox{margin-bottom:4px;width:100%}[data-v-fe904689] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-dc7cd0f9]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-dc7cd0f9]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-dc7cd0f9]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-dc7cd0f9]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-dc7cd0f9]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-dc7cd0f9]{margin-bottom:1em}.hotkeys-item__content span[data-v-dc7cd0f9]{margin:.5em}[data-v-2cfb5302] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-2cfb5302] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-e99e7704]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-e99e7704]{flex:1;margin-left:20px}.editor .right[data-v-e99e7704]{flex:1;width:360px;margin-right:20px}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -4,10 +4,10 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="./favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<script type="module" crossorigin src="./assets/index-f4927a88.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/vendor-bf77f5c0.js">
|
||||
<script type="module" crossorigin src="./assets/index-76057bdd.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/vendor-93648100.js">
|
||||
<link rel="stylesheet" href="./assets/vendor-6f0d1692.css">
|
||||
<link rel="stylesheet" href="./assets/index-060af40e.css">
|
||||
<link rel="stylesheet" href="./assets/index-3a786cf8.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package io.legado.app.help.http
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.net.http.SslError
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.AndroidRuntimeException
|
||||
import android.webkit.CookieManager
|
||||
import android.webkit.SslErrorHandler
|
||||
import android.webkit.WebSettings
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
@@ -135,6 +137,15 @@ class BackstageWebView(
|
||||
mHandler.postDelayed(runnable, 1000)
|
||||
}
|
||||
|
||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||
override fun onReceivedSslError(
|
||||
view: WebView?,
|
||||
handler: SslErrorHandler?,
|
||||
error: SslError?
|
||||
) {
|
||||
handler?.proceed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private inner class EvalJsRunnable(
|
||||
@@ -197,6 +208,15 @@ class BackstageWebView(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||
override fun onReceivedSslError(
|
||||
view: WebView?,
|
||||
handler: SslErrorHandler?,
|
||||
error: SslError?
|
||||
) {
|
||||
handler?.proceed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class LoadJsRunnable(
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.legado.app.ui.browser
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.net.Uri
|
||||
import android.net.http.SslError
|
||||
import android.os.Bundle
|
||||
import android.view.KeyEvent
|
||||
import android.view.Menu
|
||||
@@ -247,12 +248,14 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() {
|
||||
"http", "https" -> {
|
||||
return false
|
||||
}
|
||||
|
||||
"legado", "yuedu" -> {
|
||||
startActivity<OnLineImportActivity> {
|
||||
data = url
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
else -> {
|
||||
binding.root.longSnackbar("跳转其它应用", "确认") {
|
||||
openUrl(url)
|
||||
@@ -262,6 +265,15 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||
override fun onReceivedSslError(
|
||||
view: WebView?,
|
||||
handler: SslErrorHandler?,
|
||||
error: SslError?
|
||||
) {
|
||||
handler?.proceed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package io.legado.app.ui.login
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Bitmap
|
||||
import android.net.http.SslError
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
@@ -85,6 +86,15 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) {
|
||||
}
|
||||
super.onPageFinished(view, url)
|
||||
}
|
||||
|
||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||
override fun onReceivedSslError(
|
||||
view: WebView?,
|
||||
handler: SslErrorHandler?,
|
||||
error: SslError?
|
||||
) {
|
||||
handler?.proceed()
|
||||
}
|
||||
}
|
||||
binding.webView.webChromeClient = object : WebChromeClient() {
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.net.Uri
|
||||
import android.net.http.SslError
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.webkit.*
|
||||
@@ -66,6 +67,7 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||
}
|
||||
|
||||
Configuration.ORIENTATION_PORTRAIT -> {
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
|
||||
@@ -95,6 +97,7 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
||||
R.id.menu_rss_refresh -> viewModel.refresh {
|
||||
binding.webView.reload()
|
||||
}
|
||||
|
||||
R.id.menu_rss_star -> viewModel.favorite()
|
||||
R.id.menu_share_it -> {
|
||||
binding.webView.url?.let {
|
||||
@@ -103,11 +106,13 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
||||
share(it.link)
|
||||
} ?: toastOnUi(R.string.null_url)
|
||||
}
|
||||
|
||||
R.id.menu_aloud -> readAloud()
|
||||
R.id.menu_login -> startActivity<SourceLoginActivity> {
|
||||
putExtra("type", "rssSource")
|
||||
putExtra("key", viewModel.rssSource?.loginUrl)
|
||||
}
|
||||
|
||||
R.id.menu_browser_open -> binding.webView.url?.let {
|
||||
openUrl(it)
|
||||
} ?: toastOnUi("url null")
|
||||
@@ -397,12 +402,14 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
||||
"http", "https", "jsbridge" -> {
|
||||
return false
|
||||
}
|
||||
|
||||
"legado", "yuedu" -> {
|
||||
startActivity<OnLineImportActivity> {
|
||||
data = url
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
else -> {
|
||||
binding.root.longSnackbar(R.string.jump_to_another_app, R.string.confirm) {
|
||||
openUrl(url)
|
||||
@@ -412,6 +419,15 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||
override fun onReceivedSslError(
|
||||
view: WebView?,
|
||||
handler: SslErrorHandler?,
|
||||
error: SslError?
|
||||
) {
|
||||
handler?.proceed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,23 +2,35 @@
|
||||
<el-checkbox
|
||||
size="large"
|
||||
border
|
||||
:label="source"
|
||||
:class="{ error: errorPushSources.includes(source) }"
|
||||
@change="handleSourceClick(source)"
|
||||
:label="sourceUrl"
|
||||
:class="{
|
||||
error: errorPushSources.includes(source),
|
||||
edit: sourceUrl == currentSourceUrl,
|
||||
}"
|
||||
>
|
||||
{{ source.bookSourceName || source.sourceName }}
|
||||
<el-button text :icon="Edit" @click="handleSourceClick(source)" />
|
||||
</el-checkbox>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps(["source"]);
|
||||
import { Edit } from "@element-plus/icons-vue";
|
||||
|
||||
const props = defineProps(["source"]);
|
||||
const sourceUrl = props.source.bookSourceUrl || props.source.sourceUrl;
|
||||
const store = useSourceStore();
|
||||
const { errorPushSources } = storeToRefs(store);
|
||||
const { errorPushSources, currentSourceUrl } = storeToRefs(store);
|
||||
const handleSourceClick = (source) => {
|
||||
store.changeCurrentSource(source);
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-checkbox__label) {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.error {
|
||||
border-color: var(--el-color-error) !important;
|
||||
color: var(--el-color-error) !important;
|
||||
@@ -26,4 +38,7 @@ const handleSourceClick = (source) => {
|
||||
--el-checkbox-checked-bg-color: var(--el-color-error);
|
||||
--el-checkbox-checked-input-border-color: var(--el-color-error);
|
||||
}
|
||||
.edit {
|
||||
border-color: var(--el-color-dark) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
type="danger"
|
||||
:icon="Delete"
|
||||
@click="deleteSelectSources"
|
||||
:disabled="sourceSelect.length === 0"
|
||||
:disabled="sourceUrlSelect.length === 0"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
@@ -29,7 +29,7 @@
|
||||
>清空</el-button
|
||||
>
|
||||
</div>
|
||||
<el-checkbox-group id="source-list" v-model="sourceSelect">
|
||||
<el-checkbox-group id="source-list" v-model="sourceUrlSelect">
|
||||
<virtual-list
|
||||
style="height: 100%; overflow-y: auto; overflow-x: hidden"
|
||||
:data-key="(source) => source.bookSourceUrl || source.sourceUrl"
|
||||
@@ -48,22 +48,37 @@ import VirtualList from "vue3-virtual-scroll-list";
|
||||
import SourceItem from "./SourceItem.vue";
|
||||
|
||||
const store = useSourceStore();
|
||||
const sourceSelect = ref([]);
|
||||
const sourceUrlSelect = ref([]);
|
||||
const searchKey = ref("");
|
||||
const { sources } = storeToRefs(store);
|
||||
const isBookSource = computed(() => {
|
||||
return /bookSource/.test(window.location.href);
|
||||
});
|
||||
const sourceSelect = computed(() => {
|
||||
let temp = sourceUrlSelect.value,
|
||||
selectUrlsLength = temp.length;
|
||||
if (selectUrlsLength == 0) return [];
|
||||
let searchKey = "sourceUrl";
|
||||
if (isBookSource.value) searchKey = "bookSourceUrl";
|
||||
return sources.value.filter((source) => {
|
||||
let searchIndex = temp.indexOf(source[searchKey]);
|
||||
if (searchIndex > -1) {
|
||||
temp.splice(searchIndex, 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
const deleteSelectSources = () => {
|
||||
API.deleteSource(sourceSelect.value).then(({ data }) => {
|
||||
if (!data.isSuccess) return ElMessage.error(data.errorMsg);
|
||||
store.deleteSources(sourceSelect.value);
|
||||
sourceSelect.value = [];
|
||||
sourceUrlSelect.value = [];
|
||||
});
|
||||
};
|
||||
const clearAllSources = () => {
|
||||
store.clearAllSource();
|
||||
sourceSelect.value = [];
|
||||
sourceUrlSelect.value = [];
|
||||
};
|
||||
//筛选源
|
||||
const sourcesFiltered = computed(() => {
|
||||
@@ -104,7 +119,7 @@ const importSourceFile = () => {
|
||||
const outExport = () => {
|
||||
const exportFile = document.createElement("a");
|
||||
let sources =
|
||||
sourceSelect.value.length === 0
|
||||
sourceUrlSelect.value.length === 0
|
||||
? sourcesFiltered.value
|
||||
: sourceSelect.value,
|
||||
sourceType = isBookSource.value ? "BookSource" : "RssSource";
|
||||
@@ -131,7 +146,6 @@ const outExport = () => {
|
||||
#source-list {
|
||||
margin-top: 6px;
|
||||
height: calc(100vh - 112px - 7px);
|
||||
|
||||
:deep(.el-checkbox) {
|
||||
margin-bottom: 4px;
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user