Browse Source

城市接口

develop
王健 4 years ago
parent
commit
1ae77050ce
  1. 230
      src/router/views/index.js
  2. 86
      src/views/activiti/api/activiti.js
  3. 23
      src/views/activiti/api/historic-task.js
  4. 52
      src/views/activiti/api/process.js
  5. 38
      src/views/activiti/api/task.js
  6. 281
      src/views/activiti/bpmn-editor.vue
  7. 316
      src/views/activiti/bpmn-module-editor.vue
  8. 65
      src/views/activiti/bpmn-viewer.vue
  9. 64
      src/views/activiti/crud/activiti.js
  10. 45
      src/views/activiti/crud/process.js
  11. 95
      src/views/activiti/crud/task.js
  12. 305
      src/views/activiti/detail.vue
  13. 33
      src/views/activiti/dialog-demo.vue
  14. 158
      src/views/activiti/historic-task.vue
  15. 193
      src/views/activiti/index.vue
  16. 210
      src/views/activiti/process.vue
  17. 206
      src/views/activiti/task.vue
  18. 35
      src/views/activiti/util/context-pad-provider-remove/context-pad-provider-remove.js
  19. 6
      src/views/activiti/util/context-pad-provider-remove/index.js
  20. 14
      src/views/activiti/util/custom-translate.js
  21. 226
      src/views/activiti/util/event-interceptor/bpmn-events.txt
  22. 5
      src/views/activiti/util/event-interceptor/bpmn-interaction.js
  23. 119
      src/views/activiti/util/event-interceptor/event-interceptor.js
  24. 6
      src/views/activiti/util/event-interceptor/index.js
  25. 6
      src/views/activiti/util/palette-provider-remove/index.js
  26. 41
      src/views/activiti/util/palette-provider-remove/palette-provider-remove.js
  27. 10
      src/views/activiti/util/remove-key-group.js
  28. 213
      src/views/activiti/util/translations.js
  29. 183
      src/views/activiti/util/xml-parser.js
  30. 50
      src/views/activiti/xxx.xml
  31. 14
      src/views/activiti/xxx1.xml
  32. 505
      src/views/city/cityCoordinate/index.vue
  33. 435
      src/views/city/cityList/index.vue
  34. 39
      src/views/gen/api/form.js
  35. 92
      src/views/gen/api/gen.js
  36. 40
      src/views/gen/crud/form.js
  37. 174
      src/views/gen/crud/gen.js
  38. 122
      src/views/gen/datasource.vue
  39. 71
      src/views/gen/design.vue
  40. 127
      src/views/gen/form.vue
  41. 189
      src/views/gen/index.vue
  42. 2
      src/views/land/handLand/newLand.vue
  43. 2
      src/views/land/noneHandLand/newLand.vue
  44. 14
      src/views/log/login/index.vue
  45. 14
      src/views/log/opration/index.vue
  46. 14
      src/views/set/userCenter/index.vue
  47. 14
      src/views/set/userSet/index.vue
  48. 4
      vue.config.js

230
src/router/views/index.js

