agilebuilder-ui 1.1.14 → 1.1.16-tmp1

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-42d5d61b.js";
2
+ import { _ as s } from "./index-cd2cc1c6.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,4 +1,4 @@
1
- import { _ as v, c as $, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-42d5d61b.js";
1
+ import { _ as v, c as $, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-cd2cc1c6.js";
2
2
  import { resolveComponent as m, openBlock as l, createBlock as b, withCtx as g, createVNode as w, TransitionGroup as L, createElementBlock as p, Fragment as T, renderList as C, createElementVNode as u, toDisplayString as y, createCommentVNode as f, normalizeClass as S } from "vue";
3
3
  const A = { class: "no-redirect" }, k = v({ name: "Breadcrumb", data: () => ({ levelList: null }), computed: { levelListWithTitle() {
4
4
  return this.levelList.filter((e) => e.meta.title !== void 0 && e.meta.title !== null);
@@ -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-42d5d61b.js";
2
+ import { _ as I } from "./index-cd2cc1c6.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.14",
3
+ "version": "1.1.16-tmp1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
package/packages/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import '../src/utils/insert_css' // 公共样式库
1
2
  // 依次导入组件库的各个组件
2
3
  import Breadcrumb from './breadcrumb'
3
4
  import DepartmentTree from './department-tree'
@@ -22,6 +22,7 @@ import eventBus from './eventBus'
22
22
  import { isPromise } from '../../../src/utils/common-util'
23
23
  import { updateWithPageValue } from '../../../src/utils/jump-page-utils'
24
24
  import { getGuId } from '../../../src/utils/guid.js';
25
+ import { ElMessageBox } from 'element-plus';
25
26
 
26
27
  const apis = {
27
28
  // 列表工具栏控件刷新列表数据。添加该方法解决工具栏值清空后,列表内容没有还原问题
@@ -135,7 +136,6 @@ const apis = {
135
136
  // 新建行
136
137
  createRow(listCode, row, options) {
137
138
  return new Promise((resolve, reject) => {
138
- debugger;
139
139
  if (!listCode) {
140
140
  listCode = store.get('_list_code')
141
141
  }
@@ -420,6 +420,58 @@ const apis = {
420
420
  }
421
421
  }
422
422
  },
423
+ isLastEditRowSaveMessage(listCode) {
424
+ if (!listCode) {
425
+ listCode = store.get('_list_code')
426
+ }
427
+ const gridParams = store.get(listCode)
428
+ if (!isLastEditRowSave(listCode)) {
429
+ // 最后编辑的一行没有保存,则提示
430
+ window.$vueApp.config.globalProperties.$message({
431
+ showClose: true,
432
+ message: getI18n().t('superGrid.pleaseSaveLine', {
433
+ row: gridParams.$rowIndex + 1
434
+ }),
435
+ type: 'warning'
436
+ })
437
+ }
438
+ },
439
+ // 切换行编辑时候提示
440
+ confirmBeforeSwitchingRow(listCode, callback) {
441
+ if (!listCode) {
442
+ listCode = store.get('_list_code')
443
+ }
444
+ const { t } = getI18n()
445
+ const gridParams = store.get(listCode)
446
+ const rowIndex = gridParams.$rowIndex
447
+ if (!isLastEditRowSave(listCode)) {
448
+ ElMessageBox.confirm(
449
+ t('superGrid.rowEditMessageBox.content'), // 当前行有未保存的修改,你是否要切换编辑行?
450
+ t('superGrid.rowEditMessageBox.title'), // 操作确认
451
+ {
452
+ distinguishCancelAndClose: true,
453
+ confirmButtonText: t('superGrid.rowEditMessageBox.confirmButton'), // 提交修改
454
+ cancelButtonText: t('superGrid.rowEditMessageBox.cancelButton'), // 放弃修改
455
+ showClose: true,
456
+ beforeClose: (action, instance, done) => {
457
+ if (action === 'confirm') {
458
+ this.saveRow(rowIndex, listCode).then((res) => {
459
+ // this.editRow(rowIndex, listCode, true)
460
+ callback?.('confirm');
461
+ done();
462
+ })
463
+ } else if (action === 'cancel') {
464
+ this.restoreCurrentRow(rowIndex, listCode)
465
+ callback?.('cancel');
466
+ done();
467
+ } else if (action === 'close') {
468
+ done();
469
+ }
470
+ },
471
+ }
472
+ )
473
+ }
474
+ },
423
475
  // 编辑行
424
476
  editRow(rowIndex, listCode, isSaveCallback) {
425
477
  if (!listCode) {
@@ -2,7 +2,8 @@
2
2
  <div style="width: 100%">
3
3
  <!--添加:key="column.prop+'_'+rowIndex"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
4
4
  <dynamic-input
5
- v-if="(lineEdit.editable && isEditable && row.$editing && !isContentViewText) || isShowForm"
5
+ v-if="isEditing || isShowForm"
6
+ ref="dynamicRef"
6
7
  v-model:value="row[column.prop]"
7
8
  :class="requiredClass"
8
9
  :column="column"
@@ -20,6 +21,7 @@
20
21
  :row="row"
21
22
  :row-index="rowIndex"
22
23
  :type="column.componentType"
24
+ @keyup.enter="clearAllEditing"
23
25
  @findIndex="findIndex(rowIndex)"
24
26
  @focus="onFocus(rowIndex)"
25
27
  @prohibit-to-edit="prohibitToEdit"
@@ -32,7 +34,11 @@
32
34
  @change-required="changeRequired"
33
35
  @open-page="openPageEvent"
34
36
  />
35
- <span v-else>
37
+ <div v-else class="column-text-main">
38
+ <div v-if="lineEdit.editable && isEditable && !disabled && !isContentViewText" class="column-text-edit-main" @click="onEditing">
39
+ <el-icon :size="14" color="#409eff"><Edit /></el-icon>
40
+ <span v-if="!row[column.prop]" table-column-placeholder>请点击输入</span>
41
+ </div>
36
42
  <span v-if="column.operations" class="grid-operation-buttons">
37
43
  <span
38
44
  v-for="(operation, operationIndex) in column.operations"
@@ -337,7 +343,7 @@
337
343
  $escapeHtml(getLabel(row, rowIndex))
338
344
  }}</span>
339
345
  </span>
340
- </span>
346
+ </div>
341
347
  <view-image-dialog v-if="showSingleImgFlag" :file-list="fileList" @close="showSingleImgFlag = false" />
342
348
  <rich-editor-viewer
343
349
  v-if="showRichEditorViewer"
@@ -375,6 +381,8 @@ import FsPreview from '../../fs-preview'
375
381
  import RichEditorViewer from '../../rich-editor/viewer.vue'
376
382
  import GridIcon from './components/grid-icon.vue'
377
383
  import { formatScanRuleSets } from './scan-util.ts'
384
+ import storeVuex from '../../../src/store';
385
+
378
386
  export default {
379
387
  components: {
380
388
  DynamicInput,
@@ -518,6 +526,37 @@ export default {
518
526
  }
519
527
  },
520
528
  computed: {
529
+ $rowGuId() {
530
+ return `${this.row.$rowDataGuId ?? this.row.id ?? this.rowIndex}`
531
+ },
532
+ // 字段唯一标识
533
+ $rowColumnDataGuId() {
534
+ return `${this.$rowGuId}_${this.column.prop}`
535
+ },
536
+ // 手动触发编辑状态
537
+ isEditing() {
538
+ try {
539
+ // 没权限
540
+ if (!this.hasEditPermission) return
541
+ // 检测到单选修改模式
542
+ if (storeVuex.getters.isEditing(this.$rowColumnDataGuId)) return true
543
+ // 判定不是子表情况
544
+ if (!this.isFormSubTable) {
545
+ if (this.row.$editing) {
546
+ // 检测是否是单元格同一行
547
+ if (storeVuex.getters.isRowEditing(this.$rowGuId)) return false
548
+ return true
549
+ }
550
+ }
551
+ return this.row.$editing;
552
+ } catch (error) {
553
+ return false
554
+ }
555
+ },
556
+ // 基础编辑权限
557
+ hasEditPermission() {
558
+ return this.lineEdit.editable && this.isEditable && !this.isContentViewText
559
+ },
521
560
  // lineEdit() {
522
561
  // let isLineEdit = false
523
562
  // if (this.listCode) {
@@ -534,6 +573,15 @@ export default {
534
573
  ...mapGetters(['preventReclick'])
535
574
  },
536
575
  watch: {
576
+ // 取消行时候
577
+ 'row.$editing': {
578
+ deep: true,
579
+ handler(newValue) {
580
+ if([false].includes(newValue)) {
581
+ this.clearAllEditing()
582
+ }
583
+ }
584
+ },
537
585
  isSql: {
538
586
  deep: true,
539
587
 
@@ -710,6 +758,79 @@ export default {
710
758
  methods: {
711
759
  ...customFormatter,
712
760
  ...apis,
761
+ // 清理所有手动编辑
762
+ clearAllEditing() {
763
+ if (this.hasEditPermission) {
764
+ storeVuex?.dispatch?.('clearAllEditing')
765
+ }
766
+ },
767
+ // 手动编辑触发
768
+ onEditing(event) {
769
+ if (this.hasEditPermission && !this.isEditing) {
770
+ event.stopPropagation()
771
+
772
+ const onEditing = () => {
773
+ this.clearAllEditing()
774
+ storeVuex?.dispatch?.('setRowEditing', {
775
+ $rowDataGuId: this.$rowColumnDataGuId,
776
+ isEditing: true
777
+ })
778
+ setTimeout(this.focusBottomInput, 400)
779
+ }
780
+
781
+ if(!this.isFormSubTable) {
782
+ // 非子表
783
+ if (storeVuex.getters.isConfigEditing) {
784
+ if (storeVuex.getters.isRowEditing(this.$rowGuId)) {
785
+ onEditing()
786
+ } else {
787
+ this.isLastEditRowSaveMessage(this.listCode)
788
+ // this.confirmBeforeSwitchingRow(this.listCode, () => { })
789
+ }
790
+ } else {
791
+ // 如果不是子表 则 开启 编辑模式
792
+ this.editRow(this.rowIndex, this.listCode, true)
793
+ onEditing()
794
+ }
795
+ } else {
796
+ // 取消所有列编辑状态
797
+ this.restoreGridEdit(this.listCode)
798
+ // 子表
799
+ onEditing()
800
+ }
801
+ }
802
+ },
803
+ // 默认聚焦渲染组件
804
+ focusBottomInput() {
805
+ this.$nextTick(() => {
806
+ try {
807
+ const getOffsetParent = (selectorAll) => {
808
+ return selectorAll ? Array.from(this.$refs.dynamicRef.$el.querySelectorAll(selectorAll)).filter(control => !!control.offsetParent) : [];
809
+ }
810
+
811
+ let visibleFormControls = getOffsetParent('.el-select, .el-date-picker, .el-upload');
812
+ if (visibleFormControls.length) {
813
+ visibleFormControls[0].click()
814
+ } else {
815
+ visibleFormControls = getOffsetParent('input, textarea');
816
+ if (visibleFormControls.length > 0) {
817
+ const bottomControl = visibleFormControls.reduce((prev, current) => {
818
+ return current.getBoundingClientRect().bottom > prev.getBoundingClientRect().bottom
819
+ ? current
820
+ : prev;
821
+ });
822
+ if (['INPUT', 'TEXTAREA'].includes(bottomControl.tagName)) {
823
+ bottomControl.focus();
824
+ bottomControl.select();
825
+ }
826
+ }
827
+
828
+ }
829
+ } catch (error) {
830
+ console.error(error)
831
+ }
832
+ })
833
+ },
713
834
  getFileObj(fileSet) {
714
835
  if (fileSet) {
715
836
  return JSON.parse(fileSet)
@@ -1056,4 +1177,25 @@ export default {
1056
1177
  content: '*';
1057
1178
  color: #f56c6c;
1058
1179
  }
1180
+ .column-text-main {
1181
+ display: flex;
1182
+ align-items: center;
1183
+ gap: 10px;
1184
+
1185
+ .column-text-edit-main {
1186
+ display: flex;
1187
+ align-items: center;
1188
+ gap: 10px;
1189
+
1190
+ &::after {
1191
+ content: ' ';
1192
+ position: absolute;
1193
+ left: 0;
1194
+ top: 0;
1195
+ right: 0;
1196
+ bottom: 0;
1197
+ cursor: pointer;
1198
+ }
1199
+ }
1200
+ }
1059
1201
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div data-v="1.0.0" :style="subTableStyle">
2
+ <div data-v="1.0.0" :style="subTableStyle" @click="onClickTableMain">
3
3
  <search-form
4
4
  v-if="!isFormSubTable && hasLoadedColumns && query && query.showType === 'embedded'"
5
5
  v-show="!isMobile || (isMobile && isShowMobileSearch)"
@@ -906,6 +906,10 @@ export default {
906
906
  ...publicMethods,
907
907
  ...superGridService,
908
908
  ...apis,
909
+ onClickMain() {
910
+ // 清理编辑选中
911
+ storeVuex?.dispatch?.('clearAllEditing')
912
+ },
909
913
  isDeleteChange(boole) {
910
914
  this.isDelete = boole
911
915
  },
@@ -1320,6 +1324,11 @@ export default {
1320
1324
  },
1321
1325
  changeRowStyle(param) {
1322
1326
  // param的格式:{row, rowIndex}
1327
+
1328
+ // 新增表格编辑背景颜色
1329
+ if (param.row.$editing) {
1330
+ return { background: `var(--el-table-row-hover-bg-color)` }
1331
+ }
1323
1332
  const gridParams = store.get(this.code)
1324
1333
  if (this.lineEdit && this.lineEdit.editable) {
1325
1334
  if (param.rowIndex === gridParams.$rowIndex) {
@@ -2207,7 +2216,8 @@ export default {
2207
2216
  },
2208
2217
  getSearchParam() {
2209
2218
  const searchParam = {
2210
- code: this.code
2219
+ code: this.code,
2220
+ tableName: this.tableName
2211
2221
  }
2212
2222
  const gridParams = store.get(this.code)
2213
2223
  const pagination = this.getPaginationInfo()
@@ -88,6 +88,12 @@ const cn = {
88
88
  },
89
89
  // 列表组件
90
90
  superGrid: {
91
+ rowEditMessageBox: {
92
+ title: "操作确认",
93
+ content: "当前行有未保存的修改,是否进行保存修改切换?",
94
+ confirmButton: "保存修改",
95
+ cancelButton: "放弃修改"
96
+ },
91
97
  columnConfig: '字段配置',
92
98
  pleaseSaveOrCancelEditingLine: '请先保存或撤销编辑第 {row} 行数据',
93
99
  pleaseSaveLine: '请先保存第 {row} 行数据',
@@ -89,6 +89,12 @@ const en = {
89
89
  mustFill: '{label} must fill'
90
90
  },
91
91
  superGrid: {
92
+ rowEditMessageBox: {
93
+ title: "Operation Confirmation",
94
+ content: "There are unsaved modifications in the current row. Do you want to save the modifications and switch?",
95
+ confirmButton: "Save edit",
96
+ cancelButton: "Discard edit"
97
+ },
92
98
  columnConfig: 'Column Config',
93
99
  pleaseSaveOrCancelEditingLine:
94
100
  'Please Save Or Cancel Editing Line {row} Data First',
@@ -4,6 +4,10 @@ const getters = {
4
4
  windowWidth: (state) => state.app.windowWidth,
5
5
  windowHeight: (state) => state.app.windowHeight,
6
6
  isMobileResize: (state) => state.app.isMobileResize,
7
+ tableEditingDatas: (state) => state.table.tableEditingDatas,
8
+ isConfigEditing: (state) => state.table.tableEditingDatas.length > 0,
9
+ isEditing: (state) => ($rowDataGuId) => state.table.tableEditingDatas.includes($rowDataGuId),
10
+ isRowEditing: (state) => ($rowGuId) => state.table.tableEditingDatas.some(v => v.includes($rowGuId)),
7
11
  token: (state) => state.user.token,
8
12
  name: (state) => state.user.name,
9
13
  // routers: state => state.permission.routers,
@@ -1,6 +1,7 @@
1
1
  import * as Vue from 'vue'
2
2
  import * as Vuex from 'vuex'
3
3
  import app from './modules/app'
4
+ import table from './modules/table'
4
5
  import user from './modules/user'
5
6
  import permission from './modules/permission'
6
7
  import tabContent from './modules/tab-content'
@@ -9,6 +10,7 @@ import getters from './getters'
9
10
  const store = Vuex.createStore({
10
11
  modules: {
11
12
  app,
13
+ table,
12
14
  user,
13
15
  permission,
14
16
  tabContent,
@@ -0,0 +1,76 @@
1
+ const app = {
2
+ state: {
3
+ tableEditingDatas: [], // 开启编辑 表格$rowDataGuId
4
+ },
5
+ mutations: {
6
+ /**
7
+ * 切换行数据的编辑状态
8
+ * @param {Object} state - 当前状态对象
9
+ * @param {string} $rowDataGuId - 行数据的唯一标识
10
+ */
11
+ toggleRowEditing(state, $rowDataGuId) {
12
+ if (state.tableEditingDatas.includes($rowDataGuId)) {
13
+ state.tableEditingDatas = state.tableEditingDatas.filter(id => id !== $rowDataGuId)
14
+ } else {
15
+ state.tableEditingDatas = [...state.tableEditingDatas, $rowDataGuId]
16
+ }
17
+ },
18
+ /**
19
+ * 直接设置行数据的编辑状态
20
+ * @param {Object} state - 当前状态对象
21
+ * @param {Object} payload - 包含行数据唯一标识和编辑状态的对象
22
+ * @param {string} payload.$rowDataGuId - 行数据的唯一标识
23
+ * @param {boolean} payload.isEditing - 编辑状态
24
+ */
25
+ setRowEditing(state, { $rowDataGuId, isEditing = false }) {
26
+ if ($rowDataGuId) {
27
+ if (isEditing) {
28
+ if (!state.tableEditingDatas.includes($rowDataGuId)) {
29
+ state.tableEditingDatas = [...state.tableEditingDatas, $rowDataGuId];
30
+ }
31
+ } else {
32
+ state.tableEditingDatas = state.tableEditingDatas.filter(id => id!== $rowDataGuId);
33
+ }
34
+ }
35
+ },
36
+ /**
37
+ * 清理所有编辑状态
38
+ * @param {Object} state - 当前状态对象
39
+ */
40
+ clearAllEditing(state) {
41
+ state.tableEditingDatas = [];
42
+ }
43
+ },
44
+ actions: {
45
+ /**
46
+ * 触发切换行数据编辑状态的操作
47
+ * @param {Object} context - 上下文对象
48
+ * @param {string} $rowDataGuId - 行数据的唯一标识
49
+ */
50
+ toggleEditingData({ commit }, $rowDataGuId) {
51
+ commit('toggleRowEditing', $rowDataGuId)
52
+ },
53
+ /**
54
+ * 触发直接设置行数据编辑状态的操作
55
+ * @param {Object} context - 上下文对象
56
+ * @param {Object} payload - 包含行数据唯一标识和编辑状态的对象
57
+ * @param {string} payload.$rowDataGuId - 行数据的唯一标识
58
+ * @param {boolean} payload.isEditing - 编辑状态
59
+ */
60
+ setRowEditing({ commit }, payload) {
61
+ commit('setRowEditing', payload);
62
+ },
63
+ closeRowEditing({ commit }, payload) {
64
+ commit('setRowEditing', payload);
65
+ },
66
+ /**
67
+ * 触发清理所有编辑状态的操作
68
+ * @param {Object} context - 上下文对象
69
+ */
70
+ clearAllEditing({ commit }) {
71
+ commit('clearAllEditing');
72
+ }
73
+ },
74
+ }
75
+
76
+ export default app
@@ -10,7 +10,8 @@ import {
10
10
  setToken,
11
11
  removeProjectSettings,
12
12
  removeProjectCode,
13
- setTheme
13
+ setTheme,
14
+ removeSystemCacheUrl
14
15
  } from '../../utils/auth'
15
16
 
16
17
  import {
@@ -205,6 +206,7 @@ const user = {
205
206
  removeDevpPermissions()
206
207
  removeProjectSettings()
207
208
  removeProjectCode()
209
+ removeSystemCacheUrl()
208
210
  resolve(data)
209
211
  })
210
212
  .catch((error) => {
@@ -38,6 +38,10 @@
38
38
  overflow-wrap: break-word;
39
39
  }
40
40
 
41
+ [table-column-placeholder] {
42
+ color: var(--el-text-color-placeholder, #a8abb2);
43
+ }
44
+
41
45
  .yx-flex-wrap {
42
46
  display: flex;
43
47
  justify-content: flex-start;
@@ -284,3 +288,9 @@
284
288
  }
285
289
  }
286
290
  }
291
+
292
+ .el-descriptions {
293
+ .el-descriptions__content{
294
+ position: relative;
295
+ }
296
+ }
@@ -50,8 +50,7 @@
50
50
  font-size: 0.9rem;
51
51
  font-weight: bold;
52
52
  text-align: left;
53
- padding: 9px 0px 9px 20px;
54
- display: flex;
53
+ padding: 9px 20px;
55
54
  align-items: center;
56
55
  }
57
56
 
@@ -178,10 +178,11 @@ function getSystemCacheUrlByCode(systemCode) {
178
178
  }
179
179
 
180
180
  function getSystemCacheUrl() {
181
- let systemUrlJson = getCookieCache(currentSystemUrlKey)
182
- if (!systemUrlJson) {
183
- systemUrlJson = getSessionCache(currentSystemUrlKey)
184
- }
181
+ // let systemUrlJson = getCookieCache(currentSystemUrlKey)
182
+ // if (!systemUrlJson) {
183
+ // systemUrlJson = getSessionCache(currentSystemUrlKey)
184
+ // }
185
+ let systemUrlJson = localStorage.getItem(currentSystemUrlKey)
185
186
  if (systemUrlJson) {
186
187
  return JSON.parse(systemUrlJson)
187
188
  }
@@ -190,14 +191,16 @@ function getSystemCacheUrl() {
190
191
  function setSystemCacheUrl(systemUrlObj) {
191
192
  if (systemUrlObj) {
192
193
  const systemUrlStr = JSON.stringify(systemUrlObj)
193
- setSessionCache(currentSystemUrlKey, systemUrlStr)
194
- setCookieCache(currentSystemUrlKey, systemUrlStr)
194
+ localStorage.setItem(currentSystemUrlKey, systemUrlStr)
195
+ // setSessionCache(currentSystemUrlKey, systemUrlStr)
196
+ // setCookieCache(currentSystemUrlKey, systemUrlStr)
195
197
  }
196
198
  }
197
199
 
198
200
  function removeSystemCacheUrl() {
199
- removeSessionCache(currentSystemUrlKey)
200
- removeCookieCache(currentSystemUrlKey)
201
+ // removeSessionCache(currentSystemUrlKey)
202
+ // removeCookieCache(currentSystemUrlKey)
203
+ localStorage.removeItem(currentSystemUrlKey)
201
204
  }
202
205
 
203
206
  function getLanguage() {
package/src/utils/auth.js CHANGED
@@ -143,6 +143,10 @@ export function removeProjectCode() {
143
143
  authApi.removeCookieCache('_PROJECT_CDOE')
144
144
  }
145
145
 
146
+ export function removeSystemCacheUrl() {
147
+ authApi.removeSystemCacheUrl()
148
+ }
149
+
146
150
  export function getRunCurrentRole() {
147
151
  let runCurrentRoleKey = '_RUN_CURRENT_ROLE'
148
152
  if(!isDevpSystem()){
@@ -160,4 +164,5 @@ export function clearPermission() {
160
164
 
161
165
  removeAllSystemPermissions()
162
166
  removePublishControl()
167
+ removeSystemCacheUrl()
163
168
  }
@@ -546,25 +546,26 @@ async function handlePlateSysLang(currentLanguage) {
546
546
  }
547
547
  }
548
548
 
549
- export function setProjectSetting() {
550
- const projectSettingCache = Cookies.get('PROJECT_SETTINGS')
551
- let projectSettings = null
552
- if (projectSettingCache) {
553
- projectSettings = JSON.parse(projectSettingCache)
554
- this.setLogoUrl(projectSettings)
555
- } else {
556
- this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/cfg/project-settings').then((data) => {
557
- Cookies.set('PROJECT_SETTINGS', JSON.stringify(data))
558
- projectSettings = data
559
- })
560
- }
561
- if (projectSettings.browserImageUuid) {
562
- const linkElement = document.getElementById('ambBrowserIcon')
563
- if (linkElement) {
564
- linkElement.href = window.$vueApp.config.globalProperties.baseAPI + '/cfg/project/icon/browserIcon'
565
- }
566
- }
567
- }
549
+ // export function setProjectSetting() {
550
+ // const projectSettingCache = Cookies.get('PROJECT_SETTINGS')
551
+ // let projectSettings = null
552
+ // if (projectSettingCache) {
553
+ // projectSettings = JSON.parse(projectSettingCache)
554
+ // // TODO:工具方法中没有this,这个代码会报错,先注释该方法,没找到调用它的地方
555
+ // this.setLogoUrl(projectSettings)
556
+ // } else {
557
+ // window.$vueApp.config.globalProperties.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/cfg/project-settings').then((data) => {
558
+ // Cookies.set('PROJECT_SETTINGS', JSON.stringify(data))
559
+ // projectSettings = data
560
+ // })
561
+ // }
562
+ // if (projectSettings.browserImageUuid) {
563
+ // const linkElement = document.getElementById('ambBrowserIcon')
564
+ // if (linkElement) {
565
+ // linkElement.href = window.$vueApp.config.globalProperties.baseAPI + '/cfg/project/icon/browserIcon'
566
+ // }
567
+ // }
568
+ // }
568
569
 
569
570
  // 动态加载css
570
571
  export function loadCSS() {
@@ -694,3 +695,24 @@ export function isLogoutTimeout(event) {
694
695
  }
695
696
  return isTimeout
696
697
  }
698
+
699
+ export function cacheSystemUrl() {
700
+ return new Promise((resolve, reject) => {
701
+ const systemUrls = window.$authApi.getSystemCacheUrl()
702
+ if(!systemUrls){
703
+ window.$vueApp.config.globalProperties.$http
704
+ .get(
705
+ window.$vueApp.config.globalProperties.baseAPI +
706
+ '/component/business-systems/without-plate'
707
+ )
708
+ .then((urlMap) => {
709
+ if (urlMap) {
710
+ window.$authApi.setSystemCacheUrl(urlMap)
711
+ }
712
+ resolve()
713
+ })
714
+ } else {
715
+ resolve()
716
+ }
717
+ })
718
+ }