Ver Fonte

bug修改,顶部修改

asd26269546 há 2 anos atrás
pai
commit
835e1e4ad4

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

@@ -30,6 +30,9 @@
 					@input="commonsEmit"
 					:type="i.itemType ? i.itemType : 'text'"
 					:disabled="i.disabled ? i.disabled : false"
+					:max="i.max"
+					:min="i.min"
+					:maxlength="i.maxlength"
 				/>
 				<el-select
 					v-model="formData[i.prop]"

+ 37 - 5
src/components/headerBar/header-bar.vue

@@ -11,10 +11,15 @@
 						功能导览
 					</div>
 				</li>
-
-				<li class="nav-li active" v-for="i in barData" :key="i.id">
-					<span>{{ i.name }}</span>
-				</li>
+				<div class="auto-list">
+					<li class="nav-li" v-for="(i,index) in barData" v-show="index < autoListChidrenNum - 1" :key="i.id">
+						<span>{{index +  i.name }}</span>
+					</li>
+					<li class="nav-li more-box">
+						更多
+					</li>
+				</div>
+				
 				<div
 					class="header-bar-warp"
 					v-if="isChildMenu"
@@ -146,12 +151,20 @@ const { proxy } = getCurrentInstance()
 const sidebarRouters = ref([])
 const input1 = ref('')
 const isChildMenu = ref(false)
+const autoListChidrenNum = ref(0)
 const menuData = ref([])
 const barData = ref([
 	{name:'首页1',id:1},
 	{name:'首页2',id:2},
 	{name:'首页3',id:3},
 	{name:'首页4',id:4},
+	{name:'首页5',id:5},
+	{name:'首页6',id:6},
+	{name:'首页7',id:7},
+	{name:'首页8',id:8},
+	{name:'首页9',id:9},
+	{name:'首页10',id:10},
+	{name:'首页11',id:11},
 ])
 const userData = ref(Cookies.get('username') || '')
 
@@ -229,8 +242,21 @@ function routerPush(i) {
 	isChildMenu.value = false
 }
 
