系统菜单部分功能及planToAdd文件中的config.ts文件修改
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { get } from 'lodash-es';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
/***
|
||||
*配置接口 格式 module:Array<resource>
|
||||
*/
|
||||
export const apiModule = {
|
||||
parking: ['User', 'CurrentUser', 'Organizational'],
|
||||
};
|
||||
export const BASE_URL = '/carbon-smart';
|
||||
interface dictHttpConfig {
|
||||
api?: string;
|
||||
keyField?: string;
|
||||
params: object;
|
||||
transform?: Function;
|
||||
}
|
||||
7
hx-op/src/api/menuSystem.ts
Normal file
7
hx-op/src/api/menuSystem.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { BASE_URL } from './index';
|
||||
export enum menuS {
|
||||
queryMenuPage = `${BASE_URL}/hxPermissionInfo/getPermissionTree`, // 菜单列表
|
||||
queryMenuPageAdd = `${BASE_URL}/hxPermissionInfo/addPermission`, // 菜单添加
|
||||
queryMenuPageEdit = `${BASE_URL}/hxPermissionInfo/updatePermission`,//菜单编辑
|
||||
queryMenuPageDel = `${BASE_URL}/hxPermissionInfo/deletePermission`,//菜单删除
|
||||
}
|
||||
104
hx-op/src/components/icon/IconPicker.vue
Normal file
104
hx-op/src/components/icon/IconPicker.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<a-modal :bodyStyle="{ padding: '24px'}" :visible="iconOpen" :width="800" @ok="iconHandleOk(iconChecked)" @cancel="closeOpenIcon" title="选择图标">
|
||||
<a-input
|
||||
v-model:value="searchValue"
|
||||
placeholder="请输入英文关键词进行搜索"
|
||||
@change="filterIcon"
|
||||
/>
|
||||
<div class="icon-box">
|
||||
<div
|
||||
v-for="(item,index) in iconArr"
|
||||
:key="index"
|
||||
@click="sendData(item)"
|
||||
class="icon-content"
|
||||
:style="{ background: iconChecked === item ? '#1890ff' : ''}"
|
||||
>
|
||||
<component :is="$icons[item]" />
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch,defineProps} from 'vue';
|
||||
import { NsMessage } from '/nerv-lib/saas';
|
||||
import icons from './icons.json';
|
||||
const props = defineProps(['iconHandleOk']);
|
||||
const iconArr = ref<string[]>(icons);
|
||||
const searchValue = ref('');
|
||||
const iconOpen = ref<boolean>(false);
|
||||
const iconChecked =ref('');//选中数据
|
||||
/**
|
||||
* 进行搜索过滤
|
||||
*/
|
||||
const filterIcon = () => {
|
||||
if (searchValue.value){
|
||||
iconArr.value = icons.filter(item => item.toLowerCase().includes(searchValue.value.toLowerCase()) )
|
||||
}else{
|
||||
iconArr.value = icons;
|
||||
}
|
||||
}
|
||||
watch(iconOpen,()=>{
|
||||
searchValue.value = ''
|
||||
iconArr.value = icons;
|
||||
})
|
||||
const sendData = (data:any) => {
|
||||
iconChecked.value = data;
|
||||
}
|
||||
const iconHandleOk = (e: MouseEvent) => {
|
||||
if(!iconChecked.value){
|
||||
NsMessage.error('请选择图标');
|
||||
return;
|
||||
}else{
|
||||
props.iconHandleOk(iconChecked.value);//调用父组件传递来的函数
|
||||
iconOpen.value = false;
|
||||
iconChecked.value = '';
|
||||
}
|
||||
};
|
||||
// 关闭图标选择弹窗
|
||||
const closeOpenIcon = () => {
|
||||
iconOpen.value = false;
|
||||
iconChecked.value = '';
|
||||
};
|
||||
// 暴露给父组件
|
||||
const isIconOpenToggle = (data:any)=>{
|
||||
if(data){
|
||||
iconChecked.value = data;//记住上一次选择的数据
|
||||
}
|
||||
iconOpen.value = true;
|
||||
}
|
||||
const isIconData = ()=>{
|
||||
if(!iconChecked.value){
|
||||
NsMessage.warn('请先选择图标');
|
||||
iconOpen.value = true;
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
isIconOpenToggle,
|
||||
isIconData
|
||||
})
|
||||
|
||||
</script>
|
||||
<style lang="less">
|
||||
.icon-box{
|
||||
overflow: auto;
|
||||
font-size: 20px;
|
||||
width: 100%;
|
||||
height: 280px;
|
||||
padding-top:10px;
|
||||
}
|
||||
|
||||
.icon-content{
|
||||
width: 45px;
|
||||
height: 40px;
|
||||
margin: 6px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.icon-content:hover{
|
||||
background: rgba(26, 144, 255,.3);
|
||||
}
|
||||
</style>
|
||||
790
hx-op/src/components/icon/icons.json
Normal file
790
hx-op/src/components/icon/icons.json
Normal file
@@ -0,0 +1,790 @@
|
||||
[
|
||||
"AccountBookFilled",
|
||||
"AccountBookOutlined",
|
||||
"AccountBookTwoTone",
|
||||
"AimOutlined",
|
||||
"AlertFilled",
|
||||
"AlertOutlined",
|
||||
"AlertTwoTone",
|
||||
"AlibabaOutlined",
|
||||
"AlignCenterOutlined",
|
||||
"AlignLeftOutlined",
|
||||
"AlignRightOutlined",
|
||||
"AlipayCircleFilled",
|
||||
"AlipayCircleOutlined",
|
||||
"AlipayOutlined",
|
||||
"AlipaySquareFilled",
|
||||
"AliwangwangFilled",
|
||||
"AliwangwangOutlined",
|
||||
"AliyunOutlined",
|
||||
"AmazonCircleFilled",
|
||||
"AmazonOutlined",
|
||||
"AmazonSquareFilled",
|
||||
"AndroidFilled",
|
||||
"AndroidOutlined",
|
||||
"AntCloudOutlined",
|
||||
"AntDesignOutlined",
|
||||
"ApartmentOutlined",
|
||||
"ApiFilled",
|
||||
"ApiOutlined",
|
||||
"ApiTwoTone",
|
||||
"AppleFilled",
|
||||
"AppleOutlined",
|
||||
"AppstoreAddOutlined",
|
||||
"AppstoreFilled",
|
||||
"AppstoreOutlined",
|
||||
"AppstoreTwoTone",
|
||||
"AreaChartOutlined",
|
||||
"ArrowDownOutlined",
|
||||
"ArrowLeftOutlined",
|
||||
"ArrowRightOutlined",
|
||||
"ArrowUpOutlined",
|
||||
"ArrowsAltOutlined",
|
||||
"AudioFilled",
|
||||
"AudioMutedOutlined",
|
||||
"AudioOutlined",
|
||||
"AudioTwoTone",
|
||||
"AuditOutlined",
|
||||
"BackwardFilled",
|
||||
"BackwardOutlined",
|
||||
"BankFilled",
|
||||
"BankOutlined",
|
||||
"BankTwoTone",
|
||||
"BarChartOutlined",
|
||||
"BarcodeOutlined",
|
||||
"BarsOutlined",
|
||||
"BehanceCircleFilled",
|
||||
"BehanceOutlined",
|
||||
"BehanceSquareFilled",
|
||||
"BehanceSquareOutlined",
|
||||
"BellFilled",
|
||||
"BellOutlined",
|
||||
"BellTwoTone",
|
||||
"BgColorsOutlined",
|
||||
"BlockOutlined",
|
||||
"BoldOutlined",
|
||||
"BookFilled",
|
||||
"BookOutlined",
|
||||
"BookTwoTone",
|
||||
"BorderBottomOutlined",
|
||||
"BorderHorizontalOutlined",
|
||||
"BorderInnerOutlined",
|
||||
"BorderLeftOutlined",
|
||||
"BorderOuterOutlined",
|
||||
"BorderOutlined",
|
||||
"BorderRightOutlined",
|
||||
"BorderTopOutlined",
|
||||
"BorderVerticleOutlined",
|
||||
"BorderlessTableOutlined",
|
||||
"BoxPlotFilled",
|
||||
"BoxPlotOutlined",
|
||||
"BoxPlotTwoTone",
|
||||
"BranchesOutlined",
|
||||
"BugFilled",
|
||||
"BugOutlined",
|
||||
"BugTwoTone",
|
||||
"BuildFilled",
|
||||
"BuildOutlined",
|
||||
"BuildTwoTone",
|
||||
"BulbFilled",
|
||||
"BulbOutlined",
|
||||
"BulbTwoTone",
|
||||
"CalculatorFilled",
|
||||
"CalculatorOutlined",
|
||||
"CalculatorTwoTone",
|
||||
"CalendarFilled",
|
||||
"CalendarOutlined",
|
||||
"CalendarTwoTone",
|
||||
"CameraFilled",
|
||||
"CameraOutlined",
|
||||
"CameraTwoTone",
|
||||
"CarFilled",
|
||||
"CarOutlined",
|
||||
"CarTwoTone",
|
||||
"CaretDownFilled",
|
||||
"CaretDownOutlined",
|
||||
"CaretLeftFilled",
|
||||
"CaretLeftOutlined",
|
||||
"CaretRightFilled",
|
||||
"CaretRightOutlined",
|
||||
"CaretUpFilled",
|
||||
"CaretUpOutlined",
|
||||
"CarryOutFilled",
|
||||
"CarryOutOutlined",
|
||||
"CarryOutTwoTone",
|
||||
"CheckCircleFilled",
|
||||
"CheckCircleOutlined",
|
||||
"CheckCircleTwoTone",
|
||||
"CheckOutlined",
|
||||
"CheckSquareFilled",
|
||||
"CheckSquareOutlined",
|
||||
"CheckSquareTwoTone",
|
||||
"ChromeFilled",
|
||||
"ChromeOutlined",
|
||||
"CiCircleFilled",
|
||||
"CiCircleOutlined",
|
||||
"CiCircleTwoTone",
|
||||
"CiOutlined",
|
||||
"CiTwoTone",
|
||||
"ClearOutlined",
|
||||
"ClockCircleFilled",
|
||||
"ClockCircleOutlined",
|
||||
"ClockCircleTwoTone",
|
||||
"CloseCircleFilled",
|
||||
"CloseCircleOutlined",
|
||||
"CloseCircleTwoTone",
|
||||
"CloseOutlined",
|
||||
"CloseSquareFilled",
|
||||
"CloseSquareOutlined",
|
||||
"CloseSquareTwoTone",
|
||||
"CloudDownloadOutlined",
|
||||
"CloudFilled",
|
||||
"CloudOutlined",
|
||||
"CloudServerOutlined",
|
||||
"CloudSyncOutlined",
|
||||
"CloudTwoTone",
|
||||
"CloudUploadOutlined",
|
||||
"ClusterOutlined",
|
||||
"CodeFilled",
|
||||
"CodeOutlined",
|
||||
"CodeSandboxCircleFilled",
|
||||
"CodeSandboxOutlined",
|
||||
"CodeSandboxSquareFilled",
|
||||
"CodeTwoTone",
|
||||
"CodepenCircleFilled",
|
||||
"CodepenCircleOutlined",
|
||||
"CodepenOutlined",
|
||||
"CodepenSquareFilled",
|
||||
"CoffeeOutlined",
|
||||
"ColumnHeightOutlined",
|
||||
"ColumnWidthOutlined",
|
||||
"CommentOutlined",
|
||||
"CompassFilled",
|
||||
"CompassOutlined",
|
||||
"CompassTwoTone",
|
||||
"CompressOutlined",
|
||||
"ConsoleSqlOutlined",
|
||||
"ContactsFilled",
|
||||
"ContactsOutlined",
|
||||
"ContactsTwoTone",
|
||||
"ContainerFilled",
|
||||
"ContainerOutlined",
|
||||
"ContainerTwoTone",
|
||||
"ControlFilled",
|
||||
"ControlOutlined",
|
||||
"ControlTwoTone",
|
||||
"CopyFilled",
|
||||
"CopyOutlined",
|
||||
"CopyTwoTone",
|
||||
"CopyrightCircleFilled",
|
||||
"CopyrightCircleOutlined",
|
||||
"CopyrightCircleTwoTone",
|
||||
"CopyrightOutlined",
|
||||
"CopyrightTwoTone",
|
||||
"CreditCardFilled",
|
||||
"CreditCardOutlined",
|
||||
"CreditCardTwoTone",
|
||||
"CrownFilled",
|
||||
"CrownOutlined",
|
||||
"CrownTwoTone",
|
||||
"CustomerServiceFilled",
|
||||
"CustomerServiceOutlined",
|
||||
"CustomerServiceTwoTone",
|
||||
"DashOutlined",
|
||||
"DashboardFilled",
|
||||
"DashboardOutlined",
|
||||
"DashboardTwoTone",
|
||||
"DatabaseFilled",
|
||||
"DatabaseOutlined",
|
||||
"DatabaseTwoTone",
|
||||
"DeleteColumnOutlined",
|
||||
"DeleteFilled",
|
||||
"DeleteOutlined",
|
||||
"DeleteRowOutlined",
|
||||
"DeleteTwoTone",
|
||||
"DeliveredProcedureOutlined",
|
||||
"DeploymentUnitOutlined",
|
||||
"DesktopOutlined",
|
||||
"DiffFilled",
|
||||
"DiffOutlined",
|
||||
"DiffTwoTone",
|
||||
"DingdingOutlined",
|
||||
"DingtalkCircleFilled",
|
||||
"DingtalkOutlined",
|
||||
"DingtalkSquareFilled",
|
||||
"DisconnectOutlined",
|
||||
"DislikeFilled",
|
||||
"DislikeOutlined",
|
||||
"DislikeTwoTone",
|
||||
"DollarCircleFilled",
|
||||
"DollarCircleOutlined",
|
||||
"DollarCircleTwoTone",
|
||||
"DollarOutlined",
|
||||
"DollarTwoTone",
|
||||
"DotChartOutlined",
|
||||
"DoubleLeftOutlined",
|
||||
"DoubleRightOutlined",
|
||||
"DownCircleFilled",
|
||||
"DownCircleOutlined",
|
||||
"DownCircleTwoTone",
|
||||
"DownOutlined",
|
||||
"DownSquareFilled",
|
||||
"DownSquareOutlined",
|
||||
"DownSquareTwoTone",
|
||||
"DownloadOutlined",
|
||||
"DragOutlined",
|
||||
"DribbbleCircleFilled",
|
||||
"DribbbleOutlined",
|
||||
"DribbbleSquareFilled",
|
||||
"DribbbleSquareOutlined",
|
||||
"DropboxCircleFilled",
|
||||
"DropboxOutlined",
|
||||
"DropboxSquareFilled",
|
||||
"EditFilled",
|
||||
"EditOutlined",
|
||||
"EditTwoTone",
|
||||
"EllipsisOutlined",
|
||||
"EnterOutlined",
|
||||
"EnvironmentFilled",
|
||||
"EnvironmentOutlined",
|
||||
"EnvironmentTwoTone",
|
||||
"EuroCircleFilled",
|
||||
"EuroCircleOutlined",
|
||||
"EuroCircleTwoTone",
|
||||
"EuroOutlined",
|
||||
"EuroTwoTone",
|
||||
"ExceptionOutlined",
|
||||
"ExclamationCircleFilled",
|
||||
"ExclamationCircleOutlined",
|
||||
"ExclamationCircleTwoTone",
|
||||
"ExclamationOutlined",
|
||||
"ExpandAltOutlined",
|
||||
"ExpandOutlined",
|
||||
"ExperimentFilled",
|
||||
"ExperimentOutlined",
|
||||
"ExperimentTwoTone",
|
||||
"ExportOutlined",
|
||||
"EyeFilled",
|
||||
"EyeInvisibleFilled",
|
||||
"EyeInvisibleOutlined",
|
||||
"EyeInvisibleTwoTone",
|
||||
"EyeOutlined",
|
||||
"EyeTwoTone",
|
||||
"FacebookFilled",
|
||||
"FacebookOutlined",
|
||||
"FallOutlined",
|
||||
"FastBackwardFilled",
|
||||
"FastBackwardOutlined",
|
||||
"FastForwardFilled",
|
||||
"FastForwardOutlined",
|
||||
"FieldBinaryOutlined",
|
||||
"FieldNumberOutlined",
|
||||
"FieldStringOutlined",
|
||||
"FieldTimeOutlined",
|
||||
"FileAddFilled",
|
||||
"FileAddOutlined",
|
||||
"FileAddTwoTone",
|
||||
"FileDoneOutlined",
|
||||
"FileExcelFilled",
|
||||
"FileExcelOutlined",
|
||||
"FileExcelTwoTone",
|
||||
"FileExclamationFilled",
|
||||
"FileExclamationOutlined",
|
||||
"FileExclamationTwoTone",
|
||||
"FileFilled",
|
||||
"FileGifOutlined",
|
||||
"FileImageFilled",
|
||||
"FileImageOutlined",
|
||||
"FileImageTwoTone",
|
||||
"FileJpgOutlined",
|
||||
"FileMarkdownFilled",
|
||||
"FileMarkdownOutlined",
|
||||
"FileMarkdownTwoTone",
|
||||
"FileOutlined",
|
||||
"FilePdfFilled",
|
||||
"FilePdfOutlined",
|
||||
"FilePdfTwoTone",
|
||||
"FilePptFilled",
|
||||
"FilePptOutlined",
|
||||
"FilePptTwoTone",
|
||||
"FileProtectOutlined",
|
||||
"FileSearchOutlined",
|
||||
"FileSyncOutlined",
|
||||
"FileTextFilled",
|
||||
"FileTextOutlined",
|
||||
"FileTextTwoTone",
|
||||
"FileTwoTone",
|
||||
"FileUnknownFilled",
|
||||
"FileUnknownOutlined",
|
||||
"FileUnknownTwoTone",
|
||||
"FileWordFilled",
|
||||
"FileWordOutlined",
|
||||
"FileWordTwoTone",
|
||||
"FileZipFilled",
|
||||
"FileZipOutlined",
|
||||
"FileZipTwoTone",
|
||||
"FilterFilled",
|
||||
"FilterOutlined",
|
||||
"FilterTwoTone",
|
||||
"FireFilled",
|
||||
"FireOutlined",
|
||||
"FireTwoTone",
|
||||
"FlagFilled",
|
||||
"FlagOutlined",
|
||||
"FlagTwoTone",
|
||||
"FolderAddFilled",
|
||||
"FolderAddOutlined",
|
||||
"FolderAddTwoTone",
|
||||
"FolderFilled",
|
||||
"FolderOpenFilled",
|
||||
"FolderOpenOutlined",
|
||||
"FolderOpenTwoTone",
|
||||
"FolderOutlined",
|
||||
"FolderTwoTone",
|
||||
"FolderViewOutlined",
|
||||
"FontColorsOutlined",
|
||||
"FontSizeOutlined",
|
||||
"ForkOutlined",
|
||||
"FormOutlined",
|
||||
"FormatPainterFilled",
|
||||
"FormatPainterOutlined",
|
||||
"ForwardFilled",
|
||||
"ForwardOutlined",
|
||||
"FrownFilled",
|
||||
"FrownOutlined",
|
||||
"FrownTwoTone",
|
||||
"FullscreenExitOutlined",
|
||||
"FullscreenOutlined",
|
||||
"FunctionOutlined",
|
||||
"FundFilled",
|
||||
"FundOutlined",
|
||||
"FundProjectionScreenOutlined",
|
||||
"FundTwoTone",
|
||||
"FundViewOutlined",
|
||||
"FunnelPlotFilled",
|
||||
"FunnelPlotOutlined",
|
||||
"FunnelPlotTwoTone",
|
||||
"GatewayOutlined",
|
||||
"GifOutlined",
|
||||
"GiftFilled",
|
||||
"GiftOutlined",
|
||||
"GiftTwoTone",
|
||||
"GithubFilled",
|
||||
"GithubOutlined",
|
||||
"GitlabFilled",
|
||||
"GitlabOutlined",
|
||||
"GlobalOutlined",
|
||||
"GoldFilled",
|
||||
"GoldOutlined",
|
||||
"GoldTwoTone",
|
||||
"GoldenFilled",
|
||||
"GoogleCircleFilled",
|
||||
"GoogleOutlined",
|
||||
"GooglePlusCircleFilled",
|
||||
"GooglePlusOutlined",
|
||||
"GooglePlusSquareFilled",
|
||||
"GoogleSquareFilled",
|
||||
"GroupOutlined",
|
||||
"HddFilled",
|
||||
"HddOutlined",
|
||||
"HddTwoTone",
|
||||
"HeartFilled",
|
||||
"HeartOutlined",
|
||||
"HeartTwoTone",
|
||||
"HeatMapOutlined",
|
||||
"HighlightFilled",
|
||||
"HighlightOutlined",
|
||||
"HighlightTwoTone",
|
||||
"HistoryOutlined",
|
||||
"HomeFilled",
|
||||
"HomeOutlined",
|
||||
"HomeTwoTone",
|
||||
"HourglassFilled",
|
||||
"HourglassOutlined",
|
||||
"HourglassTwoTone",
|
||||
"Html5Filled",
|
||||
"Html5Outlined",
|
||||
"Html5TwoTone",
|
||||
"IdcardFilled",
|
||||
"IdcardOutlined",
|
||||
"IdcardTwoTone",
|
||||
"IeCircleFilled",
|
||||
"IeOutlined",
|
||||
"IeSquareFilled",
|
||||
"ImportOutlined",
|
||||
"InboxOutlined",
|
||||
"InfoCircleFilled",
|
||||
"InfoCircleOutlined",
|
||||
"InfoCircleTwoTone",
|
||||
"InfoOutlined",
|
||||
"InsertRowAboveOutlined",
|
||||
"InsertRowBelowOutlined",
|
||||
"InsertRowLeftOutlined",
|
||||
"InsertRowRightOutlined",
|
||||
"InstagramFilled",
|
||||
"InstagramOutlined",
|
||||
"InsuranceFilled",
|
||||
"InsuranceOutlined",
|
||||
"InsuranceTwoTone",
|
||||
"InteractionFilled",
|
||||
"InteractionOutlined",
|
||||
"InteractionTwoTone",
|
||||
"IssuesCloseOutlined",
|
||||
"ItalicOutlined",
|
||||
"KeyOutlined",
|
||||
"LaptopOutlined",
|
||||
"LayoutFilled",
|
||||
"LayoutOutlined",
|
||||
"LayoutTwoTone",
|
||||
"LeftCircleFilled",
|
||||
"LeftCircleOutlined",
|
||||
"LeftCircleTwoTone",
|
||||
"LeftOutlined",
|
||||
"LeftSquareFilled",
|
||||
"LeftSquareOutlined",
|
||||
"LeftSquareTwoTone",
|
||||
"LikeFilled",
|
||||
"LikeOutlined",
|
||||
"LikeTwoTone",
|
||||
"LineChartOutlined",
|
||||
"LineHeightOutlined",
|
||||
"LineOutlined",
|
||||
"LinkOutlined",
|
||||
"LinkedinFilled",
|
||||
"LinkedinOutlined",
|
||||
"Loading3QuartersOutlined",
|
||||
"LoadingOutlined",
|
||||
"LockFilled",
|
||||
"LockOutlined",
|
||||
"LockTwoTone",
|
||||
"LoginOutlined",
|
||||
"LogoutOutlined",
|
||||
"MacCommandFilled",
|
||||
"MacCommandOutlined",
|
||||
"MailFilled",
|
||||
"MailOutlined",
|
||||
"MailTwoTone",
|
||||
"ManOutlined",
|
||||
"MedicineBoxFilled",
|
||||
"MedicineBoxOutlined",
|
||||
"MedicineBoxTwoTone",
|
||||
"MediumCircleFilled",
|
||||
"MediumOutlined",
|
||||
"MediumSquareFilled",
|
||||
"MediumWorkmarkOutlined",
|
||||
"MehFilled",
|
||||
"MehOutlined",
|
||||
"MehTwoTone",
|
||||
"MenuFoldOutlined",
|
||||
"MenuOutlined",
|
||||
"MenuUnfoldOutlined",
|
||||
"MergeCellsOutlined",
|
||||
"MessageFilled",
|
||||
"MessageOutlined",
|
||||
"MessageTwoTone",
|
||||
"MinusCircleFilled",
|
||||
"MinusCircleOutlined",
|
||||
"MinusCircleTwoTone",
|
||||
"MinusOutlined",
|
||||
"MinusSquareFilled",
|
||||
"MinusSquareOutlined",
|
||||
"MinusSquareTwoTone",
|
||||
"MobileFilled",
|
||||
"MobileOutlined",
|
||||
"MobileTwoTone",
|
||||
"MoneyCollectFilled",
|
||||
"MoneyCollectOutlined",
|
||||
"MoneyCollectTwoTone",
|
||||
"MonitorOutlined",
|
||||
"MoreOutlined",
|
||||
"NodeCollapseOutlined",
|
||||
"NodeExpandOutlined",
|
||||
"NodeIndexOutlined",
|
||||
"NotificationFilled",
|
||||
"NotificationOutlined",
|
||||
"NotificationTwoTone",
|
||||
"NumberOutlined",
|
||||
"OneToOneOutlined",
|
||||
"OrderedListOutlined",
|
||||
"PaperClipOutlined",
|
||||
"PartitionOutlined",
|
||||
"PauseCircleFilled",
|
||||
"PauseCircleOutlined",
|
||||
"PauseCircleTwoTone",
|
||||
"PauseOutlined",
|
||||
"PayCircleFilled",
|
||||
"PayCircleOutlined",
|
||||
"PercentageOutlined",
|
||||
"PhoneFilled",
|
||||
"PhoneOutlined",
|
||||
"PhoneTwoTone",
|
||||
"PicCenterOutlined",
|
||||
"PicLeftOutlined",
|
||||
"PicRightOutlined",
|
||||
"PictureFilled",
|
||||
"PictureOutlined",
|
||||
"PictureTwoTone",
|
||||
"PieChartFilled",
|
||||
"PieChartOutlined",
|
||||
"PieChartTwoTone",
|
||||
"PlayCircleFilled",
|
||||
"PlayCircleOutlined",
|
||||
"PlayCircleTwoTone",
|
||||
"PlaySquareFilled",
|
||||
"PlaySquareOutlined",
|
||||
"PlaySquareTwoTone",
|
||||
"PlusCircleFilled",
|
||||
"PlusCircleOutlined",
|
||||
"PlusCircleTwoTone",
|
||||
"PlusOutlined",
|
||||
"PlusSquareFilled",
|
||||
"PlusSquareOutlined",
|
||||
"PlusSquareTwoTone",
|
||||
"PoundCircleFilled",
|
||||
"PoundCircleOutlined",
|
||||
"PoundCircleTwoTone",
|
||||
"PoundOutlined",
|
||||
"PoweroffOutlined",
|
||||
"PrinterFilled",
|
||||
"PrinterOutlined",
|
||||
"PrinterTwoTone",
|
||||
"ProfileFilled",
|
||||
"ProfileOutlined",
|
||||
"ProfileTwoTone",
|
||||
"ProjectFilled",
|
||||
"ProjectOutlined",
|
||||
"ProjectTwoTone",
|
||||
"PropertySafetyFilled",
|
||||
"PropertySafetyOutlined",
|
||||
"PropertySafetyTwoTone",
|
||||
"PullRequestOutlined",
|
||||
"PushpinFilled",
|
||||
"PushpinOutlined",
|
||||
"PushpinTwoTone",
|
||||
"QqCircleFilled",
|
||||
"QqOutlined",
|
||||
"QqSquareFilled",
|
||||
"QrcodeOutlined",
|
||||
"QuestionCircleFilled",
|
||||
"QuestionCircleOutlined",
|
||||
"QuestionCircleTwoTone",
|
||||
"QuestionOutlined",
|
||||
"RadarChartOutlined",
|
||||
"RadiusBottomleftOutlined",
|
||||
"RadiusBottomrightOutlined",
|
||||
"RadiusSettingOutlined",
|
||||
"RadiusUpleftOutlined",
|
||||
"RadiusUprightOutlined",
|
||||
"ReadFilled",
|
||||
"ReadOutlined",
|
||||
"ReconciliationFilled",
|
||||
"ReconciliationOutlined",
|
||||
"ReconciliationTwoTone",
|
||||
"RedEnvelopeFilled",
|
||||
"RedEnvelopeOutlined",
|
||||
"RedEnvelopeTwoTone",
|
||||
"RedditCircleFilled",
|
||||
"RedditOutlined",
|
||||
"RedditSquareFilled",
|
||||
"RedoOutlined",
|
||||
"ReloadOutlined",
|
||||
"RestFilled",
|
||||
"RestOutlined",
|
||||
"RestTwoTone",
|
||||
"RetweetOutlined",
|
||||
"RightCircleFilled",
|
||||
"RightCircleOutlined",
|
||||
"RightCircleTwoTone",
|
||||
"RightOutlined",
|
||||
"RightSquareFilled",
|
||||
"RightSquareOutlined",
|
||||
"RightSquareTwoTone",
|
||||
"RiseOutlined",
|
||||
"RobotFilled",
|
||||
"RobotOutlined",
|
||||
"RocketFilled",
|
||||
"RocketOutlined",
|
||||
"RocketTwoTone",
|
||||
"RollbackOutlined",
|
||||
"RotateLeftOutlined",
|
||||
"RotateRightOutlined",
|
||||
"SafetyCertificateFilled",
|
||||
"SafetyCertificateOutlined",
|
||||
"SafetyCertificateTwoTone",
|
||||
"SafetyOutlined",
|
||||
"SaveFilled",
|
||||
"SaveOutlined",
|
||||
"SaveTwoTone",
|
||||
"ScanOutlined",
|
||||
"ScheduleFilled",
|
||||
"ScheduleOutlined",
|
||||
"ScheduleTwoTone",
|
||||
"ScissorOutlined",
|
||||
"SearchOutlined",
|
||||
"SecurityScanFilled",
|
||||
"SecurityScanOutlined",
|
||||
"SecurityScanTwoTone",
|
||||
"SelectOutlined",
|
||||
"SendOutlined",
|
||||
"SettingFilled",
|
||||
"SettingOutlined",
|
||||
"SettingTwoTone",
|
||||
"ShakeOutlined",
|
||||
"ShareAltOutlined",
|
||||
"ShopFilled",
|
||||
"ShopOutlined",
|
||||
"ShopTwoTone",
|
||||
"ShoppingCartOutlined",
|
||||
"ShoppingFilled",
|
||||
"ShoppingOutlined",
|
||||
"ShoppingTwoTone",
|
||||
"ShrinkOutlined",
|
||||
"SignalFilled",
|
||||
"SisternodeOutlined",
|
||||
"SketchCircleFilled",
|
||||
"SketchOutlined",
|
||||
"SketchSquareFilled",
|
||||
"SkinFilled",
|
||||
"SkinOutlined",
|
||||
"SkinTwoTone",
|
||||
"SkypeFilled",
|
||||
"SkypeOutlined",
|
||||
"SlackCircleFilled",
|
||||
"SlackOutlined",
|
||||
"SlackSquareFilled",
|
||||
"SlackSquareOutlined",
|
||||
"SlidersFilled",
|
||||
"SlidersOutlined",
|
||||
"SlidersTwoTone",
|
||||
"SmallDashOutlined",
|
||||
"SmileFilled",
|
||||
"SmileOutlined",
|
||||
"SmileTwoTone",
|
||||
"SnippetsFilled",
|
||||
"SnippetsOutlined",
|
||||
"SnippetsTwoTone",
|
||||
"SolutionOutlined",
|
||||
"SortAscendingOutlined",
|
||||
"SortDescendingOutlined",
|
||||
"SoundFilled",
|
||||
"SoundOutlined",
|
||||
"SoundTwoTone",
|
||||
"SplitCellsOutlined",
|
||||
"StarFilled",
|
||||
"StarOutlined",
|
||||
"StarTwoTone",
|
||||
"StepBackwardFilled",
|
||||
"StepBackwardOutlined",
|
||||
"StepForwardFilled",
|
||||
"StepForwardOutlined",
|
||||
"StockOutlined",
|
||||
"StopFilled",
|
||||
"StopOutlined",
|
||||
"StopTwoTone",
|
||||
"StrikethroughOutlined",
|
||||
"SubnodeOutlined",
|
||||
"SwapLeftOutlined",
|
||||
"SwapOutlined",
|
||||
"SwapRightOutlined",
|
||||
"SwitcherFilled",
|
||||
"SwitcherOutlined",
|
||||
"SwitcherTwoTone",
|
||||
"SyncOutlined",
|
||||
"TableOutlined",
|
||||
"TabletFilled",
|
||||
"TabletOutlined",
|
||||
"TabletTwoTone",
|
||||
"TagFilled",
|
||||
"TagOutlined",
|
||||
"TagTwoTone",
|
||||
"TagsFilled",
|
||||
"TagsOutlined",
|
||||
"TagsTwoTone",
|
||||
"TaobaoCircleFilled",
|
||||
"TaobaoCircleOutlined",
|
||||
"TaobaoOutlined",
|
||||
"TaobaoSquareFilled",
|
||||
"TeamOutlined",
|
||||
"ThunderboltFilled",
|
||||
"ThunderboltOutlined",
|
||||
"ThunderboltTwoTone",
|
||||
"ToTopOutlined",
|
||||
"ToolFilled",
|
||||
"ToolOutlined",
|
||||
"ToolTwoTone",
|
||||
"TrademarkCircleFilled",
|
||||
"TrademarkCircleOutlined",
|
||||
"TrademarkCircleTwoTone",
|
||||
"TrademarkOutlined",
|
||||
"TransactionOutlined",
|
||||
"TranslationOutlined",
|
||||
"TrophyFilled",
|
||||
"TrophyOutlined",
|
||||
"TrophyTwoTone",
|
||||
"TwitterCircleFilled",
|
||||
"TwitterOutlined",
|
||||
"TwitterSquareFilled",
|
||||
"UnderlineOutlined",
|
||||
"UndoOutlined",
|
||||
"UngroupOutlined",
|
||||
"UnlockFilled",
|
||||
"UnlockOutlined",
|
||||
"UnlockTwoTone",
|
||||
"UnorderedListOutlined",
|
||||
"UpCircleFilled",
|
||||
"UpCircleOutlined",
|
||||
"UpCircleTwoTone",
|
||||
"UpOutlined",
|
||||
"UpSquareFilled",
|
||||
"UpSquareOutlined",
|
||||
"UpSquareTwoTone",
|
||||
"UploadOutlined",
|
||||
"UsbFilled",
|
||||
"UsbOutlined",
|
||||
"UsbTwoTone",
|
||||
"UserAddOutlined",
|
||||
"UserDeleteOutlined",
|
||||
"UserOutlined",
|
||||
"UserSwitchOutlined",
|
||||
"UsergroupAddOutlined",
|
||||
"UsergroupDeleteOutlined",
|
||||
"VerifiedOutlined",
|
||||
"VerticalAlignBottomOutlined",
|
||||
"VerticalAlignMiddleOutlined",
|
||||
"VerticalAlignTopOutlined",
|
||||
"VerticalLeftOutlined",
|
||||
"VerticalRightOutlined",
|
||||
"VideoCameraAddOutlined",
|
||||
"VideoCameraFilled",
|
||||
"VideoCameraOutlined",
|
||||
"VideoCameraTwoTone",
|
||||
"WalletFilled",
|
||||
"WalletOutlined",
|
||||
"WalletTwoTone",
|
||||
"WarningFilled",
|
||||
"WarningOutlined",
|
||||
"WarningTwoTone",
|
||||
"WechatFilled",
|
||||
"WechatOutlined",
|
||||
"WeiboCircleFilled",
|
||||
"WeiboCircleOutlined",
|
||||
"WeiboOutlined",
|
||||
"WeiboSquareFilled",
|
||||
"WeiboSquareOutlined",
|
||||
"WhatsAppOutlined",
|
||||
"WifiOutlined",
|
||||
"WindowsFilled",
|
||||
"WindowsOutlined",
|
||||
"WomanOutlined",
|
||||
"YahooFilled",
|
||||
"YahooOutlined",
|
||||
"YoutubeFilled",
|
||||
"YoutubeOutlined",
|
||||
"YuqueFilled",
|
||||
"YuqueOutlined",
|
||||
"ZhihuCircleFilled",
|
||||
"ZhihuOutlined",
|
||||
"ZhihuSquareFilled",
|
||||
"ZoomInOutlined",
|
||||
"ZoomOutOutlined"
|
||||
]
|
||||
@@ -81,6 +81,7 @@ export const appConfig = {
|
||||
orgName: 'orgName',
|
||||
projectId: 'projectId',
|
||||
});
|
||||
sessionStorage.setItem('accountNo', info.accountNo);
|
||||
return { data: { ...trD } };
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createApp,nextTick } from 'vue';
|
||||
import App from '/@/App.vue';
|
||||
import { saasInit } from '/nerv-lib/saas';
|
||||
import { apiModule } from '/@/api';
|
||||
import { appConfig } from '/@/config';
|
||||
import './theme/global.less';
|
||||
import { LeftOutlined } from '@ant-design/icons-vue';
|
||||
import * as Icons from '@ant-design/icons-vue'
|
||||
// import ElementPlus from 'element-plus'
|
||||
// import 'element-plus/dist/index.css'
|
||||
const app = createApp(App);
|
||||
// 屏蔽黄色警告信息
|
||||
app.config.warnHandler = () => null;
|
||||
nextTick(() => {
|
||||
// 配置全局对象
|
||||
app.config.globalProperties.$icons = Icons
|
||||
// Antd 注入全部图标(这样注入之后,就可以全局直接使用 icon 组件,不需要每个页面去引入了)
|
||||
for (const key in Icons) { app.component(key, Icons[key as keyof typeof Icons]) }
|
||||
})
|
||||
app.component('LeftOutlined', LeftOutlined);
|
||||
saasInit({
|
||||
app,
|
||||
|
||||
30
hx-op/src/router/menu.ts
Normal file
30
hx-op/src/router/menu.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
const Base = () => import('/nerv-lib/saas/view/system/layout/content.vue');
|
||||
const equipment = {
|
||||
path: '/systemManage',
|
||||
name: 'systemManage',
|
||||
meta: { title: '系统管理', icon: 'dicizhishou', index: 1 },
|
||||
redirect: { name: 'Ledger' },
|
||||
children: [
|
||||
{
|
||||
path: 'systemMenu',
|
||||
name: 'systemMenu',
|
||||
meta: { title: '系统菜单', hideChildren: true, icon: 'dicizhishou' },
|
||||
component: Base,
|
||||
redirect: { name: 'systemMenuIndex' },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'systemMenuIndex',
|
||||
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
|
||||
component: () => import('/@/view/systemManage/systemMenu/index.vue'),
|
||||
meta: {
|
||||
title: '系统菜单',
|
||||
keepAlive: false,
|
||||
// backApi: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
export default equipment;
|
||||
10
hx-op/src/shims-vue.d.ts
vendored
Normal file
10
hx-op/src/shims-vue.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
export {}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$filters: any,
|
||||
$icons:any,
|
||||
icon:any
|
||||
}
|
||||
}
|
||||
176
hx-op/src/view/systemManage/systemMenu/config.ts
Normal file
176
hx-op/src/view/systemManage/systemMenu/config.ts
Normal file
@@ -0,0 +1,176 @@
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { ref } from 'vue';
|
||||
import { menuS } from '/@/api/menuSystem';
|
||||
// interface DataItem {
|
||||
// key: number;
|
||||
// menuName: string;
|
||||
// menuType: number;
|
||||
// menuIcon: string;
|
||||
// menuRouter:string;
|
||||
// children?: DataItem[];
|
||||
// }
|
||||
// const data: DataItem[] = [
|
||||
// {
|
||||
// key: 1,
|
||||
// menuName: 'John Brown sr.',
|
||||
// menuType: 60,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard',
|
||||
// children: [
|
||||
// {
|
||||
// key: 11,
|
||||
// menuName: 'John Brown',
|
||||
// menuType: 42,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard1',
|
||||
// },
|
||||
// {
|
||||
// key: 12,
|
||||
// menuName: 'John Brown',
|
||||
// menuType: 42,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard3',
|
||||
// children: [
|
||||
// {
|
||||
// key: 121,
|
||||
// menuName: 'John Brown',
|
||||
// menuType: 42,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard4',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// key: 13,
|
||||
// menuName: 'John Brown sr.',
|
||||
// menuType: 60,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard',
|
||||
// children: [
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// key: 2,
|
||||
// menuName: 'John Brown sr.',
|
||||
// menuType: 60,
|
||||
// menuIcon:'icon',
|
||||
// menuRouter: '/dashboard',
|
||||
// },
|
||||
// ];
|
||||
export const tableConfig = (orgId:any,SystemAddEdit:any) => {
|
||||
return ref({
|
||||
title: '系统菜单',
|
||||
api: menuS.queryMenuPage,
|
||||
params: {projectId:null},
|
||||
pagination: false,
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'systemMenuAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
console.log("12345")
|
||||
SystemAddEdit.value.toggle(1);
|
||||
// editConfigureDeviceAlarms.value.toggle(null, configureDeviceAlarmsData.value);
|
||||
},
|
||||
},
|
||||
],
|
||||
// rowSelection: {
|
||||
// checkStrictly: false,
|
||||
// onChange: (selectedRowKeys: (string | number)[], selectedRows: DataItem[]) => {
|
||||
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
||||
// },
|
||||
// onSelect: (record: DataItem, selected: boolean, selectedRows: DataItem[]) => {
|
||||
// console.log(record, selected, selectedRows);
|
||||
// },
|
||||
// onSelectAll: (selected: boolean, selectedRows: DataItem[], changeRows: DataItem[]) => {
|
||||
// console.log(selected, selectedRows, changeRows);
|
||||
// },
|
||||
// },
|
||||
columns:[
|
||||
{
|
||||
title: '菜单名称',
|
||||
dataIndex: 'label',
|
||||
key: 'label',
|
||||
},
|
||||
{
|
||||
title: '菜单类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align:'center'
|
||||
},
|
||||
{
|
||||
title: '图标',
|
||||
dataIndex: 'icon',
|
||||
key: 'icon',
|
||||
align:'center'
|
||||
},
|
||||
{
|
||||
title: '路由',
|
||||
dataIndex: 'backApi',
|
||||
key: 'backApi',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'sort',
|
||||
key: 'sort',
|
||||
align:'center'
|
||||
}
|
||||
],
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'label',
|
||||
label: '菜单名称',
|
||||
component: 'NsInput',
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入菜单名称',
|
||||
},
|
||||
}
|
||||
],
|
||||
params: {},
|
||||
},
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'userAdd',
|
||||
handle: (record: any) => {
|
||||
console.log("我是编辑区域11111")
|
||||
console.log(record)
|
||||
SystemAddEdit.value.getMenuList();//请求列表的菜单数据
|
||||
SystemAddEdit.value.toggle(1,record);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'userEdit',
|
||||
handle: (record: any) => {
|
||||
SystemAddEdit.value.toggle(2,record);
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'userDelete',
|
||||
dynamicParams: { id: 'id' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
handle: (data: any) => {
|
||||
// http.post(energyAlarms.del, { id: data.id, orgId: data.orgId }).then(() => {
|
||||
// NsMessage.success('操作成功');
|
||||
// mainEnergyAlarmConfig.value?.nsTableRef.reload();
|
||||
// mainRef.value?.nsTableRef.reload();
|
||||
// });
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
rowKey: 'code',
|
||||
})
|
||||
}
|
||||
296
hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue
Normal file
296
hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<!-- 系统菜单的新增、编辑 duyf-->
|
||||
<template>
|
||||
<a-drawer
|
||||
:width="500"
|
||||
:visible="visible"
|
||||
:body-style="{ paddingBottom: '80px' }"
|
||||
:footer-style="{ textAlign: 'right' }"
|
||||
destroyOnClose
|
||||
:title="drawerTitele"
|
||||
@close="onClose">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formState"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-item label="菜单类型:" name="menuType">
|
||||
<a-radio-group v-model:value="menuRadioType">
|
||||
<a-radio-button :value="1" @click="chanageMenuType">一级菜单</a-radio-button>
|
||||
<a-radio-button :value="2" @click="chanageMenuType">子菜单</a-radio-button>
|
||||
<a-radio-button :value="3" @click="chanageMenuType">按钮/权限</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="菜单名称:" name="menuName" v-if="menuNameIsshow">
|
||||
<a-input allowClear v-model:value="formState.menuName" maxlength="255" placeholder="请输入菜单名称" />
|
||||
</a-form-item>
|
||||
<a-form-item label="菜单编码:" name="menuCode" v-if="menuCodeIsshow">
|
||||
<a-input allowClear v-model:value="formState.menuCode" maxlength="64" placeholder="请输入菜单编码" />
|
||||
</a-form-item>
|
||||
<a-form-item label="按钮/权限:" name="perissionBtn" v-if="btnPermissIsshow">
|
||||
<a-input v-model:value="formState.perissionBtn" maxlength="255" placeholder="请输入按钮/权限" />
|
||||
</a-form-item>
|
||||
<a-form-item label="上级菜单:" name="previousMenu" v-if="preMenuIsshow">
|
||||
<a-tree-select
|
||||
v-model:value="formState.previousMenu"
|
||||
:tree-line="true"
|
||||
:tree-data="treeData"
|
||||
>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="菜单路由:" name="routePath">
|
||||
<a-input v-model:value="formState.routePath" placeholder="请输入路由地址"/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="跳转地址:" name="menuJumpUrl">
|
||||
<a-input v-model:value="formState.menuJumpUrl" placeholder="请输入跳转地址"/>
|
||||
</a-form-item> -->
|
||||
<a-form-item label="菜单图标:" name="menuIcon" class="iconMenu">
|
||||
<a-input v-model:value="formState.menuIcon" placeholder="点击选择菜单图标" />
|
||||
<SlackOutlined @click="showIconMenu"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="授权标识:" name="authorizationMark" v-if="authorMarkIsshow">
|
||||
<a-input v-model:value="formState.authorizationMark" placeholder="请输入授权标识" />
|
||||
</a-form-item>
|
||||
<a-form-item label="排序:" name="menuSort" v-if="sortIsshow">
|
||||
<a-input type="number" v-model:value="formState.menuSort" min="0" maxlength="7" placeholder="请输入排序号" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||
<a-button type="primary" @click="onSubmit">确定</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
<icon-picker :iconHandleOk="getSonData" ref="refIconPicker"></icon-picker>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref,toRaw,defineExpose,reactive} from 'vue';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import type { TreeSelectProps } from 'ant-design-vue';
|
||||
import { SlackOutlined } from '@ant-design/icons-vue';
|
||||
import iconPicker from '../../../components/icon/IconPicker.vue';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { menuS } from '/@/api/menuSystem';
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
const accountNo = sessionStorage.getItem('accountNo')?sessionStorage.getItem('accountNo'):'';
|
||||
const menuRadioType = ref(1);//菜单类型默认值
|
||||
const treeData = ref<TreeSelectProps['treeData']>([]);//存储菜单数据
|
||||
|
||||
const drawerTitele = ref('');
|
||||
const formRef = ref();
|
||||
const visible = ref(false);
|
||||
const btnPermissIsshow = ref(false);//按钮权限是否显示
|
||||
const menuCodeIsshow = ref(true);//菜单编码是否显示
|
||||
const preMenuIsshow = ref(false);//上级菜单是否显示
|
||||
const authorMarkIsshow = ref(false);//授权标识是否显示
|
||||
const menuNameIsshow = ref(true);//菜单名称是否显示
|
||||
const sortIsshow = ref(true);//排序是否显示
|
||||
const menuRouteIsshow = ref(true);//菜单路由是否显示
|
||||
const refIconPicker = ref();
|
||||
interface FormState {
|
||||
menuName: string;
|
||||
previousMenu:string;
|
||||
routePath:string;
|
||||
menuSort:string;
|
||||
perissionBtn:string;
|
||||
authorizationMark:string;
|
||||
menuIcon:string;
|
||||
menuCode:string;
|
||||
type:string;//菜单类型
|
||||
menuJumpUrl:string;
|
||||
}
|
||||
const formState = ref<FormState>({
|
||||
menuName:'',
|
||||
previousMenu:'',
|
||||
routePath:'',
|
||||
menuSort:'',
|
||||
perissionBtn:'',
|
||||
authorizationMark:'',
|
||||
menuIcon:'',
|
||||
menuCode:'',
|
||||
type:'',
|
||||
menuJumpUrl:''
|
||||
})
|
||||
const labelCol = { span: 5 };
|
||||
const wrapperCol = { span: 19 };
|
||||
|
||||
// 定义form表单的必填
|
||||
var rules: Record<string, Rule[]> = reactive({
|
||||
menuName: [{ required: true, message: '请输入菜单名称', trigger: 'change' }],
|
||||
menuCode: [{ required: true, message: '请输入菜单编码', trigger: 'change' }],
|
||||
perissionBtn: [{ required: true, message: '请输入按钮/权限', trigger: 'change' }],
|
||||
previousMenu: [{ required: true, message: '请选择上级菜单', trigger: 'change' }],
|
||||
routePath:[{ required: true, message: '请输入菜单路由', trigger: 'change' }],
|
||||
});
|
||||
const emit = defineEmits(['editObject']);
|
||||
// 关闭新增抽屉
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
//菜单类型按钮切换
|
||||
const chanageMenuType = (e:any,typeMenu:any)=>{
|
||||
console.log("1444444444444443333333333333333333333333333333333333")
|
||||
let currentType = null;
|
||||
if(e && e.target){
|
||||
currentType = e.target.value;
|
||||
}
|
||||
if(typeMenu){
|
||||
currentType = typeMenu;
|
||||
}
|
||||
console.log(currentType);
|
||||
menuRadioType.value = currentType;
|
||||
if(currentType==1){//一级菜单
|
||||
menuNameIsshow.value = true;
|
||||
btnPermissIsshow.value = false;
|
||||
preMenuIsshow.value = false;
|
||||
authorMarkIsshow.value = false;
|
||||
sortIsshow.value = true;
|
||||
menuCodeIsshow.value = true;
|
||||
menuRouteIsshow.value = true;
|
||||
}else if(currentType==2){//二级菜单
|
||||
menuNameIsshow.value = true;
|
||||
preMenuIsshow.value = true;
|
||||
btnPermissIsshow.value = false;
|
||||
authorMarkIsshow.value = false;
|
||||
sortIsshow.value = true;
|
||||
menuCodeIsshow.value = true;
|
||||
menuRouteIsshow.value = true;
|
||||
}else{//按钮
|
||||
menuNameIsshow.value = false;
|
||||
preMenuIsshow.value = true;
|
||||
btnPermissIsshow.value = true;
|
||||
authorMarkIsshow.value = true;
|
||||
sortIsshow.value = false;
|
||||
menuCodeIsshow.value = false;
|
||||
menuRouteIsshow.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 点击确定提交
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
console.log('values1111111111111');
|
||||
console.log(formState)
|
||||
console.log(toRaw(formState))
|
||||
//请求添加接口提交数据
|
||||
let params={
|
||||
pid:'root',
|
||||
code:formState.value.menuCode,
|
||||
label:formState.value.menuName,
|
||||
icon:formState.value.menuIcon,
|
||||
type:menuRadioType.value,
|
||||
sort:formState.value.menuSort,
|
||||
backApi:formState.value.routePath,
|
||||
projectId:null,
|
||||
updateUser:accountNo
|
||||
}
|
||||
if(menuRadioType.value==3){
|
||||
params.code = formState.value.authorizationMark;
|
||||
params
|
||||
}
|
||||
return
|
||||
http.post(menuS.queryMenuPageAdd, params).then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
});
|
||||
// emit("editObject",formState)
|
||||
})
|
||||
}
|
||||
//获取菜单列表
|
||||
const getMenuList= ()=>{
|
||||
http.post(menuS.queryMenuPage, { label: '',projectId: null}).then((res) => {
|
||||
treeData.value = res.data.records;
|
||||
treeData.value = res.data.records.map((item:any) => ({
|
||||
value: item.code,
|
||||
label: item.label,
|
||||
children: item.children ? item.children.map((child:any) => ({
|
||||
value: child.code,
|
||||
label:child.label,
|
||||
|
||||
})) : []
|
||||
}));
|
||||
});
|
||||
}
|
||||
//展示icon图标集
|
||||
const showIconMenu = (data:any)=>{
|
||||
refIconPicker.value.isIconOpenToggle(formState.value.menuIcon);
|
||||
|
||||
}
|
||||
const getSonData = (data:any) => {
|
||||
// formState.icon = data;
|
||||
console.log("子组件中的数据:",data)
|
||||
if(data){
|
||||
formState.value.menuIcon = data;
|
||||
}else{
|
||||
refIconPicker.value.isIconData();
|
||||
}
|
||||
}
|
||||
const toggle = (type:any,record:any)=>{
|
||||
visible.value = !visible.value;
|
||||
if(type==1){//新增
|
||||
drawerTitele.value = '新增菜单';
|
||||
}else if(type==2){//编辑
|
||||
drawerTitele.value = '编辑菜单';
|
||||
}
|
||||
//如果record有值,说明是编辑或者从有数据条目中点击新增编辑过来的
|
||||
if(record){
|
||||
if(record.type==1){//一级菜单
|
||||
formState.value.previousMenu = record.code;
|
||||
if(type==1){//新增
|
||||
menuRadioType.value = 2;//如果是一级菜单进来应该是添加子菜单
|
||||
chanageMenuType(null,2);
|
||||
}else{//编辑
|
||||
menuRadioType.value = 1;
|
||||
chanageMenuType(null,1);
|
||||
}
|
||||
}else if(record.type==2){//子菜单
|
||||
formState.value.previousMenu = record.code;
|
||||
if(type==1){
|
||||
menuRadioType.value = 2;//如果是一级菜单进来应该是添加子菜单
|
||||
}else{
|
||||
menuRadioType.value = 2;
|
||||
}
|
||||
chanageMenuType(null,2);
|
||||
}else if(record.type==3){//按钮
|
||||
formState.value.previousMenu = record.code;
|
||||
if(type==1){
|
||||
menuRadioType.value = 2;//如果是一级菜单进来应该是添加子菜单
|
||||
chanageMenuType(null,2);
|
||||
}else{
|
||||
menuRadioType.value = 3;
|
||||
chanageMenuType(null,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
defineExpose({
|
||||
toggle,
|
||||
getMenuList
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.iconMenu :deep(.ant-form-item-control-input-content){
|
||||
display: flex;
|
||||
.ant-input{
|
||||
border-top-right-radius:0;
|
||||
border-bottom-right-radius:0;
|
||||
}
|
||||
.anticon{
|
||||
padding:7px 10px 0;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius:4px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius:0;
|
||||
cursor: pointer;
|
||||
border-left:0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
69
hx-op/src/view/systemManage/systemMenu/index.vue
Normal file
69
hx-op/src/view/systemManage/systemMenu/index.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<!-- <a-table :columns="columns" :data-source="data" :row-selection="rowSelection" /> -->
|
||||
<div style="padding:10px auto;">
|
||||
<ns-view-list-table v-bind="config" :model="data" ref="mainRef">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'type'">
|
||||
<a-button type="primary" class="oneLevelMenu" v-if="record.type === '1'">一级菜单</a-button>
|
||||
<a-button class="childMenu" type="primary" v-else-if="record.type === '2'">子菜单</a-button>
|
||||
<a-button class="btnMenu" :data-aaavvv="record.type" type="primary" v-else>按钮</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'icon'">
|
||||
<component :is="$icons[record.icon]" />
|
||||
</template>
|
||||
</template>
|
||||
</ns-view-list-table>
|
||||
</div>
|
||||
<!-- 新增or编辑界面 -->
|
||||
<editSystemMenu ref="SystemAddEdit" @editObject="editObject" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { tableConfig } from './config';
|
||||
import { computed, nextTick, onMounted, ref ,unref} from 'vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import editSystemMenu from './editSystemMenu.vue';
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const SystemAddEdit = ref({});
|
||||
const config = tableConfig(orgId.value,SystemAddEdit);
|
||||
|
||||
// 表格相关数据
|
||||
const data = ref([]);//子组件数据修改时,父组件也跟着改变。
|
||||
const mainRef = ref();//可以定义一个函数使用mainRef.value来调用子组件的方法。
|
||||
defineOptions({
|
||||
name: 'systemMenuIndex', // 与页面路由name一致缓存才可生效
|
||||
});
|
||||
onMounted(() => {
|
||||
});
|
||||
//编辑新增成功时刷新表格
|
||||
const editObject = (val:any)=>{
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ns-table-search),
|
||||
:deep(.ns-part-tree),
|
||||
:deep(.ns-table-main) {
|
||||
box-shadow: @ns-content-box-shadow;
|
||||
}
|
||||
:deep(.ns-basic-table){
|
||||
padding-bottom:15px;
|
||||
}
|
||||
.oneLevelMenu{
|
||||
background-color: #2778FF;
|
||||
border-color:#2778FF;
|
||||
}
|
||||
.childMenu{
|
||||
background-color: #009688;
|
||||
border-color:#009688;
|
||||
}
|
||||
.btnMenu{
|
||||
background-color: #FFB800;
|
||||
border-color:#FFB800;
|
||||
}
|
||||
:deep(.ant-btn){
|
||||
padding:0px 8px;
|
||||
height:28px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user