|
@ -1,9 +1,8 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { updateContainer } from '@/apis/container' |
|
|
import { updateContainer } from '@/apis/container' |
|
|
import { useSolutionStore } from '@/stores/useSolutionStore' |
|
|
|
|
|
import { Plus } from '@element-plus/icons-vue' |
|
|
import { Plus } from '@element-plus/icons-vue' |
|
|
import { FtMessage } from 'libs/message' |
|
|
import { FtMessage } from 'libs/message' |
|
|
import { computed, ref } from 'vue' |
|
|
|
|
|
|
|
|
import { computed, inject, ref } from 'vue' |
|
|
import { useRouter } from 'vue-router' |
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
@ -21,9 +20,10 @@ const emits = defineEmits<{ |
|
|
(e: 'ok'): void |
|
|
(e: 'ok'): void |
|
|
}>() |
|
|
}>() |
|
|
|
|
|
|
|
|
|
|
|
const solutionList = inject<Solution.SolutionItem[]>('solutionList') |
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
const router = useRouter() |
|
|
const visible = ref(false) |
|
|
const visible = ref(false) |
|
|
const solutionStore = useSolutionStore() |
|
|
|
|
|
const solutionId = ref() |
|
|
const solutionId = ref() |
|
|
const selectedSolutionItem = ref() |
|
|
const selectedSolutionItem = ref() |
|
|
const solutionInfo = ref(props.solutionItem) |
|
|
const solutionInfo = ref(props.solutionItem) |
|
@ -75,7 +75,7 @@ const onSolutionChange = (value: number) => { |
|
|
if (value) { |
|
|
if (value) { |
|
|
solutionId.value = value |
|
|
solutionId.value = value |
|
|
solutionInfo.value.solutionId = value |
|
|
solutionInfo.value.solutionId = value |
|
|
selectedSolutionItem.value = solutionStore.solutionList.filter(item => item.id === value)[0] |
|
|
|
|
|
|
|
|
selectedSolutionItem.value = solutionList.value?.filter(item => item.id === value)[0] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const onClose = () => { |
|
|
const onClose = () => { |
|
@ -83,7 +83,7 @@ const onClose = () => { |
|
|
visible.value = false |
|
|
visible.value = false |
|
|
} |
|
|
} |
|
|
const onSubmitSolution = () => { |
|
|
const onSubmitSolution = () => { |
|
|
if (!solutionStore.solutionList.length) { |
|
|
|
|
|
|
|
|
if (solutionList.value?.length) { |
|
|
// 跳转至配置酸液页面 |
|
|
// 跳转至配置酸液页面 |
|
|
router.push('/solution') |
|
|
router.push('/solution') |
|
|
return |
|
|
return |
|
@ -131,9 +131,9 @@ const onSubmitSolution = () => { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<FtDialog v-model="visible" title="选择酸液" :ok-handle="onSubmitSolution" @cancel="onClose"> |
|
|
<FtDialog v-model="visible" title="选择酸液" :ok-handle="onSubmitSolution" @cancel="onClose"> |
|
|
<div v-if="solutionStore.solutionList.length"> |
|
|
|
|
|
|
|
|
<div v-if="solutionList?.length"> |
|
|
<el-radio-group v-model="solutionId" size="large" class="radio-group" @change="onSolutionChange"> |
|
|
<el-radio-group v-model="solutionId" size="large" class="radio-group" @change="onSolutionChange"> |
|
|
<el-radio-button v-for="item in solutionStore.solutionList" :key="item.id" :label="item.name" :value="item.id" class="radio-marge" /> |
|
|
|
|
|
|
|
|
<el-radio-button v-for="item in solutionList" :key="item.id" :label="item.name" :value="item.id" class="radio-marge" /> |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else> |
|
|
<div v-else> |
|
|