zhuzhen há 10 meses atrás
pai
commit
8d314adf19

+ 1 - 4
src/renderer/src/api/SupdemApi.ts

@@ -24,10 +24,7 @@ class DeptApi {
    * @param id 部门ID
    */
   static subcateList(id: string): Promise<any> {
-	  let data = {
-		  id:id
-	  }
-    return FetchRequest.post(this.url,JSON.stringify(data),true);
+    return FetchRequest.get("/api/sys/supply/subcateList?id="+id,true);
   }
   /**
    * 获取供求列表

BIN
src/renderer/src/assets/icon.jpeg


+ 1 - 1
src/renderer/src/config/VimConfig.ts

@@ -14,7 +14,7 @@ interface VimConfig {
 }
 
 const vimConfig: VimConfig = {
-  name: 'V-IM(乐聊)',
+  name: '信息通',
   host: 'sup.workervip.com',
   hostwx: '47.115.48.242',
   httProtocol: 'http',

+ 2 - 1
src/renderer/src/views/Home.vue

@@ -35,7 +35,8 @@
 				</li> -->
 				<li title="供求">
 					<router-link :to="'/index/supdem'">
-						<i class="iconfont icon-v-icon_xinyong_xianxing_jijin-284"></i>
+						<i style="color: white;">供求</i>
+						<!-- <i class="iconfont icon-v-icon_xinyong_xianxing_jijin-284"></i> -->
 					</router-link>
 				</li>
 				<li title="收藏">

+ 2 - 2
src/renderer/src/views/Login.vue

@@ -3,8 +3,8 @@
     <vim-top />
     <el-form ref="formRef" v-loading="loading" class="login" :model="form" label-width="60px">
       <div class="title">
-        <img src="../assets/icon.png" alt="logo" class="logo" />
-        <span style="margin-left: 20px">{{ vimConfig.name }} 登录</span>
+        <img src="../assets/icon.jpeg" alt="logo" class="logo" />
+        <span style="margin-left: 20px">{{ vimConfig.name }}</span>
       </div>
       <el-form-item label="用户名" class="item">
         <el-input v-model="form.name"></el-input>

+ 31 - 14
src/renderer/src/views/supdem/Index.vue

@@ -10,12 +10,15 @@
         </el-row>
       </div>
       <el-scrollbar class="list">
-        <el-tree
+        <!-- <el-tree
           :default-expand-all="true"
           :data="tree"
           :props="defaultProps"
           @node-click="handleNodeClick"
-        />
+        /> -->
+		<view class="title_caty" v-for="(item,_index) in tree" @click="handleNode(item.id)">
+			{{item.categoryName}}
+		</view>
       </el-scrollbar>
     </div>
     <div class="right">
@@ -39,7 +42,8 @@ interface Tree {
   id: string
   label: string
   categoryType: number
-  children?: Tree[]
+  categoryName:string
+  // children?: Tree[]
 }
 
 const defaultProps = {
@@ -48,14 +52,17 @@ const defaultProps = {
 }
 
 const handleNodeClick = (data: Tree) => {
-	console.log("打孩子",data.categoryType)
-  if (data.categoryType == 2) {
-    id.value = data.id
-	console.log("打孩子")
-    router.push('/index/supdem/' + data.id)
-  }
+	console.log("打孩子77",data)
+	router.push('/index/supdem/' + data.id)
+  // if (data.categoryType == 2) {
+  //   id.value = data.id
+  //   router.push('/index/supdem/' + data.id)
+  // }
+}
+const handleNode  = (id:string) => {
+	console.log("打孩子77",id)
+	router.push('/index/supdem/' + id)
 }
-
 const tree = ref<Array<Tree>>([])
 SupdemApi.list().then((res) => {
   tree.value.splice(0, tree.value.length)
@@ -66,7 +73,6 @@ SupdemApi.list().then((res) => {
 })
 
 onActivated(() => {
-	console.log("打孩子8888")
   if (id.value) {
     router.push('/index/dept/' + id.value)
   }
@@ -74,7 +80,18 @@ onActivated(() => {
 </script>
 
 <style lang="less" scoped>
-.el-tree {
-  background-color: transparent !important;
-}
+	.main .left{
+		width: 15rem !important;
+	}
+	.title_caty{
+		display: block;
+		text-align: center;
+		font-size: 18px;
+		color: black;
+		font-weight: 600;
+		padding: 5%;
+	}
+	.el-tree {
+	  background-color: transparent !important;
+	}
 </style>

+ 64 - 10
src/renderer/src/views/supdem/List.vue

@@ -14,6 +14,11 @@
 				<el-button :type="rangType=='1'?'success':''" @click="changeTy('1')">求</el-button>
 				<el-button type="primary"  v-if="supplyFlag == 1"  @click="poupForm">发布需求</el-button>
 			</div>
+			<view class="subListcd">
+				<view  class="subcd"  v-for="(item,index) in ctList" :class="cksub== index?'cksub':''" @click="changeCk(index,item.id)">
+					{{item.categoryName}}
+				</view>
+			</view>
 			<view class="messageBox">
 				<view class="leftBox" v-if="rangType=='0'">
 					<!-- <view class="">
@@ -77,6 +82,7 @@
 	const route = useRoute()
 	const router = useRouter()
 	const keyword = ref('')
+	const cksub = ref(0)
 	const loading = ref(true)
 	const bupplyList : any = ref([]);
 	const buyList : any = ref([]);
@@ -85,31 +91,54 @@
 	const supply = ref(false);
 	const supplyContent = ref('');
 	const buyContent = ref('');
-	const supplyContentapl = ref('供 内容  举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
-	const buyContentapl = ref('求 内容  举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
+	const supplyContentapl = ref('供');
+	const buyContentapl = ref('求');
 	const rangType = ref('0')
-	
+	const ctList : any = ref([]);
+	const cdid  = ref('');
 	if (typeof deptId === 'string') {
 		loading.value = true
-		SupdemApi.getSupplyBuyList(deptId)
+		SupdemApi.subcateList(deptId)
 			.then((res) => {
-				bupplyList.value = res.data.bupplyList;
-				buyList.value = res.data.buyList;
-				supplyFlag.value = res.data.supplyFlag
+				console.log("subcateList",res)
+				ctList.value =  res.data
+				cdid.value = res.data[0].id
+				getSupply(res.data[0].id)
+				// bupplyList.value = res.data.bupplyList;
+				// buyList.value = res.data.buyList;
+				// supplyFlag.value = res.data.supplyFlag
 			})
 			.finally(() => {
 				loading.value = false
 			})
 	}
+
+	const getSupply = (deptId:string)=>{
+			SupdemApi.getSupplyBuyList(deptId)
+				.then((res) => {
+					bupplyList.value = res.data.bupplyList;
+					buyList.value = res.data.buyList;
+					supplyFlag.value = res.data.supplyFlag
+				})
+				.finally(() => {
+					loading.value = false
+				})
+	}
 	const poupForm=()=>{
 		supply.value = true;
+		
 	}
 	const changeTy=(s:string)=>{
 		rangType.value = s
 	}
+	const changeCk=(i:number,id:string)=>{
+		cksub.value = i;
+		cdid.value = id;
+		getSupply(id)
+	}
 	const save = () => {
 		console.log("supplyContent", supplyContent.value)
-		SupdemApi.addSupply(deptId,supplyContent.value, buyContent.value).then((res) => {
+		SupdemApi.addSupply(cdid.value,supplyContent.value, buyContent.value).then((res) => {
 			// map.value = Tools.listToMap(res.data);
 			console.log("发布结果",res)
 			if(res.code == 200){
@@ -139,7 +168,32 @@
 		padding: 0 !important;
 		box-sizing: border-box;
 	}
-
+	.subListcd{
+		flex: 1;
+		display: flex;
+		// justify-content: space-between;
+		padding: 0 2%;
+		align-items: center;
+		// border: 1px solid #b7b7b7;
+		margin-right: 2%;
+		margin-top: 5px;
+		border-radius: 5px;
+		flex-wrap: wrap;
+		.subcd{
+			height: 100%;
+			display: flex;
+			align-items: center;
+			min-width: 50px;
+			justify-content: center;
+			font-size: 16px;
+			font-weight: 600;
+			height: 40px;
+			line-height: 40px;
+		}
+	}
+	.cksub{
+		color: #388fff;
+	}
 	.users {
 		padding: 18px;
 		height: 100%;
@@ -184,7 +238,7 @@
 	}
 	.messageBox {
 		display: block;
-		padding: 5%;
+		padding: 0 5%;
 		// display: flex;
 		// justify-content: space-around;
 		height: 100%;

+ 2 - 2
src/renderer/src/views/supdem/ListDetail.vue

@@ -81,8 +81,8 @@
 	const supply = ref(false);
 	const supplyContent = ref('');
 	const buyContent = ref('');
-	const supplyContentapl = ref('供 内容  举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
-	const buyContentapl = ref('求 内容  举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
+	const supplyContentapl = ref('供');
+	const buyContentapl = ref('求');
 	const rangType = ref('0')
 	
 	if (typeof deptId === 'string') {