agilebuilder-ui 1.0.86 → 1.0.87-temp10

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.
@@ -1224,6 +1224,26 @@ const apis = {
1224
1224
  })
1225
1225
  return result
1226
1226
  },
1227
+ // 获得该列表中,下拉选是选项组的字段信息,返回的key是属性名,value是选项集合
1228
+ getTableSelectOptions(listCode) {
1229
+ const result = {}
1230
+ if (!listCode) {
1231
+ listCode = store.get('_list_code')
1232
+ }
1233
+ const gridParams = store.get(listCode)
1234
+ const columns = gridParams.columns
1235
+ columns.forEach(col => {
1236
+ const prop = col.prop
1237
+ const isDynamicDataSource = isDynamicDataSourceSource(col)
1238
+ if (!isDynamicDataSource && col.valueSet && col.valueSet.length > 0) {
1239
+ result[prop] = {
1240
+ options: col.valueSet,
1241
+ column: col
1242
+ }
1243
+ }
1244
+ })
1245
+ return result
1246
+ },
1227
1247
  // 取消列表的编辑状态
1228
1248
  restoreGridEdit(listCode) {
1229
1249
  if (!listCode) {
@@ -1387,6 +1407,12 @@ const apis = {
1387
1407
  })
1388
1408
  }
1389
1409
  return defaultValueColumnsMap
1410
+ },
1411
+ // 重新刷新子表数据
1412
+ reloadSubTableData(listCode) {
1413
+ const gridParams = store.get(listCode)
1414
+ gridParams.options['subTableData'] = null
1415
+ this.fetchListData()
1390
1416
  }
1391
1417
  }
1392
1418
  export default apis
@@ -269,14 +269,14 @@ const customFormatter = {
269
269
  }
270
270
  if (isPromise(canClick)) {
271
271
  canClick.then((result) => {
272
- this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
272
+ this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
273
273
  })
274
274
  } else {
275
- this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
275
+ this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
276
276
  }
277
277
  }
278
278
  },
