|
@@ -1,5 +1,11 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
+ <el-form-item>
|
|
|
+ <div class="back-btn" @click="goBack">
|
|
|
+ <el-icon><Back /></el-icon>
|
|
|
+ 返回上一级
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
<div v-show="!dialog.visible">
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
<div v-show="showSearch">
|
|
@@ -14,7 +20,7 @@
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="专题:" prop="status">
|
|
|
<el-select v-model="queryParams.topicName" placeholder="请选择" clearable>
|
|
|
- <el-option label="暂无数据" value="" />
|
|
|
+ <el-option v-for="dict in topic_type" :key="dict.value" :label="dict.value">{{ dict.label }}</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -54,7 +60,7 @@
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
:default-expand-all="isExpandAll"
|
|
|
>
|
|
|
- <el-table-column prop="menuName" align="center" label="菜单名称" :show-overflow-tooltip="true"> </el-table-column>
|
|
|
+ <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true"> </el-table-column>
|
|
|
<el-table-column prop="menuType" label="菜单类型" align="center">
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="menu_type" :value="scope.row.menuType" />
|
|
@@ -116,7 +122,15 @@
|
|
|
<el-col v-if="form.menuType !== 'F'" :span="24">
|
|
|
<el-form-item label="菜单图标:" prop="icon">
|
|
|
<!-- 图标选择器 -->
|
|
|
- <icon-select v-model="form.icon" />
|
|
|
+<!-- <icon-select v-model="form.icon" />-->
|
|
|
+ <FileUpload
|
|
|
+ v-model="form.icon"
|
|
|
+ :file-type="['jpg', 'jpeg', 'png']"
|
|
|
+ :limit="1"
|
|
|
+ :file-size="5"
|
|
|
+ class="upload-box"
|
|
|
+ @change="menuFormRef.validateField('fileList')"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-if="form.menuType !== 'F'" :span="24">
|
|
@@ -137,28 +151,11 @@
|
|
|
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-<!-- <el-col v-if="form.menuType !== 'F'" :span="12">-->
|
|
|
-<!-- <el-form-item>-->
|
|
|
-<!-- <template #label>-->
|
|
|
-<!-- <span>-->
|
|
|
-<!-- <el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">-->
|
|
|
-<!-- <el-icon>-->
|
|
|
-<!-- <question-filled />-->
|
|
|
-<!-- </el-icon> </el-tooltip-->
|
|
|
-<!-- >是否外链:-->
|
|
|
-<!-- </span>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- <el-radio-group v-model="form.isFrame">-->
|
|
|
-<!-- <el-radio label="0">是</el-radio>-->
|
|
|
-<!-- <el-radio label="1">否</el-radio>-->
|
|
|
-<!-- </el-radio-group>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
<el-col v-if="form.menuType !== 'F'" :span="12">
|
|
|
<el-form-item v-if="form.menuType === 'C'" prop="path" style="width: 500px">
|
|
|
<template #label>
|
|
|
<span>
|
|
|
- <el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
|
|
|
+ <el-tooltip content="选择新增内容的展示类型,是在地图内定位打点或者是地图侧边的弹出框" placement="top">
|
|
|
<el-icon>
|
|
|
<question-filled />
|
|
|
</el-icon>
|
|
@@ -217,38 +214,20 @@
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if="form.menuType === 'C'" :span="12">
|
|
|
- <el-form-item>
|
|
|
- <template #label>
|
|
|
- <span>
|
|
|
- <el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
|
|
- <el-icon>
|
|
|
- <question-filled />
|
|
|
- </el-icon>
|
|
|
- </el-tooltip>
|
|
|
- 是否缓存:
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- <el-radio-group v-model="form.isCache">
|
|
|
- <el-radio label="0">缓存</el-radio>
|
|
|
- <el-radio label="1">不缓存</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col v-if="form.menuType !== 'F'" :span="12">
|
|
|
<el-form-item>
|
|
|
<template #label>
|
|
|
<span>
|
|
|
- <el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
|
|
+ <el-tooltip content="选择不上架则不在地图中展示" placement="top">
|
|
|
<el-icon>
|
|
|
<question-filled />
|
|
|
</el-icon>
|
|
|
</el-tooltip>
|
|
|
- 显示状态:
|
|
|
+ 上架状态:
|
|
|
</span>
|
|
|
</template>
|
|
|
<el-radio-group v-model="form.visible">
|
|
|
- <el-radio v-for="dict in sys_show_hide" :key="dict.value" :label="dict.value">{{ dict.label }} </el-radio>
|
|
|
+ <el-radio v-for="dict in listing_status" :key="dict.value" :label="dict.value">{{ dict.label }} </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -297,6 +276,11 @@ import {
|
|
|
} from '@/api/globalMap/layerConfig';
|
|
|
import { MenuForm, MenuQuery, MenuVO } from '@/api/globalMap/layerConfig/types';
|
|
|
import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
|
|
|
+import { ref, onMounted, toRefs, ComponentInternalInstance, reactive, getCurrentInstance } from 'vue';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import { addInformation, getTemplateList } from '@/api/informationissue/informationissue';
|
|
|
+import TopicPage from '@/views/globalMap/topicPage.vue';
|
|
|
+import { Back } from '@element-plus/icons-vue';
|
|
|
|
|
|
interface MenuOptionsType {
|
|
|
menuId: number;
|
|
@@ -304,9 +288,9 @@ interface MenuOptionsType {
|
|
|
children: MenuOptionsType[] | undefined;
|
|
|
}
|
|
|
|
|
|
-import { ref, onMounted } from 'vue';
|
|
|
-import { ElMessage } from 'element-plus';
|
|
|
-import { addInformation, getTemplateList } from '@/api/informationissue/informationissue';
|
|
|
+const props = defineProps({
|
|
|
+ id: String
|
|
|
+});
|
|
|
|
|
|
const templateOptions = ref([
|
|
|
{ value: 'template1', label: '图层分析一' },
|
|
@@ -321,9 +305,10 @@ const typeOptions = ref([
|
|
|
]);
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { sys_show_hide, sys_normal_disable, topic_name, menu_type } = toRefs<any>(
|
|
|
- proxy?.useDict('sys_show_hide', 'sys_normal_disable', 'topic_name', 'menu_type')
|
|
|
+const { sys_show_hide, sys_normal_disable, topic_name, menu_type, listing_status, topic_type } = toRefs<any>(
|
|
|
+ proxy?.useDict('sys_show_hide', 'sys_normal_disable', 'topic_name', 'menu_type', 'listing_status', 'topic_type')
|
|
|
);
|
|
|
+
|
|
|
const menuList = ref<MenuVO[]>([]);
|
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
@@ -362,12 +347,12 @@ const data = reactive<PageData<MenuForm, MenuQuery>>({
|
|
|
path: [{ required: true, message: '路由地址不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+const emits = defineEmits(['close']);
|
|
|
const menuTableRef = ref<ElTableInstance>();
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs<PageData<MenuForm, MenuQuery>>(data);
|
|
|
/** 查询菜单列表 */
|
|
|
-const getList = async () => {
|
|
|
+const getList = async (id) => {
|
|
|
loading.value = true;
|
|
|
const res = await LayerlistMenu(queryParams.value);
|
|
|
const data = proxy?.handleTree<MenuVO>(res.data, 'menuId');
|
|
@@ -397,7 +382,7 @@ const reset = () => {
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
const handleQuery = () => {
|
|
|
- getList();
|
|
|
+ getList(props.id);
|
|
|
};
|
|
|
/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
@@ -443,7 +428,7 @@ const submitForm = () => {
|
|
|
form.value.menuId ? await updateLayerMenu(form.value) : await addLayerMenu(form.value);
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
dialog.visible = false;
|
|
|
- await getList();
|
|
|
+ await getList(props.id);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -451,11 +436,14 @@ const submitForm = () => {
|
|
|
const handleDelete = async (row: MenuVO) => {
|
|
|
await proxy?.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?');
|
|
|
await delLayerMenu(row.menuId);
|
|
|
- await getList();
|
|
|
+ await getList(props.id);
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
};
|
|
|
+const goBack = () => {
|
|
|
+ emits('close');
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getList();
|
|
|
+ getList(props.id);
|
|
|
});
|
|
|
</script>
|