diff --git a/src/views/tool/draggable/elements/hw-form.vue b/src/views/tool/draggable/elements/hw-form.vue
index c30e44a..9b3a369 100644
--- a/src/views/tool/draggable/elements/hw-form.vue
+++ b/src/views/tool/draggable/elements/hw-form.vue
@@ -1,11 +1,13 @@
+
+
+
+
diff --git a/src/views/tool/draggable/formBoard.vue b/src/views/tool/draggable/formBoard.vue
index 3903224..e87e223 100644
--- a/src/views/tool/draggable/formBoard.vue
+++ b/src/views/tool/draggable/formBoard.vue
@@ -1,12 +1,14 @@
@@ -16,7 +18,6 @@ export default {
- {{ formData }}
@@ -30,6 +31,7 @@ const props = defineProps({
const { widgetList } = toRefs(props);
const formData = ref({ pageVariable: {} });
+provide('globalFormData', formData);
const formDataOperation = {
get: (key) => {
return formData.value.pageVariable[key];
diff --git a/src/views/tool/draggable/index.vue b/src/views/tool/draggable/index.vue
index fdf0014..3ba05d4 100644
--- a/src/views/tool/draggable/index.vue
+++ b/src/views/tool/draggable/index.vue
@@ -5,6 +5,7 @@
+ 表单组件
@@ -12,6 +13,14 @@
+ 数据展示组件
+
+
+
+
+
Config
@@ -92,11 +101,16 @@ const dragList = [
name: '表单',
labelWidth: '120px',
formData: {},
+ isInLine: false,
isReset: false,
isResetBottom: false,
isSubmitBottom: true,
submitBottomName: '提交',
resetBottomName: '重置',
+ isPagination: true,
+ total: 'total',
+ pageNum: 'pageNum',
+ pageSize: 'pageSize',
submitFunction: ''
},
tasks: [],
@@ -133,6 +147,19 @@ const dragList = [
},
{ type: 'hw-slider', isContainer: false, options: { name: '滑块', step: 2, showStops: true }, name: '滑块', id: 6 }
];
+const dragViewList = [
+ {
+ type: 'hw-table',
+ isContainer: false,
+ options: {
+ name: '表格',
+ thTdMap: { planId: '字段planId', dispatchCode: '字段dispatchCode', materialName: '字段materialName' },
+ dataKey: ''
+ },
+ name: '表格',
+ id: 101
+ }
+];
function removeItemByUuid(arr, uuid) {
arr.forEach((item, index) => {
@@ -214,7 +241,7 @@ const viewForm = () => {
.option-box {
width: 400px;
display: inline-block;
- user-select: none;
+ //user-select: none;
vertical-align: top;
margin: 8px;
border: 1px solid #ccc;
diff --git a/src/views/tool/draggable/nest.vue b/src/views/tool/draggable/nest.vue
index c80d1e1..9cee513 100644
--- a/src/views/tool/draggable/nest.vue
+++ b/src/views/tool/draggable/nest.vue
@@ -1,11 +1,13 @@
-
-
-
-
+
+
{{ options.submitBottomName }}
{{ options.resetBottomName }}
+
+
@@ -37,15 +43,22 @@ const props = defineProps({
const { options, tasks, formData } = toRefs(props);
const formDataOperation = inject('formDataOperation');
+const localData = ref({});
onBeforeMount(() => {
formData.value[options.value.key || ('form-' + options.value.uuid)] = {};
});
-const onSubmit = () => {
+const onSubmit = async () => {
try {
- const submitFunction = new Function('formData', 'request','formDataOperation', options.value.submitFunction);
- submitFunction(formData.value[options.value.key || ('form-' + options.value.uuid)], request,formDataOperation);
+ const fun = () => {
+ return `return async ()=>{
+ ${options.value.submitFunction}
+ }`;
+ };
+ const submitFunction = new Function('formData', 'request', 'formDataOperation', 'localData', fun());
+ await submitFunction(formData.value[options.value.key || ('form-' + options.value.uuid)], request, formDataOperation, localData.value)();
+ console.log();
} catch (e) {
console.log(e);
}
diff --git a/src/views/tool/draggable/viewElements/hw-input-view.vue b/src/views/tool/draggable/viewElements/hw-input-view.vue
index 877fc2d..78705ec 100644
--- a/src/views/tool/draggable/viewElements/hw-input-view.vue
+++ b/src/views/tool/draggable/viewElements/hw-input-view.vue
@@ -1,9 +1,7 @@
-
-
-
-
-
+
+
+
+
+
+
+