|
@@ -12,16 +12,28 @@
|
|
|
class="j-checkbox-button"
|
|
|
v-for="state in options.value"
|
|
|
:key="state"
|
|
|
- :label="state"
|
|
|
+ :label="setSelectValue(state)"
|
|
|
>
|
|
|
- {{ state }}
|
|
|
+ {{ field ? setSelectValue(state) : state }}
|
|
|
</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
+ // 是否单选
|
|
|
+ sigle: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ // field: 空代表字符串数组
|
|
|
+ // 其他: options是对象数组,field是对象数组的某个字段
|
|
|
+ field: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
options: {
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
@@ -31,6 +43,13 @@ const props = defineProps({
|
|
|
default: () => []
|
|
|
}
|
|
|
})
|
|
|
+function setSelectValue(state) {
|
|
|
+ if (props.dataType === '') {
|
|
|
+ return state
|
|
|
+ } else {
|
|
|
+ return state[props.field]
|
|
|
+ }
|
|
|
+}
|
|
|
const emit = defineEmits(['input'])
|
|
|
function onIssueStateChange(value) {
|
|
|
const isAllBtn = value.filter((item, i) => item === '全部' && i !== 0)
|