@ -1,123 +1,111 @@
import Layout from '@/page/index/'
export default [{
path: '/info',
component: Layout,
redirect: '/info/index',
children: [{
path: 'index',
name: '个人信息',
component: () =>
import( /* webpackChunkName: "page" */ '@/views/admin/user/info')
}]
},
{
path: '/activiti',
component: Layout,
redirect: '/activiti',
children: [{
path: 'detail/:id',
name: '流程图',
meta: {
keepAlive: true
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/activiti/detail')
}]
},
{
path: '/houseList',
component: Layout,
redirect: '/houseList',
children: [{
path: 'page/FormatInfo',
name: '业态信息',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/houseList/page/FormatInfo')
}, {
path: 'page/houseInfo',
name: '楼栋信息',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/houseList/page/houseInfo')
}, {
path: 'page/detail',
name: '房屋信息',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/houseList/page/detail')
}, ]
},
{
path: '/company',
component: Layout,
redirect: '/company',
children: [{
path: 'auction/insert',
name: '新增参拍记录',
meta: {
keepAlive: true
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/company/auction/insert')
}, ]
},
{
path: '/land',
component: Layout,
redirect: '/land',
children: [{
path: 'handLand/newLand',
name: '编辑土地',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '../../views/land/handLand/newLand')
},
{
path: 'noneHandLand/newLand',
name: '编辑土地拟',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '../../views/land/noneHandLand/newLand')
},]
},
{
path: '/bigdata',
component: Layout,
redirect: '/bigdata',
children: [{
path: 'city/newCity',
name: '新增城市',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/bigdata/city/newCity')
}, ]
},
{
path: '/message',
component: Layout,
redirect: '/message',
children: [{
path: 'editMessage',
name: '编辑消息',
meta: {
keepAlive: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/message/editMessage')
}, ]
},
]
export default []
//
// export default [{
// path: '/info',
// component: Layout,
// redirect: '/info/index',
// children: [{
// path: 'index',
// name: '个人信息',
// component: () =>
// import( /* webpackChunkName: "page" */ '@/views/admin/user/info')
// }]
// },
// {
// path: '/houseList',
// component: Layout,
// redirect: '/houseList',
// children: [{
// path: 'page/FormatInfo',
// name: '业态信息',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/houseList/page/FormatInfo')
// }, {
// path: 'page/houseInfo',
// name: '楼栋信息',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/houseList/page/houseInfo')
// }, {
// path: 'page/detail',
// name: '房屋信息',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/houseList/page/detail')
// }, ]
// },
// {
// path: '/company',
// component: Layout,
// redirect: '/company',
// children: [{
// path: 'auction/insert',
// name: '新增参拍记录',
// meta: {
// keepAlive: true
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/company/auction/insert')
// }, ]
// },
// {
// path: '/land',
// component: Layout,
// redirect: '/land',
// children: [{
// path: 'handLand/newLand',
// name: '编辑土地',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '../../views/land/handLand/newLand')
// },
// {
// path: 'noneHandLand/newLand',
// name: '编辑土地拟',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '../../views/land/noneHandLand/newLand')
// },]
// },
// {
// path: '/bigdata',
// component: Layout,
// redirect: '/bigdata',
// children: [{
// path: 'city/newCity',
// name: '新增城市',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/bigdata/city/newCity')
// }, ]
// },
// {
// path: '/message',
// component: Layout,
// redirect: '/message',
// children: [{
// path: 'editMessage',
// name: '编辑消息',
// meta: {
// keepAlive: false
// },
// component: () =>
// import( /* webpackChunkName: "views" */ '@/views/message/editMessage')
// }, ]
// },
// ]

86
src/views/activiti/api/activiti.js

@ -1,86 +0,0 @@
import request from '@/router/axios'
export function fetchList (query) {
return request({
url: '/act/model',
method: 'get',
params: query
})
}
export function delObj (id) {
return request({
url: '/act/model/' + id,
method: 'delete'
})
}
export function deploy (id) {
return request({
url: '/act/model/deploy/' + id,
method: 'post'
})
}
export function addObj (obj) {
return request({
url: '/act/model/insert',
method: 'post',
data: obj
})
}
export function getObj (id) {
return request({
url: '/admin/log/' + id,
method: 'get'
})
}
export function putObj (obj) {
return request({
url: '/admin/log/',
method: 'put',
data: obj
})
}
export function getEditorXml(modelId) {
return request({
url: '/act/service/model/' + modelId + '/xml',
method: 'get'
})
}
export function getEditorXmls(...modelIds) {
return request({
url: '/act/service/models/xml',
method: 'get',
data: modelIds
})
}
export function getDefaultEditorXml() {
return request({
url: '/act/service/model/editor-default/xml',
method: 'get'
})
}
export function saveModel(obj) {
return request({
url: '/act/service/model/' + obj.modelId + '/save',
method: 'put',
data: obj
})
}
export function saveModels(...obj) {
let data = {'models': obj[0]};
console.log(data);
return request({
url: '/act/service/models/save',
method: 'put',
data: data
})
}

23
src/views/activiti/api/historic-task.js

@ -1,23 +0,0 @@
import request from '@/router/axios'
export function fetchList (query) {
return request({
url: '/act/task/historic/tasks',
method: 'get',
params: query
})
}
export function fetchDetail (id) {
return request({
url: '/act/task/' + id,
method: 'get'
})
}
export function fetchComment (id) {
return request({
url: '/act/task/comment/' + id,
method: 'get'
})
}

52
src/views/activiti/api/process.js

@ -1,52 +0,0 @@
import request from '@/router/axios'
export function fetchList (query) {
return request({
url: '/act/process',
method: 'get',
params: query
})
}
export function addObj (obj) {
return request({
url: '/act/process',
method: 'post',
data: obj
})
}
export function delObj (id) {
return request({
url: '/act/process/' + id,
method: 'delete'
})
}
export function status (id, type) {
return request({
url: '/act/process/status/' + id + '/' + type,
method: 'put'
})
}
export function getBpmnXml (taskId) {
return request({
url: `/act/task/view/` + taskId,
method: 'get'
})
}
export function getBpmnXmlByProcessInstanceId (processInstanceId) {
return request({
url: `/act/process/xml/` + processInstanceId,
method: 'get'
})
}
export function getBpmnXmlByDeployId (deployId) {
return request({
url: `/act/model/deploy/xml/` + deployId,
method: 'get'
})
}

38
src/views/activiti/api/task.js

@ -1,38 +0,0 @@
import request from '@/router/axios'
export function fetchList (query) {
return request({
url: '/act/task/todo',
method: 'get',
params: query
})
}
export function fetchDetail (id) {
return request({
url: '/act/task/' + id,
method: 'get'
})
}
export function fetchComment (id) {
return request({
url: '/act/task/comment/' + id,
method: 'get'
})
}
export function doTask (obj) {
let param = {};
Object.assign(param, obj);
if (obj.variables != null && obj.variables.trim().length !== 0) {
param.variables = JSON.parse(obj.variables.trim());
} else {
param.variables = {};
}
return request({
url: '/act/task',
method: 'post',
data: param
})
}

281
src/views/activiti/bpmn-editor.vue

@ -1,281 +0,0 @@
<template>
<div class="execution">
<div class="main content with-diagram" ref="jsDropZone">
<div class="canvas" ref="jsCanvas"></div>
<div
class="properties-panel-parent"
ref="jsPropertiesPanel"
id="js-properties-panel"
></div>
</div>
</div>
</template>
<script>
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
import BpmnModeler from 'bpmn-js/lib/Modeler'
import customTranslate from './util/custom-translate'
import propertiesPanelModule from 'bpmn-js-properties-panel'
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda'
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
import { getEditorXml, getDefaultEditorXml, saveModel } from './api/activiti'
import eventInterceptor from './util/event-interceptor'
import PaletteProviderRemove from './util/palette-provider-remove'
import ContextPadProviderRemove from './util/context-pad-provider-remove'
export default {
componentName: 'BpmnEditor',
props: {
/**
* 模型id指定时自动加载对应xml
*/
id: {
type: String,
default: ''
},
/**
* 模型名称
*/
name: {
type: String,
default: ''
},
/**
* 是否根据id自动加载
*/
autoLoad: {
type: Boolean,
default: true
},
/**
* 调试模式
*/
debugMode: {
type: Boolean,
default: true
},
/**
* 移除的按钮类型
*/
removeKeyType: {
type: String,
default: 'simple'
},
/**
* 是否显示右侧属性面板
*/
showPropertiesPanel: {
type: Boolean,
default: false
}
},
data() {
return {}
},
created() {
},
mounted() {
if (this.autoLoad) {
if (this.id.length > 0) {
this.loadEditorXml()
} else {
this.loadDefaultEditorXml()
}
}
let canvas = this.$refs.jsCanvas;
let customTranslateModule = {
translate: ['value', customTranslate]
};
let additionalModules = [
propertiesProviderModule,
customTranslateModule,
eventInterceptor,
PaletteProviderRemove,
ContextPadProviderRemove
];
if (this.showPropertiesPanel) {
additionalModules.push(propertiesPanelModule);
}
this.bpmnModeler = new BpmnModeler({
container: canvas,
propertiesPanel: {
parent: '#js-properties-panel'
},
additionalModules: additionalModules,
moddleExtensions: {
camunda: camundaModdleDescriptor
}
});
let eventBus = this.bpmnModeler.get('eventBus');
//
eventBus.on('commandStack.shape.create.postExecute', _ => {
this.saveEditorXml();
});
//
this.bpmnModeler.get('palette').removeKeyType = this.removeKeyType;
this.bpmnModeler.get('contextPad').removeKeyType = this.removeKeyType;
},
computed: {},
methods: {
//xml,
loadDefaultEditorXml() {
getDefaultEditorXml().then(response => {
this.openDiagram(response.data.data)
})
},
//xml
loadEditorXml() {
this.$emit('xmlLoading');
getEditorXml(this.id).then(response => {
this.formData = response.data.data;
this.openDiagram(response.data.data.bpmnXml);
if (this.debugMode) {
console.log(response.data.data.bpmnXml);
}
this.$emit('xmlLoaded');
})
},
//xml
getEditorXml(callback) {
let options = {
format: true,
preamble: true
};
this.bpmnModeler.saveXML(options, (err, xml) => {
callback(err, xml)
})
},
//
saveEditorXml(success = ()=>{}, failure = ()=>{}) {
let options = {
format: true,
preamble: true
};
this.bpmnModeler.saveXML(options, (err, xml) => {
this.formData.bpmnXml = xml
this.bpmnModeler.saveSVG((err, svg) => {
this.formData.svgXml = svg
saveModel(this.formData)
.then(response => success(response))
.catch(err => failure(err))
})
})
},
//id,使
setProcessId(processId, success, failure) {
let elementRegistry = this.bpmnModeler.get('elementRegistry');
let processElement = elementRegistry.getAll()[0];
let cmd = 'element.updateProperties';
//properties:
let context = {element: processElement, properties: {id: processId}};
this.bpmnModeler.get('commandStack').execute(cmd, context);
this.saveEditorXml(success, failure);
},
_handleError: function(err) {
console.error('failed to show diagram', err)
},
openDiagram(xml) {
this.bpmnModeler.importXML(xml, function(err) {
this.bpmnModeler.get('canvas').zoom('fit-viewport');
})
}
}
}
</script>
<style lang="scss" scoped>
.execution {
height: 99%;
.header {
position: relative;
display: flex;
align-items: center;
&__title {
font-size: 22px;
}
&__btn {
position: absolute;
right: 10px;
}
&__btn1 {
position: absolute;
right: 160px;
}
}
.main {
margin: 0 auto;
width: 99%;
height: 99%;
background-color: #fff;
padding: 20px;
border-radius: 3px;
box-sizing: border-box;
position: relative;
}
.canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&.with-diagram {
.canvas,
.properties-panel-parent {
display: block;
}
}
.properties-panel-parent {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 400px;
z-index: 10;
border-left: 1px solid #ccc;
overflow: auto;
&:empty {
display: none;
}
> .djs-properties-panel {
padding-bottom: 70px;
min-height: 100%;
}
.bpp-properties-panel {
height: 100%;
}
}
}
</style>
<style>
.bjs-powered-by {
display: none;
}
.djs-container {
background: #f6f6f6;
}
</style>

316
src/views/activiti/bpmn-module-editor.vue

@ -1,316 +0,0 @@
<template>
<div class="execution">
<div class="main content with-diagram" ref="jsDropZone">
<div class="canvas" ref="jsCanvas"></div>
<div
class="properties-panel-parent"
ref="jsPropertiesPanel"
id="js-properties-panel"
></div>
</div>
</div>
</template>
<script>
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
import BpmnModeler from 'bpmn-js/lib/Modeler'
import customTranslate from './util/custom-translate'
import propertiesPanelModule from 'bpmn-js-properties-panel'
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda'
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
import { getEditorXmls, getDefaultEditorXml, saveModels } from './api/activiti'
import eventInterceptor from './util/event-interceptor'
import PaletteProviderRemove from './util/palette-provider-remove'
import ContextPadProviderRemove from './util/context-pad-provider-remove'
import {combineMutiPartProcessDefinition, extractXml} from './util/xml-parser'
export default {
componentName: 'BpmnModuleEditor',
props: {
/**
* 主模型id,必传,新增元素根据id分类
*/
id: {
type: String,
required: true
},
/**
* 模型名称
*/
name: {
type: String,
default: ''
},
/**
* 调试模式
*/
debugMode: {
type: Boolean,
default: true
},
/**
* 移除的按钮类型
*/
removeKeyType: {
type: String,
default: 'simple'
},
/**
* 是否显示右侧属性面板
*/
showPropertiesPanel: {
type: Boolean,
default: false
}
},
data() {
return {
modelIds: [],
models: {}
}
},
created() {
},
mounted() {
let canvas = this.$refs.jsCanvas;
let customTranslateModule = {
translate: ['value', customTranslate]
};
let additionalModules = [
propertiesProviderModule,
customTranslateModule,
eventInterceptor,
PaletteProviderRemove,
ContextPadProviderRemove
];
if (this.showPropertiesPanel) {
additionalModules.push(propertiesPanelModule);
}
this.bpmnModeler = new BpmnModeler({
container: canvas,
propertiesPanel: {
parent: '#js-properties-panel'
},
additionalModules: additionalModules,
moddleExtensions: {
camunda: camundaModdleDescriptor
}
});
//
let eventBus = this.bpmnModeler.get('eventBus');
eventBus.on('commandStack.shape.create.postExecute', param => {
// let newElement = e.newSelection[0];
console.log('commandStack.shape.create.postExecute', param);
let cmd = 'element.updateProperties';
let element = this.bpmnModeler.get('elementRegistry').get(param.context.shape.id);
console.log(element)
//properties:
let context = {element: element, properties: {class: this.id, di: {class: this.id}}};
this.bpmnModeler.get('commandStack').execute(cmd, context);
});
// 线
eventBus.on('commandStack.connection.create.postExecuted', param => {
// let newElement = e.newSelection[0];
console.log('commandStack.shape.create.postExecute', param);
let cmd = 'element.updateProperties';
let element = this.bpmnModeler.get('elementRegistry').get(param.context.connection.id);
let source = param.context.source;
console.log(element)
//properties:
let context = {element: element, properties: {class: source.businessObject.class, di: {class: source.businessObject.class}}};
this.bpmnModeler.get('commandStack').execute(cmd, context);
});
//
eventBus.on('commandStack.shape.create.postExecute', _ => {
this.saveEditorXml();
});
//
this.bpmnModeler.get('palette').removeKeyType = this.removeKeyType;
this.bpmnModeler.get('contextPad').removeKeyType = this.removeKeyType;
},
computed: {},
methods: {
//ids
setModelIds(...modelIds) {
this.models = modelIds || [];
},
//xml,
loadDefaultEditorXml() {
getDefaultEditorXml().then(response => {
this.openDiagram(response.data.data)
})
},
//xml
loadEditorXml(...modelIds) {
this.modelIds = modelIds || [];
this.$emit('xmlLoading');
getEditorXmls(modelIds).then(response => {
this.models = response.data.data || {};
let xmls = [];
Object.keys(this.models).forEach(k => {
xmls.push(this.models[k].bpmnXml);
});
let bpmnXml = combineMutiPartProcessDefinition(...xmls);
this.openDiagram(bpmnXml);
if (this.debugMode) {
console.log(response.data.data.bpmnXml);
}
})
},
//xml
getEditorXml(callback) {
let options = {
format: true,
preamble: true
};
this.bpmnModeler.saveXML(options, (err, xml) => {
callback(err, xml)
})
},
//,
saveEditorXml(success = ()=>{}, failure = ()=>{}) {
let options = {
format: true,
preamble: true
};
this.bpmnModeler.saveXML(options, (err, xml) => {
Object.keys(this.models).forEach(k => {
this.models[k].bpmnXml = extractXml(xml, k);
});
let xmls = [];
Object.keys(this.models).forEach(e => xmls.push(this.models[e]));
saveModels(xmls)
.then(response => success(response))
.catch(err => failure(err))
})
},
_handleError: function(err) {
console.error('failed to show diagram', err)
},
openDiagram(xml) {
this.bpmnModeler.importXML(xml, function(err) {
this.bpmnModeler.get('canvas').zoom('fit-viewport');
this.$emit('xmlLoaded', err);
if (err) {
this.container.removeClass('with-diagram').addClass('with-error')
this.container.find('.error pre').text(err.message)
console.error(err)
} else {
this.container.removeClass('with-error').addClass('with-diagram')
this.bpmnModeler.get('minimap').open()
if (this.debugMode) {
console.log('Awesome! Ready to navigate!')
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.execution {
height: 99%;
.header {
position: relative;
display: flex;
align-items: center;
&__title {
font-size: 22px;
}
&__btn {
position: absolute;
right: 10px;
}
&__btn1 {
position: absolute;
right: 160px;
}
}
.main {
margin: 0 auto;
width: 99%;
height: 99%;
background-color: #fff;
padding: 20px;
border-radius: 3px;
box-sizing: border-box;
position: relative;
}
.canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&.with-diagram {
.canvas,
.properties-panel-parent {
display: block;
}
}
.properties-panel-parent {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 400px;
z-index: 10;
border-left: 1px solid #ccc;
overflow: auto;
&:empty {
display: none;
}
> .djs-properties-panel {
padding-bottom: 70px;
min-height: 100%;
}
.bpp-properties-panel {
height: 100%;
}
}
}
</style>
<style>
.bjs-powered-by {
display: none;
}
.djs-container {
background: #f6f6f6;
}
</style>

65
src/views/activiti/bpmn-viewer.vue

@ -1,65 +0,0 @@
<template>
<el-scrollbar class="main content with-diagram" ref="jsDropZone">
<div class="canvas" ref="jsCanvas"></div>
</el-scrollbar>
</template>
<script>
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import Modeling from 'bpmn-js/lib/features/modeling'
import BpmnJS from 'bpmn-js'
export default {
componentName: 'BpmnViewer',
mounted() {
BpmnJS.$inject = ['modeling']
this.viewer = new BpmnJS({
container: this.$refs.jsCanvas,
additionalModules: [
Modeling
]
});
},
methods: {
showDiagram(diagramXML, executedIds, currentActivitiIds) {
const viewer = this.viewer;
console.log(diagramXML);
viewer.importXML(diagramXML, function () {
viewer.get('canvas').zoom('fit-viewport');
let elementRegistry = viewer.get('elementRegistry'),
modeling = viewer.get('modeling');
//
let history = [];
executedIds.forEach(item => history.push(elementRegistry.get(item)));
modeling.setColor(history, {
stroke: 'green',
fill: 'rgba(0, 80, 0, 0.4)'
});
//
let current = [];
currentActivitiIds.forEach(item => current.push(elementRegistry.get(item)));
modeling.setColor(current, {
stroke: 'yellow',
fill: 'rgba(0, 80, 0, 0.4)'
});
});
}
}
}
</script>
<style scoped>
.canvas {
width: 100%;
height: 500px;
}
</style>
<style>
.bjs-powered-by {
display: none;
}
</style>

64
src/views/activiti/crud/activiti.js

@ -1,64 +0,0 @@
export const tableOption = {
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
menuWidth: 150,
menuBtn: true,
align: 'center',
editBtn: false,
delBtn: false,
menuType: 'menu',
searchShow: false,
labelWidth: 120,
column: [{
fixed: true,
label: '模型ID',
prop: 'id',
editDisabled: true,
addDisplay: false
}, {
fixed: true,
label: '模型标识',
prop: 'key',
editDisabled: true
}, {
label: '流程分类',
prop: 'category',
search: true
}, {
label: '模型名称',
prop: 'name'
},
{
label: '描述',
prop: 'desc',
hide: true,
editDisabled: false,
addDisplay: true
}, {
label: '版本号',
prop: 'version',
editDisabled: true,
addDisplay: false
}, {
width: 150,
label: '创建时间',
prop: 'createTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'timestamp',
editDisabled: true,
addDisplay: false
}, {
width: 150,
label: '最后更新时间',
prop: 'lastUpdateTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'timestamp',
editDisabled: true,
addDisplay: false
}]
}

45
src/views/activiti/crud/process.js

@ -1,45 +0,0 @@
export const tableOption = {
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
menuWidth: 150,
menuBtn: true,
align: 'center',
addBtn: false,
editBtn: false,
delBtn: false,
menuType: 'menu',
searchShow: false,
column: [{
fixed: true,
label: '流程ID',
prop: 'processonDefinitionId'
}, {
fixed: true,
label: '模型标识',
prop: 'key',
editDisabled: true
}, {
label: '流程分类',
prop: 'category',
search: true
}, {
label: '模型名称',
prop: 'name'
}, {
label: '版本号',
prop: 'revision',
editDisabled: true,
addDisplay: false
}, {
label: '部署时间',
prop: 'deploymentTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'timestamp',
editDisabled: true,
addDisplay: false
}]
}

95
src/views/activiti/crud/task.js

@ -1,95 +0,0 @@
export const tableOption = {
border: true,
index: true,
stripe: true,
menuAlign: 'center',
align: 'center',
menuBtn: true,
editBtn: false,
delBtn: false,
addBtn: false,
menuType: 'menu',
column: [
{
label: 'ID',
prop: 'taskId',
editDisabled: true,
addDisplay: false
},
{
label: '任务名称',
prop: 'taskName',
editDisabled: true,
addDisplay: false
},
{
label: '提交时间',
prop: 'time',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm'
}
]
}
export const formOption = {
submitBtn: false,
emptytBtn: false,
row: true,
span: 12,
column: [
{
label: '批注',
prop: 'comment',
type: 'textarea',
minRows: 2,
row: true,
span: 24,
rules: [{
required: false,
message: '请输入备注',
trigger: 'blur'
}]
},
{
label: '参数(variables)',
prop: 'variables',
type: 'textarea',
minRows: 2,
row: true,
span: 24,
rules: [{
required: false,
message: '请输入变量',
trigger: 'blur'
}]
}
]
}
export const taskOption = {
menu: false,
page: false,
addBtn: false,
align: 'center',
menuAlign: 'center',
column: [
{
label: 'id',
prop: 'id',
hide: true
},
{
label: '用户',
prop: 'userId'
},
{
label: '批注',
prop: 'fullMessage'
}, {
label: '操作时间',
prop: 'time',
type: 'datetime',
format: 'yyyy-MM-dd hh:mm:ss',
valueFormat: 'yyyy-MM-dd hh:mm:ss'
}
]
}

305
src/views/activiti/detail.vue

@ -1,305 +0,0 @@
<template>
<div class="execution">
<basic-container>
<div class="header">
<p class="header__title">{{name}}</p>
<el-button class="header__btn1"
type="primary"
@click="done">保存
</el-button>
<el-button class="header__btn"
type="primary"
@click="breaks">关闭返回列表
</el-button>
</div>
</basic-container>
<el-scrollbar class="main content with-diagram" ref="jsDropZone">
<div class="canvas" ref="jsCanvas"></div>
<div class="properties-panel-parent" ref="jsPropertiesPanel" id="js-properties-panel"></div>
</el-scrollbar>
<dialog-demo :obj="element" ref="dialog"></dialog-demo>
</div>
</template>
<script>
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
import BpmnModeler from 'bpmn-js/lib/Modeler'
import customTranslate from './util/custom-translate'
import propertiesPanelModule from 'bpmn-js-properties-panel'
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda'
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
import {getEditorXml, saveModel} from './api/activiti'
import eventInterceptor from './util/event-interceptor'
import DialogDemo from "./dialog-demo"
import BpmnInteraction from './util/event-interceptor/bpmn-interaction'
import PaletteProviderRemove from './util/palette-provider-remove'
import ContextPadProviderRemove from './util/context-pad-provider-remove'
// import bpmnXml from './xxx.xml'
// import {test, extractXml} from '../util/xml-parser'
export default {
components: {DialogDemo},
data() {
return {
id: '',
name: '',
dialogFormVisible: false,
element: ''
}
},
created() {
this.id = this.$route.params.id;
this.name = this.$route.query.name;
BpmnInteraction.element.dblclick = this.bpmnElementDblclick;
},
mounted() {
this.getEditorXml();
var container = this.$refs.jsDropZone;
var canvas = this.$refs.jsCanvas;
var customTranslateModule = {
translate: ['value', customTranslate]
};
this.bpmnModeler = new BpmnModeler({
container: canvas,
propertiesPanel: {
parent: '#js-properties-panel'
},
additionalModules: [
propertiesPanelModule,
propertiesProviderModule,
eventInterceptor,
customTranslateModule,
PaletteProviderRemove,
ContextPadProviderRemove
],
moddleExtensions: {
camunda: camundaModdleDescriptor
}
});
//
this.bpmnModeler.get('palette').removeKeyType = 'simple';
this.bpmnModeler.get('contextPad').removeKeyType = 'simple';
console.log(this.bpmnModeler, this.$destroy);
//线
console.log('eventBus: ', this.bpmnModeler.get('eventBus'));
console.log('commandStack: ', this.bpmnModeler.get('commandStack'));
console.log('modeling: ', this.bpmnModeler.get('modeling'));
let eventBus = this.bpmnModeler.get('eventBus');
eventBus.on('commandStack.elements.delete.preExecute', function(e) {
// let newElement = e.newSelection[0];
console.log('commandStack.elements.delete.preExecute', arguments);
//
// throw new Error('cant delete')
});
//
eventBus.on('commandStack.shape.create.postExecute', param => {
// let newElement = e.newSelection[0];
console.log('commandStack.shape.create.postExecute', param);
let cmd = 'element.updateProperties';
let element = this.bpmnModeler.get('elementRegistry').get(param.context.shape.id);
console.log(element)
//properties:
// let context = {element: element, properties: {class: 'xbxbxbxb', name: 'zeb', di: {class: 'xbxbxbxb'}}};
// this.bpmnModeler.get('commandStack').execute(cmd, context);
});
// 线
eventBus.on('commandStack.connection.create.postExecuted', param => {
// let newElement = e.newSelection[0];
console.log('commandStack.shape.create.postExecute', param);
let cmd = 'element.updateProperties';
let element = this.bpmnModeler.get('elementRegistry').get(param.context.connection.id);
let source = param.context.source;
console.log(element)
//properties:
let context = {element: element, properties: {class: source.businessObject.class, di: {class: source.businessObject.class}}};
this.bpmnModeler.get('commandStack').execute(cmd, context);
});
eventBus.on('saveXML.start', definitions => {
console.log('saveXML.start, get definitions: ', definitions)
// definitions.definitions.rootElements[0].flowElements.forEach(item => item.name1 = 'zeb')
// console.log('saveXML modified, get definitions: ', definitions)
// return definitions
})
// this.openDiagram(test());
},
computed: {
src() {
return `${this.actUrl}${this.id}`;
}
},
methods: {
breaks() {
this.$router.$avueRouter.closeTag();
// this.$router.go(-1)
this.$destroy()
},
bpmnElementDblclick(e, commandStack) {
// console.log(e, commandStack);
this.$refs.dialog.setDialogFormVisible(true);
this.element = JSON.stringify(e.element.businessObject, null, 2);
console.log(this.element);
let cmd = 'element.updateProperties';
//properties:
console.log(e.element.businessObject.name)
if (e.element.businessObject.name === undefined) {
// let context = {element: e.element, properties: {name: '😻'/*, name1: 'zeb'*/}};
// commandStack.execute(cmd, context || { element : e.element });
}
},
getEditorXml() {
getEditorXml(this.id).then(response => {
this.formData = response.data.data;
this.openDiagram(response.data.data.bpmnXml);
console.log(response.data.data.bpmnXml);
})
},
done() {
let options = {
format: true,
preamble: true
};
// this.setProcessId("process_zeb");
this.bpmnModeler.saveXML(options, (err, xml) => {
console.log('saveXML: ', err, xml);
// let newxml = extractXml(xml, 'xbxbxbxb');
// this.openDiagram(newxml);
// return;
if(err) {
return;
}
this.formData.bpmnXml = xml;
this.bpmnModeler.saveSVG((err, svg) => {
this.formData.svgXml = svg;
saveModel(this.formData).then(_ => {
this.$message({
showClose: true,
message: '保存成功',
type: 'success'
})
});
});
});
},
setProcessId(processId) {
let elementRegistry = this.bpmnModeler.get('elementRegistry');
let processElement = elementRegistry.getAll()[0];
let cmd = 'element.updateProperties';
//properties:
let context = {element: processElement, properties: {id: processId}};
this.bpmnModeler.get('commandStack').execute(cmd, context);
},
handleError: function (err) {
console.error('failed to show diagram', err);
},
openDiagram(xml) {
this.bpmnModeler.importXML(xml, (err) => {
if (err) {
console.log('Awesome! Ready to navigate!');
}
});
}
}
}
</script>
<style lang="scss" scoped>
.execution {
height: 99%;
.header {
position: relative;
display: flex;
align-items: center;
&__title {
font-size: 22px;
}
&__btn {
position: absolute;
right: 10px;
}
&__btn1 {
position: absolute;
right: 160px;
}
}
.main {
margin: 0 auto;
width: 99%;
height: calc(100% - 100px);
background-color: #fff;
padding: 20px;
border-radius: 3px;
box-sizing: border-box;
}
.canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&.with-diagram {
.canvas,
.properties-panel-parent {
display: block;
}
}
.properties-panel-parent {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 460px;
z-index: 10;
border-left: 1px solid #ccc;
overflow: auto;
&:empty {
display: none;
}
> .djs-properties-panel {
padding-bottom: 70px;
min-height: 100%;
}
.bpp-properties-panel {
height: 100%;
}
}
}
</style>
<style>
.bjs-powered-by {
display: none;
}
</style>

33
src/views/activiti/dialog-demo.vue

@ -1,33 +0,0 @@
<template>
<div>
<!-- Form -->
<el-dialog title="弹窗" :visible.sync="dialogFormVisible">
<p>节点参数</p>
<pre style="margin-left: 10px;padding: 10px; color: #2d8cf0; background: #e4fdc5;" v-text="obj"></pre>
</el-dialog>
</div>
</template>
<script>
export default {
componentName: 'DialogDemo',
props: {
obj: {}
},
data() {
return {
dialogFormVisible: false
};
},
methods: {
setDialogFormVisible(val) {
this.dialogFormVisible = val
}
}
};
</script>

158
src/views/activiti/historic-task.vue

@ -1,158 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<span class="pageTitle">历史任务</span>
<avue-crud
ref="crud"
:page="page"
:data="tableData"
@on-load="getList"
:table-loading="tableLoading"
:option="tableOption"
@refresh-change="refreshChange"
>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="taskInfo(scope.row,scope.index)"
>任务信息</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="comment(scope.row,scope.index)"
>批注</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="viewPic(scope.row,scope.index)"
>流程图</el-dropdown-item>
</template>
</avue-crud>
</basic-container>
<el-dialog title="任务信息" :visible.sync="showTaskInfo">
任务信息:
<pre v-text="JSON.stringify(obj.taskInfo, null, 2)"></pre>流程实例信息:
<pre v-text="JSON.stringify(obj.processInstanceInfo, null, 2)"></pre>
</el-dialog>
<el-dialog title="批注列表" :visible.sync="showComment">
<avue-crud :data="taskTableData" :option="taskOption"></avue-crud>
</el-dialog>
<el-dialog title="流程图" :visible.sync="showPicDialog">
<bpmn-viewer ref="bpmnViewer" />
</el-dialog>
</div>
</template>
<script>
import {
doTask,
fetchComment,
fetchDetail,
fetchList,
} from "./api/historic-task";
import { formOption, tableOption, taskOption } from "./crud/task";
import { getBpmnXml } from "./api/process";
import BpmnViewer from "./bpmn-viewer";
export default {
name: "historic-task",
components: { BpmnViewer },
component: {
BpmnViewer,
},
data() {
return {
obj: {},
actPicUrl: "",
showTaskInfo: false,
showComment: false,
showPicDialog: false,
tableData: [],
taskTableData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 20, //
},
tableLoading: false,
tableOption: tableOption,
taskOption: taskOption,
permissions: {
act_task_manage: true,
},
};
},
created() {},
mounted: function () {},
computed: {},
methods: {
getList(page, params) {
this.tableLoading = true;
fetchList(
Object.assign(
{
current: page.currentPage,
size: page.pageSize,
user: "assignee",
},
params
)
).then((response) => {
this.tableData = response.data.data.records;
this.page.total = response.data.data.total;
this.tableLoading = false;
});
},
taskInfo: function (row, index) {
fetchDetail(row.taskId).then((response) => {
this.obj.taskInfo = response.data.data.taskInfo;
this.obj.processInstanceInfo = response.data.data.processInstanceInfo;
// 线
this.flagList = this.obj.flagList;
this.showTaskInfo = true;
});
this.obj = row;
},
comment: function (row) {
fetchComment(row.taskId).then((response) => {
this.taskTableData = response.data.data;
});
this.showComment = true;
},
viewPic: function (row) {
this.showPicDialog = true;
getBpmnXml(row.taskId).then((response) => {
this.$refs.bpmnViewer.showDiagram(
response.data.data.bpmnXml,
response.data.data.executedIds,
response.data.data.currentActivitiIds
);
});
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page);
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
/deep/ .avue-crud__menu {
display: none;
}
/deep/ .avue-crud {
margin-top: 20px;
}
</style>

193
src/views/activiti/index.vue

@ -1,193 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<span class="pageTitle">模型管理</span>
<avue-crud
ref="crud"
:page="page"
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@search-change="searchChange"
@refresh-change="refreshChange"
@row-save="handleSave"
@row-del="rowDel"
>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item
divided
v-if="permissions.act_model_manage"
@click.native="handleView(scope.row, scope.index)"
>模型图</el-dropdown-item
>
<el-dropdown-item
divided
v-if="permissions.act_model_manage"
@click.native="handleDeploy(scope.row, scope.index)"
>部署</el-dropdown-item
>
<el-dropdown-item
divided
v-if="permissions.act_model_manage"
@click.native="handleDel(scope.row, scope.index)"
>删除</el-dropdown-item
>
</template>
</avue-crud>
</basic-container>
</div>
</template>
<script>
import { addObj, delObj, deploy, fetchList } from "./api/activiti";
import { tableOption } from "./crud/activiti";
// import {mapGetters} from 'vuex'
export default {
name: "activiti",
data() {
return {
permissions: {
act_model_manage: true,
},
tableData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 20, //
},
tableLoading: false,
tableOption: tableOption,
};
},
created() {},
mounted: function () {},
computed: {
// ...mapGetters(['permissions'])
},
methods: {
getList(page, params) {
this.tableLoading = true;
fetchList(
Object.assign(
{
descs: "create_time",
current: page.currentPage,
size: page.pageSize,
},
params
)
).then((response) => {
this.tableData = response.data.data.records;
this.page.total = response.data.data.total;
this.tableLoading = false;
console.log(response);
});
},
handleView(row, index) {
const name = `${row.name}`,
src = `/activiti/detail/${row.id}`;
this.$router.push({
path: src,
query: {
name: name,
},
});
},
handleDel(row, index) {
this.$refs.crud.rowDel(row, index);
},
handleDeploy: function (row, index) {
var _this = this;
this.$confirm('是否确认部署ID为"' + row.id + '"的模型?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return deploy(row.id);
})
.then((data) => {
this.getList(this.page);
_this.$message({
showClose: true,
message: "部署成功",
type: "success",
});
})
.catch(function (err) {});
},
rowDel: function (row, index) {
var _this = this;
this.$confirm('是否确认删除ID为"' + row.id + '"的模型?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delObj(row.id);
})
.then((data) => {
this.getList(this.page);
_this.$message({
showClose: true,
message: "删除成功",
type: "success",
});
})
.catch(function (err) {});
},
/**
* @title 数据添加
* @param row 为当前的数据
* @param done 为表单关闭函数
*
**/
handleSave: function (row, done) {
addObj(row).then((data) => {
this.tableData.push(Object.assign({}, row));
this.$message({
showClose: true,
message: "添加成功",
type: "success",
});
done();
this.getList(this.page);
});
},
/**
* 搜索回调
*/
searchChange(form) {
this.getList(this.page, form);
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page);
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
/deep/ .avue-crud__menu {
margin-bottom: 20px !important;
margin-top: 0 !important;
.avue-crud__left {
.el-button {
margin-top: 22px;
float: right !important;
}
}
}
/deep/ .el-col {
padding-left: 0 !important;
}
</style>

210
src/views/activiti/process.vue

@ -1,210 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<span class="pageTitle">流程管理</span>
<avue-crud
ref="crud"
:page="page"
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@search-change="searchChange"
@refresh-change="refreshChange"
@row-del="rowDel"
>
<template slot="menuLeft">
<!-- <el-button class="header__btn"-->
<!-- type="primary"-->
<!-- size="small"-->
<!-- @click="handleAddObj()">开启流程-->
<!-- </el-button>-->
</template>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item
divided
v-if="permissions.act_process_manage"
@click.native="handlePic(scope.row,scope.index)"
>流程图</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_process_manage && scope.row.suspend"
@click.native="handleStatus(scope.row,'active')"
>激活</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_process_manage && !scope.row.suspend"
@click.native="handleStatus(scope.row,'suspend')"
>失效</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_process_manage"
@click.native="handleDel(scope.row,'suspend')"
>删除</el-dropdown-item>
</template>
</avue-crud>
</basic-container>
<el-dialog title="流程图" width="85%" :visible.sync="showPicDialog">
<bpmn-viewer ref="bpmnViewer" />
</el-dialog>
</div>
</template>
<script>
import { addObj, delObj, fetchList, status } from "./api/process";
import { tableOption } from "./crud/process";
import { getBpmnXmlByDeployId } from "./api/process";
import BpmnViewer from "./bpmn-viewer";
import { mapGetters } from "vuex";
export default {
name: "process",
data() {
return {
showPicDialog: false,
actPicUrl: "",
tableData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 20, //
},
tableLoading: false,
tableOption: tableOption,
};
},
created() {},
components: {
BpmnViewer,
},
mounted: function () {},
computed: {
...mapGetters(["permissions"]),
},
methods: {
handleAddObj() {
let param = {
processDefinitionKey: "process_listener",
businessKey: "1",
variables: {
assignee: "admin",
},
};
addObj(param).then((response) => {
console.log(response);
this.$message({
showClose: true,
message: "成功开启流程",
type: "success",
});
});
},
getList(page, params) {
this.tableLoading = true;
fetchList(
Object.assign(
{
descs: "create_time",
current: page.currentPage,
size: page.pageSize,
},
params
)
).then((response) => {
this.tableData = response.data.data.records;
this.page.total = response.data.data.total;
this.tableLoading = false;
});
},
handlePic(row, index) {
this.showPicDialog = true;
getBpmnXmlByDeployId(row.deploymentId).then((response) => {
this.$refs.bpmnViewer.showDiagram(
response.data.data.bpmnXml,
response.data.data.executedIds,
response.data.data.currentActivitiIds
);
});
},
handleStatus(row, type) {
var _this = this;
this.$confirm(
'是否确认操作ID为"' + row.processonDefinitionId + '"的流程?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return status(row.processonDefinitionId, type);
})
.then((data) => {
this.getList(this.page);
_this.$message({
showClose: true,
message: "操作成功",
type: "success",
});
this.getList(this.page);
});
},
handleDel(row, index) {
this.$refs.crud.rowDel(row, index);
},
rowDel: function (row, index) {
var _this = this;
this.$confirm(
'是否确认删除ID为"' + row.deploymentId + '"的模型?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delObj(row.deploymentId);
})
.then((data) => {
this.getList(this.page);
_this.$message({
showClose: true,
message: "删除成功",
type: "success",
});
this.getList(this.page);
})
.catch(function (err) {});
},
/**
* 搜索回调
*/
searchChange(form) {
this.getList(this.page, form);
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page);
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
/deep/ .avue-crud__menu {
display: none;
}
/deep/ .avue-crud {
margin-top: 20px;
}
</style>

206
src/views/activiti/task.vue

@ -1,206 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<span class="pageTitle">待办任务</span>
<avue-crud
ref="crud"
:page="page"
:data="tableData"
@on-load="getList"
:table-loading="tableLoading"
:option="tableOption"
@refresh-change="refreshChange"
>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="taskInfo(scope.row,scope.index)"
>任务信息</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="showAudit(scope.row,scope.index)"
>流程审批</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="comment(scope.row,scope.index)"
>查看批注</el-dropdown-item>
<el-dropdown-item
divided
v-if="permissions.act_task_manage"
@click.native="viewPic(scope.row,scope.index)"
>流程图</el-dropdown-item>
</template>
</avue-crud>
</basic-container>
<el-dialog title="任务办理" :visible.sync="showHandleTask">
<avue-form ref="form" v-model="obj" :option="formOption">
<template slot="menuForm">
<el-button @click="submitTask">提交</el-button>
</template>
</avue-form>
</el-dialog>
<el-dialog title="任务信息" :visible.sync="showTaskInfo">
任务信息:
<pre v-text="JSON.stringify(obj.taskInfo, null, 2)"></pre>流程实例信息:
<pre v-text="JSON.stringify(obj.processInstanceInfo, null, 2)"></pre>
</el-dialog>
<el-dialog title="批注列表" :visible.sync="showComment">
<avue-crud :data="taskTableData" :option="taskOption"></avue-crud>
</el-dialog>
<el-dialog title="流程图" width="85%" :visible.sync="showPicDialog">
<bpmn-viewer ref="bpmnViewer" />
</el-dialog>
</div>
</template>
<script>
import { doTask, fetchComment, fetchDetail, fetchList } from "./api/task";
import { formOption, tableOption, taskOption } from "./crud/task";
import { getBpmnXml } from "./api/process";
import BpmnViewer from "./bpmn-viewer";
// import {mapGetters} from 'vuex'
export default {
name: "task",
components: { BpmnViewer },
data() {
return {
actPicUrl: "",
obj: {},
flagList: {},
showHandleTask: false,
showTaskInfo: false,
showComment: false,
showPicDialog: false,
tableData: [],
taskTableData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 20, //
},
tableLoading: false,
tableOption: tableOption,
formOption: formOption,
taskOption: taskOption,
permissions: {
act_task_manage: true,
},
};
},
created() {},
mounted: function () {},
computed: {
// ...mapGetters(['permissions'])
},
methods: {
getList(page, params) {
this.tableLoading = true;
fetchList(
Object.assign(
{
current: page.currentPage,
size: page.pageSize,
},
params
)
).then((response) => {
this.tableData = response.data.data.records;
this.page.total = response.data.data.total;
this.tableLoading = false;
});
},
taskInfo: function (row, index) {
fetchDetail(row.taskId).then((response) => {
this.obj.taskInfo = response.data.data.taskInfo;
this.obj.processInstanceInfo = response.data.data.processInstanceInfo;
// 线
this.flagList = this.obj.flagList;
this.showTaskInfo = true;
});
this.obj = row;
},
showAudit(row) {
this.showHandleTask = true;
this.obj.taskId = row.taskId;
},
submitTask: function () {
console.log(this.obj);
this.handleSubmit();
},
comment: function (row) {
fetchComment(row.taskId).then((response) => {
this.taskTableData = response.data.data;
});
this.showComment = true;
},
handleSubmit: function () {
var _this = this;
this.$confirm("是否确认提交ID为" + _this.obj.taskId + "的任务", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return _this.handleTask();
})
.then(() => {
_this.$message({
showClose: true,
message: "提交成功",
type: "success",
});
})
.catch(function () {});
},
handleTask: function () {
doTask(this.obj).then(() => {
this.showHandleTask = false;
this.$message({
showClose: true,
message: "提交成功",
type: "success",
});
this.showHandleTask = false;
this.getList(this.page);
});
},
viewPic: function (row) {
this.showPicDialog = true;
getBpmnXml(row.taskId).then((response) => {
this.$refs.bpmnViewer.showDiagram(
response.data.data.bpmnXml,
response.data.data.executedIds,
response.data.data.currentActivitiIds
);
});
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page);
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
/deep/ .avue-crud__menu {
display: none;
}
/deep/ .avue-crud {
margin-top: 20px;
}
</style>

35
src/views/activiti/util/context-pad-provider-remove/context-pad-provider-remove.js

@ -1,35 +0,0 @@
import {
forEach
} from 'min-dash';
import ContextPad from 'diagram-js/lib/features/context-pad/ContextPad'
import removeKeyGroup from '../remove-key-group'
export default function ContextPadProviderRemove(contextPad) {
ContextPad.prototype.getEntries = function(element) {
let entries = {};
// loop through all providers and their entries.
// group entries by id so that overriding an entry is possible
forEach(this._providers, function(provider) {
let e = provider.getContextPadEntries(element);
forEach(e, function(entry, id) {
entries[id] = entry;
});
});
if (contextPad.removeKeyType !== undefined && removeKeyGroup[contextPad.removeKeyType] !== undefined) {
let removeKey = removeKeyGroup[contextPad.removeKeyType];
forEach(Object.keys(entries), key => {
if (removeKey.indexOf(key) !== -1) {
delete entries[key]
}
});
}
return entries;
};
}
ContextPadProviderRemove.$inject = [ 'contextPad' ];

6
src/views/activiti/util/context-pad-provider-remove/index.js

@ -1,6 +0,0 @@
import ContextPadProviderRemove from './context-pad-provider-remove';
export default {
__init__: [ 'contextPadProviderRemove' ],
contextPadProviderRemove: [ 'type', ContextPadProviderRemove ]
};

14
src/views/activiti/util/custom-translate.js

@ -1,14 +0,0 @@
import translations from './translations';
export default function customTranslate(template, replacements) {
replacements = replacements || {};
// console.log(template, replacements)
// Translate
template = translations[template] || template;
// console.log(template)
// Replace
return template.replace(/{([^}]+)}/g, function(_, key) {
// return replacements[key] || '{' + key + '}';
return translations[replacements[key]] || '{' + key + '}';
});
}

226
src/views/activiti/util/event-interceptor/bpmn-events.txt

@ -1,226 +0,0 @@
EventBus
{
_listeners:
Object
{
diagram.destroy:[..., ..., ..., ..., ..., ..., ...],
render.shape: [..., ..., ..., ...],
render.connection: [..., ..., ..., ...],
render.getShapePath: [..., ..., ..., ...],
render.getConnectionPath: [..., ..., ..., ...], diagram.init: [..., ..., ..., ...],
shape.added: [..., ..., ...],
connection.added: [..., ..., ...],
shape.removed: [...],
connection.removed: [...],
elements.changed: [..., ...],
diagram.clear: [..., ..., ..., ...],
canvas.destroy: [..., ...],
canvas.init: [..., ..., ..., ...],
shape.changed: [..., ..., ..., ..., ...],
connection.changed: [..., ..., ..., ...],
shape.remove: [..., ...],
connection.remove: [..., ..., ...],
element.hover: [..., ..., ...],
element.out: [..., ...],
selection.changed: [..., ..., ..., ...],
create.end: [..., ..., ..., ..., ..., ..., ..., ..., ...],
connect.end: [..., ..., ...],
shape.move.end: [..., ..., ..., ..., ...],
element.click: [...],
canvas.viewbox.changing: [..., ..., ...],
canvas.viewbox.changed: [..., ...],
element.changed: [..., ..., ...],
element.marker.update: [..., ...],
element.mousedown: [..., ..., ..., ..., ..., ...],
commandStack.connection.create.canExecute: [...],
commandStack.connection.reconnectStart.canExecute: [...],
commandStack.connection.reconnectEnd.canExecute: [...],
commandStack.connection.updateWaypoints.canExecute: [...],
commandStack.shape.resize.canExecute: [..., ...],
commandStack.elements.move.canExecute: [...],
commandStack.shape.create.canExecute: [...],
commandStack.shape.attach.canExecute: [...],
commandStack.element.copy.canExecute: [...],
commandStack.element.paste.canExecute: [...],
commandStack.elements.paste.canExecute: [...],
shape.move.start: [..., ..., ..., ..., ..., ..., ..., ..., ...],
shape.move.move: [..., ..., ..., ..., ..., ...],
elements.delete: [...],
tool-manager.update: [...],
i18n.changed: [...],
drag.move: [..., ...],
contextPad.create: [...],
palette.create: [...],
drag.start: [...],
drag.cleanup: [...],
bendpoint.move.start: [...],
bendpoint.move.hover: [...],
bendpoint.move.out: [...],
bendpoint.move.cleanup: [...],
bendpoint.move.move: [..., ...],
bendpoint.move.end: [..., ...],
bendpoint.move.cancel: [..., ...],
connectionSegment.move.start: [...],
connectionSegment.move.move: [..., ...],
connectionSegment.move.hover: [...],
connectionSegment.move.out: [...],
connectionSegment.move.cleanup: [..., ...],
connectionSegment.move.cancel: [...],
connectionSegment.move.end: [..., ...],
element.mousemove: [...],
element.updateId: [...],
shape.move.out: [...],
shape.move.cleanup: [..., ..., ...],
resize.start: [..., ..., ...],
resize.move: [..., ...],
resize.end: [..., ...],
resize.cleanup: [...],
commandStack.shape.create.postExecuted: [..., ..., ...],
commandStack.elements.move.postExecuted: [..., ..., ..., ..., ..., ..., ...],
commandStack.element.autoResize.canExecute: [...],
autoPlace.end: [..., ...],
spaceTool.selection.init: [...],
spaceTool.selection.ended: [...],
spaceTool.selection.canceled: [...],
spaceTool.ended: [...],
spaceTool.canceled: [...],
spaceTool.selection.end: [...],
spaceTool.move: [..., ..., ...],
spaceTool.end: [...],
lasso.selection.init: [...],
lasso.selection.ended: [...],
lasso.selection.canceled: [...],
lasso.ended: [...],
lasso.canceled: [...],
lasso.selection.end: [...],
lasso.end: [...],
lasso.start: [...],
lasso.move: [...],
lasso.cleanup: [...], hand.init: [...],
hand.ended: [...],
hand.canceled: [...],
hand.move.ended: [...],
hand.move.canceled: [...],
hand.end: [...],
hand.move.move: [...],
hand.move.end: [...],
connect.move: [..., ...],
connect.hover: [..., ...],
connect.out: [...],
connect.cleanup: [..., ...],
connect.start: [...],
global-connect.init: [...],
global-connect.ended: [..., ...],
global-connect.canceled: [...],
global-connect.drag.ended: [...],
global-connect.drag.canceled: [...],
global-connect.hover: [...],
global-connect.out: [...],
global-connect.cleanup: [...],
spaceTool.selection.start: [...],
spaceTool.selection.move: [...],
spaceTool.selection.cleanup: [...],
spaceTool.cleanup: [...],
element.paste: [...],
create.move: [..., ..., ..., ..., ..., ...],
create.out: [...],
create.cleanup: [..., ..., ...],
attach: [...],
detach: [...],
element.dblclick: [...],
drag.init: [...],
autoPlace: [...],
popupMenu.open: [...],
commandStack.changed: [...],
directEditing.activate: [..., ...],
directEditing.resize: [...],
directEditing.complete: [...],
directEditing.cancel: [...],
commandStack.connection.create.postExecuted: [...],
commandStack.connection.layout.postExecuted: [...],
commandStack.connection.reconnectEnd.postExecuted: [..., ...],
commandStack.connection.reconnectStart.postExecuted: [..., ...],
commandStack.connection.updateWaypoints.postExecuted: [...],
commandStack.label.create.postExecuted: [...],
commandStack.shape.append.preExecute: [...],
commandStack.elements.paste.preExecute: [...],
commandStack.elements.paste.postExecute: [...],
commandStack.shape.create.preExecute: [..., ..., ..., ..., ..., ..., ..., ...],
commandStack.connection.layout.executed: [..., ...],
commandStack.connection.create.executed: [..., ..., ..., ...],
commandStack.connection.reconnectEnd.executed: [..., ..., ..., ..., ...],
commandStack.connection.reconnectStart.executed: [..., ..., ..., ...],
commandStack.connection.layout.reverted: [..., ...],
commandStack.shape.move.executed: [..., ...],
commandStack.shape.create.executed: [..., ...],
commandStack.shape.delete.executed: [...],
commandStack.connection.move.executed: [..., ..., ..., ...],
commandStack.connection.delete.executed: [..., ..., ...],
commandStack.shape.move.reverted: [..., ...],
commandStack.shape.create.reverted: [..., ...],
commandStack.shape.delete.reverted: [...],
commandStack.connection.create.reverted: [..., ..., ...],
commandStack.connection.move.reverted: [..., ..., ..., ...],
commandStack.connection.delete.reverted: [..., ..., ...],
commandStack.canvas.updateRoot.executed: [...],
commandStack.canvas.updateRoot.reverted: [...],
commandStack.shape.resize.executed: [...],
commandStack.shape.resize.reverted: [...],
commandStack.connection.reconnectEnd.reverted: [..., ..., ..., ...],
commandStack.connection.reconnectStart.reverted: [..., ..., ...],
commandStack.connection.updateWaypoints.executed: [...],
commandStack.connection.updateWaypoints.reverted: [...],
commandStack.element.updateAttachment.executed: [...],
commandStack.element.updateAttachment.reverted: [...],
commandStack.elements.move.preExecute: [..., ..., ...],
commandStack.shape.create.postExecute: [..., ..., ..., ...],
commandStack.shape.move.postExecute: [...],
commandStack.shape.delete.postExecute: [..., ..., ...],
commandStack.canvas.updateRoot.postExecute: [...],
commandStack.shape.create.execute: [...],
commandStack.shape.create.revert: [...],
commandStack.shape.delete.postExecuted: [..., ...],
bpmnElement.added: [...],
commandStack.element.updateProperties.postExecute: [...],
commandStack.connection.create.postExecute: [...],
commandStack.label.create.postExecute: [...],
commandStack.connection.layout.postExecute: [...],
commandStack.connection.reconnectEnd.postExecute: [...],
commandStack.connection.reconnectStart.postExecute: [...],
commandStack.connection.updateWaypoints.postExecute: [...],
commandStack.shape.replace.postExecute: [..., ..., ...],
shape.move.rejected: [...],
create.rejected: [...],
elements.paste.rejected: [...],
commandStack.shape.delete.preExecute: [..., ..., ..., ..., ..., ...],
commandStack.element.updateProperties.postExecuted: [...],
commandStack.shape.replace.postExecuted: [...],
commandStack.shape.toggleCollapse.executed: [...],
commandStack.shape.toggleCollapse.reverted: [...],
commandStack.shape.toggleCollapse.postExecuted: [...],
commandStack.elements.delete.preExecute: [..., ...],
commandStack.connection.delete.preExecute: [..., ...],
commandStack.spaceTool.preExecute: [...],
commandStack.lane.add.preExecute: [...],
commandStack.lane.resize.preExecute: [...],
commandStack.lane.split.preExecute: [...],
commandStack.shape.move.preExecute: [..., ..., ...],
commandStack.shape.resize.preExecute: [..., ...],
commandStack.spaceTool.postExecuted: [...],
commandStack.lane.add.postExecuted: [...],
commandStack.lane.resize.postExecuted: [...],
commandStack.lane.split.postExecuted: [...],
commandStack.elements.delete.postExecuted: [...],
commandStack.shape.move.postExecuted: [...],
commandStack.shape.resize.postExecuted: [...],
commandStack.connection.create.preExecute: [...],
commandStack.connection.move.preExecute: [...],
commandStack.elements.move.preExecuted: [..., ...],
commandStack.shape.delete.execute: [...],
commandStack.shape.delete.revert: [...],
commandStack.shape.resize.postExecute: [...],
create.start: [..., ...],
shape.move.hover: [...],
create.hover: [...]
}
}

5
src/views/activiti/util/event-interceptor/bpmn-interaction.js

@ -1,5 +0,0 @@
export default {
element: {
dblclick: (e, commandStack) => {}
}
}

119
src/views/activiti/util/event-interceptor/event-interceptor.js

@ -1,119 +0,0 @@
import inherits from 'inherits';
import TouchInteractionEvents from 'diagram-js/lib/features/touch/TouchInteractionEvents';
import BpmnInteraction from './bpmn-interaction'
import EventBus from 'diagram-js/lib/core/EventBus'
import {assign} from "min-dash";
export default function EventInterceptor(eventBus, commandStack) {
console.log(eventBus);
//双击
eventBus.on('element.dblclick', 1500, (e) => {
BpmnInteraction.element.dblclick(e, commandStack);
// e.element.businessObject.name = 'xxxx';
// let values = {name: 'xxxx'};
// let cmd = 'element.updateProperties';
// let context = {element: e.element, properties: values};
// // this._commandStack.execute(commandToExecute.cmd, commandToExecute.context || { element : element });
// commandStack.execute(cmd, context || { element : e.element });
return false;
});
//单击选中
eventBus.on('selection.changed', function(e) {
let newElement = e.oldSelection[0];
console.log(newElement);
});
// eventBus.on('commandStack.elements.delete.preExecute', function(e) {
// // let newElement = e.newSelection[0];
// console.log('commandStack.elements.delete.preExecute', arguments);
// //抛出异常可阻止后续执行
// // throw new Error('cant delete')
// });
}
inherits(EventInterceptor, TouchInteractionEvents);
EventBus.prototype.fire = function(type, data) {
if(type.indexOf('error') !== -1) {
console.log('触发事件: ' + type, '参数: ', data);
}
var event,
firstListener,
returnValue,
args;
var slice = Array.prototype.slice;
args = slice.call(arguments);
if (typeof type === 'object') {
event = type;
type = event.type;
}
if (!type) {
throw new Error('no event type specified');
}
firstListener = this._listeners[type];
if (!firstListener) {
return;
}
// we make sure we fire instances of our home made
// events here. We wrap them only once, though
if (data instanceof InternalEvent) {
// we are fine, we alread have an event
event = data;
} else {
event = this.createEvent(data);
}
// ensure we pass the event as the first parameter
args[0] = event;
// original event type (in case we delegate)
var originalType = event.type;
// update event type before delegation
if (type !== originalType) {
event.type = type;
}
try {
returnValue = this._invokeListeners(event, args, firstListener);
} finally {
// reset event type after delegation
if (type !== originalType) {
event.type = originalType;
}
}
// set the return value to false if the event default
// got prevented and no other return value exists
if (returnValue === undefined && event.defaultPrevented) {
returnValue = false;
}
return returnValue;
};
function InternalEvent() { }
InternalEvent.prototype.stopPropagation = function() {
this.cancelBubble = true;
};
InternalEvent.prototype.preventDefault = function() {
this.defaultPrevented = true;
};
InternalEvent.prototype.init = function(data) {
assign(this, data || {});
};
EventInterceptor.$inject = [ 'eventBus', 'commandStack' ];

6
src/views/activiti/util/event-interceptor/index.js

@ -1,6 +0,0 @@
import EventInterceptor from './event-interceptor';
export default {
__init__: [ 'eventInterceptor' ],
eventInterceptor: [ 'type', EventInterceptor ]
};

6
src/views/activiti/util/palette-provider-remove/index.js

@ -1,6 +0,0 @@
import PaletteProviderRemove from './palette-provider-remove';
export default {
__init__: [ 'paletteProviderRemove' ],
paletteProviderRemove: [ 'type', PaletteProviderRemove ]
};

41
src/views/activiti/util/palette-provider-remove/palette-provider-remove.js

@ -1,41 +0,0 @@
import {
forEach
} from 'min-dash';
import Palette from 'diagram-js/lib/features/palette/Palette'
import removeKeyGroup from '../remove-key-group'
export default function PaletteProviderRemove(palette) {
Palette.prototype.getEntries = function() {
let entries = {};
// loop through all providers and their entries.
// group entries by id so that overriding an entry is possible
forEach(palette._providers, function(provider) {
let e = provider.getPaletteEntries();
forEach(e, function(entry, id) {
entries[id] = entry;
});
});
if (palette.removeKeyType !== undefined && removeKeyGroup[palette.removeKeyType] !== undefined) {
let removeKey = removeKeyGroup[palette.removeKeyType];
forEach(Object.keys(entries), key => {
if (removeKey.indexOf(key) !== -1) {
delete entries[key]
}
});
}
return entries;
};
setTimeout(() => {
palette._update();
}, 0.1);
}
PaletteProviderRemove.$inject = [ 'palette' ];

10
src/views/activiti/util/remove-key-group.js

@ -1,10 +0,0 @@
//定义需要移除的操作按钮,分组
export default {
simple: [
'create.data-object',
'create.data-store',
'append.text-annotation',
'create.participant-expanded',
'create.intermediate-event'
],
}

213
src/views/activiti/util/translations.js

@ -1,213 +0,0 @@
/**
* This is a sample file that should be replaced with the actual translation.
*
* Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available
* translations and labels to translate.
*/
export default {
// Labels
'Activate the global connect tool' : '激活全局连接工具',
'Append {type}': '添加 {type}',
'Add Lane above': '在上面添加道',
'Divide into two Lanes': '分割成两个道',
'Divide into three Lanes': '分割成三个道',
'Add Lane below': '在下面添加道',
'Append compensation activity': '追加补偿活动',
'Change type': '修改类型',
'Connect using Association': '使用关联连接',
'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接',
'Connect using DataInputAssociation': '使用数据输入关联连接',
'Remove': '移除',
'Activate the hand tool': '激活抓手工具',
'Activate the lasso tool': '激活套索工具',
'Activate the create/remove space tool': '激活创建/删除空间工具',
'Create expanded SubProcess': '创建扩展子过程',
'Create IntermediateThrowEvent/BoundaryEvent' : '创建中间抛出事件/边界事件',
'Create Pool/Participant': '创建池/参与者',
'Parallel Multi Instance': '并行多重事件',
'Sequential Multi Instance': '时序多重事件',
'DataObjectReference':'数据对象参考',
'DataStoreReference':'数据存储参考',
'Loop': '循环',
'Ad-hoc': '即席',
'Create {type}': '创建 {type}',
'Task': '任务',
'Send Task': '发送任务',
'Receive Task': '接收任务',
'User Task': '用户任务',
'Manual Task': '手工任务',
'Business Rule Task': '业务规则任务',
'Service Task': '服务任务',
'Script Task': '脚本任务',
'Call Activity': '调用活动',
'Sub Process (collapsed)': '子流程(折叠的)',
'Sub Process (expanded)': '子流程(展开的)',
'Start Event': '开始事件',
'StartEvent': '开始事件',
'Intermediate Throw Event': '中间事件',
'End Event': '结束事件',
'EndEvent': '结束事件',
'Create Gateway': '创建网关',
'Create Intermediate/Boundary Event': '创建中间/边界事件',
'Message Start Event': '消息开始事件',
'Timer Start Event': '定时开始事件',
'Conditional Start Event': '条件开始事件',
'Signal Start Event': '信号开始事件',
'Error Start Event': '错误开始事件',
'Escalation Start Event': '升级开始事件',
'Compensation Start Event': '补偿开始事件',
'Message Start Event (non-interrupting)': '消息开始事件(非中断)',
'Timer Start Event (non-interrupting)': '定时开始事件(非中断)',
'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)',
'Signal Start Event (non-interrupting)': '信号开始事件(非中断)',
'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)',
'Message Intermediate Catch Event': '消息中间捕获事件',
'Message Intermediate Throw Event': '消息中间抛出事件',
'Timer Intermediate Catch Event': '定时中间捕获事件',
'Escalation Intermediate Throw Event': '升级中间抛出事件',
'Conditional Intermediate Catch Event': '条件中间捕获事件',
'Link Intermediate Catch Event': '链接中间捕获事件',
'Link Intermediate Throw Event': '链接中间抛出事件',
'Compensation Intermediate Throw Event': '补偿中间抛出事件',
'Signal Intermediate Catch Event': '信号中间捕获事件',
'Signal Intermediate Throw Event': '信号中间抛出事件',
'Message End Event': '消息结束事件',
'Escalation End Event': '定时结束事件',
'Error End Event': '错误结束事件',
'Cancel End Event': '取消结束事件',
'Compensation End Event': '补偿结束事件',
'Signal End Event': '信号结束事件',
'Terminate End Event': '终止结束事件',
'Message Boundary Event': '消息边界事件',
'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)',
'Timer Boundary Event': '定时边界事件',
'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)',
'Escalation Boundary Event': '升级边界事件',
'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)',
'Conditional Boundary Event': '条件边界事件',
'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)',
'Error Boundary Event': '错误边界事件',
'Cancel Boundary Event': '取消边界事件',
'Signal Boundary Event': '信号边界事件',
'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)',
'Compensation Boundary Event': '补偿边界事件',
'Exclusive Gateway': '互斥网关',
'Parallel Gateway': '并行网关',
'Inclusive Gateway': '相容网关',
'Complex Gateway': '复杂网关',
'Event based Gateway': '事件网关',
'Transaction': '转运',
'Sub Process': '子流程',
'Event Sub Process': '事件子流程',
'Collapsed Pool': '折叠池',
'Expanded Pool': '展开池',
// Errors
'no parent for {element} in {parent}': '在{parent}里,{element}没有父类',
'no shape type specified': '没有指定的形状类型',
'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类',
'out of bounds release': 'out of bounds release',
'more than {count} child lanes': '子道大于{count} ',
'element required': '元素不能为空',
'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范',
'no diagram to display': '没有可展示的流程图',
'no process or collaboration to display': '没有可展示的流程/协作',
'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制',
'already rendered {element}': '{element} 已被渲染',
'failed to import {element}': '导入{element}失败',
//属性面板的参数
'Id':'编号',
'Name':'名称',
'General':'常规',
'Details':'详情',
'Message Name':'消息名称',
'Message':'消息',
'Initiator':'创建者',
'Asynchronous Continuations':'持续异步',
'Asynchronous Before':'异步前',
'Asynchronous After':'异步后',
'Job Configuration':'工作配置',
'Exclusive':'排除',
'Job Priority':'工作优先级',
'Retry Time Cycle':'重试时间周期',
'Documentation':'文档',
'Element Documentation':'元素文档',
'History Configuration':'历史配置',
'History Time To Live':'历史的生存时间',
'Forms':'表单',
'Form Key':'表单key',
'Form Fields':'表单字段',
'Business Key':'业务key',
'Form Field':'表单字段',
'ID':'编号',
'Type':'类型',
'Label':'名称',
'Default Value':'默认值',
'Validation':'校验',
'Add Constraint':'添加约束',
'Config':'配置',
'Properties':'属性',
'Add Property':'添加属性',
'Value':'值',
'Listeners':'监听器',
'Execution Listener':'执行监听',
'Event Type':'事件类型',
'Listener Type':'监听器类型',
'Java Class':'Java类',
'Expression':'表达式',
'Must provide a value':'必须提供一个值',
'Delegate Expression':'代理表达式',
'Script':'脚本',
'Script Format':'脚本格式',
'Script Type':'脚本类型',
'Inline Script':'内联脚本',
'External Script':'外部脚本',
'Resource':'资源',
'Field Injection':'字段注入',
'Extensions':'扩展',
'Input/Output':'输入/输出',
'Input Parameters':'输入参数',
'Output Parameters':'输出参数',
'Parameters':'参数',
'Output Parameter':'输出参数',
'Timer Definition Type':'定时器定义类型',
'Timer Definition':'定时器定义',
'Date':'日期',
'Duration':'持续',
'Cycle':'循环',
'Signal':'信号',
'Signal Name':'信号名称',
'Escalation':'升级',
'Error':'错误',
'Link Name':'链接名称',
'Condition':'条件名称',
'Variable Name':'变量名称',
'Variable Event':'变量事件',
'Specify more than one variable change event as a comma separated list.':'多个变量事件以逗号隔开',
'Wait for Completion':'等待完成',
'Activity Ref':'活动参考',
'Version Tag':'版本标签',
'Executable':'可执行文件',
'External Task Configuration':'扩展任务配置',
'Task Priority':'任务优先级',
'External':'外部',
'Connector':'连接器',
'Must configure Connector':'必须配置连接器',
'Connector Id':'连接器编号',
'Implementation':'实现方式',
'Field Injections':'字段注入',
'Fields':'字段',
'Result Variable':'结果变量',
'Topic':'主题',
'Configure Connector':'配置连接器',
'Input Parameter':'输入参数',
'Assignee':'代理人',
'Candidate Users':'候选用户',
'Candidate Groups':'候选组',
'Due Date':'到期时间',
'Follow Up Date':'跟踪日期',
'Priority':'优先级',
'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)':'跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)':'跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
'Variables':'变量',
};

183
src/views/activiti/util/xml-parser.js

@ -1,183 +0,0 @@
import $ from 'jquery'
/**
* 组合多个流程定义文件
*/
export function combineMutiPartProcessDefinition(xml1, ...others) {
if (others.length === 0) {
return xml1;
}
let xmlDoc1 = $.parseXml(xml1);
let processNode1 = getChildNodes(xmlDoc1.childNodes[0], 'bpmn2:process')[0];
let BPMNDiagramNode1 = getChildNodes(xmlDoc1.childNodes[0], 'bpmndi:BPMNDiagram')[0];
let BPMNPlane1 = getChildNodes(BPMNDiagramNode1, 'bpmndi:BPMNPlane')[0];
let otherChildNodes = getProcessAndPlaneChildNodes(...others);
//otherChildNodes.processNodes.forEach(node => processNode1.appendChild(node));
[].forEach.call(otherChildNodes.processNodes,node => processNode1.appendChild(node));
//otherChildNodes.BPMNDiagramNodes.forEach(node => BPMNPlane1.appendChild(node));
[].forEach.call(otherChildNodes.BPMNDiagramNodes,node => BPMNPlane1.appendChild(node));
console.log('合并后: ', $(xmlDoc1).xml());
return $(xmlDoc1).xml();
}
export function extractXml(xml, cls) {
let xmlDoc = $.parseXml(xml);
let processNode = getChildNodes(xmlDoc.childNodes[0], 'bpmn2:process')[0];
let BPMNDiagramNode = getChildNodes(xmlDoc.childNodes[0], 'bpmndi:BPMNDiagram')[0];
let BPMNPlane = getChildNodes(BPMNDiagramNode, 'bpmndi:BPMNPlane')[0];
let needRemoveProcessChild = [],
needRemoveBPMNPlaneChild = [];
if(processNode) {
[].forEach.call(processNode.childNodes,node => {
if (node.className !== cls) {
needRemoveProcessChild.push(node);
}
});
}
if(BPMNPlane) {
[].forEach.call(BPMNPlane.childNodes,node => {
if (node.className !== cls) {
needRemoveBPMNPlaneChild.push(node);
}
});
}
// needRemoveProcessChild.forEach(node => processNode.removeChild(node));
// needRemoveBPMNPlaneChild.forEach(node => BPMNPlane.removeChild(node));
[].forEach.call(needRemoveProcessChild,node => processNode.removeChild(node));
[].forEach.call(needRemoveBPMNPlaneChild,node => BPMNPlane.removeChild(node));
console.log('拆分后: ', $(xmlDoc).xml());
return $(xmlDoc).xml();
}
function getProcessAndPlaneChildNodes(...xmls) {
let ret = {
processNodes: [],
BPMNDiagramNodes: []
};
xmls.forEach(xml => {
let xmlDoc = $.parseXml(xml);
let processNode = getChildNodes(xmlDoc.childNodes[0], 'bpmn2:process')[0];
ret.processNodes.push(...getChildNodes(processNode));
let BPMNDiagramNode = getChildNodes(xmlDoc.childNodes[0], 'bpmndi:BPMNDiagram')[0];
let BPMNPlane = getChildNodes(BPMNDiagramNode, 'bpmndi:BPMNPlane')[0];
ret.BPMNDiagramNodes.push(...getChildNodes(BPMNPlane));
});
return ret;
}
/**
* 获取子节点
* @param node 当前节点
* @param childNodeName 子节点名称
*/
function getChildNodes(node, childNodeName) {
console.log('getChildNodes');
console.log('node ', node);
console.log('childNodeName ', childNodeName);
if (node === undefined) {
return []
}
// let childNodes = new Array(...node.childNodes); 存在ie下兼容问题
let childNodes = [];
for (let i = 0; i < node.childNodes.length; i++) {
childNodes.push(node.childNodes[i]);
}
if (childNodeName) {
childNodes = childNodes.filter(n => n.nodeName === childNodeName);
}
return childNodes;
}
(function($) {
function mnpXml(opCode, xmlStr) {
return this.each(function() {
if (typeof xmlStr != "string") return;
if (!$.isXMLDoc(this)) return;
let node = $.parseXml(xmlStr).firstChild.cloneNode(true);
switch (opCode) {
case "append":
this.appendChild(node);
break;
case "prepend":
if (this.childNodes.length > 0)
this.insertBefore(node, this.firstChild);
else
this.appendChild(node);
break;
case "after":
if (this.nextSibling)
this.parentNode.insertBefore(node, this.nextSibling);
else
this.parentNode.appendChild(node);
break;
case "before":
this.parentNode.insertBefore(node, this);
break;
}
});
}
$.fn.extend({
appendXml: function(s) {
return mnpXml.call(this, "append", s);
},
prependXml: function(s) {
return mnpXml.call(this, "prepend", s);
},
afterXml: function(s) {
return mnpXml.call(this, "after", s);
},
beforeXml: function(s) {
return mnpXml.call(this, "before", s);
},
xml: function() {
let elem = this[0];
return elem.xml || (new XMLSerializer()).serializeToString(elem) ;
},
innerXml: function() {
let s = this.xml();
let i = s.indexOf(">"), j = s.lastIndexOf("<");
if (j > i)
return s.substring(i + 1, j);
else
return "";
}
});
$.extend($, {
parseXml: function(xmlStr) {
//ie
if (!!window.ActiveXObject || "ActiveXObject" in window) {
let xd = new ActiveXObject("Microsoft.XMLDOM");
xd.async = false;
xd.loadXML(xmlStr);
return xd;
}
else if (typeof DOMParser != "undefined") {
let xd = new DOMParser().parseFromString(xmlStr, "text/xml");
return xd;
}
else return null;
},
toXml: function(obj, nodeName, useAttr) {
let x = $($.parseXml("<" + nodeName + " />"));
let n = x.find(":first");
for (let p in obj) {
if (useAttr)
n.attr(p, obj[p]);
else
n.appendXml("<" + p + " />").find(p).text(obj[p]);
}
return x[0];
}
});
})($);

50
src/views/activiti/xxx.xml

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="Process_1" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_1xzrr1a</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1xzrr1a" sourceRef="StartEvent_1" targetRef="Task_1s76p0u" />
<bpmn2:userTask id="Task_1s76p0u" name="主管审批&#10;" camunda:assignee="assignee">
<bpmn2:incoming>SequenceFlow_1xzrr1a</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_00elv6d</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="SequenceFlow_00elv6d" sourceRef="Task_1s76p0u" targetRef="Task_1imdm0t" />
<bpmn2:userTask id="Task_1imdm0t" name="领导审批&#10;" camunda:assignee="leader">
<bpmn2:incoming>SequenceFlow_00elv6d</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0la4bah</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:endEvent id="EndEvent_1na3ymp">
<bpmn2:incoming>SequenceFlow_0la4bah</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_0la4bah" sourceRef="Task_1imdm0t" targetRef="EndEvent_1na3ymp" />
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="412" y="240" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1xzrr1a_di" bpmnElement="SequenceFlow_1xzrr1a">
<di:waypoint x="448" y="258" />
<di:waypoint x="498" y="258" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1ir9igv_di" bpmnElement="Task_1s76p0u">
<dc:Bounds x="498" y="218" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_00elv6d_di" bpmnElement="SequenceFlow_00elv6d">
<di:waypoint x="598" y="258" />
<di:waypoint x="654" y="258" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_0x3waz9_di" bpmnElement="Task_1imdm0t">
<dc:Bounds x="654" y="218" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1na3ymp_di" bpmnElement="EndEvent_1na3ymp">
<dc:Bounds x="810" y="240" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0la4bah_di" bpmnElement="SequenceFlow_0la4bah">
<di:waypoint x="754" y="258" />
<di:waypoint x="810" y="258" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

14
src/views/activiti/xxx1.xml

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="Process_1" isExecutable="true">
<bpmn2:userTask id="Task_1imdm0m" name="领导审批&#10;" camunda:assignee="leader">
</bpmn2:userTask>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="UserTask_0x3waz8_di" bpmnElement="Task_1imdm0m">
<dc:Bounds x="554" y="418" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

505
src/views/city/cityCoordinate/index.vue

@ -0,0 +1,505 @@
<template>
<div class="normal_page">
<div class="page_search">
<div>
<el-form :inline="true" :model="searchForm" class="searchForm">
<el-form-item label="区域类型:">
<el-select v-model="searchForm.type">
<el-option
v-for="item in areaType"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="城市:">
<el-select v-model="searchForm.city">
<el-option
v-for="item in cityList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="区域名称:">
<el-input width="100%" v-model="searchForm.name"> </el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
<el-form-item>
<el-button @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="page_content">
<div class="page_content_head">
<div style="display: flex; justify-content: space-between">
<div class="page_content_head_left">
<div>区域经纬度列表</div>
<div style="margin-left: 10px">
<img src="@public/img/land/u1343.png" />
</div>
<div style="margin-left: 10px">
<span>已选择{{ selectedData.length }}</span>
</div>
<div style="margin-left: 10px">
<el-button type="text" @click="clearSelection">清空</el-button>
</div>
</div>
<div class="page_content_head_right">
<div>
<el-button @click="multiDelete" v-show="hasSelectData"
><img
style="margin-right: 5px"
src="@public/img/land/u1340.png"
/>
</el-button>
</div>
<div>
<el-upload
class="upload-demo"
action=""
:before-upload="importData"
>
<el-button size="medium" type="primary">导入数据</el-button>
</el-upload>
</div>
<div style="margin-right: 30px">
<el-button @click="newItem" type="primary"
><i class="el-icon-plus"></i>新建
</el-button>
</div>
</div>
</div>
</div>
<div class="page_content_table">
<el-table
:data="tableData"
border
@selection-change="handleSelectionChange"
style="width: 100%"
ref="multipleTable"
v-loading="loading"
>
<el-table-column fixed type="selection" width="55"></el-table-column>
<el-table-column
v-for="(item, index) in cols"
:key="index"
:prop="item.prop"
:label="item.label"
:width="item.width"
show-overflow-tooltip
>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="viewItem(scope.row)"
>详情
</el-button>
<el-button type="text" size="small" @click="editItem(scope.row)"
>编辑
</el-button>
<el-button type="text" size="small" @click="delItem(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page_page">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" width="60%" :visible.sync="dialogVisible">
<el-form :model="editForm" :disabled="dialogReadOnly">
<el-row>
<el-col :span="8">
<el-form-item label="区域类型:">
<el-select v-model="editForm.type" :disabled="areaTypeReadOnly">
<el-option
v-for="item in areaType"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="城市:">
<el-select v-model="editForm.city">
<el-option
v-for="item in cityList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="区域:">
<el-input v-model="editForm.name"> </el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="经纬度:">
<el-input v-model="editForm.pos"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="线条宽度:">
<el-input-number
controls-position="right"
:min="0"
:max="255"
v-model="editForm.lineWidth"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="线条颜色:">
<el-select v-model="editForm.lineColor">
<el-option
v-for="item in colorList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="线条透明度:">
<el-input-number
controls-position="right"
:min="0"
:max="255"
v-model="editForm.lineOpaqueness"
></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填充颜色:">
<el-select v-model="editForm.fillColor">
<el-option
v-for="item in colorList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填充透明度:">
<el-input-number
controls-position="right"
:min="0"
:max="255"
v-model="editForm.fillOpaqueness"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
queryList,
delData,
addData,
updateData,
importFile,
getDict,
} from "@/views/city/cityCoordinate/api/cityCoordinate";
import { getCityList } from "@/views/land/api/api";
export default {
data() {
return {
searchForm: {
type: "area",
city: "重庆",
name: "",
},
tableData: [],
//
cols: [
{
label: "城市",
prop: "city",
},
{
label: "区域",
prop: "name",
},
{
label: "线条宽度",
prop: "lineWidth",
},
{
label: "线条颜色",
prop: "lineColor",
},
{
label: "线条不透明度",
prop: "lineOpaqueness",
},
{
label: "填充颜色",
prop: "fillColor",
},
{
label: "填充不透明",
prop: "fillOpaqueness",
},
],
//
loading: false,
//
selectedData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 10, //
},
//
hasSelectData: false,
title: "新增经纬度",
editForm: {},
dialogVisible: false,
dialogReadOnly: false,
areaTypeReadOnly: false,
areaType: [],
colorList: [],
cityList: [],
};
},
mounted() {
this.onSubmit();
getDict("color").then((res) => {
this.colorList = res.data.data;
});
getDict("city_area_type").then((res) => {
this.areaType = res.data.data;
});
getCityList().then((res) => {
this.cityList = res.data.data;
});
},
watch: {
selectedData: {
handler(newVal, oldVal) {
this.hasSelectData = newVal.length > 0 ? true : false;
},
},
},
methods: {
//
clearSelection() {
this.$refs.multipleTable.clearSelection();
},
//
onSubmit() {
this.loading = true;
let param = Object.assign(
{
current: this.page.currentPage,
size: this.page.pageSize,
},
this.searchForm
);
queryList(param).then((response) => {
let records = response.data.data.records.map((record) => {
record.lineColor = this.colorList.find((color) => {
return (color.value = record.lineColor);
}).label;
record.fillColor = this.colorList.find((color) => {
return (color.value = record.lineColor);
}).label;
return record;
});
this.tableData = records;
this.page.total = response.data.data.total;
this.loading = false;
});
},
//
onReset() {
this.searchForm = {
type: "area",
city: "重庆",
name: "",
};
},
handleSizeChange(val) {
this.page.pageSize = val;
this.onSubmit();
},
handleCurrentChange(val) {
this.page.currentPage = val;
this.onSubmit();
},
//
handleSelectionChange(val) {
this.selectedData = val;
},
//
newItem() {
this.title = "新增经纬度";
this.editForm = {};
this.areaTypeReadOnly = false;
this.dialogReadOnly = false;
this.dialogVisible = true;
},
//
editItem(row) {
this.title = "编辑经纬度";
this.editForm = row;
this.areaTypeReadOnly = true;
this.dialogReadOnly = false;
this.dialogVisible = true;
},
save() {
if (this.editForm.id) {
updateData(this.editForm).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
} else {
addData(this.editForm).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
}
},
//
viewItem(row) {
this.title = "查看经纬度";
this.editForm = row;
this.areaTypeReadOnly = true;
this.dialogReadOnly = true;
this.dialogVisible = true;
},
//
delItem(row) {
let _this = this;
let ids = [row.id];
this.$confirm("确认删除?", "系统提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
cancelButtonClass: "btn-custom-cancel",
type: "warning",
}).then(function () {
delData(ids, _this.searchForm.type).then((res) => {
if (res.data.success) {
_this.$message({
type: "success",
message: "删除成功",
});
_this.onSubmit();
} else {
_this.$message("删除失败");
}
});
});
},
//
multiDelete() {
let _this = this;
if (this.selectedData.length < 1) {
this.$message({
message: "未选中数据",
type: "warning",
});
return;
}
let ids = [];
for (let item of this.selectedData) {
ids.push(item["id"]);
}
delData(ids, _this.searchForm.type).then((res) => {
if (res.data.success) {
_this.$message({
type: "success",
message: "删除成功",
});
_this.onSubmit();
} else {
_this.$message("删除失败");
}
});
},
//
importData(e) {
const file = e;
let formData = new FormData();
formData.append("uploadFile", file);
importFile(formData).then((res) => {
if (res.data.success) {
this.$message({
type: "success",
message: "导入成功",
});
this.onSubmit();
return true;
} else {
this.$message("导入失败");
return false;
}
});
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
.el-select .el-input {
width: 100% !important;
}
.searchForm .el-form-item__content > .el-input {
width: 100% !important;
}
.el-form-item__content > .el-input {
width: 60%;
}
/deep/ .el-form-item__label {
width: 100px;
}
</style>

435
src/views/city/cityList/index.vue

@ -0,0 +1,435 @@
<template>
<div class="normal_page">
<div class="page_search">
<div>
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="城市:">
<el-select v-model="searchForm.city">
<el-option
v-for="item in cityList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="行政区:">
<el-select v-model="searchForm.area" :disabled="!searchForm.city">
<el-option
v-for="item in regionList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="大组团:">
<el-select
v-model="searchForm.bigGroup"
:disabled="!searchForm.area"
>
<el-option
v-for="item in bigGroupList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
<el-form-item>
<el-button @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="page_content">
<div class="page_content_head">
<div style="display: flex; justify-content: space-between">
<div class="page_content_head_left">
<div>城市区域列表</div>
<div style="margin-left: 10px">
<img src="@public/img/land/u1343.png" />
</div>
<div style="margin-left: 10px">
<span>已选择{{ selectedData.length }}</span>
</div>
<div style="margin-left: 10px">
<el-button type="text" @click="clearSelection">清空</el-button>
</div>
</div>
<div class="page_content_head_right">
<div>
<el-button @click="multiDelete" v-show="hasSelectData"
><img
style="margin-right: 5px"
src="@public/img/land/u1340.png"
/>
</el-button>
</div>
<div>
<el-upload
class="upload-demo"
action=""
:before-upload="importData"
>
<el-button size="medium" type="primary">导入数据</el-button>
</el-upload>
</div>
<div style="margin-right: 30px">
<el-button @click="newItem" type="primary"
><i class="el-icon-plus"></i>新建
</el-button>
</div>
</div>
</div>
</div>
<div class="page_content_table">
<el-table
:data="tableData"
border
@selection-change="handleSelectionChange"
style="width: 100%"
ref="multipleTable"
v-loading="loading"
>
<el-table-column fixed type="selection" width="55"></el-table-column>
<el-table-column
v-for="(item, index) in cols"
:key="index"
:prop="item.prop"
:label="item.label"
:width="item.width"
show-overflow-tooltip
>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="viewItem(scope.row)"
>详情
</el-button>
<el-button type="text" size="small" @click="editItem(scope.row)"
>编辑
</el-button>
<el-button type="text" size="small" @click="delItem(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page_page">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="dialogVisible">
<el-form :model="editForm" :disabled="dialogReadOnly">
<el-row>
<el-col :span="12">
<el-form-item label="城市:">
<el-input
v-model="editForm.city"
placeholder="请输入城市"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行政区:">
<el-input
v-model="editForm.area"
placeholder="请输入行政区"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="大组团:">
<el-input
v-model="editForm.bigGroup"
placeholder="请输入大组团"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="小组团:">
<el-input
v-model="editForm.smallGroup"
placeholder="请输入小组团"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
queryList,
delData,
addData,
updateData,
importFile
} from "@/views/city/cityList/api/cityList";
import {
getCityList,
getAreaList,
getBigGroupList,
} from "@/views/land/api/api";
export default {
data() {
return {
searchForm: {
//
city: "",
area: "",
bigGroup: "",
},
tableData: [],
//
cols: [
{
label: "城市",
prop: "city",
},
{
label: "行政区",
prop: "area",
},
{
label: "大组团",
prop: "bigGroup",
},
{
label: "小组团",
prop: "smallGroup",
},
],
//
loading: false,
//
selectedData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 10, //
},
//
hasSelectData: false,
title: "新增城市",
dialogReadOnly: false,
editForm: {},
dialogVisible: false,
cityList: [],
regionList: [],
bigGroupList: [],
};
},
mounted() {
this.onSubmit();
getCityList().then((res) => {
this.cityList = res.data.data;
});
},
watch: {
selectedData: {
handler(newVal, oldVal) {
this.hasSelectData = newVal.length > 0 ? true : false;
},
},
searchForm: {
handler(newValue, oldValue) {
if (this.searchForm.city && this.searchForm.city != "") {
getAreaList(this.searchForm.city).then((res) => {
this.regionList = res.data.data;
});
if (this.searchForm.area && this.searchForm.area != "") {
getBigGroupList(this.searchForm.city, this.searchForm.area).then(
(res) => {
this.bigGroupList = res.data.data;
}
);
}
}
},
deep: true,
},
},
methods: {
//
clearSelection() {
this.$refs.multipleTable.clearSelection();
},
//
onSubmit() {
this.loading = true;
let param = Object.assign(
{
current: this.page.currentPage,
size: this.page.pageSize,
},
this.searchForm
);
queryList(param).then((response) => {
this.tableData = response.data.data.records;
this.page.total = response.data.data.total;
this.loading = false;
});
},
//
onReset() {
for (let item in this.searchForm) {
this.searchForm[item] = "";
}
},
handleSizeChange(val) {
this.page.pageSize = val;
this.onSubmit();
},
handleCurrentChange(val) {
this.page.currentPage = val;
this.onSubmit();
},
//
handleSelectionChange(val) {
this.selectedData = val;
},
//
newItem() {
this.title = "新增城市";
this.editForm = {};
this.dialogReadOnly = false;
this.dialogVisible = true;
},
//
editItem(row) {
this.title = "编辑城市";
this.editForm = row;
this.dialogReadOnly = false;
this.dialogVisible = true;
},
//
save() {
if (this.editForm.id) {
updateData(this.editForm).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
} else {
addData(this.editForm).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
}
},
//
viewItem(row) {
this.title = "查看城市";
this.editForm = row;
this.dialogReadOnly = true;
this.dialogVisible = true;
},
//
delItem(row) {
let _this = this;
this.$confirm("确认删除?", "系统提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
cancelButtonClass: "btn-custom-cancel",
type: "warning",
})
.then(function () {
delData(row.id).then((res) => {
if (res.data.success) {
_this.$message({
type: "success",
message: "删除成功",
});
_this.onSubmit();
} else {
_this.$message("删除失败");
}
});
})
.catch(function () {});
},
//
multiDelete() {
if (this.selectedData.length < 1) {
this.$message({
message: "未选中数据",
type: "warning",
});
return;
}
let ids = [];
for (let item of this.selectedData) {
ids.push(item["id"]);
}
delData(ids).then((res) => {
if (res.data.success) {
this.$message({
type: "success",
message: "删除成功",
});
this.onSubmit();
} else {
this.$message("删除失败");
}
});
},
//
importData(e) {
const file = e;
let formData = new FormData();
formData.append("uploadFile", file);
importFile(formData).then((res) => {
if (res.data.success) {
this.$message({
type: "success",
message: "导入成功",
});
this.onSubmit();
return true;
} else {
this.$message("导入失败");
return false;
}
});
},
},
};
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
/deep/ .el-input {
width: 60%;
}
/deep/ .el-form-item__label {
width: 100px;
}
</style>

39
src/views/gen/api/form.js

@ -1,39 +0,0 @@
import request from '@/router/axios'
export function fetchList(query) {
return request({
url: '/gen/form/page',
method: 'get',
params: query
})
}
export function addObj(obj) {
return request({
url: '/gen/form',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: '/gen/form/' + id,
method: 'get'
})
}
export function delObj(id) {
return request({
url: '/gen/form/' + id,
method: 'delete'
})
}
export function putObj(obj) {
return request({
url: '/gen/form',
method: 'put',
data: obj
})
}

92
src/views/gen/api/gen.js

@ -1,92 +0,0 @@
import request from '@/router/axios'
export function fetchList(query) {
return request({
url: '/gen/generator/page',
method: 'get',
params: query
})
}
export function fetchDsList(query) {
return request({
url: '/gen/dsconf/page',
method: 'get',
params: query
})
}
export function fetchSelectDsList() {
return request({
url: '/gen/dsconf/list',
method: 'get'
})
}
export function addObj(obj) {
return request({
url: '/gen/dsconf/',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: '/gen/dsconf/' + id,
method: 'get'
})
}
export function delObj(id) {
return request({
url: '/gen/dsconf/' + id,
method: 'delete'
})
}
export function putObj(obj) {
return request({
url: '/gen/dsconf/',
method: 'put',
data: obj
})
}
export function handleDown(table) {
return request({
url: '/gen/generator/code',
method: 'post',
data: table,
responseType: 'arraybuffer'
}).then((response) => { // 处理返回的文件流
const blob = new Blob([response.data], {type: 'application/zip'})
const filename = table.tableName + '.zip'
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = filename
document.body.appendChild(link)
link.click()
window.setTimeout(function () {
URL.revokeObjectURL(blob)
document.body.removeChild(link)
}, 0)
})
}
export function getForm(tableName, dsName) {
return request({
url: '/gen/form/info',
params: {tableName: tableName, dsName: dsName},
method: 'get'
})
}
export function postForm(formInfo, tableName, dsId) {
return request({
url: '/gen/form/',
method: 'post',
data: Object.assign({formInfo, tableName, dsId})
})
}

40
src/views/gen/crud/form.js

@ -1,40 +0,0 @@
export const tableOption = {
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
align: 'center',
viewBtn: true,
editBtn: false,
addBtn: false,
searchMenuSpan: 6,
column: [
{
label: 'ID',
prop: 'id',
hide: true,
},
{
label: '表名称',
prop: 'tableName'
},
{
label: '创建时间',
prop: 'createTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss'
},
{
label: '表单信息',
prop: 'formInfo',
overHidden: true,
width: 500,
type: 'textarea',
minRows: 3,
row: true,
span: 24
}
]
}

174
src/views/gen/crud/gen.js

@ -1,174 +0,0 @@
export const tableOption = {
selection: true,
border: true,
index: true,
stripe: true,
menuAlign: 'center',
align: 'center',
addBtn: false,
editBtn: false,
delBtn: false,
searchMenuSpan: 6,
column: [{
label: '表名称',
prop: 'tableName',
align: 'center'
}, {
label: '表注释',
prop: 'tableComment',
align: 'center'
}, {
label: '表编码',
prop: 'tableCollation',
align: 'center'
}, {
label: '索引',
prop: 'engine',
align: 'center'
}, {
type: 'datetime',
valueFormat: 'timestamp',
format: 'yyyy-MM-dd hh:mm:ss',
label: '创建时间',
prop: 'createTime',
align: 'center'
}]
}
export const formOption = {
submitText: '生成',
column: [
{
label: '表名称',
prop: 'tableName',
disabled: true
}, {
label: '包名',
prop: 'packageName',
placeholder: '可为空,加载系统默认配置'
}, {
label: '作者',
prop: 'author',
placeholder: '可为空,加载系统默认配置'
}, {
label: '模块',
prop: 'moduleName',
placeholder: '可为空,加载系统默认配置'
}, {
label: '表前缀',
prop: 'tablePrefix',
placeholder: '可为空,加载系统默认配置'
}, {
label: '注释',
prop: 'comments',
placeholder: '可为空,加载表备注'
},{
label: '前端风格',
prop: 'style',
type: 'radio',
slot: true,
border:true,
span: 24,
dicUrl: '/admin/dict/type/style_type',
}
]
}
export const formBatchOption = {
submitText: '生成',
column: [
{
label: '表名称',
prop: 'tableName',
disabled: true,
minRows: 2,
type: 'textarea',
row: true,
span: 24
},
{
label: '包名',
prop: 'packageName',
placeholder: '可为空,加载系统默认配置'
}, {
label: '作者',
prop: 'author',
placeholder: '可为空,加载系统默认配置'
}, {
label: '模块',
prop: 'moduleName',
placeholder: '可为空,加载系统默认配置'
}, {
label: '注释',
prop: 'comments',
placeholder: '可为空,加载表备注'
}
]
}
export const tableDsOption = {
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
align: 'center',
column: [
{
label: '主键',
prop: 'id',
hide: true,
addDisplay: false,
editDisplay: false
},
{
label: '名称',
prop: 'name',
rules: [
{ required: true, message: '请输入名称', trigger: 'blur' },
{ max: 32, message: '长度在 32 个字符', trigger: 'blur' }
]
},
{
label: 'jdbcUrl',
prop: 'url',
type: 'textarea',
span: 24,
row: true,
minRows: 2,
overHidden: true,
rules: [
{ required: true, message: '请输入jdbcUrl', trigger: 'blur' }
]
},
{
label: '用户名',
prop: 'username',
rules: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ max: 32, message: '长度在 32 个字符', trigger: 'blur' }
]
},
{
label: '密码',
prop: 'password',
rules: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ max: 32, message: '长度在 32 个字符', trigger: 'blur' }
]
},
{
label: '创建时间',
prop: 'createDate',
addDisplay: false,
editDisplay: false,
overHidden: true
},
{
label: '更新时间',
prop: 'updateDate',
overHidden: true,
addDisplay: false,
editDisplay: false
}
]
}

