@blueking/bkui-form 0.0.39 → 0.0.41
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/dist/bkui-form-es-min.js +3 -3
- package/dist/bkui-form-es.js +51 -9
- package/dist/bkui-form-es.js.map +1 -1
- package/dist/bkui-form-umd-min.js +3 -3
- package/dist/bkui-form-umd.js +51 -9
- package/dist/bkui-form-umd.js.map +1 -1
- package/dist/bkui-form.css +8 -0
- package/dist/types/bkui-form.d.ts +1 -1
- package/package.json +1 -1
package/dist/bkui-form-es.js
CHANGED
|
@@ -1936,7 +1936,7 @@ var WidgetTree = /*#__PURE__*/function () {
|
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
1938
|
var _node = new WidgetNode({
|
|
1939
|
-
id: path,
|
|
1939
|
+
id: instance.path,
|
|
1940
1940
|
type: type,
|
|
1941
1941
|
index: index,
|
|
1942
1942
|
parent: parentNode,
|
|
@@ -10213,7 +10213,22 @@ var Widget = Vue.extend({
|
|
|
10213
10213
|
val = item.label;
|
|
10214
10214
|
}
|
|
10215
10215
|
}
|
|
10216
|
-
|
|
10216
|
+
var value = val === '' ? '--' : val;
|
|
10217
|
+
if (Object.prototype.toString.call(value) === '[Object Object]') {
|
|
10218
|
+
value = JSON.stringify(value);
|
|
10219
|
+
} else if (Array.isArray(value)) {
|
|
10220
|
+
var isTrue = value.some(function (item) {
|
|
10221
|
+
return item && _typeof(item) === 'object';
|
|
10222
|
+
});
|
|
10223
|
+
if (isTrue) {
|
|
10224
|
+
value = JSON.stringify(value);
|
|
10225
|
+
} else {
|
|
10226
|
+
value = value.join(',');
|
|
10227
|
+
}
|
|
10228
|
+
} else {
|
|
10229
|
+
value = String(value);
|
|
10230
|
+
}
|
|
10231
|
+
return value;
|
|
10217
10232
|
}
|
|
10218
10233
|
},
|
|
10219
10234
|
render: function render(h) {
|
|
@@ -10902,6 +10917,22 @@ var getRowDefaultData = function getRowDefaultData() {
|
|
|
10902
10917
|
var TableWidget = Vue.extend({
|
|
10903
10918
|
name: 'TableWidget',
|
|
10904
10919
|
props: props,
|
|
10920
|
+
mounted: function mounted() {
|
|
10921
|
+
var _this = this;
|
|
10922
|
+
this.$nextTick(function () {
|
|
10923
|
+
var fieldMap = _this.schema.items.properties;
|
|
10924
|
+
_this.value.forEach(function (item, index) {
|
|
10925
|
+
Object.keys(fieldMap).forEach(function (key) {
|
|
10926
|
+
var config = fieldMap[key];
|
|
10927
|
+
if (config['ui:rules']) {
|
|
10928
|
+
var instance = _this.$refs[key + index];
|
|
10929
|
+
// 注册widget TreeNode
|
|
10930
|
+
widgetTree.addWidgetNode("".concat(_this.path, ".").concat(key), instance, 'node');
|
|
10931
|
+
}
|
|
10932
|
+
});
|
|
10933
|
+
});
|
|
10934
|
+
});
|
|
10935
|
+
},
|
|
10905
10936
|
methods: {
|
|
10906
10937
|
// 单元格表单编辑
|
|
10907
10938
|
handleCellValChange: function handleCellValChange(_ref) {
|
|
@@ -10914,12 +10945,14 @@ var TableWidget = Vue.extend({
|
|
|
10914
10945
|
// 新增
|
|
10915
10946
|
handleAddRow: function handleAddRow(index) {
|
|
10916
10947
|
var _this$$props$schema$i;
|
|
10948
|
+
if (this.schema['ui:props'].disabled) return;
|
|
10917
10949
|
var newValue = this.value.slice(0);
|
|
10918
10950
|
newValue.splice.apply(newValue, [index + 1, 0].concat(_toConsumableArray(getRowDefaultData((_this$$props$schema$i = this.$props.schema.items) === null || _this$$props$schema$i === void 0 ? void 0 : _this$$props$schema$i.properties))));
|
|
10919
10951
|
this.$emit('input', newValue);
|
|
10920
10952
|
},
|
|
10921
10953
|
// 删除
|
|
10922
10954
|
handleDelRow: function handleDelRow(index) {
|
|
10955
|
+
if (this.schema['ui:props'].disabled) return;
|
|
10923
10956
|
var newValue = this.value.slice(0);
|
|
10924
10957
|
newValue.splice(index, 1);
|
|
10925
10958
|
this.$emit('input', newValue);
|
|
@@ -10927,7 +10960,7 @@ var TableWidget = Vue.extend({
|
|
|
10927
10960
|
},
|
|
10928
10961
|
render: function render(h) {
|
|
10929
10962
|
var _schema$items,
|
|
10930
|
-
|
|
10963
|
+
_this2 = this;
|
|
10931
10964
|
var self = this;
|
|
10932
10965
|
var _this$$props = this.$props,
|
|
10933
10966
|
schema = _this$$props.schema,
|
|
@@ -10936,7 +10969,8 @@ var TableWidget = Vue.extend({
|
|
|
10936
10969
|
path = _this$$props.path,
|
|
10937
10970
|
context = _this$$props.context,
|
|
10938
10971
|
rootData = _this$$props.rootData,
|
|
10939
|
-
value = _this$$props.value
|
|
10972
|
+
value = _this$$props.value,
|
|
10973
|
+
disabled = _this$$props.disabled;
|
|
10940
10974
|
var columnsKey = Object.keys(((_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.properties) || []);
|
|
10941
10975
|
var uiOptions = Schema.getUiOptions(schema);
|
|
10942
10976
|
var getTableColumn = function getTableColumn() {
|
|
@@ -10964,16 +10998,20 @@ var TableWidget = Vue.extend({
|
|
|
10964
10998
|
}
|
|
10965
10999
|
return h(registry.getBaseWidget('table-column'), {
|
|
10966
11000
|
props: _objectSpread2({
|
|
10967
|
-
label: colField.title
|
|
11001
|
+
label: colField.title,
|
|
11002
|
+
minWidth: colField.minWidth,
|
|
11003
|
+
width: colField.width
|
|
10968
11004
|
}, colProps),
|
|
10969
11005
|
scopedSlots: {
|
|
10970
11006
|
default: function _default(props) {
|
|
10971
11007
|
return h(SchemaField, {
|
|
11008
|
+
ref: key + props.$index,
|
|
10972
11009
|
props: {
|
|
10973
11010
|
context: context,
|
|
10974
11011
|
rootData: rootData,
|
|
10975
11012
|
readonly: readonly,
|
|
10976
11013
|
readonlyMode: readonlyMode,
|
|
11014
|
+
disabled: disabled,
|
|
10977
11015
|
schema: mergeDeep(colField, {
|
|
10978
11016
|
'ui:props': {
|
|
10979
11017
|
// 默认不展示标题
|
|
@@ -10995,16 +11033,20 @@ var TableWidget = Vue.extend({
|
|
|
10995
11033
|
}
|
|
10996
11034
|
});
|
|
10997
11035
|
});
|
|
10998
|
-
if (!
|
|
11036
|
+
if (!_this2.readonly && uiOptions.modifyRows !== false) {
|
|
10999
11037
|
VNodeList.push(h(registry.getBaseWidget('table-column'), {
|
|
11000
11038
|
props: {
|
|
11001
11039
|
label: '操作',
|
|
11002
|
-
width: 100
|
|
11040
|
+
width: 100,
|
|
11041
|
+
fixed: 'right'
|
|
11003
11042
|
},
|
|
11004
11043
|
scopedSlots: {
|
|
11005
11044
|
default: function _default(props) {
|
|
11006
11045
|
return h('div', {
|
|
11007
|
-
class:
|
|
11046
|
+
class: {
|
|
11047
|
+
'table-widget-actions': true,
|
|
11048
|
+
'is-disabled': schema['ui:props'].disabled
|
|
11049
|
+
}
|
|
11008
11050
|
}, [h('i', {
|
|
11009
11051
|
class: 'bk-icon icon-plus-circle action-btn',
|
|
11010
11052
|
on: {
|
|
@@ -11042,7 +11084,7 @@ var TableWidget = Vue.extend({
|
|
|
11042
11084
|
},
|
|
11043
11085
|
scopedSlots: {
|
|
11044
11086
|
empty: function empty() {
|
|
11045
|
-
return
|
|
11087
|
+
return _this2.readonly || uiOptions.modifyRows === false ? null : h('div', {
|
|
11046
11088
|
style: {
|
|
11047
11089
|
color: '#3a84ff',
|
|
11048
11090
|
cursor: 'pointer'
|