IndexOa.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-row :gutter="24">
  4. <a-col :sm="24" :md="24" :xl="24" :style="{ marginBottom: '24px' }">
  5. <a-card size="small" title="OA工作台" :bordered="false" >
  6. <a-row :gutter="24">
  7. <a-col :sm="24" :md="12" :xl="2" v-for="(item,index) in activeKeyAll" :key="index">
  8. <a-card size="small" :bordered="false" >
  9. <a-row :gutter="24">
  10. <a-col :sm="24" :md="24" :xl="24" style="margin-bottom:24px;text-align:center">
  11. <!-- <a-avatar :size="64"
  12. src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
  13. />-->
  14. <a @click.prevent="aClick(item)" >
  15. <a-avatar
  16. shape="square"
  17. :size="64"
  18. :src="item.iconAddress"
  19. />
  20. </a>
  21. </a-col>
  22. <a-col :sm="24" :md="24" :xl="24" style="margin-bottom:24px;text-align:center">
  23. <h4>{{item.name}}</h4>
  24. </a-col>
  25. </a-row>
  26. <!-- <a-upload
  27. action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
  28. list-type="picture-card"
  29. :file-list="fileList"
  30. :disabled="true"
  31. >
  32. </a-upload>-->
  33. </a-card>
  34. </a-col>
  35. </a-row>
  36. </a-card>
  37. </a-col>
  38. </a-row>
  39. <!--流程表单-->
  40. <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
  41. <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
  42. :processData="lcModa.processData" :isNew = "lcModa.isNew"
  43. @afterSubmit="afterSub" @close="lcModa.visible=false,lcModa.disabled = false"></component>
  44. </a-modal>
  45. </div>
  46. </template>
  47. <script>
  48. import ChartCard from '@/components/ChartCard'
  49. import ACol from 'ant-design-vue/es/grid/Col'
  50. import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
  51. import MiniArea from '@/components/chart/MiniArea'
  52. import MiniBar from '@/components/chart/MiniBar'
  53. import MiniProgress from '@/components/chart/MiniProgress'
  54. import RankList from '@/components/chart/RankList'
  55. import Bar from '@/components/chart/Bar'
  56. import LineChartMultid from '@/components/chart/LineChartMultid'
  57. import HeadInfo from '@/components/tools/HeadInfo.vue'
  58. import Trend from '@/components/Trend'
  59. import { getLoginfo, getVisitInfo } from '@/api/api'
  60. import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
  61. export default {
  62. mixins:[activitiMixin],
  63. name: 'IndexOa',
  64. data() {
  65. return {
  66. loading: true,
  67. visitFields: ['ip', 'visit'],
  68. indicator: <a-icon type="loading" style="font-size: 24px" spin />,
  69. activeKeyAll:[],
  70. lcModa: {
  71. title:'',
  72. disabled:false,
  73. visible:false,
  74. formComponent : null,
  75. isNew : false
  76. },
  77. }
  78. },
  79. created() {
  80. setTimeout(() => {
  81. this.loading = !this.loading
  82. }, 1000)
  83. this.getActiveKeyAll();
  84. },
  85. methods: {
  86. //获取OA工作流List
  87. getActiveKeyAll() {
  88. this.postFormAction("/activiti_process/listData", { status: 1, roles: true })
  89. .then(res => {
  90. this.activeKeyAll = []
  91. if (res.success) {
  92. var result = res.result || []
  93. if (result.length > 0) {
  94. // this.processDataMap = _.groupBy(result, 'categoryId')
  95. // for (const categoryId in this.processDataMap) {
  96. // this.activeKeyAll.push(categoryId)
  97. // }
  98. // this.activeKey = this.activeKeyAll
  99. this.activeKeyAll=result;
  100. }
  101. this.processModalVisible = true
  102. } else {
  103. this.$message.warning(res.message)
  104. }
  105. })
  106. .finally(() => (this.addApplyLoading = false))
  107. },
  108. //OA图标点击事件
  109. aClick(v) {
  110. console.log(v)
  111. // this.$refs.modal.add("1")
  112. if (!v.routeName) {
  113. this.$message.warning(
  114. "该流程信息未配置表单,请联系开发人员!"
  115. );
  116. return;
  117. }
  118. if(v.routeName.indexOf("外部表单")!=-1){
  119. alert("调用其他项目页面")
  120. }else if(v.routeName.indexOf("自定义")!=-1){
  121. this.lcModa.disabled = false;
  122. let com={component:() => import(`@/views/activiti/form/demoForm2`)}
  123. this.lcModa.formComponent = com.component;
  124. this.lcModa.title = '发起流程:'+v.name;
  125. this.lcModa.isNew = true;
  126. this.lcModa.processData = v;
  127. this.lcModa.visible = true;
  128. }else{
  129. this.lcModa.disabled = false;
  130. this.lcModa.formComponent = this.getFormComponent(v.routeName).component;
  131. this.lcModa.title = '发起流程:'+v.name;
  132. this.lcModa.isNew = true;
  133. this.lcModa.processData = v;
  134. this.lcModa.visible = true;
  135. }
  136. console.log("发起",v)
  137. },
  138. afterSub(formData){
  139. this.lcModa.visible = false;
  140. // this.loadData();
  141. },
  142. }
  143. }
  144. </script>