mineConfigurationSlot.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. } else if (item.buttonType === 'none') {
  113. uni.showToast({
  114. title: '暂未开放',
  115. icon: "none",
  116. mask: true,
  117. duration: 2000
  118. });
  119. }
  120. },
  121. //电子签名
  122. signatureButton() {
  123. uni.navigateTo({
  124. url: '/pages_manage/workbench/signature/signature?item=' + this.signatureUrl, //电子签名
  125. });
  126. },
  127. //查询用户指纹录取数据
  128. async fingerprintClick(routeUrl) {
  129. let _this = this;
  130. const {
  131. data
  132. } = await fingerprintQueryList(uni.getStorageSync('userId'));
  133. if (data.code == 200) {
  134. uni.navigateTo({
  135. url: routeUrl, //指纹信息
  136. });
  137. }
  138. },
  139. },
  140. }
  141. </script>
  142. <style lang="stylus" scoped>
  143. .mineConfigurationSlot {
  144. margin: 0;
  145. background: #fff;
  146. padding: 0 20rpx;
  147. margin-top: 30rpx;
  148. .button-for-box:last-of-type{
  149. .button-max-box{
  150. border:none !important;
  151. }
  152. }
  153. .button-max-box {
  154. height: 100rpx;
  155. display flex;
  156. border-bottom: 1px solid #e0e0e0;
  157. .left-img {
  158. height: 30rpx;
  159. width: 30rpx;
  160. margin: 34rpx 44rpx 0 0;
  161. }
  162. view {
  163. line-height: 100rpx;
  164. }
  165. view:nth-child(2) {
  166. flex: 1;
  167. color: #333333;
  168. font-size: 30rpx;
  169. }
  170. .right-img {
  171. height: 24rpx;
  172. width: 12rpx;
  173. margin: 39rpx 0 0 0;
  174. }
  175. .colorA {
  176. color: #E45656 !important;
  177. }
  178. .marginType {
  179. margin-right: 12rpx;
  180. }
  181. .view-three-one {
  182. width: 30rpx;
  183. height: 30rpx;
  184. text-align center;
  185. background #FF4552;
  186. border-radius: 50%;
  187. font-size: 20rpx;
  188. line-height: 30rpx;
  189. color: #fff;
  190. margin: 36rpx 20rpx;
  191. }
  192. .view-three-two {
  193. width: 30rpx;
  194. height: 30rpx;
  195. text-align center;
  196. border-radius: 50%;
  197. font-size: 20rpx;
  198. line-height: 30rpx;
  199. color: #999;
  200. margin: 36rpx 20rpx;
  201. }
  202. .view-three-type {
  203. width: 120rpx;
  204. text-align center;
  205. color: #CCCCCC;
  206. font-size: 26rpx;
  207. }
  208. }
  209. }
  210. </style>