addNode.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /* stylelint-disable order/properties-order */
  2. <template>
  3. <div class="add-node-btn-box">
  4. <div class="add-node-btn">
  5. <el-popover placement="right-start" v-model="visible" width="auto">
  6. <div class="add-node-popover-body">
  7. <a class="add-node-popover-item approver" @click="addType(1)">
  8. <div class="item-wrapper">
  9. <span class="iconfont"></span>
  10. </div>
  11. <p>审批人</p>
  12. </a>
  13. <a class="add-node-popover-item notifier" @click="addType(2)">
  14. <div class="item-wrapper">
  15. <span class="iconfont"></span>
  16. </div>
  17. <p>抄送人</p>
  18. </a>
  19. <a class="add-node-popover-item condition" @click="addType(4)">
  20. <div class="item-wrapper">
  21. <span class="iconfont"></span>
  22. </div>
  23. <p>条件分支</p>
  24. </a>
  25. </div>
  26. <template #reference>
  27. <button class="btn" type="button">
  28. <span class="iconfont"></span>
  29. </button>
  30. </template>
  31. </el-popover>
  32. </div>
  33. </div>
  34. </template>
  35. <script lang="ts" setup>
  36. import { ref } from 'vue'
  37. let props = defineProps({
  38. childNodeP: {
  39. type: Object,
  40. default: () => ({})
  41. }
  42. })
  43. let emits = defineEmits(['update:childNodeP'])
  44. let visible = ref(false)
  45. const addType = (type) => {
  46. visible.value = false
  47. if (type != 4) {
  48. var data
  49. if (type == 1) {
  50. // data = {
  51. // name: '审核人',
  52. // error: true,
  53. // type: 1,
  54. // settype: 1,
  55. // selectMode: 0,
  56. // selectRange: 0,
  57. // directorLevel: 1,
  58. // examineMode: 1,
  59. // noHanderAction: 1,
  60. // examineEndDirectorLevel: 0,
  61. // childNode: props.childNodeP,
  62. // nodeUserList: []
  63. // }
  64. data = {
  65. name: '审核人',
  66. error: true,
  67. type: 1,
  68. // 审批节点配置
  69. attributes : {
  70. approveMethod : undefined,
  71. candidateStrategy: undefined,
  72. candidateParam: []
  73. },
  74. childNode: props.childNodeP,
  75. nodeUserList: []
  76. }
  77. } else if (type == 2) {
  78. data = {
  79. name: '抄送人',
  80. type: 2,
  81. ccSelfSelectFlag: 1,
  82. childNode: props.childNodeP,
  83. nodeUserList: []
  84. }
  85. }
  86. emits('update:childNodeP', data)
  87. } else {
  88. emits('update:childNodeP', {
  89. name: '路由',
  90. type: 4,
  91. childNode: null,
  92. conditionNodes: [
  93. {
  94. name: '条件1',
  95. error: true,
  96. type: 3,
  97. priorityLevel: 1,
  98. conditionList: [],
  99. nodeUserList: [],
  100. childNode: props.childNodeP
  101. },
  102. {
  103. name: '条件2',
  104. type: 3,
  105. priorityLevel: 2,
  106. conditionList: [],
  107. nodeUserList: [],
  108. childNode: null
  109. }
  110. ]
  111. })
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .add-node-btn-box {
  117. width: 240px;
  118. display: inline-flex;
  119. -ms-flex-negative: 0;
  120. flex-shrink: 0;
  121. -webkit-box-flex: 1;
  122. -ms-flex-positive: 1;
  123. position: relative;
  124. &:before {
  125. content: '';
  126. position: absolute;
  127. top: 0;
  128. left: 0;
  129. right: 0;
  130. bottom: 0;
  131. z-index: -1;
  132. margin: auto;
  133. width: 2px;
  134. height: 100%;
  135. background-color: #cacaca;
  136. }
  137. .add-node-btn {
  138. user-select: none;
  139. width: 240px;
  140. padding: 20px 0 32px;
  141. display: flex;
  142. -webkit-box-pack: center;
  143. justify-content: center;
  144. flex-shrink: 0;
  145. -webkit-box-flex: 1;
  146. flex-grow: 1;
  147. .btn {
  148. outline: none;
  149. box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  150. width: 30px;
  151. height: 30px;
  152. background: #3296fa;
  153. border-radius: 50%;
  154. position: relative;
  155. border: none;
  156. line-height: 30px;
  157. -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  158. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  159. .iconfont {
  160. color: #fff;
  161. font-size: 16px;
  162. }
  163. &:hover {
  164. transform: scale(1.3);
  165. box-shadow: 0 13px 27px 0 rgba(0, 0, 0, 0.1);
  166. }
  167. &:active {
  168. transform: none;
  169. background: #1e83e9;
  170. box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  171. }
  172. }
  173. }
  174. }
  175. .add-node-popover-body {
  176. display: flex;
  177. .add-node-popover-item {
  178. margin-right: 10px;
  179. cursor: pointer;
  180. text-align: center;
  181. flex: 1;
  182. color: #191f25 !important;
  183. .item-wrapper {
  184. user-select: none;
  185. display: inline-block;
  186. width: 80px;
  187. height: 80px;
  188. margin-bottom: 5px;
  189. background: #fff;
  190. border: 1px solid #e2e2e2;
  191. border-radius: 50%;
  192. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  193. .iconfont {
  194. font-size: 35px;
  195. line-height: 80px;
  196. }
  197. }
  198. &.approver {
  199. .item-wrapper {
  200. color: #ff943e;
  201. }
  202. }
  203. &.notifier {
  204. .item-wrapper {
  205. color: #3296fa;
  206. }
  207. }
  208. &.condition {
  209. .item-wrapper {
  210. color: #15bc83;
  211. }
  212. }
  213. &:hover {
  214. .item-wrapper {
  215. background: #3296fa;
  216. box-shadow: 0 10px 20px 0 rgba(50, 150, 250, 0.4);
  217. }
  218. .iconfont {
  219. color: #fff;
  220. }
  221. }
  222. &:active {
  223. .item-wrapper {
  224. box-shadow: none;
  225. background: #eaeaea;
  226. }
  227. .iconfont {
  228. color: inherit;
  229. }
  230. }
  231. }
  232. }
  233. </style>