cloud-web-corejs 1.0.54-dev.672 → 1.0.54-dev.674

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.672",
4
+ "version": "1.0.54-dev.674",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
package/src/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  /**version-1.0*/
2
- import Vue from 'vue';
3
- import Cookies from 'js-cookie';
4
- import 'normalize.css/normalize.css'; // a modern alternative to CSS resets
5
- import Element from 'element-ui';
6
- import '@/styles/element-variables.scss';
7
- import '@/styles/index.scss'; // global css
2
+ import Vue from "vue";
3
+ import Cookies from "js-cookie";
4
+ import "normalize.css/normalize.css"; // a modern alternative to CSS resets
5
+ import Element from "element-ui";
6
+ import "@/styles/element-variables.scss";
7
+ import "@/styles/index.scss"; // global css
8
8
 
9
- import App from '@base/App';
10
- import store from '@base/store';
11
- import router from '@base/router';
9
+ import App from "@base/App";
10
+ import store from "@base/store";
11
+ import router from "@base/router";
12
12
 
13
- import '@/icons'; // icon
14
- import '@base/permission'; // permission control
13
+ import "@/icons"; // icon
14
+ import "@base/permission"; // permission control
15
15
 
16
- import * as filters from '@base/filters'; // global filters
16
+ import * as filters from "@base/filters"; // global filters
17
17
 
18
18
  // main.js 文件添加以下代码
19
19
 
20
- import BaseKeepAlive from '@base/utils/keepAlive.js'
20
+ import BaseKeepAlive from "@base/utils/keepAlive.js";
21
21
 
22
- Vue.component('BaseKeepAlive', BaseKeepAlive)
22
+ Vue.component("BaseKeepAlive", BaseKeepAlive);
23
23
 
24
- import VXETable from 'vxe-table';
25
- import 'vxe-table/lib/style.css';
24
+ import VXETable from "vxe-table";
25
+ import "vxe-table/lib/style.css";
26
26
 
27
27
  // 引入扩展插件
28
- import '@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js'
29
- import '@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css'
28
+ import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js";
29
+ import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css";
30
30
 
31
31
  /* // 设置授权信息
32
32
  VXETable.setup({
@@ -39,9 +39,7 @@ VXETable.setup({
39
39
  // }
40
40
  }) */
41
41
 
42
-
43
-
44
- import Vab from '@base/utils/vab';
42
+ import Vab from "@base/utils/vab";
45
43
 
46
44
  Vue.use(Vab);
47
45
 
@@ -50,54 +48,58 @@ Vue.use(VXETable);
50
48
  /* import tablePluns from "@/mixins/table/index.js"
51
49
  VXETable.use(tablePluns) */
52
50
 
53
- import '@base/components/table/index.js';
51
+ import "@base/components/table/index.js";
54
52
 
55
- import drag from '@base/directive/el-drag-dialog/index.js';
53
+ import drag from "@base/directive/el-drag-dialog/index.js";
56
54
 
57
55
  Vue.use(drag.install);
58
56
 
59
- import elDialogCenter from '@base/directive/el-dialog-center/index.js';
57
+ import elDialogCenter from "@base/directive/el-dialog-center/index.js";
60
58
 
61
59
  Vue.use(elDialogCenter.install);
62
60
 
63
- import ErroreBox from '@base/components/errorMsg/index.js';
61
+ import ErroreBox from "@base/components/errorMsg/index.js";
64
62
 
65
63
  Vue.use(ErroreBox);
66
64
 
67
- import ExcelExport from '@base/components/excelExport/index.js';
65
+ import ExcelExport from "@base/components/excelExport/index.js";
68
66
 
69
67
  Vue.use(ExcelExport);
70
68
 
71
- import ExcelImport from '@base/components/excelImport/index.js';
69
+ import ExcelImport from "@base/components/excelImport/index.js";
72
70
 
73
71
  Vue.use(ExcelImport);
74
72
 
75
- import ConfirmDialog from '@base/components/confirmDialog/index.js';
73
+ import ConfirmDialog from "@base/components/confirmDialog/index.js";
76
74
 
77
75
  Vue.use(ConfirmDialog);
78
76
 
79
- import baseAlert from '@base/components/baseAlert/index.js';
77
+ import baseAlert from "@base/components/baseAlert/index.js";
80
78
 
