|
|
@ -57,7 +57,11 @@ import { onMounted, ref } from "vue"; |
|
|
|
import { createLiquid, deleteLiquid, getLiquidList, type Liquid } from "@/services/liquid/liquidManage"; |
|
|
|
import { showToast } from "vant"; |
|
|
|
import AddLiquid from "./components/AddLiquid.vue"; |
|
|
|
import { useSettingStore } from "@/stores/setting"; |
|
|
|
import * as R from "ramda"; |
|
|
|
import { ElMessageBox } from "element-plus"; |
|
|
|
|
|
|
|
const settingStore = useSettingStore(); |
|
|
|
const showEditDialog = ref<boolean>(false); |
|
|
|
|
|
|
|
const liquidList = ref<Liquid[]>([]); |
|
|
@ -67,6 +71,7 @@ function getLiquid() { |
|
|
|
getLiquidList({ pageNum: 1, pageSize: 9999 }).then(res => { |
|
|
|
if (res.success) { |
|
|
|
liquidList.value = res.data.list; |
|
|
|
settingStore.setLiquidList(res.data.list); |
|
|
|
} else { |
|
|
|
showToast(res.msg); |
|
|
|
} |
|
|
@ -107,6 +112,19 @@ function addLiquid(name: string) { |
|
|
|
} |
|
|
|
function onDeleteLiquid() { |
|
|
|
if (selectedIds.value.length === 0) return; |
|
|
|
const joinSet = R.innerJoin( |
|
|
|
(container, id) => container.solutionId === id, |
|
|
|
settingStore.heatContainerWithLiquid, |
|
|
|
selectedIds.value |
|
|
|
); |
|
|
|
if (joinSet.length > 0) { |
|
|
|
ElMessageBox.confirm("所选溶液和容器存在对应关系,请先在【加液配置】中解除与容器的关联,再删除溶液。", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
showCancelButton: false, |
|
|
|
center: true, |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
deleteLiquid(selectedIds.value.join(",")).then(res => { |
|
|
|
if (res.success) { |
|
|
|
selectedIds.value = []; |
|
|
|