🎉 1.0.1.RELEASE

main
ssc 5 years ago
parent 6c202db522
commit a7d32ce6ed
  1. 28
      src/views/plugin/workflow/design/deployment.vue
  2. 138
      src/views/plugin/workflow/design/form.vue
  3. 38
      src/views/plugin/workflow/design/index.vue
  4. 1
      src/views/plugin/workflow/design/model.vue

@ -142,7 +142,7 @@ export default {
return { return {
addBtn: this.vaildData(this.permission.deployment_add, false), addBtn: this.vaildData(this.permission.deployment_add, false),
viewBtn: this.vaildData(this.permission.deployment_view, false), viewBtn: this.vaildData(this.permission.deployment_view, false),
delBtn: this.vaildData(this.permission.deployment_delete, false), delBtn: this.vaildData(this.permission.wf_design_deployment_delete, false),
editBtn: this.vaildData(this.permission.deployment_edit, false) editBtn: this.vaildData(this.permission.deployment_edit, false)
}; };
}, },
@ -179,21 +179,25 @@ export default {
}) })
}, },
rowDel(row) { rowDel(row) {
this.$confirm("确定将选择数据删除?", { this.$confirm("此操作会级联删除当前正在进行的流程实例,且无法恢复,确定要删除吗?", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$confirm("二次确认!此操作会级联删除当前正在进行的流程实例,且无法恢复,确定要删除吗?", {
return remove({ deploymentId: row.deploymentId }); confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
remove({ deploymentId: row.deploymentId }).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
})
})
}) })
.then(() => { })
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
}, },
handleDelete() { handleDelete() {
if (this.selectionList.length === 0) { if (this.selectionList.length === 0) {

@ -22,17 +22,24 @@
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
plain plain
v-if="permission.wf_design_model_delete" v-if="permission.wf_design_form_delete"
@click="handleDelete"> @click="handleDelete">
</el-button> </el-button>
</template> </template>
<template slot="menu" <template slot="menu"
slot-scope="{row}"> slot-scope="{row}">
<el-button type="text" <el-button v-if="permission.wf_design_form_design"
type="text"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleDesign(row)">设计</el-button> @click="handleDesign(row)">设计</el-button>
<!-- <el-button type="text" <el-button v-if="permission.wf_design_form_copy"
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(row)">拷贝</el-button>
<!-- <el-button v-if="permission.wf_design_form_history && row.version > 1"
type="text"
size="mini" size="mini"
icon="el-icon-time" icon="el-icon-time"
@click="handleHistory(row)">历史</el-button> --> @click="handleHistory(row)">历史</el-button> -->
@ -57,6 +64,16 @@
</template> </template>
</avue-form-design> </avue-form-design>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="copyVisible"
append-to-body
title="拷贝表单">
<avue-form :option="copyOption"
v-model="form"
ref="copyForm"
@submit="handleCopySubmit">
</avue-form>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -149,7 +166,52 @@ export default {
type: 'textarea', type: 'textarea',
span: 24, span: 24,
display: true display: true
}] }],
copyOption: {
column: [{
label: "表单key",
prop: "key",
rules: [{
required: true,
message: "请输入表单key",
trigger: "blur"
}],
},
{
label: "表单名称",
prop: "name",
rules: [{
required: true,
message: "请输入表单名称",
trigger: "blur"
}],
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24
},
{
label: '状态',
prop: 'status',
type: 'select',
dicData: [{
label: '可用',
value: 1
}, {
label: '禁用',
value: 2
}],
rules: [{
required: true,
message: "请选择状态",
trigger: "change"
}],
},]
},
isCopy: false,
copyVisible: false
}; };
}, },
computed: { computed: {
@ -173,34 +235,64 @@ export default {
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.formDesign.getData('string').then(data => { this.$refs.formDesign.getData('string').then(data => {
this.row.content = data if (this.isCopy) {
this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', { this.copyVisible = true
confirmButtonText: '否', this.form.content = data
cancelButtonText: '是', } else {
type: 'warning' this.row.content = data
}).then(() => { this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', {
this.row.newVersion = false confirmButtonText: '否',
cancelButtonText: '是',
type: 'warning'
}).then(() => {
this.row.newVersion = false
update(this.row).then(() => { update(this.row).then(() => {
this.$message.success("保存成功") this.$message.success("保存成功")
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
this.formVisible = false this.formVisible = false
}) })
}).catch(() => { }).catch(() => {
this.row.newVersion = true this.row.newVersion = true
update(this.row).then(() => { update(this.row).then(() => {
this.$message.success("保存成功") this.$message.success("保存成功")
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
this.formVisible = false this.formVisible = false
})
}) })
}) }
}) })
}, },
handleDesign(row) { handleDesign(row) {
this.formVisible = true this.formVisible = true
this.options = this.deepClone(row.content || '') this.options = this.deepClone(row.content || '')
this.row = row this.row = row
this.isCopy = false
},
handleCopy(row) {
this.formVisible = true
this.options = this.deepClone(row.content || '')
this.isCopy = true
},
handleCopySubmit(form, done) {
const param = {
...form,
content: this.form.content
}
add(param).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.copyForm.resetFields()
done()
this.copyVisible = false
this.formVisible = false
}).catch(() => {
done()
})
}, },
rowSave(row, loading, done) { rowSave(row, loading, done) {
add(row).then(() => { add(row).then(() => {

@ -19,7 +19,7 @@
<template slot="tip"> <template slot="tip">
<el-link type="primary" <el-link type="primary"
:underline="false" :underline="false"
@click="$router.push('/workflow/design/form')">没有想要的表单点击去设计</el-link> @click="$router.push('/plugin/workflow/design/form')">没有想要的表单点击去设计</el-link>
</template> </template>
<template slot="form"> <template slot="form">
<avue-form v-model="step1.form" <avue-form v-model="step1.form"
@ -59,6 +59,7 @@
import { getDetail as getFormByKey } from '@/api/plugin/workflow/form' import { getDetail as getFormByKey } from '@/api/plugin/workflow/form'
import { submit, getDetail } from '@/api/plugin/workflow/model' import { submit, getDetail } from '@/api/plugin/workflow/model'
import { getList as buttonList } from '@/api/plugin/workflow/button' import { getList as buttonList } from '@/api/plugin/workflow/button'
import { userList } from '@/api/plugin/workflow/process'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -162,6 +163,7 @@ export default {
}, },
mounted() { mounted() {
this.getButtonList() this.getButtonList()
this.getUserList()
}, },
methods: { methods: {
handleNextStep() { handleNextStep() {
@ -239,6 +241,40 @@ export default {
}) })
this.$set(this.step2.option, 'button', list) this.$set(this.step2.option, 'button', list)
}) })
},
getUserList() {
const userConfig = {
leftColumns: [{
title: '姓名',
dataIndex: 'realName',
align: 'center'
}, {
title: '部门',
dataIndex: 'deptName',
align: 'center'
}, {
title: '职位',
dataIndex: 'postName',
align: 'center'
}],
rightColumns: [{
title: '姓名',
dataIndex: 'realName',
align: 'center'
},],
filterKey: 'realName',
}
userList(1, 99, {}).then(res => {
userConfig.data = res.data.data.records.map(r => {
return {
key: r.id,
realName: r.realName,
deptName: r.deptName
}
})
console.log(userConfig)
this.$set(this.step2.option, 'user', userConfig)
})
} }
} }
} }

@ -6,6 +6,7 @@
ref="crud" ref="crud"
v-model="form" v-model="form"
:page.sync="page" :page.sync="page"
@row-del="rowDel"
@search-change="searchChange" @search-change="searchChange"
@search-reset="searchReset" @search-reset="searchReset"
@selection-change="selectionChange" @selection-change="selectionChange"

Loading…
Cancel
Save