81
79
  Vue.use(baseAlert);
82
80
 
83
- import permission from '@base/directive/permission';
81
+ import permission from "@base/directive/permission";
84
82
 
85
83
  Vue.use(permission);
86
84
 
87
- import VabUpload from '@base/components/VabUpload/index.js';
85
+ import VabUpload from "@base/components/VabUpload/index.js";
88
86
 
89
87
  Vue.use(VabUpload);
90
88
 
91
- Vue.component('baseUpload', () => import('@base/components/VabUpload/view.vue'));
89
+ Vue.component("baseUpload", () =>
90
+ import("@base/components/VabUpload/view.vue")
91
+ );
92
92
 
93
- import baseAttachment from '@base/components/baseAttachment/install';
93
+ import baseAttachment from "@base/components/baseAttachment/install";
94
94
 
95
95
  Vue.use(baseAttachment);
96
- Vue.component('attachmentShowList', () => import('@base/components/baseAttachment/showList'));
96
+ Vue.component("attachmentShowList", () =>
97
+ import("@base/components/baseAttachment/showList")
98
+ );
97
99
 
98
- import '@base/resources/js/base/common.js';
100
+ import "@base/resources/js/base/common.js";
99
101
 
100
- import vxeFilter from '@base/components/table/vxeFilter/index.js';
102
+ import vxeFilter from "@base/components/table/vxeFilter/index.js";
101
103
 
102
104
  Vue.use(vxeFilter);
103
105
 
@@ -105,18 +107,17 @@ import baseTableExport from "@base/components/excelExport/button.vue";
105
107
 
106
108
  Vue.component(baseTableExport.name, baseTableExport);
107
109
 
108
-
109
110
  /* Vue.component('extendedProperties', () => import('@base/components/extendedProperties/view.vue')); */
110
111
 
111
- import LimitNumber from '@base/directive/LimitNumber/index.js';
112
+ import LimitNumber from "@base/directive/LimitNumber/index.js";
112
113
 
113
114
  Vue.use(LimitNumber);
114
115
 
115
- import baseInputNumber from '@base/components/baseInputNumber/index.vue'
116
+ import baseInputNumber from "@base/components/baseInputNumber/index.vue";
116
117
 
117
118
  Vue.component(baseInputNumber.name, baseInputNumber);
118
119
 
119
- import elReadonly from '@base/directive/el-readonly/index.js';
120
+ import elReadonly from "@base/directive/el-readonly/index.js";
120
121
 
121
122
  Vue.use(elReadonly);
122
123
 
@@ -125,23 +126,27 @@ Vue.use(elReadonly);
125
126
  Vue.use(cnPrint);*/
126
127
 
127
128
  /* Vue.component('oplogTable', () => import('@base/components/oplogTable/index.vue')); */
128
- import oplogTable from '@base/components/oplogTable/index.vue'
129
+ import oplogTable from "@base/components/oplogTable/index.vue";
129
130
 
130
131
  Vue.component(oplogTable.name, oplogTable);
131
132
 
132
- import baseInputBatch from '@base/components/baseInputBatch/index.vue'
133
+ import baseInputBatch from "@base/components/baseInputBatch/index.vue";
133
134
 
134
135
  Vue.component(baseInputBatch.name, baseInputBatch);
135
136
 
136
- Vue.component('baseInputExport', () => import('@base/components/baseInputExport/index.vue'));
137
+ Vue.component("baseInputExport", () =>
138
+ import("@base/components/baseInputExport/index.vue")
139
+ );
137
140
 
138
- Vue.component('advancedSearchDialog', () => import('@base/components/advancedSearchDialog/index.vue'));
141
+ Vue.component("advancedSearchDialog", () =>
142
+ import("@base/components/advancedSearchDialog/index.vue")
143
+ );
139
144
 
140
- import baseTabs from '@base/components/baseTabs/index.vue'
145
+ import baseTabs from "@base/components/baseTabs/index.vue";
141
146
 
142
147
  Vue.component(baseTabs.name, baseTabs);
143
148
 
144
- import baseTabPane from '@base/components/baseTabs/baseTabPane.vue'
149
+ import baseTabPane from "@base/components/baseTabs/baseTabPane.vue";
145
150
 
