mineConfigurationSlot.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <!--
  2. 个人中心按钮匹配组件
  3. <mineConfigurationSlot :mineConfig="mineConfigData"></mineConfigurationSlot>
  4. import { mineConfigurationSlot } from '@/component/mineConfigurationSlot'
  5. import { getMineConfig } from '@/utils/mineConfig'
  6. components: {
  7. mineConfigurationSlot,
  8. },
  9. mineConfigData: [],
  10. //获取菜单配置
  11. async systemAppletLayoutSelect() {
  12. const {data} = await systemAppletLayoutSelect({module:'mine'})
  13. if(data.code == 200){
  14. let list = JSON.parse(JSON.stringify(data.data))
  15. for(let i=0;i<list.length;i++){
  16. list[i].layout = JSON.parse(list[i].layout);
  17. }
  18. this.$set(this,'mineConfigData',getMineConfig(list));
  19. console.log('mineConfigData',this.mineConfigData)
  20. }
  21. },
  22. -->
  23. <template>
  24. <view class="mineConfigurationSlot">
  25. <view class="button-max-big-box">
  26. <permissionsSlot class="button-for-box" v-for="(item,index) in mineConfig.layout" :key="index" :hasPermi="item.limits">
  27. <view class="button-max-box" @click="buttonClick(item)">
  28. <img class="left-img" :src="item.img">
  29. <view>{{item.name}}</view>
  30. <view class="view-three-one" v-if="item.route === 'alarm' && securityAlertNum>0">{{securityAlertNum}}</view>
  31. <view class="view-three-two" v-if="item.route === 'laboratory' && adminSubCount>0">{{adminSubCount}}</view>
  32. <view class="view-three-two" v-if="item.route === 'record' && wranDoCount>0">{{wranDoCount}}</view>
  33. <view class="view-three-type" v-if="item.route === 'faceImage'"
  34. :class="!ifFaceFeature?'colorA':'marginType'">
  35. {{!ifFaceFeature?'去认证':'已认证'}}
  36. </view>
  37. <view class="view-three-type" v-if="item.route === 'signature'" :class="!isUpload?'colorA':'marginType'">{{!isUpload?'未上传':'已上传'}}</view>
  38. <view class="view-three-type" v-if="item.route === 'fingerprint'" :class="Quantity>0?'marginType':'colorA'">{{Quantity>0?'已配置'+Quantity+'个':''}}</view>
  39. <img class="right-img" src="@/images/basicsModules/icon_04.png">
  40. </view>
  41. </permissionsSlot>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. fingerprintQueryList
  48. } from '@/api/basicsModules/index.js'
  49. export default {
  50. name: "mineConfigurationSlot",
  51. props: {
  52. mineConfig: {},
  53. // 人脸
  54. ifFaceFeature: "",
  55. //签名
  56. isUpload:"",
  57. Quantity:0,//指纹录取数量
  58. //用户签名
  59. signatureUrl: "",
  60. //预案执行记录
  61. wranDoCount: 0,
  62. //我的实验室
  63. adminSubCount: 0,
  64. //预警记录
  65. securityAlertNum: 0,
  66. },
  67. data() {
  68. return {
  69. }
  70. },
  71. created() {
  72. },
  73. mounted() {
  74. console.log('mineConfig',this.mineConfig)
  75. },
  76. methods: {
  77. //按钮点击事件
  78. buttonClick(item) {
  79. if (item.buttonType === 'page') {
  80. uni.navigateTo({
  81. url: item.routeUrl,
  82. });
  83. } else if (item.buttonType === 'button') {
  84. if (item.route === 'fingerprint') {
  85. this.fingerprintClick();
  86. }
  87. } else if (item.buttonType === 'none') {
  88. uni.showToast({
  89. title: '暂未开放',
  90. icon: "none",
  91. mask: true,
  92. duration: 2000
  93. });
  94. }
  95. },
  96. //电子签名
  97. signatureButton() {
  98. uni.navigateTo({
  99. url: '/pages_manage/workbench/signature/signature?item=' + this.signatureUrl, //电子签名
  100. });
  101. },
  102. //查询用户指纹录取数据
  103. async fingerprintClick() {
  104. let _this = this;
  105. const {
  106. data
  107. } = await fingerprintQueryList(uni.getStorageSync('userId'));
  108. if (data.code == 200) {
  109. uni.navigateTo({
  110. url: '/pages/fingerprint', //指纹信息
  111. });
  112. }
  113. },
  114. },
  115. }
  116. </script>
  117. <style lang="stylus" scoped>
  118. .mineConfigurationSlot {
  119. margin: 0;
  120. background: #fff;
  121. padding: 0 20rpx;
  122. margin-top: 30rpx;
  123. .button-for-box:last-of-type{
  124. .button-max-box{
  125. border:none !important;
  126. }
  127. }
  128. .button-max-box {
  129. height: 100rpx;
  130. display flex;
  131. border-bottom: 1px solid #e0e0e0;
  132. .left-img {
  133. height: 30rpx;
  134. width: 30rpx;
  135. margin: 34rpx 44rpx 0 0;
  136. }
  137. view {
  138. line-height: 100rpx;
  139. }
  140. view:nth-child(2) {
  141. flex: 1;
  142. color: #333333;
  143. font-size: 30rpx;
  144. }
  145. .right-img {
  146. height: 24rpx;
  147. width: 12rpx;
  148. margin: 39rpx 0 0 0;
  149. }
  150. .colorA {
  151. color: #E45656 !important;
  152. }
  153. .marginType {
  154. margin-right: 12rpx;
  155. }
  156. .view-three-one {
  157. width: 30rpx;
  158. height: 30rpx;
  159. text-align center;
  160. background #FF4552;
  161. border-radius: 50%;
  162. font-size: 20rpx;
  163. line-height: 30rpx;
  164. color: #fff;
  165. margin: 36rpx 20rpx;
  166. }
  167. .view-three-two {
  168. width: 30rpx;
  169. height: 30rpx;
  170. text-align center;
  171. border-radius: 50%;
  172. font-size: 20rpx;
  173. line-height: 30rpx;
  174. color: #999;
  175. margin: 36rpx 20rpx;
  176. }
  177. .view-three-type {
  178. width: 120rpx;
  179. text-align center;
  180. color: #CCCCCC;
  181. font-size: 26rpx;
  182. }
  183. }
  184. }
  185. </style>