update
This commit is contained in:
@@ -407,7 +407,14 @@ const system = {
|
||||
setExchangeTop: async (data) => {
|
||||
return request({
|
||||
method: MethodsENUM.POST,
|
||||
url: "/task/setExchangeTop",
|
||||
url: "/task/setChildrenTop",
|
||||
data: data
|
||||
});
|
||||
},
|
||||
setChildrenRead: async (data) => {
|
||||
return request({
|
||||
method: MethodsENUM.POST,
|
||||
url: "/task/setChildrenRead",
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
@@ -25,29 +25,39 @@ const {contextRow, type, data} = defineProps({
|
||||
});
|
||||
|
||||
const itemList = computed(() => {
|
||||
const tp = SystemStore.message.find(v => v.id === data.id);
|
||||
const list = type === 0 ? [
|
||||
{text: '置顶', type: 1, hide: data.is_top === 1},
|
||||
{text: '取消置顶', type: 0, hide: data.is_top === 0},
|
||||
{text: '标记已读', type: 0, hide: data.is_read === 0},
|
||||
{text: '标记未读', type: 1, hide: data.is_read === 1},
|
||||
{text: '标记已读', type: 1, hide: data.is_read === 0},
|
||||
{text: '标记未读', type: 0, hide: data.is_read > 0},
|
||||
] : [
|
||||
{text: '标记已读', type: 0, hide: data.is_read === 0},
|
||||
{text: '标记未读', type: 1, hide: data.is_read === 1},
|
||||
{text: '标记已读', type: 0, hide: tp.is_read},
|
||||
{text: '标记未读', type: 1, hide: !tp.is_read},
|
||||
]
|
||||
return list.filter(v => !v.hide);
|
||||
})
|
||||
|
||||
const selectActionsheet = async (e) => {
|
||||
if (type === 0) {
|
||||
if (e.text === '置顶' || e.text === '取消置顶') {
|
||||
const {msg} = await Api.system.setExchangeTop({
|
||||
id: data.id,
|
||||
type: e.type,
|
||||
});
|
||||
showToast(msg);
|
||||
emits('success');
|
||||
} else {
|
||||
if (type === 0) {
|
||||
const {msg} = await Api.system.setChildrenRead({
|
||||
id: data.id,
|
||||
type: e.type,
|
||||
});
|
||||
showToast(msg);
|
||||
emits('success');
|
||||
} else {
|
||||
const index = SystemStore.message.findIndex(v => v.id === data.id);
|
||||
SystemStore.message[index].is_read = true;
|
||||
SystemStore.message[index].is_read = !SystemStore.message[index].is_read;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +85,7 @@ onMounted(() => {
|
||||
class="!py-[30rpx] !px-[24rpx] bg-[#fff] rounded-[8rpx] !flex items-center gap-[20rpx] overflow-hidden relative !mb-[20rpx]">
|
||||
<view class="relative">
|
||||
<image class="!size-[72rpx] flex-shrink-0" mode="aspectFill" :src="messageIcon"></image>
|
||||
<view v-if="type === 0 ? data.is_read===0 : !SystemStore.message.find(v => v.id===data.id).is_read"
|
||||
<view v-if="type === 0 ? data.is_read>0 : !SystemStore.message.find(v => v.id===data.id).is_read"
|
||||
class="size-[20rpx] bg-[#f00] absolute right-0 top-0 rounded-[50%]"></view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ const emits = defineEmits(['success']);
|
||||
const show = ref(false);
|
||||
|
||||
const success = (e) => {
|
||||
show.value = false;
|
||||
emits('success', e);
|
||||
}
|
||||
</script>
|
||||
@@ -19,7 +20,6 @@ const success = (e) => {
|
||||
:show="show"
|
||||
@click="success"
|
||||
@cancel="show=false">
|
||||
|
||||
</tui-actionsheet>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,23 +1,40 @@
|
||||
<script setup>
|
||||
const visible = defineModel('visible');
|
||||
const model = defineModel('model');
|
||||
const emits = defineEmits(['success']);
|
||||
const emits = defineEmits(['success', 'init']);
|
||||
import {watch, ref} from "vue";
|
||||
|
||||
const XFilterRef = ref();
|
||||
const init = () => {
|
||||
Object.keys(model.value).forEach(key => {
|
||||
model.value[key] = null;
|
||||
});
|
||||
success();
|
||||
emits('init');
|
||||
}
|
||||
|
||||
const success = () => {
|
||||
visible.value = false;
|
||||
emits('success');
|
||||
}
|
||||
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
const node = XFilterRef.value.$el.nextElementSibling.childNodes[2];
|
||||
if (val) {
|
||||
node.style.transform = 'none';
|
||||
} else {
|
||||
node.style.transform = 'translate3d(0, -100%, 0)';
|
||||
}
|
||||
},
|
||||
{deep: true}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<tui-drawer
|
||||
ref="XFilterRef"
|
||||
mode="top"
|
||||
maskZIndex="999"
|
||||
zIndex="999"
|
||||
|
||||
@@ -29,6 +29,7 @@ const vo = reactive({
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
api: Api.system.getMessageCenter,
|
||||
uuid: true,
|
||||
parameter: po,
|
||||
callback: (data) => {
|
||||
Object.assign(vo, data);
|
||||
|
||||
@@ -55,14 +55,14 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
|
||||
<view class="px-[24rpx] py-[16rpx] bg-[#fff] rounded-[8rpx]" v-if="v.pattern===1">
|
||||
<view v-html="v.content"></view>
|
||||
<view v-if="v.image_arr.length > 0" class="!flex flex-wrap gap-2">
|
||||
<x-image v-for="v in v.image_arr" :src="v"
|
||||
<x-image v-for="(v, index) in v.image_arr" :cur="index" :src="v"
|
||||
style="width: 80rpx;height: 80rpx"></x-image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="px-[24rpx] py-[16rpx] bg-[#fff] rounded-[8rpx] test-24r text-[#4E5969]" v-else>
|
||||
<view v-html="v.content"></view>
|
||||
<view v-if="v.image_arr.length > 0" class="!flex flex-wrap gap-2 justify-end">
|
||||
<x-image v-for="k in v.image_arr" :src="k" :list="v.image_arr"
|
||||
<x-image v-for="(k, index) in v.image_arr" :cur="index" :src="k" :list="v.image_arr"
|
||||
style="width: 70rpx;height: 70rpx"></x-image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -29,6 +29,11 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
Object.assign(vo, data);
|
||||
}
|
||||
});
|
||||
|
||||
const init = () => {
|
||||
sumPo.type = 0;
|
||||
sumPo.datetime = dayjs().format('YYYY-MM');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -36,6 +41,7 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
<x-nav></x-nav>
|
||||
|
||||
<x-filter
|
||||
@init="init"
|
||||
@success="initFetchData"
|
||||
v-model:model="sumPo"
|
||||
v-model:visible="showFilter">
|
||||
@@ -73,7 +79,7 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
|
||||
<scroll-view
|
||||
@refresherpulling="initFetchData()"
|
||||
@scrolltolower="pagination.current++"
|
||||
@scrolltolower="pagination.page++"
|
||||
scroll-y
|
||||
class="h-[calc(100vh-200rpx)]">
|
||||
<view class="p-[20rpx]" v-for="item in vo.rows" :key="item.id">
|
||||
|
||||
Reference in New Issue
Block a user