122
src/views/gen/datasource.vue

@ -1,122 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<avue-crud
ref="data-source-settings-crud"
v-model="dsForm"
:page="dsPage"
:data="tableDsData"
:option="tableDsOption"
:before-open="handleOpenBefore"
@row-update="handleUpdate"
@row-save="handleSave"
@row-del="rowDel"
@size-change="sizeChange"
@current-change="currentChange"
@refresh-change="refreshDsChange"
@on-load="getDsList"/>
</basic-container>
</div>
</template>
<script>
import {addObj, delObj, fetchDsList, putObj} from '@/views/gen/api/gen'
import {formOption, tableDsOption, tableOption} from '@/views/gen/crud/gen'
export default {
name: 'CodeGenerator',
data() {
return {
dataSourceList: [],
tableDsData: [],
box: false,
dsPage: {
total: 0, //
currentPage: 1, //
pageSize: 20 //
},
dsForm: {},
tableLoading: false,
tableOption: tableOption,
tableDsOption: tableDsOption,
formOption: formOption
}
},
created() {
},
methods: {
rowDel: function (row, index) {
this.$confirm('是否确认删除ID为' + row.id, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return delObj(row.id)
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getDsList(this.dsPage)
})
},
handleOpenBefore: function (show) {
this.dsForm.password = undefined
show()
},
handleUpdate: function (row, index, done) {
putObj(row).then(res => {
if (res.data.data){
this.$message({
type: 'success',
message: '修改成功!'
});
}else {
this.$message.error('修改失败,数据源不可访问')
}
done()
this.getDsList(this.dsPage)
})
},
handleSave: function (row, done) {
addObj(row).then(res => {
if (res.data.data){
this.$message({
type: 'success',
message: '添加成功!'
});
}else {
this.$message.error('添加失败,数据源不可访问')
}
done()
this.getDsList(this.dsPage)
})
},
getDsList(page, params) {
fetchDsList(Object.assign({
current: page.currentPage,
size: page.pageSize
}, params)).then(response => {
this.tableDsData = response.data.data.records
this.dsPage.total = response.data.data.total
})
},
sizeChange(pageSize) {
this.page.pageSize = pageSize
},
currentChange(current) {
this.page.currentPage = current
},
refreshDsChange() {
this.getDsList(this.dsPage)
}
}
}
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
</style>

