vue2-client 1.8.452 → 1.8.455

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,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.452",
3
+ "version": "1.8.455",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -695,7 +695,7 @@ export default {
695
695
  flashModal (show = 'None') {
696
696
  const bool = show === 'None' ? !this.visible : !!show
697
697
  if (bool && this.option.length === 0) {
698
- getDictionaryParam().then(res => {
698
+ getDictionaryParam(true).then(res => {
699
699
  this.option = res
700
700
  })
701
701
  }
@@ -367,7 +367,7 @@ export default {
367
367
  flashModal (show = 'None') {
368
368
  const bool = show === 'None' ? !this.visible : !!show
369
369
  if (bool && this.option.length === 0) {
370
- getDictionaryParam().then(res => {
370
+ getDictionaryParam(true).then(res => {
371
371
  this.option = res
372
372
  })
373
373
  }
@@ -14,6 +14,7 @@
14
14
  @updateImg="updateImg"
15
15
  @selectRow="selectRow"
16
16
  ref="main"
17
+ :env="env"
17
18
  :use-oss-for-img="false"
18
19
  :config-name="configName"
19
20
  :show-img-in-cell="true"
@@ -36,7 +37,10 @@ export default {
36
37
  XReport: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
37
38
  },
38
39
  props: {
39
-
40
+ env: {
41
+ type: String,
42
+ default: 'prod'
43
+ }
40
44
  },
41
45
  data () {
42
46
  return {
@@ -67,6 +71,7 @@ export default {
67
71
  isInAModal: () => { return true }
68
72
  }
69
73
  },
74
+ inject: ['getComponentByName'],
70
75
  computed: {
71
76
  businessTitle () {
72
77
  return this.businessType + this.title
@@ -102,8 +107,13 @@ export default {
102
107
  this.visible = false
103
108
  this.$emit('close')
104
109
  },
105
- getComponentByName (name) {
106
- return this.$refs.main.getComponentByName(name)
110
+ getComponentByNameCur (name) {
111
+ const innerRef = this.getComponentByName(name)
112
+ if (innerRef) {
113
+ return innerRef
114
+ } else {
115
+ return this.$refs.main.getComponentByName(name)
116
+ }
107
117
  },
108
118
  async onSubmit () {
109
119
  if (this.$refs.main?.config?.confirmFunction) {
@@ -115,11 +125,14 @@ export default {
115
125
  const result = executeStrFunctionByContext(this, func, [])
116
126
  if (result instanceof Promise) {
117
127
  result.then((res) => {
118
- if (!res) return
128
+ if (!res) {
129
+ this.close()
130
+ return
131
+ }
119
132
  let messageType = 'success'
120
133
  // 如果传递了组件名字 自动调用刷新
121
134
  if (res?.name) {
122
- const waitRefreshRef = this.getComponentByName(res.name)
135
+ const waitRefreshRef = this.getComponentByNameCur(res.name)
123
136
  if (waitRefreshRef) {
124
137
  waitRefreshRef.refresh()
125
138
  } else {
@@ -62,6 +62,10 @@ export default {
62
62
  type: String,
63
63
  default: undefined
64
64
  },
65
+ env: {
66
+ type: String,
67
+ default: 'prod'
68
+ },
65
69
  // 每列显示数量
66
70
  column: {
67
71
  type: Number,
@@ -134,7 +138,7 @@ export default {
134
138
  }
135
139
  this.realData = result
136
140
  this.loading = false
137
- })
141
+ }, this.env === 'dev')
138
142
  },
139
143
  // 文字格式化
140
144
  formatText (value) {
@@ -132,7 +132,7 @@
132
132
  :key="item.value"
133
133
  :value="item.value">
134
134
  <!-- 徽标(badge) -->
135
- <x-badge :badge-key="attr.keyName" :replaceText="item.text" :value="item.value"/>
135
+ <x-badge :badge-key="attr.keyName" :replaceText="item.text" :value="item.value" :service-name="serviceName" :env="env"/>
136
136
  </a-select-option>
137
137
  </template>
138
138
  </template>
@@ -1009,7 +1009,7 @@ export default {
1009
1009
  formData.append('f_operator', this.currUser ? this.currUser.username : '')
1010
1010
 
1011
1011
  // 上传文件
1012
- await upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }).then(res => {
1012
+ await upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }, this.env === 'dev').then(res => {
1013
1013
  this.form[this.attr.model] = res.data.id
1014
1014
  this.form.t_f_path = res.data.f_downloadpath
1015
1015
  }).catch(error => {
@@ -4,7 +4,7 @@
4
4
  title="示例表单查询"
5
5
  :queryParamsName="queryParamsName"
6
6
  :fixedAddForm="fixedAddForm"
7
- service-name="af-gaslink"
7
+ service-name="af-revenue"
8
8
  @action="action"
9
9
  ref="xFormTable">
10
10
  </x-form-table>
@@ -35,7 +35,7 @@ export default {
35
35
  data () {
36
36
  return {
37
37
  // 查询配置名称
38
- queryParamsName: 'vehicleManageCRUD',
38
+ queryParamsName: 'UserFilesListCRUD',
39
39
  // 新增表单固定值
40
40
  fixedAddForm: {},
41
41
  // 是否显示详情抽屉
@@ -60,6 +60,10 @@ export default {
60
60
  type: String,
61
61
  default: undefined
62
62
  },
63
+ env: {
64
+ type: String,
65
+ default: 'prod'
66
+ },
63
67
  queryParamsName: {
64
68
  type: String,
65
69
  default: 'none'
@@ -102,7 +106,7 @@ export default {
102
106
  importTemplate () {
103
107
  downloadImportExcel({
104
108
  queryParamsName: this.queryParamsName
105
- }, this.serviceName).then(res => {
109
+ }, this.serviceName, this.env === 'dev').then(res => {
106
110
  if (!res || !res.value) {
107
111
  this.$message.warn('导入模板不存在,请检查配置')
108
112
  return
@@ -138,7 +142,7 @@ export default {
138
142
  formData.append('file', fileList[0])
139
143
  formData.append('queryParamsName', this.queryParamsName)
140
144
  formData.append('userData', JSON.stringify(userData))
141
- importData(formData).then(res => {
145
+ importData(formData, this.serviceName, this.env === 'dev').then(res => {
142
146
  this.fileList = []
143
147
  this.$message.success(res.msg || res)
144
148
  this.open = false
@@ -66,6 +66,7 @@
66
66
  ref="XReportDesign"
67
67
  id="printReady"
68
68
  :server-name="serverName"
69
+ :env="env"
69
70
  :show-images="hasImages"
70
71
  :image-list="imageList">
71
72
  </XReportDesign>
@@ -73,6 +74,7 @@
73
74
  </template>
74
75
  <!-- 弹出框 -->
75
76
  <x-add-report
77
+ :env="env"
76
78
  ref="xAddReport"
77
79
  />
78
80
  </div>
@@ -24,6 +24,7 @@
24
24
  :queryParamsName="cell.slotConfig"
25
25
  :configName="cell.slotConfig"
26
26
  :countVisible="false"
27
+ :env="env"
27
28
  />
28
29
  </template>
29
30
  </template>
@@ -17,6 +17,7 @@
17
17
  v-on="getEventHandlers(tab)"
18
18
  @hook:mounted="(h)=>onComponentMounted(h,tab,index)"
19
19
  :config-name="tab.slotConfig"
20
+ :env="env"
20
21
  />
21
22
  </a-card>
22
23
  </a-tab-pane>
@@ -55,7 +56,7 @@ export default {
55
56
  getConfig () {
56
57
  getConfigByName(this.configName, this.serverName, res => {
57
58
  this.config = res.data
58
- })
59
+ }, this.env === 'dev')
59
60
  },
60
61
  runLogic,
61
62
  getConfigByNameAsync,
@@ -99,7 +100,7 @@ export default {
99
100
  images: param.images
100
101
  }
101
102
  })
102
- })
103
+ }, this.env === 'dev')
103
104
  }
104
105
  },
105
106
  },
@@ -113,6 +114,10 @@ export default {
113
114
  type: String,
114
115
  default: undefined
115
116
  },
117
+ env: {
118
+ type: String,
119
+ default: 'prod'
120
+ },
116
121
  // 本地配置,调试用
117
122
  localConfig: {
118
123
  type: Object,
@@ -5,40 +5,48 @@
5
5
  <span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
6
6
  <a-space>
7
7
  <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
8
- <a-button v-if="!buttonState || buttonState.add && buttonRendering('add')" type="primary" @click="add">
8
+ <a-button v-if="buttonState.add && buttonRendering('add')" type="primary" @click="add">
9
9
  <a-icon type="plus"/>新增
10
10
  </a-button>
11
- <a-button v-if="!buttonState || buttonState.move && buttonRendering('move')" type="primary" @click="move">
11
+ <a-button v-if="buttonState.move && buttonRendering('move')" type="primary" @click="move">
12
12
  <a-icon type="plus"/>添加
13
13
  </a-button>
14
14
  <a-button
15
- v-if="!buttonState || buttonState.edit && buttonRendering('edit')"
15
+ v-if="buttonState.edit && buttonRendering('edit')"
16
16
  :disabled="!isModify"
17
17
  :loading="editLoading"
18
18
  class="btn-success"
19
19
  type="dashed"
20
20
  @click="edit()">
21
- <a-icon :style="iconStyle" type="edit"/>修改
21
+ <a-icon :style="iconStyle" type="form"/>修改
22
22
  </a-button>
23
23
  <a-button
24
- v-if="!buttonState || buttonState.delete && buttonRendering('delete')"
24
+ v-if="buttonState.delete && buttonRendering('delete')"
25
25
  :disabled="!isDelete"
26
26
  type="danger"
27
27
  @click="deleteItem">
28
28
  <a-icon :style="iconStyle" type="delete"/>删除
29
29
  </a-button>
30
30
  <a-button
31
- v-if="!buttonState || buttonState.import && buttonRendering('import')"
31
+ v-if="buttonState.import && buttonRendering('import')"
32
32
  type="dashed"
33
33
  @click="importData">
34
34
  <a-icon :style="iconStyle" type="import"/>导入
35
35
  </a-button>
36
- <a-button
37
- v-if="!buttonState || buttonState.import && buttonRendering('editRow')"
38
- type="dashed"
39
- @click="()=>editRow = true">
40
- <a-icon :style="iconStyle" type="import"/>行编辑
41
- </a-button>
36
+ <template
37
+ v-if="buttonState.import && buttonRendering('editRow')">
38
+ <a-button
39
+ v-if="isEditMode"
40
+ class="ant-btn-hover"
41
+ @click="()=>isEditMode = !isEditMode">
42
+ <a-icon :style="iconStyle" type="save"/>保存
43
+ </a-button>
44
+ <a-button
45
+ v-else
46
+ @click="()=>isEditMode = !isEditMode">
47
+ <a-icon :style="iconStyle" type="edit"/>行编辑
48
+ </a-button>
49
+ </template>
42
50
  <a-dropdown v-if="!buttonState || buttonState.export && buttonRendering('export')">
43
51
  <a-menu slot="overlay">
44
52
  <a-menu-item :disabled="selectedRowKeys.length === 0" key="1" @click="handleExport(true)"><a-icon
@@ -110,26 +118,24 @@
110
118
  v-for="(item, c_index) in tableColumns"
111
119
  :slot="item.dataIndex"
112
120
  slot-scope="text, record, index">
121
+ <template v-if="isEditMode && getFromItem(item.dataIndex)">
122
+ <!-- 根据 formItems 中的输入类型显示内容 -->
123
+ <!-- <x-form-item-->
124
+ <!-- v-for="formItem in formItems"-->
125
+ <!-- v-if="formItem.model === item.dataIndex"-->
126
+ <!-- :form="record"-->
127
+ <!-- :attr="formItem"-->
128
+ <!-- v-model="record[item.dataIndex]"-->
129
+ <!-- :key="formItem.model"-->
130
+ <!-- />-->
131
+ </template>
113
132
  <!-- 序号列 -->
114
133
  <span v-if="item.slotType === 'index'" :key="'index-' + c_index">
115
134
  {{ index + 1 }}
116
135
  </span>
117
136
  <!-- 文本溢出省略(ellipsis) -->
118
137
  <span v-if="item.slotType === 'ellipsis'" :key="'ellipsis-' + c_index">
119
- <template v-if="isEditMode && formItems.some(formItem => formItem.model === item.dataIndex)">
120
- <!-- 根据 formItems 中的输入类型显示内容 -->
121
- <x-form-item
122
- v-for="formItem in formItems"
123
- v-if="formItem.model === item.dataIndex"
124
- :form="record"
125
- :attr="formItem"
126
- v-model="record[item.dataIndex]"
127
- :key="formItem.model"
128
- />
129
- </template>
130
- <template v-else>
131
- <ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
132
- </template>
138
+ <ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
133
139
  </span>
134
140
  <!-- 徽标(badge) -->
135
141
  <span v-else-if="item.slotType === 'badge'" :key="'badge-' + c_index">
@@ -221,6 +227,7 @@
221
227
  @ok="importExcelOk"
222
228
  :title="title"
223
229
  :service-name="serviceName"
230
+ :env="env"
224
231
  :query-params-name="queryParamsName"
225
232
  >
226
233
  <template #importExcelSlot>
@@ -366,9 +373,7 @@ export default {
366
373
  // 允许看板模式
367
374
  allowCardMode: false,
368
375
  // 看板模式配置
369
- cardModeConfig: undefined,
370
- // 是否开启行编辑
371
- editRow: false
376
+ cardModeConfig: undefined
372
377
  }
373
378
  },
374
379
  props: {
@@ -430,6 +435,11 @@ export default {
430
435
  window.removeEventListener('resize', this.handleResize)
431
436
  },
432
437
  methods: {
438
+ getFromItem (model) {
439
+ const aa = this.formItems.find(item => item.model === model)
440
+ console.log(aa)
441
+ return this.formItems.find(item => item.model === model)
442
+ },
433
443
  importExcelOk () {
434
444
  this.refresh(true)
435
445
  this.$emit('importExcelOk')
@@ -466,7 +476,6 @@ export default {
466
476
  const {
467
477
  // 查询参数对象, 用于没有对应查询配置文件名时
468
478
  queryParams,
469
- tableEdit,
470
479
  tableColumns,
471
480
  buttonState,
472
481
  buttonPermissions,
@@ -485,9 +494,6 @@ export default {
485
494
  } = params
486
495
  this.showSummary = Object.keys(tableSummaryMap).length > 0
487
496
  this.queryParams = queryParams
488
- if (tableEdit) {
489
- this.isEditMode = tableEdit
490
- }
491
497
  this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
492
498
  if (this.tableColumns.length === 0) {
493
499
  return
@@ -970,4 +976,8 @@ export default {
970
976
  .footer_sum_item {
971
977
  white-space: nowrap;
972
978
  }
979
+ .ant-btn-hover {
980
+ border-color: @primary-color;
981
+ color: @primary-color;
982
+ }
973
983
  </style>
@@ -111,7 +111,7 @@ if (props.configName) {
111
111
  // 如果数据源是 logic
112
112
  getData()
113
113
  }
114
- })
114
+ }, props.env === 'dev')
115
115
  }
116
116
 
117
117
  const emit = defineEmits(['onSelect'])
@@ -185,7 +185,7 @@ export default {
185
185
  },
186
186
  async created () {
187
187
  if (this.configName) {
188
- this.config = await getConfigByNameAsync(this.configName, this.serviceName)
188
+ this.config = await getConfigByNameAsync(this.configName, this.serviceName, this.env === 'dev')
189
189
  } else if (this.configValue) {
190
190
  this.config = this.configValue
191
191
  } else {
@@ -83,8 +83,8 @@ routerResource.example = {
83
83
  {
84
84
  path: 'default',
85
85
  name: '示例页面',
86
- // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
87
- component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
86
+ component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
87
+ // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
88
88
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
89
89
  meta: {
90
90
  // 菜单中不显示
@@ -126,7 +126,7 @@ export function getConfigByLogic (logicName, parameter, serviceName = process.en
126
126
  * @param serviceName 命名空间名称
127
127
  * @param isDev 是否是开发环境
128
128
  */
129
- export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
129
+ export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev = true) {
130
130
  let apiPre = '/api/'
131
131
  if (isDev) {
132
132
  apiPre = '/devApi/'
package/vue.config.js CHANGED
@@ -30,7 +30,7 @@ const revenue = 'http://aote-office.8866.org:31567'
30
30
  module.exports = {
31
31
  devServer: {
32
32
  // development server port 8000
33
- port: 8001,
33
+ port: 8020,
34
34
  // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
35
35
  proxy: {
36
36
  // '/apply-image': {