🎉 1.2.5.RELEASE

saber
ssc 4 years ago
parent fda19f9f12
commit 6f229ad563
  1. 4
      src/main.js
  2. 21
      src/views/plugin/workflow/components/index.js
  3. 263
      src/views/plugin/workflow/components/wf-user-select/index.vue
  4. 2
      src/views/plugin/workflow/design/button.vue
  5. 2
      src/views/plugin/workflow/design/form-history.vue
  6. 21
      src/views/plugin/workflow/design/form.vue
  7. 12
      src/views/plugin/workflow/design/index.vue
  8. 18
      src/views/plugin/workflow/mixins/custom-fields.js
  9. 5
      src/views/plugin/workflow/process/claim.vue
  10. 16
      src/views/plugin/workflow/process/components/button.vue
  11. 2
      src/views/plugin/workflow/process/components/detail.vue
  12. 2
      src/views/plugin/workflow/process/components/form.vue
  13. 10
      src/views/plugin/workflow/process/start.vue

@ -56,6 +56,10 @@ Vue.use(window.AvueFormDesign)
Vue.use(window.WfDesign.default, {
i18n: (key, value) => i18n.t(key, value)
})
import WfCustomFields from './views/plugin/workflow/components'
Vue.use(WfCustomFields)
Vue.config.productionTip = false;
new Vue({

@ -0,0 +1,21 @@
// ./为当前目录, true为是否匹配当前文件夹 /\.vue$/为匹配插件(匹配.vue结尾的插件)
const requireComponent = require.context('./', true, /\.vue$/);
const install = (Vue) => {
if (install.installed) return
else install.installed
requireComponent.keys().forEach(fileName => {
const config = requireComponent(fileName)
const componentName = config.default.name
Vue.component('wf-' + componentName, config.default || config)
})
}
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default {
install
}

@ -0,0 +1,263 @@
<template>
<div>
<el-input v-model="name"
:size="size"
suffix-icon="el-icon-user"
placeholder="人员选择"
readonly
@click.native="visible = true"></el-input>
<el-dialog ref="wf-dialog"
custom-class="wf-dialog"
:visible.sync="visible"
title="人员选择"
width="60%"
:before-close="handleClose"
append-to-body>
<avue-crud :option="option"
:table-loading="loading"
:data="data"
:page.sync="page"
v-model="form"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionList=$event"
@current-change="page.currentPage=$event"
@size-change="page.pageSize=$event"
@row-click="rowClick"
@on-load="onLoad">
<template v-if="checkType == 'radio'"
#radio="{row}">
<el-radio v-model="form.radio"
:label="row.id"><i></i></el-radio>
</template>
</avue-crud>
<span slot="footer"
class="dialog-footer">
<el-button @click="handleClose"
size="mini"> </el-button>
<el-button type="primary"
@click="handleConfirm"
size="mini"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'user-select',
props: {
value: [String, Number],
checkType: {
type: String,
default: () => {
return 'radio'
}
},
size: {
type: String,
default: () => {
return 'small'
}
}
},
watch: {
value: {
handler(val) {
if (val) this.changeDefaultChecked()
},
immediate: true
},
checkType: {
handler(val) {
if (val == 'radio') {
this.$set(this.option, 'selection', false)
this.findObject(this.option.column, 'radio').hide = false
} else {
this.$set(this.option, 'selection', true)
this.findObject(this.option.column, 'radio').hide = true
}
},
immediate: true
}
},
computed: {
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
},
names() {
let names = [];
this.selectionList.forEach(ele => {
names.push(ele.realName);
});
return names.join(",");
}
},
data() {
return {
visible: false,
name: '',
form: {},
query: {},
loading: false,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
data: [],
option: {
size: 'mini',
searchSize: 'mini',
align: 'center',
menu: false,
addBtn: false,
header: false,
border: true,
tip: false,
reserveSelection: true,
highlightCurrentRow: true,
gutter: 5,
searchMenuSpan: 6,
selection: true,
column: [{
label: '',
prop: 'radio',
type: 'radio',
width: 55,
hide: true
}, {
label: '头像',
prop: 'avatar',
type: 'upload',
width: 90
}, {
label: '姓名',
prop: 'name',
overHidden: true,
search: true
}, {
label: '部门',
prop: 'deptName',
overHidden: true,
search: true
}, {
label: '职位',
prop: 'postName',
overHidden: true,
search: true
}]
}
}
},
mounted() {
this.onLoad(this.page)
},
methods: {
handleConfirm() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据")
return
}
this.$set(this, 'name', this.names)
this.$emit('input', this.ids)
this.handleClose()
},
handleClose(done) {
// this.selectionClear()
this.visible = false
if (done && typeof done == 'function') done()
},
searchReset() {
this.query = {}
this.onLoad(this.page)
},
searchChange(params, done) {
this.query = params
this.page.currentPage = 1
this.onLoad(this.page, params)
done()
},
selectionClear() {
this.selectionList = []
if (this.$refs.crud) this.$refs.crud.toggleSelection()
},
rowClick(row) {
if (this.checkType == 'radio') {
this.selectionList = [row]
this.$set(this.form, 'radio', row.id)
} else this.$refs.crud.toggleSelection([row])
},
changeDefaultChecked() {
if (!this.value) return
let defaultChecked = this.value + ''
const name = []
if (this.checkType == 'checkbox') {
this.selectionClear()
const checks = defaultChecked.split(",")
if (checks.length > 0) {
setTimeout(() => {
checks.forEach(c => {
const row = this.data.find(d => d.id == c)
if (row) name.push(row.realName)
if (row && this.$refs.crud) {
this.$refs.crud.toggleRowSelection(row, true)
}
})
}, 500);
}
} else {
const row = this.data.find(d => d.id == defaultChecked)
if (row) {
this.selectionList = [row]
this.$set(this.form, 'radio', defaultChecked)
name.push(row.realName)
} else {
this.selectionList = []
this.$set(this.form, 'radio', '')
}
}
setTimeout(() => {
this.$set(this, 'name', name.join(','))
}, 1000);
},
onLoad(page, params = {}) {
this.loading = true;
const param = {
current: page.currentPage,
size: page.pageSize,
...Object.assign(params, this.query)
}
this.$axios.get('/api/blade-user/search/user', { params: param }).then(res => {
this.page.total = res.data.data.total
this.data = res.data.data.records
this.loading = false
})
},
}
}
</script>
<style lang="scss">
.wf-dialog {
display: flex;
flex-direction: column;
margin: 0 !important;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -40%);
max-height: calc(100% - 30px);
max-width: calc(100% - 30px);
.el-dialog__body {
flex: 1;
overflow: auto;
}
}
</style>