146
151
  Vue.component(baseTabPane.name, baseTabPane);
147
152
 
@@ -153,32 +158,38 @@ Vue.component(vb_tabs.name, vb_tabs);
153
158
  Vue.component(vb_tab_pane.name, vb_tab_pane);
154
159
  Vue.component(xTabs.name, xTabs);
155
160
 
156
- Vue.component('status-tag', () => import('@base/components/statusTag/index.vue'));
161
+ Vue.component("status-tag", () =>
162
+ import("@base/components/statusTag/index.vue")
163
+ );
157
164
 
158
- Vue.component('CodeEditor', () => import('@base/components/code-editor/index.vue'));
165
+ Vue.component("CodeEditor", () =>
166
+ import("@base/components/code-editor/index.vue")
167
+ );
159
168
 
160
- Vue.component('scriptDescriptionButton', () => import('@base/components/scriptDescription/button'));
169
+ Vue.component("scriptDescriptionButton", () =>
170
+ import("@base/components/scriptDescription/button")
171
+ );
161
172
 
162
- Vue.component('scriptTestButton', () => import('@base/components/scriptTest/button'));
173
+ Vue.component("scriptTestButton", () =>
174
+ import("@base/components/scriptTest/button")
175
+ );
163
176
 
164
-
165
- import baseTextarea from '@base/components/base-textarea/index.vue'
177
+ import baseTextarea from "@base/components/base-textarea/index.vue";
166
178
 
167
179
  Vue.component(baseTextarea.name, baseTextarea);
168
180
 
169
- import jsonImport from '@base/components/jsonImport/index.js';
181
+ import jsonImport from "@base/components/jsonImport/index.js";
170
182
 
171
183
  Vue.use(jsonImport);
172
184
 
173
- import langImport from '@base/components/langImport/index.js';
185
+ import langImport from "@base/components/langImport/index.js";
174
186
 
175
187
  Vue.use(langImport);
176
188
 
177
189
  //vform
178
190
  // import '@base/components/xform/utils/directive'
179
191
 
180
-
181
- import i18n from '@base/lang/index.js'
192
+ import i18n from "@base/lang/index.js";
182
193
 
183
194
  /**
184
195
  * If you don't want to use mock-server
@@ -188,28 +199,28 @@ import i18n from '@base/lang/index.js'
188
199
  * Currently MockJs will be used in the production environment,
189
200
  * please remove it before going online ! ! !
190
201
  */
