@bdsoft/element 1.1.13 → 1.1.15
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/index.html +13 -0
- package/index.js +12 -12
- package/package.json +19 -23
- package/src/App.vue +28 -0
- package/src/assets/css/element.scss +196 -0
- package/src/assets/css/layout.scss +215 -0
- package/src/assets/css/tailwind.scss +67 -0
- package/src/assets/images/banner.gif +0 -0
- package/src/assets/images/banner.png +0 -0
- package/src/assets/images/bg1.svg +22 -0
- package/src/assets/images/bg2.png +0 -0
- package/src/assets/images/ff.png +0 -0
- package/src/assets/images/home-file1.png +0 -0
- package/src/assets/images/ky.png +0 -0
- package/src/assets/images/menu/add.png +0 -0
- package/src/assets/images/menu/del.png +0 -0
- package/src/assets/images/menu/down.png +0 -0
- package/src/assets/images/menu/dr.png +0 -0
- package/src/assets/images/menu/edit.png +0 -0
- package/src/assets/images/menu/kx.png +0 -0
- package/src/assets/images/menu/mb.png +0 -0
- package/src/assets/images/menu/pz.png +0 -0
- package/src/assets/images/menu/save.png +0 -0
- package/src/assets/images/menu/sj.png +0 -0
- package/src/assets/images/menu/sjk.png +0 -0
- package/src/assets/images/menu/up.png +0 -0
- package/src/assets/images/po-i.png +0 -0
- package/src/assets/images/po1-i1.png +0 -0
- package/src/assets/images/po1-i2.png +0 -0
- package/src/assets/images/po1-i3.png +0 -0
- package/src/assets/images/po1-i4.png +0 -0
- package/src/assets/images/po1-i5.png +0 -0
- package/src/assets/images/po1-i6.png +0 -0
- package/src/assets/images/po1-i7.png +0 -0
- package/src/assets/images/po1-i8.png +0 -0
- package/src/assets/images/po2-i1.png +0 -0
- package/src/assets/images/po2-i2.png +0 -0
- package/src/assets/images/po3-i1.png +0 -0
- package/src/assets/images/po4-i1.png +0 -0
- package/src/assets/images/po5-i1.png +0 -0
- package/src/assets/images/po6-i1.png +0 -0
- package/src/assets/images/po6-i2.png +0 -0
- package/src/assets/images/po7-i1.png +0 -0
- package/src/assets/images/tj1.png +0 -0
- package/src/assets/images/tj2.png +0 -0
- package/src/assets/images/tj3.png +0 -0
- package/src/components/3dcloudwords/index.js +346 -0
- package/src/components/3dcloudwords/index.vue +99 -0
- package/src/components/3dcloudwords/readme.md +66 -0
- package/src/components/badge/index.js +167 -0
- package/src/components/badge/index.scss +166 -0
- package/src/components/badge/index.vue +98 -0
- package/src/components/badge/readme.md +18 -0
- package/src/components/basic/Finish.vue +107 -0
- package/src/components/basic/button.vue +19 -0
- package/src/components/basic/readme.md +7 -0
- package/src/components/button/index.vue +48 -0
- package/src/components/button/readme.md +62 -0
- package/src/components/carousel/index.vue +104 -0
- package/src/components/carousel/readme.md +12 -0
- package/src/components/chartconfig/index.vue +141 -0
- package/src/components/chartconfig/readme.md +25 -0
- package/src/components/contextMenu/hookContxtMenu.js +41 -0
- package/src/components/contextMenu/index.vue +245 -0
- package/src/components/contextMenu/readme.md +55 -0
- package/src/components/contextMenu/useElementBounding.js +40 -0
- package/src/components/countup/countUp.js +196 -0
- package/src/components/countup/index.vue +114 -0
- package/src/components/countup/readme.md +9 -0
- package/src/components/empty/assets/build.png +0 -0
- package/src/components/empty/assets/emptybg.gif +0 -0
- package/src/components/empty/assets/emptybg.png +0 -0
- package/src/components/empty/assets/emptybg2.jpg +0 -0
- package/src/components/empty/assets/emptybg3.jpg +0 -0
- package/src/components/empty/assets/wuxiao.png +0 -0
- package/src/components/empty/assets/wuxiao.webp +0 -0
- package/src/components/empty/building.vue +117 -0
- package/src/components/empty/empty.vue +120 -0
- package/src/components/empty/index.js +12 -0
- package/src/components/empty/invalid.vue +56 -0
- package/src/components/error/Error.vue +79 -0
- package/src/components/error/readme.md +20 -0
- package/src/components/form/Form.vue +84 -0
- package/src/components/form/FormItem.vue +143 -0
- package/src/components/form/data.js +52 -0
- package/src/components/form/readme.md +69 -0
- package/src/components/layout/banner.vue +412 -0
- package/src/components/layout/bar.vue +43 -0
- package/src/components/layout/layout1.vue +60 -0
- package/src/components/layout/layout2.vue +134 -0
- package/src/components/layout/layout3.vue +107 -0
- package/src/components/layout/layout4.vue +66 -0
- package/src/components/layout/nav.vue +333 -0
- package/src/components/layout/readme.md +61 -0
- package/src/components/loading/index.vue +122 -0
- package/src/components/loading/readme.md +6 -0
- package/src/components/notice/NoticeList.vue +198 -0
- package/src/components/notice/NoticeListPaging.vue +281 -0
- package/src/components/notice/NoticeView.vue +92 -0
- package/src/components/notice/readme.md +1 -0
- package/src/components/pagination/index.vue +100 -0
- package/src/components/pagination/readme.md +19 -0
- package/src/components/pagination/scroll-to.js +51 -0
- package/src/components/progress/bar.vue +72 -0
- package/src/components/progress/progress.vue +58 -0
- package/src/components/screenfull/index.js +3 -0
- package/src/components/screenfull/index.vue +65 -0
- package/src/components/screenfull/package.json +15 -0
- package/src/components/screenfull/readme.md +6 -0
- package/src/components/statisticalCount/index.vue +80 -0
- package/src/components/statisticalCount/readme.md +21 -0
- package/src/components/username/index.vue +79 -0
- package/src/components/username/readme.md +22 -0
- package/src/components/username//346/225/210/346/236/234/345/233/276.png +0 -0
- package/src/global/index.ts +6 -0
- package/src/global/register-properties.ts +10 -0
- package/src/index.js +88 -0
- package/src/utils/coms/load.jsx +10 -0
- package/src/utils/func.js +62 -0
- package/src/utils/hookDialog.js +38 -0
- package/src/utils/hookPage.js +49 -0
- package/src/utils/index.js +5 -0
- package/src/utils/lib/console.js +39 -0
- package/src/utils/lib/debounce.js +19 -0
- package/src/utils/lib/deepextend.js +51 -0
- package/src/utils/lib/deepset.js +14 -0
- package/src/utils/lib/extend.js +28 -0
- package/src/utils/lib/index.js +13 -0
- package/src/utils/lib/json.js +90 -0
- package/src/utils/lib/mergeprops.js +62 -0
- package/src/utils/lib/mitt.js +43 -0
- package/src/utils/lib/modify.js +8 -0
- package/src/utils/lib/slot.js +19 -0
- package/src/utils/lib/toarray.js +5 -0
- package/src/utils/lib/tocase.js +11 -0
- package/src/utils/lib/todate.js +10 -0
- package/src/utils/lib/toline.js +10 -0
- package/src/utils/lib/tostring.js +7 -0
- package/src/utils/lib/type.js +45 -0
- package/src/utils/lib/unique.js +6 -0
- package/src/utils/message.js +164 -0
- package/src/utils/type.js +45 -0
- package/src/xm_components/HeadSearch/hook/hookSearch.js +96 -0
- package/src/xm_components/HeadSearch/index.vue +206 -0
- package/src/xm_components/HeadSearch/readme.md +12 -0
- package/src/xm_components/HeadSearch//346/220/234/347/264/242/345/210/227/350/241/250.png +0 -0
- package/src/xm_components/Milestone/index.vue +213 -0
- package/src/xm_components/Milestone/readme.md +15 -0
- package/src/xm_components/MultiStatisticalCard/image.png +0 -0
- package/src/xm_components/MultiStatisticalCard/index.vue +114 -0
- package/src/xm_components/MultiStatisticalCard/readme.md +29 -0
- package/src/xm_components/StatisticalCard/image.png +0 -0
- package/src/xm_components/StatisticalCard/index.vue +196 -0
- package/src/xm_components/StatisticalCard/readme.md +41 -0
- package/src/xm_components/readme.md +1 -0
- package/vite.config.js +58 -0
- package/dist/BdElement.js +0 -23432
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 认证失败错误页面
|
|
3
|
+
* @Author: lbq
|
|
4
|
+
* @Date: 2024-04-25 14:39:42
|
|
5
|
+
* @LastEditors: lbq
|
|
6
|
+
* @LastEditTime: 2024-04-25 14:39:42
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref, reactive, computed, watch, onMounted } from 'vue'
|
|
10
|
+
// import { useRoute, useRouter } from 'vue-router'
|
|
11
|
+
|
|
12
|
+
// const route = useRoute()
|
|
13
|
+
// const router = useRouter()
|
|
14
|
+
|
|
15
|
+
const msgStr = ref('认证失败!请重新登录')
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 注销登录,返回首页
|
|
19
|
+
*/
|
|
20
|
+
const logOutuser = () => {
|
|
21
|
+
let url = $bd.ptUrl || 'http://123.129.65.205:8034/bdpt'
|
|
22
|
+
if(!$bd.ptUrl){
|
|
23
|
+
console.error('请配置ptUrl')
|
|
24
|
+
}
|
|
25
|
+
window.open(url, '_self')
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<template>
|
|
29
|
+
<div class="container">
|
|
30
|
+
<div class="image-container">
|
|
31
|
+
<img src="../../assets/images/ff.png" alt="" />
|
|
32
|
+
<div class="text" v-html="msgStr"></div>
|
|
33
|
+
<el-text class="eltext" @click="logOutuser">点击登录</el-text>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.container {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
height: 100vh; /* 设置容器高度为视口高度 */
|
|
44
|
+
.image-container {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
width: 300px;
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
.image {
|
|
52
|
+
width: 100px; /* 设置图片宽度 */
|
|
53
|
+
height: 100px; /* 设置图片高度 */
|
|
54
|
+
}
|
|
55
|
+
.text {
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 450px;
|
|
58
|
+
top: 180px;
|
|
59
|
+
left: -30%;
|
|
60
|
+
line-height: 50px;
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
margin-top: 10px; /* 设置文字与图片之间的间距 */
|
|
63
|
+
color: #7e7e7e;
|
|
64
|
+
text-align: center;
|
|
65
|
+
}
|
|
66
|
+
.eltext {
|
|
67
|
+
position: absolute;
|
|
68
|
+
width: 450px;
|
|
69
|
+
top: 220px;
|
|
70
|
+
left: -30%;
|
|
71
|
+
line-height: 50px;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
margin-top: 10px; /* 设置文字与图片之间的间距 */
|
|
74
|
+
color: #1159a7;
|
|
75
|
+
text-align: center;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 错误异常展示
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
import { BdError } from '@bdsoft/element'
|
|
5
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
6
|
+
const router = useRouter()
|
|
7
|
+
|
|
8
|
+
// router/index.js
|
|
9
|
+
{
|
|
10
|
+
path: '/error',
|
|
11
|
+
name: 'error',
|
|
12
|
+
component: BdError
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
// 使用场景 在判断用户未登录或者没有权限时,可以跳转到错误页面
|
|
16
|
+
if (!_ticket) {
|
|
17
|
+
router.push({ path: '/error' })
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription:
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2021-06-08 09 时
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间 @update:modelValue="newValue=>formModel[formKey]=newValue"
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div>
|
|
10
|
+
<el-form ref="formRef" label-width="auto" inline :model="formModel" :rules="rules" @submit.prevent>
|
|
11
|
+
<template #default="{ slotProps }">
|
|
12
|
+
<BDFormItem v-for="(item, index) in config" :config="config" :item-config="item" :key="index"
|
|
13
|
+
v-model="formModel[item['formKey']]" @click="handleItemClick">
|
|
14
|
+
</BDFormItem>
|
|
15
|
+
</template>
|
|
16
|
+
</el-form>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script setup>
|
|
20
|
+
import { ref, reactive, computed, watch, onMounted } from "vue";
|
|
21
|
+
// 组件
|
|
22
|
+
import BDFormItem from './FormItem.vue'
|
|
23
|
+
|
|
24
|
+
const emits = defineEmits(['query'])
|
|
25
|
+
// props
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
formConfig: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
rules:{
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => {}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
const config = ref([])
|
|
37
|
+
// 内置表单
|
|
38
|
+
const formModel = reactive({})
|
|
39
|
+
const formRef = ref()
|
|
40
|
+
watch(
|
|
41
|
+
() => props.formConfig,
|
|
42
|
+
(newVal, oldVal) => {
|
|
43
|
+
if (newVal != '') {
|
|
44
|
+
// 属性赋值
|
|
45
|
+
props.formConfig.map(v => {
|
|
46
|
+
formModel[v.formKey] = v.value
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
config.value = props.formConfig
|
|
50
|
+
console.log('props.formConfig', props.formConfig);
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
immediate: true,
|
|
56
|
+
deep: true
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
// click事件
|
|
60
|
+
const handleItemClick = (parms) => {
|
|
61
|
+
|
|
62
|
+
if (parms.key == 'qyBtn') {
|
|
63
|
+
emits('query', formModel)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const getFormData = async () => {
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
formRef.value.validate((valid) => {
|
|
69
|
+
if (valid) {
|
|
70
|
+
resolve({ status: true, formdata: formModel })
|
|
71
|
+
} else {
|
|
72
|
+
resolve({ status: false })
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
})
|
|
79
|
+
defineExpose({
|
|
80
|
+
getFormData
|
|
81
|
+
})
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 动态表单渲染
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2021-06-08 09 时
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
<script lang="jsx">
|
|
9
|
+
import { defineComponent, toRefs, h, computed } from "vue";
|
|
10
|
+
import { ElFormItem, ElInput, ElButton, ElSelect, ElCheckbox, ElOption, ElDatePicker, ElInputNumber,ElTreeSelect } from 'element-plus';
|
|
11
|
+
|
|
12
|
+
const componentMap = {
|
|
13
|
+
'el-input': ElInput,
|
|
14
|
+
'el-select': ElSelect,
|
|
15
|
+
'el-button': ElButton,
|
|
16
|
+
'el-option': ElOption,
|
|
17
|
+
'el-checkbox': ElCheckbox,
|
|
18
|
+
'el-date-picker': ElDatePicker,
|
|
19
|
+
'el-input-number': ElInputNumber,
|
|
20
|
+
'el-tree-select': ElTreeSelect
|
|
21
|
+
// 其他表单项类型
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: "FormItem",
|
|
26
|
+
props: {
|
|
27
|
+
config: Array, // 接收外部传入的配置
|
|
28
|
+
itemConfig: Object, // 接收配置,外部传入
|
|
29
|
+
modelValue: [String, Number, Boolean, Array, Object],
|
|
30
|
+
},
|
|
31
|
+
emits: ['update:modelValue', 'click'],
|
|
32
|
+
setup(props, { slots, attrs, emit }) {
|
|
33
|
+
// 使用 toRefs 来确保响应式
|
|
34
|
+
const { modelValue, itemConfig } = toRefs(props);
|
|
35
|
+
|
|
36
|
+
// 定义计算属性
|
|
37
|
+
const componentShow = computed(() => {
|
|
38
|
+
const vIfArr = itemConfig.value?.options?.vIf;
|
|
39
|
+
if (!vIfArr) return true;
|
|
40
|
+
|
|
41
|
+
const relationArr = props.config.filter(configItem =>
|
|
42
|
+
vIfArr.find(vIf => vIf.relationKey === configItem.formKey)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
for (const relationItem of relationArr) {
|
|
46
|
+
const vIfItem = vIfArr.find(vIf => vIf.relationKey === relationItem.formKey);
|
|
47
|
+
|
|
48
|
+
// 这里判断联动的表单值是否不满足可以显示的条件,不满足则不显示
|
|
49
|
+
if (relationItem.value !== vIfItem.value) return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// 使用 emit 来传递值的更新
|
|
56
|
+
const handleUpdate = (value) => {
|
|
57
|
+
console.info('触发更新', value)
|
|
58
|
+
emit('update:modelValue', value);
|
|
59
|
+
};
|
|
60
|
+
// let _itemConfig = props.itemConfig
|
|
61
|
+
let aa = itemConfig.value.type
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// 处理button
|
|
65
|
+
const renderButton = () => {
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
return () => {
|
|
69
|
+
// 判断是否显示
|
|
70
|
+
if (!componentShow.value) return;
|
|
71
|
+
|
|
72
|
+
const Component = componentMap[itemConfig.value.type];
|
|
73
|
+
|
|
74
|
+
const inputWidth = itemConfig.value.width ? `${itemConfig.value.width}px` : '100%';
|
|
75
|
+
|
|
76
|
+
const componentStyle = { width: inputWidth };
|
|
77
|
+
|
|
78
|
+
console.info(`渲染组件:${aa},componentStyle:${inputWidth}`)
|
|
79
|
+
switch (itemConfig.value.type) {
|
|
80
|
+
case 'el-button':
|
|
81
|
+
return h(ElFormItem, {
|
|
82
|
+
// label: itemConfig.value.label,
|
|
83
|
+
style: componentStyle
|
|
84
|
+
}, {
|
|
85
|
+
default: () => [
|
|
86
|
+
h(ElButton,
|
|
87
|
+
{
|
|
88
|
+
...attrs,
|
|
89
|
+
...itemConfig.value.options, // 假设所有按钮相关的属性都在 buttonProps 对象内
|
|
90
|
+
style: componentStyle,
|
|
91
|
+
// onClick: () => emit('click', { key: itemConfig.value.formKey }) // 假设按钮点击事件的处理函数为外部传入
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
default: () => [
|
|
95
|
+
itemConfig.value.label || 'Button'
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) // 使用默认值或从配置中获取按钮内容
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
default:
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 特殊处理 el-date-picker
|
|
106
|
+
// const datePickerProps = itemConfig.value.type === 'el-date-picker' ? {
|
|
107
|
+
// type: itemConfig.value.dateType, // 根据itemConfig里的配置来决定日期选择器的类型
|
|
108
|
+
// format: itemConfig.value.dateFormat // 你可以在itemConfig中定义dateFormat来控制日期格式
|
|
109
|
+
// } : {};
|
|
110
|
+
|
|
111
|
+
// 针对 select 组件的特殊处理
|
|
112
|
+
const slotContent = itemConfig.value.type === 'el-select' ?
|
|
113
|
+
() => itemConfig.value.optionData.map(option => {
|
|
114
|
+
return h(ElOption, { label: option.label, value: option.value });
|
|
115
|
+
}) :
|
|
116
|
+
null; // 非 select 类型组件不需要插槽
|
|
117
|
+
|
|
118
|
+
return h(ElFormItem, {
|
|
119
|
+
label: itemConfig.value.label,
|
|
120
|
+
prop: itemConfig.value.formKey,
|
|
121
|
+
style: componentStyle,
|
|
122
|
+
rules: itemConfig.value.rules,
|
|
123
|
+
}, {
|
|
124
|
+
default: () => [ // 使用函数插槽 type\props attribute 和 property都能在 prop 中书写\children
|
|
125
|
+
|
|
126
|
+
h(Component,
|
|
127
|
+
{
|
|
128
|
+
modelValue: modelValue.value,
|
|
129
|
+
'onUpdate:modelValue': (value) => emit('update:modelValue', value),
|
|
130
|
+
...attrs,
|
|
131
|
+
// style: componentStyle,
|
|
132
|
+
style: { width: '100%' },
|
|
133
|
+
// ...datePickerProps, // 将datePickerProps传递给el-date-picker组件
|
|
134
|
+
...itemConfig.value.options
|
|
135
|
+
}, slotContent)
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'el-input',
|
|
4
|
+
label: '活动名称',
|
|
5
|
+
formKey: 'name',
|
|
6
|
+
value: '1', // 默认值为空字符串
|
|
7
|
+
width:100,
|
|
8
|
+
options: {
|
|
9
|
+
vIf: [
|
|
10
|
+
// 表示:当 form.area === 'area1',才显示
|
|
11
|
+
{ relationKey: 'area', value: 'area1' }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
rules:[]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'el-select',
|
|
18
|
+
label: '活动区域',
|
|
19
|
+
formKey: 'area',
|
|
20
|
+
value: 'area1',
|
|
21
|
+
width:100,
|
|
22
|
+
options: {
|
|
23
|
+
multiple: true
|
|
24
|
+
},
|
|
25
|
+
optionData: [ // 这里模拟去后端拉回数据
|
|
26
|
+
{ label: '区域1', value: 'area1' },
|
|
27
|
+
{ label: '区域2', value: 'area2' }
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'el-date-picker',
|
|
32
|
+
label: '选择',
|
|
33
|
+
formKey: '',
|
|
34
|
+
value: '',
|
|
35
|
+
width:100,
|
|
36
|
+
dateType:'', // 日期包含数据类型
|
|
37
|
+
options: {
|
|
38
|
+
// multiple: true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
{
|
|
42
|
+
type: 'el-button',
|
|
43
|
+
label: '确定',
|
|
44
|
+
formKey: 'area',
|
|
45
|
+
value: 'area1',
|
|
46
|
+
width:100,
|
|
47
|
+
options: {
|
|
48
|
+
type:'primary',
|
|
49
|
+
// multiple: true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
## 示例demo
|
|
4
|
+
```
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
type: 'el-input',
|
|
8
|
+
label: '活动名称',
|
|
9
|
+
formKey: 'name',
|
|
10
|
+
value: '1', // 默认值为空字符串
|
|
11
|
+
width:100,
|
|
12
|
+
options: {
|
|
13
|
+
vIf: [
|
|
14
|
+
// 表示:当 form.area === 'area1',才显示
|
|
15
|
+
{ relationKey: 'area', value: 'area1' }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
rules:[]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'el-select',
|
|
22
|
+
label: '活动区域',
|
|
23
|
+
formKey: 'area',
|
|
24
|
+
value: 'area1',
|
|
25
|
+
width:100,
|
|
26
|
+
options: {
|
|
27
|
+
multiple: true
|
|
28
|
+
},
|
|
29
|
+
optionData: [ // 这里模拟去后端拉回数据
|
|
30
|
+
{ label: '区域1', value: 'area1' },
|
|
31
|
+
{ label: '区域2', value: 'area2' }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'el-button',
|
|
36
|
+
label: '确定',
|
|
37
|
+
formKey: 'area',
|
|
38
|
+
value: 'area1',
|
|
39
|
+
width:100,
|
|
40
|
+
options: {
|
|
41
|
+
multiple: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
<template>
|
|
46
|
+
<div>
|
|
47
|
+
<el-form label-width="auto" inline :model="form1" >
|
|
48
|
+
<BDFormItem v-for="(item, index) in config" :item-config="item" :key="index" />
|
|
49
|
+
</el-form>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
<script setup>
|
|
53
|
+
import { ref, reactive, computed, watch, onMounted } from "vue";
|
|
54
|
+
import datas from './data.js'
|
|
55
|
+
|
|
56
|
+
const form1 = reactive({
|
|
57
|
+
age: '',
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
// 组件
|
|
61
|
+
import { BDFormItem } from '@bdsoft/element'
|
|
62
|
+
|
|
63
|
+
const config = ref(datas)
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
})
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped></style>
|
|
69
|
+
```
|