@ -62,7 +62,7 @@ export default {
column: [
{
label: "key",
prop: "key",
prop: "buttonKey",
rules: [{
required: true,
message: "请输入key",

@ -86,7 +86,7 @@ export default {
column: [
{
label: "表单key",
prop: "key",
prop: "formKey",
search: true
},
{

@ -6,6 +6,7 @@
:page.sync="page"
:search.sync="query"
:permission="permissionList"
:before-open="beforeOpen"
v-model="form"
@row-update="rowUpdate"
@row-save="rowSave"
@ -74,7 +75,10 @@
import { getList, add, update, remove, listType } from "@/api/plugin/workflow/form";
import { mapGetters } from "vuex";
import customFields from '../mixins/custom-fields'
export default {
mixins: [customFields],
data() {
return {
formVisible: false,
@ -103,7 +107,7 @@ export default {
column: [
{
label: "表单key",
prop: "key",
prop: "formKey",
rules: [{
required: true,
message: "请输入表单key",
@ -153,18 +157,11 @@ export default {
]
},
data: [],
customFields: [{
label: '批复意见',
prop: 'comment',
type: 'textarea',
span: 24,
display: true
}],
defaultValues: {},
copyOption: {
column: [{
label: "表单key",
prop: "key",
prop: "formKey",
rules: [{
required: true,
message: "请输入表单key",
@ -391,6 +388,12 @@ export default {
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["add"].includes(type)) {
this.$set(this.form, 'status', 1)
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);

@ -22,7 +22,8 @@
</el-steps>
<div v-show="step == 0">
<avue-form ref="form1"
<avue-form style="margin-bottom: 66px;"
ref="form1"
:option="step1.option"
v-model="step1.form">
<template #tip>
@ -31,8 +32,7 @@
@click="$router.push('/plugin/workflow/design/form')">没有想要的表单点击去设计</el-link>
</template>
<template #form>
<avue-form style="margin-bottom: 66px;"
ref="form2"
<avue-form ref="form2"
v-model="step1.form"
:option="step1.option1"></avue-form>
</template>
@ -190,13 +190,13 @@ export default {
},
props: {
label: 'name',
value: 'key'
value: 'formKey'
},
event: {
change: (val) => {
this.step1.option1 = {}
if (val) {
getFormByKey({ key: val }).then(res => {
getFormByKey({ formKey: val }).then(res => {
_this.step1.option1 = { ...eval('(' + res.data.data.content + ')'), menuBtn: false, readonly: true }
_this.step1.option.group[1].display = true
setTimeout(() => {
@ -370,7 +370,7 @@ export default {
const list = res.data.data.records.map(l => {
return {
label: l.name,
prop: l.key,
prop: l.buttonKey,
display: true
}
})

@ -0,0 +1,18 @@
export default {
data() {
return {
customFields: [{
title: '业务字段',
list: [{
label: '人员选择',
prop: 'user',
component: 'wf-user-select',
span: 12,
params: {
checkType: 'checkbox'
}
}]
}]
}
}
}

@ -44,7 +44,10 @@
import { claimList as getList, claimTask, detail } from "@/api/plugin/workflow/process";
import { mapGetters } from "vuex";
import exForm from '../mixins/ex-form'
export default {
mixins: [exForm],
data() {
return {
form: {},
@ -144,7 +147,7 @@ export default {
},
methods: {
handleClaim(row) {
this.$confirm('确定要签收此任务吗?签收成功后会进入办事宜。', '提示', {
this.$confirm('确定要签收此任务吗?签收成功后会进入办事宜。', '提示', {
type: 'warning'
}).then(() => {
claimTask({ taskId: row.taskId }).then(() => {

@ -4,42 +4,42 @@
<el-row class="foot-item avue-affix"
:style="{width: isCollapse? 'calc(100% - 80px)': 'calc(100% - 260px)' }"
id="avue-view">
<el-button v-if="buttonList.find(b => b.key == 'wf_pass')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_pass')"
type="success"
size="medium"
v-loading="loading"
@click="$emit('examine', true)">通过</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_reject')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_reject')"
type="danger"
size="medium"
v-loading="loading"
@click="$emit('examine', false)">驳回</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_transfer')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_transfer')"
type="primary"
size="medium"
v-loading="loading"
@click="$emit('user-select', {type: 'transfer', checkType: 'radio'})">转办</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_delegate')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_delegate')"
type="warning"
size="medium"
v-loading="loading"
@click="$emit('user-select', {type: 'delegate', checkType: 'radio'})">委托</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_print')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_print')"
type="info"
size="medium"
v-loading="loading"
@click="$emit('print')">打印</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_print')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_print')"
type="success"
size="medium"
v-loading="loading"
@click="handleRollback">指定回退</el-button>
<el-button v-if="buttonList.find(b => b.key == 'wf_terminate')"
<el-button v-if="buttonList.find(b => b.buttonKey == 'wf_terminate')"
type="danger"
size="medium"
v-loading="loading"
@click="$emit('terminate')">终止</el-button>
<el-button v-if="process.isMultiInstance && buttonList.find(b => b.key == 'wf_add_instance')"
<el-button v-if="process.isMultiInstance && buttonList.find(b => b.buttonKey == 'wf_add_instance')"
type="primary"
size="medium"
v-loading="loading"

@ -14,6 +14,7 @@
<avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))"
v-model="form"
ref="form"
:defaults.sync="defaults"
:option="option"
:upload-preview="handleUploadPreview">
</avue-form>
@ -94,6 +95,7 @@ export default {
data() {
return {
activeName: 'first',
defaults: {},
form: {},
option: {},
vars: [], //

@ -9,6 +9,7 @@
v-model="form"
ref="form"
:option="option"
:defaults.sync="defaults"
@submit="handleSubmit"
@error="loading = false"
:upload-preview="handleUploadPreview">
@ -79,6 +80,7 @@ export default {
},
data() {
return {
defaults: {},
form: {},
option: {},
process: {},

@ -12,6 +12,13 @@
@current-change="currentChange"
@size-change="sizeChange"
@on-load="onLoad">
<template #menuLeft
v-if="isDev">
<el-tag type="warning"
effect="dark"
size="medium"><i class="el-icon-warning"></i> 部署的流程不显示请查看使用文档或到 模型设计 中配置权限
</el-tag>
</template>
<template slot="menu"
slot-scope="{row}">
<el-button v-if="permission.wf_process_start_flow"
@ -119,6 +126,9 @@ export default {
ids.push(ele.id);
});
return ids.join(",");
},
isDev() {
return process.env.NODE_ENV === "development"
}
},
methods: {

Loading…
Cancel
Save