71
src/views/gen/design.vue

@ -1,71 +0,0 @@
<template>
<div class="webapp">
<basic-container>
<avue-form-design :option="option"
@submit="handleSubmit">
</avue-form-design>
</basic-container>
</div>
</template>
<script>
import {getForm, postForm} from '@/views/gen/api/gen'
import {validatenull} from "../../util/validate";
export default {
data() {
return {
box: true,
option: {
column: []
}
}
},
created() {
this.getFormInfo()
},
methods: {
handleSubmit(json) {
let params = this.$route.query;
if (validatenull(params)) {
return false
}
let result = JSON.stringify(json)
postForm(result, params.tableName, params.dsName).then(response => {
this.$message({
type: 'success',
message: '生成并保存成功!'
});
})
},
getFormInfo() {
let params = this.$route.query;
if (validatenull(params)) {
return false
}
getForm(params.tableName, params.dsName).then(response => {
if (!validatenull(response.data.data)) {
this.option = JSON.parse(response.data.data)
}
})
}
}
}
</script>
<style lang="scss">
.webapp {
background-color: #fff;
position: relative;
width: 100%;
height: 100%;
.form-designer {
height: 800px;
}
.form-designer .widget-config-container .el-tabs__header {
position: relative;
}
}
</style>

127
src/views/gen/form.vue

