| | |
| | | "ant-design-vue": "^1.7.2", |
| | | "axios": "^0.18.0", |
| | | "china-area-data": "^5.0.1", |
| | | "element-ui": "^2.15.14", |
| | | "clipboard": "^2.0.4", |
| | | "codemirror": "^5.46.0", |
| | | "cron-parser": "^2.10.0", |
| | |
| | | "vuex": "^3.1.0", |
| | | "vxe-table": "2.9.13", |
| | | "vxe-table-plugin-antd": "1.8.10", |
| | | "workflow-bpmn-modeler": "^0.2.8", |
| | | "xe-utils": "2.4.8", |
| | | "xss": "^1.0.13" |
| | | }, |
| | |
| | | //表åéªè¯ |
| | | import { rules } from '@/utils/rules' |
| | | import * as echarts from 'echarts' |
| | | |
| | | import ElementUI from 'element-ui'; |
| | | Vue.use(ElementUI); |
| | | // å°èªå¨æ³¨åææç»ä»¶ä¸ºå
¨å±ç»ä»¶ |
| | | import dataV from '@jiaminghi/data-view' |
| | | Vue.use(dataV) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {axios as request} from '@/utils/request' |
| | | |
| | | // æ¥è¯¢æµç¨å®ä¹å表 |
| | | export function listDefinition(query) { |
| | | return request({ |
| | | url: '/flowable/definition/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // é¨ç½²æµç¨å®ä¾ |
| | | export function definitionStartByDefId(procDefId,data) { |
| | | return request({ |
| | | url: '/flowable/definition/startByProcDefId/' + procDefId, |
| | | method: 'post', |
| | | data: JSON.stringify(data) |
| | | }) |
| | | } |
| | | // é¨ç½²æµç¨å®ä¾ |
| | | export function definitionStartByDefKey(procDefKey,data) { |
| | | return request({ |
| | | url: '/flowable/definition/startByProcDefKey/' + procDefKey, |
| | | method: 'post', |
| | | data: JSON.stringify(data) |
| | | }) |
| | | } |
| | | // é¨ç½²æµç¨å®ä¾ |
| | | export function definitionStartByDataId(dataId,data) { |
| | | return request({ |
| | | url: '/flowable/definition/startByDataId/' + dataId, |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // è·åæµç¨åé |
| | | export function getProcessVariables(taskId) { |
| | | return request({ |
| | | url: '/flowable/task/processVariables/' + taskId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ¿æ´»/æèµ·æµç¨ |
| | | export function updateState(params) { |
| | | return request({ |
| | | url: '/flowable/definition/updateState', |
| | | method: 'put', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | // æå®æµç¨åç人åå表 |
| | | export function userList(query) { |
| | | return request({ |
| | | url: '/flowable/definition/userList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æå®æµç¨åçç»å表 |
| | | export function roleList(query) { |
| | | return request({ |
| | | url: '/flowable/definition/roleList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | // æå®æµç¨åç±»å表 |
| | | export function categoryList(query) { |
| | | return request({ |
| | | url: '/flowable/definition/categoryList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 读åxmlæä»¶ |
| | | export function readXml(deployId) { |
| | | return request({ |
| | | url: '/flowable/definition/readXml/' + deployId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 读åxmlæä»¶ |
| | | export function readXmlByDataId(dataId) { |
| | | return request({ |
| | | url: '/flowable/definition/readXmlByDataId/' + dataId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 读åimageæä»¶ |
| | | export function readImage(deployId) { |
| | | return request({ |
| | | url: '/flowable/definition/readImage/' + deployId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 读åimageæä»¶ |
| | | export function getFlowViewer(procInsId) { |
| | | return request({ |
| | | url: '/flowable/task/flowViewer/' + procInsId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 读åimageæä»¶ |
| | | export function getFlowViewerByDataId(dataId) { |
| | | return request({ |
| | | url: '/flowable/task/flowViewerByDataId/' + dataId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 读åxmlæä»¶ |
| | | export function saveXml(data) { |
| | | return request({ |
| | | url: '/flowable/definition/save', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å 餿µç¨å®ä¹ |
| | | export function delDeployment(query) { |
| | | return request({ |
| | | url: '/flowable/definition/delete/', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {axios as request} from '@/utils/request' |
| | | |
| | | // æ¥è¯¢å·²åä»»å¡å表 |
| | | export function finishedList(query) { |
| | | return request({ |
| | | url: '/flowable/task/finishedList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 任塿µè½¬è®°å½ |
| | | export function flowRecord(query) { |
| | | return request({ |
| | | url: '/flowable/task/flowRecord', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¤åä»»å¡ |
| | | export function revokeProcess(data) { |
| | | return request({ |
| | | url: '/flowable/task/revokeProcess', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // é¨ç½²æµç¨å®ä¾ |
| | | export function deployStart(deployId) { |
| | | return request({ |
| | | url: '/flowable/process/startFlow/' + deployId, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {axios as request} from '@/utils/request' |
| | | |
| | | // æçåèµ·çæµç¨ |
| | | export function myProcessList(query) { |
| | | return request({ |
| | | url: '/flowable/task/myProcess', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | |
| | | // åæ¶ç³è¯· |
| | | export function deleteByDataId(dataId,deleteReason) { |
| | | const data = { |
| | | dataId:dataId, |
| | | deleteReason:deleteReason |
| | | } |
| | | return request({ |
| | | url: '/flowable/instance/deleteByDataId', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | |
| | | // é¨ç½²æµç¨å®ä¾ |
| | | export function deployStart(deployId) { |
| | | return request({ |
| | | url: '/flowable/process/startFlow/' + deployId, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {axios as request} from '@/utils/request' |
| | | |
| | | // æ¥è¯¢å¾
åä»»å¡å表 |
| | | export function todoList(query) { |
| | | return request({ |
| | | url: '/flowable/task/todoList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // å®æä»»å¡ |
| | | export function completeTask(data) { |
| | | return request({ |
| | | url: '/flowable/task/completeByDateId', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å§æ´¾ä»»å¡ |
| | | export function delegate(data) { |
| | | return request({ |
| | | url: '/flowable/task/delegate', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // éåä»»å¡ |
| | | export function returnTask(data) { |
| | | return request({ |
| | | url: '/flowable/task/taskReturnByDataId', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 驳åä»»å¡ |
| | | export function rejectTask(data) { |
| | | return request({ |
| | | url: '/flowable/task/taskRejectByDataId', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å¯éåä»»å¡å表 |
| | | export function returnList(data) { |
| | | return request({ |
| | | url: '/flowable/task/findReturnTaskListByDataId', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¸ä¸èç¹ todo ç®åç´æ¥èªå¨åé
å°åé人ï¼ä¸ç¨ä¸»å¨é人ï¼å¦æéè¦åå¼å |
| | | export function getNextFlowNode(data) { |
| | | return request({ |
| | | url: '/flowable/task/nextFlowNode', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style lang="less"> |
| | | </style> |
| | | <template> |
| | | <span> |
| | | <a-button :loading="submitLoading" :type="btnType" @click="applySubmit()" >{{text}}</a-button> |
| | | </span> |
| | | </template> |
| | | |
| | | <script> |
| | | import {definitionStartByDataId} from "@views/flowable/api/definition"; |
| | | |
| | | export default { |
| | | name: 'ActApplyBtn', |
| | | components: {}, |
| | | props: { |
| | | btnType: { type: String, default: 'link', required: false }, |
| | | /**/ |
| | | dataId: { |
| | | type: String, |
| | | default: '', |
| | | required: true |
| | | }, |
| | | variables:{ |
| | | type: Object, |
| | | default: {}, |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: 'æäº¤ç³è¯·', |
| | | required: false |
| | | } |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | modalVisible: false, |
| | | submitLoading: false, |
| | | form: { |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | }, |
| | | methods: { |
| | | applySubmit() { |
| | | if (this.dataId && this.dataId.length < 1) { |
| | | this.error = 'å¿
é¡»ä¼ å
¥åæ°dataId'; |
| | | this.$message.error(this.error); |
| | | return; |
| | | } else { |
| | | this.error = ''; |
| | | } |
| | | this.submitLoading = true; |
| | | var params = Object.assign({ |
| | | dataId: this.dataId |
| | | }, this.variables); |
| | | definitionStartByDataId(this.dataId, params) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$message.success('æä½æå'); |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | .finally(() => (this.submitLoading = false)); |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style lang="less"> |
| | | </style> |
| | | <template> |
| | | <span> |
| | | <a-button :type="btnType" @click="cancel()" >{{text}}</a-button> |
| | | <a-modal title="确认æ¤å" v-model="modalCancelVisible" :mask-closable="false" :width="500"> |
| | | <a-form ref="delForm" v-model="cancelForm" :label-width="70" v-if="modalCancelVisible"> |
| | | <a-form-item label="æ¤ååå " prop="reason"> |
| | | <a-input type="textarea" v-model="cancelForm.reason" :rows="4" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | <div slot="footer"> |
| | | <a-button type="text" @click="modalCancelVisible = false">åæ¶</a-button> |
| | | <a-button type="primary" :disabled="submitLoading" @click="handelSubmitCancel">æäº¤</a-button> |
| | | </div> |
| | | </a-modal> |
| | | </span> |
| | | </template> |
| | | |
| | | <script> |
| | | import {deleteByDataId} from "@views/flowable/api/process"; |
| | | |
| | | export default { |
| | | name: 'ActCancelBtn', |
| | | components: {}, |
| | | props: { |
| | | btnType: { type: String, default: 'link', required: false }, |
| | | /**/ |
| | | dataId: { |
| | | type: String, |
| | | default: '', |
| | | required: true |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: 'æ¤å', |
| | | required: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | modalCancelVisible: false, |
| | | cancelForm: { |
| | | reason: '' |
| | | }, |
| | | submitLoading: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | }, |
| | | methods: { |
| | | cancel() { |
| | | this.modalCancelVisible = true; |
| | | }, |
| | | handelSubmitCancel() { |
| | | this.submitLoading = true; |
| | | deleteByDataId(this.dataId, this.cancelForm.reason) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$message.success('æä½æå'); |
| | | this.modalCancelVisible = false; |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message.error(res.message); |
| | | } |
| | | }) |
| | | .finally(() => (this.submitLoading = false)); |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style lang="less"> |
| | | </style> |
| | | <template> |
| | | <span> |
| | | <a-button :type="btnType" @click="handle()" >{{text}}</a-button> |
| | | <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500"> |
| | | |
| | | <div v-if="modalTaskVisible"> |
| | | <div v-if="type==handleType.reApply"> |
| | | 确认æ è¯¯å¹¶éæ°æäº¤ï¼ |
| | | </div> |
| | | <a-form ref="form" :model="form" :label-width="85" > |
| | | <a-form-item v-if="type!==handleType.reApply" label="å¤çæè§" prop="reason"> |
| | | <a-input type="textarea" v-model="form.comment" :rows="4" /> |
| | | </a-form-item> |
| | | <div v-show="type==2"> |
| | | <a-form-item label="éåèç¹" prop="targetKey" v-if="returnTaskList.length"> |
| | | <a-radio-group v-model="form.targetKey" @change="targetKeyChange"> |
| | | <a-radio-button |
| | | v-for="item in returnTaskList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | >{{item.name}}</a-radio-button> |
| | | </a-radio-group> |
| | | </a-form-item> |
| | | <span v-else>æ å¯éåèç¹ï¼</span> |
| | | </div> |
| | | <div v-if="form.targetKey !== 'start' && candidateUsers.length"> |
| | | <a-form-item label="ä¸ä¸ªèç¹å®¡æ¹åé人"> |
| | | <a-select |
| | | mode="multiple" |
| | | v-model="candidateUsersSelecteds" |
| | | style="width: 100%" |
| | | placeholder="è¯·éæ©ä¸ä¸ªèç¹å®¡æ¹åé人" |
| | | > |
| | | <a-select-option v-for="user in candidateUsers" :key="user.username" :value="user.username"> |
| | | {{user.realname}} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </div> |
| | | </a-form> |
| | | </div> |
| | | <div slot="footer"> |
| | | <a-button type="text" @click="modalTaskVisible=false">åæ¶</a-button> |
| | | <a-button type="primary" :loading="submitLoading" @click="handelSubmit">æäº¤</a-button> |
| | | </div> |
| | | </a-modal> |
| | | </span> |
| | | </template> |
| | | |
| | | <script> |
| | | import {completeTask, rejectTask, returnList, returnTask} from "@views/flowable/api/todo"; |
| | | |
| | | export default { |
| | | name: 'ActHandleBtn', |
| | | components: {}, |
| | | props: { |
| | | btnType: { type: String, default: 'link', required: false }, |
| | | /* handleType 0éè¿ 1驳å 2éå */ |
| | | type: { |
| | | type: String|Number, |
| | | default: '0', |
| | | required: true |
| | | }, |
| | | dataId: { |
| | | type: String, |
| | | default: '', |
| | | required: true |
| | | }, |
| | | /*æµç¨åé*/ |
| | | variables:{ |
| | | type: Object, |
| | | default: ()=>{}, |
| | | }, |
| | | candidateUsers:{ |
| | | type: Array, |
| | | default: ()=>[], |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: 'å¤ç', |
| | | required: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | handleType:{ |
| | | // éè¿ |
| | | pass: 0, |
| | | // 驳å |
| | | back: 1, |
| | | // éå |
| | | return: 2, |
| | | // éæ°æäº¤ |
| | | reApply: 3 |
| | | }, |
| | | returnTaskList: [], |
| | | candidateUsersSelecteds:[], |
| | | modalTaskVisible: false, |
| | | submitLoading: false, |
| | | form: { |
| | | comment:'', |
| | | targetKey:'' |
| | | }, |
| | | modalTaskTitle: '', |
| | | |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | }, |
| | | methods: { |
| | | handle() { |
| | | this.form.comment = '' |
| | | this.candidateUsersSelecteds = [] |
| | | if (this.type === this.handleType.delegate) { |
| | | // this.delegateTask(); |
| | | } else if (this.type === this.handleType.pass) { |
| | | this.passTask(); |
| | | } else if (this.type === this.handleType.back) { |
| | | this.backTask(); |
| | | } else if(this.type === this.handleType.return){ |
| | | this.returnTask(); |
| | | } else if(this.type === this.handleType.reApply){ |
| | | this.reApply(); |
| | | } |
| | | else { |
| | | this.$message.warn('æªç¥ç±»åtypeï¼åè§ handleType'); |
| | | } |
| | | }, |
| | | reApply() { |
| | | const v = this; |
| | | this.modalTaskTitle = 'ç¡®è®¤éæ°æäº¤'; |
| | | this.modalTaskVisible = true; |
| | | }, |
| | | passTask() { |
| | | const v = this; |
| | | this.modalTaskTitle = '审æ¹éè¿'; |
| | | this.modalTaskVisible = true; |
| | | }, |
| | | backTask() { |
| | | const v = this; |
| | | this.modalTaskTitle = '审æ¹é©³å'; |
| | | this.modalTaskVisible = true; |
| | | }, |
| | | returnTask() { |
| | | const v = this; |
| | | this.modalTaskTitle = '审æ¹éå'; |
| | | this.modalTaskVisible = true; |
| | | returnList({dataId:this.dataId}).then(res => { |
| | | this.returnTaskList = res.result||[]; |
| | | // console.log(this.returnTaskList) |
| | | }) |
| | | }, |
| | | |
| | | handelSubmit() { |
| | | console.log('æäº¤'); |
| | | this.submitLoading = true; |
| | | var formData = Object.assign({ |
| | | dataId:this.dataId, |
| | | candidateUsers:this.candidateUsersSelecteds, |
| | | values:Object.assign({dataId:this.dataId},this.variables) |
| | | }, this.form); |
| | | if (this.type==this.handleType.reApply){ |
| | | formData.comment = 'éæ°æäº¤' |
| | | } |
| | | if (!formData.comment){ |
| | | this.$message.error('请è¾å
¥å®¡æ¹æè§ï¼'); |
| | | this.submitLoading=false |
| | | return; |
| | | } |
| | | // æä¸ä¸ªèç¹å®¡æ¹äººéæ©ï¼ä½æ¯æªé |
| | | if (this.candidateUsers.length && |
| | | this.candidateUsersSelecteds.length==0 && |
| | | this.form.targetKey !== 'start' |
| | | ){ |
| | | this.$message.error('è¯·éæ©ä¸ä¸ªèç¹å®¡æ¹äººï¼'); |
| | | this.submitLoading=false |
| | | return; |
| | | } |
| | | if (this.type == this.handleType.reApply || this.type == this.handleType.pass) { |
| | | // éè¿ |
| | | completeTask(formData).then(res => { |
| | | this.submitLoading = false; |
| | | if (res.success) { |
| | | this.$message.success('æä½æå'); |
| | | this.modalTaskVisible = false; |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message.error('æä½å¤±è´¥'); |
| | | } |
| | | }).finally(()=>{this.submitLoading=false}); |
| | | } else if (this.type == this.handleType.back) { |
| | | // 驳å |
| | | rejectTask(formData).then(res => { |
| | | this.submitLoading = false; |
| | | if (res.success) { |
| | | this.$message.success('æä½æå'); |
| | | this.modalTaskVisible = false; |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message.error('æä½å¤±è´¥'); |
| | | } |
| | | }).finally(()=>{this.submitLoading=false}); |
| | | |
| | | } else if (this.type == this.handleType.return){ |
| | | if (!formData.targetKey){ |
| | | this.$message.error('è¯·éæ©éåèç¹ï¼'); |
| | | this.submitLoading=false |
| | | return; |
| | | } |
| | | //éå |
| | | returnTask(formData).then(res => { |
| | | this.submitLoading = false; |
| | | if (res.success) { |
| | | this.$message.success('æä½æå'); |
| | | this.modalTaskVisible = false; |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message.error('æä½å¤±è´¥'); |
| | | } |
| | | }).finally(()=>{this.submitLoading=false}); |
| | | } |
| | | }, |
| | | |
| | | targetKeyChange() { |
| | | this.candidateUsersSelecteds = [] |
| | | this.$emit('targetKeyChange',this.form.targetKey) |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style lang="less"> |
| | | </style> |
| | | <template> |
| | | <span> |
| | | <a-button :type="btnType" @click="history()" >{{text}}</a-button> |
| | | <a-modal title="审æ¹åå²" v-model="modalLsVisible" :mask-closable="true" :width="'80%'" :footer="null"> |
| | | <div v-if="modalLsVisible"> |
| | | <HistoricDetail ref="historicDetail" :data-id="dataId"></HistoricDetail> |
| | | </div> |
| | | </a-modal> |
| | | </span> |
| | | </template> |
| | | |
| | | <script> |
| | | import HistoricDetail from './HistoricDetail'; |
| | | export default { |
| | | name: 'ActHistoricDetailBtn', |
| | | components: { HistoricDetail }, |
| | | props: { |
| | | btnType: { type: String, default: 'link', required: false }, |
| | | /**/ |
| | | dataId: { |
| | | type: String, |
| | | default: '', |
| | | required: true |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: '审æ¹åå²', |
| | | required: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | modalLsVisible: false |
| | | }; |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | }, |
| | | methods: { |
| | | history() { |
| | | if (!this.dataId) { |
| | | this.$message.error('æµç¨å®ä¾IDä¸åå¨'); |
| | | return; |
| | | } |
| | | this.modalLsVisible = true; |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style lang="less"> |
| | | </style> |
| | | <template> |
| | | <div class="search"> |
| | | <a-card> |
| | | <p slot="title"> |
| | | <span>æµç¨å¾</span> |
| | | </p> |
| | | <div :style="{height: svgHeight}" v-if="svgShow"> |
| | | <bpmnModeler class="svg" ref="bpm" :xml="xmlData" :is-view="true"></bpmnModeler> |
| | | </div> |
| | | </a-card> |
| | | <a-card style="margin-top:10px;"> |
| | | <p slot="title"> |
| | | <span>æµç¨å®¡æ¹è¿åº¦åå²</span> |
| | | </p> |
| | | <a-row style="position:relative"> |
| | | <div class="block"> |
| | | <a-timeline> |
| | | <a-timeline-item |
| | | v-for="(item,index ) in flowRecordList" |
| | | :key="index" |
| | | :color="setColor(item.finishTime)" |
| | | > |
| | | <p style="font-weight: 700;">{{item.taskName}} |
| | | <i v-if="!item.finishTime" style="color: orange">(å¾
åä¸ããã)</i> |
| | | </p> |
| | | |
| | | <a-card :body-style="{ padding: '10px' }"> |
| | | <label v-if="item.assigneeName&&item.finishTime" style="font-weight: normal;margin-right: 30px;">å®é
åçäººï¼ {{item.assigneeName}} <a-tag type="info" size="mini">{{item.deptName}}</a-tag></label> |
| | | <label v-if="item.candidate" style="font-weight: normal;margin-right: 30px;">åéåçäººï¼ {{item.candidate}}</label> |
| | | <label style="font-weight: normal">æ¥æ¶æ¶é´ï¼ </label><label style="color:#8a909c;font-weight: normal">{{item.createTime}}</label> |
| | | <label v-if="item.finishTime" style="margin-left: 30px;font-weight: normal">åç»æ¶é´ï¼ </label><label style="color:#8a909c;font-weight: normal">{{item.finishTime}}</label> |
| | | <label v-if="item.duration" style="margin-left: 30px;font-weight: normal">èæ¶ï¼ </label><label style="color:#8a909c;font-weight: normal">{{item.duration}}</label> |
| | | |
| | | <p v-if="item.comment"> |
| | | <!-- 1 æ£å¸¸æè§ 2 éåæè§ 3 驳åæè§ --> |
| | | <a-tag color="green" v-if="item.comment.type === '1'"> |
| | | <span v-if="item.comment.comment!='éæ°æäº¤'">éè¿ï¼</span> |
| | | {{item.comment.comment}} |
| | | </a-tag> |
| | | <a-tag color="orange" v-if="item.comment.type === '2'">éåï¼ {{item.comment.comment}}</a-tag> |
| | | <a-tag color="red" v-if="item.comment.type === '3'">驳åï¼ {{item.comment.comment}}</a-tag> |
| | | </p> |
| | | </a-card> |
| | | </a-timeline-item> |
| | | </a-timeline> |
| | | </div> |
| | | </a-row> |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {flowRecord} from "@views/flowable/api/finished"; |
| | | import {getFlowViewerByDataId, readXmlByDataId} from "@views/flowable/api/definition"; |
| | | import bpmnModeler from "workflow-bpmn-modeler"; |
| | | |
| | | export default { |
| | | name: 'HistoricDetail', |
| | | components: { |
| | | bpmnModeler, |
| | | }, |
| | | props: { |
| | | /**/ |
| | | dataId: { |
| | | type: String, |
| | | default: '', |
| | | required: true |
| | | }, |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | taskList:[], |
| | | flowRecordList: [], // æµç¨æµè½¬æ°æ® |
| | | formData:{}, |
| | | xmlData:'', |
| | | type: 0, |
| | | loading: false, // 表åå è½½ç¶æ |
| | | loadingImg: false, |
| | | data: [], |
| | | id: '', |
| | | imgUrl: '', |
| | | backRoute: '', |
| | | svgHeight:'', |
| | | svgShow: true |
| | | }; |
| | | }, |
| | | created() { |
| | | this.init(); |
| | | }, |
| | | watch: { |
| | | dataId: function(newval, oldName) { |
| | | this.init(); |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | init() { |
| | | this.getFlowRecordList() |
| | | this.getModelDetail() |
| | | }, |
| | | /** xml æä»¶ */ |
| | | getModelDetail() { |
| | | // åé请æ±ï¼è·åxml |
| | | readXmlByDataId(this.dataId).then(res => { |
| | | this.xmlData = res.result |
| | | this.getFlowViewer() |
| | | setTimeout(()=>{ |
| | | this.fitViewport() |
| | | }) |
| | | }) |
| | | }, |
| | | // æµç¨è¿è¡æ
åµ |
| | | getFlowViewer() { |
| | | getFlowViewerByDataId(this.dataId).then(res => { |
| | | this.taskList = res.result || [] |
| | | this.fillColor(); |
| | | }) |
| | | }, |
| | | /** æµç¨æµè½¬è®°å½ */ |
| | | getFlowRecordList() { |
| | | const params = {dataId: this.dataId} |
| | | flowRecord(params).then(res => { |
| | | // console.log(res) |
| | | this.flowRecordList = res.result.flowList; |
| | | this.finishOrder() |
| | | // æµç¨è¿ç¨ä¸ä¸åå¨åå§å表å ç´æ¥è¯»åçæµç¨åéä¸åå¨ç表åå¼ |
| | | if (res.result.formData) { |
| | | this.formData = res.result.formData; |
| | | } |
| | | }).catch(res => { |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | //æ´ç顺åºï¼æå¾
åæ¾æä¸é¢ï¼å¹¶ä¸åªçä¸ä¸ªï¼ä¸ç¶ä¼ç¾æ¶ä¼ä¹±ï¼ |
| | | finishOrder(){ |
| | | const list = [] |
| | | let noFinish = null |
| | | for (const flow of this.flowRecordList) { |
| | | if (flow.finishTime){ |
| | | // åç»çèç¹åæ¶åæå®é
åç人çï¼å 为ä¼ç¾ä¼å°ææçå¤å®ä¾é½è¿åï¼éè¦è¿æ»¤ |
| | | if (flow.assigneeId){ |
| | | list.push(flow) |
| | | } |
| | | } else { |
| | | noFinish = flow |
| | | } |
| | | } |
| | | if (noFinish){ |
| | | const find = list.find(obj=>obj.taskDefKey == noFinish.taskDefKey); |
| | | if (find){ |
| | | noFinish.taskName = 'ãä¼ç¾ä¸ã'+noFinish.taskName |
| | | } |
| | | this.flowRecordList = [noFinish,...list]; |
| | | } else { |
| | | this.flowRecordList = list; |
| | | } |
| | | |
| | | }, |
| | | setColor(val) { |
| | | if (val) { |
| | | return "#2bc418"; |
| | | } else { |
| | | return "#b3bdbb"; |
| | | } |
| | | }, |
| | | fillColor() { |
| | | const modeler = this.$refs.bpm.modeler; |
| | | const canvas = modeler.get('canvas') |
| | | modeler._definitions.rootElements[0].flowElements.forEach(n => { |
| | | const completeTask = this.taskList.find(m => m.key === n.id) |
| | | const todoTask = this.taskList.find(m => !m.completed) |
| | | const endTask = this.taskList[this.taskList.length - 1] |
| | | //ç¨æ·ä»»å¡ |
| | | if (n.$type === 'bpmn:UserTask') { |
| | | if (completeTask) { |
| | | canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') |
| | | canvas.addMarker(n.id, completeTask.back ? 'highlight-back' : 'highlight-noback') |
| | | n.outgoing.forEach(nn => { |
| | | const targetTask = this.taskList.find(m => m.key === nn.targetRef.id) |
| | | if (targetTask) { |
| | | if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ |
| | | canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') |
| | | canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') |
| | | }else { |
| | | canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | // æä»ç½å
³ |
| | | else if (n.$type === 'bpmn:ExclusiveGateway') { |
| | | if (completeTask) { |
| | | canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') |
| | | n.outgoing.forEach(nn => { |
| | | const targetTask = this.taskList.find(m => m.key === nn.targetRef.id) |
| | | if (targetTask) { |
| | | |
| | | canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | } |
| | | // å¹¶è¡ç½å
³ |
| | | else if (n.$type === 'bpmn:ParallelGateway') { |
| | | if (completeTask) { |
| | | canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') |
| | | n.outgoing.forEach(nn => { |
| | | debugger |
| | | const targetTask = this.taskList.find(m => m.key === nn.targetRef.id) |
| | | if (targetTask) { |
| | | canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | else if (n.$type === 'bpmn:StartEvent') { |
| | | n.outgoing.forEach(nn => { |
| | | const completeTask = this.taskList.find(m => m.key === nn.targetRef.id) |
| | | if (completeTask) { |
| | | canvas.addMarker(nn.id, 'highlight') |
| | | canvas.addMarker(n.id, 'highlight') |
| | | return |
| | | } |
| | | }) |
| | | } |
| | | else if (n.$type === 'bpmn:EndEvent') { |
| | | if (endTask.key === n.id && endTask.completed) { |
| | | canvas.addMarker(n.id, 'highlight') |
| | | return |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 让å¾è½èªéåºå±å¹ |
| | | fitViewport() { |
| | | const modeler = this.$refs.bpm.modeler; |
| | | const canvas = modeler.get('canvas') |
| | | // this.zoom = this.modeler.get('canvas').zoom('fit-viewport') |
| | | if (this.svgHeight){ |
| | | document.querySelector('.canvas').style.height = this.svgHeight; |
| | | } |
| | | const bbox = document.querySelector('.flow-containers .viewport').getBBox() |
| | | const currentViewbox = modeler.get('canvas').viewbox() |
| | | if (!this.svgHeight){ |
| | | this.svgHeight = currentViewbox.inner.height + 'px' |
| | | this.svgShow = false |
| | | this.$nextTick(()=>{ |
| | | this.svgShow = true |
| | | }) |
| | | // this.fitViewport() |
| | | setTimeout(()=>{ |
| | | this.fitViewport() |
| | | }) |
| | | } |
| | | |
| | | const elementMid = { |
| | | x: bbox.x + bbox.width / 2 - 65, |
| | | y: bbox.y + bbox.height / 2 |
| | | } |
| | | // è°èä½ç½® |
| | | modeler.get('canvas').viewbox({ |
| | | x: elementMid.x - currentViewbox.width / 2 + 70, |
| | | y: elementMid.y - currentViewbox.height/2, |
| | | width: currentViewbox.width, |
| | | height: currentViewbox.height |
| | | }) |
| | | // è°è大å°ç¼©æ¾ |
| | | const zoom = currentViewbox.outer.width /(currentViewbox.inner.width+200) |
| | | console.log('********',zoom,elementMid,currentViewbox.inner,currentViewbox.outer) |
| | | // modeler.get('canvas').zoom(zoom) |
| | | |
| | | |
| | | }, |
| | | } |
| | | |
| | | }; |
| | | </script> |
| | | <style lang="less"> |
| | | .highlight.djs-shape .djs-visual > :nth-child(1) { |
| | | fill: green !important; |
| | | stroke: green !important; |
| | | fill-opacity: 0.2 !important; |
| | | } |
| | | .highlight.djs-shape .djs-visual > :nth-child(2) { |
| | | fill: green !important; |
| | | } |
| | | .highlight.djs-shape .djs-visual > path { |
| | | fill: green !important; |
| | | fill-opacity: 0.2 !important; |
| | | stroke: green !important; |
| | | } |
| | | .highlight.djs-connection > .djs-visual > path { |
| | | stroke: green !important; |
| | | } |
| | | // .djs-connection > .djs-visual > path { |
| | | // stroke: orange !important; |
| | | // stroke-dasharray: 4px !important; |
| | | // fill-opacity: 0.2 !important; |
| | | // } |
| | | // .djs-shape .djs-visual > :nth-child(1) { |
| | | // fill: orange !important; |
| | | // stroke: orange !important; |
| | | // stroke-dasharray: 4px !important; |
| | | // fill-opacity: 0.2 !important; |
| | | // } |
| | | .highlight-todo.djs-connection > .djs-visual > path { |
| | | stroke: orange !important; |
| | | stroke-dasharray: 4px !important; |
| | | fill-opacity: 0.2 !important; |
| | | } |
| | | .highlight-todo.djs-shape .djs-visual > :nth-child(1) { |
| | | fill: orange !important; |
| | | stroke: orange !important; |
| | | stroke-dasharray: 4px !important; |
| | | fill-opacity: 0.2 !important; |
| | | } |
| | | .highlight-back.djs-connection > .djs-visual > path { |
| | | stroke: red !important; |
| | | stroke-dasharray: 4px !important; |
| | | fill-opacity: 0.2 !important; |
| | | } |
| | | .highlight-back.djs-shape .djs-visual > :nth-child(1) { |
| | | fill: red !important; |
| | | stroke: red !important; |
| | | stroke-dasharray: 4px !important; |
| | | fill-opacity: 0.2 !important; |
| | | } |
| | | .overlays-div { |
| | | font-size: 10px; |
| | | color: red; |
| | | width: 100px; |
| | | top: -20px !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Vue from "vue"; |
| | | import {USER_INFO} from "@/store/mutation-types"; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | export const FlowableMixin = { |
| | | data(){ |
| | | return { |
| | | loginUser:{} |
| | | } |
| | | }, |
| | | created() { |
| | | this.loginUser = Vue.ls.get(USER_INFO); |
| | | }, |
| | | methods:{ |
| | | // å½åæ°æ®æ¯å¦å¯æäº¤ |
| | | isCanApply(row){ |
| | | // æ²¡ææµç¨å®ä¾çå³å¯æäº¤ |
| | | return !Boolean(row.processInstanceId); |
| | | }, |
| | | // å½åæ°æ®æ¯å¦å¯æ¤å |
| | | isCanRecall(row){ |
| | | // è¿è¡ä¸çæµç¨&&å½åèç¹ä¸æ¯å¼å§èç¹&&ç¶æä¸æ¯éè¿ |
| | | return Boolean(row.processInstanceId)&&row.taskNameId!=='start'&&row.actStatus!=='审æ¹éè¿'; |
| | | }, |
| | | // éæ°æäº¤æé® |
| | | isCanReApply(row){ |
| | | return row.taskNameId=='start'&&this.isTodoUsers(row); |
| | | }, |
| | | // éè¿æé® |
| | | isCanPass(row){ |
| | | return row.taskNameId!=='start'&& this.isTodoUsers(row); |
| | | }, |
| | | // 驳åéåæé® |
| | | isCanBacke(row){ |
| | | // 䏿¯startèç¹&&å¨å¯æä½äººåå表 |
| | | return row.taskNameId!=='start'&&this.isTodoUsers(row); |
| | | }, |
| | | // æ¥ç审æ¹åå²æé® |
| | | isCanHistoric(row){ |
| | | // æå®ä¾idå°±è½æ¥ç |
| | | return Boolean(row.processInstanceId); |
| | | }, |
| | | // å½åç»å½äººæ¯å¦å¨å¤ç人å表 |
| | | isTodoUsers(row){ |
| | | const todoUsers = row.todoUsers; |
| | | if (todoUsers&&todoUsers.length){ |
| | | const parse = JSON.parse(todoUsers)||[]; |
| | | return parse.includes(this.loginUser.username); |
| | | }else { |
| | | return false; |
| | | } |
| | | }, |
| | | // å½åç»å½äººæ¯å¦æ¯å¤çè¿ç人å表 |
| | | isDoneUsers(row){ |
| | | const doneUsers = row.doneUsers; |
| | | if (doneUsers&&doneUsers.length){ |
| | | const parse = JSON.parse(doneUsers)||[]; |
| | | return parse.includes(this.loginUser.username); |
| | | }else { |
| | | return false; |
| | | } |
| | | }, |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- ==================æµç¨å®ä¹å表=============== --> |
| | | <a-card v-if="!xmlFrame.open||xmlView"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> |
| | | <el-form-item label="æµç¨åç§°" prop="name"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请è¾å
¥åç§°" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨åç±»" prop="category"> |
| | | <el-select @change="handleQuery" v-model="queryParams.category" placeholder="è¯·éæ©æµç¨åç±»" clearable prop="category"> |
| | | <el-option label="è¯·éæ©" value="" /> |
| | | <el-option v-for="category in categorys" :key="category.id" :label="category.name" :value="category.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¿æ´»" prop="active"> |
| | | <el-switch |
| | | v-model="queryParams.active" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | @change="handleQuery" |
| | | > |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleLoadXml" |
| | | >æ°å¢æµç¨å®ä¹</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-table |
| | | v-loading="loading" fit |
| | | :data="definitionList" |
| | | row-key="id" |
| | | border |
| | | lazy |
| | | :load="load" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
| | | <el-table-column label="æµç¨å®ä¹id" align="center" prop="id" /> |
| | | <el-table-column label="æµç¨æ è¯Key" align="center" prop="key" /> |
| | | <el-table-column label="æµç¨åç±»" align="center" > |
| | | <template slot-scope="scope"> |
| | | <span>{{ getCategoryName(scope.row.category) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æµç¨åç§°" align="center" :show-overflow-tooltip="true"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleReadImage(scope.row.deploymentId)"> |
| | | <span>{{ scope.row.name }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æµç¨çæ¬" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="medium" >v{{ scope.row.version }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="scope.row.suspensionState === 1">æ¿æ´»</el-tag> |
| | | <el-tag type="warning" v-if="scope.row.suspensionState === 2">æèµ·</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é¨ç½²æ¶é´" align="center" prop="deploymentTime" width="180"/> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-dropdown> |
| | | <span class="el-dropdown-link"> |
| | | æ´å¤æä½<i class="el-icon-arrow-down el-icon--right"></i> |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item icon="el-icon-edit-outline" @click.native="handleLoadXml(scope.row)"> |
| | | ç¼è¾ |
| | | </el-dropdown-item> |
| | | <!-- <el-dropdown-item icon="el-icon-connection" @click.native="handleAddForm(scope.row)" v-if="scope.row.formId == null"> |
| | | é
置表å |
| | | </el-dropdown-item>--> |
| | | <el-dropdown-item icon="el-icon-video-pause" @click.native="handleUpdateSuspensionState(scope.row)" v-if="scope.row.suspensionState === 1"> |
| | | æèµ· |
| | | </el-dropdown-item> |
| | | <el-dropdown-item icon="el-icon-video-play" @click.native="handleUpdateSuspensionState(scope.row)" v-if="scope.row.suspensionState === 2"> |
| | | æ¿æ´» |
| | | </el-dropdown-item> |
| | | <el-dropdown-item icon="el-icon-delete" @click.native="handleDelete(scope.row)" > |
| | | å é¤ |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :current-page.sync="queryParams.pageNum" |
| | | :page-size.sync="queryParams.pageSize" |
| | | @size-change="getList" |
| | | @current-change="getList" |
| | | /> |
| | | </a-card> |
| | | <!-- æµç¨å¾ --> |
| | | <a-card v-if="xmlFrame.open&&!xmlView" :title="xmlFrame.title"> |
| | | <a slot="extra" href="#" @click="()=>{xmlFrame.open=false}">è¿å</a> |
| | | <bpmn-modeler |
| | | v-if="xmlShow" |
| | | ref="refNode" |
| | | :xml="xmlData" |
| | | :users="users" |
| | | :groups="groups" |
| | | :categorys="categorys" |
| | | :is-view="xmlView" |
| | | @save="save" |
| | | /> |
| | | </a-card> |
| | | <!-- å¼¹çªé¢è§ --> |
| | | <a-modal :title="xmlFrame.title" :visible.sync="xmlView&&xmlFrame.open" :width="xmlFrame.width" |
| | | :footer="null" closable @cancel="()=>{xmlView=false,xmlFrame.open=false}" |
| | | > |
| | | <bpmn-modeler |
| | | v-if="xmlShow" |
| | | ref="refNode" |
| | | :xml="xmlData" |
| | | :users="users" |
| | | :groups="groups" |
| | | :categorys="categorys" |
| | | :is-view="xmlView" |
| | | @save="save" |
| | | /> |
| | | </a-modal> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import bpmnModeler from "workflow-bpmn-modeler"; |
| | | import { |
| | | categoryList, |
| | | delDeployment, |
| | | listDefinition, |
| | | readXml, |
| | | roleList, |
| | | saveXml, |
| | | updateState, |
| | | userList |
| | | } from "@views/flowable/api/definition"; |
| | | |
| | | export default { |
| | | components: { |
| | | bpmnModeler, |
| | | }, |
| | | data() { |
| | | return { |
| | | /*===================设计å¨å±æ§======================*/ |
| | | users: [], |
| | | groups: [], |
| | | categorys: [], |
| | | /*=================页é¢å±æ§===================*/ |
| | | loading: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // æµç¨å®ä¹è¡¨æ ¼æ°æ® |
| | | definitionList: [], |
| | | allDefinitionList: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: null, |
| | | category: null, |
| | | key: null, |
| | | tenantId: null, |
| | | deployTime: null, |
| | | derivedFrom: null, |
| | | derivedFromRoot: null, |
| | | parentDeploymentId: null, |
| | | engineVersion: null |
| | | }, |
| | | xmlFrame:{ |
| | | width:'70%', |
| | | title:'æµç¨å¾', |
| | | open: false, |
| | | src: "", |
| | | }, |
| | | // xml |
| | | xmlData:"", |
| | | xmlShow: true, |
| | | xmlView: false, |
| | | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.initUserAndRole(); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /*===============设计å¨===============*/ |
| | | initUserAndRole(){ |
| | | userList({}).then(res=>{ |
| | | this.users = res.result||[] |
| | | this.users.map(o=>{ |
| | | o.id = o.username |
| | | o.name = o.realname |
| | | }) |
| | | }) |
| | | roleList({}).then(res=>{ |
| | | this.groups = res.result||[] |
| | | this.groups.map(o=>{ |
| | | o.name = o.roleName |
| | | }) |
| | | }) |
| | | categoryList({}).then(res=>{ |
| | | this.categorys = res.result||[] |
| | | }) |
| | | }, |
| | | getModelDetail(deployId) { |
| | | // åé请æ±ï¼è·åxml |
| | | readXml(deployId).then(res =>{ |
| | | this.xmlData = res.result; |
| | | }) |
| | | }, |
| | | getCategoryName(category){ |
| | | let find = this.categorys.find(o=>o.id==category); |
| | | if (find){ |
| | | return find.name |
| | | } |
| | | return '' |
| | | }, |
| | | /*ä¿åæµç¨å®ä¹*/ |
| | | save(data) { |
| | | console.log(data); // { process: {...}, xml: '...', svg: '...' } |
| | | const params = { |
| | | name: data.process.name, |
| | | category: data.process.category, |
| | | xml: data.xml |
| | | } |
| | | saveXml(params).then(res => { |
| | | this.$message.success(res.message) |
| | | // å
³éå½åæ ç¾é¡µå¹¶è¿åä¸ä¸ªé¡µé¢ |
| | | this.getList() |
| | | this.xmlFrame.open = false |
| | | }) |
| | | }, |
| | | /*================页é¢===============*/ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.queryParams.suspensionState = this.queryParams.active?1:0; |
| | | this.getList(); |
| | | }, |
| | | /** æ¥è¯¢æµç¨å®ä¹å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | // ææ°çæ¬ |
| | | const param1 = Object.assign({ |
| | | isLastVersion:1, |
| | | },this.queryParams) |
| | | listDefinition(param1).then(response => { |
| | | this.definitionList = response.result.records; |
| | | this.total = response.result.total; |
| | | this.loading = false; |
| | | for (const definition of this.definitionList) { |
| | | definition.hasChildren = true |
| | | } |
| | | }); |
| | | // ææ |
| | | const param2 = Object.assign({ |
| | | isLastVersion:0 |
| | | },this.queryParams,{ |
| | | pageSize: 9999, |
| | | pageNum:1 |
| | | }) |
| | | listDefinition(param2).then(response => { |
| | | console.log(response) |
| | | this.allDefinitionList = response.result.records; |
| | | }); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields() |
| | | }, |
| | | /** æå¼æµç¨è®¾è®¡å¼¹çªé¡µé¢ */ |
| | | handleLoadXml(row){ |
| | | if (row&&row.deploymentId){ |
| | | console.log(row.deploymentId) |
| | | this.handleReadImage(row.deploymentId) |
| | | this.xmlView = false |
| | | this.xmlFrame.title = "ç¼è¾æµç¨å¾"; |
| | | } else { |
| | | //æ°å¢ |
| | | this.xmlData = '' |
| | | this.xmlView = false |
| | | this.xmlFrame.open = true |
| | | this.xmlFrame.title = 'æ°å¢æµç¨' |
| | | this.xmlShow = false |
| | | this.$nextTick(()=>{ |
| | | this.xmlShow = true |
| | | }) |
| | | } |
| | | this.xmlFrame.width = '90%' |
| | | }, |
| | | /** æµç¨å¾æ¥ç */ |
| | | handleReadImage(deploymentId){ |
| | | this.xmlFrame.title = "æµç¨å¾"; |
| | | this.xmlFrame.open = true; |
| | | this.xmlFrame.width = '70%'; |
| | | // this.xmlFrame.src = process.env.VUE_APP_BASE_API + "/flowable/definition/xmlFrame/" + deploymentId; |
| | | // åé请æ±ï¼è·åxml |
| | | this.xmlView = true |
| | | readXml(deploymentId).then(res =>{ |
| | | if (res.success){ |
| | | this.xmlData = res.result |
| | | /*this.xmlShow = false |
| | | this.$nextTick(()=>{ |
| | | this.xmlShow = true |
| | | })*/ |
| | | } else { |
| | | this.$message.error("è·åæµç¨å¾å¤±è´¥ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | // æå¼ä¸å¡è¡¨å |
| | | handleForm() { |
| | | }, |
| | | // é
ç½®ä¸å¡è¡¨å |
| | | handleAddForm(row) { |
| | | }, |
| | | /** æèµ·/æ¿æ´»æµç¨ */ |
| | | handleUpdateSuspensionState(row){ |
| | | let state = 1; |
| | | if (row.suspensionState === 1) { |
| | | state = 2 |
| | | } |
| | | const params = { |
| | | deployId: row.deploymentId, |
| | | state: state |
| | | } |
| | | updateState(params).then(res => { |
| | | this.$message.success(res.message); |
| | | this.getList(); |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | // const ids = row.deploymentId || this.ids; |
| | | const params = { |
| | | deployId: row.deploymentId |
| | | } |
| | | this.$confirm({ |
| | | title:"è¦å", |
| | | content:'æ¯å¦ç¡®è®¤å 餿µç¨å®ä¹ç¼å·ä¸º"' + params.deployId + '"çæ°æ®é¡¹?', |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | onOk:()=>{ |
| | | delDeployment(params).then(res=>{ |
| | | this.getList(); |
| | | if (res.success){ |
| | | this.$message.success('å 餿å'); |
| | | } else { |
| | | this.$message.success('å é¤å¤±è´¥'); |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | load(tree, treeNode, resolve) { |
| | | const key = tree.key; |
| | | const childrens = [] |
| | | for (const one of this.allDefinitionList) { |
| | | if (one.key==key&&one.id!=tree.id){ |
| | | childrens.push(one) |
| | | } |
| | | } |
| | | console.log(tree, treeNode,this.allDefinitionList,childrens) |
| | | resolve(childrens) |
| | | } |
| | | }, |
| | | computed: { |
| | | getContainer() { |
| | | return document.querySelector('#app') |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç¨æ·å"> |
| | | <a-input placeholder="请è¾å
¥ç¨æ·å" v-model="queryParam.name"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ§å«"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©æ§å«" v-model="queryParam.sex" dictCode="sex"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çæ¥"> |
| | | <j-date placeholder="è¯·éæ©çæ¥" v-model="queryParam.birthday"></j-date> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç¨æ·ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥ç¨æ·ç¼ç " v-model="queryParam.userCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="åå¸"> |
| | | <j-area-linkage type="cascader" v-model="queryParam.chegnshi" placeholder="è¯·éæ©çå¸åº"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="checkbox"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©checkbox" v-model="queryParam.ceck" dictCode="sex"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="䏿å¤é"> |
| | | <j-multi-select-tag placeholder="è¯·éæ©ä¸æå¤é" dictCode="sex" v-model="queryParam.xiamuti"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æç´¢ä¸æ"> |
| | | <j-search-select-tag placeholder="è¯·éæ©æç´¢ä¸æ" v-model="queryParam.searchSel" dict="sys_role,role_name,role_code"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('æµè¯ç¨æ·è¡¨')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="pcaSlot" slot-scope="text"> |
| | | <div>{{ getPcaText(text) }}</div> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" ></a-divider> |
| | | <a @click="relationAct(record)">å
³èæµç¨</a> |
| | | <act-apply-btn @success="loadData" :data-id="record.id" |
| | | :variables="{ assigneeList:[]}"></act-apply-btn> |
| | | {{isCanApply(record)}} |
| | | <act-handle-btn @success="loadData" :data-id="record.id" :type="3" text="éæ°æäº¤"></act-handle-btn> |
| | | {{isCanReApply(record)}} |
| | | <act-handle-btn @success="loadData" :data-id="record.id" :type="0" text="éè¿" |
| | | :candidate-users="[{username:'admin',realname:'管çå'},{username:'jeecg',realname:'jeecgè´¦å·'}]" |
| | | ></act-handle-btn> |
| | | {{isCanPass(record)}} |
| | | <act-handle-btn @success="loadData" :data-id="record.id" :type="1" text="驳å"></act-handle-btn> |
| | | {{isCanBacke(record)}} |
| | | <act-handle-btn @success="loadData" :data-id="record.id" :type="2" text="éå" |
| | | @targetKeyChange="targetKeyChange" |
| | | :candidate-users="[{username:'admin',realname:'管çå'},{username:'jeecg',realname:'jeecgè´¦å·'}]" |
| | | ></act-handle-btn> |
| | | {{isCanBacke(record)}} |
| | | <act-cancel-btn @success="loadData" :data-id="record.id"></act-cancel-btn> |
| | | {{isCanRecall(record)}} |
| | | <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn> |
| | | {{isCanHistoric(record)}} |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <test-demo-modal ref="modalForm" @ok="modalFormOk"></test-demo-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import TestDemoModal from './modules/TestDemoModal' |
| | | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
| | | import Area from '@/components/_util/Area' |
| | | import {getAction} from "@api/manage"; |
| | | import ActApplyBtn from "@views/flowable/components/ActApplyBtn"; |
| | | import ActCancelBtn from "@views/flowable/components/ActCancelBtn"; |
| | | import ActHandleBtn from "@views/flowable/components/ActHandleBtn"; |
| | | import ActHistoricDetailBtn from "@views/flowable/components/ActHistoricDetailBtn"; |
| | | import {FlowableMixin} from "@views/flowable/mixin/FlowableMixin"; |
| | | |
| | | export default { |
| | | name: 'TestDemoList', |
| | | mixins:[JeecgListMixin, mixinDevice,FlowableMixin], |
| | | components: { |
| | | TestDemoModal, |
| | | ActApplyBtn, |
| | | ActCancelBtn, |
| | | ActHandleBtn, |
| | | ActHistoricDetailBtn |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'æµè¯ç¨æ·è¡¨ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'ç¨æ·å', |
| | | align:"center", |
| | | sorter: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title:'æ§å«', |
| | | align:"center", |
| | | sorter: true, |
| | | dataIndex: 'sex_dictText' |
| | | }, |
| | | { |
| | | title:'å¹´é¾', |
| | | align:"center", |
| | | dataIndex: 'age' |
| | | }, |
| | | { |
| | | title:'æµç¨ç¶æ', |
| | | align:"center", |
| | | dataIndex: 'actStatus' |
| | | }, |
| | | { |
| | | title:'å¾
å¤çèç¹', |
| | | align:"center", |
| | | dataIndex: 'taskName' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/test_demo/testDemo/list", |
| | | delete: "/test_demo/testDemo/delete", |
| | | deleteBatch: "/test_demo/testDemo/deleteBatch", |
| | | exportXlsUrl: "/test_demo/testDemo/exportXls", |
| | | importExcelUrl: "test_demo/testDemo/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | pcaData:'', |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.pcaData = new Area() |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | getPcaText(code){ |
| | | return this.pcaData.getText(code); |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'id',text:'主é®',dictCode:''}) |
| | | fieldList.push({type:'string',value:'name',text:'ç¨æ·å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'sex',text:'æ§å«',dictCode:'sex'}) |
| | | fieldList.push({type:'int',value:'age',text:'å¹´é¾',dictCode:''}) |
| | | fieldList.push({type:'string',value:'descc',text:'æè¿°',dictCode:''}) |
| | | fieldList.push({type:'date',value:'birthday',text:'çæ¥'}) |
| | | fieldList.push({type:'string',value:'userCode',text:'ç¨æ·ç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'topPic',text:'头å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'fileKk',text:'éä»¶',dictCode:''}) |
| | | fieldList.push({type:'pca',value:'chegnshi',text:'åå¸'}) |
| | | fieldList.push({type:'string',value:'pop',text:'å¼¹çª',dictCode:''}) |
| | | fieldList.push({type:'string',value:'ceck',text:'checkbox',dictCode:'sex'}) |
| | | fieldList.push({type:'list_multi',value:'xiamuti',text:'䏿å¤é',dictTable:'', dictText:'', dictCode:'sex'}) |
| | | fieldList.push({type:'sel_search',value:'searchSel',text:'æç´¢ä¸æ',dictTable:'sys_role', dictText:'role_name', dictCode:'role_code'}) |
| | | fieldList.push({type:'sel_search',value:'selTable',text:'䏿åå
¸è¡¨',dictTable:'sys_user', dictText:'realname', dictCode:'username'}) |
| | | this.superFieldList = fieldList |
| | | }, |
| | | relationAct(r) { |
| | | getAction("/test_demo/testDemo/relationAct",{dataId:r.id}).then(res=>{ |
| | | if (res.success){ |
| | | this.$message.success("æä½æå") |
| | | this.loadData() |
| | | } else { |
| | | this.$message.error("æä½å¤±è´¥") |
| | | } |
| | | }) |
| | | }, |
| | | targetKeyChange(targetKey) { |
| | | // todo |
| | | console.log('targetKeyæ¹åï¼æ¹å :candidate-users åé人',targetKey) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç¨æ·å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> |
| | | <a-input v-model="model.name" placeholder="请è¾å
¥ç¨æ·å" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æ§å«" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex"> |
| | | <j-dict-select-tag type="list" v-model="model.sex" dictCode="sex" placeholder="è¯·éæ©æ§å«" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å¹´é¾" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="age"> |
| | | <a-input-number v-model="model.age" placeholder="请è¾å
¥å¹´é¾" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="descc"> |
| | | <j-editor v-model="model.descc" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="çæ¥" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="birthday"> |
| | | <j-date placeholder="è¯·éæ©çæ¥" v-model="model.birthday" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç¨æ·ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userCode"> |
| | | <a-input v-model="model.userCode" placeholder="请è¾å
¥ç¨æ·ç¼ç " ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="头å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="topPic"> |
| | | <j-image-upload isMultiple v-model="model.topPic" ></j-image-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="éä»¶" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileKk"> |
| | | <j-upload v-model="model.fileKk" ></j-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå¸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chegnshi"> |
| | | <j-area-linkage type="cascader" v-model="model.chegnshi" placeholder="请è¾å
¥çå¸åº" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å¼¹çª" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pop"> |
| | | <a-input v-model="model.pop" placeholder="请è¾å
¥å¼¹çª" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="checkbox" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ceck"> |
| | | <j-multi-select-tag type="checkbox" v-model="model.ceck" dictCode="sex" placeholder="è¯·éæ©checkbox" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="䏿å¤é" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xiamuti"> |
| | | <j-multi-select-tag type="list_multi" v-model="model.xiamuti" dictCode="sex" placeholder="è¯·éæ©ä¸æå¤é" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æç´¢ä¸æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="searchSel"> |
| | | <j-search-select-tag v-model="model.searchSel" dict="sys_role,role_name,role_code" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="䏿åå
¸è¡¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="selTable"> |
| | | <j-search-select-tag v-model="model.selTable" dict="sys_user,realname,username" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'TestDemoForm', |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | name: [ |
| | | { required: true, message: '请è¾å
¥ç¨æ·å!'}, |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/test_demo/testDemo/add", |
| | | edit: "/test_demo/testDemo/edit", |
| | | queryById: "/test_demo/testDemo/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | submitForm () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | httpAction(httpurl,this.model,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <test-demo-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></test-demo-form> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import TestDemoForm from './TestDemoForm' |
| | | export default { |
| | | name: 'TestDemoModal', |
| | | components: { |
| | | TestDemoForm |
| | | }, |
| | | data () { |
| | | return { |
| | | title:'', |
| | | width:896, |
| | | visible: false, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(); |
| | | }) |
| | | }, |
| | | edit (record) { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.edit(record); |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | this.$refs.realForm.submitForm(); |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |