Merge branch 'feature-Beta-dev-renpy' into master-dev
This commit is contained in:
commit
5e563ac93d
71
src/components/CustomSelectWithAllChecking.vue/index.vue
Normal file
71
src/components/CustomSelectWithAllChecking.vue/index.vue
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
<template>
|
||||||
|
<a-select v-bind="$attrs" v-model="innerValue" mode="multiple" allow-clear :options="options">
|
||||||
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
|
<div slot="dropdownRender" slot-scope="menu">
|
||||||
|
<v-nodes :vnodes="menu" />
|
||||||
|
<a-divider style="margin: 4px 0" />
|
||||||
|
<div style="padding: 4px 12px; cursor: pointer" @mousedown="(e) => e.preventDefault()">
|
||||||
|
<a-checkbox v-model="isSelectAll" :disabled="!options.length">
|
||||||
|
<span @click.prevent="isSelectAll = !isSelectAll"> ALL </span>
|
||||||
|
</a-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Array, Number],
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
VNodes: {
|
||||||
|
functional: true,
|
||||||
|
render: (h, ctx) => ctx.props.vnodes,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
innerValue: {
|
||||||
|
set(val) {
|
||||||
|
this.$emit('input', val)
|
||||||
|
},
|
||||||
|
get() {
|
||||||
|
return this.value
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
isSelectAll: {
|
||||||
|
set(val) {
|
||||||
|
if (val) {
|
||||||
|
this.$emit(
|
||||||
|
'input',
|
||||||
|
this.options.map((item) => item.value)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.$emit('input', [])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
get() {
|
||||||
|
return !!this.options.length && this.value.length === this.options.length
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.ant-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-select-dropdown-content {
|
||||||
|
position: relative;
|
||||||
|
background: #03353f;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -547,6 +547,8 @@ input[type='number']::-webkit-outer-spin-button {
|
||||||
.ant-select-dropdown-content {
|
.ant-select-dropdown-content {
|
||||||
border: 1px solid @borderColor;
|
border: 1px solid @borderColor;
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
|
transform: translateZ(0);
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -6px;
|
top: -6px;
|
||||||
|
|
|
@ -214,7 +214,7 @@
|
||||||
prop="station"
|
prop="station"
|
||||||
:rules="[{ required: true, message: 'Please select station!' }]"
|
:rules="[{ required: true, message: 'Please select station!' }]"
|
||||||
>
|
>
|
||||||
<a-select
|
<!-- <a-select
|
||||||
class="form-select"
|
class="form-select"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
|
@ -224,7 +224,16 @@
|
||||||
v-model="formVal.station"
|
v-model="formVal.station"
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select> -->
|
||||||
|
<custom-select-with-all-checking
|
||||||
|
class="form-select"
|
||||||
|
placeholder="select..."
|
||||||
|
:options="filteredStationList"
|
||||||
|
:filter-option="filterOption"
|
||||||
|
:max-tag-count="1"
|
||||||
|
v-model="formVal.station"
|
||||||
|
>
|
||||||
|
</custom-select-with-all-checking>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item
|
<a-form-model-item
|
||||||
label="Nuclide"
|
label="Nuclide"
|
||||||
|
@ -320,11 +329,7 @@
|
||||||
</dic-select>
|
</dic-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
|
||||||
<a-form-model-item
|
<a-form-model-item label="Identify nuclides" prop="identifyNuclides">
|
||||||
label="Identify nuclides"
|
|
||||||
prop="identifyNuclides"
|
|
||||||
:rules="[{ required: true, message: 'Please select Identify nuclides!' }]"
|
|
||||||
>
|
|
||||||
<a-select
|
<a-select
|
||||||
class="form-select"
|
class="form-select"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
|
@ -375,6 +380,7 @@ import { getAction, postAction, httpAction, deleteAction, putAction } from '@/ap
|
||||||
import DicSelect from '../../components/dicSelect.vue'
|
import DicSelect from '../../components/dicSelect.vue'
|
||||||
import { MenuNameMap, QcFlagOptions, SampleMap, SampleTypeOptions } from './config'
|
import { MenuNameMap, QcFlagOptions, SampleMap, SampleTypeOptions } from './config'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
import CustomSelectWithAllChecking from '@/components/CustomSelectWithAllChecking.vue'
|
||||||
|
|
||||||
const InitialFormVal = {
|
const InitialFormVal = {
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -397,6 +403,7 @@ const InitialFormVal = {
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DicSelect,
|
DicSelect,
|
||||||
|
CustomSelectWithAllChecking,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -583,7 +590,7 @@ export default {
|
||||||
colTime: colTime ? (colTime.length > 1 ? colTime : colTime[0]) : null,
|
colTime: colTime ? (colTime.length > 1 ? colTime : colTime[0]) : null,
|
||||||
xe133MDC: xe133MDC ? (xe133MDC.length > 1 ? xe133MDC : xe133MDC[0]) : null,
|
xe133MDC: xe133MDC ? (xe133MDC.length > 1 ? xe133MDC : xe133MDC[0]) : null,
|
||||||
|
|
||||||
identifyNuclides: identifyNuclidesChecked,
|
identifyNuclides: identifyNuclidesChecked || undefined,
|
||||||
station: stationChecked,
|
station: stationChecked,
|
||||||
nuclide: nuclidesChecked,
|
nuclide: nuclidesChecked,
|
||||||
|
|
||||||
|
@ -704,7 +711,7 @@ export default {
|
||||||
conditions: condition,
|
conditions: condition,
|
||||||
stations: station.join(','),
|
stations: station.join(','),
|
||||||
nuclides: nuclide.join(','),
|
nuclides: nuclide.join(','),
|
||||||
identifyNuclides: identifyNuclides.join(','),
|
identifyNuclides: identifyNuclides && identifyNuclides.length ? identifyNuclides.join(',') : null,
|
||||||
...qcFlags,
|
...qcFlags,
|
||||||
}
|
}
|
||||||
if (this.isAdd) {
|
if (this.isAdd) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user