cloud-web-corejs 1.0.54-dev.370 → 1.0.54-dev.371

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.
@@ -165,7 +165,7 @@
165
165
  :parent-widget="widget"
166
166
  :columnConfig="obj.column.params.columnConfig"
167
167
  :subFormRowIndex="obj.rowIndex"
168
- :formItemProp="getColumnProp(widget, obj)"
168
+ :formItemProp="getColumnProp(obj)"
169
169
  :subFormRowId="obj.row._X_ROW_KEY"
170
170
  :tableParam="obj"
171
171
  >
@@ -211,7 +211,7 @@
211
211
  :columnConfig="obj.column.params.columnConfig"
212
212
  :subFormRowIndex="obj.rowIndex"
213
213
  :subFormRowId="obj.row._X_ROW_KEY"
214
- :formItemProp="getColumnProp(widget, obj, true)"
214
+ :formItemProp="getColumnProp(obj, true)"
215
215
  :tableParam="obj"
216
216
  >
217
217
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
@@ -1896,26 +1896,84 @@ modules = {
1896
1896
  return { columnSelectedWidget, columnEditFields };
1897
1897
  },
1898
1898
  getColumnProp2(fieldWidget, obj) {
1899
+ let isQueryTable = this.widget.options.isQueryTable || false;
1900
+ let rowWidget = this.getRowWidget(obj, fieldWidget)
1901
+ let required = rowWidget.options.required || false;
1902
+
1899
1903
  let fieldKeyName = this.getFieldKeyName(this.widget);
1900
- let property = this.getFieldKeyName(fieldWidget);
1901
- if (this.isVabsearchFlagWidget(fieldWidget)) {
1902
- property = fieldWidget.options.vabSearchName || property;
1904
+ let property = this.getFieldKeyName(rowWidget);
1905
+ if (this.isVabsearchFlagWidget(rowWidget)) {
1906
+ property = rowWidget.options.vabSearchName || property;
1903
1907
  }
1904
1908
  let rowIndex = Math.max(obj.rowIndex, 0);
1905
1909
 
1906
1910
  let propName = fieldKeyName + "." + rowIndex + "." + property;
1911
+ if (isQueryTable && !required) {
1912
+ propName = "false";
1913
+ }
1907
1914
  return propName;
1908
1915
  },
1909
- getColumnProp(widget, obj, isEdit) {
1910
- if (!widget) {
1911
- return "false";
1916
+ validateCheckRow(){
1917
+ let $grid = this.getGridTable();
1918
+ let checkRows = $grid.getCheckboxRecords(true);
1919
+ if(checkRows.length == 0){
1920
+ this.$message({
1921
+ message: '请选择要操作的行',
1922
+ type: 'warning'
1923
+ });
1924
+ return false;
1912
1925
  }
1913
- /*if(isEdit){
1914
- return "false"
1915
- }*/
1916
- let isQueryTable = this.widget.options.isQueryTable || false;
1917
- if (isEdit || !isQueryTable) {
1918
- let sourceWidgetId = isEdit
1926
+ const fieldsToValidate = [];
1927
+ let tableColumns = this.widget.options.tableColumns;
1928
+ checkRows.forEach(row => {
1929
+ let fieldSchema = this.fieldSchemaMap[row._X_ROW_KEY];
1930
+ tableColumns.forEach(column => {
1931
+ if(column.widget){
1932
+ let widget = fieldSchema[column.widget.id]
1933
+ let required = widget.options.required || false;
1934
+ if(required){
1935
+ let propName = this.getColumnWidgetProp(widget, row);
1936
+ fieldsToValidate.push(propName)
1937
+ }
1938
+ }
1939
+ if(column.widgetList){
1940
+ column.widgetList.forEach(itemWidget=>{
1941
+ let widget = fieldSchema[itemWidget.id]
1942
+ let required = widget.options.required || false;
1943
+ if(required){
1944
+ let propName = this.getColumnWidgetProp(widget, row);
1945
+ fieldsToValidate.push(propName)
1946
+ }
1947
+ })
1948
+
1949
+ }
1950
+ })
1951
+ })
1952
+ let formRef = this.getFormRef();
1953
+ let renderForm = formRef.$refs.renderForm;
1954
+ let hasError = false;
1955
+ renderForm.validateField(fieldsToValidate, errors => {
1956
+ if (!hasError && errors) {
1957
+ this.$message.error(errors)
1958
+ hasError = true;
1959
+ }
1960
+ });
1961
+ return !hasError;
1962
+ },
1963
+ getColumnWidgetProp(widget, row){
1964
+ if(!widget)return
1965
+ let $grid = this.getGridTable();
1966
+ let rowIndex = $grid.getRowIndex(row);
1967
+ let fieldKeyName = this.getFieldKeyName(this.widget);
1968
+ let property = this.getFieldKeyName(widget);
1969
+ if (this.isVabsearchFlagWidget(widget)) {
1970
+ property = widget.options.vabSearchName || property;
1971
+ }
1972
+ let propName = fieldKeyName + "." + rowIndex + "." + property;
1973
+ return propName;
1974
+ },
1975
+ getColumnProp(obj, isEdit) {
1976
+ let sourceWidgetId = isEdit
1919
1977
  ? obj.column.params.editWidget.id
1920
1978
  : obj.column.params.widget.id;
1921
1979
  if (!this.fieldSchemaMap[obj.row._X_ROW_KEY]) return "false";
@@ -1924,8 +1982,11 @@ modules = {
1924
1982
  if (!fieldWidget) {
1925
1983
  return "false";
1926
1984
  }
1985
+ let isQueryTable = this.widget.options.isQueryTable || false;
1927
1986
 
1928
- let fieldKeyName = this.getFieldKeyName(widget);
1987
+ let required = fieldWidget.options.required || false;
1988
+ if (isEdit || !isQueryTable || required) {
1989
+ let fieldKeyName = this.getFieldKeyName(this.widget);
1929
1990
  let rowIndex = Math.max(obj.rowIndex, 0);
1930
1991
 
1931
1992
  let property = this.getFieldKeyName(fieldWidget);
@@ -1937,18 +1998,6 @@ modules = {
1937
1998
  property = fieldWidget.options.vabSearchName || property;
1938
1999
  }
1939
2000
  let propName = fieldKeyName + "." + rowIndex + "." + property;
1940
- /* let lineWidget = !isEdit
1941
- ? obj.column.params.widget
1942
- : obj.column.params.editWidget;
1943
- if (!lineWidget) {
1944
- return "false";
1945
- } */
1946
- /* if (this.isVabsearchFlagWidget(lineWidget)) {
1947
- let fieldName =
1948
- lineWidget.options.vabSearchName ||
1949
- this.getFieldKeyName(lineWidget);
1950
- propName = fieldKeyName + "." + rowIndex + "." + fieldName;
1951
- } */
1952
2001
  return propName;
1953
2002
  } else {
1954
2003
  return "false";
@@ -48,6 +48,7 @@ tMixins = {
48
48
  }
49
49
  },
50
50
  addDataTable(obj) {
51
+ debugger
51
52
  let fieldKey = this.fieldKey;
52
53
  let selectMulti = this.selectMulti;
53
54
  let row = obj.row;
@@ -82,21 +83,25 @@ tMixins = {
82
83
  this.checkRows.push(obj.row);
83
84
  }
84
85
 
85
- if (obj.checked) {
86
+ let checkStrictly = $table1.$options.propsData?.checkboxConfig?.checkStrictly;
87
+ if(checkStrictly){
88
+ if (obj.checked) {
86
89
 
87
- // let ay = $table1.getTableData().fullData;
88
- // let aRows = this.findAllRows(ay);
89
- let aRows = $table1.getTableData().visibleData;
90
+ // let ay = $table1.getTableData().fullData;
91
+ // let aRows = this.findAllRows(ay);
92
+ let aRows = $table1.getTableData().visibleData;
90
93
 
91
- let cRows = $table1.getCheckboxRecords();
92
- if (aRows.length == cRows.length) {
93
- $table1.setAllCheckboxRow(true);
94
+ let cRows = $table1.getCheckboxRecords();
95
+ if (aRows.length == cRows.length) {
96
+ $table1.setAllCheckboxRow(true);
97
+ } else {
98
+ $table1.setAllCheckboxRow(false);
99
+ }
94
100
  } else {
95
101
  $table1.setAllCheckboxRow(false);
96
102
  }
97
- } else {
98
- $table1.setAllCheckboxRow(false);
99
103
  }
104
+
100
105
  },
101
106
  clearTable1Select(index) {
102
107
  let fieldKey = this.fieldKey;
@@ -114,7 +119,10 @@ tMixins = {
114
119
  $grid1.clearCheckboxRow();
115
120
  }
116
121
  this.checkRows.splice(index, 1);
117
- if (row2) $grid1.setAllCheckboxRow(false);
122
+ let checkStrictly = $grid1.$options.propsData?.checkboxConfig?.checkStrictly;
123
+ if(checkStrictly){
124
+ if (row2) $grid1.setAllCheckboxRow(false);
125
+ }
118
126
  },
119
127
  checkAll(res) {
120
128
  let fieldKey = this.fieldKey;