agilebuilder-ui 1.1.52 → 1.1.53-rc1

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.
@@ -1,5 +1,5 @@
1
1
  import { openBlock as r, createElementBlock as t, createCommentVNode as o } from "vue";
2
- import { _ as s } from "./index-0a1887ad.js";
2
+ import { _ as s } from "./index-05ede327.js";
3
3
  const u = ["src"], f = s({ data: () => ({ src: null }), watch: { $route(n, c) {
4
4
  this.src = this.$route.query.src;
5
5
  } }, mounted() {
@@ -1,5 +1,5 @@
1
- import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-0a1887ad.js";
2
- import { resolveComponent as u, openBlock as l, createBlock as b, withCtx as g, createVNode as v, TransitionGroup as L, createElementBlock as p, Fragment as C, renderList as T, createElementVNode as m, toDisplayString as w, normalizeClass as S, createCommentVNode as y } from "vue";
1
+ import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-05ede327.js";
2
+ import { resolveComponent as u, openBlock as d, createBlock as b, withCtx as g, createVNode as v, TransitionGroup as L, createElementBlock as p, Fragment as T, renderList as C, createElementVNode as m, toDisplayString as w, normalizeClass as S, createCommentVNode as y } from "vue";
3
3
  const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ levelList: null }), computed: { levelListWithTitle() {
4
4
  return this.levelList.filter((e) => e.meta.title !== void 0 && e.meta.title !== null);
5
5
  } }, watch: { $route() {
@@ -8,7 +8,7 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
8
8
  this.getBreadcrumb();
9
9
  }, methods: { getBreadcrumb() {
10
10
  const { params: e } = this.$route;
11
- console.log("this.$route.matched==", this.$route.matched);
11
+ this.$route.matched;
12
12
  let t = this.$route.matched.filter((a) => {
13
13
  if (a.name) {
14
14
  var r = _(a.path);
@@ -17,12 +17,12 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
17
17
  });
18
18
  if (t) {
19
19
  let a;
20
- const r = x(), o = window.$vueApp.config.globalProperties.systemNameObj;
21
- o && (a = o[r]), t = [{ path: "/", redirect: "noredirect", meta: { title: a } }].concat(t);
22
- const s = P.get("selectMenu"), d = window.$vueApp.config.globalProperties._selectMenu;
23
- let n;
24
- if (d ? n = d : s && (n = s), n) {
25
- const i = n.substring(0, n.indexOf("~~")), c = n.substring(n.indexOf("~~") + 2);
20
+ const r = x(), n = window.$vueApp.config.globalProperties.systemNameObj;
21
+ n && (a = n[r]), t = [{ path: "/", redirect: "noredirect", meta: { title: a } }].concat(t);
22
+ const s = P.get("selectMenu"), l = window.$vueApp.config.globalProperties._selectMenu;
23
+ let o;
24
+ if (l ? o = l : s && (o = s), o) {
25
+ const i = o.substring(0, o.indexOf("~~")), c = o.substring(o.indexOf("~~") + 2);
26
26
  if (t && t.length > 0) {
27
27
  const $ = t[t.length - 1];
28
28
  this.isShouldConcatLastMenu(c, i, $) && t.push({ path: i, meta: { title: c } });
@@ -35,9 +35,9 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
35
35
  return !(!this.isTitleNotEqual(e, a) || !this.isPathNotEqual(t, a));
36
36
  }, isTitleNotEqual(e, t) {
37
37
  return !(!e || !t.meta || e === t.meta.title || e === this.$t(t.meta.title));
38
- }, isPathNotEqual: (e, t) => !(!e || !t.path || e === t.path) } }, [["render", function(e, t, a, r, o, s) {
39
- const d = u("el-breadcrumb-item"), n = u("el-breadcrumb");
40
- return l(), b(n, { class: "app-breadcrumb", separator: ">" }, { default: g(() => [v(L, { name: "breadcrumb", tag: "span" }, { default: g(() => [(l(!0), p(C, null, T(s.levelListWithTitle, (i, c) => (l(), b(d, { key: i.path + "-" + c }, { default: g(() => [m("span", k, w(e.$t(i.meta.title)), 1)]), _: 2 }, 1024))), 128))]), _: 1 })]), _: 1 });
38
+ }, isPathNotEqual: (e, t) => !(!e || !t.path || e === t.path) } }, [["render", function(e, t, a, r, n, s) {
39
+ const l = u("el-breadcrumb-item"), o = u("el-breadcrumb");
40
+ return d(), b(o, { class: "app-breadcrumb", separator: ">" }, { default: g(() => [v(L, { name: "breadcrumb", tag: "span" }, { default: g(() => [(d(!0), p(T, null, C(s.levelListWithTitle, (i, c) => (d(), b(l, { key: i.path + "-" + c }, { default: g(() => [m("span", k, w(e.$t(i.meta.title)), 1)]), _: 2 }, 1024))), 128))]), _: 1 })]), _: 1 });
41
41
  }], ["__scopeId", "data-v-768a430c"]]), { body: B } = document, E = { watch: { $route(e) {
42
42
  this.device === "mobile" && this.sidebar.opened && h.dispatch("closeSidebar", { withoutAnimation: !1 });
43
43
  } }, beforeMount() {
@@ -76,8 +76,8 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
76
76
  if (e.routePath === "/iframe-page/page") {
77
77
  let a, r = "";
78
78
  if (e.routeQuery)
79
- for (const o in e.routeQuery)
80
- o === "src" ? a = e.routeQuery[o] : r += o + "=" + e.routeQuery[o] + "&";
79
+ for (const n in e.routeQuery)
80
+ n === "src" ? a = e.routeQuery[n] : r += n + "=" + e.routeQuery[n] + "&";
81
81
  a && (t = a), r && (t += "?" + r);
82
82
  } else if (e.routePath.indexOf("http:") < 0 && e.routePath.indexOf("https:") < 0 && (t = "#"), t = e.routePath.indexOf("?") >= 0 ? t + e.routePath + "&" : t + e.routePath + "?", e.routeQuery)
83
83
  for (const a in e.routeQuery)
@@ -87,16 +87,16 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
87
87
  if (e && typeof e.data == "string" && e.data === "refreshTabContent")
88
88
  window.location.reload();
89
89
  else if (e && typeof e.data == "string" && e.data.indexOf("loginTimeout") >= 0)
90
- console.log("tab-content-接收到登录超时的信息---event.data=", e.data), window.parent.postMessage(e.data, "*");
90
+ e.data, window.parent.postMessage(e.data, "*");
91
91
  else if (e && typeof e.data == "string" && e.data === "return-to-system-list") {
92
92
  this.$store.commit("clear_tabs");
93
93
  let t = "_IS_APP_LIST";
94
94
  const a = window.sessionStorage.getItem(t);
95
95
  a !== void 0 && a === "true" ? this.$router.push({ path: "/mms/apps/list" }) : this.$router.push({ path: "/mms/systems/list" });
96
96
  }
97
- } } }, V = ["src"], Q = { key: 1, class: "default-page-tip" }, R = { class: "default-page-tip-msg" }, q = { class: "default-page-tip-item" }, z = { class: "default-page-tip-item" }, j = { class: "main-container" }, W = f({ name: "Layout", components: { Menubar: O, Breadcrumb: A, TabContent: f(N, [["render", function(e, t, a, r, o, s) {
98
- const d = u("el-tab-pane"), n = u("el-tabs");
99
- return e.openTab && e.openTab.length > 0 ? (l(), b(n, { key: 0, modelValue: s.activeIndex, "onUpdate:modelValue": t[0] || (t[0] = (i) => s.activeIndex = i), class: "nav-tab menu-tab-container", closable: "", onTabRemove: s.closeSelectedTag }, { default: g(() => [(l(!0), p(C, null, T(e.openTab, (i) => (l(), b(d, { key: i.code, label: i.name, name: i.code }, { default: g(() => [m("iframe", { ref_for: !0, ref: "tabMainContent", src: s.getFullPath(i), class: "tab-main-content", name: "tab-main-content", frameborder: "0" }, null, 8, V)]), _: 2 }, 1032, ["label", "name"]))), 128))]), _: 1 }, 8, ["modelValue", "onTabRemove"])) : (l(), p("div", Q, [m("div", R, [m("div", q, w(o.defaultPageTipCn), 1), m("div", z, w(o.defaultPageTipEn), 1)])]));
97
+ } } }, V = ["src"], Q = { key: 1, class: "default-page-tip" }, R = { class: "default-page-tip-msg" }, q = { class: "default-page-tip-item" }, z = { class: "default-page-tip-item" }, j = { class: "main-container" }, W = f({ name: "Layout", components: { Menubar: O, Breadcrumb: A, TabContent: f(N, [["render", function(e, t, a, r, n, s) {
98
+ const l = u("el-tab-pane"), o = u("el-tabs");
99
+ return e.openTab && e.openTab.length > 0 ? (d(), b(o, { key: 0, modelValue: s.activeIndex, "onUpdate:modelValue": t[0] || (t[0] = (i) => s.activeIndex = i), class: "nav-tab menu-tab-container", closable: "", onTabRemove: s.closeSelectedTag }, { default: g(() => [(d(!0), p(T, null, C(e.openTab, (i) => (d(), b(l, { key: i.code, label: i.name, name: i.code }, { default: g(() => [m("iframe", { ref_for: !0, ref: "tabMainContent", src: s.getFullPath(i), class: "tab-main-content", name: "tab-main-content", frameborder: "0" }, null, 8, V)]), _: 2 }, 1032, ["label", "name"]))), 128))]), _: 1 }, 8, ["modelValue", "onTabRemove"])) : (d(), p("div", Q, [m("div", R, [m("div", q, w(n.defaultPageTipCn), 1), m("div", z, w(n.defaultPageTipEn), 1)])]));
100
100
  }], ["__scopeId", "data-v-a5252a92"]]) }, mixins: [E], data: () => ({ showMenuRoute: I(), systemCode: null }), computed: { sidebar() {
101
101
  return this.$store.state.app.sidebar;
102
102
  }, device() {
@@ -104,12 +104,12 @@ const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ l
104
104
  }, classObj() {
105
105
  return { hideSidebar: !this.sidebar.opened, openSidebar: this.sidebar.opened, withoutAnimation: this.sidebar.withoutAnimation, mobile: this.device === "mobile" };
106
106
  } }, created() {
107
- this.systemCode = window.$vueApp.config.globalProperties.customSystem, console.log("新菜单组件-----systemCode====", this.systemCode);
107
+ this.systemCode = window.$vueApp.config.globalProperties.customSystem, this.systemCode;
108
108
  }, methods: { handleClickOutside() {
109
109
  this.$store.dispatch("closeSidebar", { withoutAnimation: !1 });
110
- } } }, [["render", function(e, t, a, r, o, s) {
111
- const d = u("menubar"), n = u("breadcrumb"), i = u("tab-content");
112
- return l(), p("div", { class: S([s.classObj, "app-wrapper"]) }, [s.device === "mobile" && s.sidebar.opened ? (l(), p("div", { key: 0, class: "drawer-bg", onClick: t[0] || (t[0] = (...c) => s.handleClickOutside && s.handleClickOutside(...c)) })) : y("", !0), v(d, { "system-code": o.systemCode, collapse: !0, class: "sidebar-container" }, null, 8, ["system-code"]), m("div", j, [o.showMenuRoute ? (l(), b(n, { key: 0 })) : y("", !0), v(i)])], 2);
110
+ } } }, [["render", function(e, t, a, r, n, s) {
111
+ const l = u("menubar"), o = u("breadcrumb"), i = u("tab-content");
112
+ return d(), p("div", { class: S([s.classObj, "app-wrapper"]) }, [s.device === "mobile" && s.sidebar.opened ? (d(), p("div", { key: 0, class: "drawer-bg", onClick: t[0] || (t[0] = (...c) => s.handleClickOutside && s.handleClickOutside(...c)) })) : y("", !0), v(l, { "system-code": n.systemCode, collapse: !0, class: "sidebar-container" }, null, 8, ["system-code"]), m("div", j, [n.showMenuRoute ? (d(), b(o, { key: 0 })) : y("", !0), v(i)])], 2);
113
113
  }], ["__scopeId", "data-v-5c0a6bf6"]]);
114
114
  export {
115
115
  W as default
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as t, openBlock as a, createElementBlock as s, createElementVNode as y, createVNode as l, withCtx as r, createTextVNode as n, toDisplayString as p, createCommentVNode as c, createBlock as h } from "vue";
2
- import { _ as I } from "./index-0a1887ad.js";
2
+ import { _ as I } from "./index-05ede327.js";
3
3
  const g = { style: { "padding-bottom": "10px" } }, k = { key: 0, class: "graphDiv" }, N = I({ name: "TacheSubprocessHistory", data: () => ({ type: "graph", workflowId: null }), created() {
4
4
  const o = this.$route.query.workflowId;
5
5
  o && (this.workflowId = parseInt(o));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agilebuilder-ui",
3
- "version": "1.1.52",
3
+ "version": "1.1.53-rc1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -24,6 +24,14 @@
24
24
  @visible-change="visibleChange"
25
25
  @remove-tag="removeTag(remote, $event)"
26
26
  >
27
+ <template v-if="isSearch" #header>
28
+ <el-checkbox
29
+ v-model="checkEmptyValue"
30
+ @change="changeEmptyValue"
31
+ >
32
+ {{$t('imatrixUIPublicModel.emptyValue')}}
33
+ </el-checkbox>
34
+ </template>
27
35
  <template v-if="descriptionAttribute">
28
36
  <div v-if="optionWidth > 0" :style="{ width: optionWidth + 'px' }">
29
37
  <el-option
@@ -172,6 +180,11 @@ export default {
172
180
  // 下拉框配置宽度
173
181
  optionWidth: {
174
182
  default: 0
183
+ },
184
+ // 是否是查询时
185
+ isSearch: {
186
+ type: Boolean,
187
+ default: false
175
188
  }
176
189
  },
177
190
  // 是否是页面预览, 从页面管理传递
@@ -211,7 +224,8 @@ export default {
211
224
  descriptionAttribute: null,
212
225
  queryParam: {}, // 请求参数,
213
226
  lastValues, // 最后一次的value值,用于判断是否是增加元素
214
- optionItemList: [] // 多选时会多一个saveAll 全选 选项
227
+ optionItemList: [], // 多选时会多一个saveAll 全选 选项
228
+ checkEmptyValue: false // 是否查询空值
215
229
  }
216
230
  },
217
231
  watch: {
@@ -719,11 +733,11 @@ export default {
719
733
  if (this.optionItems && this.optionItems.length > 0) {
720
734
  this.optionItems.forEach((selectItem) => {
721
735
  const addValue = selectItem[sourceColumnName]
722
- if (originalValue !== undefined && originalValue !== null && originalValue !== '') {
723
- originalValue = originalValue + ',' + addValue
724
- } else {
725
- originalValue = addValue
726
- }
736
+ if (originalValue !== undefined && originalValue !== null && originalValue !== '') {
737
+ originalValue = originalValue + ',' + addValue
738
+ } else {
739
+ originalValue = addValue
740
+ }
727
741
  })
728
742
  value = originalValue
729
743
  }
@@ -831,6 +845,13 @@ export default {
831
845
  }
832
846
  this.markValue = JSON.stringify(muMarkValue)
833
847
  }
848
+ },
849
+ changeEmptyValue(newVal) {
850
+ this.$emit('changeEmptyValue', newVal)
851
+ },
852
+ // 清空 空值 勾选,列表查询空值 重置时调用了
853
+ clearEmptyValue(){
854
+ this.checkEmptyValue = false
834
855
  }
835
856
  },
836
857
  emits: [
@@ -841,7 +862,8 @@ export default {
841
862
  'focus',
842
863
  'blur',
843
864
  'visible-change',
844
- 'change'
865
+ 'change',
866
+ 'chnageEmptyValue'
845
867
  ]
846
868
  }
847
869
  </script>
@@ -84,13 +84,16 @@
84
84
  // import { Image } from 'antd';
85
85
  import { Paperclip as ElIconPaperclip, View as ElIconView, Download as ElIconDownload } from '@element-plus/icons-vue'
86
86
  import * as Vue from 'vue'
87
- import { isPlateSys, getSystemFrontendUrl, getRelativeBaseUrl, getKkFilePreviewUrl } from '../../../src/utils/common-util'
88
- import { isImage, getEntityFieldValue } from '../../../src/utils/util'
87
+ import {
88
+ isPlateSys,
89
+ getSystemFrontendUrl,
90
+ getRelativeBaseUrl,
91
+ getKkFilePreviewUrl
92
+ } from '../../../src/utils/common-util'
93
+ import { isImage, getEntityFieldValue, getI18n } from '../../../src/utils/util'
89
94
  import { packageFile } from '../../super-grid/src/utils'
90
95
  import { getToken } from '../../../src/utils/auth'
91
96
  import { getFileIconByName } from '../../../src/utils/file-util'
92
- import { Base64 } from 'js-base64'
93
- import { ElMessage } from 'element-plus'
94
97
  export default {
95
98
  components: {
96
99
  ElIconPaperclip,
@@ -136,7 +139,7 @@ export default {
136
139
  default: false
137
140
  },
138
141
  // 水印配置{isShowWatermark:true/false,content:'xxxxx'}
139
- watermark:{
142
+ watermark: {
140
143
  type: Object,
141
144
  default: () => ({})
142
145
  }
@@ -298,13 +301,13 @@ export default {
298
301
  const myPreviewUrl = originUrl + '&fullfilename=' + showName
299
302
  console.log('myPreviewUrl====', myPreviewUrl)
300
303
  // http://127.0.0.1:8012/onlinePreview
301
- getKkFilePreviewUrl(myPreviewUrl).then(url=>{
304
+ getKkFilePreviewUrl(myPreviewUrl).then((url) => {
302
305
  window.open(url, showName)
303
- })
306
+ }) /
304
307
  // window.$vueApp.config.globalProperties.kkFileViewUrl +
305
308
  // '?url=' +
306
309
  // encodeURIComponent(Base64.encode(myPreviewUrl))
307
- /window.open(previewUrl, showName)
310
+ window.open(previewUrl, showName)
308
311
  console.log('previewUrl====', previewUrl)
309
312
  } else {
310
313
  previewUrl = baseUrl + '/common/fs-upload/preview?jwt=' + token
@@ -327,7 +330,7 @@ export default {
327
330
  const token = getToken()
328
331
  const isShowWatermark = this.watermark.isShowWatermark
329
332
  let watermarkContent = this.watermark?.content
330
- if(!watermarkContent){
333
+ if (!watermarkContent) {
331
334
  watermarkContent = ''
332
335
  }
333
336
  let url = window.$vueApp.config.globalProperties.baseURL + '/common/super-form/downloads?jwt=' + token
@@ -335,7 +338,16 @@ export default {
335
338
  url = window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/downloads?jwt=' + token
336
339
  }
337
340
  url = getRelativeBaseUrl(url)
338
- const src = url + '&showName=' + encodeURI(showName) + '&serverPath=' + serverPath+'&isShowWatermark='+isShowWatermark+'&watermark='+watermarkContent
341
+ const src =
342
+ url +
343
+ '&showName=' +
344
+ encodeURI(showName) +
345
+ '&serverPath=' +
346
+ serverPath +
347
+ '&isShowWatermark=' +
348
+ isShowWatermark +
349
+ '&watermark=' +
350
+ watermarkContent
339
351
  window.open(src)
340
352
  },
341
353
  analysisFileSetObj(fileSetObj, isSql) {
@@ -402,12 +414,20 @@ export default {
402
414
  const fileInfo = this.getFirstFile()
403
415
  this.$emit('delete-file', fileInfo)
404
416
  this.fileList = this.fileList.filter((item) => item.serverPath !== fileInfo.serverPath)
405
- ElMessage.success('文件已删除')
417
+ this.$message({
418
+ showClose: true,
419
+ type: 'success',
420
+ message: getI18n().t('fsUpload.deleteSuccessful')
421
+ })
406
422
  },
407
423
  deleteFile(fileInfo) {
408
424
  this.$emit('delete-file', fileInfo)
409
425
  this.fileList = this.fileList.filter((item) => item.serverPath !== fileInfo.serverPath)
410
- ElMessage.success('文件已删除')
426
+ this.$message({
427
+ showClose: true,
428
+ type: 'success',
429
+ message: getI18n().t('fsUpload.deleteSuccessful')
430
+ })
411
431
  }
412
432
  },
413
433
  emits: ['close', 'delete-file']
@@ -1125,6 +1125,144 @@ const apis = {
1125
1125
  resolve()
1126
1126
  })
1127
1127
  },
1128
+ getDeleteIndexes(dataArr, deleteRows, rowKey) {
1129
+ const indexes = []
1130
+ dataArr.forEach((row, index) => {
1131
+ if (indexes.length === deleteRows.length) return
1132
+ for (const delRow of deleteRows) {
1133
+ if (row[rowKey] === delRow[rowKey]) {
1134
+ indexes.push(index)
1135
+ break
1136
+ }
1137
+ }
1138
+ })
1139
+ return indexes.sort((a, b) => b - a)
1140
+ },
1141
+ batchDeleteSubTableRowApi(listCode, deleteRows, rowKey) {
1142
+ return new Promise((resolve, reject) => {
1143
+ deleteRows = deleteRows || []
1144
+ if (!deleteRows.length) {
1145
+ window.$vueApp.config.globalProperties.$message({
1146
+ showClose: true,
1147
+ message: getI18n().t('imatrixUIMessage.pleaseSelectDeleteData'),
1148
+ type: 'warning'
1149
+ })
1150
+ resolve()
1151
+ return
1152
+ }
1153
+ listCode = listCode || store.get('_list_code')
1154
+ const gridParams = store.get(listCode)
1155
+ let canDelete = true
1156
+ // 删除行记录前的回调
1157
+ if (isEditOptionFunction('beforeDelete', listCode)) {
1158
+ const isSubTableShowPage = gridParams.isSubTableShowPage
1159
+ // 每页显示多少条
1160
+ const pageSize = gridParams.pagination && gridParams.pagination.pageSize
1161
+ const gridData = isSubTableShowPage ? gridParams.subTableData : gridParams.gridData
1162
+ const isMobile = this.isMobile
1163
+ if (gridParams.pageContext) {
1164
+ canDelete = gridParams.options.lineEditOptions.beforeDelete.call(this, {
1165
+ deleteRows: deleteRows,
1166
+ gridData,
1167
+ isMobile,
1168
+ baseURL: this.baseURL,
1169
+ totalData: isSubTableShowPage ? gridParams.gridData : null,
1170
+ pageSize,
1171
+ additionalParamMap: gridParams.additionalParamMap,
1172
+ pageContext: gridParams.pageContext,
1173
+ configureObj: gridParams.configureObj
1174
+ })
1175
+ } else {
1176
+ canDelete = gridParams.options.lineEditOptions.beforeDelete.call(
1177
+ this,
1178
+ deleteRows,
1179
+ gridData,
1180
+ isMobile,
1181
+ this.baseURL,
1182
+ isSubTableShowPage ? gridParams.gridData : null,
1183
+ pageSize,
1184
+ gridParams.additionalParamMap
1185
+ )
1186
+ }
1187
+ }
1188
+ if (canDelete === undefined || canDelete === true) {
1189
+ const deleteIndexs = []
1190
+ if (gridParams.isSubTableShowPage !== undefined && gridParams.isSubTableShowPage === true) {
1191
+ // 子表集合添加该新建的行。会触发watch subTableData的监控
1192
+ gridParams.isChangePage = true
1193
+ const indexes = this.getDeleteIndexes(gridParams.subTableData, deleteRows, rowKey)
1194
+ for (const idx of indexes) {
1195
+ gridParams.subTableData.splice(idx, 1)
1196
+ }
1197
+ } else {
1198
+ const indexes = this.getDeleteIndexes(gridParams.gridData, deleteRows, rowKey)
1199
+ for (const idx of indexes) {
1200
+ gridParams.gridData.splice(idx, 1)
1201
+ gridParams.orgGridData.splice(idx, 1)
1202
+ }
1203
+ }
1204
+ // TODO 注释下面的代码,是因为表单子表删除记录时会造成未保存新增的记录的字段被清空的问题,不知道当时为什么要加这个代码
1205
+ // Object.assign(gridParams.gridData, gridParams.orgGridData)
1206
+ gridParams.$lastSaveRowIndex = null
1207
+ gridParams.$rowIndex = null
1208
+ gridParams.isEditRow = false
1209
+ window.$vueApp.config.globalProperties.$message({
1210
+ showClose: true,
1211
+ message: getI18n().t('superGrid.deleteSuccessful'),
1212
+ type: 'success'
1213
+ })
1214
+ if (gridParams.gridData.length === 0) {
1215
+ if (
1216
+ gridParams.options &&
1217
+ gridParams.options.isDefaultShowEdit !== null &&
1218
+ gridParams.options.isDefaultShowEdit !== undefined &&
1219
+ gridParams.options.isDefaultShowEdit === true
1220
+ ) {
1221
+ // 表示没有记录时,需要创建新行
1222
+ this.createRow(listCode)
1223
+ }
1224
+ }
1225
+ if (gridParams.isMulitiSelect) {
1226
+ gridParams.superGrid?.clearSelection?.()
1227
+ }
1228
+ gridParams.isCreateRow = false
1229
+ if (isRestore === undefined || !isRestore) {
1230
+ // 表示是删除操作,执行删除记录后回调
1231
+ if (isEditOptionFunction('afterDelete', listCode)) {
1232
+ const isSubTableShowPage = gridParams.isSubTableShowPage
1233
+ // 每页显示多少条
1234
+ const pageSize = gridParams.pagination && gridParams.pagination.pageSize
1235
+ const isMobile = this.isMobile
1236
+ if (gridParams.pageContext) {
1237
+ gridParams.options.lineEditOptions.afterDelete.call(this, {
1238
+ deleteRows: deleteRows,
1239
+ gridData: isSubTableShowPage ? gridParams.subTableData : gridParams.gridData,
1240
+ isMobile,
1241
+ baseURL: this.baseURL,
1242
+ totalData: isSubTableShowPage ? gridParams.gridData : null,
1243
+ pageSize,
1244
+ additionalParamMap: gridParams.additionalParamMap,
1245
+ pageContext: gridParams.pageContext,
1246
+ configureObj: gridParams.configureObj
1247
+ })
1248
+ } else {
1249
+ gridParams.options.lineEditOptions.afterDelete.call(
1250
+ this,
1251
+ deleteRows,
1252
+ isSubTableShowPage ? gridParams.subTableData : gridParams.gridData,
1253
+ isMobile,
1254
+ this.baseURL,
1255
+ isSubTableShowPage ? gridParams.gridData : null,
1256
+ pageSize,
1257
+ gridParams.additionalParamMap
1258
+ )
1259
+ }
1260
+ }
1261
+ }
1262
+ }
1263
+ resolve()
1264
+ })
1265
+ },
1128
1266
  // 行编辑时,点击自定义组件时,使当前行获得焦点
1129
1267
  focus(rowIndex, listCode) {
1130
1268
  setCurrentRow(rowIndex, listCode)
@@ -1461,11 +1599,11 @@ const apis = {
1461
1599
  getCustomFunc(funcName) {
1462
1600
  window.$PageUtil.getCustomFunc(this.pageContext, funcName)
1463
1601
  },
1464
- addRequiredClass(fieldName,listCode, rowIndex, pageNum) {
1602
+ addRequiredClass(fieldName, listCode, rowIndex, pageNum) {
1465
1603
  const gridParams = store.get(listCode)
1466
- if (this.isFormSubTable && this.isSubTableShowPage){
1604
+ if (this.isFormSubTable && this.isSubTableShowPage) {
1467
1605
  rowIndex = rowIndex - 1
1468
- if(pageNum !== this.currentPage){
1606
+ if (pageNum !== this.currentPage) {
1469
1607
  this.currentPage = pageNum
1470
1608
  this.changePage(pageNum)
1471
1609
  }
@@ -1477,7 +1615,7 @@ const apis = {
1477
1615
  * @param {Array} searchableColumns 查询字段集合
1478
1616
  * @param {object} searchData 查询值对象。例如:{'DEPT_CODE':'xxx','DEPT_NAME':'xxxx'}
1479
1617
  */
1480
- handleSearch(searchableColumns, searchData){
1618
+ handleSearch(searchableColumns, searchData) {
1481
1619
  const searchForm = this.packageSearchParamNormalType(searchableColumns, searchData)
1482
1620
  this.doSearch(searchForm)
1483
1621
  }
@@ -34,7 +34,7 @@
34
34
  @change-required="changeRequired"
35
35
  @open-page="openPageEvent"
36
36
  />
37
- <div v-else :class=" (options?.configureObj?.props?.base?.columnEditable ?? false) ? 'column-text-main' : ''">
37
+ <div v-else :class="options?.configureObj?.props?.base?.columnEditable ?? false ? 'column-text-main' : ''">
38
38
  <div
39
39
  v-if="
40
40
  lineEdit.editable &&
@@ -1274,7 +1274,14 @@ export default {
1274
1274
  }
1275
1275
  }
1276
1276
  },
1277
- emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
1277
+ emits: [
1278
+ 'refresData',
1279
+ 'refresPortData',
1280
+ 'refresPortsData',
1281
+ 'refresMainTableFields',
1282
+ 'prohibitToEdit',
1283
+ 'deleteFormSubTableRow'
1284
+ ]
1278
1285
  }
1279
1286
  </script>
1280
1287
 
@@ -12,7 +12,7 @@
12
12
  :min-width="getColumnWidth()"
13
13
  >
14
14
  <template v-slot:header>
15
- <span v-if="!column.customHeader" :class="{ is_req: isFieldRequired() }">
15
+ <span v-if="!column.customHeader" :class="{ is_req: isFieldRequired() }" class="normal-column-header">
16
16
  <span :title="$escapeHtml(label)" class="cell--span required__label" v-html="$escapeHtml(label)" />
17
17
  </span>
18
18
  <component
@@ -23,9 +23,18 @@
23
23
  :grid-data="gridData"
24
24
  :current-page="currentPage"
25
25
  />
26
- <el-icon v-if="isShowAdd" style="font-size: 20px; color: #409eff" @click="createFormSubTableRow">
27
- <CirclePlus />
28
- </el-icon>
26
+ <span style="margin-left: 5px">
27
+ <el-icon v-if="isShowAdd" class="normal-column-header normal-column-header-icon" @click="createFormSubTableRow">
28
+ <CirclePlus />
29
+ </el-icon>
30
+ <el-icon
31
+ v-if="isShowDelete"
32
+ class="normal-column-header normal-column-header-icon"
33
+ @click="deleteFormSubTableRow"
34
+ >
35
+ <Remove />
36
+ </el-icon>
37
+ </span>
29
38
  </template>
30
39
  <template v-slot="scope">
31
40
  <!-- :pagination="pagination" -->
@@ -49,8 +58,8 @@
49
58
  :row-index="scope.$index"
50
59
  :line-edit="lineEdit"
51
60
  :custom-format="customFormat"
52
- :class="isValidateError(scope.row,scope.$index)?'required_bg required-corner':''"
53
- :style="isValidateError(scope.row,scope.$index)?'display:block;':''"
61
+ :class="isValidateError(scope.row, scope.$index) ? 'required_bg required-corner' : ''"
62
+ :style="isValidateError(scope.row, scope.$index) ? 'display:block;' : ''"
54
63
  @open-page="openPageEvent"
55
64
  @refresData="refresData"
56
65
  @refresh-list="refreshList"
@@ -63,7 +72,7 @@
63
72
  </el-table-column>
64
73
  </template>
65
74
  <script>
66
- import { CirclePlus, ZoomIn as ElIconZoomIn } from '@element-plus/icons-vue'
75
+ import { CirclePlus, ZoomIn as ElIconZoomIn, Remove } from '@element-plus/icons-vue'
67
76
  import { $emit, $off, $on } from '../../utils/gogocodeTransfer'
68
77
  import { getColumnValues, isRequiredEdit, getContentAlign, getHeaderAlign, getHeaderLable } from './utils'
69
78
  import DynamicInput from './dynamic-input.vue'
@@ -78,7 +87,7 @@ import RichEditorViewer from '../../rich-editor/viewer.vue'
78
87
  import GridIcon from './components/grid-icon.vue'
79
88
  import NormalColumnContent from './normal-column-content.vue'
80
89
  import eventBus from './eventBus'
81
- // border:1px solid red;padding: 10px;
90
+ // border:1px solid red;padding: 10px;
82
91
  export default {
83
92
  components: {
84
93
  DynamicInput,
@@ -164,7 +173,9 @@ export default {
164
173
  headerAlign: 'left', // 表头对齐方式
165
174
  isFormSubTable: false, // 是否是表单子表
166
175
  subTableCanAdd: true, // 表单子表时是否有新增权限
176
+ subTableCanDelete: true, // 表单子表时是否有删除权限
167
177
  isShowAdd: false, // 是否显示表头的新增按钮
178
+ isShowDelete: false, // 是否显示表头的删除按钮
168
179
  cellWidth: null,
169
180
  parentFormData,
170
181
  options,
@@ -267,13 +278,13 @@ export default {
267
278
  if (gridParams && gridParams.options && gridParams.options.isFormSubTable) {
268
279
  this.isFormSubTable = gridParams.options.isFormSubTable
269
280
  }
270
- if (
271
- gridParams &&
272
- gridParams.options &&
273
- gridParams.options.subTableCanAdd !== undefined &&
274
- gridParams.options.subTableCanAdd !== null
275
- ) {
276
- this.subTableCanAdd = gridParams.options.subTableCanAdd
281
+ if (gridParams && gridParams.options) {
282
+ if (gridParams.options.subTableCanAdd !== undefined && gridParams.options.subTableCanAdd !== null) {
283
+ this.subTableCanAdd = gridParams.options.subTableCanAdd
284
+ }
285
+ if (gridParams.options.subTableCanDelete !== undefined && gridParams.options.subTableCanDelete !== null) {
286
+ this.subTableCanDelete = gridParams.options.subTableCanDelete
287
+ }
277
288
  }
278
289
  const align = getContentAlign(this.column, gridParams)
279
290
  if (align) {
@@ -294,6 +305,14 @@ export default {
294
305
  this.subTableCanAdd &&
295
306
  gridParams.options &&
296
307
  gridParams.options.showOperationButton
308
+
309
+ this.isShowDelete =
310
+ this.isFormSubTable &&
311
+ this.column.prop === 'operation' &&
312
+ this.subTableCanDelete &&
313
+ gridParams.options &&
314
+ gridParams.options.showOperationButton &&
315
+ gridParams.isMulitiSelect
297
316
  },
298
317
  mounted() {
299
318
  if (this.column.prop === 'operation') {
@@ -336,6 +355,10 @@ export default {
336
355
  console.log('触发了行新建')
337
356
  this.createRow(this.listCode)
338
357
  },
358
+ deleteFormSubTableRow() {
359
+ console.log('触发了行批量删除')
360
+ $emit(this, 'batchDeleteSubTableRow')
361
+ },
339
362
  getColumnWidth() {
340
363
  if (this.column && this.column.prop === 'operation' && !this.column.width) {
341
364
  // 表示操作列,宽度固定
@@ -362,14 +385,30 @@ export default {
362
385
  console.log('normalColumn----openPageEvent----', openPageParams)
363
386
  this.$emit('open-page', openPageParams)
364
387
  },
365
- isValidateError(row,rowIndex) {
388
+ isValidateError(row, rowIndex) {
366
389
  // const gridParams = store.get(this.listCode)
367
- console.log('row.validateErrorField-----',row)
368
390
  return this.isFormSubTable && row && row['validateErrorField'] && row['validateErrorField'] === this.column.prop
369
391
  }
370
392
  },
371
- emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
393
+ emits: [
394
+ 'refresData',
395
+ 'refresPortData',
396
+ 'refresPortsData',
397
+ 'refresMainTableFields',
398
+ 'prohibitToEdit',
399
+ 'deleteFormSubTableRow'
400
+ ]
372
401
  }
373
402
  </script>
403
+ <style lang="scss" scoped>
404
+ .normal-column-header {
405
+ display: inline-flex;
406
+ vertical-align: middle;
407
+ }
374
408
 
375
- <style lang="scss" scoped></style>
409
+ .normal-column-header-icon {
410
+ font-size: 20px;
411
+ color: #409eff;
412
+ cursor: pointer;
413
+ }
414
+ </style>