@zhijiancloud/bpm 0.0.1 → 0.0.2
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/CHANGELOG.md +23 -0
- package/README.md +49 -5
- package/components/.DS_Store +0 -0
- package/components/css/bpmMulFile.less +54 -0
- package/components/css/bpmSelectCheckItem.less +4 -0
- package/components/css/bpmSelectFromForm.less +10 -0
- package/components/css/bpmSelectFromId.less +33 -0
- package/components/css/bpmText.less +49 -0
- package/components/css/demo2.less +3 -0
- package/components/css/index.less +3 -0
- package/components/lib/bpmDateTime/index.js +7 -0
- package/components/lib/bpmDateTime/src/main.vue +82 -0
- package/components/lib/bpmDateTime/src/part/editor.vue +124 -0
- package/components/lib/bpmDateTime/src/part/reader.vue +55 -0
- package/components/lib/bpmField/index.js +7 -0
- package/components/lib/bpmField/src/main.vue +173 -0
- package/components/lib/bpmMulFile/index.js +7 -0
- package/components/lib/bpmMulFile/src/main.vue +86 -0
- package/components/lib/bpmMulFile/src/part/editor.vue +433 -0
- package/components/lib/bpmMulFile/src/part/lib/compressImageUtils.js +226 -0
- package/components/lib/bpmMulFile/src/part/lib/utils.js +281 -0
- package/components/lib/bpmMulFile/src/part/reader.vue +303 -0
- package/components/lib/bpmMulImage/index.js +7 -0
- package/components/lib/bpmMulImage/src/main.vue +87 -0
- package/components/lib/bpmMulImage/src/part/editor.vue +439 -0
- package/components/lib/bpmMulImage/src/part/lib/compressImageUtils.js +226 -0
- package/components/lib/bpmMulImage/src/part/lib/utils.js +281 -0
- package/components/lib/bpmMulImage/src/part/reader.vue +171 -0
- package/components/lib/bpmNumber/index.js +7 -0
- package/components/lib/bpmNumber/src/main.vue +83 -0
- package/components/lib/bpmNumber/src/part/editor.vue +48 -0
- package/components/lib/bpmNumber/src/part/reader.vue +7 -0
- package/components/lib/bpmSelect/index.js +7 -0
- package/components/lib/bpmSelect/src/main.vue +90 -0
- package/components/lib/bpmSelect/src/part/editor.vue +75 -0
- package/components/lib/bpmSelect/src/part/reader.vue +44 -0
- package/components/lib/bpmSelectCheckItem/index.js +7 -0
- package/components/lib/bpmSelectCheckItem/src/main.vue +101 -0
- package/components/lib/bpmSelectCheckItem/src/part/editor.vue +94 -0
- package/components/lib/bpmSelectCheckItem/src/part/reader.vue +7 -0
- package/components/lib/bpmSelectFromField/index.js +7 -0
- package/components/lib/bpmSelectFromField/src/main.vue +97 -0
- package/components/lib/bpmSelectFromField/src/part/editor.vue +82 -0
- package/components/lib/bpmSelectFromField/src/part/reader.vue +7 -0
- package/components/lib/bpmSelectFromForm/index.js +7 -0
- package/components/lib/bpmSelectFromForm/src/main.vue +103 -0
- package/components/lib/bpmSelectFromForm/src/part/editor.vue +181 -0
- package/components/lib/bpmSelectFromForm/src/part/reader.vue +7 -0
- package/components/lib/bpmSelectFromId/index.js +7 -0
- package/components/lib/bpmSelectFromId/src/main.vue +102 -0
- package/components/lib/bpmSelectFromId/src/part/editor.vue +260 -0
- package/components/lib/bpmSelectFromId/src/part/reader.vue +7 -0
- package/components/lib/bpmSubForm/index.js +7 -0
- package/components/lib/bpmSubForm/src/main.vue +181 -0
- package/components/lib/bpmText/index.ts +13 -0
- package/components/lib/bpmText/src/main.vue +87 -0
- package/components/lib/bpmText/src/part/editor.vue +104 -0
- package/components/lib/bpmText/src/part/reader.vue +7 -0
- package/components/lib/bpmTime/index.js +7 -0
- package/components/lib/bpmTime/src/main.vue +83 -0
- package/components/lib/bpmTime/src/part/editor.vue +54 -0
- package/components/lib/bpmTime/src/part/reader.vue +24 -0
- package/components/lib/demo/index.js +7 -0
- package/components/{bpm2/lib → lib}/demo/src/main.vue +1 -1
- package/components/lib/demo2/index.js +7 -0
- package/components/lib/demo2/src/main.vue +11 -0
- package/components/lib/field-const.js +468 -0
- package/components/lib/index.ts +52 -0
- package/components/lib/mixins/RemoteSelectReader.vue +49 -0
- package/components/lib/mixins/TextReader.vue +22 -0
- package/components/lib/net.js +21 -0
- package/components/lib/utils.js +89 -0
- package/components/sfc.d.ts +27 -0
- package/dist/06c52960c6d2c0312a3e.woff +1 -0
- package/dist/0db1520f47986b6c755a.svg +1 -0
- package/dist/1e59d2330b4c6deb84b340635ed36249.ttf +0 -0
- package/dist/20fd1704ea223900efa9fd4e869efb08.woff2 +0 -0
- package/dist/4a2487b5cc6987c4f1de.woff2 +1 -0
- package/dist/4c6f1cd9993ba8a53b8e.ttf +1 -0
- package/dist/8b43027f47b20503057dfbbaa9401fef.eot +0 -0
- package/dist/bpmDateTime.umd.js +1 -0
- package/dist/bpmDateTime.umd.js.LICENSE.txt +38 -0
- package/dist/bpmField.umd.js +2 -0
- package/dist/bpmField.umd.js.LICENSE.txt +9 -0
- package/dist/bpmMulFile.umd.js +2 -0
- package/dist/bpmMulFile.umd.js.LICENSE.txt +9 -0
- package/dist/bpmMulImage.umd.js +2 -0
- package/dist/bpmMulImage.umd.js.LICENSE.txt +9 -0
- package/dist/bpmNumber.umd.js +1 -0
- package/dist/bpmNumber.umd.js.LICENSE.txt +38 -0
- package/dist/bpmSelect.umd.js +1 -0
- package/dist/bpmSelect.umd.js.LICENSE.txt +38 -0
- package/dist/bpmSelectCheckItem.umd.js +1 -0
- package/dist/bpmSelectFromField.umd.js +1 -0
- package/dist/bpmSelectFromForm.umd.js +1 -0
- package/dist/bpmSelectFromId.umd.js +1 -0
- package/dist/bpmSelectUser.umd.js +1 -0
- package/dist/bpmSubForm.umd.js +1 -0
- package/dist/bpmText.umd.js +1 -0
- package/dist/bpmText.umd.js.LICENSE.txt +38 -0
- package/dist/bpmTime.umd.js +1 -0
- package/dist/bpmTime.umd.js.LICENSE.txt +38 -0
- package/dist/c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg +2671 -0
- package/dist/css/bpmMulFile.css +1 -0
- package/dist/css/bpmSelectCheckItem.css +1 -0
- package/dist/css/bpmSelectFromForm.css +1 -0
- package/dist/css/bpmSelectFromId.css +1 -0
- package/dist/css/bpmText.css +1 -0
- package/dist/css/demo2.css +1 -0
- package/dist/css/index.css +1 -0
- package/dist/demo.umd.js +1 -0
- package/dist/demo2.umd.js +1 -0
- package/dist/e5c0c62d732823225aaa.eot +1 -0
- package/dist/f691f37e57f04c152e2315ab7dbad881.woff +0 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.LICENSE.txt +9 -0
- package/package.json +66 -16
- package/components/bpm2/.DS_Store +0 -0
- package/components/bpm2/lib/demo/index.js +0 -18
- package/dist/favicon.ico +0 -0
- package/dist/index.html +0 -1
- package/dist/js/chunk-vendors.fad77a0a.js +0 -2
- package/dist/js/chunk-vendors.fad77a0a.js.map +0 -1
- package/dist/js/index.655afe85.js +0 -2
- package/dist/js/index.655afe85.js.map +0 -1
- package/dist/lib.umd.js +0 -1
- /package/components/{bpm2/css → css}/demo.less +0 -0
- /package/dist/css/{index.40a99d5f.css → demo.css} +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-button
|
|
4
|
+
v-if="uiType === 'table'"
|
|
5
|
+
@click="showSubForm = true"
|
|
6
|
+
type="text">查看子表单</el-button>
|
|
7
|
+
<el-table
|
|
8
|
+
v-else
|
|
9
|
+
:data="subformData"
|
|
10
|
+
:max-height="maxHeight"
|
|
11
|
+
border stripe
|
|
12
|
+
style="width: 100%;">
|
|
13
|
+
<el-table-column v-for="col in columns"
|
|
14
|
+
:prop="col.id"
|
|
15
|
+
:key="col.key"
|
|
16
|
+
:label="col.label"
|
|
17
|
+
:min-width="col.minWidth"
|
|
18
|
+
:sortable="col.sortable"
|
|
19
|
+
:sort-by="col.sortBy">
|
|
20
|
+
<template slot-scope="scope">
|
|
21
|
+
<bpm-field
|
|
22
|
+
v-model="scope.row[col.id]"
|
|
23
|
+
:type="col.data.type"
|
|
24
|
+
:fieldConf="col.data"
|
|
25
|
+
:mode="mode"
|
|
26
|
+
uiType="table"
|
|
27
|
+
:formDefId="formDefId"
|
|
28
|
+
:orgInfo="orgInfo"
|
|
29
|
+
@change="handleChange"></bpm-field>
|
|
30
|
+
</template>
|
|
31
|
+
</el-table-column>
|
|
32
|
+
</el-table>
|
|
33
|
+
|
|
34
|
+
<el-dialog
|
|
35
|
+
:title="subFormDialogTitle"
|
|
36
|
+
:visible.sync="showSubForm"
|
|
37
|
+
width="50%"
|
|
38
|
+
@close="showSubForm = false">
|
|
39
|
+
<div style="max-height: 70vh; overflow: auto;">
|
|
40
|
+
<el-table
|
|
41
|
+
:data="subformData"
|
|
42
|
+
:max-height="dialogTableMaxHeight"
|
|
43
|
+
border stripe
|
|
44
|
+
style="width: 100%;">
|
|
45
|
+
<el-table-column v-for="col in columns"
|
|
46
|
+
:prop="col.id"
|
|
47
|
+
:key="col.key"
|
|
48
|
+
:label="col.label"
|
|
49
|
+
:min-width="col.minWidth"
|
|
50
|
+
:sortable="col.sortable"
|
|
51
|
+
:sort-by="col.sortBy">
|
|
52
|
+
<template slot-scope="scope">
|
|
53
|
+
<bpm-field
|
|
54
|
+
v-model="scope.row[col.id]"
|
|
55
|
+
:type="col.data.type"
|
|
56
|
+
:fieldConf="col.data"
|
|
57
|
+
:mode="mode"
|
|
58
|
+
uiType="table"
|
|
59
|
+
:formDefId="formDefId"
|
|
60
|
+
:orgInfo="orgInfo"
|
|
61
|
+
@change="handleChange"></bpm-field>
|
|
62
|
+
</template>
|
|
63
|
+
</el-table-column>
|
|
64
|
+
</el-table>
|
|
65
|
+
</div>
|
|
66
|
+
</el-dialog>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
import { FORM_FIELDS_MAP } from '../../field-const.js'
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'BpmSubForm',
|
|
75
|
+
props: {
|
|
76
|
+
value: {
|
|
77
|
+
type: [String, Number, Object, Array]
|
|
78
|
+
},
|
|
79
|
+
type: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: 'XSubForm' // SubForm, XSubForm, OrderSubForm
|
|
82
|
+
},
|
|
83
|
+
fieldConf: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default() {
|
|
86
|
+
return {}
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
mode: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: 'view' // view, edit
|
|
92
|
+
},
|
|
93
|
+
uiType: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: 'default' // default,table,form,search
|
|
96
|
+
},
|
|
97
|
+
maxHeight: {
|
|
98
|
+
type: [Number, String],
|
|
99
|
+
default: 500
|
|
100
|
+
},
|
|
101
|
+
formDefId: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: ''
|
|
104
|
+
},
|
|
105
|
+
orgInfo: {
|
|
106
|
+
type: Object,
|
|
107
|
+
default () {
|
|
108
|
+
return {
|
|
109
|
+
level: 'group', // group,team,project
|
|
110
|
+
level_id: 0,
|
|
111
|
+
group_id: 0
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
data() {
|
|
117
|
+
return {
|
|
118
|
+
subformData: [],
|
|
119
|
+
dialogTableMaxHeight: 500,
|
|
120
|
+
showSubForm: false
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
computed: {
|
|
124
|
+
columns () {
|
|
125
|
+
const elements = this.fieldConf.elements || []
|
|
126
|
+
const arr = []
|
|
127
|
+
elements.forEach(item => {
|
|
128
|
+
const fieldMap = FORM_FIELDS_MAP[item.type] || {}
|
|
129
|
+
if (fieldMap.hasBpmField) {
|
|
130
|
+
arr.push({
|
|
131
|
+
key: item.id,
|
|
132
|
+
id: item.id,
|
|
133
|
+
label: item.name || item.id,
|
|
134
|
+
minWidth: fieldMap.tableColWidth || 100,
|
|
135
|
+
sortable: true,
|
|
136
|
+
sortBy: item.id,
|
|
137
|
+
data: item
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
return arr
|
|
143
|
+
},
|
|
144
|
+
subFormDialogTitle () {
|
|
145
|
+
return this.fieldConf.name || this.fieldConf.id
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
watch: {
|
|
149
|
+
value: {
|
|
150
|
+
handler (val) {
|
|
151
|
+
if (val && _.isArray(val)) {
|
|
152
|
+
this.subformData = val
|
|
153
|
+
} else {
|
|
154
|
+
this.subformData = []
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
immediate: true
|
|
158
|
+
},
|
|
159
|
+
// subformData: {
|
|
160
|
+
// handler (val) {
|
|
161
|
+
// this.$emit('input', val)
|
|
162
|
+
// this.$emit('change', val)
|
|
163
|
+
// },
|
|
164
|
+
// deep: true
|
|
165
|
+
// }
|
|
166
|
+
},
|
|
167
|
+
created() {
|
|
168
|
+
this.dialogTableMaxHeight = Math.floor(window.innerHeight / 100 * 70 - 114)
|
|
169
|
+
},
|
|
170
|
+
methods: {
|
|
171
|
+
handleChange () {
|
|
172
|
+
this.$emit('input', this.subformData)
|
|
173
|
+
this.$emit('change', this.subformData)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<style lang="less" scoped>
|
|
180
|
+
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
class="bpm-text"
|
|
4
|
+
v-model="curVal"
|
|
5
|
+
:is="curComponent"
|
|
6
|
+
:fieldConf="fieldConf"
|
|
7
|
+
:row="row"
|
|
8
|
+
:mode="mode"
|
|
9
|
+
:uiType="uiType"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
v-on="$listeners"
|
|
12
|
+
>
|
|
13
|
+
</component>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
16
|
+
import editorComponent from "./part/editor.vue";
|
|
17
|
+
import readerComponent from "./part/reader.vue";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "BpmText",
|
|
21
|
+
components: {
|
|
22
|
+
editorComponent,
|
|
23
|
+
readerComponent
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
value: {
|
|
27
|
+
type: String,
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
fieldConf: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default() {
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
row: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default() {
|
|
39
|
+
return {};
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
mode: {
|
|
43
|
+
type: String,
|
|
44
|
+
default() {
|
|
45
|
+
return "view";
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
uiType: {
|
|
49
|
+
type: String,
|
|
50
|
+
default() {
|
|
51
|
+
return "default";
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
data () {
|
|
56
|
+
return {
|
|
57
|
+
curVal: ""
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
curComponent() {
|
|
62
|
+
if (this.mode == "view") {
|
|
63
|
+
return readerComponent;
|
|
64
|
+
} else {
|
|
65
|
+
return editorComponent;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
watch: {
|
|
70
|
+
curVal(val){
|
|
71
|
+
this.$emit("input", val)
|
|
72
|
+
this.$emit("change", val);
|
|
73
|
+
},
|
|
74
|
+
value(){
|
|
75
|
+
this.curVal = this.value
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
mounted () {
|
|
80
|
+
this.curVal = this.value
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style lang="less" scoped>
|
|
86
|
+
@import "../../../css/bpmText.less";
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bpm-text-edit" style="position: relative">
|
|
3
|
+
<el-input
|
|
4
|
+
ref="component"
|
|
5
|
+
v-model="curVal"
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
:type="inputType"
|
|
8
|
+
:rows="2"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
v-on="$listeners"
|
|
11
|
+
></el-input>
|
|
12
|
+
<div class="prefab-words" v-if="prefabWords && prefabWords.length && uiType != 'table'">
|
|
13
|
+
<!-- <div>{{ $z("快捷输入", "b2.common.quick_input") }}</div> -->
|
|
14
|
+
|
|
15
|
+
<div>快捷输入</div>
|
|
16
|
+
<ul>
|
|
17
|
+
<li
|
|
18
|
+
v-for="(item, index) in prefabWords"
|
|
19
|
+
:class="selectWord == item ? 'active' : ''"
|
|
20
|
+
:key="`${index}`"
|
|
21
|
+
@click="handleAddWord(item)"
|
|
22
|
+
>
|
|
23
|
+
<span>{{ item }}</span>
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import _ from "lodash";
|
|
32
|
+
|
|
33
|
+
import Vue from "vue";
|
|
34
|
+
|
|
35
|
+
import { Input } from "element-ui";
|
|
36
|
+
|
|
37
|
+
Vue.use(Input);
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
selectWord: "",
|
|
43
|
+
curVal: "",
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
props: ["value", "fieldConf", "row", "uiType"],
|
|
47
|
+
|
|
48
|
+
watch: {
|
|
49
|
+
curVal(val) {
|
|
50
|
+
this.$emit("input", val);
|
|
51
|
+
},
|
|
52
|
+
value() {
|
|
53
|
+
this.curVal = this.value;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
computed: {
|
|
58
|
+
placeholder() {
|
|
59
|
+
return this.fieldConf.desc || this.fieldConf.name;
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
prefabWords() {
|
|
63
|
+
return _.get(this.fieldConf, "prefab_words", []);
|
|
64
|
+
},
|
|
65
|
+
inputType() {
|
|
66
|
+
let confType = this.fieldConf.type;
|
|
67
|
+
switch (confType) {
|
|
68
|
+
case "TextArea":
|
|
69
|
+
return "textarea";
|
|
70
|
+
default:
|
|
71
|
+
return "text";
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
async handleAddWord(str) {
|
|
77
|
+
this.selectWord = str;
|
|
78
|
+
if (this.curVal) {
|
|
79
|
+
let elem = this.$refs.component.$refs.input;
|
|
80
|
+
let startPos = elem.selectionStart;
|
|
81
|
+
let endPos = elem.selectionEnd;
|
|
82
|
+
let value = this.curVal;
|
|
83
|
+
let preStr = value.substring(0, startPos);
|
|
84
|
+
let endStr = value.substring(endPos, value.length);
|
|
85
|
+
let result = preStr + str + endStr;
|
|
86
|
+
this.curVal = result;
|
|
87
|
+
|
|
88
|
+
await this.$nextTick();
|
|
89
|
+
elem.focus();
|
|
90
|
+
|
|
91
|
+
elem.setSelectionRange(startPos + str.length, startPos + str.length);
|
|
92
|
+
} else {
|
|
93
|
+
this.curVal = str;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.selectWord = "";
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
mounted() {
|
|
100
|
+
this.curVal = this.value;
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
</script>
|
|
104
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
class="bpm-select"
|
|
4
|
+
v-model="curVal"
|
|
5
|
+
:is="curComponent"
|
|
6
|
+
:fieldConf="fieldConf"
|
|
7
|
+
:row="row"
|
|
8
|
+
:mode="mode"
|
|
9
|
+
:uiType="uiType"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
v-on="$listeners"
|
|
12
|
+
>
|
|
13
|
+
</component>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
16
|
+
import editorComponent from "./part/editor.vue";
|
|
17
|
+
import readerComponent from "./part/reader.vue";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "BpmTime",
|
|
21
|
+
components: {
|
|
22
|
+
editorComponent,
|
|
23
|
+
readerComponent
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
value: {
|
|
27
|
+
type: [String, Number],
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
fieldConf: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default() {
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
row: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default() {
|
|
39
|
+
return {};
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
mode: {
|
|
43
|
+
type: String,
|
|
44
|
+
default() {
|
|
45
|
+
return "view";
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
uiType: {
|
|
49
|
+
type: String,
|
|
50
|
+
default() {
|
|
51
|
+
return "default";
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
data () {
|
|
56
|
+
return {
|
|
57
|
+
curVal: ""
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
curComponent() {
|
|
62
|
+
if (this.mode == "view") {
|
|
63
|
+
return readerComponent;
|
|
64
|
+
} else {
|
|
65
|
+
return editorComponent;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
watch: {
|
|
70
|
+
curVal(val){
|
|
71
|
+
this.$emit("input", val)
|
|
72
|
+
this.$emit("change", val);
|
|
73
|
+
},
|
|
74
|
+
value(){
|
|
75
|
+
this.curVal = this.value
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
mounted () {
|
|
80
|
+
this.curVal = this.value
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bpm-time-edit">
|
|
3
|
+
<el-time-select
|
|
4
|
+
ref="component"
|
|
5
|
+
v-model="curVal"
|
|
6
|
+
format-model="number"
|
|
7
|
+
:format="format"
|
|
8
|
+
:value-format="checkFormat"
|
|
9
|
+
:clearable="true"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import _ from "lodash";
|
|
17
|
+
|
|
18
|
+
import Vue from "vue";
|
|
19
|
+
|
|
20
|
+
import { TimeSelect } from "element-ui";
|
|
21
|
+
|
|
22
|
+
Vue.use(TimeSelect);
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
curVal: ""
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
props: ["value", "fieldConf", "row"],
|
|
31
|
+
watch: {
|
|
32
|
+
curVal(val) {
|
|
33
|
+
this.$emit("input", val);
|
|
34
|
+
},
|
|
35
|
+
value(){
|
|
36
|
+
this.curVal = this.value;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
format() {
|
|
41
|
+
return _.get(this.fieldConf, "view.format");
|
|
42
|
+
},
|
|
43
|
+
checkFormat() {
|
|
44
|
+
return _.get(this.fieldConf, "check.format");
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
mounted() {
|
|
48
|
+
this.curVal = this.value;
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span >{{ value }}</span>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
// import _ from "lodash";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
props: ["value", "fieldConf", "row"],
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
computed: {
|
|
15
|
+
},
|
|
16
|
+
watch: {
|
|
17
|
+
},
|
|
18
|
+
mounted() {
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|