浏览代码

主题页面

lidongyu 1 年之前
父节点
当前提交
db54b4b303
共有 3 个文件被更改,包括 179 次插入1 次删除
  1. 51 0
      api/handleAffairs/topicType.js
  2. 10 1
      pages.json
  3. 118 0
      pages/topic/topic.vue

+ 51 - 0
api/handleAffairs/topicType.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询主题类型配置列表
+export function listTopicType(query) {
+  return request({
+    url: '/jnb/topicType/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询主题类型配置列表
+export function listAll(query) {
+  return request({
+    url: '/jnb/topicType/listAll',
+    method: 'get',
+    params: query
+  })
+}
+// 查询主题类型配置详细
+export function getTopicType(id) {
+  return request({
+    url: '/jnb/topicType/' + id,
+    method: 'get'
+  })
+}
+
+// 新增主题类型配置
+export function addTopicType(data) {
+  return request({
+    url: '/jnb/topicType',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改主题类型配置
+export function updateTopicType(data) {
+  return request({
+    url: '/jnb/topicType',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除主题类型配置
+export function delTopicType(id) {
+  return request({
+    url: '/jnb/topicType/' + id,
+    method: 'delete'
+  })
+}

+ 10 - 1
pages.json

@@ -334,6 +334,15 @@
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "知识库详情"
 			}
+		},
+		{
+			"path" : "pages/topic/topic",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "主题导航"
+			}
 		}
 	],
 	"easycom": {
@@ -387,4 +396,4 @@
 		}]
 	},
 	"subPackages": []
-}
+}

+ 118 - 0
pages/topic/topic.vue

@@ -0,0 +1,118 @@
+<template>
+	<view>
+		<view style="height: 20%;">
+			<button v-for="(item,index) in userType" @click="onclick(item)">{{item.dictLabel}}
+			</button>
+		</view>
+		<view>
+			<uni-grid :column="2" :square="false" :highlight="false">
+				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index">
+					<view class="grid-item-box">
+						<text class="text">{{ item.deptName }}</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getDicts
+	} from "@/api/system/dict/data.js"
+	import {
+		listAll
+	} from "@/api/handleAffairs/topicType.js"
+	export default {
+
+		data() {
+			return {
+				userType: [], // 初始化用户类型为空
+				dataList: [],
+
+			}
+		},
+		created() {
+			this.getdictData()//初始化字典按钮
+			this.getdataList()//初始化数据
+		},
+		methods: {
+			
+			getdataList(data){
+				let _that = this
+				if (!data) {
+					data = {
+						objectOfHandling: 0,
+						yesOrNoShow: "0"
+					}
+				}
+				listAll(data).then(res => {
+					_that.dataList = res.data
+				})
+				console.log(_that.dataList)
+			},
+			onclick(row) {
+				
+				let data = {
+					objectOfHandling: row.dictValue,
+					yesOrNoShow: "0"
+				}
+				this.getdataList(data)
+			},
+			getdictData() {
+				let _that = this
+				getDicts("object_application").then(res => {
+					_that.userType = res.data
+				})
+			},
+			changeUserType(type) {
+				this.userType = type
+			}
+		},
+
+	}
+</script>
+
+<style>
+	/* view {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		height: 100vh;
+	} */
+
+	button {
+		margin-bottom: 10px;
+	}
+
+	.selected {
+		background-color: #007bff;
+		color: #fff;
+	}
+
+	.grid-item-box {
+		flex: 1;
+		// position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		padding: 15px 0;
+	}
+
+	.grid-item-box-row {
+		flex: 1;
+		// position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		padding: 15px 0;
+	}
+</style>