From 3e26a1ba293ed6906ef56e35bcd5862d8260f937 Mon Sep 17 00:00:00 2001
From: xy <271556543@qq.com>
Date: Tue, 3 Sep 2024 18:05:17 +0800
Subject: [PATCH] init
---
src/styles/sidebar.scss | 2 +-
src/utils/formBuilder.js | 73 ++++++++++++++++++++++++++++++++++
src/views/flow/DesktopForm.vue | 50 +++++++++++++++++++++++
src/views/flow/index.vue | 17 ++++++++
4 files changed, 141 insertions(+), 1 deletion(-)
create mode 100644 src/views/flow/index.vue
diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss
index 7a90094..015609f 100644
--- a/src/styles/sidebar.scss
+++ b/src/styles/sidebar.scss
@@ -11,7 +11,7 @@
transition: width 0.28s;
width: $sideBarWidth !important;
background-color: $menuBg;
- position: absolute;
+ position: fixed;
font-size: 0px;
top: 0;
bottom: 0;
diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js
index 171079c..77f3722 100644
--- a/src/utils/formBuilder.js
+++ b/src/utils/formBuilder.js
@@ -241,6 +241,7 @@ export default function (device, info,h ) {
headers: {
Authorization: `Bearer ${getToken()}`,
},
+ accept: "application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
multiple: true,
fileList: this.file[info.name],
beforeUpload: (file) => {
@@ -339,6 +340,78 @@ export default function (device, info,h ) {
"文件不超过20Mb"
)
])
+ break;
+ case 'label':
+ formItem = h(formBuilderMap(device).get(info.type),{
+ props: {
+ type: 'primary'
+ }
+ },info.label)
+ break;
+ case 'static':
+ formItem = h(formBuilderMap(device).get(info.type),{
+ props: {
+ type: 'primary'
+ },
+ attrs: {
+ href: this.form[info.name],
+ target: "_blank"
+ }
+ },info.label)
+ break;
+ case 'hr':
+ formItem = h(formBuilderMap(device).get(info.type),{
+ },info.label)
+ break;
+ case 'choice':
+ formItem = h(formBuilderMap(device).get(info.type),{
+ props: {
+ value: this.form[info.name],
+ clearable: true,
+ placeholder: info.help_text
+ },
+ attrs: {
+ placeholder: info.help_text
+ },
+ on: {
+ input: e => {
+ this.$set(this.form,info.name,e)
+ }
+ }
+ },[1,2,3].map(option => (
+ h('el-option',{
+ props: {
+ label: option,
+ value: option
+ }
+ })
+ )))
+ break;
+ case 'choices':
+ formItem = h(formBuilderMap(device).get(info.type),{
+ props: {
+ value: this.form[info.name],
+ clearable: true,
+ placeholder: info.help_text,
+ multiple: true
+ },
+ attrs: {
+ placeholder: info.help_text
+ },
+ on: {
+ input: e => {
+ this.$set(this.form,info.name,e)
+ }
+ }
+ },[1,2,3].map(option => (
+ h('el-option',{
+ props: {
+ label: option,
+ value: option
+ }
+ })
+ )))
+ break;
}
return h('el-form-item',{
props: {
diff --git a/src/views/flow/DesktopForm.vue b/src/views/flow/DesktopForm.vue
index 9eba155..c19f774 100644
--- a/src/views/flow/DesktopForm.vue
+++ b/src/views/flow/DesktopForm.vue
@@ -88,6 +88,56 @@ export default {
label: "ggg",
help_text: 'write ggg'
},
+ {
+ id: 8,
+ type: "label",
+ gs_x: 1,
+ gs_y: 6,
+ gs_height: 1,
+ gs_width: 6,
+ name: "hhh",
+ label: "hhh",
+ },
+ {
+ id: 9,
+ type: "static",
+ gs_x: 1,
+ gs_y: 7,
+ gs_height: 1,
+ gs_width: 6,
+ name: "iii",
+ label: "iii",
+ },
+ {
+ id: 10,
+ type: "hr",
+ gs_x: 1,
+ gs_y: 8,
+ gs_height: 1,
+ gs_width: 6,
+ name: "jjj",
+ label: "jjj",
+ },
+ {
+ id: 11,
+ type: "choice",
+ gs_x: 1,
+ gs_y: 9,
+ gs_height: 1,
+ gs_width: 6,
+ name: "kkk",
+ label: "kkk",
+ },
+ {
+ id: 12,
+ type: "choices",
+ gs_x: 1,
+ gs_y: 10,
+ gs_height: 1,
+ gs_width: 6,
+ name: "lll",
+ label: "lll",
+ },
],
form: {
aaa: "",
diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue
new file mode 100644
index 0000000..98b6b2f
--- /dev/null
+++ b/src/views/flow/index.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+