+//获取浏览器宽度
+function getBrowserWidth() {
+	return document.documentElement.clientWidth
+}
+
+//计算auto-list 能放下几个
+function calcAutoListChidren() {
+	autoListChidrenNum.value = Math.floor((getBrowserWidth() - 390) / 120)
+	console.log(autoListChidrenNum.value )
+}
+
 onMounted(() => {
 	routerInit()
+	window.addEventListener('resize', calcAutoListChidren);
+	
 	proxy.get('/getInfo').then(res=>{
 		userData.value = res.user.userName
 	})
@@ -381,6 +407,12 @@ onMounted(() => {
 		margin: 0;
 		height: 50px;
 		overflow: hidden;
+		.auto-list{
+			width: calc(100vw - 350px);
+			li{
+				float: left;
+			}
+		}
 		.logo {
 			color: #fff;
 			font-size: 20px;
@@ -389,7 +421,7 @@ onMounted(() => {
 			margin: 0 20px;
 		}
 		.nav-li {
-			width: 130px;
+			width: 120px;
 			height: 50px;
 			font-size: 14px;
 			font-weight: 400;

+ 31 - 16
src/views/system/dept2/index.vue

@@ -191,6 +191,7 @@ let rules = ref({
   parentId: [{ required: true, message: "请选择上级机构", trigger: "blur" }],
   orderNum: [{ required: true, message: "排序不能为空", trigger: "blur" }],
   deptName: [{ required: true, message: "机构名称不能为空", trigger: "blur" }],
+  type: [{ required: true, message: "机构类型不能为空", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = computed(() => {
@@ -269,7 +270,9 @@ const config = computed(() => {
 });
 
 let formData = reactive({
-  data: {},
+  data: {
+    orderNum:1,
+  },
 });
 const formOption = reactive({
   inline: true,
@@ -327,26 +330,14 @@ const formConfig = computed(() => {
       label: "负责人",
       prop: "leaderId",
       itemWidth: 50,
-      isLoad: {
-        url: "/tenantUser/list?pageNum=1&pageSize=10000",
-        labelKey: "userName",
-        labelVal: "userId",
-        method: "get",
-        resUrl: "rows",
-      },
+      data:[],
     },
     {
       type: "select",
       label: "总监",
       prop: "directorId",
       itemWidth: 50,
-      isLoad: {
-        url: "/tenantUser/list?pageNum=1&pageSize=10000",
-        labelKey: "userName",
-        labelVal: "userId",
-        method: "get",
-        resUrl: "rows",
-      },
+      data:[],
     },
     {
       type: "input",
@@ -419,7 +410,10 @@ const handleAdd = (row) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
-  formData.data = {};
+  formData.data = {
+    orderNum:1,
+  };
+  getUserList()
 };
 const TreetenantId = ref("");
 const selection = ref({
@@ -503,6 +497,27 @@ const getDtl = (row) => {
   console.log(modalType.value);
   dialogVisible.value = true;
 };
+
+const getUserList = () => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: sourceList.value.pagination.tenantId,
+    })
+    .then((message) => {
+      message.rows.map((item) => {
+        item.label = item.nickName;
+        item.id = item.userId;
+      });
+      formConfig.value[3].data = message.rows;
+      formConfig.value[4].data = message.rows;
+      console.log(config)
+    });
+};
+
+
+
 getTreeList();
 getList();
 </script>

+ 4 - 7
src/views/system/dict/dictCommonType.vue

@@ -317,7 +317,7 @@ const submitForm = () => {
 		submitLoading.value = true
 
 		proxy
-			.post('/tenantInfo/' + modalType.value, formData.data)
+			.post('/dictCommonType/' + modalType.value, formData.data)
 			.then((res) => {
 				ElMessage({
 					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
@@ -331,12 +331,9 @@ const submitForm = () => {
 }
 
 const getDtl = (row) => {
-	proxy.post('/tenantInfo/detail', { id: row.id }).then((res) => {
-		formData.data = res
-		console.log(formData)
-		modalType.value = 'edit'
-		dialogVisible.value = true
-	})
+	formData.data = { ...row }
+	modalType.value = 'edit'
+	dialogVisible.value = true
 }
 
 const changeStatus = (row) => {

+ 3 - 2
src/views/system/dict/dictTenantDtl.vue

@@ -113,7 +113,7 @@ const config = computed(() => {
 		{
 			attrs: {
 				label: '值',
-				prop: 'dictKey',
+				prop: 'dictValue',
 			},
 		},
 		{
@@ -228,9 +228,10 @@ const getList = async (req) => {
 	proxy
 		.post('/dictTenantData/page', sourceList.value.pagination)
 		.then((message) => {
-			console.log(message)
+			
 			sourceList.value.data = message.rows
 			sourceList.value.pagination.total = message.total
+			console.log(sourceList.value.data)
 			setTimeout(() => {
 				loading.value = false
 			}, 200)

+ 0 - 1
src/views/system/dict/dictTenantType.vue

@@ -17,7 +17,6 @@
 				:loading="loading"
 				highlight-current-row
 				:selectConfig="selectConfig"
-				searchKey="userName"
 				:table-events="{
 					//element talbe事件都能传
 					select: select,

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

@@ -111,7 +111,7 @@ let dialogVisible = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  tenantId: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
+  tenantId: [{pattern: /^\w+$/, message: '请输入正确的租户号,禁止下划线外的其他符号,不区分大小写'}],
   password: [{ required: true, message: "请输入密码", trigger: "blur" }],
   enterpriseName: [
     { required: true, message: "请输入企业名称", trigger: "blur" },
@@ -313,6 +313,7 @@ const formConfig = computed(() => {
       type: "input",
       prop: "enterpriseName",
       label: "企业名称",
+      maxlength:100
     },
     {
       type: "radio",
@@ -410,6 +411,8 @@ const submitForm = () => {
       dialogVisible.value = false;
       submitLoading.value = false;
       getList();
+    }).catch((err)=>{
+      submitLoading.value = false;
     });
   });
 };