fix
This commit is contained in:
parent
ce7aa3e7b3
commit
70e505e53f
@ -3,13 +3,17 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, watch } from 'vue';
|
import { reactive, watch } from 'vue';
|
||||||
import { isEmpty } from '@/utils';
|
import { isEmpty, sleep } from '@/utils';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
query: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -79,6 +83,34 @@ const state = reactive({
|
|||||||
data: [],
|
data: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const loadData = async (code = '') => {
|
||||||
|
state.loading = true;
|
||||||
|
// GetInputsInfo()
|
||||||
|
// .then((res) => {
|
||||||
|
// if (res.code === 200) {
|
||||||
|
// state.data = res.data;
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// app.$message.error(err.msg);
|
||||||
|
// });
|
||||||
|
await sleep(500);
|
||||||
|
state.data = [
|
||||||
|
{ name: '耿马镇', value: 70 },
|
||||||
|
{ name: '勐撒镇', value: 203 },
|
||||||
|
{ name: '勐永镇', value: 54 },
|
||||||
|
{ name: '孟定镇', value: 35 },
|
||||||
|
{ name: '勐简乡', value: 95 },
|
||||||
|
{ name: '贺派乡', value: 62 },
|
||||||
|
{ name: '四排山乡', value: 84 },
|
||||||
|
{ name: '芒洪乡', value: 82 },
|
||||||
|
{ name: '大兴乡', value: 64 },
|
||||||
|
{ name: '信阳', value: 55 },
|
||||||
|
{ name: '新乡', value: 32 },
|
||||||
|
{ name: '大同', value: 51 },
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
(val) => {
|
(val) => {
|
||||||
@ -91,4 +123,17 @@ watch(
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.query,
|
||||||
|
(val) => {
|
||||||
|
if (!isEmpty(val)) {
|
||||||
|
loadData(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user