阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

325 lines
9.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="process-dep-container">
  3. <div class="head-container">
  4. <div class="head-left">
  5. <el-button size="mini" @click="handleDeloy">
  6. <i class="iconfont icon-xinzeng" />
  7. 部署
  8. </el-button>
  9. <el-button size="mini" :disabled="selectedItem.length===0 || (selectedItem.length !== 0 && selectedItem[0].suspensionState === 1)" @click="activateHandle(1)">
  10. <i class="iconfont icon-jihuo" />
  11. 激活
  12. </el-button>
  13. <el-button size="mini" :disabled="selectedItem.length===0 || (selectedItem.length !== 0 && selectedItem[0].suspensionState === 2)" @click="activateHandle(2)">
  14. <i class="iconfont icon-guaqi" />
  15. 挂起
  16. </el-button>
  17. <el-button size="mini" :disabled="selectedItem.length===0" @click="downloadModel(selectedItem[0])">
  18. <i class="iconfont icon-daochu" />
  19. 导出
  20. </el-button>
  21. </div>
  22. <div class="head-right">
  23. <el-select v-model="query.suspensionState" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="queryState">
  24. <i slot="prefix" class="iconfont icon-zhuangtai" />
  25. <el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="process-dep-main">
  30. <ul class="process-list">
  31. <li v-for="(item,index) in flowableList" :key="index" :class="isActive === index ? 'active-li': ''" @click="selectProcess(item,index)">
  32. <p>{{ item.deployName }}</p>
  33. <span :class="item.suspensionState === 1 ? 'process-on': 'process-off'" />
  34. </li>
  35. </ul>
  36. <div v-if="isHasModel" class="process-info">
  37. <div class="process-info-txt">
  38. <div class="info-left">
  39. <p>当前版本
  40. <el-select v-model="versionNew" style="width:70px;" @change="selectVersion">
  41. <el-option
  42. v-for="item in versionOptions"
  43. :key="item.value"
  44. :label="item.label"
  45. :value="item.value"
  46. />
  47. </el-select>
  48. </p>
  49. <p>部署时间<span>{{ modelInfo.deploymentTime | parseTime }}</span></p>
  50. </div>
  51. <div class="info-right ">
  52. <p>运行中<span>{{ modelInfo.runCount }}</span></p>
  53. <p>已完成<span>{{ modelInfo.completeCount }}</span></p>
  54. </div>
  55. </div>
  56. <div class="process-info-img">
  57. <img src="~@/assets/images/system/process-img.png" alt="">
  58. </div>
  59. </div>
  60. </div>
  61. <eForm ref="mform" @refresh="getList" />
  62. </div>
  63. </template>
  64. <script>
  65. import { FetchInitFlowAll, FetchSuspendActivate, FetchAllByKey, FetchLeadingOutModelXml, FetchGenProcessDiagram } from '@/api/system/flowable'
  66. import { downloadFile } from '@/utils/index'
  67. import eForm from './module/form'
  68. export default {
  69. name: 'ProcessDeployment',
  70. components: { eForm },
  71. data() {
  72. return {
  73. flowableList: [],
  74. query: {
  75. suspensionState: null
  76. },
  77. isActive: -1,
  78. isHasModel: false,
  79. selectedItem: [],
  80. modelInfo: {},
  81. allVersionModel: [],
  82. versionOptions: [],
  83. versionNew: null,
  84. exportVisible: false,
  85. activateName: '',
  86. enabledTypeOptions: [
  87. { key: null, display_name: '全部' },
  88. { key: 1, display_name: '启用' },
  89. { key: 2, display_name: '挂起' }
  90. ]
  91. }
  92. },
  93. mounted() {
  94. this.getList()
  95. },
  96. methods: {
  97. getList(suspensionState) {
  98. this.selectedItem = []
  99. this.isActive = -1
  100. this.isHasModel = false
  101. FetchInitFlowAll({ 'suspensionState': suspensionState }).then((res) => {
  102. this.flowableList = res
  103. }).catch(err => {
  104. console.log(err)
  105. })
  106. },
  107. queryState(val) {
  108. this.getList(val)
  109. },
  110. selectProcess(item, index) {
  111. this.selectedItem = []
  112. this.selectedItem.push(item)
  113. this.isActive = index
  114. this.isHasModel = true
  115. this.modelInfo = item
  116. FetchAllByKey({ 'key': item.modelKey }).then(res => {
  117. this.allVersionModel = res
  118. this.versionOptions = res.map(item => {
  119. const json = {}
  120. json.value = item.version
  121. json.label = item.version
  122. return json
  123. })
  124. this.versionNew = item.version
  125. FetchGenProcessDiagram({ 'processId': item.procdefId }).then((res) => {
  126. console.log(res)
  127. }).catch(err => {
  128. console.log(err)
  129. })
  130. }).catch((err) => {
  131. console.log(err)
  132. })
  133. },
  134. selectVersion(val) {
  135. this.allVersionModel.filter((item, index) => {
  136. if (item.version === val) {
  137. this.modelInfo = item
  138. }
  139. })
  140. },
  141. handleDeloy() {
  142. this.$refs.mform.uploadVisible = true
  143. if (this.isActive !== -1) {
  144. this.$refs.mform.form.name = this.selectedItem[0].deployName
  145. }
  146. },
  147. activateHandle(type) {
  148. if (type === 1) {
  149. this.activateName = '激活'
  150. } else {
  151. this.activateName = '挂起'
  152. }
  153. this.$confirm('此操作将' + this.activateName + '“' + this.selectedItem[0].modelName + '”' + '<span>你是否还要继续?</span>', '提示', {
  154. confirmButtonText: '继续',
  155. cancelButtonText: '取消',
  156. type: 'warning',
  157. dangerouslyUseHTMLString: true
  158. }).then(() => {
  159. const params = {
  160. 'procdefId': this.selectedItem[0].procdefId,
  161. 'type': type
  162. }
  163. FetchSuspendActivate(params).then(res => {
  164. if (res === 'SUCCESS') {
  165. this.getList()
  166. }
  167. }).catch((err) => {
  168. console.log(err)
  169. })
  170. }).catch(() => {
  171. })
  172. },
  173. downloadModel(data) {
  174. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  175. confirmButtonText: '继续',
  176. cancelButtonText: '取消',
  177. type: 'warning',
  178. dangerouslyUseHTMLString: true
  179. }).then(() => {
  180. const params = {
  181. 'deployId': data.deployId
  182. }
  183. const name = data.modelName
  184. FetchLeadingOutModelXml(params).then(result => {
  185. downloadFile(result, name, 'xml')
  186. }).catch(() => {
  187. this.$message.error('下载失败,请检查好网络后重新下载')
  188. })
  189. }).catch(() => {
  190. })
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang='scss' scoped>
  196. [data-theme=dark] .process-dep-main{
  197. background-color: transparent;
  198. border-top: 1px solid #113d72;
  199. .process-list{
  200. box-shadow: 5px 2px 10px 1px rgba(15,164,222,.16);
  201. li{
  202. &.active-li,
  203. &:hover{
  204. background: linear-gradient(90deg, rgba(59, 160, 255, 0) 0%, rgba(42,112,177,0.3) 43%, rgba(51, 156, 255, 0) 100%);
  205. }
  206. }
  207. }
  208. }
  209. [data-theme=light] .process-dep-main{
  210. background-color: #F5F5F5;
  211. border: 1px solid #E6E8ED;
  212. .process-list{
  213. background-color: #fff;
  214. box-shadow: 4px 0px 4px 0px rgba(0,0,0,0.04);
  215. li{
  216. color: #0C0E1E;
  217. &.active-li,
  218. &:hover{
  219. background-color: #E8F2FF;
  220. }
  221. }
  222. }
  223. .process-info-txt{
  224. color: #0C0E1E;
  225. span{
  226. color: #545B65;
  227. }
  228. }
  229. }
  230. [data-theme=light] .head-container{
  231. margin: 20px 0 !important;
  232. }
  233. .process-dep-container{
  234. min-height: calc(100vh - 300px);
  235. }
  236. .head-container{
  237. display: flex;
  238. justify-content: space-between;
  239. .head-left{
  240. width: 342px;
  241. padding: 0 10px;
  242. display: flex;
  243. justify-content: space-between;
  244. ::v-deep .el-button--mini{
  245. padding: 7px;
  246. }
  247. }
  248. .head-right{
  249. flex: 1;
  250. display: flex;
  251. justify-content: flex-end;
  252. }
  253. .filter-item{
  254. margin-right: 0;
  255. }
  256. }
  257. .process-dep-main{
  258. display: flex;
  259. justify-content: flex-start;
  260. height: calc(100vh - 283px);
  261. .process-list{
  262. width: 342px;
  263. li{
  264. display: flex;
  265. justify-content: space-between;
  266. align-items: center;
  267. padding: 0 16px;
  268. font-size: 14px;
  269. height: 40px;
  270. line-height: 40px;
  271. cursor: pointer;
  272. p{
  273. flex: 1;
  274. }
  275. span{
  276. display: block;
  277. width: 9px;
  278. height: 9px;
  279. border-radius: 50%;
  280. &.process-on{
  281. background-color: #3FE246;
  282. }
  283. &.process-off{
  284. background-color: #ED4A41;
  285. }
  286. }
  287. }
  288. }
  289. .process-info{
  290. flex: 1;
  291. padding:10px 30px;
  292. .process-info-txt{
  293. display: flex;
  294. justify-content: space-between;
  295. font-size: 14px;
  296. line-height: 30px;
  297. margin-bottom: 10px;
  298. .info-left{
  299. width: 50%;
  300. }
  301. .info-right{
  302. width: 50%;
  303. text-align: right;
  304. }
  305. }
  306. .process-info-img{
  307. height: calc(100vh - 374px);
  308. & img{
  309. display: block;
  310. height: 100%;
  311. border: 1px solid #E6E8ED;
  312. }
  313. }
  314. }
  315. }
  316. </style>