Browse Source

自定义表单列表字段属性设置

lwx_v7
超级管理员 2 years ago
parent
commit
6d9ed85b68
  1. 16
      node_modules/.package-lock.json
  2. 4
      node_modules/sortablejs/README.md
  3. 1571
      node_modules/sortablejs/Sortable.js
  4. 4
      node_modules/sortablejs/Sortable.min.js
  5. 1571
      node_modules/sortablejs/modular/sortable.complete.esm.js
  6. 1572
      node_modules/sortablejs/modular/sortable.core.esm.js
  7. 1571
      node_modules/sortablejs/modular/sortable.esm.js
  8. 4
      node_modules/sortablejs/package.json
  9. 17
      package-lock.json
  10. 1
      package.json
  11. 108
      src/api/DesignForm/tableButton.ts
  12. 20
      src/api/DesignForm/type.ts
  13. 13
      src/types/components.d.ts
  14. 256
      src/utils/DesignForm/design.ts
  15. 1
      src/views/sysworkflow/lowcodepage/lowCodeFormPage.vue
  16. 457
      src/views/sysworkflow/lowcodepage/pageList.vue
  17. 14
      src/views/sysworkflow/lowcodepage/pageListHeadTools.vue
  18. 114
      src/views/sysworkflow/lowcodepage/pageSetUpDialog/controlSetup.vue
  19. 77
      src/views/sysworkflow/lowcodepage/pageSetUpDialog/fieldSetUp.vue
  20. 39
      src/views/taskplatform/taskmanagement/taskcustomerformnew.vue

16
node_modules/.package-lock.json

