Selaa lähdekoodia

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

cz 2 vuotta sitten
vanhempi
commit
3a1fe7f985

+ 1 - 1
index.html

@@ -7,7 +7,7 @@
   <meta name="renderer" content="webkit">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
   <link rel="icon" href="/favicon.ico">
-  <title>若依管理系统</title>
+  <title>ByteSailing</title>
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
   <style>
     html,

+ 2 - 2
package.json

@@ -1,8 +1,8 @@
 {
   "name": "ruoyi",
   "version": "3.8.5",
-  "description": "若依管理系统",
-  "author": "若依",
+  "description": "ByteSailing",
+  "author": "ByteSailing",
   "license": "MIT",
   "scripts": {
     "dev": "vite",

+ 3 - 4
src/components/byForm/index.vue

@@ -40,8 +40,7 @@
 					:disabled="i.disabled ? i.disabled : false"
 					:style="i.style"
 				>
-					<el-option :label="j.title || j.name" :value="j.id || j.value" v-for="j in i.data" :key="j.id">
-						
+					<el-option :label="j.title || j.name || j.label" :value="j.id || j.value" v-for="j in i.data" :key="j.id">
 					</el-option>
 				</el-select>
 				<el-tree-select
@@ -73,8 +72,8 @@
 					v-model="formData[i.prop]"
 					:disabled="i.disabled ? i.disabled : false"
 				>
-					<el-checkbox  v-for="j in i.data" :key="j.id" :label="j.id" name="type">
-						{{ j.name }}
+					<el-checkbox  v-for="j in i.data" :key="j.id || j.value" ::label="j.id  || j.value" name="type">
+						{{ j.name || j.label }}
 					</el-checkbox>
 					
 				</el-checkbox-group>

+ 10 - 6
src/components/headerBar/header-bar.vue

@@ -2,13 +2,15 @@
 	<div id="main" class="header-bar">
 		<header>
 			<ul class="nav">
-				<div class="logo">GrandStar</div>
+				<div class="logo">ByteSailing</div>
 				<li class="header-bar-hover-warp nav-li">
 					<div @click="isChildMenu = !isChildMenu" class="menu-modal" style="font-size: 12px;">
 						功能导览
 						<i class="el-icon-arrow-down el-icon--right"></i>
 					</div>
+					
 				</li>
+				
 				<li class="nav-li" v-for="i in barData" :key="i.id">
 					<span>{{ i.name }}</span>
 				</li>
@@ -26,7 +28,7 @@
 									<el-icon size="16" color="#0084FF">
 										<edit />
 									</el-icon>
-									订购服务
+									功能菜单
 								</div>
 								<ul>
 									<li>外贸ERP</li>
@@ -35,12 +37,12 @@
 									<li>供应链</li>
 									<li>产品库</li>
 								</ul>
-								<div class="first-order">
+								<!-- <div class="first-order">
 									<el-icon size="16" color="#0084FF">
 										<edit /> 
 									</el-icon>
 									推荐服务
-								</div>
+								</div> -->
 							</div>
 							<div class="menu-warp">
 								<div class="first-order-title">
@@ -129,7 +131,7 @@
   
 <script setup>
 import Cookies from 'js-cookie'
-import { ElMessageBox } from 'element-plus'
+import { ElMessageBox,ElNotification } from 'element-plus'
 import useUserStore from '@/store/modules/user'
 import usePermissionStore from '@/store/modules/permission'
 const router = useRouter()
@@ -166,7 +168,7 @@ const routerInit = (() => {
 			//判断是否存在
 			if(element.children && element.children.length > 0){
 				//判断余数加上子项列会不会爆掉
-				if(num % 10 + element.children.length + 1 > 11 && element.children.length < 11){
+				if(num % 11 + element.children.length + 1 > 11 && element.children.length < 11){
 					element.pushNum = 11 - num % 11
 					for (let j = 0; j < 11 - num % 11; j++) {
 						arr.splice(i, 0, {...element,isNone:true})
@@ -194,7 +196,9 @@ function handleCommand(command) {
 	}
 }
 
+
 function logout() {
+	
 	ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
 		confirmButtonText: '确定',
 		cancelButtonText: '取消',

+ 215 - 60
src/components/notice/index.vue

@@ -1,73 +1,228 @@
 <template>
-    <div class="commons-notice">
-        <el-dialog
-            title="系统公告"
-            v-model="value"
-            width="460px"
-            :before-close="handleClose">
-            <div class="title">
-                <!-- {{ data.length == 0 ? '暂无数据' :  data[indexCopy].title}} -->
-            </div>
-            <div class="text-content" v-if="data.length > 0" style="margin-top:10px">
-                {{ data[index].content}}
-            </div>
-            <template #footer>
-                <span class="dialog-footer">
-                    <el-button size="small" @click="index--" :disabled="data.length < 2 || index == 0">上一条</el-button>
-                    <el-button size="small" @click="index++" :disabled="data.length == index + 1">下一条</el-button>
-                    <el-button type="primary" size="small" :disabled="data.length == 0" @click="confirm">确认已读</el-button>
-                    <span class="more" @click="moreFn">查看更多 &gt;</span>
-                </span>
-            </template>
-        </el-dialog>
-    </div>
+	<div class="commons-notice">
+		<el-button @click="openBottomBar(1)">弹窗测试1</el-button>
+		<el-button @click="openBottomBar(2)">弹窗测试2</el-button>
+		<el-button @click="openBottomBar(3)">弹窗测试3</el-button>
+		<el-dialog
+			title="系统公告"
+			v-model="value"
+			width="460px"
+			:before-close="handleClose"
+		>
+			<div class="title">
+				<!-- {{ data.length == 0 ? '暂无数据' :  data[indexCopy].title}} -->
+			</div>
+			<div
+				class="text-content"
+				v-if="data.length > 0"
+				style="margin-top: 10px"
+			>
+				{{ data[index].content }}
+			</div>
+			<template #footer>
+				<span class="dialog-footer">
+					<el-button
+						size="small"
+						@click="index--"
+						:disabled="data.length < 2 || index == 0"
+						>上一条</el-button
+					>
+					<el-button
+						size="small"
+						@click="index++"
+						:disabled="data.length == index + 1"
+						>下一条</el-button
+					>
+					<el-button
+						type="primary"
+						size="small"
+						:disabled="data.length == 0"
+						@click="confirm"
+						>确认已读</el-button
+					>
+					<span class="more" @click="moreFn">查看更多 &gt;</span>
+				</span>
+			</template>
+		</el-dialog>
+		<div class="notice-table-warp" :class="noticeTableModal ? 'notice-table-warp-open' : ''" @click.stop="noticeTableModal = false">
+			<div class="notice-table" @click.stop>
+				<div class="tabs">
+					<ul>
+						<li style="padding-left: 0; border: none">
+							全部(99)
+						</li>
+						<li class="active">待办(99)</li>
+						<li>通知(99)</li>
+					</ul>
+					<div class="more">查看更多&gt;</div>
+				</div>
+				<el-table :data="noticeData" style="width: 100%">
+					<el-table-column prop="date" label="标题内容" width="250">
+					</el-table-column>
+					<el-table-column prop="name" label="类型" width="120">
+					</el-table-column>
+					<el-table-column prop="address" label="操作">
+						<template #default="scope">
+							<span style="cursor: pointer;">未读</span>
+						</template>
+					</el-table-column>
+				</el-table>
+				<div class="notice-btn-box" style="margin-top: 20px">
+					<el-button  plain>点击清空</el-button>
+					<el-button type="primary">全部已读</el-button>
+				</div>
+			</div>
+		</div>
+	</div>
 </template>
 <script setup>
-
-
+import { ElMessageBox, ElNotification } from 'element-plus'
+let noticeTableModal = ref(false)
+let noticeData = ref([
+	{
+		date: '2016-05-02',
+		name: '王小虎',
+		address: '上海市普陀区金沙江路 1518 弄',
+	},
+	{
+		date: '2016-05-04',
+		name: '王小虎',
+		address: '上海市普陀区金沙江路 1517 弄',
+	},
+	{
+		date: '2016-05-01',
+		name: '王小虎',
+		address: '上海市普陀区金沙江路 1519 弄',
+	},
+	{
+		date: '2016-05-03',
+		name: '王小虎',
+		address: '上海市普陀区金沙江路 1516 弄',
+	},
+])
 const index = ref(1)
-const data  = ref([{title:'11',content:'11'},{title:'22',content:'22'},{title:'33',content:'33'},{title:'44',content:'44'}])
-const value  = ref(false)
-function moreFn (){
-    console.log(this.data[this.index])
+const data = ref([
+	{ title: '11', content: '11' },
+	{ title: '22', content: '22' },
+	{ title: '33', content: '33' },
+	{ title: '44', content: '44' },
+])
+const value = ref(false)
+const moreFn = () => {
+	noticeTableModal.value = true
 }
 
-function confirm (){
-    console.log(this.data[this.index])
+const confirm = () => {
+	value.value = false
 }
 
-function handleClose (){
-    console.log(data)
-    value.value = false
+const handleClose = () => {
+	value.value = false
 }
 
+const openBottomBar = (type) => {
+	if (type == 1) {
+		ElNotification({
+			message: '您有一封新的邮件,请注意查收。',
+			type: 'warning',
+			position: 'bottom-right',
+		})
+	} else if (type == 2) {
+		value.value = true
+	} else {
+		noticeTableModal.value = true
+	}
+}
 </script>
+<style lang="scss">
+.notice-table-warp{
+	position: fixed;
+	right: 0;
+	top: 0;
+	width: 100%;
+	height: 100%;
+	z-index: 1000;
+	background: rgba(0, 0, 0, 0.1);
+	transition: all 0.3s ease-in-out;
+	opacity: 0;
+	display: none;
+}
+
+.notice-table-warp-open{
+	opacity: 1;
+	display: block;
+}
+.notice-table {
+	position: fixed;
+	right: 2px;
+	top: 52px;
+	padding: 0 20px 20px;
+	width: 500px;
+	background: #fff;
+	box-shadow: 0px 2px 20px 1px rgba(0, 0, 0, 0.1);
+	z-index: 20;
+	.notice-btn-box {
+		text-align: right;
+	}
+	.tabs {
+		display: flex;
+		justify-content: space-between;
+		height: 60px;
+		line-height: 60px;
+		font-size: 14px;
+		font-weight: 400;
+		ul {
+			display: flex;
+			margin: 23px 0;
+			padding: 0;
+			li {
+				list-style: none;
+				padding: 0 20px;
+				cursor: pointer;
+				height: 14px;
+				line-height: 14px;
+				border-left: 1px solid #dcdcdc;
+			}
+			.active {
+				color: #0084ff;
+			}
+		}
+		.more {
+			color: #0084ff;
+			cursor: pointer;
+		}
+	}
+}
+</style>
 <style>
-    .commons-notice .el-dialog__footer{
-        text-align: left!important;
-        margin-top: 24px;
-    }
-    .commons-notice .more{
-        color:#0084FF;
-        float: right;
-        cursor: pointer;
-    }
-    .commons-notice .el-dialog__header{
-        background: #EEEEEE;
-    }
-    .commons-notice .el-dialog__title{
-        position: relative;
-        padding-left: 30px;
-        color: #333333;
-        font-weight: bold;
-    }
-    .commons-notice .el-dialog__title::before{
-        content: " ";
-        position: absolute;
-        left: 0;
-        top: 0;
-        width: 20px;
-        height: 20px;
-        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAftJREFUOE+tlT9MU1EUxr9zWwgBI/D6Boh/EnbCRiImMhBCGqNhcnDQrbgRAyxGBgYICzXYDbrB4OBENIaY4GAMrmqc3DQxMrxWNGkH0Hv83m0ptvS1EHqTm/fuO+f+zjn3nHueoGYoIFju7kGXGeTrJOd1qlwqq30HdJdzCwX7GY9+7QsX/yO4Ph66gHb0+EkiUzAyRklnrcHyugirb4jKYj/YlgUcHOlVgJrxLkLMHJVSEOmLAFV/Vt2j8SzUrsh0/ncodEDnmec9BswsYV1Vu1RD6+842zmvUR6vkRcAm0Y+vxR6Ku7MVv3bMFir65nVT/gZDNNgBw1+oM7ACe9DTy0e4GHwQnS5uxedbRs8s1t1w1S7I9O5cRfJU/8j9Ybq6ll9ieLhfdFM7w1IfDsyAacFAkXonySB3gokNhuZhNMDGcLfNIGJXWZ3pDVA+z4EfiXwaouA384GzDApEpEUlzXrgI1Dhn7B4cEITOwCYob1aK40iCYMuVlS1BLAY0GMz8ssWxMNdElpVjaaJ+RZCaJ3GbIXASyXTdPC1udAcK8E8TcJvNO4sJtePfsa/bmbDvIj8QrGTDS8ei6QsDkk/Hl2mpm6zUH0bSliGaU8bBLHQ7XA832CXLDomsORxLUvgDfGTJ2pfcGuc1+6qn1VoK1ssBXoOX8B/wDYqv5bje949AAAAABJRU5ErkJggg==);
-    }
+.commons-notice .el-table__row {
+	height: 50px;
+}
+.commons-notice .el-dialog__footer {
+	text-align: left !important;
+	margin-top: 24px;
+}
+.commons-notice .more {
+	color: #0084ff;
+	float: right;
+	cursor: pointer;
+}
+.commons-notice .el-dialog__header {
+	background: #eeeeee;
+}
+.commons-notice .el-dialog__title {
+	position: relative;
+	padding-left: 30px;
+	color: #333333;
+	font-weight: bold;
+}
+.commons-notice .el-dialog__title::before {
+	content: ' ';
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 20px;
+	height: 20px;
+	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAftJREFUOE+tlT9MU1EUxr9zWwgBI/D6Boh/EnbCRiImMhBCGqNhcnDQrbgRAyxGBgYICzXYDbrB4OBENIaY4GAMrmqc3DQxMrxWNGkH0Hv83m0ptvS1EHqTm/fuO+f+zjn3nHueoGYoIFju7kGXGeTrJOd1qlwqq30HdJdzCwX7GY9+7QsX/yO4Ph66gHb0+EkiUzAyRklnrcHyugirb4jKYj/YlgUcHOlVgJrxLkLMHJVSEOmLAFV/Vt2j8SzUrsh0/ncodEDnmec9BswsYV1Vu1RD6+842zmvUR6vkRcAm0Y+vxR6Ku7MVv3bMFir65nVT/gZDNNgBw1+oM7ACe9DTy0e4GHwQnS5uxedbRs8s1t1w1S7I9O5cRfJU/8j9Ybq6ll9ieLhfdFM7w1IfDsyAacFAkXonySB3gokNhuZhNMDGcLfNIGJXWZ3pDVA+z4EfiXwaouA384GzDApEpEUlzXrgI1Dhn7B4cEITOwCYob1aK40iCYMuVlS1BLAY0GMz8ssWxMNdElpVjaaJ+RZCaJ3GbIXASyXTdPC1udAcK8E8TcJvNO4sJtePfsa/bmbDvIj8QrGTDS8ei6QsDkk/Hl2mpm6zUH0bSliGaU8bBLHQ7XA832CXLDomsORxLUvgDfGTJ2pfcGuc1+6qn1VoK1ssBXoOX8B/wDYqv5bje949AAAAABJRU5ErkJggg==);
+}
 </style>

+ 424 - 0
src/views/system/dept2/index.vue

@@ -0,0 +1,424 @@
+<template>
+	<div class="dept">
+		<div class="tree">
+			<treeList
+				:data="treeListData"
+				v-model="sourceList.pagination.tenantId"
+				node-key="id"
+				@change="treeChange"
+			>
+			</treeList>
+		</div>
+		<div class="content">
+			<byTable
+				:source="sourceList.data"
+                :hidePagination="true"
+				:config="config"
+				:loading="loading"
+				highlight-current-row
+				:selectConfig="selectConfig"
+				:table-events="{
+					//element talbe事件都能传
+					select: select,
+				}"
+				:action-list="[
+					{
+						text: '添加机构',
+						action: () => openModal('add'),
+                        disabled:!sourceList.pagination.tenantId
+					},
+				]"
+				@get-list="getList"
+			>
+				<template #slotName="{ item }">
+					{{ item.createTime }}
+				</template>
+			</byTable>
+		</div>
+		<el-dialog
+			:title="modalType == 'add' ? '新增' : '编辑'"
+			v-model="dialogVisible"
+			width="500"
+			v-loading="loading"
+		>
+			<byForm
+				:formConfig="formConfig"
+				:formOption="formOption"
+				v-model="formData.data"
+				:rules="rules"
+				ref="byform"
+			>
+                <template #account>
+                    <el-input style="width:150px;margin-right: 10px;" v-model="formData.data.userName" placeholder="请输入用户名"></el-input>
+                    <el-input style="width:150px;margin-right: 10px;" v-model="formData.data.password" placeholder="密码"></el-input>
+                    <span style="color:#409EFF;cursor: pointer;" @click="newPassword">随机生成</span>
+                </template>
+			</byForm>
+			<template #footer>
+				<el-button @click="dialogVisible = false" size="large"
+					>取 消</el-button
+				>
+				<el-button
+					type="primary"
+					@click="submitForm('byform')"
+					size="large"
+					:loading="submitLoading"
+				>
+					确 定
+				</el-button>
+			</template>
+		</el-dialog>
+		<el-dialog
+			title="修改密码"
+			v-model="roomDialogVisible"
+			width="500"
+			:before-close="handleClose"
+			v-loading="loading"
+		>
+			<template #footer>
+				<el-button @click="roomDialogVisible = false" size="large"
+					>取 消</el-button
+				>
+				<el-button
+					type="primary"
+					@click="submitTree('byform')"
+					size="large"
+					:loading="submitLoading"
+				>
+					确 定
+				</el-button>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from 'element-plus'
+import byTable from '@/components/byTable/index'
+import byForm from '@/components/byForm/index'
+import treeList from '@/components/treeList/index'
+import { computed, defineComponent, ref } from 'vue'
+const loading = ref(false)
+const submitLoading = ref(false)
+const sourceList = ref({
+	data: [],
+	pagination: {
+		total: 3,
+		pageNum: 1,
+		pageSize: 10,
+	},
+})
+let dialogVisible = ref(false)
+let modalType = ref('add')
+let rules = ref({
+	roleKey: [{ required: true, message: '请选择部门', trigger: 'blur' }],
+    nickName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+    userName:[{ required: true, message: '用户名不能为空', trigger: 'blur' }],
+})
+const { proxy } = getCurrentInstance()
+const selectConfig = computed(() => {
+	return []
+})
+const config = computed(() => {
+	return [
+		{
+			attrs: {
+				label: '机构名称',
+				prop: 'deptName',
+			},
+		},
+		{
+			attrs: {
+				label: '机构类型',
+				prop: 'userName',
+				align: 'left',
+			},
+		},
+		{
+			attrs: {
+				label: '排序',
+				prop: 'nickName',
+			},
+		},
+		{
+			attrs: {
+				label: '创建时间',
+				prop: 'remark',
+			},
+		},
+		{
+			attrs: {
+				label: '操作',
+				width: '200',
+				align: 'right',
+			},
+			// 渲染 el-button,一般用在最后一列。
+			renderHTML(row) {
+				return [
+					{
+						attrs: {
+							label: '修改',
+							type: 'primary',
+							text: true,
+						},
+						el: 'button',
+						click() {
+							getDtl(row)
+						},
+					},
+					{
+						attrs: {
+							label: '删除',
+							type: 'danger',
+							text: true,
+						},
+						el: 'button',
+						click() {
+							// 弹窗提示是否删除
+							ElMessageBox.confirm(
+								'此操作将永久删除该数据, 是否继续?',
+								'提示',
+								{
+									confirmButtonText: '确定',
+									cancelButtonText: '取消',
+									type: 'warning',
+								}
+							).then(() => {
+								// 删除
+								proxy
+									.post(
+										'/tenantUser/' + row.userId,
+										{
+											id: row.userId,
+										},
+										'delete'
+									)
+									.then((res) => {
+										ElMessage({
+											message: '删除成功',
+											type: 'success',
+										})
+										getList()
+									})
+							})
+						},
+					},
+				]
+			},
+		},
+	]
+})
+
+let formData = reactive({
+	data: {},
+})
+const formOption = reactive({
+	inline: true,
+	labelWidth: 100,
+	itemWidth: 100,
+	rules: [],
+})
+const byform = ref(null)
+const treeListData = ref([])
+const formConfig = computed(() => {
+	return [
+		{
+			type: 'treeSelect',
+			prop: 'parentId',
+			label: '上级机构',
+			data: [],
+		},
+		{
+			type: 'input',
+			prop: 'deptName',
+			label: '机构名称',
+			required: true,
+			itemWidth: 50,
+			//disabled:true,
+			itemType: 'text',
+		},
+        
+		{
+			type: 'select',
+			prop: 'type',
+			label: '机构类型',
+			required: true,
+			
+			data: [
+				{
+					label: '公司',
+					id: 0,
+				},
+				{
+					label: '业务中心',
+					id: 1,
+				},
+                {
+					label: '部门',
+					id: 2,
+				},
+                {
+					label: '组',
+					id: 3,
+				},
+			],
+		},
+		{
+			type: 'select',
+			label: '负责人',
+			prop: 'leaderId',
+            itemWidth: 50,
+			isLoad: {
+				url: '/tenantUser/list?pageNum=1&pageSize=10000',
+				labelKey: 'userName',
+				labelVal: 'userId',
+				method: 'get',
+				resUrl: 'rows',
+			},
+		},
+        {
+			type: 'select',
+			label: '总监',
+			prop: 'directorId',
+            itemWidth: 50,
+			isLoad: {
+				url: '/tenantUser/list?pageNum=1&pageSize=10000',
+				labelKey: 'userName',
+				labelVal: 'userId',
+				method: 'get',
+				resUrl: 'rows',
+			},
+		},
+		{
+			type: 'input',
+			prop: 'orderNum',
+			label: '排序',
+			required: true,
+			itemWidth: 50,
+			//disabled:true,
+			itemType: 'number',
+		},
+	]
+})
+const newPassword = () => {
+    formData.data.password = generatePassword()
+}
+const generatePassword = () => {
+    var length = 12,
+      charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+      password = "";
+    for (var i = 0, n = charset.length; i < length; ++i) {
+        password += charset.charAt(Math.floor(Math.random() * n));
+    }
+    return password;
+}
+
+const getTreeList = () => {
+	proxy.post('/tenantInfo/list').then((message) => {
+		message.map((item) => {
+			item.label = item.enterpriseName
+			item.id = item.tenantId
+			item.children = []
+		})
+		
+		treeListData.value = message
+		console.log(treeListData.value)
+	})
+
+}
+const getList = async (req) => {
+	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
+	loading.value = true
+	proxy
+		.get('/tenantDept/list', sourceList.value.pagination)
+		.then((message) => {
+            recursive(message.data)
+			sourceList.value.data = message.data
+            formConfig.value[0].data = message.data
+			setTimeout(() => {
+				loading.value = false
+			}, 200)
+		})
+}
+
+const treeChange = (e) => {
+	sourceList.value.pagination.tenantId = e.id
+	getList({ tenantId: e.id })
+}
+
+const openModal = () => {
+	dialogVisible.value = true
+	modalType.value = 'add'
+	formData.data = {}
+}
+const TreetenantId = ref('')
+const selection = ref({
+	data: [],
+})
+
+const select = (_selection, row) => {
+	selection.value.data = _selection
+	console.log(_selection.length)
+}
+
+const tree = ref(null)
+const submitForm = () => {
+	byform.value.handleSubmit((valid) => {
+		const method = modalType.value == 'add' ? 'POST' : 'PUT'
+		console.log(method)
+		proxy
+			.post(
+				'/tenantDept',
+				{
+					...formData.data,
+					tenantId: sourceList.value.pagination.tenantId,
+				},
+				method
+			)
+			.then((res) => {
+				ElMessage({
+					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
+					type: 'success',
+				})
+				dialogVisible.value = false
+				getList()
+			})
+	})
+}
+
+const recursive = (data) => {
+    data.map((item) => {
+        item.label = item.deptName
+        item.id = item.deptId
+        if (item.children) {
+            recursive(item.children)
+        }
+    })
+}
+
+
+const getDtl = (row) => {
+	formData.data = {...row}
+	modalType.value = 'edit'
+	console.log(modalType.value)
+	dialogVisible.value = true
+}
+getTreeList()
+getList()
+
+</script>
+  
+<style lang="scss" scoped>
+.dept {
+	padding: 20px;
+	display: flex;
+	justify-content: space-between;
+	.tree {
+		width: 300px;
+	}
+	.content {
+		width: calc(100% - 320px);
+	}
+}
+</style>

+ 5 - 7
src/views/system/role2/index.vue

@@ -282,7 +282,6 @@ const openModal = () => {
 	dialogVisible.value = true
 	modalType.value = 'add'
 	formData.data = {}
-	
 }
 const TreetenantId = ref('')
 const selection = ref({
@@ -294,21 +293,20 @@ const select = (_selection, row) => {
 }
 const openRoomModal = () => {
 	roomDialogVisible.value = true
-	proxy.get('/tenantInfo/roleMenuTreeSelect/' + selection.value.data[0].tenantId).then((res) => {
+	proxy.get('/tenantRole/roleMenuTreeSelect/' + selection.value.data[0].roleId).then((res) => {
 		if(res.code == 200){
 			treeData.value = res.menus
 			formData.treeData = res.checkedKeys
 			tree.value.setCheckedKeys(res.checkedKeys)
 		}
 	})
-	
 }
 const tree = ref(null)
 const submitTree = () => {
-	proxy.post('/tenantInfo/bindingMenu', {
-		tenantId: selection.value.data[0].tenantId,
-		menuIdList: tree.value.getCheckedKeys()
-	}).then((res) => {
+	proxy.post('/tenantRole', {
+		... selection.value.data[0],
+		menuIds:tree.value.getCheckedKeys(),
+	},'PUT').then((res) => {
 		ElMessage({
 			message: '保存成功',
 			type: 'success',

+ 1 - 0
src/views/system/tenant/index.vue

@@ -390,6 +390,7 @@ const getDtl = (row) => {
 	proxy.post('/tenantInfo/detail', { id: row.id }).then((res) => {
 		formData.data = res
 		console.log(formData)
+		modalType.value = 'edit'
 		dialogVisible.value = true
 	})
 }