@bdsoft/element 1.1.0
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/README.md +90 -0
- package/global/index.ts +6 -0
- package/global/register-properties.ts +10 -0
- package/index.html +13 -0
- package/index.js +84 -0
- package/package-form/core/components/formCreate.js +274 -0
- package/package-form/core/components/fragment.js +12 -0
- package/package-form/core/factory/context.js +257 -0
- package/package-form/core/factory/creator.js +63 -0
- package/package-form/core/factory/maker.js +17 -0
- package/package-form/core/factory/manager.js +79 -0
- package/package-form/core/factory/node.js +85 -0
- package/package-form/core/factory/parser.js +28 -0
- package/package-form/core/frame/api.js +599 -0
- package/package-form/core/frame/attrs.js +12 -0
- package/package-form/core/frame/dataDriver.js +76 -0
- package/package-form/core/frame/fetch.js +119 -0
- package/package-form/core/frame/formCreate.js +274 -0
- package/package-form/core/frame/index.js +760 -0
- package/package-form/core/frame/provider.js +288 -0
- package/package-form/core/frame/util.js +274 -0
- package/package-form/core/handler/context.js +380 -0
- package/package-form/core/handler/effect.js +122 -0
- package/package-form/core/handler/index.js +111 -0
- package/package-form/core/handler/inject.js +145 -0
- package/package-form/core/handler/input.js +197 -0
- package/package-form/core/handler/lifecycle.js +43 -0
- package/package-form/core/handler/loader.js +373 -0
- package/package-form/core/handler/page.js +46 -0
- package/package-form/core/handler/render.js +29 -0
- package/package-form/core/index.js +12 -0
- package/package-form/core/package.json +15 -0
- package/package-form/core/parser/html.js +17 -0
- package/package-form/core/render/cache.js +47 -0
- package/package-form/core/render/index.js +31 -0
- package/package-form/core/render/render.js +393 -0
- package/package-form/element-form/components/checkbox/package.json +17 -0
- package/package-form/element-form/components/checkbox/src/component.jsx +110 -0
- package/package-form/element-form/components/checkbox/src/index.js +3 -0
- package/package-form/element-form/components/frame/package.json +17 -0
- package/package-form/element-form/components/frame/src/IconCircleClose.vue +14 -0
- package/package-form/element-form/components/frame/src/IconDelete.vue +12 -0
- package/package-form/element-form/components/frame/src/IconDocument.vue +12 -0
- package/package-form/element-form/components/frame/src/IconFolderOpened.vue +12 -0
- package/package-form/element-form/components/frame/src/IconView.vue +12 -0
- package/package-form/element-form/components/frame/src/component.jsx +349 -0
- package/package-form/element-form/components/frame/src/index.js +3 -0
- package/package-form/element-form/components/frame/src/style.css +66 -0
- package/package-form/element-form/components/group/package.json +17 -0
- package/package-form/element-form/components/group/src/component.jsx +314 -0
- package/package-form/element-form/components/group/src/index.js +3 -0
- package/package-form/element-form/components/group/src/style.css +125 -0
- package/package-form/element-form/components/index.js +22 -0
- package/package-form/element-form/components/radio/package.json +17 -0
- package/package-form/element-form/components/radio/src/component.jsx +101 -0
- package/package-form/element-form/components/radio/src/index.js +3 -0
- package/package-form/element-form/components/select/package.json +17 -0
- package/package-form/element-form/components/select/src/component.jsx +52 -0
- package/package-form/element-form/components/select/src/index.js +3 -0
- package/package-form/element-form/components/subform/package.json +14 -0
- package/package-form/element-form/components/subform/src/component.jsx +76 -0
- package/package-form/element-form/components/subform/src/index.js +3 -0
- package/package-form/element-form/components/tree/package.json +17 -0
- package/package-form/element-form/components/tree/src/component.jsx +62 -0
- package/package-form/element-form/components/tree/src/index.js +3 -0
- package/package-form/element-form/components/upload/package.json +17 -0
- package/package-form/element-form/components/upload/src/IconUpload.vue +12 -0
- package/package-form/element-form/components/upload/src/component.jsx +129 -0
- package/package-form/element-form/components/upload/src/index.js +3 -0
- package/package-form/element-form/components/upload/src/style.css +11 -0
- package/package-form/element-form/index.js +8 -0
- package/package-form/element-form/package.json +16 -0
- package/package-form/element-form/src/components/icon/IconWarning.vue +12 -0
- package/package-form/element-form/src/components/index.js +22 -0
- package/package-form/element-form/src/core/alias.js +34 -0
- package/package-form/element-form/src/core/api.js +208 -0
- package/package-form/element-form/src/core/config.js +62 -0
- package/package-form/element-form/src/core/index.js +60 -0
- package/package-form/element-form/src/core/maker.js +76 -0
- package/package-form/element-form/src/core/manager.js +315 -0
- package/package-form/element-form/src/core/provider.js +79 -0
- package/package-form/element-form/src/parsers/datePicker.js +31 -0
- package/package-form/element-form/src/parsers/hidden.js +12 -0
- package/package-form/element-form/src/parsers/index.js +17 -0
- package/package-form/element-form/src/parsers/input.js +21 -0
- package/package-form/element-form/src/parsers/row.js +10 -0
- package/package-form/element-form/src/parsers/select.js +15 -0
- package/package-form/element-form/src/parsers/slider.js +21 -0
- package/package-form/element-form/src/parsers/timePicker.js +17 -0
- package/package-form/element-form/src/style/index.css +52 -0
- package/package.json +17 -0
- package/src/App.vue +28 -0
- package/src/assets/css/element.scss +179 -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 +112 -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/index.js +82 -0
- package/src/utils/index.js +32 -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 +212 -0
- package/src/xm_components/Milestone/readme.md +15 -0
- package/src/xm_components/readme.md +1 -0
- package/utils/coms/load.jsx +10 -0
- package/utils/func.js +32 -0
- package/utils/hookDialog.js +38 -0
- package/utils/hookPage.js +49 -0
- package/utils/index.js +5 -0
- package/utils/lib/console.js +39 -0
- package/utils/lib/debounce.js +19 -0
- package/utils/lib/deepextend.js +51 -0
- package/utils/lib/deepset.js +14 -0
- package/utils/lib/extend.js +28 -0
- package/utils/lib/index.js +13 -0
- package/utils/lib/json.js +90 -0
- package/utils/lib/mergeprops.js +62 -0
- package/utils/lib/mitt.js +43 -0
- package/utils/lib/modify.js +8 -0
- package/utils/lib/slot.js +19 -0
- package/utils/lib/toarray.js +5 -0
- package/utils/lib/tocase.js +11 -0
- package/utils/lib/todate.js +10 -0
- package/utils/lib/toline.js +10 -0
- package/utils/lib/tostring.js +7 -0
- package/utils/lib/type.js +45 -0
- package/utils/lib/unique.js +6 -0
- package/utils/message.js +166 -0
- package/utils/package.json +16 -0
- package/utils/type.js +45 -0
- package/vite.config.js +51 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 搜索组件 todo
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2021-06-08 09 时
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="search_warp">
|
|
11
|
+
<img :src="logoUrl" v-if="logoUrl"
|
|
12
|
+
style="width: 40px; height: 40px;margin-right: 5px; vertical-align: middle; cursor: pointer" alt=""
|
|
13
|
+
@click="gohome" />
|
|
14
|
+
<div class="ipt_search">
|
|
15
|
+
<el-input :placeholder="placeholderTxt" v-model="keyName" clearable @focus="focusfns(1)" @blur="focusfns(-1)"
|
|
16
|
+
@keyup.enter="debouncedClick">
|
|
17
|
+
<template #append>
|
|
18
|
+
<el-button class="SearchBtn" @click="debouncedClick" type="primary" icon="Search">搜索</el-button>
|
|
19
|
+
</template>
|
|
20
|
+
</el-input>
|
|
21
|
+
<!-- 搜索记录 -->
|
|
22
|
+
<div v-show="search_drop" class="search_drop" v-if="searchkeysArr && searchkeysArr != ''">
|
|
23
|
+
<ul>
|
|
24
|
+
<li v-for="(item, index) in searchkeysArr" :key="index">
|
|
25
|
+
<span class="search-item-text" @click="setTxt(item)">{{ item }}</span>
|
|
26
|
+
<el-icon class="delete-btn" @click.stop="deleteSearchItem(index)">
|
|
27
|
+
<Delete />
|
|
28
|
+
</el-icon>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
<!-- 搜索记录 -->
|
|
36
|
+
|
|
37
|
+
<div v-if="groupData && groupData != ''" class="ipt_search_tip">
|
|
38
|
+
搜索结果数:
|
|
39
|
+
<span v-show="props.ismodule">{{ Object.keys(groupData).length }}个系统, </span>
|
|
40
|
+
{{ searchNum }} 个相关页面模块
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref, reactive, computed, onMounted } from 'vue';
|
|
45
|
+
import { getUrlKey, debounce } from '../../../utils/func.js';
|
|
46
|
+
|
|
47
|
+
const emits = defineEmits(['getSearchList']);
|
|
48
|
+
//
|
|
49
|
+
import useSearrch from './hook/hookSearch.js';
|
|
50
|
+
// hook
|
|
51
|
+
const { keyName, searchkeysArr, search_drop, getStorageKeys, focusfns, setSearchKeys, deleteSearchItem, setTxt } = useSearrch();
|
|
52
|
+
|
|
53
|
+
const props = defineProps({
|
|
54
|
+
ismodule: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
// logo url
|
|
59
|
+
logoUrl: {
|
|
60
|
+
type: String,
|
|
61
|
+
// default: 'http://123.129.65.205:18012/RabbitDocService/Doc/ptIcon/View?filePath=20250911/006.png'
|
|
62
|
+
},
|
|
63
|
+
placeholderTxt: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '请输入搜索内容'
|
|
66
|
+
},
|
|
67
|
+
groupData: {
|
|
68
|
+
type: Object
|
|
69
|
+
},
|
|
70
|
+
searchNum: {
|
|
71
|
+
type: Number
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
// 跳转到首页搜索
|
|
75
|
+
const gohome = () => {
|
|
76
|
+
// router.push('/');
|
|
77
|
+
};
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
// 是否有限取浏览器中的值 isQueryFirst==>f
|
|
80
|
+
let keymc = getUrlKey('txtKey') || '';
|
|
81
|
+
|
|
82
|
+
setTxt(keymc);
|
|
83
|
+
// getModuleList(true);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 触发上层搜索 keyName
|
|
88
|
+
* 处理防抖
|
|
89
|
+
*/
|
|
90
|
+
const getModuleList = (isfirst = false) => {
|
|
91
|
+
focusfns(-1);
|
|
92
|
+
// setCookieKey('searchKey', keyName.value);
|
|
93
|
+
setSearchKeys(keyName.value || '');
|
|
94
|
+
emits('getSearchList', keyName.value, isfirst);
|
|
95
|
+
};
|
|
96
|
+
// 防抖处理
|
|
97
|
+
const debouncedClick = debounce(getModuleList, 500);
|
|
98
|
+
|
|
99
|
+
defineExpose({
|
|
100
|
+
setTxt,
|
|
101
|
+
debouncedClick
|
|
102
|
+
});
|
|
103
|
+
</script>
|
|
104
|
+
<style lang="scss" scoped>
|
|
105
|
+
.search_warp {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ipt_search {
|
|
112
|
+
width: 700px;
|
|
113
|
+
height: 40px;
|
|
114
|
+
position: relative;
|
|
115
|
+
|
|
116
|
+
// 样式重写
|
|
117
|
+
:deep(.el-input__inner) {
|
|
118
|
+
height: 40px !important;
|
|
119
|
+
outline: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:deep(.el-input-group__append) {
|
|
123
|
+
background: linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
|
|
124
|
+
// border: 1px solid #ffffff !important;
|
|
125
|
+
color: #fff;
|
|
126
|
+
height: 40px;
|
|
127
|
+
margin-top: 1px;
|
|
128
|
+
box-shadow: none;
|
|
129
|
+
font-size: 17px;
|
|
130
|
+
border-radius: 0 8px 8px 0;
|
|
131
|
+
border: 0;
|
|
132
|
+
outline-width: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:deep(.el-button [class*='el-icon'] + span) {
|
|
136
|
+
vertical-align: 3px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ipt_search_tip {
|
|
141
|
+
margin-left: 50px;
|
|
142
|
+
color: #ccc;
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.search_drop {
|
|
147
|
+
position: absolute;
|
|
148
|
+
z-index: 99999;
|
|
149
|
+
width: 100%;
|
|
150
|
+
left: 2px;
|
|
151
|
+
max-width: 605px;
|
|
152
|
+
border: solid 1px #e4e7ed;
|
|
153
|
+
border-radius: 4px;
|
|
154
|
+
background-color: #fff;
|
|
155
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
156
|
+
box-sizing: border-box;
|
|
157
|
+
|
|
158
|
+
ul {
|
|
159
|
+
list-style: none;
|
|
160
|
+
padding: 6px 0;
|
|
161
|
+
margin: 0;
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
text-align: left;
|
|
164
|
+
|
|
165
|
+
li {
|
|
166
|
+
font-size: 14px;
|
|
167
|
+
padding: 0 20px;
|
|
168
|
+
position: relative;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
text-overflow: ellipsis;
|
|
172
|
+
color: #606266;
|
|
173
|
+
height: 34px;
|
|
174
|
+
line-height: 34px;
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
position: relative;
|
|
178
|
+
padding-right: 50px; // 给删除按钮留出空间
|
|
179
|
+
|
|
180
|
+
.search-item-text {
|
|
181
|
+
display: inline-block;
|
|
182
|
+
width: calc(100% - 40px);
|
|
183
|
+
overflow: hidden;
|
|
184
|
+
text-overflow: ellipsis;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.delete-btn {
|
|
188
|
+
position: absolute;
|
|
189
|
+
right: 5px;
|
|
190
|
+
top: 50%;
|
|
191
|
+
transform: translateY(-50%);
|
|
192
|
+
width: 30px;
|
|
193
|
+
height: 24px;
|
|
194
|
+
padding: 0;
|
|
195
|
+
background: transparent;
|
|
196
|
+
color: #909399;
|
|
197
|
+
|
|
198
|
+
&:hover {
|
|
199
|
+
color: #f56c6c;
|
|
200
|
+
background: transparent;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
</style>
|
|
Binary file
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 里程碑组件
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2025-10-30
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="milestone-container">
|
|
11
|
+
<div class="milestone-track " v-if="milestones && milestones != ''">
|
|
12
|
+
<div v-for="(item, index) in milestones" :key="index" class="milestone-item"
|
|
13
|
+
:class="{ 'odd-item': index % 2 === 0, 'even-item': index % 2 !== 0 }" :style="{
|
|
14
|
+
left: `${calculatePosition(item.rq)}%`,
|
|
15
|
+
opacity: index === milestones.length - 1 && hideLast ? '0' : '1'
|
|
16
|
+
}">
|
|
17
|
+
<template v-if="index % 2 === 0">
|
|
18
|
+
<!-- 信息面板 -->
|
|
19
|
+
<div class="milestone-info">
|
|
20
|
+
<div class="milestone-date">{{ dayjs(item.rq).format('YYYY-MM-DD') }}</div>
|
|
21
|
+
<div class="milestone-name">{{ item.name }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<!-- 竖线连接 -->
|
|
24
|
+
<div class="milestone-line"></div>
|
|
25
|
+
<!-- 原点 -->
|
|
26
|
+
<div class="milestone-dot"></div>
|
|
27
|
+
</template>
|
|
28
|
+
<template v-else>
|
|
29
|
+
<!-- 原点 -->
|
|
30
|
+
<div class="milestone-dot"></div>
|
|
31
|
+
<!-- 竖线连接 -->
|
|
32
|
+
<div class="milestone-line"></div>
|
|
33
|
+
<!-- 信息面板 -->
|
|
34
|
+
<div class="milestone-info">
|
|
35
|
+
<div class="milestone-name">{{ item.name }}</div>
|
|
36
|
+
<div class="milestone-date">{{ dayjs(item.rq).format('YYYY-MM-DD') }}</div>
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="with-arrow"></div>
|
|
42
|
+
</div>
|
|
43
|
+
<BdEmpty v-else imgType="svg" :imgSize="50" des="没有查询到相关数据">
|
|
44
|
+
|
|
45
|
+
</BdEmpty>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup>
|
|
50
|
+
import { ref, computed } from 'vue';
|
|
51
|
+
import { dayjs } from 'element-plus'
|
|
52
|
+
import BdEmpty from '../../components/empty/empty.vue'
|
|
53
|
+
// 接收父组件传递的里程碑数据 const bgColor = ref('#0ea5e9') // 0ea5e9
|
|
54
|
+
const props = defineProps({
|
|
55
|
+
// 标注色
|
|
56
|
+
bgColor: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'radial-gradient(circle, rgba(78, 171, 237, 1) 0%, rgb(81, 151, 244) 51%, rgba(78, 171, 237, 1) 100%)'
|
|
59
|
+
},
|
|
60
|
+
milestones: {
|
|
61
|
+
type: Array,
|
|
62
|
+
required: true,
|
|
63
|
+
default: () => []
|
|
64
|
+
},
|
|
65
|
+
hideLast: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 计算是否显示终点箭头
|
|
72
|
+
const showArrow = computed(() => !props.hideLast);
|
|
73
|
+
|
|
74
|
+
// 计算每个节点的位置(基于起始日期的时间占比)
|
|
75
|
+
const calculatePosition = (startDate) => {
|
|
76
|
+
if (props.milestones.length === 0) return 0;
|
|
77
|
+
const firstDate = new Date(props.milestones[0].rq);
|
|
78
|
+
const lastDate = new Date(props.milestones[props.milestones.length - 1].rq);
|
|
79
|
+
const currentDate = new Date(startDate);
|
|
80
|
+
const totalDays = (lastDate - firstDate) / (1000 * 60 * 60 * 24);
|
|
81
|
+
const daysPassed = (currentDate - firstDate) / (1000 * 60 * 60 * 24);
|
|
82
|
+
return (daysPassed / totalDays) * 100;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
$bgColor: v-bind(bgColor);
|
|
89
|
+
|
|
90
|
+
.milestone-container {
|
|
91
|
+
width: 99%;
|
|
92
|
+
// padding: 100px 0;
|
|
93
|
+
/* 增加上下内边距给上下节点留出空间 */
|
|
94
|
+
position: relative;
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.milestone-track {
|
|
99
|
+
width: calc(100% - 100px);
|
|
100
|
+
height: 14px;
|
|
101
|
+
margin: 0 auto;
|
|
102
|
+
background-color: #e5e7eb;
|
|
103
|
+
position: relative;
|
|
104
|
+
// 新增:为轨道右侧留出箭头空间
|
|
105
|
+
padding-right: 16px;
|
|
106
|
+
margin-right: calc(50px - 16px);
|
|
107
|
+
margin-top: 100px;
|
|
108
|
+
.with-arrow {
|
|
109
|
+
position: absolute;
|
|
110
|
+
right: -16px; // 定位到轨道最右侧
|
|
111
|
+
top: 0;
|
|
112
|
+
height: 1px;
|
|
113
|
+
// width: 16px;
|
|
114
|
+
|
|
115
|
+
top: 50%;
|
|
116
|
+
// left: 0;
|
|
117
|
+
transform: translateY(-50%); // 垂直居中
|
|
118
|
+
// 使用边框实现实心三角形箭头
|
|
119
|
+
border-top: 13px solid transparent;
|
|
120
|
+
border-bottom: 13px solid transparent;
|
|
121
|
+
border-left: 22px solid#e5e7eb;
|
|
122
|
+
/* 箭头颜色与主题色一致 */
|
|
123
|
+
z-index: 999;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.milestone-item {
|
|
128
|
+
position: absolute;
|
|
129
|
+
// background-color: rgba(255, 0, 0, 0.285);
|
|
130
|
+
left: 0;
|
|
131
|
+
top: 0;
|
|
132
|
+
transform: translateX(-50%);
|
|
133
|
+
/* 只水平居中,垂直位置由odd/even控制 */
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 基数项(0,2,4...)在轨道上方
|
|
140
|
+
.odd-item {
|
|
141
|
+
top: -44px;
|
|
142
|
+
|
|
143
|
+
.milestone-info {
|
|
144
|
+
transform: translateY(calc(-100% - 1px));
|
|
145
|
+
/* 信息面板在原点上方 */
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 偶数项(1,3,5...)在轨道下方
|
|
150
|
+
.even-item {
|
|
151
|
+
top: -3px;
|
|
152
|
+
|
|
153
|
+
.milestone-info {
|
|
154
|
+
transform: translateY(calc(100% + 2px));
|
|
155
|
+
/* 信息面板在原点下方 */
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// 竖线连接
|
|
160
|
+
.milestone-line {
|
|
161
|
+
width: 2px;
|
|
162
|
+
background: $bgColor;
|
|
163
|
+
position: absolute;
|
|
164
|
+
bottom: 0;
|
|
165
|
+
z-index: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// 基数项竖线向上
|
|
169
|
+
.odd-item .milestone-line {
|
|
170
|
+
height: 50px;
|
|
171
|
+
bottom: 10px;
|
|
172
|
+
/* 从原点中心向上延伸 */
|
|
173
|
+
// transform: translateY(100%);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 偶数项竖线向下
|
|
177
|
+
.even-item .milestone-line {
|
|
178
|
+
height: 50px;
|
|
179
|
+
top: 10px;
|
|
180
|
+
/* 从原点中心向下延伸 */
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.milestone-dot {
|
|
184
|
+
width: 20px;
|
|
185
|
+
height: 20px;
|
|
186
|
+
border-radius: 50%;
|
|
187
|
+
// background-color: #1652f8 ; //
|
|
188
|
+
background: $bgColor;
|
|
189
|
+
position: relative;
|
|
190
|
+
z-index: 2;
|
|
191
|
+
/* 确保原点在轨道上方 */
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.milestone-info {
|
|
195
|
+
text-align: center;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
/* 防止文本换行 */
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.milestone-date {
|
|
201
|
+
font-size: 16px;
|
|
202
|
+
font-weight: bold;
|
|
203
|
+
color: #333;
|
|
204
|
+
margin-bottom: 4px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.milestone-name {
|
|
208
|
+
font-size: 15px;
|
|
209
|
+
color: #666;
|
|
210
|
+
font-weight: bold;
|
|
211
|
+
}
|
|
212
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## 里程碑组件
|
|
2
|
+
|
|
3
|
+
注意:最后一个时间为虚拟时间不显示,进行定位使用
|
|
4
|
+
|
|
5
|
+
import {Milestone} from '@bdsoft/element'
|
|
6
|
+
<Milestone :milestones="milestoneData" :hide-last="true"></Milestone >
|
|
7
|
+
|
|
8
|
+
const milestoneData = [
|
|
9
|
+
{ rq: '2018-7-5', name: '规划设计' },
|
|
10
|
+
{ rq: '2018-7-10', name: '钻试' },
|
|
11
|
+
{ rq: '2018-8-5', name: '测井' },
|
|
12
|
+
{ rq: '2018-8-11', name: '完井' },
|
|
13
|
+
{ rq: '2018-9-1', name: '投产' },
|
|
14
|
+
{ rq: '2018-9-8', name: '' }
|
|
15
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
项目组件说明
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function LoadComponent(props, { slots, emit, attrs }) {
|
|
2
|
+
return (
|
|
3
|
+
<div class="loadsvg" style="height:20px;width:20px;">
|
|
4
|
+
<svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true">
|
|
5
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</div>
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
export default LoadComponent
|
package/utils/func.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import is from './type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 获取url参数
|
|
5
|
+
* @param {*} name
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export function getUrlKey(name, url) {
|
|
9
|
+
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url || location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// 生成guid
|
|
13
|
+
function S4() {
|
|
14
|
+
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 生成guid
|
|
18
|
+
export function NewGuid() {
|
|
19
|
+
return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 创建一个防抖函数
|
|
23
|
+
// const debouncedClick = debounce(handleQa, 500);
|
|
24
|
+
export const debounce = (func, delay) => {
|
|
25
|
+
let timer
|
|
26
|
+
return (...args) => {
|
|
27
|
+
clearTimeout(timer)
|
|
28
|
+
timer = setTimeout(() => {
|
|
29
|
+
func(...args)
|
|
30
|
+
}, delay)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ref, nextTick } from 'vue'
|
|
2
|
+
|
|
3
|
+
// 公共的Hook,用于管理对话框的显示和隐藏 用法如下:
|
|
4
|
+
// import {useDialog} from '@bdsoft/element'
|
|
5
|
+
// const { visible, showDialog,openParms,hideDialog } = useDialog()
|
|
6
|
+
// defineExpose({
|
|
7
|
+
// showDialog,
|
|
8
|
+
// hideDialog
|
|
9
|
+
// })
|
|
10
|
+
// 自定义Hook,用于管理对话框的显示和隐藏
|
|
11
|
+
export function useDialog(showFn) {
|
|
12
|
+
const visible = ref(false)
|
|
13
|
+
// 打开窗体传递的对象
|
|
14
|
+
const openParms = ref({})
|
|
15
|
+
const extParms = ref({}) // 扩展用
|
|
16
|
+
// 显示窗体
|
|
17
|
+
const showDialog = (parm,ext) => {
|
|
18
|
+
visible.value = true
|
|
19
|
+
openParms.value = parm
|
|
20
|
+
|
|
21
|
+
extParms.value = ext
|
|
22
|
+
nextTick(() => {
|
|
23
|
+
showFn && showFn()
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
// 隐藏窗体
|
|
27
|
+
const hideDialog = () => {
|
|
28
|
+
visible.value = false
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
visible,
|
|
33
|
+
openParms,
|
|
34
|
+
extParms,
|
|
35
|
+
showDialog,
|
|
36
|
+
hideDialog
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// 分页hook函数 参考说明 components/Pagination/readme.md
|
|
2
|
+
import { reactive, toRefs } from 'vue'
|
|
3
|
+
|
|
4
|
+
export function usePage(changeFn) {
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
let page = reactive({
|
|
8
|
+
// 数据服务分页参数值
|
|
9
|
+
pageHeader: {
|
|
10
|
+
startindex: 0,
|
|
11
|
+
pagesize: 30,
|
|
12
|
+
carrytotal: true
|
|
13
|
+
},
|
|
14
|
+
currentPage: 1,
|
|
15
|
+
pageSizes: [30, 60, 90],
|
|
16
|
+
pageSize: 30,
|
|
17
|
+
total: 0
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function handleSizeChange(val) {
|
|
21
|
+
page.pageSize = val
|
|
22
|
+
// page.pageHeader.mend = val
|
|
23
|
+
changeFn()
|
|
24
|
+
}
|
|
25
|
+
function handleCurrentChange(val) {
|
|
26
|
+
page.currentPage = val
|
|
27
|
+
page.pageHeader.startindex = val - 1
|
|
28
|
+
changeFn()
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param {*} pageobj { page: currentPage.value, pageSize: val }
|
|
33
|
+
*/
|
|
34
|
+
function handlePagination(pageobj) {
|
|
35
|
+
let pageIndex = pageobj.page
|
|
36
|
+
let pageSize = pageobj.pageSize
|
|
37
|
+
page.currentPage = pageIndex
|
|
38
|
+
page.pageSize = pageSize
|
|
39
|
+
page.pageHeader.startindex = (pageIndex - 1) * pageSize
|
|
40
|
+
page.pageHeader.pagesize = pageSize
|
|
41
|
+
changeFn()
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
...toRefs(page),
|
|
45
|
+
handleSizeChange,
|
|
46
|
+
handleCurrentChange,
|
|
47
|
+
handlePagination
|
|
48
|
+
}
|
|
49
|
+
}
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 格式化日志信息
|
|
3
|
+
*
|
|
4
|
+
* @param {String} type - 日志类型,如 'tip' 或 'err'
|
|
5
|
+
* @param {String} msg - 日志消息内容
|
|
6
|
+
* @param {Object} rule - 可选参数,与日志相关的规则对象
|
|
7
|
+
* @returns {String} - 返回格式化后的日志字符串
|
|
8
|
+
*/
|
|
9
|
+
export function format(type, msg, rule) {
|
|
10
|
+
// 使用模板字符串构建日志信息,包含日志类型和消息内容
|
|
11
|
+
let logMsg = `[form-create ${type}]: ${msg}`;
|
|
12
|
+
// 如果提供了规则对象,则将其转换为JSON字符串并添加到日志信息中
|
|
13
|
+
if (rule) {
|
|
14
|
+
logMsg += `\n\nrule: ${JSON.stringify(rule.getRule ? rule.getRule() : rule)}`;
|
|
15
|
+
}
|
|
16
|
+
// 返回格式化后的日志字符串
|
|
17
|
+
return logMsg;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 输出格式化的提示信息到控制台
|
|
22
|
+
*
|
|
23
|
+
* @param {String} msg - 提示信息的内容
|
|
24
|
+
* @param {Object} rule - 可选参数,与提示信息相关的规则对象
|
|
25
|
+
*/
|
|
26
|
+
export function tip(msg, rule) {
|
|
27
|
+
// 使用 format 函数格式化提示信息,并通过 console.warn 输出到控制台
|
|
28
|
+
console.warn(format('tip', msg, rule));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export function err(msg, rule) {
|
|
33
|
+
console.error(format('err', msg, rule));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function logError(e) {
|
|
37
|
+
err(e.toString());
|
|
38
|
+
console.error(e);
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 防抖函数,用于限制函数的执行频率。
|
|
3
|
+
*
|
|
4
|
+
* @param {Function} fn - 需要防抖的函数。
|
|
5
|
+
* @param {number} wait - 防抖的时间间隔,单位为毫秒。
|
|
6
|
+
* @returns {Function} - 返回一个新的函数,该函数在指定的时间间隔内只会执行一次。
|
|
7
|
+
*/
|
|
8
|
+
export default function debounce(fn, wait) {
|
|
9
|
+
// 用于存储定时器的变量
|
|
10
|
+
var timeout = null;
|
|
11
|
+
// 返回一个新的函数,该函数在指定的时间间隔内只会执行一次
|
|
12
|
+
return function (...arg) {
|
|
13
|
+
// 如果定时器已经存在,则清除定时器
|
|
14
|
+
if (timeout !== null)
|
|
15
|
+
clearTimeout(timeout);
|
|
16
|
+
// 设置新的定时器,在指定的时间间隔后执行传入的函数
|
|
17
|
+
timeout = setTimeout(() => fn.call(this, ...arg), wait);
|
|
18
|
+
}
|
|
19
|
+
}
|