From d5fac02a6fdc6564ff5da88056245d0fa579f3c6 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 30 Oct 2023 17:07:23 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
---
api/system/role.js | 2
components/curMenu/index.vue | 38 +-
api/doorplateAddress/doorplateAddress.js | 13 +
pages.json | 6
utils/func.js | 32 +-
store/index.js | 8
mixin/uploadMixin.js | 4
pages/home/index.vue | 263 +++++++++++++-------
subPackage/user/components/roleList.vue | 4
api/label/label.js | 10
subPackage/user/role/index.vue | 11
subPackage/workbench/views/cscj.vue | 322 ++++++++++++++++++------
components/tabBar/tabBar.vue | 11
subPackage/workbench/components/lineItem.vue | 2
14 files changed, 492 insertions(+), 234 deletions(-)
diff --git a/api/doorplateAddress/doorplateAddress.js b/api/doorplateAddress/doorplateAddress.js
new file mode 100644
index 0000000..a8c9cf3
--- /dev/null
+++ b/api/doorplateAddress/doorplateAddress.js
@@ -0,0 +1,13 @@
+import http from '@/http/api.js'
+
+//保存
+export const getFuncList = (type, roleName) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getFuncList',
+ method: 'GET',
+ params: {
+ type,
+ roleName
+ }
+ })
+}
\ No newline at end of file
diff --git a/api/label/label.js b/api/label/label.js
new file mode 100644
index 0000000..41b60cf
--- /dev/null
+++ b/api/label/label.js
@@ -0,0 +1,10 @@
+import http from '@/http/api.js'
+
+//保存
+export const getLabelList = (params) => {
+ return http.request({
+ url: 'blade-label/label/list',
+ method: 'GET',
+ params
+ })
+}
\ No newline at end of file
diff --git a/api/system/role.js b/api/system/role.js
index 1fd4a6f..430ee83 100644
--- a/api/system/role.js
+++ b/api/system/role.js
@@ -55,7 +55,7 @@
export const getDetail = (params) => {
return http.request({
- url: '/api/blade-system/role/detail',
+ url: '/blade-system/role/detail',
method: 'GET',
params
})
diff --git a/components/curMenu/index.vue b/components/curMenu/index.vue
index f212f45..80c6bd1 100644
--- a/components/curMenu/index.vue
+++ b/components/curMenu/index.vue
@@ -1,15 +1,16 @@
<template>
- <view class="menu-box" @click="curMenuClick(curMenu)">
- <view v-if="imgShow">
- <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 54' :height='curMenu.imgHeight || 54' shape="circle"></u--image>
- </view>
- <view v-if="textShow" :style="{height: curMenu.numHeight ? curMenu.numHeight + 'px' : '56rpx'}">
- {{curMenu.num}}
- </view>
- <view :style="{height: curMenu.titleHeight ? curMenu.titleHeight + 'px' : '56rpx'}">
- {{curMenu.title}}
- </view>
+ <view class="menu-box" @click="curMenuClick(curMenu)">
+ <view v-if="imgShow">
+ <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 40' :height='curMenu.imgHeight || 40'
+ shape="circle"></u--image>
</view>
+ <view v-if="textShow" :style="{height: curMenu.numHeight ? curMenu.numHeight + 'px' : '56rpx'}">
+ {{curMenu.num}}
+ </view>
+ <view :style="{height: curMenu.titleHeight ? curMenu.titleHeight + 'px' : '56rpx'}">
+ {{curMenu.title}}
+ </view>
+ </view>
</template>
<script>
@@ -21,22 +22,22 @@
return {}
}
},
-
+
imgShow: {
type: Boolean,
default: true
},
-
+
textShow: {
type: Boolean,
default: false
},
},
-
+
methods: {
curMenuClick(e) {
console.log('当前点击处')
-
+
if (e.event) {
e.event(e)
}
@@ -50,16 +51,15 @@
display: flex;
flex-direction: column;
font-size: 28rpx;
-
- & > view {
+
+ &>view {
display: flex;
justify-content: center;
align-items: center;
}
-
- & > view:first-child {
+
+ &>view:first-child {
flex: 1;
}
}
-
</style>
\ No newline at end of file
diff --git a/components/tabBar/tabBar.vue b/components/tabBar/tabBar.vue
index 0c23be8..e047ef0 100644
--- a/components/tabBar/tabBar.vue
+++ b/components/tabBar/tabBar.vue
@@ -9,9 +9,6 @@
</template>
<script>
- import {
- messageCount,
- } from "@/api/system/message.js"
export default {
props: {
currentTab: {},
@@ -65,15 +62,7 @@
},
methods: {
change(e) {
- this.$store.commit("SET_TABBAT_INDEX", e)
this.$emit("change", this.curTabList[e].url)
- let params = {
- recipient: this.userInfo.user_id,
- status: 0
- }
- messageCount(params).then(res => {
- this.$u.func.updateTabbar(res.data)
- })
},
}
diff --git a/mixin/uploadMixin.js b/mixin/uploadMixin.js
index c86afb4..b6e9c0d 100644
--- a/mixin/uploadMixin.js
+++ b/mixin/uploadMixin.js
@@ -25,6 +25,10 @@
}
},
+ created() {
+ this.getHeader()
+ },
+
methods: {
//获取头部
getHeader() {
diff --git a/pages.json b/pages.json
index acbbe3d..34e2925 100644
--- a/pages.json
+++ b/pages.json
@@ -326,12 +326,14 @@
"enablePullDownRefresh": false
}
},
- //消息详情
+ //切换角色
{
"path": "role/index",
"style": {
"navigationBarTitleText": "切换角色",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#4586fe",
+ "navigationBarTextStyle": "white"
}
}
]
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 29715ff..14c76d4 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -14,11 +14,11 @@
<view class="main-select" @click="selectBoxShow = !selectBoxShow">
<u-icon name="map" color="#fff"></u-icon>
<view>
- 当前场所:暂无绑定场所信息
+ 当前场所:{{curSelectSite.name?curSelectSite.name:'暂无绑定场所信息'}}
</view>
- <u-picker title="场所" :show="selectBoxShow" ref="uPicker" :columns="columns" @confirm="confirm"
- @change="changeHandler"></u-picker>
+ <u-picker title="场所" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
+ @confirm="confirm" @change="changeHandler"></u-picker>
</view>
<view class="main-btn">
@@ -26,11 +26,11 @@
</view>
<view class="main-phone-house">
- <view class="phone-box">
+ <view v-if="gridDataList.length>0" class="phone-box">
<grid-menu :gridData='item' v-for="(item, index) in gridDataList" :key='index'></grid-menu>
</view>
- <view class="house-box">
+ <view v-if="hasMenu('楼盘表').length>0" class="house-box">
<box-title :title="'楼盘表'"></box-title>
<view class="content">
<grid-menu :gridData='item' v-for="(item, index) in houseDataList" :key='index'></grid-menu>
@@ -39,19 +39,20 @@
</view>
<view class="main-bt pb-40">
- <view class="mt-20">
+ <view v-if="liveList.length>0" class="mt-20">
<box-title :title="'生活'">
<template slot="titleMore">
<view style="color: red;">titleMore</view>
</template>
</box-title>
-
- <view class="mt-20 b-c-w">
- <menu-list :menuData="liveList"></menu-list>
+ <view class="mt-20">
+ <view class="mt-20 b-c-w">
+ <menu-list :menuData="liveList"></menu-list>
+ </view>
</view>
</view>
- <view class="mt-20">
+ <view v-if="jobList.length>0" class="mt-20">
<box-title :title="'工作台'"></box-title>
<view class="mt-20 b-c-w">
@@ -81,7 +82,7 @@
</view>
</view>
- <tabBar @change='change' :currentTab="0" :tabList="tabList"></tabBar>
+ <tabBar @change='change' :currentTab="0"></tabBar>
</view>
</template>
@@ -90,6 +91,9 @@
import curMenu from "@/components/curMenu/index.vue";
import menuList from "@/components/menuList/index.vue";
import gridMenu from "@/components/gridMenu/index.vue";
+ import {
+ getFuncList
+ } from "@/api/doorplateAddress/doorplateAddress";
export default {
components: {
@@ -101,40 +105,28 @@
data() {
return {
- tabList: uni.getStorageSync("tabBarList") || [],
+ menuList: [],
+ selectRole: {},
selectBoxShow: false,
- columns: [
- ['中国', '美国']
- ],
+ siteColumns: [],
+ curSelectSite: {},
columnData: [],
btnList: [{
imgUrl: '/static/img/sys.png',
- title: '扫一扫'
+ title: '扫一扫',
+ imgWidth: 54,
+ imgHeight: 54
},
{
imgUrl: '/static/img/bs.png',
- title: '报事'
+ title: '报事',
+ imgWidth: 54,
+ imgHeight: 54
}
],
- gridDataList: [{
- title: '物业',
- data: '无数据',
- phone: '无'
- },
- {
- title: '综治网格',
- data: '无数据',
- phone: '无'
- },
- {
- title: '公安网格',
- data: '无数据',
- phone: '无'
- }
- ],
+ gridDataList: [],
- houseDataList: [
- {
+ houseDataList: [{
title: '万达广场',
useSlot: true
},
@@ -152,63 +144,9 @@
}
],
- liveList: [{
- imgUrl: '/static/img/ggbs.png',
- title: '公共报事',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/bmrx.png',
- title: '便民热线',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/zhsb.png',
- title: '租户上报',
- imgWidth: 40,
- imgHeight: 40
- }
- ],
+ liveList: [],
- jobList: [{
- imgUrl: '/static/img/ggbs.png',
- title: '场所记录',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/bmrx.png',
- title: '场所采集',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/zhsb.png',
- title: '出租房管理',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/zhsb.png',
- title: '标签事件',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/zhsb.png',
- title: '场所维护',
- imgWidth: 40,
- imgHeight: 40
- },
- {
- imgUrl: '/static/img/zhsb.png',
- title: '报事审核',
- imgWidth: 40,
- imgHeight: 40
- }
- ],
+ jobList: [],
taskTypeList: [{
title: '一次性',
@@ -237,10 +175,148 @@
},
onShow() {
- uni.hideTabBar()
+ this.init()
+ },
+
+ computed: {
+ hasMenu() {
+ return (name) => {
+ let resultArr = []
+ resultArr = this.getMenu(name, this.menuList, resultArr)
+ if (resultArr.length > 0) {
+ return resultArr
+ } else {
+ return []
+ }
+
+ }
+ }
},
methods: {
+ //初始化
+ init() {
+ this.curSelectSite = {}
+ this.menuList = uni.getStorageSync("menu")
+ this.selectRole = uni.getStorageSync("activeRole")
+ this.getMenuList()
+ this.getSiteList()
+ uni.hideTabBar()
+ },
+ //获取场所列表
+ async getSiteList() {
+ console.log(this.selectRole)
+ let type = null
+ let roleName = this.selectRole.roleName
+ console.log("roleName", roleName)
+ if (roleName == '网格员' || roleName == '系统管理员') {
+ type = 1
+ } else if (roleName == '场所负责人') {
+ type = 2
+ } else if (roleName == '居民') {
+ type = 3
+ }
+
+ const res = await getFuncList(type, roleName)
+ console.log(res, "-----------")
+ let data = res.data
+ this.siteColumns = []
+
+ this.buildSiteColumn(data, 0)
+ console.log(this.siteColumns)
+
+ },
+
+ buildSiteColumn(dataList, index) {
+ if (dataList.length > 0) {
+ this.siteColumns[index] = dataList
+ if (dataList[0].children && dataList[0].children.length > 0) {
+ this.buildSiteColumn(dataList[0].children, index + 1)
+ }
+ }
+ },
+
+ //获取首页菜单
+ getMenuList() {
+ console.log("当前角色菜单", this.menuList)
+ this.getPhoneList()
+ this.getLiveList()
+ this.getWorkbenchList()
+ },
+ getPhoneList() {
+ this.gridDataList = []
+ const resultArr = this.hasMenu('快捷拨号')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.gridDataList.push({
+ title: menu.name,
+ data: "无数据",
+ phone: "无"
+ })
+ })
+ },
+
+ //获取生活菜单
+ getLiveList() {
+ this.liveList = []
+ const resultArr = this.hasMenu('生活')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.liveList.push({
+ imgUrl: menu.source,
+ title: menu.name,
+ })
+ })
+ },
+
+ //获取工作台菜单
+ getWorkbenchList() {
+ this.jobList = []
+ const resultArr = this.hasMenu('工作台')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.jobList.push({
+ imgUrl: menu.source,
+ title: menu.name,
+ })
+ })
+ },
+
+
+
+
+
+ getMenu(menuName, menuList, resultArr) {
+ // console.log(menuList, menuName)
+ for (var i = 0; i < menuList.length; i++) {
+ if (menuList[i].name == menuName) {
+ resultArr.push(menuList[i])
+ } else {
+ if (menuList[i].children && menuList[i].children.length) {
+ this.getMenu(menuName, menuList[i].children, resultArr);
+ }
+ }
+ }
+
+ return resultArr
+
+ },
+
change(index) {
let url = index
this.$u.func.globalNavigator(url, "switchTab")
@@ -263,6 +339,7 @@
// 回调参数为包含columnIndex、value、values
confirm(e) {
console.log('confirm', e)
+ this.curSelectSite = e.value[e.value.length - 1]
this.selectBoxShow = false
}
}
@@ -330,7 +407,7 @@
.content {
display: flex;
flex-wrap: wrap;
-
+
&>view {
margin: 0 16rpx;
margin-top: 20rpx;
diff --git a/store/index.js b/store/index.js
index 7b99d17..c0230a6 100644
--- a/store/index.js
+++ b/store/index.js
@@ -47,7 +47,7 @@
isLogin: lifeData.isLogin ? lifeData.isLogin : false,
// 如果version无需保存到本地永久存储,无需lifeData.version方式
version: '1.0.0',
- activeRoleId: "",
+ activeRole: {},
// tabBarList: [],
adCodeBase: {},
// tabbarIndex: uni.getStorageSync("tabbarIndex") || 0,
@@ -93,9 +93,9 @@
// // console.log(uni.getStorageSync('tabBarList'))
// },
//设置当前激活的角色
- setActiveRoleId(state, roleId) {
- state.activeRoleId = roleId
- uni.setStorageSync('activeRoleId', roleId)
+ setActiveRole(state, role) {
+ state.activeRole = role
+ uni.setStorageSync('activeRole', role)
},
SET_MENU(state, menuList) {
diff --git a/subPackage/user/components/roleList.vue b/subPackage/user/components/roleList.vue
index 18d35fa..cedcfe7 100644
--- a/subPackage/user/components/roleList.vue
+++ b/subPackage/user/components/roleList.vue
@@ -1,6 +1,6 @@
<template>
<view class="role-container">
- <view @click="activeRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''">
+ <view @click="enableRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''">
<view class="l">
<u-icon :name="item.iconName"></u-icon>
<view class="role-name">
@@ -30,7 +30,7 @@
methods: {
//启用角色
- activeRole(item) {
+ enableRole(item) {
this.roleData.forEach(role => {
if (role.id == item.id) {
role.active = true
diff --git a/subPackage/user/role/index.vue b/subPackage/user/role/index.vue
index 837cb40..e6ee920 100644
--- a/subPackage/user/role/index.vue
+++ b/subPackage/user/role/index.vue
@@ -33,6 +33,7 @@
}
},
created() {
+ this.selectRole = uni.getStorageSync("activeRole")
this.getUserRole()
},
@@ -48,12 +49,11 @@
let data = res.data
console.log(data)
data.forEach(e => {
-
this.roleData.push({
id: e.id,
iconName: 'account-fill',
roleName: e.roleName,
- active: e.id == this.activeRoleId ? true : false
+ active: e.id == this.selectRole.id ? true : false
})
})
@@ -63,23 +63,22 @@
select(item) {
this.selectRole = item
+ console.log("当前选中角色", this.selectRole)
},
async submit() {
const that = this
//保存当前激活的角色
- store.commit("setActiveRoleId", this.selectRole.id)
+ store.commit("setActiveRole", this.selectRole)
//获取角色菜单
const res = await dynamicMenu(this.selectRole.id)
-
//把菜单存入store中
let data = res.data
- const appMenu = data.filter(e => e.name == 'app')[0]
+ const appMenu = data.filter(e => e.name == 'app')[0].children
console.log("菜单:", appMenu)
store.commit("SET_MENU", appMenu)
-
uni.showToast({
diff --git a/subPackage/workbench/components/lineItem.vue b/subPackage/workbench/components/lineItem.vue
index 36f1bd2..ad3b70e 100644
--- a/subPackage/workbench/components/lineItem.vue
+++ b/subPackage/workbench/components/lineItem.vue
@@ -1,5 +1,5 @@
<template>
- <view class="line-item-container" style="margin-bottom: 1px;">
+ <view class="line-item-container" style="margin-bottom: 20rpx;">
<view v-for="(item, index) in dataInfo" :key="index" class="line-item">
<view class="l">
diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index 129019b..410331e 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -5,28 +5,35 @@
<box-title title="基础信息"></box-title>
</view>
<view class="item">
- <u-form-item class="form-item" labelWidth="100" label="场所名称:" required prop="location">
- <u--input border="none" v-model="form.location" placeholder="请输入当前位置">
+
+ <!-- <u-form-item class="form-item" labelWidth="100" label="场所地址:" required prop="location">
+ <u--input border="none" v-model="form.location" placeholder="请选择场所地址">
+ </u--input>
+ </u-form-item> -->
+
+ <u-form-item class="form-item" labelWidth="100" label="场所名称:" required prop="placeName">
+ <u--input border="none" v-model="form.placeName" placeholder="请输入当前位置">
</u--input>
</u-form-item>
- <u-form-item @click="popup" class="form-item" labelWidth="100" label="标签:" required prop="location">
+ <u-form-item @click="popup" class="form-item" labelWidth="100" label="标签:" required prop="label">
<u--input border="none" placeholder="请选择地址标签">
</u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<view v-if="showLabelList.length>0" class="label">
<view v-for="(item,index) in showLabelList" :key="index" class="activeLabel">
- <u-tag size="mini" :text="item.text"></u-tag>
+ <u-tag closable :show="!item.isClose" size="mini" @close="delTag(item)"
+ :text="item.text"></u-tag>
</view>
</view>
- <u-form-item class="form-item" labelWidth="100" label="备注:" required prop="location">
+ <u-form-item class="form-item" labelWidth="100" label="备注:" prop="location">
<u--input border="none" v-model="form.remark" placeholder="请输入备注">
</u--input>
</u-form-item>
- <u-form-item class="form-item" labelWidth="100" label="经纬度:" required prop="location">
+ <u-form-item class="form-item" labelWidth="100" label="经纬度:" prop="location">
<u--input border="none" v-model="form.jwd" placeholder="请输入经纬度">
</u--input>
</u-form-item>
@@ -37,11 +44,11 @@
</view>
<view class="item">
- <u-form-item class="form-item" labelWidth="100" label="场所负责人:" required prop="location">
- <u--input border="none" v-model="form.charge" placeholder="请输入场所负责人">
+ <u-form-item class="form-item" labelWidth="100" label="场所负责人:" prop="principal">
+ <u--input border="none" v-model="form.principal" placeholder="请输入场所负责人">
</u--input>
</u-form-item>
- <u-form-item class="form-item" labelWidth="100" label="手机号:" required prop="location">
+ <u-form-item class="form-item" labelWidth="100" label="手机号:" prop="location">
<u--input border="none" v-model="form.phone" placeholder="请输入手机号">
</u--input>
</u-form-item>
@@ -65,16 +72,44 @@
</u-form>
<view class="box-title">
- <view>
- <box-title title="综治网格"></box-title>
- </view>
+ <box-title title="综治网格">
+ <template slot="titleMore">
+ <view class="title-more">
+ <view class="red item"></view>
+ <view class="orange item">85.9</view>
+ <view class="green item"></view>
+ </view>
+ </template>
+ </box-title>
</view>
<view class="item">
- <lineItem :dataInfo="dataInfo">
+ <lineItem :dataInfo="comprehensiveData.basic">
</lineItem>
- <lineItem :dataInfo="dataInfo1">
+ <lineItem :dataInfo="comprehensiveData.scene">
+ <template v-slot:pic="{scope}">
+ {{scope.value}}
+ </template>
+ </lineItem>
+ </view>
+
+ <view class="box-title">
+ <box-title title="公安网格">
+ <template slot="titleMore">
+ <view class="title-more">
+ <view class="red item"></view>
+ <view class="orange item">85.9</view>
+ <view class="green item"></view>
+ </view>
+ </template></box-title>
+ </view>
+
+ <view class="item">
+ <lineItem :dataInfo="comprehensiveData.basic">
+ </lineItem>
+
+ <lineItem :dataInfo="comprehensiveData.scene">
<template v-slot:pic="{scope}">
{{scope.value}}
</template>
@@ -82,9 +117,16 @@
</view>
+ <view class="bottom">
+ <view class="btn">
+ <u-button @click="addRent" type="primary" text="提交"></u-button>
+ </view>
+ </view>
+
+
<uni-popup class="citys_win popup_win" ref="uniPopup" type="bottom">
- <wyh-tree-select :items="items" title="标签选择" :showNav="true" defaultActiveColor="#4586fe"
+ <wyh-tree-select :items="labelList" title="标签选择" :showNav="true" defaultActiveColor="#4586fe"
:activeIds="activeIds" @clickItem="labelClick" :showCancel="false" :showConfirm="false">
</wyh-tree-select>
</uni-popup>
@@ -96,6 +138,9 @@
<script>
import uploadMixin from "@/mixin/uploadMixin";
import lineItem from "@/subPackage/workbench/components/lineItem.vue"
+ import {
+ getLabelList
+ } from "@/api/label/label";
export default {
mixins: [uploadMixin],
components: {
@@ -104,77 +149,125 @@
data() {
return {
form: {},
- rules: {},
+ rules: {
+ 'userInfo.name': {
+ type: 'string',
+ required: true,
+ message: '请填写姓名',
+ trigger: ['blur', 'change']
+ },
+ },
- items: [{
+ labelList: [{
text: '全部标签',
- children: [{
- text: '餐馆',
- id: 1,
- },
- {
- text: '旅馆、招待所',
- id: 2,
- }, {
- text: '居民住宿',
- id: 3
- }
- ],
+ children: [],
dot: false
}, ],
- dataInfo: [{
- label: "社区名称",
- value: "暂无数据"
- },
- {
- label: "网格名称",
- value: "暂无数据"
- },
- {
- label: "网格员",
- value: "暂无数据"
- },
- {
- label: "联系电话",
- value: "暂无数据"
- }
- ],
-
- dataInfo1: [{
- label: "场所照片",
- value: "",
- useSlot: "pic",
- },
- {
- label: "采集人",
- value: "未完善"
- },
- {
- label: "采集时间",
- value: "未完善"
- },
- {
- label: "场所负责人",
- value: "未完善",
- },
- {
- label: "采集人",
- value: "未完善"
- },
- {
- label: "采集时间",
- value: "未完善",
- }
- ],
+ comprehensiveData: {
+ basic: [{
+ label: "社区名称",
+ value: "暂无数据"
+ },
+ {
+ label: "网格名称",
+ value: "暂无数据"
+ },
+ {
+ label: "网格员",
+ value: "暂无数据"
+ },
+ {
+ label: "联系电话",
+ value: "暂无数据"
+ }
+ ],
+ scene: [{
+ label: "场所照片",
+ value: "",
+ useSlot: "pic",
+ },
+ {
+ label: "采集人",
+ value: "未完善"
+ },
+ {
+ label: "采集时间",
+ value: "未完善"
+ },
+ {
+ label: "场所负责人",
+ value: "未完善",
+ },
+ {
+ label: "采集人",
+ value: "未完善"
+ },
+ {
+ label: "采集时间",
+ value: "未完善",
+ },
+ {
+ label: "历史事件",
+ value: "未完善",
+ }
+ ],
+ },
+ publicData: {
+ basic: [{
+ label: "公安局",
+ value: "暂无数据"
+ },
+ {
+ label: "派出所",
+ value: "暂无数据"
+ },
+ {
+ label: "辖区民警",
+ value: "暂无数据"
+ },
+ {
+ label: "联系电话",
+ value: "暂无数据"
+ }
+ ],
+ scene: [{
+ label: "消防照片",
+ value: "",
+ useSlot: "pic",
+ },
+ {
+ label: "采集人",
+ value: "未完善"
+ },
+ {
+ label: "采集时间",
+ value: "未完善"
+ },
+ {
+ label: "消防负责人",
+ value: "未完善",
+ },
+ {
+ label: "采集人",
+ value: "未完善"
+ },
+ {
+ label: "采集时间",
+ value: "未完善",
+ },
+ {
+ label: "历史事件",
+ value: "未完善",
+ }
+ ],
+ },
activeIds: [],
showLabelList: []
}
},
- created() {
-
- },
+ created() {},
mounted() {
},
@@ -182,7 +275,7 @@
},
onShow() {
-
+ this.getLabel()
},
methods: {
//弹出层打开
@@ -190,22 +283,44 @@
this.$refs.uniPopup.open()
},
+ getLabel() {
+ getLabelList({
+ size: -1
+ }).then(res => {
+ let data = res.data.records
+ data.sort((a, b) => a.sort - b.sort)
+
+ data.forEach(label => {
+ this.labelList[0].children.push({
+ id: label.id,
+ text: label.labelName
+ })
+ })
+ })
+ },
+
labelClick(item) {
//判断label是否已在
const label = this.showLabelList.find(e => e.id == item.id)
-
if (label) {
//在,去掉
this.showLabelList = this.showLabelList.filter(e => e.id != label.id)
- this.activeIds = this.activeIds.filter(e => id != label.id)
+ this.activeIds = this.activeIds.filter(e => e != label.id)
} else {
//不在,添加
+ item.isClose = false
this.showLabelList.push(item)
this.activeIds.push(item.id)
}
- this.showLabelList.sort((a, b) => a.id - b.id)
+ this.showLabelList.sort((a, b) => a.sort - b.sort)
+
+ },
+ delTag(label) {
+ label.isClose = true
+ this.showLabelList = this.showLabelList.filter(e => e.id != label.id)
+ this.activeIds = this.activeIds.filter(e => e != label.id)
}
}
@@ -216,13 +331,30 @@
.container {
position: relative;
width: 100%;
- height: 100%;
+ // height: 100%;
display: flex;
flex-direction: column;
background: #F9F9FA;
.box-title {
padding: 10px 0;
+
+ .title-more {
+ display: flex;
+ align-items: center;
+ height: 100%;
+
+ .item {
+ width: 50rpx;
+ height: 40rpx;
+ color: #ffffff;
+ padding: 6rpx;
+ font-size: 2rpx;
+ text-align: center;
+ line-height: 20px;
+ }
+
+ }
}
.item {
@@ -237,10 +369,12 @@
padding: 10rpx 30rpx;
display: flex;
background-color: #ffffff;
+ flex-wrap: wrap;
.activeLabel {
// width: 80rpx;
margin-left: 10rpx;
+ margin-top: 10rpx
}
}
@@ -252,5 +386,31 @@
background-color: #ffffff;
padding: 40rpx 30rpx;
}
+
+ .bottom {
+ padding: 20rpx;
+ background-color: #ffffff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .btn {
+ width: calc(100% - 40rpx);
+ }
+ }
+ }
+
+ .red {
+ background-color: red;
+ border-radius: 10rpx 0rpx 0rpx 10rpx;
+ }
+
+ .orange {
+ background-color: orange;
+ }
+
+ .green {
+ background-color: green;
+ border-radius: 0rpx 10rpx 10rpx 0rpx;
}
</style>
\ No newline at end of file
diff --git a/utils/func.js b/utils/func.js
index b9ef044..3362a2b 100644
--- a/utils/func.js
+++ b/utils/func.js
@@ -1,6 +1,7 @@
import store from "@/store/index.js"
import {
- dynamicMenu
+ dynamicMenu,
+ getDetail
} from "@/api/system/role.js"
import {
logAdd
@@ -10,30 +11,33 @@
const install = (Vue, vm) => {
// 登录操作 1
- const login = (userInfo) => {
+ const login = async (userInfo) => {
vm.$u.vuex('userInfo', userInfo)
vm.$u.vuex('accessToken', userInfo.access_token)
vm.$u.vuex('isLogin', true)
let activeRoleId = userInfo.role_id.split(",")[0]
- console.log("当前激活角色的id:", activeRoleId)
- //添加当前激活的roleId(默认取第一个)
- vm.$u.vuex('activeRoleId', activeRoleId)
+ const resDetail = await getDetail({
+ id: activeRoleId
+ })
+ console.log("当前激活角色的id:", resDetail.data)
+ //添加当前激活的角色(默认取第一个)
+ store.commit('setActiveRole', resDetail.data)
//获取角色菜单
- dynamicMenu(activeRoleId).then(res => {
- let data = res.data
- let appMenu = data.filter(e => e.name == 'app')[0]
- console.log("当前角色菜单:", appMenu)
- vm.$u.vuex('menu', appMenu)
+ const {
+ data
+ } = await dynamicMenu(activeRoleId)
- //跳转到首页
- uni.switchTab({
- url: '/pages/home/index'
- })
+ let appMenu = data.filter(e => e.name == 'app')[0].children
+ console.log("当前角色菜单:", appMenu)
+ store.commit('SET_MENU', appMenu)
+ //跳转到首页
+ uni.switchTab({
+ url: '/pages/home/index'
})
}
--
Gitblit v1.9.3