...
 
Commits (2)
    https://gitcode.net/ai100/ai100/-/commit/3ddc21eef7628cb7451708988639f0d32db1de52 🔨 tag type 2023-11-03T11:26:20+08:00 张峻 zhangjun@zhangjundeMacBook-Pro.local https://gitcode.net/ai100/ai100/-/commit/0a2347a48af511512ad04b3369344953902c9b6e 🔨 tag type 2023-11-03T11:26:34+08:00 张峻 zhangjun@zhangjundeMacBook-Pro.local
......@@ -38,7 +38,7 @@ export default {
update_doc_info: (params: RequestParams) =>
axios.post("admin/course/update_doc_info", params),
list_tags: (params: RequestParams) =>
axios.get("admin/course/list_tags", params),
axios.get("admin/course/list_tags", { params }),
admin_course_info: (params: RequestParams) =>
axios.get("admin/course/course_info", { params }),
......
......@@ -494,9 +494,10 @@ const videointe = () => {
});
};
// 获取标签
const getlabel = () => {
api.list_tags({}).then(({ data: res }) => {
console.log(res.data);
const getlabel = (type: any) => {
console.log(0);
api.list_tags({ type }).then(({ data: res }) => {
console.log("123", res.data);
labelData.value = res.data;
console.log(labelData.value);
});
......@@ -591,7 +592,7 @@ const openAddAlbum = ref(false);
const Release = ref(false);
const tipcon = ref("");
const addAlbum = () => {
getlabel();
getlabel("VIDEO_COLLECTION");
openAddAlbum.value = true;
isdetail.value = false;
};
......@@ -629,7 +630,7 @@ const delAlbum = (data: any, state: any) => {
// 视频资源 编辑button
const editvideo = (data: any) => {
getlabel();
getlabel("VIDEO");
console.log(data);
openResAlbum.value = true;
videoId.value = data.id;
......@@ -743,7 +744,7 @@ const colldetail = ref<any>();
const isdetail = ref<any>(false);
const editAlbum = (item: any) => {
sncollId.value = item.id;
getlabel();
getlabel("VIDEO_COLLECTION");
// console.log(toRaw(item));
if (item?.id) {
currentId.value = item.id;
......
......@@ -518,8 +518,8 @@ const changePageSize = (index: number) => {
};
// 获取标签
const getlabel = () => {
api.list_tags({}).then(({ data: res }) => {
const getlabel = (type: any) => {
api.list_tags({ type }).then(({ data: res }) => {
console.log(res.data);
labelData.value = res.data;
console.log(labelData.value);
......@@ -538,7 +538,7 @@ const gettext = (id: any) => {
};
// 点击编辑按钮
const edittext = (data: any) => {
getlabel();
getlabel("DOCUMENT");
openResAlbum.value = true;
console.log("数据", data);
documentId.value = data.id;
......@@ -606,7 +606,7 @@ const openAddAlbum = ref(false);
const Release = ref(false);
const tipcon = ref("");
const addAlbum = () => {
getlabel();
getlabel("DOCUMENT_COLLECTION");
openAddAlbum.value = true;
isdetail.value = false;
};
......@@ -739,7 +739,7 @@ const isdetail = ref<any>(false);
const editAlbum = (item: any) => {
sncollId.value = item.id;
// console.log(toRaw(item));
getlabel();
getlabel("DOCUMENT_COLLECTION");
if (item?.id) {
currentId.value = item.id;
}
......
......@@ -25,9 +25,9 @@
<!-- 文档专辑开始 -->
<div class="lg:p-0 p-4 w-full lg:mt-6 mt-0" v-if="cationflag == 0">
<h1 class="text-white text-lg">文档专辑</h1>
<div class="w-full" v-if="textlabel && textlabel.length > 0">
<div class="w-full" v-if="colltextlabel && colltextlabel.length > 0">
<tablist
:tablist="textlabel"
:tablist="colltextlabel"
:condition="true"
@getlabelid="getcolllabelid"
:isType="'textList'"
......@@ -294,13 +294,16 @@ const courSort = [
];
const textlabel = ref();
const colltextlabel = ref();
const getlabel = () => {
api.user_list_tags({}).then(({ data: res }) => {
console.log(res.data);
api.user_list_tags({ type: "DOCUMENT" }).then(({ data: res }) => {
textlabel.value = res.data;
textlabel.value.unshift({ id: "", name: "全部" });
});
api.user_list_tags({ type: "DOCUMENT_COLLECTION" }).then(({ data: res }) => {
colltextlabel.value = res.data;
colltextlabel.value.unshift({ id: 0, name: "全部" });
});
};
// 输入框搜索时触发
const changeData = debounce((item: any) => {
......
......@@ -25,9 +25,9 @@
<!-- 如意合集开始 -->
<div class="lg:p-0 p-4 w-full lg:mt-6 mt-0" v-if="cationflag == 0">
<h1 class="text-lg" :class="store.switchcheck ? 'text-black ' : 'text-white'">课程专辑</h1>
<div class="w-full" v-if="videolabel && videolabel.length > 0">
<div class="w-full" v-if="collvideolabel && collvideolabel.length > 0">
<tablist
:tablist="videolabel"
:tablist="collvideolabel"
:condition="true"
:isType="'videoList'"
@getlabelid="getcolllabelid"
......@@ -317,6 +317,7 @@ const tabsort = [
}
];
const videolabel = ref();
const collvideolabel = ref();
const courSort = [
{
value: false,
......@@ -327,13 +328,17 @@ const courSort = [
label: "观看次数"
}
];
const getlabel = () => {
api.user_list_tags({}).then(({ data: res }) => {
api.user_list_tags({ type: "VIDEO" }).then(({ data: res }) => {
console.log(res.data);
videolabel.value = res.data;
videolabel.value.unshift({ id: 0, name: "全部" });
});
api.user_list_tags({ type: "VIDEO_COLLECTION" }).then(({ data: res }) => {
console.log(res.data);
collvideolabel.value = res.data;
collvideolabel.value.unshift({ id: 0, name: "全部" });
});
};
// 判断是pc端还是移动端
const isMobile = () => {
......