mooho-base-admin-plus 0.4.10 → 0.4.13

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": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "0.4.10",
4
+ "version": "0.4.13",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "dotnetVersion": "1.4.0",
7
7
  "license": "MIT",
@@ -2,10 +2,10 @@
2
2
  <div>
3
3
  <modal-table ref="table" :static="true" :setting-enable="false" :footer-enable="true" :draggable="true" :sticky="true" @on-drag-drop="dragDrop" v-if="active">
4
4
  <template #command="{ row, index }">
5
- <Button size="small" :title="$('Front_Btn_Edit')" type="primary" ghost custom-icon="fa fa-edit" @click="edit(row, index)"></Button>
6
- <Button size="small" :title="$('Front_Btn_Up')" type="primary" ghost custom-icon="fa fa-chevron-up" @click="up(row, index)"></Button>
7
- <Button size="small" :title="$('Front_Btn_Down')" type="primary" ghost custom-icon="fa fa-chevron-down" @click="down(row, index)"></Button>
8
- <Button size="small" :title="$('Front_Btn_Remove')" type="primary" ghost custom-icon="fa fa-times" @click="remove(row, index)"></Button>
5
+ <Button size="small" :title="$t('Front_Btn_Edit')" type="primary" ghost custom-icon="fa fa-edit" @click="edit(row, index)"></Button>
6
+ <Button size="small" :title="$t('Front_Btn_Up')" type="primary" ghost custom-icon="fa fa-chevron-up" @click="up(row, index)"></Button>
7
+ <Button size="small" :title="$t('Front_Btn_Down')" type="primary" ghost custom-icon="fa fa-chevron-down" @click="down(row, index)"></Button>
8
+ <Button size="small" :title="$t('Front_Btn_Remove')" type="primary" ghost custom-icon="fa fa-times" @click="remove(row, index)"></Button>
9
9
  </template>
10
10
  <template #footer>
11
11
  <Button type="primary" ghost custom-icon="fa fa-eye" @click="layoutMode">{{ $t('Front_Btn_Preview_Mode') }}</Button>
@@ -80,7 +80,7 @@
80
80
  @slot 页脚
81
81
  -->
82
82
  <slot name="footer">
83
- <Button type="primary" custom-icon="fa fa-save" v-if="canSave() && saveEnable" @click="onSave">{{ $t('Front_Btn_Save') }}</Button>
83
+ <Button type="primary" custom-icon="fa fa-save" v-if="canSave() && saveEnable && !formView.editEnable" @click="onSave">{{ $t('Front_Btn_Save') }}</Button>
84
84
  </slot>
85
85
  <Button type="default" custom-icon="fa fa-times" @click="clickClose">{{ $t('Front_Btn_Close') }}</Button>
86
86
  <Button type="error" :title="$t('Front_Btn_Setting')" custom-icon="fa fa-cog" v-if="settingEnable && allow('permission/formView')" @click="settingOpen"></Button>
@@ -46,6 +46,7 @@
46
46
  :on-search="onSearch"
47
47
  :summary-method="summaryMethod"
48
48
  :page-size-opts="pageSizeOpts"
49
+ :span-method="spanMethod"
49
50
  @create="create"
50
51
  @edit="edit"
51
52
  @on-ready="onReady"
@@ -305,6 +306,12 @@
305
306
  */
306
307
  beforeClose: {
307
308
  type: Function
309
+ },
310
+ /**
311
+ * 合并单元格的配置
312
+ */
313
+ spanMethod: {
314
+ type: Function
308
315
  }
309
316
  },
310
317
  computed: {
@@ -24,8 +24,9 @@
24
24
  </div>
25
25
  <div v-if="code == 'sorting'">
26
26
  <Input type="text" :readonly="true" v-model="sort" @click="$refs.modal_sort.open()">
27
- <template #prepend></template>
28
- <Button custom-icon="fa fa-edit" @click="$refs.modal_sort.open()"></Button>
27
+ <template #prepend>
28
+ <Button custom-icon="fa fa-edit" @click="$refs.modal_sort.open()"></Button>
29
+ </template>
29
30
  </Input>
30
31
  </div>
31
32
  <div v-if="code == 'filtering'">
@@ -589,7 +589,7 @@
589
589
  },
590
590
  // 获取数据源