@ -1,127 +0,0 @@
<template>
<div class="execution">
<basic-container>
<avue-crud ref="crud"
:page="page"
:data="tableData"
:permission="permissionList"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@search-change="searchChange"
@refresh-change="refreshChange"
@size-change="sizeChange"
@current-change="currentChange"
@row-update="handleUpdate"
@row-save="handleSave"
@row-del="rowDel">
</avue-crud>
</basic-container>
</div>
</template>
<script>
import {addObj, delObj, fetchList, putObj} from '@/views/gen/api/form'
import {tableOption} from '@/views/gen/crud/form'
import {mapGetters} from 'vuex'
export default {
name: 'genForm',
data() {
return {
searchForm: {},
tableData: [],
page: {
total: 0, //
currentPage: 1, //
pageSize: 20 //
},
tableLoading: false,
tableOption: tableOption
}
},
computed: {
...mapGetters(['permissions']),
permissionList() {
return {
addBtn: this.vaildData(this.permissions.gen_form_add, false),
delBtn: this.vaildData(this.permissions.gen_form_del, false),
editBtn: this.vaildData(this.permissions.gen_form_edit, false)
};
}
},
methods: {
getList(page, params) {
this.tableLoading = true
fetchList(Object.assign({
descs: 'create_time',
current: page.currentPage,
size: page.pageSize
}, params, this.searchForm)).then(response => {
this.tableData = response.data.data.records
this.page.total = response.data.data.total
this.tableLoading = false
}).catch(() => {
this.tableLoading = false
})
},
rowDel: function (row, index) {
var _this = this
this.$confirm('是否确认删除ID为' + row.id, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return delObj(row.id)
}).then(data => {
this.$message({
type: 'success',
message: '删除成功'
});
this.getList(this.page)
})
},
handleUpdate: function (row, index, done, loading) {
putObj(row).then(data => {
this.$message({
type: 'success',
message: '修改成功'
});
done()
this.getList(this.page)
}).catch(() => {
loading();
});
},
handleSave: function (row, done, loading) {
addObj(row).then(data => {
this.$message({
type: 'success',
message: '添加成功'
});
done()
this.getList(this.page)
}).catch(() => {
loading();
});
},
searchChange(form, done) {
this.searchForm = form
this.getList(this.page, form)
done()
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
currentChange(current){
this.page.currentPage = current
},
refreshChange() {
this.getList(this.page)
}
}
}
</script>
<style lang="scss" scoped>
</style>

