cloud-web-corejs 1.0.54-dev.714 → 1.0.54-dev.716
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 +1 -1
- package/src/components/xform/XFormTabContainer//346/226/260/345/242/236/351/241/265/347/255/276/346/250/241/345/274/217-/350/220/275/345/234/260/345/256/236/346/226/275/346/226/207/346/241/243.md +232 -0
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +563 -0
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +48 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +60 -0
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +116 -13
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +5 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +13 -0
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +11 -0
- package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +9 -1
- package/src/components/xform/form-designer/widget-panel/index.vue +29 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +183 -0
- package/src/components/xform/form-render/compareDelList.vue +83 -0
- package/src/components/xform/form-render/compareView.vue +76 -0
- package/src/components/xform/form-render/container-item/data-table-item.vue +15 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +19 -0
- package/src/components/xform/form-render/index.vue +8 -1
- package/src/components/xform/form-render/indexMixin.js +798 -3
- package/src/components/xform/lang/en-US_extension.js +4 -0
- package/src/components/xform/lang/zh-CN.js +4 -0
- package/src/components/xform/mixins/defaultHandle.js +17 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* 表单对比提示组件
|
|
4
|
+
* 差异判定(isDiff)由字段侧(fieldMixin.compareEquals)算好传入,本组件不做裸值比较;
|
|
5
|
+
* oldVal 传入的是已解析的展示文本(label),用于 popover 展示"变更前"值。
|
|
6
|
+
* 注意:DOM 顺序里 slot 必须始终在前(index 0),图标为其后的条件兄弟节点,
|
|
7
|
+
* 否则 isDiff 切换时按索引 patch 会重建 slot 内的 input,导致手动输入时失焦。
|
|
8
|
+
* 视觉上用 flex order 把图标排到输入框前面。
|
|
9
|
+
*/
|
|
10
|
+
-->
|
|
11
|
+
<template>
|
|
12
|
+
<span class="xform-compare-view">
|
|
13
|
+
<span class="xform-compare-slot"><slot></slot></span>
|
|
14
|
+
<span v-if="isCompare && isDiff" class="xform-compare-icon-wrap">
|
|
15
|
+
<el-popover placement="top-start" width="200" trigger="hover">
|
|
16
|
+
<div class="xform-compare-old">
|
|
17
|
+
{{ $t1("变更前") }}:{{ displayOldVal }}
|
|
18
|
+
</div>
|
|
19
|
+
<span slot="reference" class="xform-compare-icon">
|
|
20
|
+
<i class="el-icon-warning"></i>
|
|
21
|
+
</span>
|
|
22
|
+
</el-popover>
|
|
23
|
+
</span>
|
|
24
|
+
</span>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
name: "CompareView",
|
|
30
|
+
props: {
|
|
31
|
+
isCompare: { type: Boolean, default: false },
|
|
32
|
+
isDiff: { type: Boolean, default: false },
|
|
33
|
+
oldVal: { default: null },
|
|
34
|
+
newVal: { default: null },
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
displayOldVal() {
|
|
38
|
+
let v = this.oldVal;
|
|
39
|
+
if (v === null || v === undefined || v === "") return this.$t1("(空)");
|
|
40
|
+
return v;
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
/* 对比态用 flex;图标固定在输入框前面(左侧),输入框占满剩余宽度 */
|
|
48
|
+
.xform-compare-view {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
/* DOM 在前但视觉排到后面,输入框自适应占满 */
|
|
54
|
+
.xform-compare-slot {
|
|
55
|
+
order: 1;
|
|
56
|
+
flex: 1 1 auto;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
}
|
|
59
|
+
/* DOM 在后但视觉排到前面 */
|
|
60
|
+
.xform-compare-icon-wrap {
|
|
61
|
+
order: 0;
|
|
62
|
+
flex: 0 0 auto;
|
|
63
|
+
margin-right: 4px;
|
|
64
|
+
line-height: 1;
|
|
65
|
+
}
|
|
66
|
+
.xform-compare-icon {
|
|
67
|
+
color: #e6a23c;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
line-height: 1;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
.xform-compare-old {
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
word-break: break-all;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -329,4 +329,19 @@ export default {
|
|
|
329
329
|
.field-wrapper {
|
|
330
330
|
display: inline-block;
|
|
331
331
|
}
|
|
332
|
+
/* 对比:变更行/新增行整行高亮(vxe 行加 rowClassName) */
|
|
333
|
+
::v-deep .vxe-body--row.xform-compare-row-changed,
|
|
334
|
+
::v-deep .vxe-body--row.xform-compare-row-changed td {
|
|
335
|
+
background-color: #fdf2e3; /* 橙 - 变更 */
|
|
336
|
+
}
|
|
337
|
+
::v-deep .vxe-body--row.xform-compare-row-changed td:first-child {
|
|
338
|
+
box-shadow: inset 3px 0 0 #e6a23c;
|
|
339
|
+
}
|
|
340
|
+
::v-deep .vxe-body--row.xform-compare-row-new,
|
|
341
|
+
::v-deep .vxe-body--row.xform-compare-row-new td {
|
|
342
|
+
background-color: #eef8e3; /* 绿 - 新增 */
|
|
343
|
+
}
|
|
344
|
+
::v-deep .vxe-body--row.xform-compare-row-new td:first-child {
|
|
345
|
+
box-shadow: inset 3px 0 0 #67c23a;
|
|
346
|
+
}
|
|
332
347
|
</style>
|
|
@@ -1424,6 +1424,24 @@ modules = {
|
|
|
1424
1424
|
getTableData: function () {
|
|
1425
1425
|
return this.widget.options.tableData;
|
|
1426
1426
|
},
|
|
1427
|
+
/**
|
|
1428
|
+
* 注入对比行样式:变更行/新增行整行高亮。组合已有 rowClassName,不覆盖原逻辑。
|
|
1429
|
+
*/
|
|
1430
|
+
applyCompareRowClassName: function () {
|
|
1431
|
+
if (!this.vxeOption) return;
|
|
1432
|
+
let prev = this.vxeOption.rowClassName;
|
|
1433
|
+
let self = this;
|
|
1434
|
+
this.$set(this.vxeOption, "rowClassName", function (params) {
|
|
1435
|
+
let cls =
|
|
1436
|
+
typeof prev === "function" ? prev(params) || "" : prev || "";
|
|
1437
|
+
let formRef = self.getFormRef();
|
|
1438
|
+
if (formRef && formRef.isCompare && formRef.getCompareRowClass) {
|
|
1439
|
+
let extra = formRef.getCompareRowClass(self.fieldKeyName, params.row);
|
|
1440
|
+
if (extra) cls = (cls + " " + extra).trim();
|
|
1441
|
+
}
|
|
1442
|
+
return cls;
|
|
1443
|
+
});
|
|
1444
|
+
},
|
|
1427
1445
|
/**
|
|
1428
1446
|
* 重置查询表单,并按配置决定是否立即重新查询。
|
|
1429
1447
|
* @param {Object} options 可覆盖默认重置行为。
|
|
@@ -2568,6 +2586,7 @@ modules = {
|
|
|
2568
2586
|
}
|
|
2569
2587
|
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
2570
2588
|
this.vxeOption = opts;
|
|
2589
|
+
this.applyCompareRowClassName();
|
|
2571
2590
|
this.tryAutoLoadDynamicColumns().finally(() => {
|
|
2572
2591
|
if (!isQueryTable) {
|
|
2573
2592
|
setTimeout(() => {
|
|
@@ -105,6 +105,11 @@
|
|
|
105
105
|
:visiable.sync="showUniverDialog"
|
|
106
106
|
:option="univerDialogOption"
|
|
107
107
|
></univerDialog>
|
|
108
|
+
<compareDelList
|
|
109
|
+
v-if="showCompareDelList"
|
|
110
|
+
:visiable.sync="showCompareDelList"
|
|
111
|
+
:option="compareDelListOption"
|
|
112
|
+
></compareDelList>
|
|
108
113
|
</div>
|
|
109
114
|
</template>
|
|
110
115
|
|
|
@@ -134,7 +139,9 @@ export default {
|
|
|
134
139
|
fileReferenceDialog: () =>
|
|
135
140
|
import(
|
|
136
141
|
"../../../components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue"
|
|
137
|
-
)
|
|
142
|
+
),
|
|
143
|
+
compareDelList: () =>
|
|
144
|
+
import("../../../components/xform/form-render/compareDelList.vue"),
|
|
138
145
|
},
|
|
139
146
|
mixins: [indexMixin, formDynamicFieldMixin],
|
|
140
147
|
};
|