191
- if (process.env.NODE_ENV === 'production') {
202
+ if (process.env.NODE_ENV === "production") {
192
203
  /* const { mockXHR } = require('../mock')
193
204
  mockXHR() */
194
205
  }
195
206
 
196
207
  Vue.use(Element, {
197
- size: Cookies.get('size') || 'medium' // set element-ui default size
208
+ size: Cookies.get("size") || "medium", // set element-ui default size
198
209
  // locale: enLang // 如果使用中文,无需设置,请删除
199
210
  });
200
211
 
201
212
  // register global utility filters
202
- Object.keys(filters).forEach(key => {
213
+ Object.keys(filters).forEach((key) => {
203
214
  Vue.filter(key, filters[key]);
204
215
  });
205
216
 
206
217
  Vue.config.productionTip = false;
207
218
 
208
219
  let vue = new Vue({
209
- el: '#app',
220
+ el: "#app",
210
221
  router,
211
222
  store,
212
223
  i18n,
213
- render: h => h(App)
224
+ render: (h) => h(App),
214
225
  });
215
226
  window.$vueRoot = vue;
package/src/utils/vab.js CHANGED
@@ -330,6 +330,7 @@ install = (Vue, opts = {}) => {
330
330
  "webp",
331
331
  "tga",
332
332
  "svg",
333
+ "vue",
333
334
  ];
334
335
  Vue.prototype.$commonFileUtil = {
335
336
  // 文件类型获取与判断接口
@@ -33,46 +33,32 @@ export function getDetailRowKey(row, index = 0) {
33
33
  return row.zdEn || row.taZdMc || `idx_${row.orders ?? index}`;
34
34
  }
35
35
 
36
- export function sortDetailRows(rows = []) {
36
+ export function sortDetailRowsByZdEn(rows = []) {
37
37
  return [...rows].sort((a, b) => {
38
- const nameA = (a?.zdEn ?? "").toString();
39
- const nameB = (b?.zdEn ?? "").toString();
40
- return nameA.localeCompare(nameB, "zh-CN");
38
+ const aVal = String(a?.zdEn ?? "");
39
+ const bVal = String(b?.zdEn ?? "");
40
+ return aVal.localeCompare(bVal, "zh-CN", {
41
+ numeric: true,
42
+ sensitivity: "base",
43
+ });
41
44
  });
42
45
  }
43
46
 
44
- export function buildDetailRowDiffSet(preRows = [], curRows = []) {
45
- const preMap = new Map();
46
- const curMap = new Map();
47
+ export function buildRowDiffMaps(preCellDiff = {}, curCellDiff = {}) {
48
+ const preRowDiff = {};
49
+ const curRowDiff = {};
47
50
 
48
- preRows.forEach((row, index) => {
49
- preMap.set(getDetailRowKey(row, index), row);
51
+ Object.keys(preCellDiff).forEach((key) => {
52
+ const rowKey = key.split("__")[0];
53
+ preRowDiff[rowKey] = true;
50
54
  });
51
- curRows.forEach((row, index) => {
52
- curMap.set(getDetailRowKey(row, index), row);
53
- });
54
-
55
- const rowDiffSet = new Set();
56
- const allKeys = new Set([...preMap.keys(), ...curMap.keys()]);
57
-
58
- allKeys.forEach((key) => {
59
- const preRow = preMap.get(key);
60
- const curRow = curMap.get(key);
61
55
 
62
- if (!preRow || !curRow) {
63
- rowDiffSet.add(key);
64
- return;
65
- }
66
-
67
- const hasDiff = DETAIL_COMPARE_FIELDS.some(
68
- (field) => !isSameValue(preRow[field], curRow[field])
69
- );
70
- if (hasDiff) {
71
- rowDiffSet.add(key);
72
- }
56
+ Object.keys(curCellDiff).forEach((key) => {
57
+ const rowKey = key.split("__")[0];
58
+ curRowDiff[rowKey] = true;
73
59
  });
74
60
 
75
- return rowDiffSet;
61
+ return { preRowDiff, curRowDiff };
76
62
  }
77
63
 
78
64
  export function buildDetailDiffMaps(preRows = [], curRows = []) {
@@ -64,9 +64,9 @@ import compareMixin from "./compareMixin";
64
64
  import compareBasicSection from "./compareBasicSection.vue";
65
65
  import {
66
66
  buildDetailDiffMaps,
67
- buildDetailRowDiffSet,
67
+ buildRowDiffMaps,
68
68
  getDetailRowKey,
69
- sortDetailRows,
69
+ sortDetailRowsByZdEn,
70
70
  } from "./tableDetailDiff";
71
71
 
72
72
  const zdTypeMap = {
@@ -109,7 +109,10 @@ export default {
109
109
  preCellDiff: {},
110
110
  curCellDiff: {},
111
111
  },
112
- detailRowDiffSet: new Set(),
112
+ detailRowDiff: {
113
+ pre: {},
114
+ cur: {},
115
+ },
113
116
  };
114
117
  },
115
118
  computed: {
@@ -169,33 +172,38 @@ export default {
169
172
  formatTreeFlag(cellValue) {
170
173
  return this.$t1(treeFlagMap[cellValue] || cellValue || "");
171
174
  },
172
- getDetailColumns() {
175
+ getDetailColumns(side) {
176
+ const rowDiffMap = this.detailRowDiff[side] || {};
173
177
  return [
174
178
  {
175
- title: this.$t1("实体字段名称"),
176
- field: "zdEn",
177
- width: 150,
179
+ title: "",
180
+ field: "_diffFlag",
181
+ width: 32,
178
182
  fixed: "left",
183
+ align: "center",
179
184
  slots: {
180
185
  default: ({ row, rowIndex }) => {
181
- const hasDiff = this.hasDetailRowDiff(row, rowIndex);
186
+ const rowKey = getDetailRowKey(row, rowIndex);
187
+ if (!rowDiffMap[rowKey]) return [null];
182
188
  return [
183
- <span class="detail-zd-en-cell">
184
- {hasDiff ? (
185
- <el-tooltip
186
- effect="dark"
187
- content={this.$t1("存在不同项")}
188
- placement="top"
189
- >
190
- <i class="el-icon-warning compare-row-diff-icon" />
191
- </el-tooltip>
192
- ) : null}
193
- <span>{row.zdEn}</span>
194
- </span>,
189
+ <el-tooltip
190
+ enterable={false}
191
+ effect="dark"
192
+ content={this.$t1("存在差异项")}
193
+ placement="top"
194
+ >
195
+ <i class="el-icon-warning compare-row-diff-icon" />
196
+ </el-tooltip>,
195
197
  ];
196
198
  },
197
199
  },
198
200
  },
201
+ {
202
+ title: this.$t1("实体字段名称"),
203
+ field: "zdEn",
204
+ width: 150,
205
+ fixed: "left",
206
+ },
199
207
  {
200
208
  title: this.$t1("数据库表字段名"),
201
209
  field: "taZdMc",
@@ -304,27 +312,33 @@ export default {
304
312
  };
305
313
  },
306
314
  initDetailGrids() {
307
- this.preRows = sortDetailRows(this.compareHData1?.szTaZdMbDTOs || []);
308
- this.curRows = sortDetailRows(this.compareHData2?.szTaZdMbDTOs || []);
309
- this.detailDiff = buildDetailDiffMaps(this.preRows, this.curRows);
310
- this.detailRowDiffSet = buildDetailRowDiffSet(this.preRows, this.curRows);
315
+ const rawPreRows = this.compareHData1?.szTaZdMbDTOs || [];
316
+ const rawCurRows = this.compareHData2?.szTaZdMbDTOs || [];
317
+ this.detailDiff = buildDetailDiffMaps(rawPreRows, rawCurRows);
318
+ const { preRowDiff, curRowDiff } = buildRowDiffMaps(
319
+ this.detailDiff.preCellDiff,
320
+ this.detailDiff.curCellDiff
321
+ );
322
+ this.detailRowDiff = { pre: preRowDiff, cur: curRowDiff };
323
+ this.preRows = sortDetailRowsByZdEn(rawPreRows);
324
+ this.curRows = sortDetailRowsByZdEn(rawCurRows);
311
325
 
312
- const columns = this.getDetailColumns();
313
326
  const baseConfig = {
314
327
  border: true,
315
328
  resizable: true,
316
329
  showOverflow: true,
317
330
  scrollX: { enabled: true },
318
- columns,
319
331
  ...this.getGridSizeConfig(),
320
332
  };
321
333
  this.preGridOption = {
322
334
  ...baseConfig,
335
+ columns: this.getDetailColumns("pre"),
323
336
  data: this.preRows,
324
337
  cellClassName: (params) => this.getPreCellClassName(params),
325
338
  };
326
339
  this.curGridOption = {
327
340
  ...baseConfig,
341
+ columns: this.getDetailColumns("cur"),
328
342
  data: this.curRows,
329
343
  cellClassName: (params) => this.getCurCellClassName(params),
330
344
  };
@@ -358,9 +372,6 @@ export default {
358
372
  getCurCellClassName({ row, column, rowIndex }) {
359
373
  return this.getDetailCellClassName("cur", row, column, rowIndex);
360
374
  },
361
- hasDetailRowDiff(row, rowIndex) {
362
- return this.detailRowDiffSet.has(getDetailRowKey(row, rowIndex));
363
- },
364
375
  getDetailCellClassName(side, row, column, rowIndex) {
365
376
  const field = column.field;
366
377
  if (!field || !row) return "";
@@ -452,18 +463,10 @@ export default {
452
463
  color: #67c23a;
453
464
  }
454
465
 
455
- ::v-deep .detail-zd-en-cell {
456
- display: inline-flex;
457
- align-items: center;
458
- max-width: 100%;
459
-
460
- .compare-row-diff-icon {
461
- flex-shrink: 0;
462
- margin-right: 4px;
463
- font-size: 14px;
464
- color: #e6a23c;
465
- cursor: default;
466
- }
466
+ ::v-deep .compare-row-diff-icon {
467
+ color: #e6a23c;
468
+ font-size: 14px;
469
+ cursor: default;
467
470
  }
468
471
 
469
472
  &.is-section-fullscreen {