mineConfigurationSlot.vue 4.4 KB

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