@ -8156,9 +8156,9 @@
} }
}, },
"node_modules/sortablejs": { "node_modules/sortablejs": {
"version": "1.14.0", "version": "1.15.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz", "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.15.2.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" "integrity": "sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA=="
}, },
"node_modules/source-map": { "node_modules/source-map": {
"version": "0.6.1", "version": "0.6.1",
@ -10185,6 +10185,16 @@
"vue": "^3.2.31" "vue": "^3.2.31"
} }
}, },
"node_modules/vuedraggable-es/node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"node_modules/vuedraggable/node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"node_modules/wcwidth": { "node_modules/wcwidth": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz",

4
node_modules/sortablejs/README.md

@ -54,12 +54,12 @@ Demo: http://sortablejs.github.io/Sortable/
Install with NPM: Install with NPM:
```bash ```bash
$ npm install sortablejs --save npm install sortablejs --save
``` ```
Install with Bower: Install with Bower:
```bash ```bash
$ bower install --save sortablejs bower install --save sortablejs
``` ```
Import into your project: Import into your project:

1571
node_modules/sortablejs/Sortable.js

File diff suppressed because it is too large

4
node_modules/sortablejs/Sortable.min.js

File diff suppressed because one or more lines are too long

1571
node_modules/sortablejs/modular/sortable.complete.esm.js

File diff suppressed because it is too large

1572
node_modules/sortablejs/modular/sortable.core.esm.js

File diff suppressed because it is too large

1571
node_modules/sortablejs/modular/sortable.esm.js

File diff suppressed because it is too large

4
node_modules/sortablejs/package.json

@ -1,7 +1,7 @@
{ {
"name": "sortablejs", "name": "sortablejs",
"exportName": "Sortable", "exportName": "Sortable",
"version": "1.14.0", "version": "1.15.2",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.4", "@babel/core": "^7.4.4",
"@babel/plugin-transform-object-assign": "^7.2.0", "@babel/plugin-transform-object-assign": "^7.2.0",
@ -19,7 +19,7 @@
"main": "./Sortable.min.js", "main": "./Sortable.min.js",
"module": "modular/sortable.esm.js", "module": "modular/sortable.esm.js",
"scripts": { "scripts": {
"build:umd": "NODE_ENV=umd rollup -c ./scripts/umd-build.js", "build:umd": "set NODE_ENV=umd&& rollup -c ./scripts/umd-build.js",
"build:umd:watch": "set NODE_ENV=umd&& rollup -w -c ./scripts/umd-build.js", "build:umd:watch": "set NODE_ENV=umd&& rollup -w -c ./scripts/umd-build.js",
"build:es": "set NODE_ENV=es&& rollup -c ./scripts/esm-build.js", "build:es": "set NODE_ENV=es&& rollup -c ./scripts/esm-build.js",
"build:es:watch": "set NODE_ENV=es&& rollup -w -c ./scripts/esm-build.js", "build:es:watch": "set NODE_ENV=es&& rollup -w -c ./scripts/esm-build.js",

17
package-lock.json

@ -30,6 +30,7 @@
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"pinia": "^2.1.6", "pinia": "^2.1.6",
"screenfull": "^6.0.0", "screenfull": "^6.0.0",
"sortablejs": "^1.15.2",
"spark-md5": "^3.0.2", "spark-md5": "^3.0.2",
"tinymce": "^6.8.1", "tinymce": "^6.8.1",
"ts-md5": "^1.3.1", "ts-md5": "^1.3.1",
@ -8565,9 +8566,9 @@
} }
}, },
"node_modules/sortablejs": { "node_modules/sortablejs": {
"version": "1.14.0", "version": "1.15.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz", "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.15.2.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" "integrity": "sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA=="
}, },
"node_modules/source-map": { "node_modules/source-map": {
"version": "0.6.1", "version": "0.6.1",
@ -10594,6 +10595,16 @@
"vue": "^3.2.31" "vue": "^3.2.31"
} }
}, },
"node_modules/vuedraggable-es/node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"node_modules/vuedraggable/node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"node_modules/wcwidth": { "node_modules/wcwidth": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz",

1
package.json

@ -61,6 +61,7 @@
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"pinia": "^2.1.6", "pinia": "^2.1.6",
"screenfull": "^6.0.0", "screenfull": "^6.0.0",
"sortablejs": "^1.15.2",
"spark-md5": "^3.0.2", "spark-md5": "^3.0.2",
"tinymce": "^6.8.1", "tinymce": "^6.8.1",
"ts-md5": "^1.3.1", "ts-md5": "^1.3.1",

108
src/api/DesignForm/tableButton.ts

@ -0,0 +1,108 @@
export interface tableButton {
id?: string;
name?: string;
field?: string;
types?: string;
attribute:string;
pattern?: string;
fieldClass?: string;
activeValue?: string;
inactiveValue?: string;
options?: optionsInfo[];
config?:any;
}
export interface optionsInfo {
label: string;
value: string;
}
export interface attrButton {
label: string;
key: string;
type: string;
size: string;
icon: string;
}
//表头操作
export const tableButtonList :attrButton[] = [
{
label: "新增",
key:"newAdd",
type:"primary",
size: "small",
icon: "editPen"
},
{
label: "批量删除",
key: "del",
type: "danger",
size: "small",
icon: "delete"
}
]
//记录操作
export const tableLogButtonList :attrButton[] = [
{
label: "查看",
key: "look",
type: "success",
size: "small",
icon: "view"
},
{
label: "编辑",
key: "edit",
type: "warning",
size: "small",
icon: "delete"
},
{
label: "删除",
key: "del",
type: "danger",
size: "small",
icon: "delete"
}
];
//记录操作
export const tableAttrLogButtonList :tableButton[] = [
{
// label: "多选",
// attribute:"checkbox"
id: "checkbox",
name: "多选",
field: "checkbox",
types: "-",
attribute:"",
pattern: "bigint",
fieldClass: "-",
activeValue: "",
inactiveValue: "",
options: []
},
{
id: "serialNumber",
name: "序号",
field: "index",
types: "-",
attribute:"",
pattern: "bigint",
fieldClass: "-",
activeValue: "",
inactiveValue: "",
options: []
},
{
id: "operate",
name: "操作",
field: "operate",
types: "-",
attribute:"",
pattern: "bigint",
fieldClass: "__control",
activeValue: "",
inactiveValue: "",
options: []
}
];

20
src/api/DesignForm/type.ts

@ -199,6 +199,24 @@ export interface editFlowFormStatus{
//自定义列表字段 //自定义列表字段
export interface formTableField{ export interface formTableField{
masterTable:formTabelStruct[]; masterTable:tableButtonEs[];
sunTable?:any; sunTable?:any;
} }
export interface tableButtonEs {
id?: string;
name?: string;
field?: string;
types?: string;
attribute:string;
pattern?: string;
fieldClass?: string;
activeValue?: string;
inactiveValue?: string;
options?: optionsInfo[];
config?:any;
}
export interface optionsInfo {
label: string;
value: string;
}

13
src/types/components.d.ts

@ -22,7 +22,6 @@ declare module '@vue/runtime-core' {
DiyIconfont: typeof import('./../components/DesignForm/public/expand/diy-iconfont.vue')['default'] DiyIconfont: typeof import('./../components/DesignForm/public/expand/diy-iconfont.vue')['default']
DragControl: typeof import('./../components/DesignForm/dragControl.vue')['default'] DragControl: typeof import('./../components/DesignForm/dragControl.vue')['default']
ElAffix: typeof import('element-plus/es')['ElAffix'] ElAffix: typeof import('element-plus/es')['ElAffix']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
@ -30,14 +29,12 @@ declare module '@vue/runtime-core' {
ElCard: typeof import('element-plus/es')['ElCard'] ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
@ -54,13 +51,11 @@ declare module '@vue/runtime-core' {
ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
@ -105,15 +100,7 @@ declare module '@vue/runtime-core' {
IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default'] IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpClose: typeof import('~icons/ep/close')['default'] IEpClose: typeof import('~icons/ep/close')['default']
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
IEpMessageBox: typeof import('~icons/ep/message-box')['default']
IEpOperation: typeof import('~icons/ep/operation')['default']
IEpPlus: typeof import('~icons/ep/plus')['default']
IEpRefresh: typeof import('~icons/ep/refresh')['default']
IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default'] IEpSetting: typeof import('~icons/ep/setting')['default']
IEpView: typeof import('~icons/ep/view')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
LayoutPage: typeof import('./../components/DesignForm/layoutPage/index.vue')['default'] LayoutPage: typeof import('./../components/DesignForm/layoutPage/index.vue')['default']
List: typeof import('./../components/DesignForm/public/form/components/list.vue')['default'] List: typeof import('./../components/DesignForm/public/form/components/list.vue')['default']

256
src/utils/DesignForm/design.ts

@ -0,0 +1,256 @@
import jsBeautify from 'js-beautify'
import SparkMD5 from 'spark-md5'
export const EDITTYPE: string = 'javascript' // 弹出编辑器可输入类型 json/javascript
/**
* Function
* @param fn
*/
function evil(fn: any) {
return new Function('return ' + fn)()
}
/**
*
* @param o
*/
function obj2string(o: any) {
let r: any = []
if (o === null) {
// 这里有个问题 因typeOf null=object,下面判断会报错
return null
}
if (typeof o === 'string') {
return (
'"' +
o
.replace(/([\\'\\"\\])/g, '\\$1')
.replace(/(\n)/g, '\\n')
.replace(/(\r)/g, '\\r')
.replace(/(\t)/g, '\\t') +
'"'
)
}
if (typeof o === 'object') {
if (!o.sort) {
for (const i in o) {
let iii: string = i
if (i.indexOf('-') !== -1) {
iii = `"${i}"`
}
//r.push(iii + ':' + obj2string(o[i]))
r.push(`${iii}:${obj2string(o[i])}`)
}
if (
!!document.all &&
!/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(
o.toString
)
) {
//r.push('toString:' + o.toString.toString())
r.push(`toString:${o.toString.toString()}`)
}
// r = '{' + r.join() + '}'
r = `{${r.join()}}`
} else {
for (let i: number = 0; i < o.length; i++) {
r.push(obj2string(o[i]))
}
// r = '[' + r.join() + ']'
r = `[${r.join()}]`
}
return r
}
return o && o.toString()
}
/**
*
* @param obj
* @param isBeautify
*/
export function objToStringify(obj: any, isBeautify?: boolean) {
if (EDITTYPE === 'javascript') {
if (isBeautify) {
return jsBeautify('opt=' + obj2string(obj), {
indent_size: 2,
brace_style: 'expand'
})
} else {
return obj2string(obj)
}
} else {
return isBeautify ? JSON.stringify(obj, null, 2) : JSON.stringify(obj)
}
}
/**
*
* @param string
*/
export function stringToObj(string: string) {
if (EDITTYPE === 'javascript') {
return evil(string)
} else {
return JSON.parse(string)
}
}
export function string2json(string: string) {
return JSON.parse(string || '{}')
}
export function json2string(obj: any, isBeautify?: boolean) {
return isBeautify ? JSON.stringify(obj, null, 2) : JSON.stringify(obj)
}
// ace编辑器相关
/**
* aceEdit编辑器相关配置
* @param data
* @param id
* @param type
*/
export const aceEdit = (data: any, id?: string, type?: string) => {
type = type ? type : 'javascript'
id = id ? id : 'editJson'
// @ts-ignore
const editor = ace.edit(id)
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
})
editor.setFontSize(14)
editor.setShowPrintMargin(false)
editor.session.setMode('ace/mode/' + type)
editor.setTheme('ace/theme/tomorrow_night')
editor.setValue(data)
return editor
}
/**
*
* @param val
*/
export const formatNumber = (val: any): number | undefined => {
// 将字符类数字转为数值类
if (typeof val === 'string' && /^\d+(\.\d+)?$/.test(val.toString())) {
// 为数字
return Number(val)
} else {
return val
}
}
/**
*
* @param val
*/
export const formatToString = (val: any): string | undefined => {
if (val !== undefined) {
return val.toString()
} else {
return val
}
}
/**
* {key:value}[{label:'key',value:'value'}]
* @param obj
*/
export const objectToArray = (obj: any): { [key: string]: any } => {
if (Object.prototype.toString.call(obj) === '[object Object]') {
const temp: any = []
for (const key in obj) {
temp.push({
label: obj[key],
value: key
})
}
return temp
}
return obj
}
/****
* css
* @param id id
* @param cssContent css内容
* @param append true插入false移除
*/
export const appendOrRemoveStyle = (
id: string,
cssContent: string,
append?: boolean
): void => {
const styleId: any = document.getElementById(id)
if (styleId && append) {
// 存在时直接修改,不用多次插入
styleId.innerText = cssContent
return
}
if (cssContent && append) {
const styleEl = document.createElement('style')
styleEl.id = id
styleEl.type = 'text/css'
styleEl.appendChild(document.createTextNode(cssContent))
document.head.appendChild(styleEl)
}
if (!append || !cssContent) {
// 移除
styleId && styleId.parentNode.removeChild(styleId)
}
}
/**
*
* @param item
* @param index //type=grid下初始时item都是一样的
*/
export const getGroupName = (item: any, index?: number): string => {
if (item.name) {
return item.name
} else {
const spark = new SparkMD5()
spark.append(JSON.stringify(item) + index)
return spark.end()
}
}
/**
*
*/
export const jsonParseStringify = (val: any) => {
if (typeof val === 'object') {
return JSON.parse(JSON.stringify(val))
} else {
return val
}
}
/**
*
*/
export const beforeRequest: string =
'opt=(data, route) => {\n' +
' // data经过处理后返回\n' +
" console.log('beforeRequest',data)\n" +
' return data\n' +
'}'
export const afterResponse: string =
'opt=(res) => {\n' +
' // res返回数据\n' +
" console.log('afterResponse',res)\n" +
' return res\n' +
'}'
export const onChange: string =
'opt=(key,model) => {\n' +
' // name当前改变组件的值,model表单的值\n' +
" console.log('onChange',key)\n" +
' return model\n' +
'}'
// provide 方法定义的key
const prefix: string = 'AK'
export const constControlChange: string = prefix + 'ControlChange' // 表单组件改变事件
export const constSetFormOptions: string = prefix + 'SetFormOptions' // 使用setOptions设置下拉值
export const constGetControlByName: string = prefix + 'GetControlByName' // 根据name从formData.list查找数据
export const constFormBtnEvent: string = prefix + 'FormBtnEvent' // 按钮组件事件
export const constFormProps: string = prefix + 'FormProps' // 按钮组件事件

1
src/views/sysworkflow/lowcodepage/lowCodeFormPage.vue

@ -12,6 +12,7 @@ import { getProductionMarkForm } from '@/api/DesignForm/requestapi'
import PageDesignEs from "@/views/sysworkflow/lowcodepage/pageDesignes.vue" import PageDesignEs from "@/views/sysworkflow/lowcodepage/pageDesignes.vue"
import WorkFlow from "@/views/sysworkflow/lowcodepage/workFlow.vue" import WorkFlow from "@/views/sysworkflow/lowcodepage/workFlow.vue"
import PageList from "@/views/sysworkflow/lowcodepage/pageList.vue" import PageList from "@/views/sysworkflow/lowcodepage/pageList.vue"
import PageLists from "@/views/sysworkflow/lowcodepage/pageshiyan/pageLists.vue"

457
src/views/sysworkflow/lowcodepage/pageList.vue

@ -4,6 +4,10 @@
@ 备注: 自定义表单列表 @ 备注: 自定义表单列表
--> -->
<script lang='ts' setup> <script lang='ts' setup>
import { ElTable } from 'element-plus'
import { attrButton,tableButton,tableButtonList,tableLogButtonList,tableAttrLogButtonList } from '@/api/DesignForm/tableButton'
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import { analysisForm,setFlowFormKeyPower } from '@/api/workflowapi/index' import { analysisForm,setFlowFormKeyPower } from '@/api/workflowapi/index'
import { gainFormTableField } from '@/api/DesignForm/requestapi' import { gainFormTableField } from '@/api/DesignForm/requestapi'
@ -11,8 +15,12 @@ import { formTableField,formTabelStruct } from "@/api/DesignForm/type";
import tempOtherUnit from '@/components/DesignForm/pageList/types' import tempOtherUnit from '@/components/DesignForm/pageList/types'
import PageListHeadTools from '@/views/sysworkflow/lowcodepage/pageListHeadTools.vue'
import Sortable from 'sortablejs'
//
import PageListHeadTools from '@/views/sysworkflow/lowcodepage/pageListHeadTools.vue'
import ControlSetup from '@/views/sysworkflow/lowcodepage/pageSetUpDialog/controlSetup.vue'
import FieldSetUp from '@/views/sysworkflow/lowcodepage/pageSetUpDialog/fieldSetUp.vue'
const props = defineProps({ const props = defineProps({
@ -61,7 +69,9 @@ const state = reactive({
tableData: { tableData: {
// tableProps: {}, // // tableProps: {}, //
columns: [], columns: [],
config: {} config: {},
controlBtn:[],
operateBtn:[]
}, },
searchData: {}, searchData: {},
loading: false, loading: false,
@ -104,7 +114,7 @@ const filterFiled = (obj: any) => {
} }
}) })
} }
const excludeType = [ const excludeType = [
'txt', 'txt',
'title', 'title',
'table', 'table',
@ -164,7 +174,282 @@ watch(()=>props.tabsActive,(val:number)=>{
}) })
onMounted(()=>{ onMounted(()=>{
jieForm() jieForm()
nextTick(() => {
columnDrop()
})
}) })
const setUpFieldInfo = ref<tableButton>()
const setUpFieldIsOpen= ref(false)
/**
@ 作者: 秦东
@ 时间: 2024-03-25 11:51:46
@ 功能: 设置字段属性
*/
const setUpField = (val:any) =>{
console.log("设置字段属性-->",val)
setUpFieldInfo.value = val
setUpFieldIsOpen.value = true
console.log("设置字段属性-1->",setUpFieldIsOpen)
}
/**
@ 作者: 秦东
@ 时间: 2024-03-27 09:17:15
@ 功能: 设置功能按钮
*/
const listButtonIsShow = ref(false)
const setUpFieldBut = () => {
// console.log("-->")
listButtonIsShow.value = true
}
//
const tableAttrButClick = (val:tableButton[]) => {
if(state.tableData.controlBtn.length > 0){
state.tableData.controlBtn.splice(0, state.tableData.controlBtn.length);
state.tableData.controlBtn = val
}else{
state.tableData.controlBtn = val
}
}
/**
@ 作者: 秦东
@ 时间: 2024-03-25 14:58:22
@ 功能: 功能字段
*/
const tableFieldAttrButClick = (val:tableButton[]) => {
if(val.length > 0){ //
if(state.tableData.columns.length > 0){ //
val.forEach((item:tableButton)=>{
let isTrue = true;
state.tableData.columns.forEach((itemTab:tableButton)=>{
if(item.id == itemTab.id){
isTrue = false;
}
});
if(isTrue){
state.tableData.columns.push(item)
}
})
}else{ //,
val.forEach((item:tableButton)=>{
state.tableData.columns.push(item)
})
}
//
let delField = []
tableAttrLogButtonList.forEach((item:tableButton)=>{
let isTrue = true;
val.forEach((itemVal:tableButton)=>{
if(item.id == itemVal.id){
isTrue = false
}
})
if(isTrue){
delField.push(item.id)
}
});
if(delField.length > 0){
state.tableData.columns.forEach((itemTab:tableButton,index:number)=>{
delField.forEach((item:string)=>{
if(item == itemTab.id){
state.tableData.columns.splice(index,1) //
}
})
});
}
}else{ //
if(state.tableData.columns.length > 0){
tableAttrLogButtonList.forEach((item:tableButton)=>{
state.tableData.columns.forEach((itemTab:tableButton,index:number)=>{
if(item.id == itemTab.id){
state.tableData.columns.splice(index,1) //
}
});
});
}
}
if(state.tableData.columns.length > 0){
let isOpent = true;
state.tableData.columns.forEach((itemTab:tableButton)=>{
if(itemTab.fieldClass == "__control"){
isOpent = false;
}
});
if(isOpent){
state.tableData.operateBtn = [];
}
}else{
state.tableData.operateBtn = [];
}
}
/**
@ 作者: 秦东
@ 时间: 2024-03-25 16:36:38
@ 功能: 列表字段处理
*/
const tableListFieldClick = (val:any[]) => {
console.log("列表字段处理-->",val)
if(val.length > 0){
if(state.tableData.columns.length > 0){ //
val.forEach((item:tableButton)=>{
let isTrue = true;
state.tableData.columns.forEach((itemTab:tableButton)=>{
if(item.id == itemTab.id){
isTrue = false;
}
});
if(isTrue){
state.tableData.columns.push(item)
}
})
}else{ //,
val.forEach((item:any)=>{
state.tableData.columns.push(item)
})
}
//
let delField = []
formTableField.masterTable.forEach((item:tableButton)=>{
let isTrue = true;
val.forEach((itemVal:tableButton)=>{
if(item.id == itemVal.id){
isTrue = false
}
})
if(isTrue){
delField.push(item.id)
}
});
if(delField.length > 0){
state.tableData.columns.forEach((itemTab:tableButton,index:number)=>{
delField.forEach((item:string)=>{
if(item == itemTab.id){
state.tableData.columns.splice(index,1) //
}
})
});
}
}else{
if(state.tableData.columns.length > 0){
formTableField.masterTable.forEach((item:tableButton)=>{
state.tableData.columns.forEach((itemTab:tableButton,index:number)=>{
if(item.id == itemTab.id){
state.tableData.columns.splice(index,1) //
}
});
});
}
}
}
const container = ref()
//
const columnDrop = () => {
const wrapperTr = container.value.querySelector(
'.el-table__header-wrapper tr'
)
console.log("wrapperTr",wrapperTr)
Sortable.create(wrapperTr, {
animation: 180,
delay: 0,
onEnd: (evt: any) => {
// console.log("evt",evt.oldIndex,evt.newIndex)
const oldItem = state.tableData.columns[evt.oldIndex]
state.tableData.columns.splice(evt.oldIndex, 1)
state.tableData.columns.splice(evt.newIndex, 0, oldItem)
//
state.refreshTable = false
nextTick(() => {
state.refreshTable = true
nextTick(() => {
columnDrop() //
})
})
}
})
}
const tableFieldList = ref<InstanceType<typeof ElTable>>()
const tableFieldAttrBut = ref<InstanceType<typeof ElTable>>()
/**
@ 作者: 秦东
@ 时间: 2024-03-27 08:27:22
@ 功能: 删除表头列表字段
*/
const delCol = (val:any) => {
let delInfo = []
let delInfoBut = []
if(state.tableData.columns.length > 0) {
state.tableData.columns.forEach((item: any, index: number) => {
if (item.id === val.id) {
state.tableData.columns.splice(index, 1)
if(item.types == "-"){
delInfoBut.push(item)
}else{
delInfo.push(item)
}
}
})
// tableFieldList.value!.toggleRowSelection(delInfo, true)
console.log("delInfo",delInfo)
// tableFieldList.value!.clearSelection()
}else{
tableFieldList.value!.clearSelection()
tableFieldAttrBut.value!.clearSelection()
}
if(delInfo.length > 0){
delInfo.forEach((item:any)=>{
tableFieldList.value!.toggleRowSelection(item, false)
})
}
if(delInfoBut.length > 0){
delInfoBut.forEach((item:any)=>{
tableFieldAttrBut.value!.toggleRowSelection(item, false)
})
}
}
/**
@ 作者: 秦东
@ 时间: 2024-03-27 10:13:34
@ 功能: 更新列表记录操作按钮
*/
const updataLogBut = (val:attrButton[]) => {
console.log("更新列表记录操作按钮",val)
let isWrete = true
if(state.tableData.columns && state.tableData.columns.length > 0){
state.tableData.columns.forEach((item:any)=>{
if(item.fieldClass == "__control"){
state.tableData.operateBtn = val.value
isWrete = false
}
})
}
if(isWrete){
state.tableData.operateBtn = [];
}
// console.log("------1------->",state.tableData.operateBtn)
}
</script> </script>
<template> <template>
<div ref="container" class="design-containers design-table" v-loading="pageLoading"> <div ref="container" class="design-containers design-table" v-loading="pageLoading">
@ -188,26 +473,125 @@ onMounted(()=>{
</div> </div>
<PageListHeadTools /> <PageListHeadTools />
</div> </div>
<div class="table_box main_table">
<div
class="search-box"
>
<div class="tipBox" >条件查询搜索区域单击可编辑</div>
</div>
<div class="operateButArea">
<div>
<el-text v-if="state.tableData.controlBtn.length === 0" class="mx-1 tipBox" type="info">操作按钮区域</el-text>
<el-button
v-for="item in state.tableData.controlBtn"
v-bind="item"
:key="item.type"
>
{{ item.label }}
</el-button>
</div>
<div>2</div>
</div>
<div class="operateButArea tipBox" v-if="!state.tableData.columns?.length">
表格列设置区域可从左上角 添加表格列字段
选择已有列或直接从上方工具栏 生成脚本预览 编辑
</div>
<el-table
:data="[{}]"
v-bind="state.tableData.tableProps || {}"
ref="tableEl"
v-if="state.refreshTable && state.tableData.columns?.length"
>
<template
v-for="item in state.tableData.columns"
:key="item.prop || item.label"
>
<el-table-column v-if="item.id == 'checkbox'" fixed type="selection" width="40" align="center" />
<el-table-column v-else-if="item.field == 'index'" type="index" width="80" align="center">
<template #header="scope">
<div class="field_close">
{{item.name}}
<i class="field_close fa fa-close" @click="delCol(item)"></i>
</div>
</template>
</el-table-column>
<el-table-column v-else v-bind="item">
<template #header="scope">
<div class="field_close">
{{item.name}}
<i class="field_close fa fa-close" @click="delCol(item)"></i>
</div>
<el-tooltip placement="top" v-if="item.help">
<template #content>
<span v-html="item.help"></span>
</template>
<i class="icon-help"></i>
</el-tooltip>
</template>
<template #default>
<span v-if="item.fieldClass=='__control'">操作</span>
<span v-else>数据</span>
</template>
</el-table-column>
</template>
</el-table>
<div class="table-tip">
操作提示<br />
*从数据列表配置中选择 所属表单<br />
*从左上角 添加表格字段 选择预设字段<br />
*可拖动表头字段移动调整表头字段排列顺序<br />
*可通过顶部工具栏 生成脚本预览 查看或编辑添加自定义字段
</div>
</div>
</div> </div>
<div class="sidebar-tools"> <div class="sidebar-tools">
<el-tabs ref="multipleTableRef" v-model="formTableActive" class="form_tabs" @tab-click="handleClick"> <el-tabs ref="multipleTableRef" v-model="formTableActive" class="form_tabs" @tab-click="handleClick">
<el-tab-pane label="字段设置" :name="1"> <el-tab-pane label="字段设置" :name="1">
<el-divider content-position="left">查询设置</el-divider> <el-divider content-position="left">功能字段</el-divider>
<el-divider content-position="left">列表字段</el-divider> <el-table ref="tableFieldAttrBut" :data="tableAttrLogButtonList" border style="width: 100%" @selection-change="tableFieldAttrButClick">
<el-table :data="formTableField.masterTable" border style="width: 100%">
<el-table-column fixed type="selection" width="40" align="center" /> <el-table-column fixed type="selection" width="40" align="center" />
<el-table-column prop="name" label="字段" /> <el-table-column prop="name" label="字段" />
<el-table-column fixed="right" label="设置" width="55" align="center"> <el-table-column fixed="right" label="设置" width="55" align="center">
<template #default="scope"> <template #default="scope">
<el-icon title="设置"><Setting /></el-icon> <el-icon v-if="scope.row.fieldClass=='__control'" title="设置" @click="setUpFieldBut(scope.row)"><Setting /></el-icon>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-divider content-position="left">列表字段</el-divider>
<el-table ref="tableFieldList" :data="formTableField.masterTable" border @selection-change="tableListFieldClick" style="width: 100%">
<el-table-column fixed type="selection" width="40" align="center" />
<el-table-column prop="name" label="字段">
<template #default="scope">
{{scope.row.name}}({{scope.row.fieldClass}}[{{scope.row.pattern}}])
</template>
</el-table-column>
<el-table-column fixed="right" label="设置" width="55" align="center">
<template #default="scope">
<el-icon title="设置" @click="setUpField(scope.row)"><Setting /></el-icon>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left">查询条件</el-divider>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="列表设置" :name="2"> <el-tab-pane label="列表设置" :name="2">
<el-divider content-position="left">批量操作</el-divider> <el-divider content-position="left">批量操作</el-divider>
<el-divider content-position="left">功能按钮</el-divider> <el-divider content-position="left">功能按钮</el-divider>
<el-table ref="tableAttrBut" :data="tableButtonList" border style="width: 100%" @selection-change="tableAttrButClick">
<el-table-column fixed type="selection" width="40" align="center" />
<el-table-column prop="label" label="字段" />
</el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- {{props.formKey}} <!-- {{props.formKey}}
@ -215,7 +599,17 @@ onMounted(()=>{
{{props.formVersion}} {{props.formVersion}}
<br> <br>
{{formTableField}} --> {{formTableField}} -->
</div> </div>
<FieldSetUp v-model:is-open="setUpFieldIsOpen" :setup-field-info="setUpFieldInfo" />
<ControlSetup v-model:is-show="listButtonIsShow" v-model:contbutary:="state.tableData.operateBtn" @updata-log-but="updataLogBut" />
</div> </div>
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>
@ -236,4 +630,51 @@ onMounted(()=>{
.form_tabs > .el-tabs__content{ .form_tabs > .el-tabs__content{
padding: 0; padding: 0;
} }
.table_box{
background: #fff;
border: 1px dashed #999;
margin: 10px;
height: calc(100vh - 100px);
overflow-y: auto;
overflow-x: hidden;
position: relative;
.table-tip{
color: #999;
padding: 30px 0;
line-height: 22px;
}
.operateButArea{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.main_table{
padding: 10px 20px;
}
.field_close{
i{
display: none;
}
}
.field_close:hover{
i{
display: inline;
cursor: pointer;
}
}
.tipBox{
border: 1px dotted #ddd;
padding: 3px 5px;
border-radius: 5px;
color: #999;
text-align: center;
cursor: pointer;
margin-top: 15px;
}
</style> </style>

14
src/views/sysworkflow/lowcodepage/pageListHeadTools.vue

@ -1,6 +1,6 @@
<!-- Created by weiXin:337547038 --> <!-- Created by weiXin:337547038 -->
<template> <template>
<div class="main-tools"> <div class="main-toolsTable">
<slot></slot> <slot></slot>
<el-button <el-button
link link
@ -61,4 +61,14 @@
emits('click', type) emits('click', type)
} }
</script> </script>
<style lang='scss' scoped>
.main-toolsTable{
line-height: 26px;
border-bottom: 2px solid #e4e7ed;
/* margin-right: 10px; */
padding: 8px 10px 8px 0;
display: flex;
align-items: center;
justify-content: flex-end;
}
</style>

114
src/views/sysworkflow/lowcodepage/pageSetUpDialog/controlSetup.vue

@ -0,0 +1,114 @@
<!--
@ 作者: 秦东
@ 时间: 2024-03-27 10:02:17
@ 备注: 设置数据记录操作按钮
-->
<script lang='ts' setup>
import { ElTable } from 'element-plus'
import { tableLogButtonList,attrButton } from '@/api/DesignForm/tableButton'
const props = defineProps({
isShow:{
type:Boolean,
default:false,
},
contbutary:{
type:Object,
default(){
return {}
}
}
});
// const emits = defineEmits<{
// (e: 'update:isShow', val: boolean): void
// (e: 'updataLogBut', val: function): void
// }>()
const emits = defineEmits(["update:isShow","update:contbutary","updataLogBut"]);
const isShowIng = computed({
get() {
return props.isShow
},
set(val: formStruct) {
emits('update:isShow', val)
}
});
const contButList = computed({
get() {
return props.contbutary
},
set(val: formStruct) {
emits('update:contbutary', val)
}
});
const tableLogBut = ref<InstanceType<typeof ElTable>>()
watch(()=>isShowIng.value,(val: boolean)=>{
if(val){
// console.log("props.contbutary",props.contbutary)
// console.log("props.contbutary",contButList.value)
// if(contButList.value && contButList.value.length > 0){
// let delBut = []
// tableLogButtonList.forEach((item:any)=>{
// let isTrue = true;
// contButList.value.forEach((itemAll:any)=>{
// if (item.key === itemAll.key) {
// isTrue = false;
// }
// })
// if(isTrue){
// tableLogBut.value!.toggleRowSelection(item, false)
// }
// })
// }else{
// nextTick(() => {
// tableLogBut.value!.clearSelection()
// })
// }
}
})
/**
@ 作者: 秦东
@ 时间: 2024-03-27 10:25:54
@ 功能: 关闭弹窗
*/
const closeLogBut = () =>{
emits('update:isShow', false)
emits('updataLogBut', tableLogButtonList)
}
/**
@ 作者: 秦东
@ 时间: 2024-03-27 10:39:34
@ 功能: 选中的内容
*/
const xuanZhongLog = (val:attrButton[]) =>{
tableLogButtonList.value = val
console.log(tableLogButtonList)
}
</script>
<template>
<el-dialog
v-model="isShowIng"
title="设置数据记录操作按钮"
width="500"
draggable
center
:before-close="closeLogBut"
>
<el-table ref="tableLogBut" :data="tableLogButtonList" border style="width: 100%" @selection-change="xuanZhongLog">
<el-table-column fixed type="selection" width="40" align="center" />
<el-table-column prop="label" label="字段" />
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeLogBut">取消</el-button>
<el-button type="primary" @click="closeLogBut">确定</el-button>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
</style>

77
src/views/sysworkflow/lowcodepage/pageSetUpDialog/fieldSetUp.vue

@ -0,0 +1,77 @@
<!--
@ 作者: 秦东
@ 时间: 2024-03-27 15:05:32
@ 备注: 设置字段属性
-->
<script lang='ts' setup>
const props = defineProps({
isOpen:{
type:Boolean,
default:false,
},
setupFieldInfo:{
type:Object,
default(){
return {}
}
}
});
const drawerTitle = ref("设置")
const direction = ref('ltr')
const emits = defineEmits(["update:isOpen","update:setupFieldInfo","updataLogBut"]);
const drawerIsShow = computed({
get() {
return props.isOpen
},
set(val: formStruct) {
emits('update:isOpen', val)
}
});
const setupFieldCentent = computed({
get() {
return props.setupFieldInfo
},
set(val: formStruct) {
emits('update:setupFieldInfo', val)
}
});
/**
@ 作者: 秦东
@ 时间: 2024-03-27 15:27:14
@ 功能: 关闭弹窗
*/
const handleDrawerClose = () => {
emits('update:isOpen',false)
}
/**
@ 作者: 秦东
@ 时间: 2024-03-27 15:47:38
@ 功能: 监听开关
*/
watch(()=>drawerIsShow.value,(val:boolean)=>{
// console.log("",setupFieldCentent)
if(val) {
drawerTitle.value = setupFieldCentent.value.name + "设置"
}else{
drawerTitle.value = "设置"
initData();
}
})
const initData = () => {
setupFieldCentent.value = {}
}
</script>
<template>
<el-drawer
v-model="drawerIsShow"
:title="drawerTitle"
:direction="direction"
:before-close="handleDrawerClose"
>
{{setupFieldCentent}}
</el-drawer>
</template>
<style lang='scss' scoped>
</style>

39
src/views/taskplatform/taskmanagement/taskcustomerformnew.vue

@ -97,6 +97,8 @@ const drawerOpenOrClose = computed({
}, },
}); });
const isFlowTable = ref(false)
// //
const getTaskFormData = () =>{ const getTaskFormData = () =>{
loadingData.value = true; loadingData.value = true;
@ -111,6 +113,13 @@ const getTaskFormData = () =>{
}else{ }else{
isFlowForm.value = false; isFlowForm.value = false;
} }
if(data.flowIsOpen == 1 && data.flowkeystr != "0"){
isFlowTable.value = true;
}else{
isFlowTable.value = false;
}
state.id=props.versionid state.id=props.versionid
state.formData = stringToObj(data.mastesform) state.formData = stringToObj(data.mastesform)
state.dict = string2json(data.dict) state.dict = string2json(data.dict)
@ -122,17 +131,23 @@ const getTaskFormData = () =>{
} }
} }
}) })
nextTick(() => { nextTick(() => {
// if(data.flowIsOpen == 1 && gainFlowChart.id != "0"){
generateFlow(gainFlowChart) generateFlow(gainFlowChart)
.then((datagen:any) =>{ .then((datagen:any) =>{
console.log("获取工作流不进图",datagen.data) console.log("获取工作流不进图",datagen.data)
flowMap.value = datagen.data.flowList flowMap.value = datagen.data.flowList
console.log("获取工作流不进图--->",flowMap.value) console.log("获取工作流不进图--->",flowMap.value)
formLoading.value = false formLoading.value = false
}) })
}) }
console.log("获取工作流不进图",data.flowIsOpen,gainFlowChart)
//
})
}) })
.finally(()=>{ .finally(()=>{
loadingData.value = false; loadingData.value = false;
@ -457,7 +472,7 @@ const sendFlowInfo = ref<any>()
/> />
</div> </div>
</td> </td>
<td valign="top" width="350"> <td v-if="isFlowTable" valign="top" width="350">
<div v-loading="flowLoading" element-loading-text="Loading..." class="drawerFormBox boxRight"> <div v-loading="flowLoading" element-loading-text="Loading..." class="drawerFormBox boxRight">
<div class="flowBox"> <div class="flowBox">
<el-affix :offset="20"> <el-affix :offset="20">

Loading…
Cancel
Save