update
This commit is contained in:
@@ -24,8 +24,14 @@ const menuItemClick = (e) => {
|
||||
<icon-apps></icon-apps>
|
||||
</template>
|
||||
<template #title>{{ item.title }}</template>
|
||||
<a-menu-item v-for="k in item.children.filter(v=>!v.meta.hidden)" :key="`/${item.path}/${k.path}`">
|
||||
{{ k.title }}
|
||||
<a-menu-item v-for="k in item.children.filter(v=>!v.meta.hidden)"
|
||||
:key="`/${item.path}/${k.path}`">
|
||||
<a-badge v-if="k.meta?.num>0" :count="k.meta.num" :offset="[20,5]">
|
||||
{{ k.title }}
|
||||
</a-badge>
|
||||
<template v-else>
|
||||
{{ k.title }}
|
||||
</template>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
</template>
|
||||
@@ -34,7 +40,12 @@ const menuItemClick = (e) => {
|
||||
<template #icon>
|
||||
<icon-apps></icon-apps>
|
||||
</template>
|
||||
{{ item.title }}
|
||||
<a-badge v-if="item.meta?.num>0" :count="item.meta.num" :offset="[20,5]">
|
||||
{{ item.title }}
|
||||
</a-badge>
|
||||
<template v-else>
|
||||
{{ item.title }}
|
||||
</template>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -4,6 +4,7 @@ import {reactive, ref, watch} from 'vue';
|
||||
import Api from "../../api/index.ts";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import Comment from "../Comment/index.vue";
|
||||
import Talk from "../Talk/index.vue";
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
const {id} = defineProps({
|
||||
@@ -57,31 +58,26 @@ const refuseTaskChildren = async () => {
|
||||
<a-form
|
||||
layout="vertical">
|
||||
<a-form-item label="标题">
|
||||
<a-input :model-value="item.title"></a-input>
|
||||
<a-input v-model:model-value="item.title" :disabled="detail.check_status !== 0"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="正文">
|
||||
<a-textarea
|
||||
auto-size
|
||||
:max-length="1000"
|
||||
show-word-limit
|
||||
:disabled="detail.check_status !== 0"
|
||||
:model-value="item.content">
|
||||
</a-textarea>
|
||||
</a-form-item>
|
||||
<a-form-item label="话题">
|
||||
<div v-if="item.tags_arr.length > 0" id="tag-list"
|
||||
class="w-full bg-[var(--color-neutral-2)] p-[4px]">
|
||||
<a-tag v-for="v in item.tags_arr">#{{ v }}</a-tag>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无话题
|
||||
</div>
|
||||
<Talk v-model:model-value="item.tags_arr" :disabled="detail.check_status !== 0"></Talk>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="素材">
|
||||
<div v-if="item.materia_arr.length > 0" class="flex flex-wrap gap-[16px]">
|
||||
<x-image
|
||||
v-for="(v, index) in item.materia_arr"
|
||||
:hide-delete="true"
|
||||
:hide-delete="detail.check_status !== 0"
|
||||
:key="index"
|
||||
width="60px"
|
||||
height="60px"
|
||||
@@ -89,17 +85,14 @@ const refuseTaskChildren = async () => {
|
||||
</x-image>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无话题
|
||||
暂无素材
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="评论区内容">
|
||||
<div v-if="item.comment.length > 0" class="flex flex-col gap-[8px] w-full">
|
||||
<div v-if="item?.comment?.length > 0" class="flex flex-col gap-[8px] w-full">
|
||||
<comment :data="item.comment" :hide-delete="true"></comment>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无评论区内容
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup>
|
||||
const {list, size} = defineProps({
|
||||
import {ref} from "vue";
|
||||
|
||||
const {list, size, preview} = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: []
|
||||
@@ -7,17 +9,27 @@ const {list, size} = defineProps({
|
||||
size: {
|
||||
type: String,
|
||||
default: "40px"
|
||||
},
|
||||
preview: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
});
|
||||
const previewVisible = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="x-image-small-list">
|
||||
<a-image :width="size" :height="size" :src="list[0]" v-bind="$attrs"></a-image>
|
||||
<div class="x-image-small-list-mask" v-if="list.length > 1">
|
||||
<div class="x-image-small-list-mask cursor-pointer" v-if="list.length > 1"
|
||||
@click="preview?previewVisible=true:null">
|
||||
+{{ list.length - 1 }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-image-preview-group v-model:visible="previewVisible">
|
||||
<a-image :width="size" :height="size" v-for="v in list" :src="v" v-bind="$attrs" v-show="false"></a-image>
|
||||
</a-image-preview-group>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
73
src/components/XSelect/XTagSelect.vue
Normal file
73
src/components/XSelect/XTagSelect.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<script setup>
|
||||
import {onMounted, reactive} from "vue";
|
||||
|
||||
const emits = defineEmits(['change']);
|
||||
const modelValue = defineModel();
|
||||
const {api, fieldName, apiPo, init, defaultValue} = defineProps({
|
||||
api: {
|
||||
type: Function,
|
||||
default: async () => {
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
apiPo: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
fieldName: {
|
||||
type: Object,
|
||||
default: {value: 'id', label: 'name'},
|
||||
},
|
||||
init: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
defaultValue: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const list = reactive([]);
|
||||
|
||||
const popupChange = async (visible) => {
|
||||
if (visible) {
|
||||
api && api(apiPo).then(({data}) => {
|
||||
list.length = 0;
|
||||
list.push(...data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (init) api && api(apiPo).then(({data}) => {
|
||||
list.length = 0;
|
||||
list.push(...data);
|
||||
});
|
||||
});
|
||||
|
||||
const handleSelect = (id) => {
|
||||
modelValue.value = id;
|
||||
emits('change');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-dropdown @select="handleSelect">
|
||||
<a-tag v-bind="$attrs" :color="list.find(v => v.id === modelValue)?.color">
|
||||
<div class="flex gap-[6px] items-center justify-center cursor-pointer">
|
||||
<div v-if="modelValue===null">请选择</div>
|
||||
<div v-else>{{ list.find(v => v.id === modelValue)?.name }}</div>
|
||||
<icon-down/>
|
||||
</div>
|
||||
</a-tag>
|
||||
<template v-slot:content>
|
||||
<a-doption v-for="v in list" :key="v.id" :value="v.id">
|
||||
{{ v.name }}
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -23,8 +23,8 @@ const status = computed({
|
||||
},
|
||||
})
|
||||
|
||||
const change = async () => {
|
||||
const {msg} = await api(id);
|
||||
const change = async (e) => {
|
||||
const {msg} = await api(id, Number(e));
|
||||
Message.success(msg);
|
||||
emits('change');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user