提交 51d3ffcb 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

增加工作流前端页面

上级 910c857e
......@@ -316,6 +316,8 @@ func InitSysBaseMenus() (err error) {
{Model: gorm.Model{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "simpleUploader", Name: "simpleUploader", Component: "view/example/simpleUploader/simpleUploader", Sort: 6, Meta: model.Meta{Title: "断点续传(插件版)", Icon: "upload"}},
{Model: gorm.Model{ID: 26, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "https://www.gin-vue-admin.com", Name: "https://www.gin-vue-admin.com", Hidden: false, Component: "/", Sort: 0, Meta: model.Meta{Title: "官方网站", Icon: "s-home"}},
{Model: gorm.Model{ID: 27, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "state", Name: "state", Hidden: false, Component: "view/system/state.vue", Sort: 6, Meta: model.Meta{Title: "服务器状态", Icon: "cloudy"}},
{Model: gorm.Model{ID: 28, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "workflow", Name: "workflow", Hidden: false, Component: "view/workflow/index.vue", Sort: 6, Meta: model.Meta{Title: "工作流管理", Icon: "s-flag"}},
{Model: gorm.Model{ID: 29, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "workflowCreate", Name: "workflowCreate", Hidden: false, Component: "view/workflow/workflowCreate/workflowCreate.vue", Sort: 6, Meta: model.Meta{Title: "工作流创建", Icon: "plus"}},
}
if tx.Create(&insert).Error != nil { // 遇到错误时回滚事务
tx.Rollback()
......@@ -375,6 +377,8 @@ func InitSysAuthorityMenus() (err error) {
{"888", 25},
{"888", 26},
{"888", 27},
{"888", 28},
{"888", 29},
{"8881", 1},
{"8881", 2},
{"8881", 8},
......
此差异已折叠。
{
"name": "qm-plus-vue-page",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@moefe/vue-aplayer": "^2.0.0-beta.5",
"axios": "^0.19.0",
"core-js": "^3.6.5",
"echarts": "^4.7.0",
"element-ui": "^2.12.0",
"mavon-editor": "^2.7.7",
"node-sass": "^4.14.1",
"path": "^0.12.7",
"qs": "^6.8.0",
"quill": "^1.3.7",
"sass-loader": "^8.0.0",
"screenfull": "^5.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"spark-md5": "^3.0.1",
"timeline-vuejs": "1.1.1",
"vue": "^2.6.10",
"vue-particle-line": "^0.1.4",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.3",
"vue-simple-uploader": "^0.7.4",
"vuescroll": "^4.14.4",
"vuex": "^3.1.1",
"vuex-persist": "^2.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.6",
"@vue/cli-plugin-eslint": "^4.5.6",
"@vue/cli-service": "^4.5.6",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
"name": "qm-plus-vue-page",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
"dependencies": {
"@moefe/vue-aplayer": "^2.0.0-beta.5",
"axios": "^0.19.0",
"core-js": "^3.6.5",
"echarts": "^4.7.0",
"element-ui": "^2.12.0",
"mavon-editor": "^2.7.7",
"node-sass": "^4.14.1",
"path": "^0.12.7",
"qs": "^6.8.0",
"quill": "^1.3.7",
"sass-loader": "^8.0.0",
"screenfull": "^5.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"spark-md5": "^3.0.1",
"timeline-vuejs": "1.1.1",
"vue": "^2.6.10",
"vue-particle-line": "^0.1.4",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.3",
"vue-simple-uploader": "^0.7.4",
"vuescroll": "^4.14.4",
"vuex": "^3.1.1",
"vuex-persist": "^2.1.0",
"wfd-gva": "^1.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.6",
"@vue/cli-plugin-eslint": "^4.5.6",
"@vue/cli-service": "^4.5.6",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
\ No newline at end of file
/* eslint-disable */
export const toUpperCase = (str) => {
if (str[0]) {
return str.replace(str[0], str[0].toUpperCase())
......@@ -8,13 +9,13 @@ export const toUpperCase = (str) => {
// 驼峰转换下划线
export const toSQLLine = (str) => {
if (str=="ID") return "ID"
return str.replace(/([A-Z])/g,"_$1").toLowerCase();
}
if (str == "ID") return "ID"
return str.replace(/([A-Z])/g, "_$1").toLowerCase();
}
// 下划线转换驼峰
export const toHump = (name) => {
return name.replace(/\_(\w)/g, function(all, letter){
// 下划线转换驼峰
export const toHump = (name) => {
return name.replace(/\_(\w)/g, function(all, letter) {
return letter.toUpperCase();
});
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ export default {
apis &&
apis.map(item => {
item.onlyId = "p:"+item.path+"m:"+item.method
if (apiObj.hasOwnProperty(item.apiGroup)) {
if (Object.prototype.hasOwnProperty.call(apiObj,item.apiGroup)) {
apiObj[item.apiGroup].push(item)
} else {
Object.assign(apiObj, { [item.apiGroup]: [item] })
......
......@@ -146,8 +146,11 @@ export default {
],
};
},
created() {
created() {
this.reload();
setInterval(() => {
this.reload();
}, 1000*10);
},
methods: {
async reload() {
......
<template>
<div>
<el-form :model="form" label-width="100px" ref="form">
<el-form-item label="工作流名称">
<el-input type="text" v-model="form.workflowNickName"></el-input>
</el-form-item>
<el-form-item label="工作流英文id">
<el-input type="text" v-model="form.workflowName"></el-input>
</el-form-item>
<el-form-item label="工作流描述">
<el-input type="text" v-model="form.workflowDescription"></el-input>
</el-form-item>
</el-form>
<el-button @click="createWorkflowStep" class="fl-right mg" type="primary">新增</el-button>
<el-table :data="form.workflowStep" border style="width: 100%">
<el-table-column label="是否是完结流节点" prop="isEnd">
<template slot-scope="scope">
<el-select placeholder="请选择" v-model="scope.row.isEnd">
<el-option
:key="key"
:label="item.name"
:value="item.value"
v-for="(item,key) in options"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="是否是开始流节点" prop="isStrat">
<template slot-scope="scope">
<el-select placeholder="请选择" v-model="scope.row.isStrat">
<el-option
:key="key"
:label="item.name"
:value="item.value"
v-for="(item,key) in options"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作者级别id" prop="stepAuthorityID">
<template slot-scope="scope">
<el-input placeholder="请输入" type="text" v-model="scope.row.stepAuthorityID"></el-input>
</template>
</el-table-column>
<el-table-column label="工作流名称" prop="stepName">
<template slot-scope="scope">
<el-input placeholder="请输入" type="text" v-model="scope.row.stepName"></el-input>
</template>
</el-table-column>
<el-table-column label="步骤id" prop="stepNo">
<template slot-scope="scope">
<el-input placeholder="请输入" type="text" v-model="scope.row.stepNo"></el-input>
</template>
</el-table-column>
</el-table>
<el-button @click="submit" type="primary" class="fl-right mg">提交</el-button>
<wfd-gva ref="wfd" :data="demoData" :height="600" :users="candidateUsers" :groups="candidateGroups" :categorys="categorys" :lang="lang" />
</div>
</template>
<script>
import { createWorkFlow } from '@/api/workflow'
import wfdGva from 'wfd-gva'
export default {
name: 'Workflow',
data() {
components:{
wfdGva
},
data () {
return {
form: {
workflowName: '',
workflowDescription: '',
workflowNickName: '',
workflowStep: [
{
isEnd: false,
isStrat: true,
stepAuthorityID: '',
stepName: '',
stepNo: ''
}
]
},
options: [
{
name: '',
value: true
},
{
name: '',
value: false
}
]
lang: "zh",
demoData: {},
candidateUsers: [],
candidateGroups: []
}
},
methods: {
createWorkflowStep() {
this.form.workflowStep.push({
isEnd: false,
isStrat: false,
stepAuthorityID: '',
stepName: '',
stepNo: ''
})
},
async submit() {
const res = await createWorkFlow(this.form)
if(res.code == 0){
this.$message({
message:"创建成功",
type:"success"
})
}
methods:{
save(){
console.log(this.$refs['wfd'].graph.save())
}
}
}
</script>
<style>
</style>
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册