parent
56996efdec
commit
4b2f63f2f8
|
|
@ -14,8 +14,8 @@
|
||||||
<div class="title" :class="article_theme == '3' ? 'text-line-1 flex-1 flex-width' : 'text-line-2'" :style="article_name">{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}</div>
|
<div class="title" :class="article_theme == '3' ? 'text-line-1 flex-1 flex-width' : 'text-line-2'" :style="article_name">{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}</div>
|
||||||
<div class="flex-row jc-sb gap-8" :class="article_theme == '3' ? 'ml-10' : 'align-e mt-10'">
|
<div class="flex-row jc-sb gap-8" :class="article_theme == '3' ? 'ml-10' : 'align-e mt-10'">
|
||||||
<div :style="article_date">{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}</div>
|
<div :style="article_date">{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}</div>
|
||||||
<div class="flex-row align-c gap-3" :style="article_page_view">
|
<div v-show="field_show.includes('1')" class="flex-row align-c gap-3" :style="article_page_view">
|
||||||
<icon v-show="field_show.includes('1')" name="eye"></icon>
|
<icon name="eye"></icon>
|
||||||
<div>
|
<div>
|
||||||
{{ item.data.access_count ? item.data.access_count : '16' }}
|
{{ item.data.access_count ? item.data.access_count : '16' }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -116,21 +116,30 @@ const get_auto_data_list = async (new_content: any) => {
|
||||||
data_list.value = Array(4).fill(default_data_list);
|
data_list.value = Array(4).fill(default_data_list);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const data_type_is_change = ref(0);
|
||||||
|
watch(
|
||||||
|
() => data_type_is_change.value,
|
||||||
|
(newVal, oldValue) => {
|
||||||
|
if (newVal !== oldValue && String(newVal) === '1') {
|
||||||
|
get_auto_data_list(props.value?.content);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
watch(
|
watch(
|
||||||
props.value,
|
props.value,
|
||||||
(newVal, oldValue) => {
|
(newVal, oldValue) => {
|
||||||
const new_content = newVal?.content;
|
const new_content = newVal?.content;
|
||||||
const new_style = newVal?.style;
|
const new_style = newVal?.style;
|
||||||
// 内容
|
// 内容
|
||||||
if (new_content.data_type === '0') {
|
data_type_is_change.value = new_content.data_type;
|
||||||
|
if (String(new_content.data_type) === '0') {
|
||||||
if (!isEmpty(new_content.data_list)) {
|
if (!isEmpty(new_content.data_list)) {
|
||||||
data_list.value = new_content.data_list;
|
data_list.value = new_content.data_list;
|
||||||
data_list.value = cloneDeep(new_content.data_list);
|
data_list.value = cloneDeep(new_content.data_list);
|
||||||
} else {
|
} else {
|
||||||
data_list.value = Array(4).fill(default_data_list);
|
data_list.value = Array(4).fill(default_data_list);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
get_auto_data_list(new_content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
article_theme.value = new_content.theme;
|
article_theme.value = new_content.theme;
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,9 @@ const base_list = reactive({
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
||||||
const interval = setInterval(() => {
|
if (common_store.common.article_category.length > 0) {
|
||||||
if (common_store.common.article_category.length > 0) {
|
base_list.article_category_list = common_store.common.article_category;
|
||||||
base_list.article_category_list = common_store.common.article_category;
|
}
|
||||||
clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const theme_change = (val: any) => {
|
const theme_change = (val: any) => {
|
||||||
|
|
|
||||||
|
|
@ -145,12 +145,9 @@ const base_list = reactive({
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
||||||
const interval = setInterval(() => {
|
if (common_store.common.article_category.length > 0) {
|
||||||
if (common_store.common.article_category.length > 0) {
|
base_list.article_category_list = common_store.common.article_category;
|
||||||
base_list.article_category_list = common_store.common.article_category;
|
}
|
||||||
clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const article_theme_change = (val: any) => {
|
const article_theme_change = (val: any) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue