app-form-view 0.0.3 → 0.0.4
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/package.json +1 -1
- package/src/api/app-form.js +152 -0
- package/src/api/dict/app-data.js +11 -0
- package/src/app-index.js +61 -59
- package/src/components/appForm/Checkbox.vue +2 -2
- package/src/components/appForm/Radio.vue +2 -2
- package/src/components/appForm/dynamicMixin.js +1 -2
- package/src/views/build/viewAppForm.vue +1 -1
- package/src/views/build/viewForm.vue +0 -3
package/package.json
CHANGED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
|
|
2
|
+
const BASE = 'sjyy/sjczgl/form/bdgl/config/'
|
|
3
|
+
const API = {
|
|
4
|
+
scene: BASE + 'getFromConfigScene',
|
|
5
|
+
addSave: BASE + 'formConfigAdd',
|
|
6
|
+
editSave: BASE + 'formConfigEdit',
|
|
7
|
+
view: BASE + 'formConfigView',
|
|
8
|
+
getData: 'sjyy/sjczgl/form/bdgl/formBdglView',
|
|
9
|
+
getSjyyFields: 'sjyy/sjcxgl/sjxgl/getYsjSjxList',
|
|
10
|
+
getDict: BASE + 'getFormDictData',
|
|
11
|
+
getFormInitData: 'sjyy/sjczgl/sjcjh/getFormInitData',
|
|
12
|
+
getViewData: 'sjyy/sjczgl/sjcjh/getDataViewById'
|
|
13
|
+
}
|
|
14
|
+
export const APIOPTIONS = [
|
|
15
|
+
{ label: '系统管理信息-用户管理', url: BASE + 'selectUsers', method: 'get', fhType: 'page', paramsList: [{ label: '选择模式', name: 'xzms', value: '' }], xtgllx: 'user-gl' },
|
|
16
|
+
{ label: '系统管理信息-角色管理', url: BASE + 'selectRoles', method: 'get', fhType: 'page', paramsList: [{ label: '选择模式', name: 'xzms', value: '' }], xtgllx: 'role-gl' },
|
|
17
|
+
{ label: '系统管理信息-部门管理', url: 'system/dept/roleDeptTreeData', fhType: 'page', method: 'get', paramsList: [], xtgllx: 'dept-gl' },
|
|
18
|
+
{ label: '数据查询应用数据表页面', url: BASE + 'sjyyZycxSjzy', fhType: 'page', method: 'get', paramsList: [{ label: '选择模式', name: 'xzms', value: '' }, { label: '数据表ID', name: 'id', value: '' }], xtgllx: 'sjcxyy-table' },
|
|
19
|
+
{ label: '数据查询应用数据表JSON', url: 'sjyy/zycx/getZycxDataList', fhType: 'json', method: 'post', paramsList: [{ label: '选择模式', name: 'xzms', value: '' }, { label: '数据表ID', name: 'id', value: '' }], xtgllx: 'sjcxyy-table' }
|
|
20
|
+
]
|
|
21
|
+
export const TYPEMAPPINGS = {
|
|
22
|
+
input: {
|
|
23
|
+
widget: 'input'
|
|
24
|
+
},
|
|
25
|
+
radio: {
|
|
26
|
+
widget: 'radio',
|
|
27
|
+
},
|
|
28
|
+
checkbox: {
|
|
29
|
+
widget: 'checkbox',
|
|
30
|
+
},
|
|
31
|
+
textarea: {
|
|
32
|
+
widget: 'textarea',
|
|
33
|
+
},
|
|
34
|
+
select: {
|
|
35
|
+
widget: 'select',
|
|
36
|
+
},
|
|
37
|
+
date: {
|
|
38
|
+
widget: 'datetime',
|
|
39
|
+
},
|
|
40
|
+
rqsjfw: {
|
|
41
|
+
widget: 'datetimeRange',
|
|
42
|
+
},
|
|
43
|
+
password: {
|
|
44
|
+
widget: 'password',
|
|
45
|
+
},
|
|
46
|
+
number: {
|
|
47
|
+
widget: 'inputNumber'
|
|
48
|
+
},
|
|
49
|
+
upload: {
|
|
50
|
+
widget: 'inputUpload'
|
|
51
|
+
},
|
|
52
|
+
tree_select: {
|
|
53
|
+
widget: 'inputTree'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//
|
|
57
|
+
export function getFormConfig(data) {
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
export function getFormConfigScene(data) {
|
|
61
|
+
return this.$request({
|
|
62
|
+
url: API.scene,
|
|
63
|
+
method: 'post',
|
|
64
|
+
data: data
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function saveFormData(data) {
|
|
69
|
+
return this.$request({
|
|
70
|
+
url: data.id !== undefined ? API.editSave : API.addSave,
|
|
71
|
+
method: 'post',
|
|
72
|
+
data: data
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
export function getTableData(data) {
|
|
76
|
+
return this.$request({
|
|
77
|
+
url: API.getData,
|
|
78
|
+
method: 'post',
|
|
79
|
+
data: data
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function getUserInfo() {
|
|
84
|
+
return this.$request({
|
|
85
|
+
url: '/sjyy/sjczgl/form/bdgl/config/getDqyh',
|
|
86
|
+
method: 'get'
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function getFormData(data) {
|
|
91
|
+
return this.$request({
|
|
92
|
+
url: API.view,
|
|
93
|
+
method: 'post',
|
|
94
|
+
data: data
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function getSjyyFields(data) {
|
|
99
|
+
return this.$request({
|
|
100
|
+
url: API.getSjyyFields,
|
|
101
|
+
method: 'post',
|
|
102
|
+
data: data
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
export function getDict(dictType, dictLylx) {
|
|
106
|
+
return this.$request({
|
|
107
|
+
url: API.getDict,
|
|
108
|
+
method: 'post',
|
|
109
|
+
data: { dictType, dictLylx: dictLylx || 'sys' }
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 接口列表
|
|
114
|
+
export function apiList(query) {
|
|
115
|
+
return this.$request({
|
|
116
|
+
url: '/gzt/jkgl/getGztJklist',
|
|
117
|
+
method: 'post',
|
|
118
|
+
data: query
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
// 接口详情
|
|
122
|
+
export function apiView(id) {
|
|
123
|
+
return this.$request({
|
|
124
|
+
url: '/gzt/jkgl/jkglView',
|
|
125
|
+
method: 'post',
|
|
126
|
+
data: { id }
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function getViewData(data) {
|
|
131
|
+
return this.$request({
|
|
132
|
+
url: API.getViewData,
|
|
133
|
+
method: 'post',
|
|
134
|
+
data: data
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function getFormInitData(data) {
|
|
139
|
+
return this.$request({
|
|
140
|
+
url: API.getFormInitData,
|
|
141
|
+
method: 'post',
|
|
142
|
+
data: data
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function getData(url, data) {
|
|
147
|
+
return this.$request({
|
|
148
|
+
url: url,
|
|
149
|
+
method: 'post',
|
|
150
|
+
data: data
|
|
151
|
+
})
|
|
152
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// 根据字典类型查询字典数据信息
|
|
4
|
+
export function getDicts(dictType, dictLylx) {
|
|
5
|
+
let type = dictType.split('/')[0]
|
|
6
|
+
return this.$request({
|
|
7
|
+
url: '/sjyy/sjczgl/form/bdgl/config/getFormDictData',
|
|
8
|
+
data: { dictType: type, dictLylx: dictLylx || dictType.split('/')[1] || 'sys' },
|
|
9
|
+
method: 'post'
|
|
10
|
+
})
|
|
11
|
+
}
|
package/src/app-index.js
CHANGED
|
@@ -1,53 +1,55 @@
|
|
|
1
1
|
import Vue from 'vue'
|
|
2
2
|
import '@/assets/scss/app-form.scss'
|
|
3
3
|
import viewAppForm from '@/views/build/viewAppForm.vue'
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import _AppLayoutBlock from './components/appForm/LayoutBlock.vue'
|
|
4
|
+
import AppForm from '@/components/appForm/Form.vue'
|
|
5
|
+
import AppFormItem from '@/components/appForm/Formitem.vue'
|
|
6
|
+
import AppSubRow from '@/components/appForm/SubRow.vue'
|
|
7
|
+
import AppInput from '@/components/appForm/Input.vue'
|
|
8
|
+
import AppTextBox from '@/components/appForm/TextBox.vue'
|
|
9
|
+
import AppInputHidden from '@/components/appForm/InputHidden.vue'
|
|
10
|
+
import AppSelect from '@/components/appForm/Select.vue'
|
|
11
|
+
import AppRadio from '@/components/appForm/Radio.vue'
|
|
12
|
+
import AppCheckbox from '@/components/appForm/Checkbox.vue'
|
|
13
|
+
import AppDateTimePicker from '@/components/appForm/DateTimePicker.vue'
|
|
14
|
+
import AppDateTimeRange from '@/components/appForm/DateTimePickers.vue'
|
|
15
|
+
import AppInputTree from '@/components/appForm/inputTree.vue'
|
|
16
|
+
import AppInputUpload from '@/components/appForm/InputUpload.vue'
|
|
17
|
+
import AppSearchSelect from '@/components/appForm/SearchSelect.vue'
|
|
18
|
+
import AppSearchApi from '@/components/appForm/SearchApi.vue'
|
|
19
|
+
import AppSubTitle from '@/components/appForm/SubTitle.vue'
|
|
20
|
+
import AppTable from '@/components/appForm/Table.vue'
|
|
21
|
+
import AppButton from '@/components/appForm/Button.vue'
|
|
22
|
+
import AppLayoutBlock from './components/appForm/LayoutBlock.vue'
|
|
24
23
|
|
|
25
24
|
const components = {
|
|
26
25
|
AppFormView: viewAppForm,
|
|
27
|
-
AppForm
|
|
28
|
-
AppFormItem
|
|
29
|
-
AppSubRow
|
|
30
|
-
AppInput
|
|
31
|
-
AppTextBox
|
|
32
|
-
AppInputHidden
|
|
33
|
-
AppSelect
|
|
34
|
-
AppRadio
|
|
35
|
-
AppCheckbox
|
|
36
|
-
AppDateTimePicker
|
|
37
|
-
AppDateTimeRange
|
|
38
|
-
AppInputTree
|
|
39
|
-
AppInputUpload
|
|
40
|
-
AppSearchSelect
|
|
41
|
-
AppSearchApi
|
|
42
|
-
AppSubTitle
|
|
43
|
-
AppTable
|
|
44
|
-
AppButton
|
|
45
|
-
AppLayoutBlock
|
|
26
|
+
AppForm,
|
|
27
|
+
AppFormItem,
|
|
28
|
+
AppSubRow,
|
|
29
|
+
AppInput,
|
|
30
|
+
AppTextBox,
|
|
31
|
+
AppInputHidden,
|
|
32
|
+
AppSelect,
|
|
33
|
+
AppRadio,
|
|
34
|
+
AppCheckbox,
|
|
35
|
+
AppDateTimePicker,
|
|
36
|
+
AppDateTimeRange,
|
|
37
|
+
AppInputTree,
|
|
38
|
+
AppInputUpload,
|
|
39
|
+
AppSearchSelect,
|
|
40
|
+
AppSearchApi,
|
|
41
|
+
AppSubTitle,
|
|
42
|
+
AppTable,
|
|
43
|
+
AppButton,
|
|
44
|
+
AppLayoutBlock
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
const install = function (Vue) {
|
|
49
48
|
if (install.installed) return
|
|
50
49
|
install.installed = true
|
|
50
|
+
if (options.request) {
|
|
51
|
+
Vue.prototype.$request = options.request
|
|
52
|
+
}
|
|
51
53
|
Object.values(components).forEach(comp => {
|
|
52
54
|
Vue.component(comp.name, comp)
|
|
53
55
|
})
|
|
@@ -59,24 +61,24 @@ const AppFormPlugin = {
|
|
|
59
61
|
}
|
|
60
62
|
export default AppFormPlugin
|
|
61
63
|
|
|
62
|
-
//
|
|
64
|
+
// 逐行具名导出,不会和顶部import变量重名
|
|
63
65
|
export const AppFormView = components.AppFormView
|
|
64
|
-
export const
|
|
65
|
-
export const
|
|
66
|
-
export const
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
69
|
-
export const
|
|
70
|
-
export const
|
|
71
|
-
export const
|
|
72
|
-
export const
|
|
73
|
-
export const
|
|
74
|
-
export const
|
|
75
|
-
export const
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
66
|
+
export const CAppForm = components.AppForm
|
|
67
|
+
export const CAppFormItem = components.AppFormItem
|
|
68
|
+
export const CAppSubRow = components.AppSubRow
|
|
69
|
+
export const CAppInput = components.AppInput
|
|
70
|
+
export const CAppTextBox = components.AppTextBox
|
|
71
|
+
export const CAppInputHidden = components.AppInputHidden
|
|
72
|
+
export const CAppSelect = components.AppSelect
|
|
73
|
+
export const CAppRadio = components.AppRadio
|
|
74
|
+
export const CAppCheckbox = components.AppCheckbox
|
|
75
|
+
export const CAppDateTimePicker = components.AppDateTimePicker
|
|
76
|
+
export const CAppDateTimeRange = components.AppDateTimeRange
|
|
77
|
+
export const CAppInputTree = components.AppInputTree
|
|
78
|
+
export const CAppInputUpload = components.AppInputUpload
|
|
79
|
+
export const CAppSearchSelect = components.AppSearchSelect
|
|
80
|
+
export const CAppSearchApi = components.AppSearchApi
|
|
81
|
+
export const CAppSubTitle = components.AppSubTitle
|
|
82
|
+
export const CAppTable = components.AppTable
|
|
83
|
+
export const CAppButton = components.AppButton
|
|
84
|
+
export const CAppLayoutBlock = components.AppLayoutBlock
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
:disabled="attrs.readonly || attrs.disabled">
|
|
6
6
|
<van-checkbox :name="option.value" v-for="option in selectOptions" :key="option.value" shape="square">{{
|
|
7
7
|
option.label
|
|
8
|
-
|
|
8
|
+
}}</van-checkbox>
|
|
9
9
|
</template>
|
|
10
10
|
</van-field>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
|
-
import { getDicts } from '@/api/dict/data'
|
|
14
|
+
import { getDicts } from '@/api/dict/app-data'
|
|
15
15
|
import baseMixin from './baseMixin.js'
|
|
16
16
|
import eventsMixin from '../form/form-event-mixin.js'
|
|
17
17
|
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<van-radio-group v-model="innerValue" @change="handleChange" direction="horizontal"
|
|
5
5
|
:disabled="attrs.readonly || attrs.disabled">
|
|
6
6
|
<van-radio :name="option.value" v-for="option in selectOptions" :key="option.value">{{ option.label
|
|
7
|
-
|
|
7
|
+
}}</van-radio>
|
|
8
8
|
</template>
|
|
9
9
|
</van-field>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script>
|
|
13
|
-
import { getDicts } from '@/api/dict/data'
|
|
13
|
+
import { getDicts } from '@/api/dict/app-data'
|
|
14
14
|
import baseMixin from './baseMixin.js'
|
|
15
15
|
import eventsMixin from '../form/form-event-mixin.js'
|
|
16
16
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { mapState } from 'vuex'
|
|
2
|
-
import request from '@/utils/request'
|
|
3
2
|
import DataFetcher from '@/utils/DataFetcher'
|
|
4
3
|
import { isPlainObject, isArray } from '@/utils/index.js'
|
|
5
4
|
import config from '@/utils/config'
|
|
@@ -222,6 +221,6 @@ export default {
|
|
|
222
221
|
}
|
|
223
222
|
},
|
|
224
223
|
created: function () {
|
|
225
|
-
this.dataFetcher = new DataFetcher(request)
|
|
224
|
+
this.dataFetcher = new DataFetcher(this.$request)
|
|
226
225
|
},
|
|
227
226
|
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
import { baseComponents } from '@/utils/generator/config'
|
|
24
24
|
import { mapActions, mapState } from 'vuex'
|
|
25
25
|
import AppFormItem from './AppFormItem.vue'
|
|
26
|
-
import { getFormData, getFormInitData, getViewData } from '@/api/form'
|
|
26
|
+
import { getFormData, getFormInitData, getViewData } from '@/api/app-form'
|
|
27
27
|
import { findFirstNodeByNameAndSjbName } from '@/utils/index'
|
|
28
28
|
export default {
|
|
29
29
|
components: {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
</template>
|
|
32
32
|
<script>
|
|
33
|
-
import { mapActions, mapState } from 'vuex'
|
|
34
33
|
import FormItem from './FormItem'
|
|
35
34
|
import ViewFormItem from './viewFormItem'
|
|
36
35
|
import { getFormData, getFormInitData, getViewData } from '@/api/form'
|
|
@@ -56,7 +55,6 @@ export default {
|
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
computed: {
|
|
59
|
-
...mapState('user', ['userInfo']),
|
|
60
58
|
hiddenList() {
|
|
61
59
|
return this.drawingList.filter(item => item.noDrag)
|
|
62
60
|
},
|
|
@@ -244,7 +242,6 @@ export default {
|
|
|
244
242
|
|
|
245
243
|
},
|
|
246
244
|
methods: {
|
|
247
|
-
...mapActions('user', ['fetchUserInfo']),
|
|
248
245
|
updateItem(key, value) {
|
|
249
246
|
// 场景1:key是对象(原有逻辑,适配 name/sjbName/key 格式)
|
|
250
247
|
if (typeof key === 'object') {
|