fix(web): 同步删除app源
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
placeholder="筛选源"
|
placeholder="筛选源"
|
||||||
/>
|
/>
|
||||||
<div class="tool">
|
<div class="tool">
|
||||||
<el-button @click="importSourceFile" :icon="Folder"> 打开 </el-button>
|
<el-button @click="importSourceFile" :icon="Folder">打开</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="sourcesFiltered.length === 0"
|
:disabled="sourcesFiltered.length === 0"
|
||||||
@click="outExport"
|
@click="outExport"
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
导出</el-button
|
导出</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
|
type="danger"
|
||||||
:icon="Delete"
|
:icon="Delete"
|
||||||
@click="deleteSelectSources"
|
@click="deleteSelectSources"
|
||||||
:disabled="sourceSelect.length === 0"
|
:disabled="sourceSelect.length === 0"
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import API from "@api";
|
||||||
import { Folder, Delete, Download, Search } from "@element-plus/icons-vue";
|
import { Folder, Delete, Download, Search } from "@element-plus/icons-vue";
|
||||||
import { isSourceContains } from "../utils/souce";
|
import { isSourceContains } from "../utils/souce";
|
||||||
import VirtualList from "vue3-virtual-scroll-list";
|
import VirtualList from "vue3-virtual-scroll-list";
|
||||||
@@ -53,8 +55,11 @@ const isBookSource = computed(() => {
|
|||||||
return /bookSource/.test(window.location.href);
|
return /bookSource/.test(window.location.href);
|
||||||
});
|
});
|
||||||
const deleteSelectSources = () => {
|
const deleteSelectSources = () => {
|
||||||
store.deleteSources(sourceSelect.value);
|
API.deleteSource(sourceSelect.value).then({ data } => {
|
||||||
sourceSelect.value = [];
|
if (!data.isSuccess) return ElMessage.error(data.errorMsg);
|
||||||
|
store.deleteSources(sourceSelect.value);
|
||||||
|
sourceSelect.value = [];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const clearAllSources = () => {
|
const clearAllSources = () => {
|
||||||
store.clearAllSource();
|
store.clearAllSource();
|
||||||
|
|||||||
Reference in New Issue
Block a user