diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 18b2a3ed..302ecd1a 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -1,11 +1,11 @@ -# 页面标题 -VUE_APP_TITLE = 若依管理系统 - -# 开发环境配置 -ENV = 'development' - -# 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' - -# 路由懒加载 -VUE_CLI_BABEL_TRANSPILE_MODULES = true +# 页面标题 +VUE_APP_TITLE = 若依管理系统 + +# 开发环境配置 +ENV = 'development' + +# 若依管理系统/开发环境 +VUE_APP_BASE_API = '/dev-api' + +# 路由懒加载 +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 6cebf701..0e77a613 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,90 +1,92 @@ -{ - "name": "ruoyi", - "version": "3.6.1", - "description": "若依管理系统", - "author": "若依", - "license": "MIT", - "scripts": { - "dev": "vue-cli-service serve", - "build:prod": "vue-cli-service build", - "build:stage": "vue-cli-service build --mode staging", - "preview": "node build/index.js --preview", - "lint": "eslint --ext .js,.vue src" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "src/**/*.{js,vue}": [ - "eslint --fix", - "git add" - ] - }, - "keywords": [ - "vue", - "admin", - "dashboard", - "element-ui", - "boilerplate", - "admin-template", - "management-system" - ], - "repository": { - "type": "git", - "url": "https://gitee.com/y_project/RuoYi-Cloud.git" - }, - "dependencies": { - "@riophae/vue-treeselect": "0.4.0", - "axios": "0.24.0", - "clipboard": "2.0.8", - "core-js": "3.25.3", - "echarts": "4.9.0", - "element-ui": "2.15.10", - "file-saver": "2.0.5", - "fuse.js": "6.4.3", - "highlight.js": "9.18.5", - "js-beautify": "1.13.0", - "js-cookie": "3.0.1", - "jsencrypt": "3.0.0-rc.1", - "nprogress": "0.2.0", - "quill": "1.3.7", - "screenfull": "5.0.2", - "sortablejs": "1.10.2", - "vue": "2.6.12", - "vue-count-to": "1.0.13", - "vue-cropper": "0.5.5", - "vue-meta": "2.4.0", - "vue-router": "3.4.9", - "vuedraggable": "2.24.3", - "vuex": "3.6.0" - }, - "devDependencies": { - "@vue/cli-plugin-babel": "4.4.6", - "@vue/cli-plugin-eslint": "4.4.6", - "@vue/cli-service": "4.4.6", - "babel-eslint": "10.1.0", - "babel-plugin-dynamic-import-node": "2.3.3", - "chalk": "4.1.0", - "compression-webpack-plugin": "5.0.2", - "connect": "3.6.6", - "eslint": "7.15.0", - "eslint-plugin-vue": "7.2.0", - "lint-staged": "10.5.3", - "runjs": "4.4.2", - "sass": "1.32.13", - "sass-loader": "10.1.1", - "script-ext-html-webpack-plugin": "2.1.5", - "svg-sprite-loader": "5.1.1", - "vue-template-compiler": "2.6.12" - }, - "engines": { - "node": ">=8.9", - "npm": ">= 3.0.0" - }, - "browserslist": [ - "> 1%", - "last 2 versions" - ] -} +{ + "name": "ruoyi", + "version": "3.6.1", + "description": "若依管理系统", + "author": "若依", + "license": "MIT", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "lint": "eslint --ext .js,.vue src" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "src/**/*.{js,vue}": [ + "eslint --fix", + "git add" + ] + }, + "keywords": [ + "vue", + "admin", + "dashboard", + "element-ui", + "boilerplate", + "admin-template", + "management-system" + ], + "repository": { + "type": "git", + "url": "https://gitee.com/y_project/RuoYi-Cloud.git" + }, + "dependencies": { + "@riophae/vue-treeselect": "0.4.0", + "axios": "0.24.0", + "bpmn-js": "^7.2.1", + "clipboard": "2.0.8", + "core-js": "3.25.3", + "echarts": "4.9.0", + "element-ui": "2.15.10", + "file-saver": "2.0.5", + "fuse.js": "6.4.3", + "highlight.js": "9.18.5", + "js-beautify": "1.13.0", + "js-cookie": "3.0.1", + "jsencrypt": "3.0.0-rc.1", + "nprogress": "0.2.0", + "quill": "1.3.7", + "screenfull": "5.0.2", + "sortablejs": "1.10.2", + "vue": "2.6.12", + "vue-count-to": "1.0.13", + "vue-cropper": "0.5.5", + "vue-meta": "2.4.0", + "vue-router": "3.4.9", + "vuedraggable": "2.24.3", + "vuex": "3.6.0", + "workflow-bpmn-modeler": "^0.2.8" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.6", + "@vue/cli-plugin-eslint": "4.4.6", + "@vue/cli-service": "4.4.6", + "babel-eslint": "10.1.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "4.1.0", + "compression-webpack-plugin": "5.0.2", + "connect": "3.6.6", + "eslint": "7.15.0", + "eslint-plugin-vue": "7.2.0", + "lint-staged": "10.5.3", + "runjs": "4.4.2", + "sass": "1.32.13", + "sass-loader": "10.1.1", + "script-ext-html-webpack-plugin": "2.1.5", + "svg-sprite-loader": "5.1.1", + "vue-template-compiler": "2.6.12" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} diff --git a/ruoyi-ui/src/api/demo/demo.js b/ruoyi-ui/src/api/demo/demo.js new file mode 100644 index 00000000..04d40256 --- /dev/null +++ b/ruoyi-ui/src/api/demo/demo.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 查询测试单表列表 +export function listDemo(query) { + return request({ + url: '/demo/demo/list', + method: 'get', + params: query + }) +} + +// 自定义分页接口 +export function pageDemo(query) { + return request({ + url: '/demo/demo/page', + method: 'get', + params: query + }) +} + +// 查询测试单表详细 +export function getDemo(id) { + return request({ + url: '/demo/demo/' + id, + method: 'get' + }) +} + +// 新增测试单表 +export function addDemo(data) { + return request({ + url: '/demo/demo', + method: 'post', + data: data + }) +} + +// 修改测试单表 +export function updateDemo(data) { + return request({ + url: '/demo/demo', + method: 'put', + data: data + }) +} + +// 删除测试单表 +export function delDemo(id) { + return request({ + url: '/demo/demo/' + id, + method: 'delete' + }) +} + diff --git a/ruoyi-ui/src/api/demo/leave.js b/ruoyi-ui/src/api/demo/leave.js new file mode 100644 index 00000000..aba149c3 --- /dev/null +++ b/ruoyi-ui/src/api/demo/leave.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询请假业务列表 +export function listLeave(query) { + return request({ + url: '/demo/leave/list', + method: 'get', + params: query + }) +} + +// 查询请假业务详细 +export function getLeave(id) { + return request({ + url: '/demo/leave/' + id, + method: 'get' + }) +} + +// 新增请假业务 +export function addLeave(data) { + return request({ + url: '/demo/leave', + method: 'post', + data: data + }) +} + +// 修改请假业务 +export function updateLeave(data) { + return request({ + url: '/demo/leave', + method: 'put', + data: data + }) +} + +// 删除请假业务 +export function delLeave(id) { + return request({ + url: '/demo/leave/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/demo/tree.js b/ruoyi-ui/src/api/demo/tree.js new file mode 100644 index 00000000..4c7ebc07 --- /dev/null +++ b/ruoyi-ui/src/api/demo/tree.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询测试树表列表 +export function listTree(query) { + return request({ + url: '/demo/tree/list', + method: 'get', + params: query + }) +} + +// 查询测试树表详细 +export function getTree(id) { + return request({ + url: '/demo/tree/' + id, + method: 'get' + }) +} + +// 新增测试树表 +export function addTree(data) { + return request({ + url: '/demo/tree', + method: 'post', + data: data + }) +} + +// 修改测试树表 +export function updateTree(data) { + return request({ + url: '/demo/tree', + method: 'put', + data: data + }) +} + +// 删除测试树表 +export function delTree(id) { + return request({ + url: '/demo/tree/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/actNodeAssginee.js b/ruoyi-ui/src/api/workflow/actNodeAssginee.js new file mode 100644 index 00000000..304bdec2 --- /dev/null +++ b/ruoyi-ui/src/api/workflow/actNodeAssginee.js @@ -0,0 +1,31 @@ +import request from "@/utils/request"; + +export function add(data) { + return request({ + url: '/workflow/actNodeAssignee', + method: 'post', + data: data + }) +} + +export function del(id) { + return request({ + url: '/workflow/actNodeAssignee/'+id, + method: 'delete' + }) +} + +export function getInfoSetting(processDefinitionId,nodeId) { + return request({ + url: `/workflow/actNodeAssignee/${processDefinitionId}/${nodeId}`, + method: 'get' + }) +} + +export function copy(processDefinitionId,key) { + return request({ + url: `/workflow/actNodeAssignee/copy/${processDefinitionId}/${key}`, + method: 'post' + }) +} + diff --git a/ruoyi-ui/src/api/workflow/businessForm.js b/ruoyi-ui/src/api/workflow/businessForm.js new file mode 100644 index 00000000..071b0b5b --- /dev/null +++ b/ruoyi-ui/src/api/workflow/businessForm.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询业务表单列表 +export function listBusinessForm(query) { + return request({ + url: '/workflow/businessForm/list', + method: 'get', + params: query + }) +} + +// 查询业务表单详细 +export function getBusinessForm(id) { + return request({ + url: '/workflow/businessForm/' + id, + method: 'get' + }) +} + +// 新增业务表单 +export function addBusinessForm(data) { + return request({ + url: '/workflow/businessForm', + method: 'post', + data: data + }) +} + +// 修改业务表单 +export function updateBusinessForm(data) { + return request({ + url: '/workflow/businessForm', + method: 'put', + data: data + }) +} + +// 删除业务表单 +export function delBusinessForm(id) { + return request({ + url: '/workflow/businessForm/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/businessRule.js b/ruoyi-ui/src/api/workflow/businessRule.js new file mode 100644 index 00000000..4a6a8974 --- /dev/null +++ b/ruoyi-ui/src/api/workflow/businessRule.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询业务规则列表 +export function listBusinessRule(query) { + return request({ + url: '/workflow/businessRule/list', + method: 'get', + params: query + }) +} + +// 查询业务规则详细 +export function getBusinessRule(id) { + return request({ + url: '/workflow/businessRule/' + id, + method: 'get' + }) +} + +// 新增业务规则 +export function addbusinessRule(data) { + return request({ + url: '/workflow/businessRule', + method: 'post', + data: data + }) +} + +// 修改业务规则 +export function updateBusinessRule(data) { + return request({ + url: '/workflow/businessRule', + method: 'put', + data: data + }) +} + +// 删除业务规则 +export function delBusinessRule(id) { + return request({ + url: '/workflow/businessRule/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/definition.js b/ruoyi-ui/src/api/workflow/definition.js new file mode 100644 index 00000000..8f404a77 --- /dev/null +++ b/ruoyi-ui/src/api/workflow/definition.js @@ -0,0 +1,90 @@ +import request from "@/utils/request"; +/** + * 分页查询 + * @param {条件} query + * @returns + */ +export function list(query) { + return request({ + url: '/workflow/definition/list', + method: 'get', + params: query + }) +} + +/** + * 分页查询 + * @param {条件} query + * @returns + */ + export function hisList(query) { + return request({ + url: '/workflow/definition/hisList', + method: 'get', + params: query + }) +} + +/** + * + * @param {参数} data + * @returns + */ +export function updateProcDefState(data) { + return request({ + url: '/workflow/definition/updateProcDefState', + method: 'put', + data: data + }) +} + +/** + * 按流程部署id删除 + * @param {流程部署id} deploymentId + * @returns + */ + export function del(deploymentId,definitionId) { + return request({ + url: `/workflow/definition/${deploymentId}/${definitionId}`, + method: 'delete' + }) +} + +/** + * 通过zip或xml部署流程定义 + * @returns + */ +export function deployProcessFile(data) { + return request({ + url: '/workflow/definition/deployByFile', + method: 'post', + data: data + }) +} + +/** + * + * @param {流程定义设置} definitionId + * @returns + */ +export function setting(definitionId) { + return request({ + url: '/workflow/definition/setting/'+definitionId, + method: 'get' + }) +} + +/** + * + * @param {查看xml} definitionId + * @returns + */ +export function getXml(definitionId) { + return request({ + url: '/workflow/definition/getXml/'+definitionId, + method: 'get' + }) +} + + + diff --git a/ruoyi-ui/src/api/workflow/dynamicForm.js b/ruoyi-ui/src/api/workflow/dynamicForm.js new file mode 100644 index 00000000..c95bff15 --- /dev/null +++ b/ruoyi-ui/src/api/workflow/dynamicForm.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 查询流程单列表 +export function listDynamicForm(query) { + return request({ + url: '/workflow/dynamicForm/list', + method: 'get', + params: query + }) +} + +// 查询启用流程单列表 +export function listDynamicFormEnable(query) { + return request({ + url: '/workflow/dynamicForm/enableList', + method: 'get', + params: query + }) +} + +// 查询流程单详细 +export function getDynamicForm(id) { + return request({ + url: '/workflow/dynamicForm/' + id, + method: 'get' + }) +} + +// 新增流程单 +export function addDynamicForm(data) { + return request({ + url: '/workflow/dynamicForm', + method: 'post', + data: data + }) +} + +// 修改流程单 +export function updateDynamicForm(data) { + return request({ + url: '/workflow/dynamicForm', + method: 'put', + data: data + }) +} + +// 修改流程单 +export function editForm(data) { + return request({ + url: '/workflow/dynamicForm/editForm', + method: 'put', + data: data + }) +} + +// 删除流程单 +export function delDynamicForm(id) { + return request({ + url: '/workflow/dynamicForm/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/message.js b/ruoyi-ui/src/api/workflow/message.js new file mode 100644 index 00000000..167d1a1d --- /dev/null +++ b/ruoyi-ui/src/api/workflow/message.js @@ -0,0 +1,68 @@ +import request from '@/utils/request' + +// 查询消息通知列表 +export function listMessage(query) { + return request({ + url: '/workflow/message/list', + method: 'get', + params: query + }) +} + +// 获取个人站内信 +export function listWaitingMessage() { + return request({ + url: '/workflow/message/waitingMessage', + method: 'get' + }) +} + +// 查询消息通知详细 +export function getMessage(id) { + return request({ + url: '/workflow/message/' + id, + method: 'get' + }) +} + +// 新增消息通知 +export function addMessage(data) { + return request({ + url: '/workflow/message', + method: 'post', + data: data + }) +} + +// 修改消息通知 +export function updateMessage(data) { + return request({ + url: '/workflow/message', + method: 'put', + data: data + }) +} + +// 删除消息通知 +export function delMessage(id) { + return request({ + url: '/workflow/message/' + id, + method: 'delete' + }) +} + +// 阅读消息 +export function readMessage(id) { + return request({ + url: '/workflow/message/readMessage/' + id, + method: 'get' + }) +} + +// 批量阅读消息 +export function batchReadMessage(id) { + return request({ + url: '/workflow/message/batchReadMessage', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/workflow/model.js b/ruoyi-ui/src/api/workflow/model.js new file mode 100644 index 00000000..ea605f1e --- /dev/null +++ b/ruoyi-ui/src/api/workflow/model.js @@ -0,0 +1,110 @@ +import request from "@/utils/request"; +/** + * 分页查询 + * @param {条件} query + * @returns + */ +export function list(query) { + return request({ + url: '/workflow/model/list', + method: 'get', + params: query + }) +} + +/** + * 新增模型定义 + * @param {传输的数据}} data + * @returns + */ +export function add(data) { + return request({ + url: '/workflow/model', + method: 'post', + data: data + }) +} + +/** + * 按id删除模型 + * @param {模型id} id + * @returns + */ +export function del(id) { + return request({ + url: '/workflow/model/' + id, + method: 'delete' + }) +} + +/** + * 流程部署 + * @param {模型id} id + * @returns + */ +export function deploy(id) { + return request({ + url: '/workflow/model/deploy/' + id, + method: 'post' + }) +} +/** + * 将流程定义转换为模型 + * @param {流程定义id} processDefinitionId + * @returns + */ + export function convertToModel(processDefinitionId) { + return request({ + url: '/workflow/model/convertToModel/' + processDefinitionId, + method: 'put' + }) +} + +/** + * 查询模型xml + * @param {模型id} modelId + * @returns + */ +export function getEditorXml(modelId) { + return request({ + url: `workflow/model/getInfo/${modelId}/xml`, + method: 'get' + }) +} + +/** + * 保存模型 + * @param {参数} data + * @returns + */ +export function saveModelXml(data) { + return request({ + url: `workflow/model`, + method: 'put', + data: data + }) +} + + +export function getModelInfo(modelId) { + return request({ + url: `model/${modelId}/json`, + method: 'get' + }) +} + +export function newModel(data) { + return request({ + url: `model/newModel`, + method: 'post', + data: data + }) +} + +export function editModelInfo(modelId,data) { + return request({ + url: `/model/${modelId}/save`, + method: 'put', + data: data + }) +} diff --git a/ruoyi-ui/src/api/workflow/processDefSetting.js b/ruoyi-ui/src/api/workflow/processDefSetting.js new file mode 100644 index 00000000..d1fb241b --- /dev/null +++ b/ruoyi-ui/src/api/workflow/processDefSetting.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询流程定义与单配置列表 +export function listProcessDefSetting(query) { + return request({ + url: '/workflow/processDefSetting/list', + method: 'get', + params: query + }) +} + +// 查询流程定义与单配置详细 +export function getProcessDefSetting(id) { + return request({ + url: '/workflow/processDefSetting/' + id, + method: 'get' + }) +} + +// 按流程定义id查询流程定义与单配置详细 +export function getProcessDefSettingByDefId(id) { + return request({ + url: '/workflow/processDefSetting/getProcessDefSettingByDefId/' + id, + method: 'get' + }) +} + +// 校验表单是否关联 +export function checkProcessDefSetting(defId,param,businessType) { + return request({ + url: `/workflow/processDefSetting/checkProcessDefSetting/${defId}/${param}/${businessType}` , + method: 'get' + }) +} + +// 新增流程定义与单配置 +export function addProcessDefSetting(data) { + return request({ + url: '/workflow/processDefSetting', + method: 'post', + data: data + }) +} + +// 修改流程定义与单配置 +export function updateProcessDefSetting(data) { + return request({ + url: '/workflow/processDefSetting', + method: 'put', + data: data + }) +} + +// 删除流程定义与单配置 +export function delProcessDefSetting(id) { + return request({ + url: '/workflow/processDefSetting/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/processInst.js b/ruoyi-ui/src/api/workflow/processInst.js new file mode 100644 index 00000000..bd733b6c --- /dev/null +++ b/ruoyi-ui/src/api/workflow/processInst.js @@ -0,0 +1,92 @@ +import request from '@/utils/request' + +export default { + // 提交申请 ,启动流程申请 + startProcessApply(data) { + return request({ + url: '/workflow/processInstance/startWorkFlow', + method: 'post', + data: data + }) + }, + + // 通过流程实例id查询流程审批记录 + getHistoryInfoList(processInstId) { + return request({ + url: '/workflow/processInstance/getHistoryInfoList/'+processInstId, + method: 'get' + }) + }, + + // 通过流程实例id获取历史流程图 + getHistoryProcessImage(processInstId) { + return process.env.VUE_APP_BASE_API+`/workflow/processInstance/getHistoryProcessImage?processInstId=${processInstId}&t=` + Math.random() + }, + + // 通过业务id查询流程实例 + getInfoByBusinessKey(businessKey) { + return request({ + url: '/workflow/actBusiness/getInfoByBusinessKey/'+businessKey, + method: 'get' + }) + }, + + // 查询正在运行的流程实例 + getProcessInstRunningByPage(query) { + return request({ + url: '/workflow/processInstance/getProcessInstRunningByPage', + method: 'get', + params: query + }) + }, + + // 挂起或激活流程实例 + state(data) { + return request({ + url: '/workflow/processInstance/state', + method: 'put', + data: data + }) + }, + + // 作废流程实例,不会删除历史记录 + deleteRuntimeProcessInst(processInstId) { + return request({ + url: '/workflow/processInstance/deleteRuntimeProcessInst/'+processInstId, + method: 'delete' + }) + }, + + // 删除运行中的实例,删除历史记录,删除业务与流程关联信息 + deleteRuntimeProcessAndHisInst(processInstId) { + return request({ + url: '/workflow/processInstance/deleteRuntimeProcessAndHisInst/'+processInstId, + method: 'delete' + }) + }, + + // 删除已完成的实例,删除历史记录,删除业务与流程关联信息 + deleteFinishProcessAndHisInst(processInstId) { + return request({ + url: '/workflow/processInstance/deleteFinishProcessAndHisInst/'+processInstId, + method: 'delete' + }) + }, + + // 撤销申请 + cancelProcessApply(processInstanceId) { + return request({ + url: '/workflow/processInstance/cancelProcessApply/'+processInstanceId, + method: 'get' + }) + }, + + // 查询已完成的流程实例 + getProcessInstFinishByPage(query) { + return request({ + url: '/workflow/processInstance/getProcessInstFinishByPage', + method: 'get', + params: query + }) + } +} diff --git a/ruoyi-ui/src/api/workflow/task.js b/ruoyi-ui/src/api/workflow/task.js new file mode 100644 index 00000000..68e522bb --- /dev/null +++ b/ruoyi-ui/src/api/workflow/task.js @@ -0,0 +1,151 @@ +import request from '@/utils/request' + +export default { + + // 查询当前用户的待办任务 + getTaskWaitByPage(query) { + return request({ + url: '/workflow/task/getTaskWaitByPage', + method: 'get', + params: query + }) + }, + + // 查询当前用户的已办任务 + getTaskFinishByPage(query) { + return request({ + url: '/workflow/task/getTaskFinishByPage', + method: 'get', + params: query + }) + }, + + // 查询所有用户的待办任务 + getAllTaskWaitByPage(query) { + return request({ + url: '/workflow/task/getAllTaskWaitByPage', + method: 'get', + params: query + }) + }, + + // 查询所有用户的已办任务 + getAllTaskFinishByPage(query) { + return request({ + url: '/workflow/task/getAllTaskFinishByPage', + method: 'get', + params: query + }) + }, + + // 完成任务 + completeTask(data) { + return request({ + url: '/workflow/task/completeTask', + method: 'post', + data: data + }) + }, + + // 获取目标节点(下一个节点) + getNextNodeInfo(data) { + return request({ + url: '/workflow/task/getNextNodeInfo', + method: 'post', + data: data + }) + }, + + // 获取历史任务节点,用于驳回功能 + getBackNodes(processInstId) { + return request({ + url: '/workflow/task/getBackNodes/'+processInstId, + method: 'get' + }) + }, + + // 驳回审批 + backProcess(data) { + return request({ + url: '/workflow/task/backProcess', + method: 'post', + data: data + }) + }, + // 删除执行后的节点 + deleteByNodeIds(data) { + return request({ + url: '/workflow/task/deleteByNodeIds', + method: 'post', + data: data + }) + }, + // 签收任务 + claim(taskId) { + return request({ + url: '/workflow/task/claim/'+taskId, + method: 'post' + }) + }, + // 归还任务 + returnTask(taskId) { + return request({ + url: '/workflow/task/returnTask/'+taskId, + method: 'post' + }) + }, + // 委托任务 + delegateTask(data) { + return request({ + url: '/workflow/task/delegateTask', + method: 'post', + data: data + }) + }, + // 转办任务 + transmitTask(data) { + return request({ + url: '/workflow/task/transmitTask', + method: 'post', + data: data + }) + }, + // 会签任务加签 + addMultiInstanceExecution(data) { + return request({ + url: '/workflow/task/addMultiInstanceExecution', + method: 'post', + data: data + }) + }, + // 会签任务减签 + deleteMultiInstanceExecution(data) { + return request({ + url: '/workflow/task/deleteMultiInstanceExecution', + method: 'post', + data: data + }) + }, + // 会签任务减签 + updateAssignee(data) { + return request({ + url: '/workflow/task/updateAssignee', + method: 'post', + data: data + }) + }, + //查询流程变量 + getProcessInstVariable(taskId) { + return request({ + url: '/workflow/task/getProcessInstVariable/'+taskId, + method: 'get' + }) + }, + //修改审批意见 + editComment(commentId,comment) { + return request({ + url: `/workflow/task/editComment/${commentId}/${comment}`, + method: 'put' + }) + } +} diff --git a/ruoyi-ui/src/api/workflow/workflowUser.js b/ruoyi-ui/src/api/workflow/workflowUser.js new file mode 100644 index 00000000..3131802c --- /dev/null +++ b/ruoyi-ui/src/api/workflow/workflowUser.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 查询工作流接口用户 +export function getWorkflowUserListByPage(data) { + return request({ + url: '/workflow/user/getWorkflowUserListByPage', + method: 'post', + data: data + }) +} +// 分页查询工作流选择加签人员 +export function getWorkflowAddMultiListByPage(data) { + return request({ + url: '/workflow/user/getWorkflowAddMultiListByPage', + method: 'post', + data: data + }) +} diff --git a/ruoyi-ui/src/assets/img/home/home_bg.png b/ruoyi-ui/src/assets/img/home/home_bg.png new file mode 100644 index 00000000..d0edd455 Binary files /dev/null and b/ruoyi-ui/src/assets/img/home/home_bg.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/module_header_left.png b/ruoyi-ui/src/assets/img/work/custInfo/module_header_left.png new file mode 100644 index 00000000..20054cef Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/module_header_left.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/module_header_share.png b/ruoyi-ui/src/assets/img/work/custInfo/module_header_share.png new file mode 100644 index 00000000..4d0c2017 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/module_header_share.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBground.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBground.png new file mode 100644 index 00000000..59b31c07 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBground.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBgroundSigle.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBgroundSigle.png new file mode 100644 index 00000000..8ff31dde Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverviewBgroundSigle.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk1.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk1.png new file mode 100644 index 00000000..e7b52009 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk1.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk2.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk2.png new file mode 100644 index 00000000..a5264b16 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk2.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk3.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk3.png new file mode 100644 index 00000000..a4fc9532 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk3.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk4.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk4.png new file mode 100644 index 00000000..726f1a84 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_iconRisk4.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_sigh.png b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_sigh.png new file mode 100644 index 00000000..10c6cff3 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/riskOverview_sigh.png differ diff --git a/ruoyi-ui/src/assets/img/work/custInfo/warning.png b/ruoyi-ui/src/assets/img/work/custInfo/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/custInfo/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/duty/warning.png b/ruoyi-ui/src/assets/img/work/duty/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/duty/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/loan/warning.png b/ruoyi-ui/src/assets/img/work/loan/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/loan/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/process/warning.png b/ruoyi-ui/src/assets/img/work/process/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/process/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/product/warning.png b/ruoyi-ui/src/assets/img/work/product/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/product/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/risk/warning.png b/ruoyi-ui/src/assets/img/work/risk/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/risk/warning.png differ diff --git a/ruoyi-ui/src/assets/img/work/touch/warning.png b/ruoyi-ui/src/assets/img/work/touch/warning.png new file mode 100644 index 00000000..1afe0773 Binary files /dev/null and b/ruoyi-ui/src/assets/img/work/touch/warning.png differ diff --git a/ruoyi-ui/src/components/Bpmn/package/BpmData.js b/ruoyi-ui/src/components/Bpmn/package/BpmData.js new file mode 100644 index 00000000..672ca449 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/BpmData.js @@ -0,0 +1,68 @@ +/** + * 存储流程设计相关参数 + */ +export default class BpmData { + constructor() { + this.controls = [] // 设计器控件 + this.init() + } + + init() { + this.controls = [ + { + action: 'create.start-event', + title: '开始' + }, + { + action: 'create.intermediate-event', + title: '中间' + }, + { + action: 'create.end-event', + title: '结束' + }, + { + action: 'create.exclusive-gateway', + title: '网关' + }, + { + action: 'create.task', + title: '任务' + }, + { + action: 'create.user-task', + title: '用户任务' + }, + { + action: 'create.user-sign-task', + title: '会签任务' + }, + { + action: 'create.subprocess-expanded', + title: '子流程' + }, + { + action: 'create.data-object', + title: '数据对象' + }, + { + action: 'create.data-store', + title: '数据存储' + }, + { + action: 'create.participant-expanded', + title: '扩展流程' + }, + { + action: 'create.group', + title: '分组' + } + ] + } + + // 获取控件配置信息 + getControl(action) { + const result = this.controls.filter(item => item.action === action) + return result[0] || {} + } +} diff --git a/ruoyi-ui/src/components/Bpmn/package/PropertyPanel.vue b/ruoyi-ui/src/components/Bpmn/package/PropertyPanel.vue new file mode 100644 index 00000000..3ca31a53 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/PropertyPanel.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/common/customTranslate.js b/ruoyi-ui/src/components/Bpmn/package/common/customTranslate.js new file mode 100644 index 00000000..fa05f9d6 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/common/customTranslate.js @@ -0,0 +1,20 @@ +import translations from '../lang/zh' + +export default function customTranslate(template, replacements) { + replacements = replacements || {} + + // Translate + template = translations[template] || template + + // Replace + return template.replace(/{([^}]+)}/g, function(_, key) { + var str = replacements[key] + if ( + translations[replacements[key]] !== null && + translations[replacements[key]] !== 'undefined' + ) { + str = translations[replacements[key]] + } + return str || '{' + key + '}' + }) +} diff --git a/ruoyi-ui/src/components/Bpmn/package/common/mixinExecutionListener.js b/ruoyi-ui/src/components/Bpmn/package/common/mixinExecutionListener.js new file mode 100644 index 00000000..23295b00 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/common/mixinExecutionListener.js @@ -0,0 +1,24 @@ + +import executionListenerDialog from '../components/nodePanel/property/executionListener' +export default { + components: { + executionListenerDialog + }, + data() { + return { + executionListenerLength: 0, + dialogName: null + } + }, + methods: { + computedExecutionListenerLength() { + this.executionListenerLength = this.element.businessObject.extensionElements?.values?.length ?? 0 + }, + finishExecutionListener() { + if (this.dialogName === 'executionListenerDialog') { + this.computedExecutionListenerLength() + } + this.dialogName = '' + } + } +} diff --git a/ruoyi-ui/src/components/Bpmn/package/common/mixinPanel.js b/ruoyi-ui/src/components/Bpmn/package/common/mixinPanel.js new file mode 100644 index 00000000..8686b983 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/common/mixinPanel.js @@ -0,0 +1,70 @@ +import xcrud from 'xcrud' +import golbalConfig from 'xcrud/package/common/config' +import showConfig from '../flowable/showConfig' +golbalConfig.set({ + input: { + // size: 'mini' + }, + select: { + // size: 'mini' + }, + colorPicker: { + showAlpha: true + }, + xform: { + form: { + labelWidth: 'auto' + // size: 'mini' + } + } +}) +export default { + components: { xForm: xcrud.xForm }, + props: { + modeler: { + type: Object, + required: true + }, + element: { + type: Object, + required: true + }, + categorys: { + type: Array, + default: () => [] + } + }, + watch: { + 'formData.id': function(val) { + this.updateProperties({ id: val }) + }, + 'formData.name': function(val) { + this.updateProperties({ name: val }) + }, + 'formData.documentation': function(val) { + if (!val) { + this.updateProperties({ documentation: [] }) + return + } + const documentationElement = this.modeler.get('moddle').create('bpmn:Documentation', { text: val }) + this.updateProperties({ documentation: [documentationElement] }) + } + }, + methods: { + updateProperties(properties) { + const modeling = this.modeler.get('modeling') + modeling.updateProperties(this.element, properties) + } + }, + computed: { + elementType() { + const bizObj = this.element.businessObject + return bizObj.eventDefinitions + ? bizObj.eventDefinitions[0].$type + : bizObj.$type + }, + showConfig() { + return showConfig[this.elementType] || {} + } + } +} diff --git a/ruoyi-ui/src/components/Bpmn/package/common/mixinXcrud.js b/ruoyi-ui/src/components/Bpmn/package/common/mixinXcrud.js new file mode 100644 index 00000000..1f7ee5b5 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/common/mixinXcrud.js @@ -0,0 +1,22 @@ +import xcrud from 'xcrud' +import golbalConfig from 'xcrud/package/common/config' +golbalConfig.set({ + input: { + // size: 'mini' + }, + select: { + // size: 'mini' + }, + colorPicker: { + showAlpha: true + }, + xform: { + form: { + labelWidth: 'auto' + // size: 'mini' + } + } +}) +export default { + components: { xForm: xcrud.xForm } +} diff --git a/ruoyi-ui/src/components/Bpmn/package/common/parseElement.js b/ruoyi-ui/src/components/Bpmn/package/common/parseElement.js new file mode 100644 index 00000000..63cf336e --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/common/parseElement.js @@ -0,0 +1,53 @@ +export function commonParse(element) { + const result = { + ...element.businessObject, + ...element.businessObject.$attrs + } + return formatJsonKeyValue(result) +} + +export function formatJsonKeyValue(result) { + // 移除flowable前缀,格式化数组 + for (const key in result) { + if (key.indexOf('flowable:') === 0) { + const newKey = key.replace('flowable:', '') + result[newKey] = result[key] + delete result[key] + } + } + result = documentationParse(result) + return result +} + +export function documentationParse(obj) { + if ('documentation' in obj) { + let str = '' + obj.documentation.forEach(item => { + str += item.text + }) + obj.documentation = str + } + return obj +} + +export function conditionExpressionParse(obj) { + if ('conditionExpression' in obj) { + obj.conditionExpression = obj.conditionExpression.body + } + return obj +} + +export function userTaskParse(obj) { + for (const key in obj) { + if (key === 'candidateUsers') { + obj.userType = 'candidateUsers' + obj[key] = obj[key]?.split(',') || [] + } else if (key === 'candidateGroups') { + obj.userType = 'candidateGroups' + obj[key] = obj[key]?.split(',') || [] + } else if (key === 'assignee') { + obj.userType = 'assignee' + } + } + return obj +} diff --git a/ruoyi-ui/src/components/Bpmn/package/components/custom/customContextPad.vue b/ruoyi-ui/src/components/Bpmn/package/components/custom/customContextPad.vue new file mode 100644 index 00000000..89c2f684 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/custom/customContextPad.vue @@ -0,0 +1,24 @@ +export default class CustomContextPad { + constructor(config, contextPad, create, elementFactory, injector, translate) { + this.create = create; + this.elementFactory = elementFactory; + this.translate = translate; + + if (config.autoPlace !== false) { + this.autoPlace = injector.get('autoPlace', false); + } + + contextPad.registerProvider(this); // 定义这是一个contextPad + } + + getContextPadEntries(element) {} +} + +CustomContextPad.$inject = [ + 'config', + 'contextPad', + 'create', + 'elementFactory', + 'injector', + 'translate' +]; diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/gateway.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/gateway.vue new file mode 100644 index 00000000..db181531 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/gateway.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/process.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/process.vue new file mode 100644 index 00000000..6498d481 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/process.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/executionListener.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/executionListener.vue new file mode 100644 index 00000000..df105f93 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/executionListener.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/listenerParam.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/listenerParam.vue new file mode 100644 index 00000000..2e0f8b10 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/listenerParam.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/multiInstance.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/multiInstance.vue new file mode 100644 index 00000000..49eb06c3 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/multiInstance.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/signal.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/signal.vue new file mode 100644 index 00000000..781c24d2 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/signal.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/taskListener.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/taskListener.vue new file mode 100644 index 00000000..7f1b56e7 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/property/taskListener.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/sequenceFlow.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/sequenceFlow.vue new file mode 100644 index 00000000..178cd7d4 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/sequenceFlow.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/startEnd.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/startEnd.vue new file mode 100644 index 00000000..f16fe226 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/startEnd.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/task.vue b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/task.vue new file mode 100644 index 00000000..053fe673 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/components/nodePanel/task.vue @@ -0,0 +1,376 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/flowable/flowable.json b/ruoyi-ui/src/components/Bpmn/package/flowable/flowable.json new file mode 100644 index 00000000..bffad659 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/flowable/flowable.json @@ -0,0 +1,1194 @@ +{ + "name": "Flowable", + "uri": "http://flowable.org/bpmn", + "prefix": "flowable", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "flowable:in", + "superClass": ["Element"], + "properties": [ + { + "name": "source", + "type": "string", + "isAttr": true + }, + { + "name": "target", + "type": "string", + "isAttr": true + } + ] + }, + { + "name": "flowable:out", + "superClass": ["Element"], + "properties": [ + { + "name": "source", + "type": "string", + "isAttr": true + }, + { + "name": "target", + "type": "string", + "isAttr": true + } + ] + }, + { + "name": "BoundaryEvent", + "superClass": ["CatchEvent"], + "properties": [ + { + "name": "cancelActivity", + "default": true, + "isAttr": true, + "type": "Boolean" + }, + { + "name": "attachedToRef", + "type": "Activity", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "flowable:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "flowable:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "UserTask", + "isAbstract": true, + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "timerEventDefinition", + "type": "Expression" + }, + { + "name": "multiInstanceLoopCharacteristics", + "type": "MultiInstanceLoopCharacteristics" + } + ] + }, + { + "name": "StartEvent", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "timerEventDefinition", + "type": "Expression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExclusiveGateway", + "isAbstract": true, + "extends": ["bpmn:ExclusiveGateway"], + "properties": [ + { + "name": "serviceClass", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["flowable:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "flowable:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "flowable:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:ServiceTaskLike", + "flowable:ExecutionListener", + "flowable:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "isAttr": true, + "type": "expression" + }, + { + "name": "string", + "type": "string" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "string", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:Field" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "expression", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:Field" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["flowable:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SequenceFlow", + "superClass": ["FlowElement"], + "properties": [ + { + "name": "isImmediate", + "isAttr": true, + "type": "Boolean" + }, + { + "name": "conditionExpression", + "type": "Expression" + }, + { + "name": "sourceRef", + "type": "FlowNode", + "isAttr": true, + "isReference": true + }, + { + "name": "targetRef", + "type": "FlowNode", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "MultiInstanceLoopCharacteristics", + "superClass": ["LoopCharacteristics"], + "properties": [ + { + "name": "isSequential", + "default": false, + "isAttr": true, + "type": "Boolean" + }, + { + "name": "behavior", + "type": "MultiInstanceBehavior", + "default": "All", + "isAttr": true + }, + { + "name": "loopCardinality", + "type": "Expression", + "xml": { + "serialize": "xsi:type" + } + }, + { + "name": "loopDataInputRef", + "type": "ItemAwareElement", + "isReference": true + }, + { + "name": "loopDataOutputRef", + "type": "ItemAwareElement", + "isReference": true + }, + { + "name": "inputDataItem", + "type": "DataInput", + "xml": { + "serialize": "property" + } + }, + { + "name": "outputDataItem", + "type": "DataOutput", + "xml": { + "serialize": "property" + } + }, + { + "name": "complexBehaviorDefinition", + "type": "ComplexBehaviorDefinition", + "isMany": true + }, + { + "name": "completionCondition", + "type": "Expression", + "xml": { + "serialize": "xsi:type" + } + }, + { + "name": "oneBehaviorEventRef", + "type": "EventDefinition", + "isAttr": true, + "isReference": true + }, + { + "name": "noneBehaviorEventRef", + "type": "EventDefinition", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [] + } \ No newline at end of file diff --git a/ruoyi-ui/src/components/Bpmn/package/flowable/init.js b/ruoyi-ui/src/components/Bpmn/package/flowable/init.js new file mode 100644 index 00000000..ec9e282d --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/flowable/init.js @@ -0,0 +1,24 @@ + +function randomStr() { + return Math.random().toString(36).slice(-8) +} + +export default function() { + return ` + + + + + + + + + + + + + + + + ` +} diff --git a/ruoyi-ui/src/components/Bpmn/package/flowable/showConfig.js b/ruoyi-ui/src/components/Bpmn/package/flowable/showConfig.js new file mode 100644 index 00000000..45a752b7 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/flowable/showConfig.js @@ -0,0 +1,51 @@ +export default { + 'bpmn:EndEvent': {}, + 'bpmn:StartEvent': { + initiator: true, + formKey: true + }, + 'bpmn:UserTask': { + userType: true, + assignee: true, + candidateUsers: true, + candidateGroups: true, + async: true, + priority: true, + formKey: true, + skipExpression: true, + dueDate: true, + taskListener: true + }, + 'bpmn:ServiceTask': { + async: true, + skipExpression: true, + isForCompensation: true, + triggerable: true, + class: true + }, + 'bpmn:ScriptTask': { + async: true, + isForCompensation: true, + autoStoreVariables: true + }, + 'bpmn:ManualTask': { + async: true, + isForCompensation: true + }, + 'bpmn:ReceiveTask': { + async: true, + isForCompensation: true + }, + 'bpmn:SendTask': { + async: true, + isForCompensation: true + }, + 'bpmn:BusinessRuleTask': { + async: true, + isForCompensation: true, + ruleVariablesInput: true, + rules: true, + resultVariable: true, + exclude: true + } +} diff --git a/ruoyi-ui/src/components/Bpmn/package/index.js b/ruoyi-ui/src/components/Bpmn/package/index.js new file mode 100644 index 00000000..f78489d2 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/index.js @@ -0,0 +1,5 @@ +import workflowBpmnModeler from './index.vue' + +workflowBpmnModeler.install = Vue => Vue.component(workflowBpmnModeler.name, workflowBpmnModeler) // 给组件配置install方法 + +export default workflowBpmnModeler diff --git a/ruoyi-ui/src/components/Bpmn/package/index.vue b/ruoyi-ui/src/components/Bpmn/package/index.vue new file mode 100644 index 00000000..13e8f916 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/index.vue @@ -0,0 +1,422 @@ + + + + + diff --git a/ruoyi-ui/src/components/Bpmn/package/lang/zh.js b/ruoyi-ui/src/components/Bpmn/package/lang/zh.js new file mode 100644 index 00000000..003c0cc5 --- /dev/null +++ b/ruoyi-ui/src/components/Bpmn/package/lang/zh.js @@ -0,0 +1,227 @@ +export default { + // Labels + 'Activate the global connect tool': '激活全局连接工具', + 'Append {type}': '添加 {type}', + 'Add Lane above': '在上面添加道', + 'Divide into two Lanes': '分割成两个道', + 'Divide into three Lanes': '分割成三个道', + 'Add Lane below': '在下面添加道', + 'Append compensation activity': '追加补偿活动', + 'Change type': '修改类型', + 'Connect using Association': '使用关联连接', + 'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接', + 'Connect using DataInputAssociation': '使用数据输入关联连接', + 'Remove': '移除', + 'Activate the hand tool': '激活抓手工具', + 'Activate the lasso tool': '激活套索工具', + 'Activate the create/remove space tool': '激活创建/删除空间工具', + 'Create expanded SubProcess': '创建扩展子过程', + 'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件', + 'Create Pool/Participant': '创建池/参与者', + 'Parallel Multi Instance': '并行多重事件', + 'Sequential Multi Instance': '时序多重事件', + 'DataObjectReference': '数据对象参考', + 'DataStoreReference': '数据存储参考', + 'Loop': '循环', + 'Ad-hoc': '即席', + 'Create {type}': '创建 {type}', + 'Task': '任务', + 'Send Task': '发送任务', + 'Receive Task': '接收任务', + 'User Task': '用户任务', + 'Manual Task': '手工任务', + 'Business Rule Task': '业务规则任务', + 'Service Task': '服务任务', + 'Script Task': '脚本任务', + 'Call Activity': '调用活动', + 'Sub Process (collapsed)': '子流程(折叠的)', + 'Sub Process (expanded)': '子流程(展开的)', + 'Start Event': '开始事件', + 'StartEvent': '开始事件', + 'Intermediate Throw Event': '中间事件', + 'End Event': '结束事件', + 'EndEvent': '结束事件', + 'Create Gateway': '创建网关', + 'Create Intermediate/Boundary Event': '创建中间/边界事件', + 'Message Start Event': '消息开始事件', + 'Timer Start Event': '定时开始事件', + 'Conditional Start Event': '条件开始事件', + 'Signal Start Event': '信号开始事件', + 'Error Start Event': '错误开始事件', + 'Escalation Start Event': '升级开始事件', + 'Compensation Start Event': '补偿开始事件', + 'Message Start Event (non-interrupting)': '消息开始事件(非中断)', + 'Timer Start Event (non-interrupting)': '定时开始事件(非中断)', + 'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)', + 'Signal Start Event (non-interrupting)': '信号开始事件(非中断)', + 'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)', + 'Message Intermediate Catch Event': '消息中间捕获事件', + 'Message Intermediate Throw Event': '消息中间抛出事件', + 'Timer Intermediate Catch Event': '定时中间捕获事件', + 'Escalation Intermediate Throw Event': '升级中间抛出事件', + 'Conditional Intermediate Catch Event': '条件中间捕获事件', + 'Link Intermediate Catch Event': '链接中间捕获事件', + 'Link Intermediate Throw Event': '链接中间抛出事件', + 'Compensation Intermediate Throw Event': '补偿中间抛出事件', + 'Signal Intermediate Catch Event': '信号中间捕获事件', + 'Signal Intermediate Throw Event': '信号中间抛出事件', + 'Message End Event': '消息结束事件', + 'Escalation End Event': '定时结束事件', + 'Error End Event': '错误结束事件', + 'Cancel End Event': '取消结束事件', + 'Compensation End Event': '补偿结束事件', + 'Signal End Event': '信号结束事件', + 'Terminate End Event': '终止结束事件', + 'Message Boundary Event': '消息边界事件', + 'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)', + 'Timer Boundary Event': '定时边界事件', + 'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)', + 'Escalation Boundary Event': '升级边界事件', + 'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)', + 'Conditional Boundary Event': '条件边界事件', + 'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)', + 'Error Boundary Event': '错误边界事件', + 'Cancel Boundary Event': '取消边界事件', + 'Signal Boundary Event': '信号边界事件', + 'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)', + 'Compensation Boundary Event': '补偿边界事件', + 'Exclusive Gateway': '互斥网关', + 'Parallel Gateway': '并行网关', + 'Inclusive Gateway': '相容网关', + 'Complex Gateway': '复杂网关', + 'Event based Gateway': '事件网关', + 'Transaction': '转运', + 'Sub Process': '子流程', + 'Event Sub Process': '事件子流程', + 'Collapsed Pool': '折叠池', + 'Expanded Pool': '展开池', + // Errors + 'no parent for {element} in {parent}': '在{parent}里,{element}没有父类', + 'no shape type specified': '没有指定的形状类型', + 'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类', + 'out of bounds release': 'out of bounds release', + 'more than {count} child lanes': '子道大于{count} ', + 'element required': '元素不能为空', + 'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范', + 'no diagram to display': '没有可展示的流程图', + 'no process or collaboration to display': '没有可展示的流程/协作', + 'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制', + 'already rendered {element}': '{element} 已被渲染', + 'failed to import {element}': '导入{element}失败', + // 属性面板的参数 + 'Id': '标识', + 'Name': '名称', + 'General': '常规', + 'Details': '详情', + 'Message Name': '消息名称', + 'Message': '消息', + 'Initiator': '创建者', + 'Asynchronous Continuations': '持续异步', + 'Asynchronous Before': '异步前', + 'Asynchronous After': '异步后', + 'Job Configuration': '工作配置', + 'Exclusive': '排除', + 'Job Priority': '工作优先级', + 'Retry Time Cycle': '重试时间周期', + 'Documentation': '文档', + 'Element Documentation': '元素文档', + 'History Configuration': '历史配置', + 'History Time To Live': '历史的生存时间', + 'Forms': '表单', + 'Form Key': '表单key', + 'Form Fields': '表单字段', + 'Business Key': '业务key', + 'Form Field': '表单字段', + 'ID': '编号', + 'Type': '类型', + 'Label': '名称', + 'Default Value': '默认值', + 'Validation': '校验', + 'Add Constraint': '添加约束', + 'Config': '配置', + 'Properties': '属性', + 'Add Property': '添加属性', + 'Value': '值', + 'Listeners': '监听器', + 'Execution Listener': '执行监听', + 'Event Type': '事件类型', + 'Listener Type': '监听器类型', + 'Java Class': 'Java类', + 'Expression': '表达式', + 'Must provide a value': '必须提供一个值', + 'Delegate Expression': '代理表达式', + 'Script': '脚本', + 'Script Format': '脚本格式', + 'Script Type': '脚本类型', + 'Inline Script': '内联脚本', + 'External Script': '外部脚本', + 'Resource': '资源', + 'Field Injection': '字段注入', + 'Extensions': '扩展', + 'Input/Output': '输入/输出', + 'Input Parameters': '输入参数', + 'Output Parameters': '输出参数', + 'Parameters': '参数', + 'Output Parameter': '输出参数', + 'Timer Definition Type': '定时器定义类型', + 'Timer Definition': '定时器定义', + 'Date': '日期', + 'Duration': '持续', + 'Cycle': '循环', + 'Signal': '信号', + 'Signal Name': '信号名称', + 'Escalation': '升级', + 'Error': '错误', + 'Link Name': '链接名称', + 'Condition': '条件名称', + 'Variable Name': '变量名称', + 'Variable Event': '变量事件', + 'Specify more than one variable change event as a comma separated list.': '多个变量事件以逗号隔开', + 'Wait for Completion': '等待完成', + 'Activity Ref': '活动参考', + 'Version Tag': '版本标签', + 'Executable': '可执行文件', + 'External Task Configuration': '扩展任务配置', + 'Task Priority': '任务优先级', + 'External': '外部', + 'Connector': '连接器', + 'Must configure Connector': '必须配置连接器', + 'Connector Id': '连接器编号', + 'Implementation': '实现方式', + 'Field Injections': '字段注入', + 'Fields': '字段', + 'Result Variable': '结果变量', + 'Topic': '主题', + 'Configure Connector': '配置连接器', + 'Input Parameter': '输入参数', + 'Assignee': '代理人', + 'Candidate Users': '候选用户', + 'Candidate Groups': '候选组', + 'Due Date': '到期时间', + 'Follow Up Date': '跟踪日期', + 'Priority': '优先级', + 'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'Variables': '变量' +} + +export const NodeName = { + 'bpmn:Process': '流程', + 'bpmn:StartEvent': '开始事件', + 'bpmn:IntermediateThrowEvent': '中间事件', + 'bpmn:Task': '任务', + 'bpmn:SendTask': '发送任务', + 'bpmn:ReceiveTask': '接收任务', + 'bpmn:UserTask': '用户任务', + 'bpmn:ManualTask': '手工任务', + 'bpmn:BusinessRuleTask': '业务规则任务', + 'bpmn:ServiceTask': '服务任务', + 'bpmn:ScriptTask': '脚本任务', + 'bpmn:EndEvent': '结束事件', + 'bpmn:SequenceFlow': '流程线', + 'bpmn:ExclusiveGateway': '互斥网关', + 'bpmn:ParallelGateway': '并行网关', + 'bpmn:InclusiveGateway': '相容网关', + 'bpmn:ComplexGateway': '复杂网关', + 'bpmn:EventBasedGateway': '事件网关' +} diff --git a/ruoyi-ui/src/components/FormDesigner/configPanel.vue b/ruoyi-ui/src/components/FormDesigner/configPanel.vue new file mode 100644 index 00000000..fd659efe --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/configPanel.vue @@ -0,0 +1,76 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/Switch.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/Switch.vue new file mode 100644 index 00000000..0b4b74c3 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/Switch.vue @@ -0,0 +1,74 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/alert.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/alert.vue new file mode 100644 index 00000000..c193d7fd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/alert.vue @@ -0,0 +1,72 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/barCode.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/barCode.vue new file mode 100644 index 00000000..d03b3e06 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/barCode.vue @@ -0,0 +1,81 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/button.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/button.vue new file mode 100644 index 00000000..1118db11 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/button.vue @@ -0,0 +1,93 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/cascader.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/cascader.vue new file mode 100644 index 00000000..1cc5a1d9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/cascader.vue @@ -0,0 +1,192 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/checkbox.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/checkbox.vue new file mode 100644 index 00000000..44adc348 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/checkbox.vue @@ -0,0 +1,203 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/colorPicker.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/colorPicker.vue new file mode 100644 index 00000000..3ef564df --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/colorPicker.vue @@ -0,0 +1,91 @@ + + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/date.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/date.vue new file mode 100644 index 00000000..82dd498c --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/date.vue @@ -0,0 +1,127 @@ + + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/dialogList.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/dialogList.vue new file mode 100644 index 00000000..46021052 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/dialogList.vue @@ -0,0 +1,172 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/divider.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/divider.vue new file mode 100644 index 00000000..df2dd4b6 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/divider.vue @@ -0,0 +1,39 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/dynamicTable.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/dynamicTable.vue new file mode 100644 index 00000000..10ce5369 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/dynamicTable.vue @@ -0,0 +1,44 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/editor.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/editor.vue new file mode 100644 index 00000000..8c1acfbe --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/editor.vue @@ -0,0 +1,47 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/html.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/html.vue new file mode 100644 index 00000000..42e97726 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/html.vue @@ -0,0 +1,54 @@ + + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/input.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/input.vue new file mode 100644 index 00000000..b3217cd8 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/input.vue @@ -0,0 +1,174 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/inputNumber.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/inputNumber.vue new file mode 100644 index 00000000..3dc357f2 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/inputNumber.vue @@ -0,0 +1,83 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/link.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/link.vue new file mode 100644 index 00000000..65135315 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/link.vue @@ -0,0 +1,68 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/radio.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/radio.vue new file mode 100644 index 00000000..38fd474f --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/radio.vue @@ -0,0 +1,198 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/rate.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/rate.vue new file mode 100644 index 00000000..fae0cbd4 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/rate.vue @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/row.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/row.vue new file mode 100644 index 00000000..8bbb5f02 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/row.vue @@ -0,0 +1,55 @@ + + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/select.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/select.vue new file mode 100644 index 00000000..365532d9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/select.vue @@ -0,0 +1,179 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/slider.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/slider.vue new file mode 100644 index 00000000..da501e25 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/slider.vue @@ -0,0 +1,78 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/table.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/table.vue new file mode 100644 index 00000000..1041fcb2 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/table.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/tdItem.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/tdItem.vue new file mode 100644 index 00000000..ef098849 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/tdItem.vue @@ -0,0 +1,28 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/text.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/text.vue new file mode 100644 index 00000000..7b4b48dd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/text.vue @@ -0,0 +1,51 @@ + + diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/textarea.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/textarea.vue new file mode 100644 index 00000000..277316ab --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/textarea.vue @@ -0,0 +1,83 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/time.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/time.vue new file mode 100644 index 00000000..a0ef6893 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/time.vue @@ -0,0 +1,74 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/configs/upload.vue b/ruoyi-ui/src/components/FormDesigner/custom/configs/upload.vue new file mode 100644 index 00000000..9223a282 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/configs/upload.vue @@ -0,0 +1,95 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/formConf.js b/ruoyi-ui/src/components/FormDesigner/custom/formConf.js new file mode 100644 index 00000000..9c56adbf --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/formConf.js @@ -0,0 +1,52 @@ +/** + * 表单配置 + */ +const formConf = { + version:'1.10', + formRef: 'elForm', + formModel: 'form', + rules: 'rules', + size: 'medium', + labelPosition: 'right', + labelWidth: 80, + formRules: 'rules', + gutter: 15, + disabled: false, + dynamicTableAllowed:true +}; +export default formConf; + +//动态表单允许放入的组件 +export const dynamicTableAllowedItems = [ + 'input', + 'select', + 'radio', + 'checkbox', + 'Switch', + 'inputNumber', + 'textarea', + 'slider', + 'rate', + 'date', + 'time' +]; + +//row允许放入的items +export const rowAllowedItems = [ + 'input', + 'input', + 'select', + 'radio', + 'checkbox', + 'Switch', + 'inputNumber', + 'textarea', + 'slider', + 'rate', + 'date', + 'time' +] +//table允许放入的items +export const tableAllowedItems = [ + 'row','dynamicTable' +] \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/formDraw.js b/ruoyi-ui/src/components/FormDesigner/custom/formDraw.js new file mode 100644 index 00000000..972cd7cd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/formDraw.js @@ -0,0 +1,106 @@ +//初始化data里面的数据(1、默认为空,2、之前存在的数据。。) +let itemDatas = {} +export function datas(){ + itemDatas = {}; + let self = this; + this.itemList.forEach(val => { + if(val.layout === 'rowItem'){ //row布局 + dataResolveRowItem(val); //解析row布局 + }else if(val.layout === 'dynamicItem'){ //动态表单布局 + let obj =dataResolveDynamicItem(val); + let array = []; + array.push(obj); + itemDatas[val.id] = array; + }else if(val.layout === 'tableItem'){ //表格布局 + dataResolveTableItem(val); + }else{ //表单 + dataResolveColItem(val); + } + }) + Object.keys(itemDatas).forEach(key =>{ + this.$set(this.form, key, itemDatas[key]); + }) +} + +function dataResolveRowItem(val){ + const columns = val.columns; + columns.forEach(v =>{ + v.list.forEach(item =>{ + if(item.layout==='dynamicItem'){ + let obj =dataResolveDynamicItem(item); + let array = []; + array.push(obj); + itemDatas[item.id] = array; + }else{ + dataResolveColItem(item); + } + }) + }) +} +function dataResolveDynamicItem(val){ + const columns = val.columns; + + let obj ={}; + columns.forEach(v =>{ + const key = v.id; + obj[key] = v.value; + }) + return obj; +} + +/* +遍历表格实现组件渲染 +*/ +function dataResolveTableItem(val){ + val.layoutArray.map((tr)=>{ + tr.map((td)=>{ + td.columns.map(item=>dataResolveColItem(item)); + }) + }) +} + +function dataResolveColItem(val){ + itemDatas[val.id] = val.value; +} + +export function fillDatas(jsonValue){ + const self = this; + Object.keys(jsonValue).forEach(key =>{ + + if(typeof(self.form[key]) === 'string'||typeof(self.form[key]) === 'number'){ + self.$set(self.form, key,jsonValue[key]); + }else if(self.form[key] instanceof Array){//有可能是多选或者是明细表 + //判断是否数组中为对象 + if(jsonValue[key].length>0){ + const firsValue = jsonValue[key][0];//获取第一个对象判断是什么类型 + if(typeof(firsValue) === 'string'||typeof(firsValue) === 'number'){ + self.$set(self.form, key,jsonValue[key]); + }else{ //明细表数组 + const arrayData = jsonValue[key]; + //self.form[key] = []; + arrayData.forEach((v,index)=>{ + const newV = JSON.parse(JSON.stringify(v)); + self.$set(self.form[key],index,newV); + }) + } + } + } + }) + //console.log(this.form); + } + +export function addRow(element){ + let obj =dataResolveDynamicItem(element); + this.form[element.id].push(obj); +} + +export function deleteRow(scope,element){ + this.form[element.id].splice(scope.$index,1); +} + +export function batchDeleteRow(indexs,element){ + for(let i =0;i { +// return [ +// h("Input", {}) +// ]; +// }; + +export let checkbox = { + id:'', + _id:'', + compType: 'checkbox', + //控件名称 + compName:'复选框', + //element标签 + ele: 'el-checkbox-group', + //图标 + compIcon:'checkbox', + //展示表单的模式 + viewType:'component', + // 是否可配置 + config: true, + // 控件左侧label内容 + label: '复选框', + placeholder: '请选择', + // 最大长度 + maxLength: 50, + //表单栅格 + span:24, + //栅格间隔 + gutter:'15', + //标签宽度 + labelWidth:80, + //显示标签 + showLabel:true, + //必填 + required:false, + //禁用 + disabled:false, + //是否有边框 + border:false, + //选项是否垂直 + vertical:false, + //选项大小 + size:'medium', + //是否是按钮 + optionType:'default', + //选项列表 + options:[{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + //数据类型 static,dynamic + dataType:'static', + //默认渲染的数据 + action:'https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options', + value: [], + rules:[], + // 验证错误提示信息 + ruleError: '该字段不能为空' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/colorPicker.js b/ruoyi-ui/src/components/FormDesigner/custom/items/colorPicker.js new file mode 100644 index 00000000..53048494 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/colorPicker.js @@ -0,0 +1,37 @@ +/** + * 单行&多行输入框 + */ +export let colorPicker = { + id:'', + _id:'', + compType: 'colorPicker', + ele: 'el-color-picker', + //控件名称(左侧显示) + compName:'颜色选择器', + //图标 + compIcon:'colorpicker', + //展示表单的模式 + viewType:'component', + + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:false, + label: '单行文本', + labelWidth: 0, + //是否可以禁用 + disabled:false, + //大小,medium / small / mini + size:'medium', + //primary / success / warning / danger / info / text + type:'primary', + span:24, + //选择透明度 + 'show-alpha':false, + //格式 + 'color-format':'hex', + //预定义颜色 + predefine:[], + value:'#409EFF' + } + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/date.js b/ruoyi-ui/src/components/FormDesigner/custom/items/date.js new file mode 100644 index 00000000..9dc443bd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/date.js @@ -0,0 +1,44 @@ +/** + * 单行&多行输入框 + */ +export let date = { + id:'', + _id:'', + compType: 'date', + ele: 'el-date-picker', + //控件名称(左侧显示) + compName:'日期', + //图标 + compIcon:'date', + //展示表单的模式 + viewType:'text', + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '日期', + labelWidth: '80', + placeholder: '请选择', + // 是否必填 + required: false, + // 最大长度 + maxLength: 50, + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + //是否可清空 + clearable:true, + disabled:false, + readonly:false, + value: '', + rules:[], + //时间类型 + type:'date', + format:'yyyy-MM-dd', + 'value-format':'yyyy-MM-dd', + 'range-separator':'-', + 'start-placeholder':'开始日期', + 'end-placeholder':'结束日期' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/dialogList.js b/ruoyi-ui/src/components/FormDesigner/custom/items/dialogList.js new file mode 100644 index 00000000..0f67dca8 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/dialogList.js @@ -0,0 +1,50 @@ +/** + * dialogList + */ + export let dialogList = { + id:'', + _id:'', + compType: 'dialogList', + ele: 'fancy-dialog-list', + //控件名称(左侧显示) + compName:'选择列表', + //图标 + compIcon:'dialog', + //展示表单的模式 + viewType:'component', + + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '选择列表', + labelWidth: '80', + showLabel: true, + labelWidth: 80, + // 是否必填 + required: false, + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + //禁用 + disabled:false, + //标题 + title:'请选择', + //多选 + multi:false, + //显示序号 + showIndex:false, + //请求地址 + action:'https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/dialogListData', + //字段配置 + colConf:'[{"index":0,"label":"姓名","property":"name","width":"250","show":true},{"index":1,"label":"日期","property":"date","width":"150","show":true},{"index":2,"label":"地址","property":"address","width":"","show":true}]', + // //值 + dval:'id', + //字段 + dlabel:'name', + height:500, + value: '' + } + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/divider.js b/ruoyi-ui/src/components/FormDesigner/custom/items/divider.js new file mode 100644 index 00000000..825a2ba1 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/divider.js @@ -0,0 +1,21 @@ +/** + * 分割线 + */ +export let divider = { + id:'', + _id:'', + compType: 'divider', + ele: 'el-divider', + compName:'分割线', + compIcon:'divider', + //展示表单的模式 + viewType:'component', + config: true, + form:false, + //内容坐标 left|center|right + 'content-position':'left', + text:'', + // 控件左侧label内容 + showLabel:false, + labelWidth: '0' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/dynamicTable.js b/ruoyi-ui/src/components/FormDesigner/custom/items/dynamicTable.js new file mode 100644 index 00000000..7be10e8c --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/dynamicTable.js @@ -0,0 +1,34 @@ +/** + * 动态表单 + */ +export let dynamicTable = { + id:'', + _id:'', + compType: 'dynamicTable', + ele: 'dynamic-table', + //控件名称(左侧显示) + compName:'动态表格', + layout:'dynamicItem', + //图标 + compIcon:'table', + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + //显示标签 + labelWidth:0, + showLabel:false, + config: true, + //显示新增按钮 + buttonAdd:true, + //显示删除按钮 + buttonDel:true, + //显示行号 + showIndex:true, + visible:true, + multiCheck:false, + //合计行 + 'show-summary':false, + 'sum-text':'合计', + 'summary-text':'元', + columns:[ + ] +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/editor.js b/ruoyi-ui/src/components/FormDesigner/custom/items/editor.js new file mode 100644 index 00000000..546965dd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/editor.js @@ -0,0 +1,27 @@ +/** + * 富文本编辑器 + */ +export let editor = { + id:'', + _id:'', + compType: 'editor', + ele: 'fancy-editor', + compName:'编辑器', + compIcon:'editor', + //展示表单的模式 + viewType:'html', + config: true, + form:true, + // 控件左侧label内容 + showLabel:true, + labelWidth: '80', + label:'文本编辑器', + value:'', + required:false, + validateMaxText:false, + //最大长度 + max:2000, + //自定义rules + customRules:[] + } + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/html.js b/ruoyi-ui/src/components/FormDesigner/custom/items/html.js new file mode 100644 index 00000000..8e2ff76b --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/html.js @@ -0,0 +1,21 @@ +/**废弃 */ +/** + * html + */ +export let html = { + id:'', + _id:'', + compType: 'html', + ele: 'fancy-html', + compName:'HTML', + compIcon:'html', + //展示表单的模式 + viewType:'component', + config: true, + form:false, + text:'html', + // 控件左侧label内容 + showLabel:false, + label:'', + labelWidth: '0' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/input.js b/ruoyi-ui/src/components/FormDesigner/custom/items/input.js new file mode 100644 index 00000000..201877e4 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/input.js @@ -0,0 +1,53 @@ +/** + * 单行&多行输入框 + */ +export let input = { + id:'', + _id:'', + compType: 'input', + ele: 'el-input', + //控件名称(左侧显示) + compName:'单行文本', + //图标 + compIcon:'input', + //展示表单的模式 + viewType:'text', + + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '单行文本', + labelWidth: '80', + placeholder: '请输入文本', + // 是否必填 + required: false, + // 最大长度 + maxLength: 50, + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + //组件长度 + width: '100%', + //是否可清空 + clearable:true, + disabled:false, + readonly:false, + //状态,正常,只读,禁用 + status:'normal', + //前置图标 + 'prefix-icon':'', + //后置图标 + 'suffix-icon':'', + value: '', + //验证规则(字符,phone,email,number) + rules:[], + //验证规则 + rulesType:'default', + //前缀 + prepend:'', + //后缀 + append:'' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/inputNumber.js b/ruoyi-ui/src/components/FormDesigner/custom/items/inputNumber.js new file mode 100644 index 00000000..58b72f71 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/inputNumber.js @@ -0,0 +1,36 @@ +/** + * 计数器 + */ +export let inputNumber = { + id:'', + _id:'', + compType: 'inputNumber', + ele: 'el-inputNumber', + //控件名称(左侧显示) + compName:'计数器', + label: '计数器', + //图标 + compIcon:'inputNumber', + //展示表单的模式 + viewType:'text', + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + //栅格间隔 + gutter:15, + labelWidth: '80', + value: 0, + rules:[], + span: 24, + min: 0, + max: 100, + step: 1, + 'step-strictly': false, + precision: 0, + 'controls-position': 'default', + disabled: false, + readonly: false, + required: false, + regList: [] +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/link.js b/ruoyi-ui/src/components/FormDesigner/custom/items/link.js new file mode 100644 index 00000000..c9bafdda --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/link.js @@ -0,0 +1,32 @@ +/** + * 文字链接 + */ +export let link = { + id:'', + _id:'', + compType: 'link', + ele: 'el-link', + compName:'文字链接', + compIcon:'link', + //展示表单的模式 + viewType:'component', + config: true, + + form:false, //是否表单组件 + // 控件左侧label内容 + showLabel:false, + labelWidth: '0', + span:24, + + //主题 + type:'primary', + //链接地址 + href:'http://www.baidu.com', + //是否下划线 + underline:true, + //是否禁用 + disabled:false, + text:'链接', + target:'_blank' + } + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/radio.js b/ruoyi-ui/src/components/FormDesigner/custom/items/radio.js new file mode 100644 index 00000000..6cde4fc9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/radio.js @@ -0,0 +1,62 @@ +// export default (_self, h) => { +// return [ +// h("Input", {}) +// ]; +// }; + +export let radio = { + id:'', + _id:'', + compType: 'radio', + //控件名称 + compName:'单选框', + //element标签 + ele: 'el-radio-group', + //图标 + compIcon:'radio', + //展示表单的模式 + viewType:'component', + // 是否可配置 + config: true, + // 控件左侧label内容 + label: '单选框', + placeholder: '请选择', + // 最大长度 + maxLength: 50, + //表单栅格 + span:24, + //栅格间隔 + gutter:'15', + //标签宽度 + labelWidth:80, + //显示标签 + showLabel:true, + //必填 + required:false, + //禁用 + disabled:false, + //是否有边框 + border:false, + //选项是否垂直 + vertical:false, + //选项大小 + size:'medium', + //是否是按钮 + optionType:'default', + //选项列表 + options:[{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + //数据类型 static,dynamic + dataType:'static', + //默认渲染的数据 + action:'https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options', + value: '', + rules:[], + // 验证错误提示信息 + ruleError: '该字段不能为空' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/rate.js b/ruoyi-ui/src/components/FormDesigner/custom/items/rate.js new file mode 100644 index 00000000..8f9d1e88 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/rate.js @@ -0,0 +1,31 @@ +/** + * 评分 + */ +export let rate = { + id:'', + _id:'', + compType: 'rate', + ele: 'el-rate', + //控件名称(左侧显示) + compName:'评分', + label: '评分', + //图标 + compIcon:'rate', + //展示表单的模式 + viewType:'component', + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + //栅格间隔 + gutter:15, + labelWidth: '80', + value: 1, + rules:[], + span: 24, + disabled: false, + required: false, + max: 5, + 'allow-half': false, + 'show-score': false +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/row.js b/ruoyi-ui/src/components/FormDesigner/custom/items/row.js new file mode 100644 index 00000000..43fbbe41 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/row.js @@ -0,0 +1,43 @@ +/** + * 栅格布局 + */ + + // export default (_self, h) => { +// return [ +// h("Input", {}) +// ]; +// }; + +export let row = { + id:'', + _id:'', + compType: 'row', + //控件名称 + compName:'栅格布局', + //element标签 + ele: 'el-row', + //图标 + compIcon:'col', + layout:'rowItem', + // 是否可配置 + config: true, + // + flex:'default', + justify:'start', + align:'top', + gutter:0, + columns:[ + { + index:0, + span:12, + list:[] + }, + { + index:1, + span:12, + list:[] + } + ], + + +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/select.js b/ruoyi-ui/src/components/FormDesigner/custom/items/select.js new file mode 100644 index 00000000..f66bece4 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/select.js @@ -0,0 +1,56 @@ +export let select = { + id:'', + _id:'', + compType: 'select', + //控件名称 + compName:'下拉框', + //element标签 + ele: 'el-select', + //图标 + compIcon:'select', + //展示表单的模式 + viewType:'component', + // 是否可配置 + config: true, + // 控件左侧label内容 + label: '下拉框', + placeholder: '请选择', + // 最大长度 + maxLength: 50, + //表单栅格 + span:24, + //栅格间隔 + gutter:'15', + //标签宽度 + labelWidth:80, + //显示标签 + showLabel:true, + //必填 + required:false, + //多选 + multiple:false, + 'collapse-tags':false, + //禁用 + disabled:false, + //搜索 + filterable:false, + + //选项列表 + options:[{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + //数据类型 static,dynamic + dataType:'static', + //默认渲染的数据 + action:'https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options', + //是否可以清空 + clearable:false, + value: '', + rules:[], + // 验证错误提示信息 + ruleError: '该字段不能为空' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/slider.js b/ruoyi-ui/src/components/FormDesigner/custom/items/slider.js new file mode 100644 index 00000000..dada6c18 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/slider.js @@ -0,0 +1,40 @@ +/** + * 单行&多行输入框 + */ +export let slider = { + id:'', + _id:'', + compType: 'slider', + ele: 'el-slider', + //控件名称(左侧显示) + compName:'滑块', + label: '滑块', + //图标 + compIcon:'slider', + //展示表单的模式 + viewType:'component', + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + //栅格间隔 + gutter:15, + labelWidth: '80', + value: 0, + rules:[], + span: 24, + disabled: false, + required: false, + //最小值 + min: 0, + //最大值 + max: 20, + //步长 + step: 1, + //是否显示断点 + 'show-stops': true, + //是否显示tooltip + 'show-tooltip': true, + //范围选择 1,50 + range: false +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/table.js b/ruoyi-ui/src/components/FormDesigner/custom/items/table.js new file mode 100644 index 00000000..4741a7aa --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/table.js @@ -0,0 +1,24 @@ +/** + * 表格布局 + */ +import {getDefaultTrs} from '../../table/table' +let trs = getDefaultTrs(); + export let table = { + id:'', + _id:'', + compType: 'table', + ele: 'fancy-table', + //控件名称(左侧显示) + compName:'表格布局', + //图标 + compIcon:'table_layout', + layout:'tableItem', + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + layoutArray:trs, + //单元格样式 + tdStyle:'', + width:100, + height:50 + } \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/text.js b/ruoyi-ui/src/components/FormDesigner/custom/items/text.js new file mode 100644 index 00000000..9fddbb45 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/text.js @@ -0,0 +1,25 @@ +/** + * 文本 + */ +export let text = { + id:'', + _id:'', + compType: 'text', + ele: 'fancy-text', + compName:'文本', + compIcon:'text', + //展示表单的模式 + viewType:'component', + config: true, + form:false, + show:true, + text:'文本', + align:'left', + color:'#000000', + size:'14', + bold:'400', + // 控件左侧label内容 + showLabel:false, + labelWidth: '0' + } + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/textarea.js b/ruoyi-ui/src/components/FormDesigner/custom/items/textarea.js new file mode 100644 index 00000000..fad6bdf9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/textarea.js @@ -0,0 +1,45 @@ +/** + * 单行&多行输入框 + */ +export let textarea = { + id:'', + _id:'', + compType: 'textarea', + ele: 'el-input', + //控件名称(左侧显示) + compName:'多行文本', + //图标 + compIcon:'textarea', + //展示表单的模式 + viewType:'text', + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '多行文本', + labelWidth: '80', + placeholder: '请输入文本', + type:'textarea', + // 是否必填 + required: false, + // 最大长度 + maxlength: 50, + //输入统计 + 'show-word-limit':false, + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + //是否可清空 + clearable:true, + disabled:false, + readonly:false, + rows:4, + //状态,正常,只读,禁用 + status:'normal', + value: '', + rules:[], + // 验证错误提示信息 + ruleError: '该字段不能为空' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/time.js b/ruoyi-ui/src/components/FormDesigner/custom/items/time.js new file mode 100644 index 00000000..8a8cf4b2 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/time.js @@ -0,0 +1,46 @@ +/** + * 单行&多行输入框 + */ +export let time = { + id:'', + _id:'', + compType: 'time', + ele: 'el-time-picker', + //控件名称(左侧显示) + compName:'时间', + //图标 + compIcon:'time', + //展示表单的模式 + viewType:'text', + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '时间', + labelWidth: '80', + placeholder: '请选择', + // 是否必填 + required: false, + // 最大长度 + maxLength: 50, + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + //是否可清空 + clearable:true, + disabled:false, + readonly:false, + value: '', + rules:[], + 'picker-options': { + selectableRange: '00:00:00-23:59:59' + }, + 'arrow-control':true, + align:'left', + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + 'is-range':false, + 'range-separator':'-' +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/items/upload.js b/ruoyi-ui/src/components/FormDesigner/custom/items/upload.js new file mode 100644 index 00000000..3a1e9f40 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/items/upload.js @@ -0,0 +1,51 @@ +/** + * 上传组件 + */ +export let upload = { + id:'', + _id:'', + compType: 'upload', + ele: 'el-upload', + //控件名称(左侧显示) + compName:'附件', + //图标 + compIcon:'att', + //展示表单的模式 + viewType:'component', + + // 是否可配置 + //暂时默认为true,无法更改,后期考虑某些时候无法配置 + config: true, + // 控件左侧label内容 + showLabel:true, + label: '附件上传', + labelWidth: '80', + //栅格间隔 + gutter:15, + //默认栅格 + span:24, + // 是否必填 + required: false, + //上传地址 + action:'https://jsonplaceholder.typicode.com/posts/', + //多选上传 + multiple:false, + name:'file', + //显示上传文件列表 + 'show-file-list':true, + //文件列表类型 + 'list-type':'text', + value:'', + width:100, + //按钮文字 + buttonText:'请上传附件', + //是否显示描述 + showTip:false, + //描述内容 + tips:'点击按钮上传附件', + //允许文件类型 + accept:'.pdf, .doc, .docx, .xls, .xlsx', + //文件大小MB + fileSize:10, + headers:{'X-Access-Token':'token'}, +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/mixin/index.js b/ruoyi-ui/src/components/FormDesigner/custom/mixin/index.js new file mode 100644 index 00000000..36214d28 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/mixin/index.js @@ -0,0 +1,30 @@ +// 模态框 +export const remoteData = { + methods: { + getRemoteData(){ + //动态数据 + if(this.conf.dataType === 'dynamic'){ + this.$axios.get(this.conf.action).then(res => { + if(this.conf.options.length===0){ + this.conf.options = this.conf.options.concat(res.data); + } + }) + } + } + } +} + +export const changeId = { + methods: { + handlerChangeId(val){ + let idArray = this.getFormId(this.props._id); + console.log(idArray); + if(idArray.includes(val)){ //如果存在id相等,则提示 + this.$message.error('该ID已经存在,请修改'); + this.props.id=this.props._id; + }else{ + this.props._id=val; + } + } + } +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/previewRender.js b/ruoyi-ui/src/components/FormDesigner/custom/previewRender.js new file mode 100644 index 00000000..9ed5f04b --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/previewRender.js @@ -0,0 +1,115 @@ +import { isAttr,jsonClone } from '../utils'; +import childrenItem from './slot/index'; +import {remoteData} from './mixin'; +import Vue from 'vue' +import { getToken } from "@/utils/auth"; +import { Message } from 'element-ui' +import download from "@/plugins/download" +//先修改在这里,后续需要优化 +function vModel(self, dataObject) { + dataObject.props.value = self.value; + dataObject.on.input = val => { + self.$emit('input', val) + } + //判断是否为上传组件 + if(self.conf.compType === 'upload'){ + dataObject.attrs['headers'] = {"Authorization":"Bearer " + getToken()}; + console.log("dataObject.props.value",dataObject.props.value) + if(dataObject.props.value!==undefined && dataObject.props.value !==''){ + const filevalue = JSON.parse(dataObject.props.value); + dataObject.props['file-list'] = filevalue; + } + + dataObject.attrs['before-upload'] = file=>{ + //非限定后缀不允许上传 + const fileName = file.name; + const suffixName = fileName.split('.').pop(); + + if(!self.conf.accept.includes(suffixName)){ + self.$message.error('该后缀文件不允许上传'); + return false; + } + const fileSize = file.size; + if(fileSize>dataObject.props.fileSize*1024*1024){ + self.$message.error('文件大小超出限制,请检查!'); + return false; + } + } + dataObject.attrs['on-success'] = file=>{ + if(file.code === 500){ + Message({ message: file.msg,type: 'error' }) + return false + } + console.log("on-success",file) + //获取文件名称 + var filename=file.data.fileName.substring(file.data.fileName.lastIndexOf('/')+1) + //获取文件路径 + var url=file.data.url + // ossId + var ossId = file.data.ossId + let fileObj = {name: filename, url: url,ossId: ossId} + let oldValue = []; + if(dataObject.props.value) { + oldValue = JSON.parse(dataObject.props.value); + }else { + oldValue = []; + } + if (oldValue) { + oldValue.push(fileObj) + } else { + oldValue = [fileObj] + } + self.$emit('input',JSON.stringify(oldValue)); + } + dataObject.attrs['on-remove'] = (file, fileList) => { + let oldValue = JSON.parse(dataObject.props.value); + //file 删除的文件 + //过滤掉删除的文件 + let newValue = oldValue.filter(item => item.name !== file.name) + self.$emit('input',JSON.stringify(newValue)); + } + + dataObject.attrs['on-error'] = (file) => { + console.log("on-error file",file); + } + + dataObject.attrs['on-preview'] = (file) => { + console.log("on-preview file==",file); + download.oss(file.ossId); + } + } +} + +export default { + render(h) { + let dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + //远程获取数据 + this.getRemoteData(); + const confClone = jsonClone(this.conf); + const children = childrenItem(h,confClone); + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (dataObject[key]) { + dataObject[key] = val + } else if(key ==='width'){ + dataObject.style= 'width:'+val; + } else if (!isAttr(key)) { + dataObject.props[key] = val + }else { + if(key !== 'value'){ + dataObject.attrs[key] = val + } + } + }) + /*调整赋值模式,规避cascader组件赋值props会出现覆盖预制参数的bug */ + vModel(this, dataObject); + return h(confClone.ele, dataObject, children) + }, + props: ['conf','value'], + mixins:[remoteData] +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/register.js b/ruoyi-ui/src/components/FormDesigner/custom/register.js new file mode 100644 index 00000000..4fe26a3b --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/register.js @@ -0,0 +1,41 @@ +//在此注册组件 +const components = [ + 'input', + 'select', + 'radio', + 'checkbox', + 'Switch', + 'inputNumber', + 'textarea', + 'slider', + 'rate', + 'date', + 'time', + 'editor', + 'colorPicker', + 'cascader', + 'upload', + 'button', + 'divider', + 'alert', + 'link', + 'dialogList', + 'barCode', + 'text', + 'html', + 'row', + 'dynamicTable', + 'table', + 'tdItem' +]; + + +let comps = []; +for (let i in components) { + const comp = { + name: components[i], + content : null + } + comps.push(comp); +} +export default comps; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/render.js b/ruoyi-ui/src/components/FormDesigner/custom/render.js new file mode 100644 index 00000000..95e68d6f --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/render.js @@ -0,0 +1,41 @@ +import {isAttr,jsonClone} from '../utils/index'; +import childrenItem from './slot/index'; +import {remoteData} from './mixin'; +function vModel(self, dataObject) { + dataObject.on.input = val => { + self.$emit('input', val) + } +} + +export default { + render(h) { + let dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + + //远程获取数据 + this.getRemoteData(); + const confClone = jsonClone(this.conf); + const children = childrenItem(h,confClone); + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (dataObject[key]) { + dataObject[key] = val + } else if (!isAttr(key)) { + dataObject.props[key] = val + } else if(key ==='width'){ + dataObject.style= 'width:'+val; + }else { + dataObject.attrs[key] = val + } + }) + /*调整赋值模式,规避cascader组件赋值props会出现覆盖预制参数的bug */ + vModel(this, dataObject); + return h(confClone.ele, dataObject, children) + }, + props: ['conf'], + mixins:[remoteData] +} diff --git a/ruoyi-ui/src/components/FormDesigner/custom/rule/index.js b/ruoyi-ui/src/components/FormDesigner/custom/rule/index.js new file mode 100644 index 00000000..a659f2c9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/rule/index.js @@ -0,0 +1,21 @@ +export default function checkRules(element) { + let r = []; + const _trigger = ['blur','change']; + if(element.required){ + r.push({required: true, message: element.label+'不能为空', trigger:_trigger}); + } + //判断是否有规则 + if(element.rules){ + element.rules.forEach(obj=>{ + r.push({pattern:new RegExp(obj.rule),message:obj.msg, trigger:_trigger}); + }); + } + //编辑器最大字数验证 + if(typeof element.validateMaxText !== 'undefined'&&element.validateMaxText){ + const maxRules = { + max: element.max, message: element.label+'超出最大字数限制', trigger:_trigger + } + r.push(maxRules); + } + return r; +}; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-button.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-button.js new file mode 100644 index 00000000..a9ed0c15 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-button.js @@ -0,0 +1,5 @@ +export default { + slot(h,conf) { + return conf.text; + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-checkbox-group.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-checkbox-group.js new file mode 100644 index 00000000..e399f512 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-checkbox-group.js @@ -0,0 +1,11 @@ +export default { + slot(h,conf) { + const list = [] + const vertical = conf.vertical?'display:block;':''; + conf.options.forEach(item => { + if (conf.optionType === 'button') list.push({item.label}) + else list.push({item.label}) + }) + return list + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-divider.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-divider.js new file mode 100644 index 00000000..af75bf57 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-divider.js @@ -0,0 +1,2 @@ +import text from './el-button'; +export default text; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-input.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-input.js new file mode 100644 index 00000000..ad1d2864 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-input.js @@ -0,0 +1,12 @@ +export default { + slot(h,conf) { + const slotText = [] + if(conf.prepend!==''){ + slotText.push(); + } + if(conf.append!==''){ + slotText.push(); + } + return slotText; + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-link.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-link.js new file mode 100644 index 00000000..af75bf57 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-link.js @@ -0,0 +1,2 @@ +import text from './el-button'; +export default text; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-radio-group.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-radio-group.js new file mode 100644 index 00000000..8f3f9986 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-radio-group.js @@ -0,0 +1,11 @@ +export default { + slot(h,conf) { + const list = []; + const vertical = conf.vertical?'display:block;':''; + conf.options.forEach(item => { + if (conf.optionType === 'button') list.push({item.label}) + else list.push({item.label}) + }) + return list + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-select.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-select.js new file mode 100644 index 00000000..534a9bc5 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-select.js @@ -0,0 +1,9 @@ +export default { + slot(h,conf) { + const list = [] + conf.options.forEach(item => { + list.push() + }) + return list; + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/el-upload.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-upload.js new file mode 100644 index 00000000..af4bdf58 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/el-upload.js @@ -0,0 +1,14 @@ +export default { + slot(h,conf) { + const list = []; + if (conf['list-type'] === 'picture-card') { + list.push() + } else { + list.push({conf.buttonText}) + } + if (conf.showTip) { + list.push(
{conf.tips}
) + } + return list + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/slot/index.js b/ruoyi-ui/src/components/FormDesigner/custom/slot/index.js new file mode 100644 index 00000000..b560f62d --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/slot/index.js @@ -0,0 +1,21 @@ +const slots = require.context('./', false, /\.js$/); +const componentChild = {}; +slots.keys().forEach(obj=>{ + const tag = obj.replace('./','').replace('.js',''); + if(tag !=='index'){ + componentChild[tag] = slots(obj).default; + } +}); + + +export default function childrenItem(h,confClone) { + let children = []; + const childObjs = componentChild[confClone.ele] + if (childObjs&&childObjs.slot) { + Object.keys(childObjs).forEach(key => { + const childFunc = childObjs[key] + children.push(childFunc(h,confClone)) + }) + } + return children; +}; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/custom/viewRender.js b/ruoyi-ui/src/components/FormDesigner/custom/viewRender.js new file mode 100644 index 00000000..95036948 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/custom/viewRender.js @@ -0,0 +1,60 @@ +import { isAttr,jsonClone } from '../utils'; +import childrenItem from './slot/index'; +import {remoteData} from './mixin'; +import Vue from 'vue' +import { getToken } from "@/utils/auth"; +import download from "@/plugins/download" + +function vModel(self, dataObject) { + dataObject.props.value=self.value; + dataObject.on.input = val => { + self.$emit('input', val) + } + //判断是否为上传组件 + if(self.conf.compType === 'upload'){ + // add by nbacheng 2022-09-09 + dataObject.attrs['headers'] = {"Authorization":"Bearer " + getToken()}; + if(dataObject.props.value!==undefined && dataObject.props.value !==''){ + const filevalue = JSON.parse(dataObject.props.value); + dataObject.props['file-list'] = filevalue; + } + dataObject.attrs['on-preview'] = (file) => { + console.log("on-preview file",file); + //download(file); + download.oss(file.ossId); + } + } +} + +export default { + render(h) { + let dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + + //远程获取数据 + this.getRemoteData(); + const confClone = jsonClone(this.conf); + const children = childrenItem(h,confClone); + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (dataObject[key]) { + dataObject[key] = val + } else if(key ==='width'){ + dataObject.style= 'width:'+val+'%'; + } else if (!isAttr(key)) { + dataObject.props[key] = val + } else { + dataObject.attrs[key] = val + } + }) + /*调整赋值模式,规避cascader组件赋值props会出现覆盖预制参数的bug */ + vModel(this, dataObject); + return h(confClone.ele, dataObject, children) + }, + props: ['conf','value'], + mixins:[remoteData] +} diff --git a/ruoyi-ui/src/components/FormDesigner/designItem.vue b/ruoyi-ui/src/components/FormDesigner/designItem.vue new file mode 100644 index 00000000..68f88fd8 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/designItem.vue @@ -0,0 +1,255 @@ + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/designer.vue b/ruoyi-ui/src/components/FormDesigner/designer.vue new file mode 100644 index 00000000..56900cfd --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/designer.vue @@ -0,0 +1,394 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTable.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTable.vue new file mode 100644 index 00000000..3311e696 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTable.vue @@ -0,0 +1,28 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableItem.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableItem.vue new file mode 100644 index 00000000..bca64757 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableItem.vue @@ -0,0 +1,112 @@ + + + diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableOptButton.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableOptButton.vue new file mode 100644 index 00000000..a048c5b7 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/dynamicTableOptButton.vue @@ -0,0 +1,29 @@ + + + + diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTable.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTable.vue new file mode 100644 index 00000000..03397844 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTable.vue @@ -0,0 +1,147 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableItem.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableItem.vue new file mode 100644 index 00000000..2ef42d4d --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableItem.vue @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableViewItem.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableViewItem.vue new file mode 100644 index 00000000..a8df2ea1 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicTableViewItem.vue @@ -0,0 +1,45 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicViewTable.vue b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicViewTable.vue new file mode 100644 index 00000000..732bdab9 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/dynamic/fancyDynamicViewTable.vue @@ -0,0 +1,88 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/extend/fancyDialogList.vue b/ruoyi-ui/src/components/FormDesigner/extend/fancyDialogList.vue new file mode 100644 index 00000000..ae26df13 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/extend/fancyDialogList.vue @@ -0,0 +1,259 @@ + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/extend/fancyEditor.vue b/ruoyi-ui/src/components/FormDesigner/extend/fancyEditor.vue new file mode 100644 index 00000000..ae8155a0 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/extend/fancyEditor.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/extend/fancyHtml.vue b/ruoyi-ui/src/components/FormDesigner/extend/fancyHtml.vue new file mode 100644 index 00000000..80141ea5 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/extend/fancyHtml.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/ruoyi-ui/src/components/FormDesigner/extend/fancyText.vue b/ruoyi-ui/src/components/FormDesigner/extend/fancyText.vue new file mode 100644 index 00000000..0222e095 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/extend/fancyText.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/ruoyi-ui/src/components/FormDesigner/formBuilder.vue b/ruoyi-ui/src/components/FormDesigner/formBuilder.vue new file mode 100644 index 00000000..db80cb70 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/formBuilder.vue @@ -0,0 +1,217 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/formDesigner.vue b/ruoyi-ui/src/components/FormDesigner/formDesigner.vue new file mode 100644 index 00000000..457b2a89 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/formDesigner.vue @@ -0,0 +1,213 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/formViewItem.vue b/ruoyi-ui/src/components/FormDesigner/formViewItem.vue new file mode 100644 index 00000000..8c22510b --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/formViewItem.vue @@ -0,0 +1,67 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/formViewer.vue b/ruoyi-ui/src/components/FormDesigner/formViewer.vue new file mode 100644 index 00000000..a8ec8f96 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/formViewer.vue @@ -0,0 +1,149 @@ + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/generator/html.js b/ruoyi-ui/src/components/FormDesigner/generator/html.js new file mode 100644 index 00000000..07c05418 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/generator/html.js @@ -0,0 +1,104 @@ +/** + * 生成html的核心js函数 + */ +let globalConfig + + +export function vueTemplate(str) { + return `` +} + +export function vueScript(str) { + return `` +} + +export function cssStyle(cssStr) { + return `` +} + +const items = { + 'input':el =>{ + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : '' + //const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : '' + const readonly = el.readonly ? 'readonly' : '' + return `<${el.ele} ${vModel} ${placeholder} ${maxlength} ${readonly} ${disabled} ${clearable} />` + }, + 'textarea':el =>{ + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : '' + //const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : '' + const readonly = el.readonly ? 'readonly' : '' + const type = el.type ? `type="${el.type}"` : '' + return `<${el.ele} ${vModel} ${type} ${placeholder} ${maxlength} ${readonly} ${disabled} ${clearable} />` + } +} + + +function colWrapper(element,str){ + if (element.span) { + return ` + ${str} + ` + } + return str +} + +function attrBuilder(el) { + return { + vModel: `v-model="${globalConfig.formModel}.${el.id}"`, + clearable: el.clearable ? 'clearable' : '', + placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '', + //width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '', + disabled: el.disabled ? ':disabled=\'true\'' : '' + } +} + + +const layout = { + colFormItem(element) { + let labelWidth = `label-width="${globalConfig.labelWidth}px"` + let label = `label="${element.label}"` + if (element.labelWidth && element.labelWidth !== globalConfig.labelWidth) { + labelWidth = `label-width="${element.labelWidth}px"` + } + if (element.showLabel === false) { + labelWidth = 'label-width="0"' + label = '' + } + const required = element.required ? 'required' : '' + const itemDom = items[element.compType] ? items[element.compType](element) : null + let str = ` + ${itemDom} + ` + str = colWrapper(element,str); + return str; + } +} + + +/** + * 生成html源码 + * 表单配置和组件列表 + */ +export function buildHtmlSource(itemList,formConf){ + globalConfig = formConf; + const htmlCode = [] + itemList.forEach(el => { + htmlCode.push(layout['colFormItem'](el)) + }) + const htmlStr = htmlCode.join('\n') + //console.log(htmlStr) +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/generator/js.js b/ruoyi-ui/src/components/FormDesigner/generator/js.js new file mode 100644 index 00000000..7da257ca --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/generator/js.js @@ -0,0 +1,83 @@ +/** + * 生成js的核心js函数 + */ +let globalConfig + +export function buildJsSource(itemList,formConf){ + globalConfig = JSON.parse(JSON.stringify(formConf)) + const dataList = [] + const optionsList = [] + const propsList = [] + itemList.forEach(el =>{ + buildAttributes(el, dataList, optionsList, propsList) + }) + + const script = buildexport( + formConf, + dataList.join('\n'), + optionsList.join('\n'), + propsList.join('\n'), + ) + globalConfig = null; + console.log(script); + return script; +} + +function buildAttributes(el, dataList, optionsList, propsList) { + buildData(el, dataList) + + if (el.options && el.options.length) { + buildOptions(el, optionsList) + } + + if (el.props && el.props.props) { + buildProps(el, propsList) + } + + // if (el.children) { + // el.children.forEach(el2 => { + // buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + // }) + // } +} + +function buildData(conf, dataList) { + let value + if (typeof (conf.value) === 'string' && !conf.multiple) { + value = `'${conf.value}'` + } else { + value = `${JSON.stringify(conf.value)}` + } + if(typeof(value) === 'undefined'||value === 'undefined') value = `''`; + console.log(value); + dataList.push(`${conf.id}: ${value},`) +} + +function buildOptions(conf, optionsList) { + const str = `${conf.id}Options: ${JSON.stringify(conf.options)},` + optionsList.push(str) +} + +function buildProps(conf, propsList) { + const str = `${conf.id}Props: ${JSON.stringify(conf.props.props)},` + propsList.push(str) +} + +function buildexport(conf, data, props) { + const str = `export default { + components: {}, + props: [], + data () { + return { + ${conf.formModel}: { + ${data} + } + } + }, + computed: {}, + watch: {}, + created () {}, + mounted () {}, +}` + return str +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/icon.vue b/ruoyi-ui/src/components/FormDesigner/icon.vue new file mode 100644 index 00000000..57e7a335 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/icon.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/iconDialog.vue b/ruoyi-ui/src/components/FormDesigner/iconDialog.vue new file mode 100644 index 00000000..8c5cfdb4 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/iconDialog.vue @@ -0,0 +1,106 @@ + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/index.js b/ruoyi-ui/src/components/FormDesigner/index.js new file mode 100644 index 00000000..16e84e15 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/index.js @@ -0,0 +1,23 @@ +import formDesigner from './formDesigner'; +import fancyEditor from './extend/fancyEditor'; +import fancyHtml from './extend/fancyHtml'; +import fancyText from './extend/fancyText'; +import fancyBarCode from 'vue-barcode'; +import fancyDialogList from './extend/fancyDialogList'; +import iconDialog from './iconDialog'; +const plugins = { + install : function (Vue) { + Vue.component('form-designer',formDesigner); + Vue.component('fancy-editor',fancyEditor); + Vue.component('fancy-html',fancyHtml); + Vue.component('fancy-text',fancyText); + Vue.component('fancy-bar-code',fancyBarCode); + Vue.component('fancy-dialog-list',fancyDialogList); + Vue.component('icon-dialog',iconDialog); + } +}; +// 这一步判断window.Vue是否存在,因为直接引用vue.min.js, 它会把Vue绑到Window上,我们直接引用打包好的js才能正常跑起来。 +if (typeof window !== 'undefined' && window.Vue) { + window.Vue.use(plugins); +} +export default plugins; \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/preview.vue b/ruoyi-ui/src/components/FormDesigner/preview.vue new file mode 100644 index 00000000..a5b9bcab --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/preview.vue @@ -0,0 +1,183 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/previewItem.vue b/ruoyi-ui/src/components/FormDesigner/previewItem.vue new file mode 100644 index 00000000..30530e6e --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/previewItem.vue @@ -0,0 +1,49 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/previewRowItem.vue b/ruoyi-ui/src/components/FormDesigner/previewRowItem.vue new file mode 100644 index 00000000..3181114e --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/previewRowItem.vue @@ -0,0 +1,27 @@ + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/processFormView.vue b/ruoyi-ui/src/components/FormDesigner/processFormView.vue new file mode 100644 index 00000000..18e1e985 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/processFormView.vue @@ -0,0 +1,147 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/style/designer.css b/ruoyi-ui/src/components/FormDesigner/style/designer.css new file mode 100644 index 00000000..b42ac2fe --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/style/designer.css @@ -0,0 +1,197 @@ + +body{ + margin:0px; +} +.container { + position: relative; + width: 100%; + height: 100%; +} +.left-board { + width: 260px; + position: absolute; + left: 0; + top: 0; + height: 100vh; +} +.d-logo-wrapper{ + position: relative; + height: 42px; + background: #ffffff; + border-bottom: 1px solid #f1e8e8; + box-sizing: border-box; +} +.d-logo{ + position: absolute; + left: 12px; + top: 6px; + line-height: 30px; + color: #409eff; + font-weight: 600; + font-size: 17px; + white-space: nowrap; +} +.d-logo img{ + width: 30px; + height: 30px; + vertical-align: top; +} +.components-title{ + font-size: 14px; + color: #222; + margin: 6px 6px; + font-weight:700 +} +.components-draggable{ + padding-bottom: 20px; +} +.components-list { + padding: 8px; + box-sizing: border-box; + height: 100%; +} +.components-list .components-item { + display: inline-block; + width: 48%; + margin: 1%; + transition: transform 0ms !important; +} +.components-body { + padding: 8px 10px; + background: #f4f6fc; + font-size: 12px; + margin-left: 5px; + padding-top: 5px; + cursor: move; + border: 1px solid #409eff; + border-radius: 3px; +} +.components-body:hover { + border: 1px dashed #f56c6c; + color: #f56c6c; +} +.center-board { + height: 100vh; + width: auto; + margin: 0 350px 0 260px; + box-sizing: border-box; +} +.empty-info{ + position: absolute; + top: 30%; + left: 0; + right: 0; + text-align: center; + font-size: 18px; + letter-spacing: 4px; +} +.action-bar{ + position: relative; + height: 42px; + text-align: right; + padding: 0 15px; + box-sizing: border-box;; + border: 1px solid #f1e8e8; + border-top: none; + border-left: none; + background: #ffffff; +} +.action-bar .el-button{ + font-size: 18px; + vertical-align: middle; + position: relative; + top: -1px; + color:#409EFF +} +.action-bar .delete-btn{ + color: #F56C6C; +} +.center-scrollbar { + height: calc(100vh - 42px); + overflow: hidden; + border-left: 1px solid #f1e8e8; + border-right: 1px solid #f1e8e8; + box-sizing: border-box; +} + +.center-board-row { + padding: 10px 12px 100px 12px; + box-sizing: border-box; +} +.center-board-row .el-form { + height: calc(100vh - 69px); +} + +.dynamic-table{ + margin: 0px; + height: auto; + min-height: 120px; + padding: 10px 0px; +} +.dynamic-table__content{ + width:100%; + height:100%; + display: flex; + overflow-y: hidden; + outline: 1px dashed #ccc; + outline-offset: -1px; + min-height: 100px; + float:left +} +.dynamic-table__item { + margin:1px; + padding-top:5px; + border: 1px solid #EBEEF5; + background:#f2f6fc; + border-radius: 2px; +} +.dynamic-table__item:hover { + border: 1px solid #409EFF; +} +.dynamic-table__item_title{ + width:100%; + padding-top:8px; + line-height: 23px; + text-align: center; + border-bottom: 1px solid #EBEEF5; + font-size: 14px; + color:#606266; + height:30px; +} +.dynamic-table__item_body{ + padding:10px; + text-align: center; +} +.table__content{ + width:100%; + height:100%; + overflow-y: hidden; + outline: 1px dashed #ccc; + outline-offset: -1px; + min-height: 100px; + float:left +} +.el-radio:last-child { + margin-right:30px; +} +.el-checkbox:last-of-type{ + margin-right:30px; +} +.el-rate{ + margin-top:10px; +} + +.component-id{ + position: absolute; + top: 0; + left: 0; + font-size: 12px; + color: #bbb; + display: inline-block; + margin: 0 6px; +} + +/* .dynamic-table.active{ + border-left: 3px solid #409eff; + background:#ecf5ff +} */ \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/style/designer.scss b/ruoyi-ui/src/components/FormDesigner/style/designer.scss new file mode 100644 index 00000000..4b4f50a7 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/style/designer.scss @@ -0,0 +1,304 @@ +$selectedColor: #e6f2ff; +$lighterBlue: #409EFF; +.drawing-board { + height: 100%; + position: relative; + border:1px dashed #ccc; + .components-body { + padding: 0; + margin: 0; + font-size: 0; + } + .sortable-ghost { + position: relative; + display: block; + overflow: hidden; + &::before { + content: " "; + position: absolute; + left: 0; + right: 0; + top: 0; + height: 3px; + background: #409EFF; + z-index: 2; + } + } + .components-item.sortable-ghost { + width: 100%; + height: 5px; + background-color: $selectedColor; + } + .drawing-item.sortable-ghost { + width: 100%; + height: 5px; + background-color: $selectedColor; + } + .active-from-item { + & > .el-form-item{ + background: $selectedColor; + border-radius:6px; + margin-top:15px; + } + & > .dynamic-table{ + background: $selectedColor; + border-radius:6px; + } + & > .drawing-item-copy, & > .drawing-item-delete{ + display: initial; + } + & > .component-name{ + color: $lighterBlue; + } + } + + .el-form-item{ + margin-bottom: 5px; + } +} +.drawing-item{ + position: relative; + cursor: move; + &.unfocus-bordered:not(.active-from-item) > div:first-child { + border: 1px dashed #ccc; + } + .el-form-item{ + padding: 12px 10px; + margin-top:15px; + } +} +.drawing-item{ + position: relative; + border: 1px dashed #ccc; + cursor: move; + .dynamic-table{ + padding: 12px 5px; + + } +} +.drawing-row-item{ + position: relative; + cursor: move; + box-sizing: border-box; + border: 1px dashed #ccc; + border-radius: 3px; + padding: 0 2px; + margin-bottom: 15px; + .el-col{ + margin-top: 15px; + } + .el-form-item{ + margin-bottom: 15px; + } + .drag-wrapper{ + min-height: 80px; + } + .drag-col-wrapper{ + height: auto; + border: 1px dashed #ccc; + } + &.active-from-item{ + border: 2px solid #e6a23c; + + } + .component-name{ + position: absolute; + top: 0; + left: 0; + font-size: 12px; + color: #bbb; + display: inline-block; + padding: 0 6px; + } +} +.drawing-item, .drawing-row-item{ + &:hover { + & > .el-form-item{ + background: #ebeef5; + } + & > .drawing-item-copy, & > .drawing-item-delete{ + display: initial; + } + } + & > .drawing-item-copy, & > .drawing-item-delete{ + display: none; + position: absolute; + top: -10px; + width: 22px; + height: 22px; + line-height: 22px; + text-align: center; + border-radius: 50%; + font-size: 12px; + border: 1px solid; + cursor: pointer; + z-index: 1; + } + & > .drawing-item-copy{ + right: 56px; + border-color: $lighterBlue; + color: $lighterBlue; + background: #fff; + &:hover{ + background: $lighterBlue; + color: #fff; + } + } + & > .drawing-item-delete{ + right: 24px; + border-color: #F56C6C; + color: #F56C6C; + background: #fff; + &:hover{ + background: #F56C6C; + color: #fff; + } + } +} +.drawing-item, .drawing-form-item{ + &:hover { + & > .el-form-item{ + background: #ebeef5; + } + & > .drawing-item-copy, & > .drawing-item-delete{ + display: initial; + } + } + & > .drawing-item-copy, & > .drawing-item-delete{ + display: none; + position: absolute; + top: -10px; + width: 22px; + height: 22px; + line-height: 22px; + text-align: center; + border-radius: 50%; + font-size: 12px; + border: 1px solid; + cursor: pointer; + z-index: 1; + } + & > .drawing-item-copy{ + right: 56px; + border-color: $lighterBlue; + color: $lighterBlue; + background: #fff; + &:hover{ + background: $lighterBlue; + color: #fff; + } + } + & > .drawing-item-delete{ + right: 24px; + border-color: #F56C6C; + color: #F56C6C; + background: #fff; + &:hover{ + background: #F56C6C; + color: #fff; + } + } +} +.right-board { + width: 350px; + position: absolute; + right: 0; + top: 0; + padding-top: 3px; + .field-box { + position: relative; + height: calc(100vh - 42px); + box-sizing: border-box; + overflow: hidden; + } + .el-scrollbar { + height: 100%; + } +} +.select-item { + display: flex; + border: 1px dashed #fff; + box-sizing: border-box; + & .close-btn { + cursor: pointer; + color: #f56c6c; + } + & .el-input + .el-input { + margin-left: 4px; + } +} +.select-item + .select-item { + margin-top: 4px; +} +.select-item.sortable-chosen { + border: 1px dashed #409eff; +} +.select-line-icon { + line-height: 32px; + font-size: 22px; + padding: 0 4px; + color: #777; +} +.option-drag { + cursor: move; +} +.time-range { + .el-date-editor { + width: 227px; + } + ::v-deep .el-icon-time { + display: none; + } +} +.document-link { + position: absolute; + display: block; + width: 26px; + height: 26px; + top: 0; + left: 0; + cursor: pointer; + background: #409eff; + z-index: 1; + border-radius: 0 0 6px 0; + text-align: center; + line-height: 26px; + color: #fff; + font-size: 18px; +} +.node-label{ + font-size: 14px; +} +.node-icon{ + color: #bebfc3; +} +.center-tabs{ + .el-tabs__header{ + margin-bottom: 0!important; + } + .el-tabs__item{ + width: 100%; + text-align: center; + } + .el-tabs__nav{ + width: 100%; + } +} +.right-scrollbar { + .el-scrollbar__view { + padding: 12px 18px 15px 15px; + } +} +.drawing-row-item .el-col{ + margin-bottom:5px; +} +.components-item.dynamicGhost { + width: 5px; + height: 120px; + background-color: #409EFF; +} +.dynamic-table_item.dynamicGhost { + width: 5px; + height: 120px; + background-color: #409EFF; +} diff --git a/ruoyi-ui/src/components/FormDesigner/table/fancyEditTable.vue b/ruoyi-ui/src/components/FormDesigner/table/fancyEditTable.vue new file mode 100644 index 00000000..79dd03b1 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/table/fancyEditTable.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/table/fancyEditTableItem.vue b/ruoyi-ui/src/components/FormDesigner/table/fancyEditTableItem.vue new file mode 100644 index 00000000..83383026 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/table/fancyEditTableItem.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/table/fancyTable.vue b/ruoyi-ui/src/components/FormDesigner/table/fancyTable.vue new file mode 100644 index 00000000..bcdcd2cc --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/table/fancyTable.vue @@ -0,0 +1,265 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/table/fancyTableItem.vue b/ruoyi-ui/src/components/FormDesigner/table/fancyTableItem.vue new file mode 100644 index 00000000..f3238543 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/table/fancyTableItem.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/table/table.js b/ruoyi-ui/src/components/FormDesigner/table/table.js new file mode 100644 index 00000000..cd568d53 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/table/table.js @@ -0,0 +1,44 @@ +import {getSimpleId} from "../utils/IdGenerate"; +import constant from '../utils/constants' +import {jsonClone} from "../utils"; + +let tdItemObj = { + id:'', + col:1, + row:1, + hide:false, + compType:'tdItem', + style:{ + background:constant.defaultTdBackgroundColor, + width:35 + }, + columns:[] + } + +export function getTdItem(){ + let tdItem = cloneObj(tdItemObj); + tdItem.id = getSimpleId(); + return tdItem; +} +export function getTitleTdItem(){ + let tdItem = cloneObj(tdItemObj); + tdItem.style.background = constant.defaultTitleTdBackgroundColor; + tdItem.style.width = 15; + tdItem.id = getSimpleId(); + return tdItem; +} + +function cloneObj(source){ + let target = jsonClone(source); + target.id = getSimpleId(); + return target; +} + +export function getTrItem(){ + let trItem= [getTitleTdItem(),getTdItem(),getTitleTdItem(),getTdItem()]; + return trItem; +} +export function getDefaultTrs(){ + let trs = [getTrItem(),getTrItem()]; + return trs; +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/utils/IdGenerate.js b/ruoyi-ui/src/components/FormDesigner/utils/IdGenerate.js new file mode 100644 index 00000000..5474624d --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/utils/IdGenerate.js @@ -0,0 +1,17 @@ +export function getSimpleId(){ + sleep(10); //主要为了延时工作 + return new Date().getTime(); +} + +const sleep = function(time) { + const startTime = new Date().getTime() + parseInt(time, 10); + while(new Date().getTime() < startTime) {} +}; + +export function setTableId(table){ + table.layoutArray.map((tr,trIndex)=>{ + tr[0].id=getSimpleId(); + tr[1].id=getSimpleId(); + }) + return table; +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/utils/chinaAreaData.js b/ruoyi-ui/src/components/FormDesigner/utils/chinaAreaData.js new file mode 100644 index 00000000..e648d099 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/utils/chinaAreaData.js @@ -0,0 +1,33 @@ +import allData from 'china-area-data/v5/data'; + +export function areaData(){ + let options = []; + const allProvinceData = allData['86']; //得到全中国的省 + Object.keys(allProvinceData).forEach(key=>{ + let provinceObj={}; + provinceObj.label= allProvinceData[key]; + provinceObj.value= key; + const cityData = allData[key]; //市 + provinceObj.children = []; + Object.keys(cityData).forEach(ckey=>{ + let cityObj = {}; + cityObj.label = cityData[ckey]; + cityObj.value = ckey; + const areaData = allData[ckey]; //区 + if(typeof areaData !== 'undefined'){ + cityObj.children = []; + Object.keys(areaData).forEach(akey=>{ + let areaObj = {}; + areaObj.label = areaData[akey]; + areaObj.value = akey; + cityObj.children.push(areaObj); + }); + } + + provinceObj.children.push(cityObj); + }) + options.push(provinceObj); + }); + return options; +} + diff --git a/ruoyi-ui/src/components/FormDesigner/utils/constants.js b/ruoyi-ui/src/components/FormDesigner/utils/constants.js new file mode 100644 index 00000000..9a5c87df --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/utils/constants.js @@ -0,0 +1,7 @@ +/** + * js的常量就在这里 + */ +export default { + defaultTdBackgroundColor:'#FFFFFF', + defaultTitleTdBackgroundColor:'#F6F6F6' +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/utils/icon.json b/ruoyi-ui/src/components/FormDesigner/utils/icon.json new file mode 100644 index 00000000..07a240e8 --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/utils/icon.json @@ -0,0 +1,282 @@ +[ +"el-icon-platform-eleme", +"el-icon-eleme", +"el-icon-delete-solid", +"el-icon-delete", +"el-icon-s-tools", +"el-icon-setting", +"el-icon-user-solid", +"el-icon-user", +"el-icon-phone", +"el-icon-phone-outline", +"el-icon-more", +"el-icon-more-outline", +"el-icon-star-on", +"el-icon-star-off", +"el-icon-s-goods", +"el-icon-goods", +"el-icon-warning", +"el-icon-warning-outline", +"el-icon-question", +"el-icon-info", +"el-icon-remove", +"el-icon-circle-plus", +"el-icon-success", +"el-icon-error", +"el-icon-zoom-in", +"el-icon-zoom-out", +"el-icon-remove-outline", +"el-icon-circle-plus-outline", +"el-icon-circle-check", +"el-icon-circle-close", +"el-icon-s-help", +"el-icon-help", +"el-icon-minus", +"el-icon-plus", +"el-icon-check", +"el-icon-close", +"el-icon-picture", +"el-icon-picture-outline", +"el-icon-picture-outline-round", +"el-icon-upload", +"el-icon-upload2", +"el-icon-download", +"el-icon-camera-solid", +"el-icon-camera", +"el-icon-video-camera-solid", +"el-icon-video-camera", +"el-icon-message-solid", +"el-icon-bell", +"el-icon-s-cooperation", +"el-icon-s-order", +"el-icon-s-platform", +"el-icon-s-fold", +"el-icon-s-unfold", +"el-icon-s-operation", +"el-icon-s-promotion", +"el-icon-s-home", +"el-icon-s-release", +"el-icon-s-ticket", +"el-icon-s-management", +"el-icon-s-open", +"el-icon-s-shop", +"el-icon-s-marketing", +"el-icon-s-flag", +"el-icon-s-comment", +"el-icon-s-finance", +"el-icon-s-claim", +"el-icon-s-custom", +"el-icon-s-opportunity", +"el-icon-s-data", +"el-icon-s-check", +"el-icon-s-grid", +"el-icon-menu", +"el-icon-share", +"el-icon-d-caret", +"el-icon-caret-left", +"el-icon-caret-right", +"el-icon-caret-bottom", +"el-icon-caret-top", +"el-icon-bottom-left", +"el-icon-bottom-right", +"el-icon-back", +"el-icon-right", +"el-icon-bottom", +"el-icon-top", +"el-icon-top-left", +"el-icon-top-right", +"el-icon-arrow-left", +"el-icon-arrow-right", +"el-icon-arrow-down", +"el-icon-arrow-up", +"el-icon-d-arrow-left", +"el-icon-d-arrow-right", +"el-icon-video-pause", +"el-icon-video-play", +"el-icon-refresh", +"el-icon-refresh-right", +"el-icon-refresh-left", +"el-icon-finished", +"el-icon-sort", +"el-icon-sort-up", +"el-icon-sort-down", +"el-icon-rank", +"el-icon-loading", +"el-icon-view", +"el-icon-c-scale-to-original", +"el-icon-date", +"el-icon-edit", +"el-icon-edit-outline", +"el-icon-folder", +"el-icon-folder-opened", +"el-icon-folder-add", +"el-icon-folder-remove", +"el-icon-folder-delete", +"el-icon-folder-checked", +"el-icon-tickets", +"el-icon-document-remove", +"el-icon-document-delete", +"el-icon-document-copy", +"el-icon-document-checked", +"el-icon-document", +"el-icon-document-add", +"el-icon-printer", +"el-icon-paperclip", +"el-icon-takeaway-box", +"el-icon-search", +"el-icon-monitor", +"el-icon-attract", +"el-icon-mobile", +"el-icon-scissors", +"el-icon-umbrella", +"el-icon-headset", +"el-icon-brush", +"el-icon-mouse", +"el-icon-coordinate", +"el-icon-magic-stick", +"el-icon-reading", +"el-icon-data-line", +"el-icon-data-board", +"el-icon-pie-chart", +"el-icon-data-analysis", +"el-icon-collection-tag", +"el-icon-film", +"el-icon-suitcase", +"el-icon-suitcase-1", +"el-icon-receiving", +"el-icon-collection", +"el-icon-files", +"el-icon-notebook-1", +"el-icon-notebook-2", +"el-icon-toilet-paper", +"el-icon-office-building", +"el-icon-school", +"el-icon-table-lamp", +"el-icon-house", +"el-icon-no-smoking", +"el-icon-smoking", +"el-icon-shopping-cart-full", +"el-icon-shopping-cart-1", +"el-icon-shopping-cart-2", +"el-icon-shopping-bag-1", +"el-icon-shopping-bag-2", +"el-icon-sold-out", +"el-icon-sell", +"el-icon-present", +"el-icon-box", +"el-icon-bank-card", +"el-icon-money", +"el-icon-coin", +"el-icon-wallet", +"el-icon-discount", +"el-icon-price-tag", +"el-icon-news", +"el-icon-guide", +"el-icon-male", +"el-icon-female", +"el-icon-thumb", +"el-icon-cpu", +"el-icon-link", +"el-icon-connection", +"el-icon-open", +"el-icon-turn-off", +"el-icon-set-up", +"el-icon-chat-round", +"el-icon-chat-line-round", +"el-icon-chat-square", +"el-icon-chat-dot-round", +"el-icon-chat-dot-square", +"el-icon-chat-line-square", +"el-icon-message", +"el-icon-postcard", +"el-icon-position", +"el-icon-turn-off-microphone", +"el-icon-microphone", +"el-icon-close-notification", +"el-icon-bangzhu", +"el-icon-time", +"el-icon-odometer", +"el-icon-crop", +"el-icon-aim", +"el-icon-switch-button", +"el-icon-full-screen", +"el-icon-copy-document", +"el-icon-mic", +"el-icon-stopwatch", +"el-icon-medal-1", +"el-icon-medal", +"el-icon-trophy", +"el-icon-trophy-1", +"el-icon-first-aid-kit", +"el-icon-discover", +"el-icon-place", +"el-icon-location", +"el-icon-location-outline", +"el-icon-location-information", +"el-icon-add-location", +"el-icon-delete-location", +"el-icon-map-location", +"el-icon-alarm-clock", +"el-icon-timer", +"el-icon-watch-1", +"el-icon-watch", +"el-icon-lock", +"el-icon-unlock", +"el-icon-key", +"el-icon-service", +"el-icon-mobile-phone", +"el-icon-bicycle", +"el-icon-truck", +"el-icon-ship", +"el-icon-basketball", +"el-icon-football", +"el-icon-soccer", +"el-icon-baseball", +"el-icon-wind-power", +"el-icon-light-rain", +"el-icon-lightning", +"el-icon-heavy-rain", +"el-icon-sunrise", +"el-icon-sunrise-1", +"el-icon-sunset", +"el-icon-sunny", +"el-icon-cloudy", +"el-icon-partly-cloudy", +"el-icon-cloudy-and-sunny", +"el-icon-moon", +"el-icon-moon-night", +"el-icon-dish", +"el-icon-dish-1", +"el-icon-food", +"el-icon-chicken", +"el-icon-fork-spoon", +"el-icon-knife-fork", +"el-icon-burger", +"el-icon-tableware", +"el-icon-sugar", +"el-icon-dessert", +"el-icon-ice-cream", +"el-icon-hot-water", +"el-icon-water-cup", +"el-icon-coffee-cup", +"el-icon-cold-drink", +"el-icon-goblet", +"el-icon-goblet-full", +"el-icon-goblet-square", +"el-icon-goblet-square-full", +"el-icon-refrigerator", +"el-icon-grape", +"el-icon-watermelon", +"el-icon-cherry", +"el-icon-apple", +"el-icon-pear", +"el-icon-orange", +"el-icon-coffee", +"el-icon-ice-tea", +"el-icon-ice-drink", +"el-icon-milk-tea", +"el-icon-potato-strips", +"el-icon-lollipop", +"el-icon-ice-cream-square", +"el-icon-ice-cream-round" +] \ No newline at end of file diff --git a/ruoyi-ui/src/components/FormDesigner/utils/index.js b/ruoyi-ui/src/components/FormDesigner/utils/index.js new file mode 100644 index 00000000..d900a9ef --- /dev/null +++ b/ruoyi-ui/src/components/FormDesigner/utils/index.js @@ -0,0 +1,138 @@ +export function makeMap(str, expectsLowerCase) { + const map = Object.create(null) + const list = str.split(',') + for (let i = 0; i < list.length; i++) { + map[list[i]] = true + } + return expectsLowerCase + ? val => map[val.toLowerCase()] + : val => map[val] +} + +/** + * num 小于0,左缩进num*2个空格; 大于0,右缩进num*2个空格。 + * @param {string} str 代码 + * @param {number} num 缩进次数 + * @param {number} len 【可选】缩进单位,空格数 + */ +export function indent(str, num, len = 2) { + if (num === 0) return str + const isLeft = num < 0; const result = []; let reg; let + spaces = '' + if (isLeft) { + num *= -1 + reg = new RegExp(`(^\\s{0,${num * len}})`, 'g') + } else { + for (let i = 0; i < num * len; i++) spaces += ' ' + } + + str.split('\n').forEach(line => { + line = isLeft ? line.replace(reg, '') : spaces + line + result.push(line) + }) + return result.join('\n') +} + +// 首字母大小 +export function titleCase(str) { + return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) +} + +// 下划转驼峰 +export function camelCase(str) { + return str.replace(/-[a-z]/g, str1 => str1.substr(-1).toUpperCase()) +} + +export function isNumberStr(str) { + return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) +} + + +export const beautifierConf = { + html: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'separate', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: false, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + }, + js: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'normal', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: true, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + } +} + +function stringify(obj) { + return JSON.stringify(obj, (key, val) => { + if (typeof val === 'function') { + return `${val}` + } + return val + }) +} + +function parse(str) { + return JSON.parse(str, (k, v) => { + if (v!==null&&v.indexOf && v.indexOf('function') > -1) { + return eval(`(${v})`) + } + return v + }) +} + +export function jsonClone(obj) { + return parse(stringify(obj)); +} + +export function isLayout(obj) { + return obj.compType === 'row'; +} +export function isTable(obj) { + return obj.compType === 'table'; +} +export function inTable(obj) { + return obj.col&&obj.row; +} + +export const isAttr = makeMap( + 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' + + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' + + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' + + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' + + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' + + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' + + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' + + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' + + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' + + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' + + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' + + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' + + 'target,title,type,usemap,value,width,wrap' +) \ No newline at end of file diff --git a/ruoyi-ui/src/components/PageTabs.vue b/ruoyi-ui/src/components/PageTabs.vue new file mode 100644 index 00000000..133daff8 --- /dev/null +++ b/ruoyi-ui/src/components/PageTabs.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/ruoyi-ui/src/components/Process/Back.vue b/ruoyi-ui/src/components/Process/Back.vue new file mode 100644 index 00000000..dc7f0304 --- /dev/null +++ b/ruoyi-ui/src/components/Process/Back.vue @@ -0,0 +1,99 @@ + + diff --git a/ruoyi-ui/src/components/Process/History.vue b/ruoyi-ui/src/components/Process/History.vue new file mode 100644 index 00000000..6f691194 --- /dev/null +++ b/ruoyi-ui/src/components/Process/History.vue @@ -0,0 +1,117 @@ + + + + diff --git a/ruoyi-ui/src/components/Process/Verify.vue b/ruoyi-ui/src/components/Process/Verify.vue new file mode 100644 index 00000000..8bf936e5 --- /dev/null +++ b/ruoyi-ui/src/components/Process/Verify.vue @@ -0,0 +1,546 @@ + + diff --git a/ruoyi-ui/src/layout/components/AppMain.vue b/ruoyi-ui/src/layout/components/AppMain.vue index 25d5a25a..7316d900 100644 --- a/ruoyi-ui/src/layout/components/AppMain.vue +++ b/ruoyi-ui/src/layout/components/AppMain.vue @@ -1,61 +1,62 @@ - - - - - - - + + + + + + + diff --git a/ruoyi-ui/src/layout/index.vue b/ruoyi-ui/src/layout/index.vue index 202cfcd6..16366a88 100644 --- a/ruoyi-ui/src/layout/index.vue +++ b/ruoyi-ui/src/layout/index.vue @@ -1,111 +1,111 @@ - - - - - + + + + + diff --git a/ruoyi-ui/src/views/components/approvalForm.vue b/ruoyi-ui/src/views/components/approvalForm.vue new file mode 100644 index 00000000..664cd9de --- /dev/null +++ b/ruoyi-ui/src/views/components/approvalForm.vue @@ -0,0 +1,96 @@ + + + + diff --git a/ruoyi-ui/src/views/components/dept/sys-dept.vue b/ruoyi-ui/src/views/components/dept/sys-dept.vue new file mode 100644 index 00000000..ba5d6817 --- /dev/null +++ b/ruoyi-ui/src/views/components/dept/sys-dept.vue @@ -0,0 +1,115 @@ + + + diff --git a/ruoyi-ui/src/views/components/echarts-3d.vue b/ruoyi-ui/src/views/components/echarts-3d.vue new file mode 100644 index 00000000..93b79eca --- /dev/null +++ b/ruoyi-ui/src/views/components/echarts-3d.vue @@ -0,0 +1,236 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/components/form/dynamicFormEdit.vue b/ruoyi-ui/src/views/components/form/dynamicFormEdit.vue new file mode 100644 index 00000000..3e8f8f4a --- /dev/null +++ b/ruoyi-ui/src/views/components/form/dynamicFormEdit.vue @@ -0,0 +1,282 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/components/form/leaveForm.vue b/ruoyi-ui/src/views/components/form/leaveForm.vue new file mode 100644 index 00000000..e61b8900 --- /dev/null +++ b/ruoyi-ui/src/views/components/form/leaveForm.vue @@ -0,0 +1,159 @@ + + + diff --git a/ruoyi-ui/src/views/components/role/sys-role.vue b/ruoyi-ui/src/views/components/role/sys-role.vue new file mode 100644 index 00000000..9d31f7cc --- /dev/null +++ b/ruoyi-ui/src/views/components/role/sys-role.vue @@ -0,0 +1,202 @@ + + + diff --git a/ruoyi-ui/src/views/components/user/choose-workflow-user .vue b/ruoyi-ui/src/views/components/user/choose-workflow-user .vue new file mode 100644 index 00000000..6db5afe7 --- /dev/null +++ b/ruoyi-ui/src/views/components/user/choose-workflow-user .vue @@ -0,0 +1,243 @@ + + + + diff --git a/ruoyi-ui/src/views/components/user/multi-user.vue b/ruoyi-ui/src/views/components/user/multi-user.vue new file mode 100644 index 00000000..d674646a --- /dev/null +++ b/ruoyi-ui/src/views/components/user/multi-user.vue @@ -0,0 +1,275 @@ + + + diff --git a/ruoyi-ui/src/views/components/user/sys-dept-user.vue b/ruoyi-ui/src/views/components/user/sys-dept-user.vue new file mode 100644 index 00000000..115d24a9 --- /dev/null +++ b/ruoyi-ui/src/views/components/user/sys-dept-user.vue @@ -0,0 +1,272 @@ + + + diff --git a/ruoyi-ui/src/views/components/user/sys-user.vue b/ruoyi-ui/src/views/components/user/sys-user.vue new file mode 100644 index 00000000..cfed5fd9 --- /dev/null +++ b/ruoyi-ui/src/views/components/user/sys-user.vue @@ -0,0 +1,267 @@ + + + + diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 1fe06763..3537e5e3 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -1,875 +1,79 @@ - - - - - - + + + + + diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 074fecd3..84eb9806 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -1,219 +1,216 @@ - - - - - + + + + + diff --git a/ruoyi-ui/src/views/register.vue b/ruoyi-ui/src/views/register.vue index d8ec3c18..762d97f6 100644 --- a/ruoyi-ui/src/views/register.vue +++ b/ruoyi-ui/src/views/register.vue @@ -1,209 +1,206 @@ - - - - - + + + + + diff --git a/ruoyi-ui/src/views/work/components/custInfo/components/bg.png b/ruoyi-ui/src/views/work/components/custInfo/components/bg.png new file mode 100644 index 00000000..ddfb0d52 Binary files /dev/null and b/ruoyi-ui/src/views/work/components/custInfo/components/bg.png differ diff --git a/ruoyi-ui/src/views/work/components/custInfo/components/headerName.vue b/ruoyi-ui/src/views/work/components/custInfo/components/headerName.vue new file mode 100644 index 00000000..2a0e2d1b --- /dev/null +++ b/ruoyi-ui/src/views/work/components/custInfo/components/headerName.vue @@ -0,0 +1,96 @@ + + + + + + + diff --git a/ruoyi-ui/src/views/work/components/custInfo/components/index.vue b/ruoyi-ui/src/views/work/components/custInfo/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/custInfo/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/custInfo/components/property-analysis.vue b/ruoyi-ui/src/views/work/components/custInfo/components/property-analysis.vue new file mode 100644 index 00000000..46ee948e --- /dev/null +++ b/ruoyi-ui/src/views/work/components/custInfo/components/property-analysis.vue @@ -0,0 +1,350 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/work/components/custInfo/components/riskOverview.vue b/ruoyi-ui/src/views/work/components/custInfo/components/riskOverview.vue new file mode 100644 index 00000000..a86a290c --- /dev/null +++ b/ruoyi-ui/src/views/work/components/custInfo/components/riskOverview.vue @@ -0,0 +1,350 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/custInfo/custInfo.vue b/ruoyi-ui/src/views/work/components/custInfo/custInfo.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/custInfo/custInfo.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/duty/components/index.vue b/ruoyi-ui/src/views/work/components/duty/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/duty/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/duty/index.vue b/ruoyi-ui/src/views/work/components/duty/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/duty/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/loan/components/index.vue b/ruoyi-ui/src/views/work/components/loan/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/loan/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/loan/loanSurvey.vue b/ruoyi-ui/src/views/work/components/loan/loanSurvey.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/loan/loanSurvey.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/process/components/index.vue b/ruoyi-ui/src/views/work/components/process/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/process/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/process/processShow.vue b/ruoyi-ui/src/views/work/components/process/processShow.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/process/processShow.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/product/components/index.vue b/ruoyi-ui/src/views/work/components/product/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/product/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/product/productDesign.vue b/ruoyi-ui/src/views/work/components/product/productDesign.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/product/productDesign.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/risk/components/index.vue b/ruoyi-ui/src/views/work/components/risk/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/risk/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/risk/riskSurvey.vue b/ruoyi-ui/src/views/work/components/risk/riskSurvey.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/risk/riskSurvey.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/touch/components/index.vue b/ruoyi-ui/src/views/work/components/touch/components/index.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/touch/components/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/components/touch/touchCust.vue b/ruoyi-ui/src/views/work/components/touch/touchCust.vue new file mode 100644 index 00000000..1c066b6f --- /dev/null +++ b/ruoyi-ui/src/views/work/components/touch/touchCust.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/ruoyi-ui/src/views/work/index.vue b/ruoyi-ui/src/views/work/index.vue new file mode 100644 index 00000000..999e9678 --- /dev/null +++ b/ruoyi-ui/src/views/work/index.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/ruoyi-ui/src/views/workflow/businessForm/dynamicFormEdit.vue b/ruoyi-ui/src/views/workflow/businessForm/dynamicFormEdit.vue new file mode 100644 index 00000000..caccf1d3 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/businessForm/dynamicFormEdit.vue @@ -0,0 +1,255 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/workflow/businessForm/dynamicFormView.vue b/ruoyi-ui/src/views/workflow/businessForm/dynamicFormView.vue new file mode 100644 index 00000000..bf63561d --- /dev/null +++ b/ruoyi-ui/src/views/workflow/businessForm/dynamicFormView.vue @@ -0,0 +1,149 @@ + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/workflow/businessForm/index.vue b/ruoyi-ui/src/views/workflow/businessForm/index.vue new file mode 100644 index 00000000..40931705 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/businessForm/index.vue @@ -0,0 +1,419 @@ + + + + diff --git a/ruoyi-ui/src/views/workflow/businessRule/index.vue b/ruoyi-ui/src/views/workflow/businessRule/index.vue new file mode 100644 index 00000000..41e2d867 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/businessRule/index.vue @@ -0,0 +1,370 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processDeploy.vue b/ruoyi-ui/src/views/workflow/definition/components/processDeploy.vue new file mode 100644 index 00000000..bd10c36b --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processDeploy.vue @@ -0,0 +1,34 @@ + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processFormList.vue b/ruoyi-ui/src/views/workflow/definition/components/processFormList.vue new file mode 100644 index 00000000..8324abdd --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processFormList.vue @@ -0,0 +1,249 @@ + + + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processHisList.vue b/ruoyi-ui/src/views/workflow/definition/components/processHisList.vue new file mode 100644 index 00000000..4ea4a8a8 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processHisList.vue @@ -0,0 +1,276 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processPreview.vue b/ruoyi-ui/src/views/workflow/definition/components/processPreview.vue new file mode 100644 index 00000000..059f7f0e --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processPreview.vue @@ -0,0 +1,79 @@ + + + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processRule.vue b/ruoyi-ui/src/views/workflow/definition/components/processRule.vue new file mode 100644 index 00000000..67fa8bd8 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processRule.vue @@ -0,0 +1,129 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/definition/components/processSetting.vue b/ruoyi-ui/src/views/workflow/definition/components/processSetting.vue new file mode 100644 index 00000000..57e3e244 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/components/processSetting.vue @@ -0,0 +1,412 @@ + + + + + + + diff --git a/ruoyi-ui/src/views/workflow/definition/index.vue b/ruoyi-ui/src/views/workflow/definition/index.vue new file mode 100644 index 00000000..6c48822c --- /dev/null +++ b/ruoyi-ui/src/views/workflow/definition/index.vue @@ -0,0 +1,382 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormDesigner.vue b/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormDesigner.vue new file mode 100644 index 00000000..be870c0e --- /dev/null +++ b/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormDesigner.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormEnableList.vue b/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormEnableList.vue new file mode 100644 index 00000000..e55e5712 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/dynamicForm/dynamicFormEnableList.vue @@ -0,0 +1,262 @@ + + + + diff --git a/ruoyi-ui/src/views/workflow/dynamicForm/index.vue b/ruoyi-ui/src/views/workflow/dynamicForm/index.vue new file mode 100644 index 00000000..b04a6e60 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/dynamicForm/index.vue @@ -0,0 +1,303 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/instance/finish.vue b/ruoyi-ui/src/views/workflow/instance/finish.vue new file mode 100644 index 00000000..3cde7ba8 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/instance/finish.vue @@ -0,0 +1,137 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/instance/running.vue b/ruoyi-ui/src/views/workflow/instance/running.vue new file mode 100644 index 00000000..1d824038 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/instance/running.vue @@ -0,0 +1,233 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/message/index.vue b/ruoyi-ui/src/views/workflow/message/index.vue new file mode 100644 index 00000000..538dde00 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/message/index.vue @@ -0,0 +1,392 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/model/bpmnJs.vue b/ruoyi-ui/src/views/workflow/model/bpmnJs.vue new file mode 100644 index 00000000..e2c4215c --- /dev/null +++ b/ruoyi-ui/src/views/workflow/model/bpmnJs.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/ruoyi-ui/src/views/workflow/model/design.vue b/ruoyi-ui/src/views/workflow/model/design.vue new file mode 100644 index 00000000..8bd1c046 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/model/design.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/ruoyi-ui/src/views/workflow/model/index.vue b/ruoyi-ui/src/views/workflow/model/index.vue new file mode 100644 index 00000000..a6bf1779 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/model/index.vue @@ -0,0 +1,266 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/model/index2.vue b/ruoyi-ui/src/views/workflow/model/index2.vue new file mode 100644 index 00000000..f41ce97c --- /dev/null +++ b/ruoyi-ui/src/views/workflow/model/index2.vue @@ -0,0 +1,255 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/task/finish.vue b/ruoyi-ui/src/views/workflow/task/finish.vue new file mode 100644 index 00000000..bf7a89db --- /dev/null +++ b/ruoyi-ui/src/views/workflow/task/finish.vue @@ -0,0 +1,111 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/task/personalFinish.vue b/ruoyi-ui/src/views/workflow/task/personalFinish.vue new file mode 100644 index 00000000..05e9945a --- /dev/null +++ b/ruoyi-ui/src/views/workflow/task/personalFinish.vue @@ -0,0 +1,111 @@ + + + diff --git a/ruoyi-ui/src/views/workflow/task/personalWaiting.vue b/ruoyi-ui/src/views/workflow/task/personalWaiting.vue new file mode 100644 index 00000000..b994341f --- /dev/null +++ b/ruoyi-ui/src/views/workflow/task/personalWaiting.vue @@ -0,0 +1,222 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/workflow/task/waiting.vue b/ruoyi-ui/src/views/workflow/task/waiting.vue new file mode 100644 index 00000000..a25f89e3 --- /dev/null +++ b/ruoyi-ui/src/views/workflow/task/waiting.vue @@ -0,0 +1,385 @@ + + + + diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 2506c93a..b39246a0 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -1,136 +1,136 @@ -'use strict' -const path = require('path') - -function resolve(dir) { - return path.join(__dirname, dir) -} - -const CompressionPlugin = require('compression-webpack-plugin') - -const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 - -const port = process.env.port || process.env.npm_config_port || 80 // 端口 - -// vue.config.js 配置说明 -//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions -// 这里只列一部分,具体配置参考文档 -module.exports = { - // 部署生产环境和开发环境下的URL。 - // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 - // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - publicPath: process.env.NODE_ENV === "production" ? "/" : "/", - // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) - outputDir: 'dist', - // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) - assetsDir: 'static', - // 是否开启eslint保存检测,有效值:ture | false | 'error' - lintOnSave: process.env.NODE_ENV === 'development', - // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 - productionSourceMap: false, - // webpack-dev-server 相关配置 - devServer: { - host: '0.0.0.0', - port: port, - open: true, - proxy: { - // detail: https://cli.vuejs.org/config/#devserver-proxy - [process.env.VUE_APP_BASE_API]: { - target: `http://localhost:8080`, - changeOrigin: true, - pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' - } - } - }, - disableHostCheck: true - }, - css: { - loaderOptions: { - sass: { - sassOptions: { outputStyle: "expanded" } - } - } - }, - configureWebpack: { - name: name, - resolve: { - alias: { - '@': resolve('src') - } - }, - plugins: [ - // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 - new CompressionPlugin({ - cache: false, // 不启用文件缓存 - test: /\.(js|css|html)?$/i, // 压缩文件格式 - filename: '[path].gz[query]', // 压缩后的文件名 - algorithm: 'gzip', // 使用gzip压缩 - minRatio: 0.8 // 压缩率小于1才会压缩 - }) - ], - }, - chainWebpack(config) { - config.plugins.delete('preload') // TODO: need test - config.plugins.delete('prefetch') // TODO: need test - - // set svg-sprite-loader - config.module - .rule('svg') - .exclude.add(resolve('src/assets/icons')) - .end() - config.module - .rule('icons') - .test(/\.svg$/) - .include.add(resolve('src/assets/icons')) - .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') - .options({ - symbolId: 'icon-[name]' - }) - .end() - - config - .when(process.env.NODE_ENV !== 'development', - config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() - config - .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single'), - { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './' //到根目录下 - } - } - ) - } -} +'use strict' +const path = require('path') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const CompressionPlugin = require('compression-webpack-plugin') + +const name = process.env.VUE_APP_TITLE || '智能作业系统' // 网页标题 + +const port = process.env.port || process.env.npm_config_port || 80 // 端口 + +// vue.config.js 配置说明 +//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions +// 这里只列一部分,具体配置参考文档 +module.exports = { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + publicPath: process.env.NODE_ENV === "production" ? "/" : "/", + // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) + outputDir: 'dist', + // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) + assetsDir: 'static', + // 是否开启eslint保存检测,有效值:ture | false | 'error' + lintOnSave: process.env.NODE_ENV === 'development', + // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 + productionSourceMap: false, + // webpack-dev-server 相关配置 + devServer: { + host: '0.0.0.0', + port: port, + open: true, + proxy: { + // detail: https://cli.vuejs.org/config/#devserver-proxy + [process.env.VUE_APP_BASE_API]: { + target: `http://14.10.8.153:9999`, + changeOrigin: true, + pathRewrite: { + ['^' + process.env.VUE_APP_BASE_API]: '' + } + } + }, + disableHostCheck: true + }, + css: { + loaderOptions: { + sass: { + sassOptions: { outputStyle: "expanded" } + } + } + }, + configureWebpack: { + name: name, + resolve: { + alias: { + '@': resolve('src') + } + }, + plugins: [ + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 + new CompressionPlugin({ + cache: false, // 不启用文件缓存 + test: /\.(js|css|html)?$/i, // 压缩文件格式 + filename: '[path].gz[query]', // 压缩后的文件名 + algorithm: 'gzip', // 使用gzip压缩 + minRatio: 0.8 // 压缩率小于1才会压缩 + }) + ], + }, + chainWebpack(config) { + config.plugins.delete('preload') // TODO: need test + config.plugins.delete('prefetch') // TODO: need test + + // set svg-sprite-loader + config.module + .rule('svg') + .exclude.add(resolve('src/assets/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/assets/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + config.optimization.runtimeChunk('single'), + { + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './' //到根目录下 + } + } + ) + } +}