imeik-bizui 0.0.1
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 +35 -0
- package/dist/bizui/api/applycenter.js +19 -0
- package/dist/bizui/api/user.js +24 -0
- package/dist/bizui/index.js +86 -0
- package/dist/bizui/src/FormComponents/ImBr.vue +10 -0
- package/dist/bizui/src/FormComponents/ImButton.vue +39 -0
- package/dist/bizui/src/FormComponents/ImCascader.vue +113 -0
- package/dist/bizui/src/FormComponents/ImColorPicker.vue +76 -0
- package/dist/bizui/src/FormComponents/ImDatePicker.vue +116 -0
- package/dist/bizui/src/FormComponents/ImEnumCheckboxGroup.vue +86 -0
- package/dist/bizui/src/FormComponents/ImGroupSelect.vue +71 -0
- package/dist/bizui/src/FormComponents/ImInput.vue +85 -0
- package/dist/bizui/src/FormComponents/ImInputNumber.vue +70 -0
- package/dist/bizui/src/FormComponents/ImNumberInput.vue +206 -0
- package/dist/bizui/src/FormComponents/ImNumberRange.vue +86 -0
- package/dist/bizui/src/FormComponents/ImRadio.vue +60 -0
- package/dist/bizui/src/FormComponents/ImSelect.vue +156 -0
- package/dist/bizui/src/FormComponents/ImServerCascader.vue +223 -0
- package/dist/bizui/src/FormComponents/ImServerSelect.vue +211 -0
- package/dist/bizui/src/FormComponents/ImSlot.vue +21 -0
- package/dist/bizui/src/FormComponents/ImTimePicker.vue +52 -0
- package/dist/bizui/src/FormComponents/ImTree.vue +59 -0
- package/dist/bizui/src/FormComponents/index.js +18 -0
- package/dist/bizui/src/FormComponents/upload/ImFieldFileUpload.vue +320 -0
- package/dist/bizui/src/FormComponents/upload/ImImgUpload.vue +173 -0
- package/dist/bizui/src/FormComponents/upload/ImMultiImgUpload.vue +189 -0
- package/dist/bizui/src/FormComponents/upload/ImMultiImgUploadList.vue +178 -0
- package/dist/bizui/src/FormComponents/upload/ImVideoUpload.vue +205 -0
- package/dist/bizui/src/FormComponents/upload/upload.js +51 -0
- package/dist/bizui/src/FormComponents/upload/widgets/FileLinePreview.vue +343 -0
- package/dist/bizui/src/FormComponents/widgets/SelectShape.vue +76 -0
- package/dist/bizui/src/FormWidgets/CardHeader.vue +53 -0
- package/dist/bizui/src/FormWidgets/FixedBottom.vue +39 -0
- package/dist/bizui/src/FormWidgets/FormSplit.vue +26 -0
- package/dist/bizui/src/FormWidgets/readme.md +1 -0
- package/dist/bizui/src/ImCard/index.vue +50 -0
- package/dist/bizui/src/ImDialog/index.vue +123 -0
- package/dist/bizui/src/ImDrawer/index.vue +113 -0
- package/dist/bizui/src/ImForm/FormComponents.vue +45 -0
- package/dist/bizui/src/ImForm/index.vue +488 -0
- package/dist/bizui/src/ImLoading/index.vue +50 -0
- package/dist/bizui/src/ImLoading/loading.png +0 -0
- package/dist/bizui/src/ImPagination/index.vue +102 -0
- package/dist/bizui/src/ImSearchArea/index.vue +131 -0
- package/dist/bizui/src/ImTable/AffixedTable.js +135 -0
- package/dist/bizui/src/ImTable/components/ImFieldsEditor/index.vue +506 -0
- package/dist/bizui/src/ImTable/components/ImFieldsEditor/widget/ExcelEditor.vue +345 -0
- package/dist/bizui/src/ImTable/components/ImTableColumn.vue +71 -0
- package/dist/bizui/src/ImTable/components/TableCustomSettingModal.vue +86 -0
- package/dist/bizui/src/ImTable/index.vue +442 -0
- package/dist/bizui/src/ImTableArea/index.vue +16 -0
- package/dist/bizui/src/ImTableCellWithBorder/index.vue +69 -0
- package/dist/bizui/src/ImWrapper/index.vue +33 -0
- package/dist/bizui/utils/applycenterRequest.js +12 -0
- package/dist/bizui/utils/index.js +32 -0
- package/dist/bizui/utils/requestTemplate.js +52 -0
- package/dist/bizui/utils/userRequest.js +12 -0
- package/dist/demo.html +10 -0
- package/dist/imeik-bizui.common.js +146790 -0
- package/dist/imeik-bizui.common.js.gz +0 -0
- package/dist/imeik-bizui.css +10 -0
- package/dist/imeik-bizui.css.gz +0 -0
- package/dist/imeik-bizui.umd.js +146800 -0
- package/dist/imeik-bizui.umd.js.gz +0 -0
- package/dist/imeik-bizui.umd.min.js +80 -0
- package/dist/imeik-bizui.umd.min.js.gz +0 -0
- package/dist/img/img-holder.0dbc682e.png +0 -0
- package/dist/img/jsoneditor-icons.256e3abc.svg +893 -0
- package/dist/img/jsoneditor-icons.256e3abc.svg.gz +0 -0
- package/package.json +109 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# imeik-imui
|
|
2
|
+
|
|
3
|
+
## 安装组件库
|
|
4
|
+
```
|
|
5
|
+
npm install imeik-imui
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### 使用组件库
|
|
9
|
+
在main.js中引入组件库
|
|
10
|
+
```
|
|
11
|
+
import imui from 'imeik-imui'
|
|
12
|
+
import 'imeik-imui/dist/imeik-imui.css'
|
|
13
|
+
import { getToken } from '@/utils/auth'
|
|
14
|
+
|
|
15
|
+
Vue.use(imui, {
|
|
16
|
+
userTokenFunc: getToken,
|
|
17
|
+
env: process.env.NODE_ENV,
|
|
18
|
+
app: process.env.VUE_APP_ID
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
App.vue中
|
|
23
|
+
```
|
|
24
|
+
/**
|
|
25
|
+
* 通过这里把组件可能用到的属性传递过去
|
|
26
|
+
*/
|
|
27
|
+
setComponentsProps() {
|
|
28
|
+
this.$bizui.enums = this.enums
|
|
29
|
+
this.$bizui.enumsOptions = this.enumsOptions
|
|
30
|
+
this.$bizui.userId = this.userInfo.objectCode
|
|
31
|
+
this.$bizui.departmentCode = this.userInfo.departmentObjectCode
|
|
32
|
+
this.$bizui.employeeNo = this.userInfo.employeeNo
|
|
33
|
+
this.$bizui.userInfo = this.userInfo
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// 申请中心相关接口
|
|
2
|
+
import request from '../utils/applycenterRequest.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 获取有权限的基础数据
|
|
6
|
+
* /applyCenter-admin/baseData/getTagData
|
|
7
|
+
*
|
|
8
|
+
* "permissionIdentifier": "", // 权限标识
|
|
9
|
+
* "tagCode": "", // 标签code
|
|
10
|
+
*
|
|
11
|
+
* "tagValueCodeList": [] // 标签值code列表
|
|
12
|
+
*/
|
|
13
|
+
export function getPermissionedTagData(data) {
|
|
14
|
+
return request({
|
|
15
|
+
url: '/applyCenter-admin/baseData/getTagData',
|
|
16
|
+
method: 'post',
|
|
17
|
+
data
|
|
18
|
+
})
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 用户运营平台相关接口
|
|
2
|
+
import request from '../utils/userRequest.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 添加文件上传信息
|
|
6
|
+
*/
|
|
7
|
+
export function findAliToken() {
|
|
8
|
+
return request({
|
|
9
|
+
url: '/qxcollege/admin/fileUpload/findAliToken',
|
|
10
|
+
method: 'post',
|
|
11
|
+
data: {}
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 获取视频上传信息
|
|
17
|
+
*/
|
|
18
|
+
export function findAliVideoToken() {
|
|
19
|
+
return request({
|
|
20
|
+
url: '/qxcollege/admin/fileUpload/findAliVideoToken',
|
|
21
|
+
method: 'post',
|
|
22
|
+
data: {}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// 导入样式
|
|
2
|
+
import 'windi.css'
|
|
3
|
+
import 'viewerjs/dist/viewer.css'
|
|
4
|
+
|
|
5
|
+
// 导入卡片组件
|
|
6
|
+
import ImCard from './src/ImCard'
|
|
7
|
+
// 导入对话框组件
|
|
8
|
+
import ImDialog from './src/ImDialog'
|
|
9
|
+
// 导入抽屉组件
|
|
10
|
+
import ImDrawer from './src/ImDrawer'
|
|
11
|
+
// 导入表单组件
|
|
12
|
+
import ImForm from './src/ImForm'
|
|
13
|
+
// 导入分页组件
|
|
14
|
+
import ImPagination from './src/ImPagination'
|
|
15
|
+
// 导入搜索区域组件
|
|
16
|
+
import ImSearchArea from './src/ImSearchArea'
|
|
17
|
+
// 导入表格组件
|
|
18
|
+
import ImTable from './src/ImTable'
|
|
19
|
+
// 导入表格区域组件
|
|
20
|
+
import ImTableArea from './src/ImTableArea'
|
|
21
|
+
// 导入包装器组件
|
|
22
|
+
import ImWrapper from './src/ImWrapper'
|
|
23
|
+
// 导入带边框的表格单元格组件
|
|
24
|
+
import ImTableCellWithBorder from './src/ImTableCellWithBorder'
|
|
25
|
+
// 导入加载中组件
|
|
26
|
+
import ImLoading from './src/ImLoading'
|
|
27
|
+
// 导入卡片头部组件
|
|
28
|
+
import CardHeader from './src/FormWidgets/CardHeader'
|
|
29
|
+
// 导入表单分割线组件
|
|
30
|
+
import FormSplit from './src/FormWidgets/FormSplit'
|
|
31
|
+
// 导入固定底部组件
|
|
32
|
+
import FixedBottom from './src/FormWidgets/FixedBottom'
|
|
33
|
+
|
|
34
|
+
// 导入第三方库
|
|
35
|
+
import VueViewer from 'v-viewer'
|
|
36
|
+
|
|
37
|
+
// 表单组件也可以单独使用
|
|
38
|
+
import FormComponents from './src/FormComponents/index.js'
|
|
39
|
+
|
|
40
|
+
// 定义组件列表
|
|
41
|
+
const components = {
|
|
42
|
+
ImWrapper,
|
|
43
|
+
ImSearchArea,
|
|
44
|
+
ImTableArea,
|
|
45
|
+
ImPagination,
|
|
46
|
+
ImForm,
|
|
47
|
+
ImTable,
|
|
48
|
+
ImDrawer,
|
|
49
|
+
ImDialog,
|
|
50
|
+
ImCard,
|
|
51
|
+
ImLoading,
|
|
52
|
+
ImTableCellWithBorder,
|
|
53
|
+
CardHeader,
|
|
54
|
+
FormSplit,
|
|
55
|
+
FixedBottom,
|
|
56
|
+
...FormComponents
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 定义插件
|
|
60
|
+
const ImUI = {
|
|
61
|
+
install(Vue, options = {}) {
|
|
62
|
+
// 注册全局组件
|
|
63
|
+
Object.entries(components).forEach(([name, component]) => {
|
|
64
|
+
Vue.component(name, component)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
// 添加原型方法
|
|
68
|
+
Vue.prototype.$bizui = {
|
|
69
|
+
...options
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 使用第三方插件
|
|
73
|
+
Vue.use(VueViewer, {
|
|
74
|
+
defaultOptions: {
|
|
75
|
+
zIndex: 9999 // 控制显示层级为最高
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// 非生产环境下输出日志
|
|
80
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
81
|
+
console.log('Vue.prototype.$imui', Vue.prototype.$imui)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default ImUI
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="attrs.style"
|
|
4
|
+
style="min-height: 50px; line-height: 50px; transform: translate(-12px, -17px);"
|
|
5
|
+
>
|
|
6
|
+
<el-button
|
|
7
|
+
v-for="(opt, idx) in attrs.options"
|
|
8
|
+
:key="idx"
|
|
9
|
+
v-bind="opt.attrs"
|
|
10
|
+
v-on="opt.listeners"
|
|
11
|
+
>
|
|
12
|
+
{{ opt.label }}
|
|
13
|
+
</el-button>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'ImButton',
|
|
20
|
+
props: {
|
|
21
|
+
value: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: undefined
|
|
24
|
+
},
|
|
25
|
+
attrs: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default() {
|
|
28
|
+
return {}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
listeners: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default() {
|
|
34
|
+
return {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="attrs.isView">{{ selectLabel }}</span>
|
|
3
|
+
<el-cascader
|
|
4
|
+
v-else
|
|
5
|
+
ref="cascaderRef"
|
|
6
|
+
v-model="myValue"
|
|
7
|
+
v-bind="attrs"
|
|
8
|
+
:placeholder="attrs.placeholder || `请选择${label}`"
|
|
9
|
+
v-on="listeners"
|
|
10
|
+
@change="onChange"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'ImCascader',
|
|
17
|
+
props: {
|
|
18
|
+
value: {
|
|
19
|
+
type: [String, Array, Number, Boolean],
|
|
20
|
+
default: undefined
|
|
21
|
+
},
|
|
22
|
+
attrs: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default() {
|
|
25
|
+
return {}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
listeners: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default() {
|
|
31
|
+
return {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
default() {
|
|
37
|
+
return ''
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
myValue: undefined
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
selectLabel() {
|
|
48
|
+
if (!this.myValue) {
|
|
49
|
+
return '-'
|
|
50
|
+
}
|
|
51
|
+
const labels = []
|
|
52
|
+
// 判断当前是多选还是单选,两种形式获取label的方式不同
|
|
53
|
+
const isMultiple = this.attrs?.props?.multiple
|
|
54
|
+
this?.attrs?.options?.forEach((item) => {
|
|
55
|
+
if (isMultiple) {
|
|
56
|
+
if (this.myValue.includes(item.value)) {
|
|
57
|
+
labels.push(item.label)
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
if (item.value === this.myValue) {
|
|
61
|
+
labels.push(item.label)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
return labels.join(',') || '-'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
watch: {
|
|
70
|
+
value: {
|
|
71
|
+
immediate: true,
|
|
72
|
+
handler() {
|
|
73
|
+
this.setMyValue()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
setMyValue() {
|
|
79
|
+
try {
|
|
80
|
+
this.myValue = JSON.parse(JSON.stringify(this.value))
|
|
81
|
+
|
|
82
|
+
// 修复组件初始化数据默认不勾选问题
|
|
83
|
+
if (!this.myValue || !this.myValue[0]) return
|
|
84
|
+
this.$nextTick(() => {
|
|
85
|
+
if (this.attrs.props?.multiple) {
|
|
86
|
+
if (Array.isArray(this.myValue[0])) return
|
|
87
|
+
const nodes = this.$refs.cascaderRef?.panel?.checkedNodePaths
|
|
88
|
+
if (!nodes.length) return
|
|
89
|
+
this.myValue = nodes.map((group) => {
|
|
90
|
+
return group.map((item) => item.value)
|
|
91
|
+
})
|
|
92
|
+
// this.onChange(this.myValue)
|
|
93
|
+
} else if (!Array.isArray(this.myValue)) {
|
|
94
|
+
const [node] = this.$refs.cascaderRef?.getCheckedNodes()
|
|
95
|
+
if (!node) return
|
|
96
|
+
this.myValue = node.pathNodes.map((item) => item.value)
|
|
97
|
+
// this.onChange(this.myValue)
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
} catch (error) {
|
|
101
|
+
this.myValue = undefined
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
onChange(value) {
|
|
105
|
+
this.$emit('select', {
|
|
106
|
+
nodes: this.$refs.cascaderRef?.getCheckedNodes() ?? [],
|
|
107
|
+
value
|
|
108
|
+
})
|
|
109
|
+
this.$emit('input', this.myValue)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-input
|
|
4
|
+
v-model="myValue"
|
|
5
|
+
:style="attrs.style || inputStyle"
|
|
6
|
+
:placeholder="attrs.placeholder"
|
|
7
|
+
>
|
|
8
|
+
<el-color-picker
|
|
9
|
+
slot="append"
|
|
10
|
+
v-model="myValue"
|
|
11
|
+
class="custom-color-picker"
|
|
12
|
+
:show-alpha="attrs.alpha"
|
|
13
|
+
:disabled="attrs.disabled"
|
|
14
|
+
size="mini"
|
|
15
|
+
@change="onChange"
|
|
16
|
+
/>
|
|
17
|
+
</el-input>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: 'ImColorPicker',
|
|
24
|
+
props: {
|
|
25
|
+
value: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: undefined
|
|
28
|
+
},
|
|
29
|
+
attrs: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default() {
|
|
32
|
+
return {}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
listeners: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default() {
|
|
38
|
+
return {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
myValue: undefined
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
watch: {
|
|
48
|
+
value: {
|
|
49
|
+
immediate: true,
|
|
50
|
+
handler() {
|
|
51
|
+
this.setMyValue()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
setMyValue() {
|
|
57
|
+
this.myValue = this.value
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
onChange() {
|
|
61
|
+
this.$emit('input', this.myValue)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style scoped lang="scss">
|
|
68
|
+
.custom-color-picker {
|
|
69
|
+
transform: translate(0, 1px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/deep/.el-color-picker--mini .el-color-picker__trigger {
|
|
73
|
+
width: 26px;
|
|
74
|
+
height: 26px;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="isView ? 'pickerContainer' : 'pickerForm'">
|
|
3
|
+
<span v-if="isView" class="pickerView" :title="dateLabel">
|
|
4
|
+
{{ dateLabel }}
|
|
5
|
+
</span>
|
|
6
|
+
<el-date-picker
|
|
7
|
+
v-else
|
|
8
|
+
v-model="myValue"
|
|
9
|
+
v-bind="attrs"
|
|
10
|
+
unlink-panels
|
|
11
|
+
v-on="listeners"
|
|
12
|
+
@change="onChange"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import moment from 'moment'
|
|
19
|
+
export default {
|
|
20
|
+
name: 'ImDatePicker',
|
|
21
|
+
props: {
|
|
22
|
+
value: {
|
|
23
|
+
type: [String, Object, Array, Number, Date],
|
|
24
|
+
default: undefined
|
|
25
|
+
},
|
|
26
|
+
attrs: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default() {
|
|
29
|
+
return {}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
listeners: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default() {
|
|
35
|
+
return {}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
myValue: undefined
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
isView() {
|
|
46
|
+
return this.attrs.isView
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
dateLabel() {
|
|
50
|
+
if (!this.myValue) {
|
|
51
|
+
return ''
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(this.myValue)) {
|
|
54
|
+
return this.myValue.map(item => this.formatDate(item)).join(' ~ ')
|
|
55
|
+
} else {
|
|
56
|
+
return this.formatDate(this.myValue)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
watch: {
|
|
61
|
+
value: {
|
|
62
|
+
immediate: true,
|
|
63
|
+
handler() {
|
|
64
|
+
this.setMyValue()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
formatDate(date) {
|
|
70
|
+
if (this.attrs.labelFormat) {
|
|
71
|
+
return date ? moment(date).format(this.attrs.labelFormat) : ''
|
|
72
|
+
}
|
|
73
|
+
if (['daterange', 'date'].includes(this.attrs.type)) {
|
|
74
|
+
return date ? moment(date).format('YYYY-MM-DD') : ''
|
|
75
|
+
}
|
|
76
|
+
if (['datetimerange', 'datetime'].includes(this.attrs.type)) {
|
|
77
|
+
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
78
|
+
}
|
|
79
|
+
return date
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
setMyValue() {
|
|
83
|
+
try {
|
|
84
|
+
this.myValue = JSON.parse(JSON.stringify(this.value))
|
|
85
|
+
} catch (error) {
|
|
86
|
+
this.myValue = undefined
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
onChange() {
|
|
90
|
+
this.$emit('input', this.myValue)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
.el-range-editor--small.el-input__inner {
|
|
97
|
+
height: 32px !important;
|
|
98
|
+
}
|
|
99
|
+
.pickerContainer {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 20px;
|
|
102
|
+
line-height: 20px;
|
|
103
|
+
}
|
|
104
|
+
.pickerForm {
|
|
105
|
+
height: 32px;
|
|
106
|
+
}
|
|
107
|
+
.pickerView {
|
|
108
|
+
display: inline-block;
|
|
109
|
+
overflow-x: hidden;
|
|
110
|
+
text-overflow: ellipsis;
|
|
111
|
+
white-space: nowrap;
|
|
112
|
+
width: 100%;
|
|
113
|
+
height: 20px;
|
|
114
|
+
line-height: 20px;
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-checkbox-group
|
|
3
|
+
v-model="myValue"
|
|
4
|
+
v-bind="attrs"
|
|
5
|
+
v-on="listeners"
|
|
6
|
+
@change="onUpdate"
|
|
7
|
+
>
|
|
8
|
+
<el-checkbox
|
|
9
|
+
v-for="item in options"
|
|
10
|
+
:key="item.label + Math.random()"
|
|
11
|
+
:label="item.value"
|
|
12
|
+
>
|
|
13
|
+
<slot name="label" :item="item">
|
|
14
|
+
{{ item.label }}
|
|
15
|
+
</slot>
|
|
16
|
+
</el-checkbox>
|
|
17
|
+
</el-checkbox-group>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
// import { mapGetters } from 'vuex'
|
|
22
|
+
export default {
|
|
23
|
+
name: 'ImEnumCheckboxGroup',
|
|
24
|
+
props: {
|
|
25
|
+
value: {
|
|
26
|
+
type: [String, Array, Number, Boolean],
|
|
27
|
+
default: undefined
|
|
28
|
+
},
|
|
29
|
+
attrs: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default() {
|
|
32
|
+
return {}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
listeners: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default() {
|
|
38
|
+
return {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
myValue: undefined
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
// ...mapGetters(['enums']),
|
|
49
|
+
enums() {
|
|
50
|
+
return this.$imui.enums
|
|
51
|
+
},
|
|
52
|
+
options() {
|
|
53
|
+
if (!this.attrs.enumKey) {
|
|
54
|
+
console.log('ImEnumSelect 组件需要在attrs里增加enumKey字段,表明使用哪个枚举值')
|
|
55
|
+
return []
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const list = this.enums[this.attrs.enumKey] || []
|
|
59
|
+
// 支持传入filter进行自定义筛选
|
|
60
|
+
return this.attrs.filter ? this.attrs.filter(list) : list
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
watch: {
|
|
64
|
+
value: {
|
|
65
|
+
immediate: true,
|
|
66
|
+
handler() {
|
|
67
|
+
this.setMyValue()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
setMyValue() {
|
|
73
|
+
try {
|
|
74
|
+
this.myValue = JSON.parse(JSON.stringify(this.value))
|
|
75
|
+
} catch (error) {
|
|
76
|
+
this.myValue = undefined
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
onUpdate() {
|
|
81
|
+
this.$emit('input', this.myValue)
|
|
82
|
+
this.$emit('change', this.myValue)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
v-model="myValue"
|
|
4
|
+
v-bind="attrs"
|
|
5
|
+
v-on="listeners"
|
|
6
|
+
@change="onUpdate"
|
|
7
|
+
>
|
|
8
|
+
<el-option-group
|
|
9
|
+
v-for="opt in attrs.options"
|
|
10
|
+
:key="opt.label + Math.random()"
|
|
11
|
+
:label="opt.label"
|
|
12
|
+
>
|
|
13
|
+
<el-option
|
|
14
|
+
v-for="optItem in opt.options"
|
|
15
|
+
:key="optItem.label + Math.random()"
|
|
16
|
+
:disabled="optItem.disabled"
|
|
17
|
+
:label="optItem.label"
|
|
18
|
+
:value="optItem.value"
|
|
19
|
+
/>
|
|
20
|
+
</el-option-group>
|
|
21
|
+
</el-select>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: 'ImGroupSelect',
|
|
27
|
+
props: {
|
|
28
|
+
value: {
|
|
29
|
+
type: [String, Array, Number, Boolean],
|
|
30
|
+
default: undefined
|
|
31
|
+
},
|
|
32
|
+
attrs: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default() {
|
|
35
|
+
return {}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
listeners: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default() {
|
|
41
|
+
return {}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
myValue: undefined
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
value: {
|
|
52
|
+
immediate: true,
|
|
53
|
+
handler() {
|
|
54
|
+
this.setMyValue()
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
setMyValue() {
|
|
60
|
+
try {
|
|
61
|
+
this.myValue = JSON.parse(JSON.stringify(this.value))
|
|
62
|
+
} catch (error) {
|
|
63
|
+
this.myValue = undefined
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
onUpdate() {
|
|
67
|
+
this.$emit('input', this.myValue)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|