189
src/views/gen/index.vue

@ -1,189 +0,0 @@
<template>
<div class="execution">
<basic-container class="basicC bs m20">
<el-row :gutter="20">
<el-col :span="4">
<div class="grid-content bg-purple">
<el-select v-model="q.id" placeholder="请选择数据源" @change="search">
<el-option
v-for="item in dataSourceList"
:key="item.id"
:label="item.name"
:value="item.id"/>
</el-select>
</div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple">
<el-input v-model="q.tableName" placeholder="表名称"/>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
<el-button type="primary" icon="el-icon-download" @click="openBatch">批量生成</el-button>
</div>
</el-col>
</el-row>
<avue-crud
ref="crud"
:page="page"
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@size-change="sizeChange"
@current-change="currentChange"
@refresh-change="refreshChange">
<template
slot-scope="scope"
slot="menu">
<el-button
type="text"
icon="el-icon-check"
@click="handleDown(scope.row,scope.index)">生成
</el-button>
<el-button
type="text"
icon="icon-sheji"
@click="handleDesign(scope.row,scope.index)">设计
</el-button>
</template>
</avue-crud>
<el-dialog
:visible.sync="box"
title="生成配置"
width="50%"
lock-scroll>
<div class="pull-auto">
<avue-form
ref="formData"
:option="formOption"
v-model="formData"
@submit="gen"/>
</div>
</el-dialog>
<el-dialog
:visible.sync="boxBatch"
title="批量生成"
width="50%"
lock-scroll>
<div class="pull-auto">
<avue-form
ref="formBatchData"
:option="formBatchOption"
v-model="formBatchData"
@submit="batchGen"/>
</div>
</el-dialog>
</basic-container>
</div>
</template>
<script>
import {fetchList, fetchSelectDsList, handleDown} from '@/views/gen/api/gen'
import {formBatchOption, formOption, tableOption} from '@/views/gen/crud/gen'
export default {
name: 'CodeGenerator',
data() {
return {
q: {},
dataSourceList: [],
tableData: [],
formData: {},
formBatchData: {},
box: false,
boxBatch: false,
page: {
total: 0, //
currentPage: 1, //
pageSize: 20 //
},
tableLoading: false,
tableOption: tableOption,
formOption: formOption,
formBatchOption: formBatchOption
}
},
created() {
this.getdataSourceList()
},
methods: {
getList(page) {
this.tableLoading = true
fetchList(Object.assign({
current: page.currentPage,
size: page.pageSize
}, this.q)).then(response => {
this.tableData = response.data.data.records
this.page.total = response.data.data.total
this.tableLoading = false
})
},
handleDesign: function (row) {
this.$router.push({path: '/gen/design', query: {tableName: row.tableName, dsName: this.q.dsName}})
},
handleDown: function (row) {
this.formData.tableName = row.tableName
this.box = true
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
currentChange(current){
this.page.currentPage = current
},
refreshChange() {
this.getList(this.page)
},
gen(form,done) {
this.formData.id = this.q.id
handleDown(this.formData).then(() => {
done()
this.box = false
}).catch(()=>{
done()
})
},
getdataSourceList() {
fetchSelectDsList().then(response => {
this.dataSourceList = response.data.data
})
},
search() {
this.getList(this.page)
},
openBatch() {
if (this.$refs.crud.tableSelect.length <= 1 || this.$refs.crud.tableSelect.length > 10) {
this.$message.error('选中表数量不合法,数量最少2个或最多为10个')
return false
}
let tableName = []
for (const table of this.$refs.crud.tableSelect) {
tableName.push(table.tableName)
}
this.formBatchData.tableName = tableName.join('-')
this.boxBatch = true
},
batchGen(form,done) {
this.formBatchData.id = this.q.id
handleDown(this.formBatchData).then(() => {
done()
this.boxBatch = false
}).catch(()=>{
done()
})
}
}
}
</script>
<style lang="scss" scoped>
//
@import "@/styles/public.scss";
@import "@/styles/avue-table.scss";
</style>

2
src/views/land/handLand/newLand.vue

@ -1791,7 +1791,7 @@ export default {
}
//
if (this.editForm.transferPrice && this.editForm.transferPrice != 0 && this.editForm.dealPrice && this.editForm.dealPrice != 0) {
this.editForm.premiumRate = ((this.editForm.dealPrice - this.editForm.transferPrice) / this.editForm.transferPrice).toFixed(2)
this.editForm.premiumRate = (((this.editForm.dealPrice - this.editForm.transferPrice) / this.editForm.transferPrice)*100).toFixed(2)
}
},
deep: true,

