|
@@ -52,6 +52,27 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #menuId>
|
|
|
+ <el-form-item prop="menuId">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.data.columnId"
|
|
|
+ :rule="rules.columnId"
|
|
|
+ placeholder="请选择菜单"
|
|
|
+ no-data-text="无数据,请到栏目菜单添加"
|
|
|
+ @change="(val) => getArticleListSelect(val)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in columnListData"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
@@ -68,12 +89,13 @@ import byTable from "@/components/byTable/index.vue";
|
|
|
import byForm from "@/components/byForm/index.vue";
|
|
|
import { computed, ref } from "vue";
|
|
|
import {getDictOneByXmhjc, getFileList, getFileStr} from "@/api/XMHJC/common";
|
|
|
-import {findColumnArticleList} from "@/api/XMHJC/column";
|
|
|
+import {findColumnArticleList, findMenuListByOpen} from "@/api/XMHJC/column";
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const enableStatus = ref([]);
|
|
|
const carouselModules = ref([]);
|
|
|
const articleList = ref([]);
|
|
|
+const columnListData = ref([]);
|
|
|
const targetType = ref([]);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
@@ -233,6 +255,13 @@ const formConfig = computed(() => {
|
|
|
isShow: formData.data.targetType == 2,
|
|
|
},
|
|
|
{
|
|
|
+ type: "slot",
|
|
|
+ slotName: "menuId",
|
|
|
+ prop: "menuId",
|
|
|
+ label: "菜单",
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "跳转文章",
|
|
|
prop: "articleId",
|
|
|
type: "select",
|
|
@@ -364,12 +393,21 @@ const getDictlist = async () => {
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
+
|
|
|
//获取文章列表
|
|
|
-const getArticleList = async () => {
|
|
|
+const getArticleListSelect = async (value) => {
|
|
|
+ formData.data.articleId = ""
|
|
|
+ await getArticleList(value)
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+//获取文章列表
|
|
|
+const getArticleList = async (value) => {
|
|
|
const res = await findColumnArticleList({
|
|
|
pageNum: 1,
|
|
|
pageSize: 99999,
|
|
|
status: 1,
|
|
|
+ columnId: value,
|
|
|
});
|
|
|
articleList.value = res.data.rows.map((x) => ({
|
|
|
label: x.title,
|
|
@@ -400,9 +438,14 @@ const carouselUrlSuccess = (response, uploadFile) => {
|
|
|
formData.data.carouselUrl = uploadFile.raw.fileUrl;
|
|
|
};
|
|
|
|
|
|
+const getMenuList = async () => {
|
|
|
+ const res = await findMenuListByOpen({})
|
|
|
+ columnListData.value = res.data
|
|
|
+};
|
|
|
+
|
|
|
+getMenuList()
|
|
|
getList();
|
|
|
getDictlist();
|
|
|
-getArticleList();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|