see.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <basic-container
  3. class="see"
  4. style="margin-bottom:50px;"
  5. >
  6. <el-select
  7. style="width:300px;"
  8. v-model="value"
  9. placeholder="请选择"
  10. @change="changePosition"
  11. class="marbottom20"
  12. clearable
  13. >
  14. <el-option
  15. v-for="item in options"
  16. :key="item.roleId"
  17. :label="item.roleName"
  18. :value="item.roleId"
  19. >
  20. </el-option>
  21. </el-select>
  22. <el-row :gutter="20">
  23. <el-col
  24. :span="6"
  25. style="border-right:1px solid #EDEDED;"
  26. >
  27. <el-menu
  28. default-active="2"
  29. class="el-menu-vertical-demo"
  30. >
  31. <div
  32. v-for="(item,keys) in menuData"
  33. :key='keys'
  34. >
  35. <el-submenu :index="item.roleId">
  36. <template slot="title">
  37. <i class="el-icon-location"></i>
  38. <span>{{item.roleName}}</span>
  39. </template>
  40. <el-menu-item-group
  41. v-for="(val,k) in item.childRoleList"
  42. :key='k'
  43. >
  44. <el-menu-item
  45. :index="val.roleId"
  46. @click="dakairight(val.signPfxFileList)"
  47. >{{val.roleName}}</el-menu-item>
  48. </el-menu-item-group>
  49. </el-submenu>
  50. </div>
  51. </el-menu>
  52. </el-col>
  53. <el-col :span="18">
  54. <div
  55. class="martop20"
  56. v-for="(item,key) in rightData"
  57. :key='key'
  58. >
  59. <div class="flexBetween ">
  60. <div class="flexItemsC">姓名:{{item.createUser}}</div>
  61. <div class="flexStar flexItemsC">签名图片:
  62. <img
  63. style="height:40px;"
  64. :src="item.signatureFileUrl"
  65. />
  66. </div>
  67. <div class="flexItemsC">证书:{{item.certificateUserName}}- {{item.certificateFileUrl|urlsplice}}</div>
  68. <el-button
  69. size="mini"
  70. @click="deleteAutograph(item.id)"
  71. >删除签名配置</el-button>
  72. </div>
  73. <el-divider></el-divider>
  74. </div>
  75. </el-col>
  76. </el-row>
  77. </basic-container>
  78. </template>
  79. <script>
  80. import { remove, } from "@/api/certificate/list";
  81. import { queryAllRoleList, } from "@/api/certificate/management";
  82. export default {
  83. data () {
  84. return {
  85. options: [],
  86. value: '',
  87. menuData: [],
  88. rightData: [],
  89. }
  90. },
  91. methods: {
  92. //#region 左侧菜单
  93. dakairight (signPfxFileList) {
  94. this.rightData = signPfxFileList
  95. },
  96. changePosition () {//下拉框change事件
  97. if (this.value && this.options.length > 0) {
  98. this.options.forEach(val => {
  99. if (val.roleId == this.value) {
  100. this.menuData = [val]
  101. this.rightData = []
  102. }
  103. })
  104. }
  105. },
  106. deleteAutograph (ids) {
  107. let _that = this
  108. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  109. confirmButtonText: '确定',
  110. cancelButtonText: '取消',
  111. type: 'warning'
  112. }).then(() => {
  113. _that.remove(ids)
  114. }).catch(() => {
  115. });
  116. },
  117. //#endregion
  118. //#region 接口
  119. async queryAllRoleList (contractId) {
  120. const { data: res } = await queryAllRoleList({ contractId })
  121. console.log(res);
  122. if (res.code == 200) {
  123. this.options = res.data
  124. this.menuData = res.data
  125. }
  126. },
  127. async remove (ids) {
  128. const { data: res } = await remove({ ids })
  129. console.log(res);
  130. if (res.code == 200) {
  131. this.$message({
  132. type: 'success',
  133. message: '删除成功!'
  134. });
  135. }
  136. },
  137. //#endregion
  138. },
  139. filters: {
  140. urlsplice (url) {
  141. let da = ''
  142. if (url) {
  143. da = url.slice(url.indexOf('/', url.indexOf('/', url.indexOf('/', url.indexOf('/', url.indexOf('/', url.indexOf('/', 0) + 1) + 1) + 1) + 1) + 1) + 1)
  144. }
  145. return da
  146. },
  147. },
  148. watch: {
  149. 'value' (val) {
  150. if (!val) {
  151. this.menuData = this.options
  152. this.rightData = []
  153. }
  154. },
  155. },
  156. created () {
  157. this.queryAllRoleList(this.$route.query.contractId)
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .see {
  163. }
  164. </style>