2
src/views/land/noneHandLand/newLand.vue

@ -1299,7 +1299,7 @@ export default {
}
//
if (this.editForm.transferPrice && this.editForm.transferPrice != 0 && this.editForm.dealPrice && this.editForm.dealPrice != 0) {
this.editForm.premiumRate = ((this.editForm.dealPrice - this.editForm.transferPrice) / this.editForm.transferPrice).toFixed(2)
this.editForm.premiumRate = (((this.editForm.dealPrice - this.editForm.transferPrice) / this.editForm.transferPrice)*100).toFixed(2)
}
},
deep: true,

14
src/views/log/login/index.vue

@ -1,14 +0,0 @@
<template>
<div class="flat">
开发中
</div>
</template>
<script>
export default {
name: 'LoginLog'
};
</script>
<style>
</style>

14
src/views/log/opration/index.vue

@ -1,14 +0,0 @@
<template>
<div class="flat">
开发中
</div>
</template>
<script>
export default {
name: 'OprationLog'
};
</script>
<style>
</style>

14
src/views/set/userCenter/index.vue

@ -1,14 +0,0 @@
<template>
<div class="flat">
个人中心
</div>
</template>
<script>
export default {
name: 'UserCenter'
};
</script>
<style>
</style>

14
src/views/set/userSet/index.vue

@ -1,14 +0,0 @@
<template>
<div class="flat">
个人设置
</div>
</template>
<script>
export default {
name: 'UserSet'
};
</script>
<style>
</style>

4
vue.config.js

@ -6,8 +6,8 @@ const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
// const url = 'http://192.168.209.210:9002'; //裴
const url = 'https://yoursairdata.com/api';//生产
const url = 'http://192.168.209.210:9002'; //裴
// const url = 'https://yoursairdata.com/api';//生产
module.exports = {
lintOnSave: true,
productionSourceMap: false,

Loading…
Cancel
Save