fix
This commit is contained in:
parent
3fbd49eb4d
commit
75664bad53
@ -1,94 +0,0 @@
|
||||
<template>
|
||||
<el-select-v2
|
||||
v-model="val"
|
||||
:options="options"
|
||||
:placeholder="props.set.placeholder"
|
||||
:props="props.set.props"
|
||||
:multiple="props.set.multiple"
|
||||
@change="handleSelect"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import request from '@/utils/axios';
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
const props = defineProps({
|
||||
set: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
url: '',
|
||||
options: [
|
||||
{
|
||||
value: '1',
|
||||
label: 'label 1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: 'label 2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: 'label 3',
|
||||
},
|
||||
],
|
||||
props: {
|
||||
value: 'value',
|
||||
label: 'label',
|
||||
},
|
||||
multiple: false,
|
||||
placeholder: '请选择',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
value: {
|
||||
type: String || Array || null,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.set.multiple) val.value = [];
|
||||
|
||||
if (props.set.url) {
|
||||
let res = await request(props.set.url, {
|
||||
method: 'get',
|
||||
data: { current: 1, size: 9999 },
|
||||
});
|
||||
if (res.code == 200) {
|
||||
options.value = res.data.records;
|
||||
}
|
||||
} else {
|
||||
options.value = props.set.options;
|
||||
}
|
||||
});
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const val = ref(null);
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
val.value = props.value;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
const options = ref([]);
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
function handleSelect(val_) {
|
||||
emit('update:value', val_);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -1,44 +0,0 @@
|
||||
<template>
|
||||
<el-select-v2 v-model="val" :options="options" placeholder="请选择网格" :props="_props" @change="handleSelect" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { GetEntityList } from '@/apis/grid.js';
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
const props = defineProps({
|
||||
// 父组件传过来的值
|
||||
value: {
|
||||
type: String || null,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
let res = await GetEntityList();
|
||||
if (res.code == 200) {
|
||||
options.value = res.data.records;
|
||||
}
|
||||
});
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const val = ref(null);
|
||||
const options = ref([]);
|
||||
const _props = {
|
||||
value: 'id',
|
||||
label: 'productName',
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
function handleSelect(val_) {
|
||||
emit('update:value', val_);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -1,60 +0,0 @@
|
||||
<template>
|
||||
<el-select v-model="val" @change="change">
|
||||
<el-option v-for="item in options" :key="`land_type_${item.value}`" :value="item.value" :label="item.label" :placeholder="props.placeholder">
|
||||
{{ item.label }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
// 父组件传过来的值
|
||||
value: {
|
||||
type: String || Number || null,
|
||||
default: null,
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update:value']);
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
const val = ref(null);
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
val.value = props.value || props.value == 0 ? String(props.value) : null;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
const options = ref([
|
||||
{ label: '耕地', value: '0' },
|
||||
{ label: '果园', value: '1' },
|
||||
{ label: '茶园', value: '2' },
|
||||
{ label: '其他园地', value: '3' },
|
||||
{ label: '林地', value: '4' },
|
||||
{ label: '草地', value: '5' },
|
||||
{ label: '其他农用地', value: '6' },
|
||||
{ label: '农村宅基地', value: '7' },
|
||||
]);
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
function change(val_) {
|
||||
val.value = val_;
|
||||
emit('update:value', val_);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -1,54 +0,0 @@
|
||||
<template>
|
||||
<el-select v-model="val" @change="change">
|
||||
<el-option v-for="item in options" :key="`land_type_${item.value}`" :value="item.value" :label="item.label" :placeholder="props.placeholder">
|
||||
{{ item.label }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
// 父组件传过来的值
|
||||
value: {
|
||||
type: String || Number || null,
|
||||
default: null,
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update:value']);
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
const val = ref(null);
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
val.value = props.value || props.value == 0 ? String(props.value) : null;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
const options = ref([
|
||||
{ label: '是', value: '0' },
|
||||
{ label: '否', value: '1' },
|
||||
]);
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
function change(val_) {
|
||||
val.value = val_;
|
||||
emit('update:value', val_);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -1,55 +0,0 @@
|
||||
<template>
|
||||
<el-select v-model="val" @change="change">
|
||||
<el-option v-for="item in options" :key="`land_type_${item.value}`" :value="item.value" :label="item.label" :placeholder="props.placeholder">
|
||||
{{ item.label }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
// 父组件传过来的值
|
||||
value: {
|
||||
type: String || Number || null,
|
||||
default: null,
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update:value']);
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
const val = ref(null);
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
val.value = props.value || props.value == 0 ? String(props.value) : null;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
const options = ref([
|
||||
{ label: '农用地', value: '0' },
|
||||
{ label: '住宅用地', value: '1' },
|
||||
{ label: '园林', value: '2' },
|
||||
]);
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
function change(val_) {
|
||||
val.value = val_;
|
||||
emit('update:value', val_);
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
Loading…
x
Reference in New Issue
Block a user