diff --git a/src/views/Design/components/ActionCompoents/OptionAction.vue b/src/views/Design/components/ActionCompoents/OptionAction.vue index 4499603..71bc5cb 100644 --- a/src/views/Design/components/ActionCompoents/OptionAction.vue +++ b/src/views/Design/components/ActionCompoents/OptionAction.vue @@ -1,8 +1,9 @@ @@ -84,6 +86,10 @@ import CheckboxAction from './components/OptionItemAction/CheckboxAction.vue'; import { ref } from 'vue'; import { showConfirmDialog } from 'vant'; import Draggable from '@/views/Design/components/Draggable.vue'; + +// 是否是预览模式 +const isPreview = defineModel('isPreview', { default: false, type: Boolean }); + defineProps({ active: { type: Boolean, @@ -100,11 +106,11 @@ defineProps({ default: '' } }); - const element = defineModel('data', { type: Array, default: () => [] }); + const actions = [ { name: '上移选项', action: 'up' }, { name: '下移选项', action: 'down' } @@ -119,6 +125,21 @@ const updateData = (newValue) => { element.value = newValue; }; +/** + * 将当前激活的选项置底 + */ +function handleLastOption(value) { + // 检查是否有有效的选项被激活 + if (value === 0) return; + if (!activeIndex.value >= 0) return; + + // 寻找当前激活的选项 + const activeOption = element.value[activeIndex.value]; + activeOption.is_fixed = value; + // // 触发数据更新 + // updateData([...element.value]); +} + // emit('update:data'); /** * @name 打开model弹窗 @@ -159,7 +180,6 @@ const optionMove = (action) => { }; // 删除当前选项 - const deleteOption = (index) => { showConfirmDialog({ title: '提示', diff --git a/src/views/Design/components/Draggable.vue b/src/views/Design/components/Draggable.vue index 2c72a6f..9828c99 100644 --- a/src/views/Design/components/Draggable.vue +++ b/src/views/Design/components/Draggable.vue @@ -1,7 +1,7 @@