mineConfigurationSlot.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 === 'mineWarningRecording' && 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 === 'PlanExecuteRecord' && 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: 10,
  62. //我的实验室
  63. adminSubCount: 0,
  64. //预警记录
  65. securityAlertNum: 10,
  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. if (item.route === 'mineWarningRecording') {//预警记录
  81. uni.navigateTo({
  82. url: item.routeUrl,
  83. });
  84. }
  85. if (item.route === 'laboratory') {//我的实验室
  86. uni.navigateTo({
  87. url: item.routeUrl,
  88. });
  89. }
  90. if (item.route === 'PlanExecuteRecord') {//预案执行记录
  91. uni.navigateTo({
  92. url: item.routeUrl,
  93. });
  94. }
  95. if (item.route === 'faceImage') {//身份验证
  96. uni.navigateTo({
  97. url: item.routeUrl,
  98. });
  99. }
  100. if (item.route === 'signature') {//电子签名
  101. uni.navigateTo({
  102. url: item.routeUrl,
  103. });
  104. }
  105. if (item.route === 'fingerprint') {//指纹
  106. uni.navigateTo({
  107. url: item.routeUrl,
  108. });
  109. //this.fingerprintClick(item.routeUrl)
  110. }
  111. } else if (item.buttonType === 'button') {
  112. if (item.route === 'fingerprint') {
  113. this.fingerprintClick();
  114. }
  115. } else if (item.buttonType === 'none') {
  116. uni.showToast({
  117. title: '暂未开放',
  118. icon: "none",
  119. mask: true,
  120. duration: 2000
  121. });
  122. }
  123. },
  124. //电子签名
  125. signatureButton() {
  126. uni.navigateTo({
  127. url: '/pages_manage/workbench/signature/signature?item=' + this.signatureUrl, //电子签名
  128. });
  129. },
  130. //查询用户指纹录取数据
  131. async fingerprintClick(routeUrl) {
  132. let _this = this;
  133. const {
  134. data
  135. } = await fingerprintQueryList(uni.getStorageSync('userId'));
  136. if (data.code == 200) {
  137. uni.navigateTo({
  138. url: routeUrl, //指纹信息
  139. });
  140. }
  141. },
  142. },
  143. }
  144. </script>
  145. <style lang="stylus" scoped>
  146. .mineConfigurationSlot {
  147. margin: 0;
  148. background: #fff;
  149. padding: 0 20rpx;
  150. margin-top: 30rpx;
  151. .button-for-box:last-of-type{
  152. .button-max-box{
  153. border:none !important;
  154. }
  155. }
  156. .button-max-box {
  157. height: 100rpx;
  158. display flex;
  159. border-bottom: 1px solid #e0e0e0;
  160. .left-img {
  161. height: 30rpx;
  162. width: 30rpx;
  163. margin: 34rpx 44rpx 0 0;
  164. }
  165. view {
  166. line-height: 100rpx;
  167. }
  168. view:nth-child(2) {
  169. flex: 1;
  170. color: #333333;
  171. font-size: 30rpx;
  172. }
  173. .right-img {
  174. height: 24rpx;
  175. width: 12rpx;
  176. margin: 39rpx 0 0 0;
  177. }
  178. .colorA {
  179. color: #E45656 !important;
  180. }
  181. .marginType {
  182. margin-right: 12rpx;
  183. }
  184. .view-three-one {
  185. width: 30rpx;
  186. height: 30rpx;
  187. text-align center;
  188. background #FF4552;
  189. border-radius: 50%;
  190. font-size: 20rpx;
  191. line-height: 30rpx;
  192. color: #fff;
  193. margin: 36rpx 20rpx;
  194. }
  195. .view-three-two {
  196. width: 30rpx;
  197. height: 30rpx;
  198. text-align center;
  199. border-radius: 50%;
  200. font-size: 20rpx;
  201. line-height: 30rpx;
  202. color: #999;
  203. margin: 36rpx 20rpx;
  204. }
  205. .view-three-type {
  206. width: 120rpx;
  207. text-align center;
  208. color: #CCCCCC;
  209. font-size: 26rpx;
  210. }
  211. }
  212. }
  213. </style>