tianheng-ui 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/theme-chalk/styles/reset.scss +0 -2
- package/lib/tianheng-ui.js +13 -14
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +16 -11
- package/packages/FormMaking/GenerateFormItem.vue +73 -581
- package/packages/FormMaking/GenerateFormItemH5.vue +6 -6
- package/packages/FormMaking/Upload/index.vue +0 -1
- package/packages/FormMaking/WidgetConfig.vue +100 -77
- package/packages/FormMaking/WidgetForm.vue +7 -48
- package/packages/FormMaking/WidgetFormItem.vue +41 -65
- package/packages/FormMaking/WidgetSelect.vue +160 -0
- package/packages/FormMaking/WidgetTools.vue +538 -0
- package/packages/FormMaking/config/index.js +6 -0
- package/packages/FormMaking/custom/config.js +119 -87
- package/packages/FormMaking/custom/configs/button.vue +24 -25
- package/packages/FormMaking/custom/configs/cascader.vue +7 -7
- package/packages/FormMaking/custom/configs/checkbox.vue +23 -22
- package/packages/FormMaking/custom/configs/color.vue +3 -3
- package/packages/FormMaking/custom/configs/date.vue +3 -3
- package/packages/FormMaking/custom/configs/grid.vue +4 -4
- package/packages/FormMaking/custom/configs/input.vue +138 -31
- package/packages/FormMaking/custom/configs/number.vue +5 -5
- package/packages/FormMaking/custom/configs/radio.vue +23 -19
- package/packages/FormMaking/custom/configs/rate.vue +3 -3
- package/packages/FormMaking/custom/configs/select.vue +25 -20
- package/packages/FormMaking/custom/configs/slider.vue +3 -3
- package/packages/FormMaking/custom/configs/switch.vue +3 -3
- package/packages/FormMaking/custom/configs/table.vue +2 -2
- package/packages/FormMaking/custom/configs/{table_h5.vue → tableH5.vue} +2 -2
- package/packages/FormMaking/custom/configs/tabs.vue +18 -23
- package/packages/FormMaking/custom/configs/textarea.vue +124 -22
- package/packages/FormMaking/custom/configs/time.vue +3 -3
- package/packages/FormMaking/custom/configs/upload.vue +5 -5
- package/packages/FormMaking/custom/index.js +2 -4
- package/packages/FormMaking/custom/items/alliance.vue +30 -29
- package/packages/FormMaking/custom/items/blank_pro.vue +14 -0
- package/packages/FormMaking/custom/items/button.vue +36 -1
- package/packages/FormMaking/custom/items/cascader.vue +6 -2
- package/packages/FormMaking/custom/items/cell.vue +0 -2
- package/packages/FormMaking/custom/items/checkbox.vue +18 -8
- package/packages/FormMaking/custom/items/color.vue +1 -1
- package/packages/FormMaking/custom/items/date.vue +1 -1
- package/packages/FormMaking/custom/items/editor.vue +1 -1
- package/packages/FormMaking/custom/items/{grid.vue → grid_dev.vue} +16 -47
- package/packages/FormMaking/custom/items/grid_pro.vue +45 -0
- package/packages/FormMaking/custom/items/image.vue +0 -28
- package/packages/FormMaking/custom/items/input.vue +15 -9
- package/packages/FormMaking/custom/items/number.vue +4 -4
- package/packages/FormMaking/custom/items/radio.vue +17 -7
- package/packages/FormMaking/custom/items/rate.vue +1 -1
- package/packages/FormMaking/custom/items/select.vue +12 -6
- package/packages/FormMaking/custom/items/slider.vue +1 -1
- package/packages/FormMaking/custom/items/switch.vue +1 -1
- package/packages/FormMaking/custom/items/{table_h5.vue → tableH5_dev.vue} +44 -49
- package/packages/FormMaking/custom/items/tableH5_pro.vue +113 -0
- package/packages/FormMaking/custom/items/{table.vue → table_dev.vue} +21 -41
- package/packages/FormMaking/custom/items/table_pro.vue +114 -0
- package/packages/FormMaking/custom/items/tabs_dev.vue +101 -0
- package/packages/FormMaking/custom/items/tabs_pro.vue +50 -0
- package/packages/FormMaking/custom/items/text.vue +1 -1
- package/packages/FormMaking/custom/items/textarea.vue +4 -13
- package/packages/FormMaking/custom/items/time.vue +3 -3
- package/packages/FormMaking/custom/items/upload.vue +15 -14
- package/packages/FormMaking/custom/mixins/index.js +28 -6
- package/packages/FormMaking/custom/register.js +22 -11
- package/packages/FormMaking/index.vue +95 -468
- package/packages/FormMaking/styles/index.scss +235 -242
- package/packages/FormMaking/util/generateCode.js +3 -3
- package/packages/FormMaking/util/index.js +33 -23
- package/packages/FormMaking/util/request.js +9 -12
- package/packages/FormMaking/custom/items/tabs.vue +0 -145
- /package/packages/FormMaking/custom/items/{blank.vue → blank_dev.vue} +0 -0
@@ -1,28 +1,25 @@
|
|
1
|
-
import axios from
|
1
|
+
import axios from "axios";
|
2
2
|
|
3
3
|
const request = axios.create({
|
4
4
|
withCredentials: false
|
5
|
-
})
|
5
|
+
});
|
6
6
|
|
7
7
|
request.interceptors.request.use(
|
8
8
|
config => {
|
9
|
-
return config
|
9
|
+
return config;
|
10
10
|
},
|
11
11
|
error => {
|
12
|
-
|
13
|
-
return Promise.reject(new Error(error).message)
|
12
|
+
return Promise.reject(new Error(error).message);
|
14
13
|
}
|
15
|
-
)
|
14
|
+
);
|
16
15
|
|
17
16
|
request.interceptors.response.use(
|
18
17
|
response => {
|
19
|
-
|
20
|
-
return response.data
|
18
|
+
return response.data;
|
21
19
|
},
|
22
20
|
error => {
|
23
|
-
|
24
|
-
return Promise.reject(new Error(error).message)
|
21
|
+
return Promise.reject(new Error(error).message);
|
25
22
|
}
|
26
|
-
)
|
23
|
+
);
|
27
24
|
|
28
|
-
export default request
|
25
|
+
export default request;
|
@@ -1,145 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<el-tabs
|
3
|
-
v-model="widget.options.defaultValue"
|
4
|
-
:type="widget.options.type"
|
5
|
-
:tab-position="widget.options.tabPosition"
|
6
|
-
>
|
7
|
-
<el-tab-pane
|
8
|
-
v-for="(column, columnIndex) in widget.tabs"
|
9
|
-
:key="`tabs_${column.value}`"
|
10
|
-
:label="column.label"
|
11
|
-
:name="column.value"
|
12
|
-
>
|
13
|
-
<draggable
|
14
|
-
v-model="column.list"
|
15
|
-
:no-transition-on-drag="true"
|
16
|
-
v-bind="{
|
17
|
-
group: 'people',
|
18
|
-
ghostClass: 'ghost',
|
19
|
-
animation: 200,
|
20
|
-
handle: '.drag-widget'
|
21
|
-
}"
|
22
|
-
@add="handleWidgetTabAdd($event, widget, columnIndex)"
|
23
|
-
>
|
24
|
-
<transition-group name="fade" tag="div" class="widget-col-list">
|
25
|
-
<widget-form-item
|
26
|
-
v-for="(element, elementIndex) in column.list.filter(item => {
|
27
|
-
return item.key;
|
28
|
-
})"
|
29
|
-
:key="element.key"
|
30
|
-
:widget="element"
|
31
|
-
:widgetIndex="elementIndex"
|
32
|
-
:widgetArray="column"
|
33
|
-
:select.sync="selectWidget"
|
34
|
-
:config="config"
|
35
|
-
></widget-form-item>
|
36
|
-
</transition-group>
|
37
|
-
</draggable>
|
38
|
-
</el-tab-pane>
|
39
|
-
</el-tabs>
|
40
|
-
</template>
|
41
|
-
|
42
|
-
<script>
|
43
|
-
import { itemsComponent } from "../mixins/index";
|
44
|
-
import Draggable from "vuedraggable";
|
45
|
-
import WidgetFormItem from "../../WidgetFormItem.vue";
|
46
|
-
export default {
|
47
|
-
components: { Draggable, WidgetFormItem },
|
48
|
-
mixins: [itemsComponent],
|
49
|
-
data() {
|
50
|
-
return {
|
51
|
-
selectWidget: {}
|
52
|
-
};
|
53
|
-
},
|
54
|
-
watch: {
|
55
|
-
select(val) {
|
56
|
-
this.selectWidget = val;
|
57
|
-
},
|
58
|
-
selectWidget: {
|
59
|
-
handler(val) {
|
60
|
-
this.$emit("update:select", val);
|
61
|
-
},
|
62
|
-
deep: true
|
63
|
-
}
|
64
|
-
},
|
65
|
-
methods: {
|
66
|
-
handleWidgetTabAdd($event, row, colIndex) {
|
67
|
-
const newIndex = $event.newIndex;
|
68
|
-
const oldIndex = $event.oldIndex;
|
69
|
-
const item = $event.item;
|
70
|
-
|
71
|
-
// 防止布局元素的嵌套拖拽
|
72
|
-
if (
|
73
|
-
item.className.indexOf("tabs") !== -1 ||
|
74
|
-
item.className.indexOf("alliance") !== -1
|
75
|
-
) {
|
76
|
-
// 如果是列表中拖拽的元素需要还原到原来位置
|
77
|
-
item.tagName === "DIV" &&
|
78
|
-
this.widgetArray.list.splice(
|
79
|
-
oldIndex,
|
80
|
-
0,
|
81
|
-
row.tabs[colIndex].list[newIndex]
|
82
|
-
);
|
83
|
-
|
84
|
-
row.tabs[colIndex].list.splice(newIndex, 1);
|
85
|
-
|
86
|
-
return false;
|
87
|
-
}
|
88
|
-
|
89
|
-
const key =
|
90
|
-
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
91
|
-
|
92
|
-
this.$set(row.tabs[colIndex].list, newIndex, {
|
93
|
-
...row.tabs[colIndex].list[newIndex],
|
94
|
-
options: {
|
95
|
-
...row.tabs[colIndex].list[newIndex].options
|
96
|
-
// remoteFunc: "func_" + key
|
97
|
-
},
|
98
|
-
key,
|
99
|
-
// 绑定键值
|
100
|
-
model: row.tabs[colIndex].list[newIndex].type + "_" + key,
|
101
|
-
rules: []
|
102
|
-
});
|
103
|
-
|
104
|
-
if (
|
105
|
-
row.tabs[colIndex].list[newIndex].type === "radio" ||
|
106
|
-
row.tabs[colIndex].list[newIndex].type === "checkbox" ||
|
107
|
-
row.tabs[colIndex].list[newIndex].type === "select"
|
108
|
-
) {
|
109
|
-
this.$set(row.tabs[colIndex].list, newIndex, {
|
110
|
-
...row.tabs[colIndex].list[newIndex],
|
111
|
-
options: {
|
112
|
-
...row.tabs[colIndex].list[newIndex].options,
|
113
|
-
options: row.tabs[colIndex].list[newIndex].options.options.map(
|
114
|
-
item => ({
|
115
|
-
...item
|
116
|
-
})
|
117
|
-
)
|
118
|
-
}
|
119
|
-
});
|
120
|
-
}
|
121
|
-
|
122
|
-
if (row.tabs[colIndex].list[newIndex].type === "grid") {
|
123
|
-
this.$set(
|
124
|
-
row.tabs[colIndex].list,
|
125
|
-
newIndex,
|
126
|
-
JSON.parse(JSON.stringify(row.tabs[colIndex].list[newIndex]))
|
127
|
-
);
|
128
|
-
}
|
129
|
-
|
130
|
-
if (row.tabs[colIndex].list[newIndex].type === "table") {
|
131
|
-
this.$set(row.tabs[colIndex].list, newIndex, {
|
132
|
-
...row.tabs[colIndex].list[newIndex],
|
133
|
-
list: row.tabs[colIndex].list[newIndex].list.map(item => ({
|
134
|
-
...item
|
135
|
-
}))
|
136
|
-
});
|
137
|
-
}
|
138
|
-
|
139
|
-
this.selectWidget = row.tabs[colIndex].list[newIndex];
|
140
|
-
}
|
141
|
-
}
|
142
|
-
};
|
143
|
-
</script>
|
144
|
-
|
145
|
-
<style></style>
|
File without changes
|