591
591
  getDataSource(data, column) {
592
- if (column.dataType && column.dataType.indexOf('Enum:') === 0) {
592
+ if (!column.isStaticItem && column.dataType.indexOf('Enum:') === 0) {
593
593
  // 枚举
594
594
  return this.getEnumList(column.dataType.split(':')[1]);
595
595
  } else {
@@ -447,8 +447,8 @@
447
447
  <table-setting ref="tableSetting" v-if="tableSettingActive" :is-setting="true" @on-change="viewCode => init(viewCode)" />
448
448
  <filter-setting ref="filterSetting" v-if="filterSettingActive" @on-change="viewCode => init(viewCode)" />
449
449
  <item-select ref="itemSelect" v-if="itemSelectActive" @save="saveItemSelect"></item-select>
450
- <modal-table ref="modalTable" v-if="inited"></modal-table>
451
- <modal-form ref="modalForm" :saveEnable="false" v-if="inited"></modal-form>
450
+ <modal-table ref="modalTable" v-if="inited" @create="$refs.modalForm.openDefault(commandButtonParams)" @edit="({ row, index }) => $refs.modalForm.open(row)"></modal-table>
451
+ <modal-form ref="modalForm" v-if="inited" @on-after-save="$refs.modalTable.loadData()"></modal-form>
452
452
  <modal-table ref="batchEditTable" :embedded="true" :static="true" :footerEnable="true" v-if="inited">
453
453
  <template #footer>
454
454
  <Button type="primary" custom-icon="fa fa-save" @click="batchSave()">{{ $t('Front_Btn_Save') }}</Button>
@@ -567,7 +567,8 @@
567
567
  commandButtons: [],
568
568
  preview: false,
569
569
  imageUrl: null,
570
- isFullScreen: false
570
+ isFullScreen: false,
571
+ commandButtonParams: null
571
572
  };
572
573
  },
573
574
  async created() {
@@ -771,6 +772,12 @@
771
772
  */
772
773
  pageSizeOpts: {
773
774
  type: Array
775
+ },
776
+ /**
777
+ * 合并单元格的配置
778
+ */
779
+ spanMethod: {
780
+ type: Function
774
781
  }
775
782
  },
776
783
  computed: {
@@ -2164,22 +2171,26 @@
2164
2171
  if (commandButton.viewType == 'TableView') {
2165
2172
  // 打开表格
2166
2173
  this.$refs.modalTable.init(commandButton.viewCode, async () => {
2167
- let params = {};
2174
+ if (!!(commandButton.formViewCode || '').trim()) {
2175
+ this.$refs.modalForm.init(commandButton.formViewCode);
2176
+ }
2177
+
2178
+ this.commandButtonParams = {};
2168
2179
 
2169
2180
  if (!!(commandButton.params || '').trim()) {
2170
2181
  let commandButtonParams = JSON.parse(commandButton.params);
2171
2182
 
2172
2183
  for (let i = 0; i < commandButtonParams.length; i++) {
2173
2184
  let value = this.parseData(row, commandButtonParams[i].value);
2174
- params[commandButtonParams[i].param] = value;
2185
+ this.commandButtonParams[commandButtonParams[i].param] = value;
2175
2186
  }
2176
2187
  }
2177
2188
 
2178
- this.$refs.modalTable.open(params);
2189
+ this.$refs.modalTable.open(this.commandButtonParams);
2179
2190
  });
2180
2191
  } else {
2181
2192
  // 打开表单
2182
- this.$refs.modalForm.init(commandButton.viewCode, async () => {
2193
+ this.$refs.modalForm.init(commandButton.formViewCode, async () => {
2183
2194
  this.$refs.modalForm.open(row);
2184
2195
  });
2185
2196
  }
@@ -2190,7 +2201,11 @@
2190
2201
  this.preview = true;
2191
2202
  },
2192
2203
  // 合并单元格方法
2193
- handleSpan({ row, column, rowIndex }) {
2204
+ handleSpan({ row, column, rowIndex, columnIndex }) {
2205
+ if (this.spanMethod != null) {
2206
+ return this.spanMethod(row, column, rowIndex, columnIndex);
2207
+ }
2208
+
2194
2209
  if (column.mergeSame) {
2195
2210
  if (rowIndex != 0 && this.parseData(row, column.code) == this.parseData(this.data[rowIndex - 1], column.code)) {
2196
2211
  return [0, 0];
@@ -521,7 +521,9 @@ export default {
521
521
  } else if (operator == 'LessThanOrEqual') {
522
522
  result = data <= value;
523
523
  } else if (operator == 'NotEqual') {
524
- result = String(data) != value;
524
+ result = value.split(',').every(item => {
525
+ return String(data) != item;
526
+ });
525
527
  }
526
528
 
527
529
  if (!result) {
@@ -6,8 +6,8 @@
6
6
  <Card :bordered="false" dis-hover class="ivu-mt">
7
7
  <view-table ref="table" view-code="ApiLog">
8
8
  <template #command="{ row }">
9
- <Button size="small" :title="$('Front_Btn_Request')" type="info" custom-icon="fa fa-cloud-upload-alt" @click="openRequest(row)"></Button>
10
- <Button size="small" :title="$('Front_Btn_Response')" type="info" custom-icon="fa fa-cloud-download-alt" @click="openResponse(row)"></Button>
9
+ <Button size="small" :title="$t('Front_Btn_Request')" type="info" custom-icon="fa fa-cloud-upload-alt" @click="openRequest(row)"></Button>
10
+ <Button size="small" :title="$t('Front_Btn_Response')" type="info" custom-icon="fa fa-cloud-download-alt" @click="openResponse(row)"></Button>
11
11
  </template>
12
12
  </view-table>
13
13
  </Card>
@@ -104,7 +104,7 @@
104
104
  copy() {
105
105
  this.confirmInput(
106
106
  'Front_Msg_Sure_To_Copy_Create_View',
107
- 'Front_Label_View_Code',
107
+ this.$t('Front_Label_View_Code'),
108
108
  async () => {
109
109
  let dataView = await dataViewApi.copy(this.$refs.form.data.id, this.newCode);
110
110
  this.$refs.form.open(dataView);