mooho-base-admin-plus 0.4.12 → 0.4.15

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.12",
4
+ "version": "0.4.15",
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>
@@ -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: {
@@ -146,6 +146,19 @@
146
146
  @on-blur="onBlur(rowData(row, index), column)"
147
147
  />
148
148
  </template>
149
+ <template v-else-if="column.controlType === 'TextArea'">
150
+ <Input
151
+ type="textarea"
152
+ size="small"
153
+ :model-value="parseData(rowData(row, index), column.code)"
154
+ @update:model-value="$event => setData(rowData(row, index), column.code, $event)"
155
+ :readonly="isReadonly(rowData(row, index), column)"
156
+ :style="{ width: column.controlWidth == null ? null : column.controlWidth - 36 + 'px' }"
157
+ :rows="column.controlHeight / 20"
158
+ :maxlength="column.maxLength"
159
+ :placeholder="column.description"
160
+ />
161
+ </template>
149
162
  <template v-else-if="column.controlType === 'NumberInput'">
150
163
  <Input
151
164
  type="number"
@@ -772,6 +785,12 @@
772
785
  */
773
786
  pageSizeOpts: {
774
787
  type: Array
788
+ },
789
+ /**
790
+ * 合并单元格的配置
791
+ */
792
+ spanMethod: {
793
+ type: Function
775
794
  }
776
795
  },
777
796
  computed: {
@@ -1095,6 +1114,11 @@
1095
1114
  // }
1096
1115
  }
1097
1116
 
1117
+ // 设置数据的可见性和只读属性
1118
+ this.data.forEach(item => {
1119
+ this.setShowStatus(item);
1120
+ });
1121
+
1098
1122
  // 如果这行数据有子集,需要添加展开加载方法
1099
1123
  if (this.treeEnable) {
1100
1124
  this.data.forEach(item => {
@@ -1729,33 +1753,7 @@
1729
1753
  },
1730
1754
  // 数据变化事件
1731
1755
  onDataChange(data, sender, selected) {
1732
- for (let column of this.columns) {
1733
- // 判断是否需要显示
1734
- if (!!(column.showJson || '').trim()) {
1735
- if (data._isShow == null) {
1736
- data._isShow = {};
1737
- }
1738
-
1739
- let setting = JSON.parse(column.showJson);
1740
-
1741
- if (setting.type == 'Condition' || setting.type == 'Expression') {
1742
- data._isShow[column.code] = this.judgeCondition(setting, data);
1743
- }
1744
- }
1745
-
1746
- // 判断是否只读
1747
- if (!!(column.readonlyJson || '').trim()) {
1748
- if (data._isReadonly == null) {
1749
- data._isReadonly = {};
1750
- }
1751
-
1752
- let setting = JSON.parse(column.readonlyJson);
1753
-
1754
- if (setting.type == 'Condition' || setting.type == 'Expression') {
1755
- data._isReadonly[column.code] = this.judgeCondition(setting, data);
1756
- }
1757
- }
1758
- }
1756
+ this.setShowStatus(data);
1759
1757
 
1760
1758
  //this.$forceUpdate();
1761
1759
 
@@ -2195,7 +2193,11 @@
2195
2193
  this.preview = true;
2196
2194
  },
2197
2195
  // 合并单元格方法
2198
- handleSpan({ row, column, rowIndex }) {
2196
+ handleSpan({ row, column, rowIndex, columnIndex }) {
2197
+ if (this.spanMethod != null) {
2198
+ return this.spanMethod(row, column, rowIndex, columnIndex);
2199
+ }
2200
+
2199
2201
  if (column.mergeSame) {
2200
2202
  if (rowIndex != 0 && this.parseData(row, column.code) == this.parseData(this.data[rowIndex - 1], column.code)) {
2201
2203
  return [0, 0];
@@ -2285,6 +2287,36 @@
2285
2287
 
2286
2288
  return result;
2287
2289
  },
2290
+ // 设置可见性和只读
2291
+ setShowStatus(data) {
2292
+ for (let column of this.columns) {
2293
+ // 判断是否需要显示
2294
+ if (!!(column.showJson || '').trim()) {
2295
+ if (data._isShow == null) {
2296
+ data._isShow = {};
2297
+ }
2298
+
2299
+ let setting = JSON.parse(column.showJson);
2300
+
2301
+ if (setting.type == 'Condition' || setting.type == 'Expression') {
2302
+ data._isShow[column.code] = this.judgeCondition(setting, data);
2303
+ }
2304
+ }
2305
+
2306
+ // 判断是否只读
2307
+ if (!!(column.readonlyJson || '').trim()) {
2308
+ if (data._isReadonly == null) {
2309
+ data._isReadonly = {};
2310
+ }
2311
+
2312
+ let setting = JSON.parse(column.readonlyJson);
2313
+
2314
+ if (setting.type == 'Condition' || setting.type == 'Expression') {
2315
+ data._isReadonly[column.code] = this.judgeCondition(setting, data);
2316
+ }
2317
+ }
2318
+ }
2319
+ },
2288
2320
  // 获取多语言名称
2289
2321
  getNameI18n(column) {
2290
2322
  if (column) {
package/src/index.js CHANGED
@@ -56,6 +56,7 @@ import NoticeList from './components/home/notice-list.vue';
56
56
 
57
57
  // API
58
58
  import modelApi from './api/model';
59
+ import customModelApi from './api/customModel';
59
60
  import dataSourceApi from './api/dataSource';
60
61
  import taskApi from './api/task';
61
62
  import applicationApi from './api/application';
@@ -199,4 +200,23 @@ const routeChanged = to => {
199
200
 
200
201
  export default API;
201
202
 
202
- export { pages, App, store, i18n, setting, basicLayout, lodop, request, mixinPage, modelApi, dataSourceApi, taskApi, applicationApi, util, createRouter, created, routeChanged };
203
+ export {
204
+ pages,
205
+ App,
206
+ store,
207
+ i18n,
208
+ setting,
209
+ basicLayout,
210
+ lodop,
211
+ request,
212
+ mixinPage,
213
+ modelApi,
214
+ customModelApi,
215
+ dataSourceApi,
216
+ taskApi,
217
+ applicationApi,
218
+ util,
219
+ createRouter,
220
+ created,
221
+ routeChanged
222
+ };
@@ -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);