279
- doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams) {
279
+ doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column) {
280
280
  let parentFormData = null
281
281
  if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
282
282
  parentFormData = gridParams.options.extraParam.entityMap
@@ -311,6 +311,8 @@ const customFormatter = {
311
311
  openPageParams._rowIndex = rowIndex
312
312
  // 行编辑的记录
313
313
  openPageParams.row = row
314
+ // 列点击时列属性名
315
+ openPageParams._columnProp = column.prop
314
316
  // 通知父页面弹出页面
315
317
  $emit(this, 'open-page', openPageParams)
316
318
  }
@@ -155,15 +155,9 @@
155
155
  @focus="cellEvent('focus', $event)"
156
156
  @input="cellEvent('input', $event, true)"
157
157
  >
158
- <template
159
- v-if="isShowScanIcon"
160
- #append
161
- >
162
- <SuperIcon
163
- iconValue="fa-barcode"
164
- @click="scanClick()"
165
- ></SuperIcon>
166
- </template>
158
+ <template v-if="isShowScanIcon" #append>
159
+ <SuperIcon iconValue="fa-barcode" @click="scanClick()"></SuperIcon>
160
+ </template>
167
161
  </el-input>
168
162
 
169
163
  <el-input
@@ -436,7 +430,7 @@ import {
436
430
  isDynamicDataSourceSource,
437
431
  isEditOptionFunction,
438
432
  otherFilesToStandard,
439
- getControlConfig
433
+ getControlConfig
440
434
  } from './utils'
441
435
  import dynamicSourceSelect from '../../dynamic-source-select/src/dynamic-source-select.vue'
442
436
  import { getEntityFieldValue, setEntityFieldValue } from '../../../src/utils/util'
@@ -554,10 +548,10 @@ export default {
554
548
  const additionalParamMap = getAdditionalParamMap(gridParams)
555
549
  const pageContext = gridParams.options.pageContext
556
550
  const isMobile = isMobileBrowser()
557
-
558
- const componentId = this.listCode+'_'+this.column.prop
551
+
552
+ const componentId = this.listCode + '_' + this.column.prop
559
553
  let scanEnable = false
560
- if(controlConfig.scanEnable){
554
+ if (controlConfig.scanEnable) {
561
555
  scanEnable = true
562
556
  }
563
557
  let userAgent
@@ -570,9 +564,9 @@ export default {
570
564
  userAgent = 'browser'
571
565
  }
572
566
  console.log('superGrid----window.location.protocol---', window.location.protocol)
573
- const isShowScanIcon = isMobile && window.location.protocol === 'https:' ? true: false
574
- const isApk = isMobile && userAgent && userAgent === 'app' ? true: false
575
-
567
+ const isShowScanIcon = isMobile && window.location.protocol === 'https:' ? true : false
568
+ const isApk = isMobile && userAgent && userAgent === 'app' ? true : false
569
+
576
570
  let baseURL = gridParams.options.backendUrl
577
571
  if (!baseURL) {
578
572
  baseURL = window.$vueApp.config.globalProperties.baseURL
@@ -753,7 +747,14 @@ export default {
753
747
  const that = this
754
748
  // 选择文件结束
755
749
  eventBus.$on(this.componentId + '-pickFileDone', (data) => {
756
- console.log('superPage666611---pickFileDone--data.componentId=', data.componentId, 'data.listCode=', data.listCode, 'data=', data)
750
+ console.log(
751
+ 'superPage666611---pickFileDone--data.componentId=',
752
+ data.componentId,
753
+ 'data.listCode=',
754
+ data.listCode,
755
+ 'data=',
756
+ data
757
+ )
757
758
  if (that.$refs.fileUploadRef) {
758
759
  that.$refs.fileUploadRef.pickFileDone(data)
759
760
  }
@@ -766,12 +767,19 @@ export default {
766
767
  })
767
768
  // 扫描结束
768
769
  eventBus.$on(this.componentId + '-scanDone', (data) => {
769
- console.log('superPage666611---scanDone--data.componentId=', data.componentId, 'data.listCode=', data.listCode, 'data=', data)
770
- that.innerValue = data.result
771
- that.blurEvent()
770
+ console.log(
771
+ 'superPage666611---scanDone--data.componentId=',
772
+ data.componentId,
773
+ 'data.listCode=',
774
+ data.listCode,
775
+ 'data=',
776
+ data
777
+ )
778
+ that.innerValue = data.result
779
+ that.blurEvent()
772
780
  })
773
781
  },
774
- destroyed(){
782
+ destroyed() {
775
783
  eventBus.$off(this.componentId + '-pickFileDone')
776
784
  // 上传文件结束
777
785
  eventBus.$off(this.componentId + '-uploadFileDone')
@@ -1080,7 +1088,7 @@ export default {
1080
1088
  param.parent = this.parentFormData
1081
1089
  param.rowIndex = this.rowIndex
1082
1090
  param.additionalParamMap = gridParams.additionalParamMap
1083
- if(gridParams.options.pageContext){
1091
+ if (gridParams.options.pageContext) {
1084
1092
  param.pageContext = gridParams.options.pageContext
1085
1093
  param.configure = gridParams.options.configureObj
1086
1094
  const eventFunc = gridParams.options['eventCallBack'][funName]
@@ -1125,7 +1133,7 @@ export default {
1125
1133
  uploadOnSuccess(response) {
1126
1134
  console.log('superGrid---uploadOnSuccess----response=', response)
1127
1135
  if (response) {
1128
- if(this.isMobile){
1136
+ if (this.isMobile) {
1129
1137
  // 移动端时事件
1130
1138
  if (this.column.fileSet && this.column.fileSet !== '') {
1131
1139
  const fileSetObj = JSON.parse(this.column.fileSet)
@@ -1293,7 +1301,7 @@ export default {
1293
1301
  if (!fileArr) {
1294
1302
  fileArr = []
1295
1303
  }
1296
- responseFiles.forEach(responseFile=>{
1304
+ responseFiles.forEach((responseFile) => {
1297
1305
  const fileObj = this.responseFileToFileObj(fileSetObj, responseFile)
1298
1306
  fileArr.push(fileObj)
1299
1307
  })
@@ -1308,11 +1316,11 @@ export default {
1308
1316
  if (fileSetObj.showNameData.dbName) {
1309
1317
  if (this.row) {
1310
1318
  let showName = ''
1311
- responseFiles.forEach(responseFile=>{
1319
+ responseFiles.forEach((responseFile) => {
1312
1320
  showName = showName + responseFile.name + ','
1313
1321
  })
1314
- if(showName.indexOf(',')>=0){
1315
- showName = showName.substring(0,showName.lastIndexOf(','))
1322
+ if (showName.indexOf(',') >= 0) {
1323
+ showName = showName.substring(0, showName.lastIndexOf(','))
1316
1324
  }
1317
1325
  this.setCellValue(fileSetObj.showNameData.dbName, showName, 'input')
1318
1326
  showNameStr = this.row[fileSetObj.showNameData.dbName]
@@ -1322,11 +1330,11 @@ export default {
1322
1330
  if (fileSetObj.showNameData.name) {
1323
1331
  if (this.row) {
1324
1332
  let showName = ''
1325
- responseFiles.forEach(responseFile=>{
1333
+ responseFiles.forEach((responseFile) => {
1326
1334
  showName = showName + responseFile.name + ','
1327
1335
  })
1328
- if(showName.indexOf(',')>=0){
1329
- showName = showName.substring(0,showName.lastIndexOf(','))
1336
+ if (showName.indexOf(',') >= 0) {
1337
+ showName = showName.substring(0, showName.lastIndexOf(','))
1330
1338
  }
1331
1339
  this.setCellValue(fileSetObj.showNameData.name, showName, 'input')
1332
1340
  showNameStr = this.row[fileSetObj.showNameData.name]
@@ -1339,11 +1347,11 @@ export default {
1339
1347
  if (fileSetObj.serverNameData.dbName) {
1340
1348
  if (this.row) {
1341
1349
  let serverName = ''
1342
- responseFiles.forEach(responseFile=>{
1350
+ responseFiles.forEach((responseFile) => {
1343
1351
  serverName = serverName + responseFile.serverPath + ','
1344
1352
  })
1345
- if(serverName.indexOf(',')>=0){
1346
- serverName = serverName.substring(0,serverName.lastIndexOf(','))
1353
+ if (serverName.indexOf(',') >= 0) {
1354
+ serverName = serverName.substring(0, serverName.lastIndexOf(','))
1347
1355
  }
1348
1356
  this.setCellValue(fileSetObj.serverNameData.dbName, serverName, 'input')
1349
1357
  pathNameStr = this.row[fileSetObj.serverNameData.dbName]
@@ -1353,11 +1361,11 @@ export default {
1353
1361
  if (fileSetObj.serverNameData.name) {
1354
1362
  if (this.row) {
1355
1363
  let serverName = ''
1356
- responseFiles.forEach(responseFile=>{
1364
+ responseFiles.forEach((responseFile) => {
1357
1365
  serverName = serverName + responseFile.serverPath + ','
1358
1366
  })
1359
- if(serverName.indexOf(',')>=0){
1360
- serverName = serverName.substring(0,serverName.lastIndexOf(','))
1367
+ if (serverName.indexOf(',') >= 0) {
1368
+ serverName = serverName.substring(0, serverName.lastIndexOf(','))
1361
1369
  }
1362
1370
  this.setCellValue(fileSetObj.serverNameData.name, serverName, 'input')
1363
1371
  pathNameStr = this.row[fileSetObj.serverNameData.name]
@@ -1609,6 +1617,8 @@ export default {
1609
1617
  }
1610
1618
  this.cellEvent('change', val)
1611
1619
  this.setCellValue(this.column.prop, val, 'change')
1620
+ } else {
1621
+ this.cellEvent('change', arr)
1612
1622
  }
1613
1623
  },
1614
1624
  getDefaultValue(val) {
@@ -1749,17 +1759,17 @@ export default {
1749
1759
  }
1750
1760
  }
1751
1761
  },
1752
- scanClick(){
1762
+ scanClick() {
1753
1763
  console.log('scanClick----userAgent=', this.userAgent)
1754
- if(this.isApk) {
1764
+ if (this.isApk) {
1755
1765
  // 表示是APK中
1756
1766
  const message = {
1757
- type: 'scan',
1758
- componentId: this.componentId,
1759
- systemCode: this.pageContext.systemCode,
1760
- listCode: this.listCode
1761
- }
1762
- window.parent.postMessage(JSON.stringify(message), '*')
1767
+ type: 'scan',
1768
+ componentId: this.componentId,
1769
+ systemCode: this.pageContext.systemCode,
1770
+ listCode: this.listCode
1771
+ }
1772
+ window.parent.postMessage(JSON.stringify(message), '*')
1763
1773
  } else {
1764
1774
  // 表示是移动端浏览器中
1765
1775
  this.isShowBrowserScan = true
@@ -1769,7 +1779,7 @@ export default {
1769
1779
  * 扫描组件时,监听扫描值变化
1770
1780
  */
1771
1781
  watchScanValueChange(newValue) {
1772
- if(this.scanEnable && this.type === 'input'){
1782
+ if (this.scanEnable && this.type === 'input') {
1773
1783
  const valueSet = analysisScanValue(newValue, this.column._scanRuleSets)
1774
1784
  if (valueSet) {
1775
1785
  setScanAnalysisValue(this.row, valueSet.scanSet, valueSet.params)
@@ -655,9 +655,9 @@ export default {
655
655
  (this.column.componentType === 'multiselect' || this.column.componentType === 'select')
656
656
  ) {
657
657
  const isDynamic = isDynamicDataSourceSource(this.column)
658
+ let beforeColumnValue = param.row[this.column.prop]
658
659
  if (!isDynamic) {
659
660
  // 选项组保存时将数组处理为字符串
660
- const beforeColumnValue = param.row[this.column.prop]
661
661
  if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
662
662
  // 如果是数组才需要转换
663
663
  param.row[this.column.prop] = beforeColumnValue.join(',')
@@ -678,54 +678,41 @@ export default {
678
678
  }
679
679
  if (selectDataKey) {
680
680
  // beforeColumnValue是数组值,如果是单选则是字符串
681
- let beforeColumnValue = param.row[this.column.prop]
682
681
  if (this.column.componentType === 'select') {
683
682
  if (selectDataKey !== temp.valueAttribute) {
684
683
  // 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
685
- beforeColumnValue = temp.optionItems.find(
686
- (item) =>
687
- // 当前字段映射的是工厂名称,
688
- // 筛选动态数据源选项值字段对应的当前字段所映射的字段, 例如 根据工厂编码找工厂编码对应的工厂名称
689
- // 找出名称后赋值给当前字段
690
- item[temp.valueAttribute] === beforeColumnValue
691
- )[selectDataKey]
684
+ // 当前字段映射的是工厂名称,
685
+ // 筛选动态数据源选项值字段对应的当前字段所映射的字段, 例如 根据工厂编码找工厂编码对应的工厂名称
686
+ // 找出名称后赋值给当前字段
687
+ const filterValue = temp.optionItems.find((item) => item[temp.valueAttribute] === beforeColumnValue)
688
+ if (filterValue) {
689
+ beforeColumnValue = filterValue[selectDataKey]
690
+ }
692
691
  }
693
- // 如果是单选
694
- // 现在选择时已经赋值,不再需要这里进行赋值
695
- // temp.optionItems.forEach(optionItem => {
696
- // if (optionItem[temp.valueAttribute] === beforeColumnValue) {
697
- // this.$set(param.row, this.column.prop, optionItem[selectDataKey])
698
- // }
699
- // })
700
692
  param.row[this.column.prop] = beforeColumnValue
701
693
  } else {
702
- // 如果是多选,join “ ,” , 并给row赋值
703
- // 现在选择时已经赋值,不再需要这里进行赋值
704
- // const afterColumnValue = []
705
- // temp.optionItems.forEach(optionItem => {
706
- // beforeColumnValue.forEach(value => {
707
- // if (optionItem[temp.valueAttribute] === value) {
708
- // afterColumnValue.push(optionItem[selectDataKey])
709
- // }
710
- // })
711
- // })
712
694
  if (beforeColumnValue && selectDataKey !== temp.valueAttribute) {
695
+ if (typeof beforeColumnValue === 'string') {
696
+ beforeColumnValue = beforeColumnValue.split(',')
697
+ }
713
698
  // 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
714
699
  const t = []
715
700
  beforeColumnValue.forEach((selectItem) => {
716
701
  if (selectDataKey !== temp.valueAttribute) {
717
- t.push(
718
- temp.optionItems.find((option) => option[temp.valueAttribute] === selectItem)[selectDataKey]
719
- )
702
+ const filterValue = temp.optionItems.find((option) => option[temp.valueAttribute] === selectItem)
703
+ if (filterValue) {
704
+ t.push(filterValue[selectDataKey])
705
+ }
720
706
  }
721
707
  })
722
- beforeColumnValue = t
708
+ if (t.length > 0) {
709
+ beforeColumnValue = t
710
+ param.row[this.column.prop] = beforeColumnValue.join(',')
711
+ }
723
712
  }
724
- param.row[this.column.prop] = beforeColumnValue.join(',')
725
713
  }
726
714
  }
727
715
  } else {
728
- const beforeColumnValue = param.row[this.column.prop]
729
716
  if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
730
717
  // 如果是数组才需要转换
731
718
  param.row[this.column.prop] = beforeColumnValue.join(',')
@@ -3071,6 +3071,7 @@ export default {
3071
3071
  listCode: popPageSetting._listCode,
3072
3072
  rowIndex: popPageSetting._rowIndex,
3073
3073
  row: popPageSetting.row,
3074
+ columnProp: popPageSetting._columnProp,
3074
3075
  id: row?(row.ID?row.ID:row.id):null,
3075
3076
  isMobile,
3076
3077
  gridData: isSubTableShowPage
@@ -817,11 +817,16 @@ export function getHeaderAlign(column, gridParams){
817
817
 
818
818
 
819
819
  export function getHeaderLable(column) {
820
+ let label = column.label
820
821
  if (!column.titleValueSet) {
821
- return column.label.replace(/\\n/g, '</br>')
822
+ label = label.replace(/\\n/g, '</br>')
822
823
  } else {
823
- return formatHeader(column)
824
+ label = formatHeader(column)
824
825
  }
826
+ if (label === null || label === undefined || label === '') {
827
+ label = column.prop
828
+ }
829
+ return label
825
830
  }
826
831
 
827
832
  function formatHeader(column) {
package/src/permission.js CHANGED
@@ -151,11 +151,17 @@ router.beforeEach((to, from, next) => {
151
151
  if (!isDevp && devpRoleCodes) {
152
152
  // 表示是开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码,对应运行平台的岗位编码
153
153
  // console.log('开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码时,!isDevp && devpRoleCodes')
154
+ console.log('getDevPlatformPermissions---devpRoleCodes=', devpRoleCodes)
154
155
  return store.dispatch('getDevPlatformPermissions', devpRoleCodes)
155
156
  } else {
156
157
  // 开发平台本身的功能或直接平台功能时
157
158
  // console.log('开发平台本身的功能或直接平台功能时')
158
- return store.dispatch('getCurrentUserPermissions', user.loginName)
159
+ let systemCode = to.query ? to.query.customSystem: null
160
+ if (!systemCode) {
161
+ systemCode = window.$vueApp.config.globalProperties.currentSystem
162
+ }
163
+ console.log('3333systemCode=', systemCode)
164
+ return store.dispatch('getCurrentUserPermissions', {loginName:user.loginName, systemCode})
159
165
  }
160
166
  })
161
167
  .then((permissions) => {
@@ -231,9 +231,12 @@ const user = {
231
231
  },
232
232
 
233
233
  // 获得当前用户权限集合
234
- getCurrentUserPermissions({ commit }, loginName, systemCode) {
234
+ getCurrentUserPermissions({ commit }, param) {
235
235
  return new Promise((resolve, reject) => {
236
+ const loginName = param.loginName
237
+ const systemCode = param.systemCode
236
238
  let storePermissions = getPermissions()
239
+ console.log('getCurrentUserPermissions-----systemCode=', systemCode, 'storePermissions=', storePermissions)
237
240
  // 这个判断会导致资源不会重新加载??
238
241
  if (
239
242
  typeof storePermissions === 'undefined' ||
@@ -218,7 +218,7 @@ export function isDevpAccess() {
218
218
  const postManagementCodes = getPostManagementCodes()
219
219
  // console.log("isDevAccess----postManagementCodes=",postManagementCodes);
220
220
  if(postManagementCodes && postManagementCodes.indexOf(DEV_ROLE_PROJECT_ADMIN_CODE) >= 0 ||
221
- postManagementCodes.contains(DEV_ROLE_PROJECT_VIEWER_CODE) >= 0){
221
+ postManagementCodes.indexOf(DEV_ROLE_PROJECT_VIEWER_CODE) >= 0){
222
222
  // 表示是项目负责人岗位或观察者岗位或平台管理员,且当前登录用户是 devp的应用id
223
223
  return true
224
224
  }