feat(oa-project-flow) add

approve-sys
bob 2 years ago
parent 7b04efc107
commit b1a7634cb1

@ -0,0 +1,258 @@
<template>
<div class="app-container">
<!-- 添加或修改流程表单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="所属项目">
<el-select v-model="form.projectId"
clearable
filterable
placeholder="请选择">
<el-option
v-for="(item,index) in projectList"
:key="index"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目问题">
<el-input type="textarea" v-model="form.issue"/>
</el-form-item>
<el-form-item label="解决方案">
<el-input type="textarea" v-model="form.solution"/>
</el-form-item>
<el-form-item label="工作记录">
<el-input type="textarea" v-model="form.workRecord"/>
</el-form-item>
<el-form-item label="图片上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="文件上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
multiple
:limit="3"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listForm, getForm, delForm, addForm, updateForm, exportForm} from "@/api/flowable/form";
import Editor from '@/components/Editor';
import Parser from '@/components/parser/Parser'
export default {
name: "Form",
components: {
Editor,
Parser
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
formList: [],
//
title: "",
formConf: {}, //
formConfOpen: false,
formTitle: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
formName: null,
formContent: null,
},
fileList: [{
name: 'food.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}, {
name: 'food2.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}],
//
form: {
projectId: 0,
workRecord: '',
issue: '',
solution: '',
},
projectList: [],
//
rules: {}
};
},
methods: {
init() {
this.open = true
},
/** 查询流程表单列表 */
getList() {
this.loading = true;
listForm(this.queryParams).then(response => {
this.formList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
formId: null,
formName: null,
formContent: null,
createTime: null,
updateTime: null,
createBy: null,
updateBy: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.formId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 表单配置信息 */
handleDetail(row) {
this.formConfOpen = true;
this.formTitle = "流程表单配置详细";
this.formConf = JSON.parse(row.formContent)
},
/** 新增按钮操作 */
handleAdd() {
// this.reset();
// this.open = true;
// this.title = "";
this.$router.push({path: '/tool/build/index', query: {formId: null}})
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
// const formId = row.formId || this.ids
// getForm(formId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "";
// });
this.$router.push({path: '/tool/build/index', query: {formId: row.formId}})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.formId != null) {
updateForm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addForm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const formIds = row.formId || this.ids;
this.$confirm('是否确认删除流程表单编号为"' + formIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delForm(formIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有流程表单数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportForm(queryParams);
}).then(response => {
this.download(response.msg);
})
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
};
</script>
<style lang="scss" scoped>
.test-form {
margin: 15px auto;
width: 800px;
padding: 15px;
}
</style>

@ -4,46 +4,11 @@
<el-col :xs="24" :sm="24" :md="12" :lg="14"> <el-col :xs="24" :sm="24" :md="12" :lg="14">
<el-card class="update-log"> <el-card class="update-log">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>联系信息</span> <el-button @click="handleAddOaProject"></el-button>
</div>
<div class="body">
<p>
<i class="el-icon-user-solid"></i> QQ群
<a href="https://jq.qq.com/?_wv=1027&k=2zE87c2G" target="_blank"
> 782924350</a
>
</p>
<p>
<i class="el-icon-chat-dot-round"></i> 微信<a
>Almost-2y</a
>
</p>
<p style="color: #f54a4a;font-size:16px">
<i class="el-icon-bell"></i> 说明<a
>承接各种小型项目有需求可联系我微信Almost-2y / QQ: 846249920</a
>
</p>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="10">
<el-card class="update-log">
<div slot="header" class="clearfix">
<span>捐赠支持</span>
</div>
<div class="body">
<img
src="https://oscimg.oschina.net/oscnet/up-88f17f916de7a895cf2a84d2ce769e9b2ca.JPEG"
alt="donate"
width="100%"
/>
<span style="display: inline-block; height: 30px; line-height: 30px"
>可以请作者喝杯咖啡以示鼓励</span
>
</div>
</el-card>
</el-col>
</el-row> </el-row>
<el-divider /> <el-divider />
<el-row :gutter="20"> <el-row :gutter="20">
@ -72,10 +37,12 @@
</el-col> </el-col>
</el-row> </el-row>
<oa-project-flow ref="oaProjectFlow"></oa-project-flow>
</div> </div>
</template> </template>
<script> <script>
import oaProjectFlow from "./flowable/oa-project-flow"
export default { export default {
name: "index", name: "index",
data() { data() {
@ -84,10 +51,16 @@ export default {
version: "3.4.0", version: "3.4.0",
}; };
}, },
components: {
oaProjectFlow
},
methods: { methods: {
goTarget(href) { goTarget(href) {
window.open(href, "_blank"); window.open(href, "_blank");
}, },
handleAddOaProject() {
this.$refs.oaProjectFlow.init()
}
}, },
}; };
</script> </script>

@ -227,6 +227,7 @@ export default {
formContent: null, formContent: null,
remark: null remark: null
}, },
// //
rules: {} rules: {}
} }
@ -333,6 +334,7 @@ export default {
const i = this.drawingList.findIndex(item => item.__config__.renderKey === renderKey) const i = this.drawingList.findIndex(item => item.__config__.renderKey === renderKey)
if (i > -1) this.$set(this.drawingList, i, component) if (i > -1) this.$set(this.drawingList, i, component)
}, },
fetchData(component) { fetchData(component) {
const { dataType, method, url } = component.__config__ const { dataType, method, url } = component.__config__
if (dataType === 'dynamic' && method && url) { if (dataType === 'dynamic' && method && url) {

Loading…
Cancel
Save