|
|
|
|
@ -2,9 +2,8 @@ |
|
|
|
|
<basic-container> |
|
|
|
|
<el-container> |
|
|
|
|
<el-aside width="200px"> |
|
|
|
|
<avue-tree :option="treeOption" |
|
|
|
|
:data="treeData" |
|
|
|
|
@node-click="nodeClick"></avue-tree> |
|
|
|
|
<wf-category @node-click="nodeClick" |
|
|
|
|
@list-change="findObject(option.column, 'categoryId').dicData = $event"></wf-category> |
|
|
|
|
</el-aside> |
|
|
|
|
<el-main style="margin-left: 10px;"> |
|
|
|
|
<avue-crud ref="crud" |
|
|
|
|
@ -97,13 +96,14 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, add, update, remove, listType, changeCategory } from "@/api/plugin/workflow/form"; |
|
|
|
|
import { tree } from '@/api/plugin/workflow/category'; |
|
|
|
|
|
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
|
|
|
|
|
import customFields from '../mixins/custom-fields' |
|
|
|
|
import WfCategory from '../process/components/category.vue' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { WfCategory }, |
|
|
|
|
mixins: [customFields], |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -264,15 +264,6 @@ export default { |
|
|
|
|
isCopy: false, |
|
|
|
|
copyVisible: false, |
|
|
|
|
categoryVisible: false, |
|
|
|
|
treeData: [], |
|
|
|
|
treeOption: { |
|
|
|
|
size: 'mini', |
|
|
|
|
addBtn: false, |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
title: '表单设计' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
@ -296,7 +287,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getDefaultValues() |
|
|
|
|
this.getCategoryList() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleChangeCategorySubmit(form, done) { |
|
|
|
|
@ -315,16 +305,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.categoryVisible = true |
|
|
|
|
}, |
|
|
|
|
getCategoryList() { |
|
|
|
|
tree().then(res => { |
|
|
|
|
const data = res.data.data |
|
|
|
|
this.findObject(this.option.column, 'categoryId').dicData = this.deepClone(data) |
|
|
|
|
this.findObject(this.copyOption.column, 'categoryId').dicData = this.deepClone(data) |
|
|
|
|
|
|
|
|
|
this.treeData = data |
|
|
|
|
this.treeData.unshift({ id: '', name: '全部' }) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
nodeClick({ id }) { |
|
|
|
|
this.categoryId = id |
|
|
|
|
this.searchChange(this.query) |
|
|
|
|
@ -333,28 +313,14 @@ export default { |
|
|
|
|
this.$refs.formDesign.getData('string').then(data => { |
|
|
|
|
this.$refs.formDesign.getData('app').then(appData => { |
|
|
|
|
if (this.isCopy) { |
|
|
|
|
this.copyVisible = true |
|
|
|
|
this.form.content = data |
|
|
|
|
this.form.appContent = JSON.stringify(appData) |
|
|
|
|
} else { |
|
|
|
|
this.row.content = data |
|
|
|
|
this.row.appContent = JSON.stringify(appData) |
|
|
|
|
|
|
|
|
|
if (this.isNewVersion) { |
|
|
|
|
this.row.newVersion = false |
|
|
|
|
|
|
|
|
|
update(this.row).then(() => { |
|
|
|
|
this.$message.success("保存成功") |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
this.formVisible = false |
|
|
|
|
}) |
|
|
|
|
this.copyVisible = true |
|
|
|
|
this.form.content = data |
|
|
|
|
this.form.appContent = JSON.stringify(appData) |
|
|
|
|
} else { |
|
|
|
|
this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', { |
|
|
|
|
distinguishCancelAndClose: true, |
|
|
|
|
confirmButtonText: '否', |
|
|
|
|
cancelButtonText: '是', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.row.content = data |
|
|
|
|
this.row.appContent = JSON.stringify(appData) |
|
|
|
|
|
|
|
|
|
if (this.isNewVersion) { |
|
|
|
|
this.row.newVersion = false |
|
|
|
|
|
|
|
|
|
update(this.row).then(() => { |
|
|
|
|
@ -362,19 +328,33 @@ export default { |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
this.formVisible = false |
|
|
|
|
}) |
|
|
|
|
}).catch(action => { |
|
|
|
|
if (action == 'cancel') { |
|
|
|
|
this.row.newVersion = true |
|
|
|
|
} else { |
|
|
|
|
this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', { |
|
|
|
|
distinguishCancelAndClose: true, |
|
|
|
|
confirmButtonText: '否', |
|
|
|
|
cancelButtonText: '是', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.row.newVersion = false |
|
|
|
|
|
|
|
|
|
update(this.row).then(() => { |
|
|
|
|
this.$message.success("保存成功") |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
this.formVisible = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}).catch(action => { |
|
|
|
|
if (action == 'cancel') { |
|
|
|
|
this.row.newVersion = true |
|
|
|
|
|
|
|
|
|
update(this.row).then(() => { |
|
|
|
|
this.$message.success("保存成功") |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
this.formVisible = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|