Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
JiangQiming 2023-03-29 16:34:27 +08:00
commit 22d326337b
9 changed files with 15 additions and 8 deletions

View File

@ -52,6 +52,7 @@ const data: any = ref({
const pickerTimeChange = () => { const pickerTimeChange = () => {
data.value.time.type = undefined; data.value.time.type = undefined;
console.log(1);
}; };
const getEcharts = async (val: any) => { const getEcharts = async (val: any) => {
@ -108,6 +109,7 @@ const handleOptions = (x = [], y = []) => {
watch( watch(
() => data.value.time.type, () => data.value.time.type,
(value) => { (value) => {
if (value === undefined) return;
const date = getTimeByType(value); const date = getTimeByType(value);
data.value.time.time = [dayjs(date), dayjs(new Date())]; data.value.time.time = [dayjs(date), dayjs(new Date())];
}, },

View File

@ -165,6 +165,7 @@ const handleCpuOptions = (optionsData: any, xAxis: any) => {
watch( watch(
() => data.value.type, () => data.value.type,
(value) => { (value) => {
if (value === undefined) return;
const date = getTimeByType(value); const date = getTimeByType(value);
data.value.time = [dayjs(date), dayjs(new Date())]; data.value.time = [dayjs(date), dayjs(new Date())];
}, },

View File

@ -169,6 +169,7 @@ const handleJVMOptions = (optionsData: any, xAxis: any) => {
watch( watch(
() => data.value.type, () => data.value.type,
(value) => { (value) => {
if (value === undefined) return;
const date = getTimeByType(value); const date = getTimeByType(value);
data.value.time = [dayjs(date), dayjs(new Date())]; data.value.time = [dayjs(date), dayjs(new Date())];
}, },

View File

@ -183,6 +183,7 @@ const handleNetworkOptions = (optionsData: any, xAxis: any) => {
watch( watch(
() => data.value.time.type, () => data.value.time.type,
(value) => { (value) => {
if (value === undefined) return;
const date = getTimeByType(value); const date = getTimeByType(value);
data.value.time.time = [dayjs(date), dayjs(new Date())]; data.value.time.time = [dayjs(date), dayjs(new Date())];
}, },

View File

@ -58,7 +58,7 @@
@change="propertySelect" @change="propertySelect"
> >
<j-select-option <j-select-option
v-for="item in metadata?.properties.filter((i) => v-for="item in (metadata?.properties || []).filter((i) =>
i?.expands?.type?.includes('read'), i?.expands?.type?.includes('read'),
) || []" ) || []"
:value="item?.id" :value="item?.id"

View File

@ -171,15 +171,12 @@ const handleClick = (_detail: any) => {
} }
}; };
watch(() => props.value?.[0]?.value, (newVal) => { onMounted(() => {
if(newVal){ if(props.value?.[0]?.value){
detail(newVal).then(resp => { detail(props.value?.[0]?.value).then(resp => {
emit('change', resp.result); emit('change', resp.result);
}) })
} }
}, {
deep: true,
immediate: true
}) })
watchEffect(() => { watchEffect(() => {

View File

@ -180,6 +180,11 @@ const onValueChange = () => {
emits('update:value', [{ value: newValue, name: '标签' }]); emits('update:value', [{ value: newValue, name: '标签' }]);
emits('change', [{ value: newValue, name: '标签' }], _data); emits('change', [{ value: newValue, name: '标签' }], _data);
}; };
// onMounted(() => {
// // console.log(tagList.value, props.tagData, props.value)
// // emits('change', props.value, _data);
// })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -285,6 +285,7 @@ const onTagChange = (val: any[], arr: any[]) => {
i.name i.name
}为${i.value}`; }为${i.value}`;
}); });
console.log(tagName)
emits( emits(
'save', 'save',
unref(modelRef), unref(modelRef),

View File

@ -69,7 +69,6 @@ import Product from './Product.vue';
import Device from './device/index.vue'; import Device from './device/index.vue';
import Action from './actions/index.vue'; import Action from './actions/index.vue';
import { onlyMessage } from '@/utils/comm'; import { onlyMessage } from '@/utils/comm';
import { detail } from '@/api/device/product';
import { useSceneStore } from '@/store/scene'; import { useSceneStore } from '@/store/scene';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';