|
|
|
@ -36,17 +36,36 @@ |
|
|
|
</el-icon> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div class="productOption"> |
|
|
|
<div class="productOption" v-show="productisOpen"> |
|
|
|
<div class="productOption" v-show="productisOpen"> |
|
|
|
<hr class="line"> |
|
|
|
<div class="marketprodut"> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="ai"> |
|
|
|
<div class="checktxt">AI机构探测神器</div> |
|
|
|
<!-- 全选框 --> |
|
|
|
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange"> |
|
|
|
全选 |
|
|
|
</el-checkbox> |
|
|
|
<el-checkbox-group v-model="selectedSoftwareItems" @change="handleCheckedItemsChange"> |
|
|
|
<el-checkbox label="软件A" size="large" /> |
|
|
|
<el-checkbox label="软件B" size="large" /> |
|
|
|
<el-checkbox label="软件C" size="large" /> |
|
|
|
<hr class="line"> |
|
|
|
<el-checkbox-group v-model="selectedSoftwareItems" :max="1"> |
|
|
|
<el-checkbox v-for="ai in AIProduct" :key="ai" :label="ai" :value="ai"> |
|
|
|
{{ ai }} |
|
|
|
</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
<div class="ai"> |
|
|
|
<div class="checktxt">超级机构探测神器</div> |
|
|
|
<hr class="line"> |
|
|
|
<el-checkbox-group v-model="selectedSoftwareItems" :max="1"> |
|
|
|
<el-checkbox v-for="ai in superProduct" :key="ai" :label="ai" :value="ai"> |
|
|
|
{{ ai }} |
|
|
|
</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
<div class="ai"> |
|
|
|
<div class="checktxt">静态信息费</div> |
|
|
|
<hr class="line"> |
|
|
|
<el-checkbox-group v-model="selectedSoftwareItems" :max="1"> |
|
|
|
<el-checkbox v-for="ai in InfoFee" :key="ai" :label="ai" :value="ai"> |
|
|
|
{{ ai }} |
|
|
|
</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -55,7 +74,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script setup> |
|
|
|
import { ref, watch } from 'vue'; |
|
|
|
import { ref, watch, onMounted } from 'vue'; |
|
|
|
import { ArrowDown } from '@element-plus/icons-vue'; |
|
|
|
|
|
|
|
const searchData = ref('') |
|
|
|
@ -90,23 +109,21 @@ const isCoinRechargeChecked = ref(false) |
|
|
|
const selectedSoftwareItems = ref([]) |
|
|
|
const selectedValue = ref([]) |
|
|
|
|
|
|
|
// 全选相关 |
|
|
|
const checkAll = ref(false) |
|
|
|
const isIndeterminate = ref(false) |
|
|
|
const softwareItems = ['软件A', '软件B', '软件C'] |
|
|
|
|
|
|
|
const AIProduct = ['AI机构追踪', 'AI机构出击 ', 'AI机构资金', 'AI机活跃度'] |
|
|
|
const superProduct = ['超级机构透视', '超级机构伏击 ', '超级机构猎杀', '超级机构脉搏', '超级机构罗盘'] |
|
|
|
const InfoFee = ['静态信息费'] |
|
|
|
|
|
|
|
// 监听金币充值选中状态变化 |
|
|
|
watch(isCoinRechargeChecked, (newVal) => { |
|
|
|
if (newVal) { |
|
|
|
selectedSoftwareItems.value = []; |
|
|
|
selectedValue.value = newVal ? ['金币充值'] : []; |
|
|
|
// 重置全选相关状态 |
|
|
|
checkAll.value = false; |
|
|
|
isIndeterminate.value = false; |
|
|
|
} else { |
|
|
|
selectedValue.value = selectedSoftwareItems.value.length > 0 ? selectedSoftwareItems.value : []; |
|
|
|
} |
|
|
|
emit('update:modelValue', selectedValue.value); |
|
|
|
selectedItem.value = selectedValue.value[0] || ''; |
|
|
|
}); |
|
|
|
|
|
|
|
// 监听软件选中项变化 |
|
|
|
@ -118,23 +135,31 @@ watch(selectedSoftwareItems, (newVals) => { |
|
|
|
selectedValue.value = isCoinRechargeChecked.value ? ['金币充值'] : []; |
|
|
|
} |
|
|
|
emit('update:modelValue', selectedValue.value); |
|
|
|
selectedItem.value = selectedValue.value[0] || ''; |
|
|
|
}); |
|
|
|
|
|
|
|
// 全选逻辑 |
|
|
|
const handleCheckAllChange = (val) => { |
|
|
|
selectedSoftwareItems.value = val ? softwareItems : [] |
|
|
|
isIndeterminate.value = false |
|
|
|
} |
|
|
|
const handleCheckedItemsChange = (value) => { |
|
|
|
const checkedCount = value.length |
|
|
|
checkAll.value = checkedCount === softwareItems.length |
|
|
|
isIndeterminate.value = checkedCount > 0 && checkedCount < softwareItems.length |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
const initValue = props.modelValue; |
|
|
|
if (initValue.length === 0) return; |
|
|
|
|
|
|
|
// 若初始值是“金币充值”,同步到复选框 |
|
|
|
if (initValue[0] === '金币充值') { |
|
|
|
isCoinRechargeChecked.value = true; |
|
|
|
selectedValue.value = ['金币充值']; |
|
|
|
} |
|
|
|
// 若初始值是软件产品,同步到 selectedSoftwareItems |
|
|
|
else { |
|
|
|
selectedSoftwareItems.value = initValue; |
|
|
|
selectedValue.value = initValue; |
|
|
|
} |
|
|
|
// 同步下拉框显示文本 |
|
|
|
selectedItem.value = selectedValue.value[0] || ''; |
|
|
|
}); |
|
|
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
|
|
.productContent { |
|
|
|
position: relative; |
|
|
|
width: 268px; |
|
|
|
width: 450px; |
|
|
|
font-family: 'Arial', sans-serif; |
|
|
|
} |
|
|
|
|
|
|
|
@ -172,7 +197,7 @@ const handleCheckedItemsChange = (value) => { |
|
|
|
position: absolute; |
|
|
|
top: 100%; |
|
|
|
left: 0; |
|
|
|
width: 130%; |
|
|
|
width: 160%; |
|
|
|
max-height: 600px; |
|
|
|
min-height: 200px; |
|
|
|
display: flex; |
|
|
|
@ -221,5 +246,42 @@ const handleCheckedItemsChange = (value) => { |
|
|
|
.coinselect.active .coin-arrow { |
|
|
|
transform: rotate(-90deg); |
|
|
|
} |
|
|
|
|
|
|
|
.product { |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
.line { |
|
|
|
display: flex; |
|
|
|
height: 1px; |
|
|
|
padding: 0 16px; |
|
|
|
align-items: flex-start; |
|
|
|
align-content: flex-start; |
|
|
|
gap: 8px 60px; |
|
|
|
flex-shrink: 0; |
|
|
|
align-self: stretch; |
|
|
|
flex-wrap: wrap; |
|
|
|
border-top: 1px solid #7E91FF; |
|
|
|
} |
|
|
|
|
|
|
|
.productOption { |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
.ai { |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
.checktxt { |
|
|
|
color: #5870ff; |
|
|
|
font-family: "PingFang SC"; |
|
|
|
font-size: 13px; |
|
|
|
font-style: normal; |
|
|
|
font-weight: 700; |
|
|
|
line-height: 22px; |
|
|
|
margin: 10px 20px; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |