ocpview-pro 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
<Icon custom='iconfont icon-custom-pack' color="#f3b352" v-show="showForm" size="14" />
|
|
7
7
|
<Icon v-show="!showForm" color="#f3b352" custom='iconfont icon-custom-spread' size="14"/>
|
|
8
8
|
<span style="margin-left:10px;font-size: 14px;font-weight:bold" v-text="myConfig.title ? $t(myConfig.title) : myConfig.title" />
|
|
9
|
+
<div v-if="myConfig.titleExtraStatus || myConfig.titleExtraRender" style="margin-left:auto">
|
|
10
|
+
<TitleExtra v-if="myConfig.titleExtraStatus" :render="titleExtraStatusRender" :params="getTitleExtraParams()" />
|
|
11
|
+
<TitleExtra v-if="myConfig.titleExtraRender" :render="myConfig.titleExtraRender" :params="getTitleExtraParams()" />
|
|
12
|
+
</div>
|
|
9
13
|
</Row>
|
|
10
14
|
</p>
|
|
11
15
|
<Divider style="margin-left:24px;margin-top:0px;margin-bottom:10px;"/>
|
|
12
16
|
</template>
|
|
13
17
|
<template v-if="myConfig.modetype === '2'">
|
|
14
|
-
<div style="margin-bottom:10px;">
|
|
18
|
+
<div :style="myConfig.titleExtraStatus || myConfig.titleExtraRender ? 'margin-bottom:10px;display:flex;align-items:center;' : 'margin-bottom:10px;'">
|
|
15
19
|
<span class="efuture-title-verticalline" /> <span style="font-size: 14px;font-weight:bold" v-text="myConfig.title ? $t(myConfig.title) : myConfig.title" />
|
|
20
|
+
<div v-if="myConfig.titleExtraStatus || myConfig.titleExtraRender" style="margin-left:auto">
|
|
21
|
+
<TitleExtra v-if="myConfig.titleExtraStatus" :render="titleExtraStatusRender" :params="getTitleExtraParams()" />
|
|
22
|
+
<TitleExtra v-if="myConfig.titleExtraRender" :render="myConfig.titleExtraRender" :params="getTitleExtraParams()" />
|
|
23
|
+
</div>
|
|
16
24
|
</div>
|
|
17
25
|
</template>
|
|
18
26
|
<Form ref="form" class="efuture-tip-form" v-show="showForm" :model="form" :rules="formRules" :label-position="myConfig.labelPosition" :label-width="myConfig.labelWidth" :inline="myConfig.inline" :id="myConfig.name" @submit.enter.prevent>
|
|
@@ -31,9 +39,9 @@
|
|
|
31
39
|
<ControlBox :ref="item.name||item.sname" :valueData="form" :config="item" @inputValue="input" @doAction="doAction" ></ControlBox>
|
|
32
40
|
<template #content>
|
|
33
41
|
<ControlBox :ref="'effect_' + item.name||item.sname" style="width:100%" :valueData="effectForm" :config="effectConfig(item)" ></ControlBox>
|
|
34
|
-
</template>
|
|
42
|
+
</template>
|
|
35
43
|
</Poptip>
|
|
36
|
-
</template>
|
|
44
|
+
</template>
|
|
37
45
|
</FormItem>
|
|
38
46
|
<ControlBox v-if="item.type === 'Divider'" :ref="item.dividerName" :style="getDividerStyle" :config="item"></ControlBox>
|
|
39
47
|
</Col>
|
|
@@ -44,9 +52,15 @@
|
|
|
44
52
|
</template>
|
|
45
53
|
|
|
46
54
|
<script>
|
|
55
|
+
import { h } from 'vue';
|
|
47
56
|
import Base from '@/components/form/formbox.vue';
|
|
57
|
+
|
|
58
|
+
// 标题右侧扩展的渲染包装:调用配置的 render 函数(函数式组件,无实例开销)
|
|
59
|
+
const TitleExtra = (props) => props.render(h, props.params);
|
|
60
|
+
|
|
48
61
|
export default {
|
|
49
62
|
name:'mformcard',
|
|
63
|
+
components: { TitleExtra },
|
|
50
64
|
extends: Base,
|
|
51
65
|
data () {
|
|
52
66
|
return {
|
|
@@ -63,6 +77,39 @@ export default {
|
|
|
63
77
|
};
|
|
64
78
|
},
|
|
65
79
|
methods:{
|
|
80
|
+
getTitleExtraParams() {
|
|
81
|
+
return {
|
|
82
|
+
form: this.form,
|
|
83
|
+
dictData: this.dictData,
|
|
84
|
+
config: this.myConfig
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
titleExtraStatusRender(h, params) {
|
|
88
|
+
let statusConfig = params.config.titleExtraStatus;
|
|
89
|
+
if (!statusConfig.codeField) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
let status = params.form[statusConfig.codeField];
|
|
93
|
+
if (status === undefined || status === null || status === '') {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
let dicts = statusConfig.dicts;
|
|
97
|
+
if (!Array.isArray(dicts)) {
|
|
98
|
+
dicts = statusConfig.dictKey ? (params.dictData && params.dictData[statusConfig.dictKey]) : null;
|
|
99
|
+
}
|
|
100
|
+
let codeKey = statusConfig.codeKey || 'code';
|
|
101
|
+
let nameKey = statusConfig.nameKey || 'name';
|
|
102
|
+
let tmp = Array.isArray(dicts) ? dicts.find(el => el[codeKey] === status) : null;
|
|
103
|
+
if (!tmp || !tmp[nameKey]) {
|
|
104
|
+
// 字典未命中或无字典来源时,降级直接显示状态编码
|
|
105
|
+
return h('span', String(status));
|
|
106
|
+
}
|
|
107
|
+
if (statusConfig.showCode) {
|
|
108
|
+
// [编码]名称 形式;编码不参与转义,仅对名称做多语言转义,避免拼接后词条匹配失效
|
|
109
|
+
return h('span', '[' + tmp[codeKey] + ']' + this.$t(tmp[nameKey]));
|
|
110
|
+
}
|
|
111
|
+
return h('span', this.$t(tmp[nameKey]));
|
|
112
|
+
},
|
|
66
113
|
customInit() {
|
|
67
114
|
if (this.myConfig.showEffectValue !== undefined) {
|
|
68
115
|
this.showEffectValue = this.myConfig.showEffectValue;
|
|
@@ -103,4 +150,4 @@ export default {
|
|
|
103
150
|
}
|
|
104
151
|
}
|
|
105
152
|
};
|
|
106
|
-
</script>
|
|
153
|
+
</script>
|