mooho-base-admin-plus 2.10.10 → 2.10.11

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": "2.10.10",
4
+ "version": "2.10.11",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -171,7 +171,7 @@
171
171
  </FormItem>
172
172
  </Col>
173
173
  <Col v-bind="grid8" v-if="data.controlType == 'DialogSelect' || data.controlType == 'MultiDialogSelect' || data.controlType == 'Table' || data.controlType == 'List'">
174
- <FormItem label="视图" key="dataViewSource" prop="dataViewSource">
174
+ <FormItem label="表格视图" key="dataViewSource" prop="dataViewSource">
175
175
  <dialog-select
176
176
  ref="dataViewSource"
177
177
  v-model="data.source"
@@ -227,8 +227,8 @@
227
227
  />
228
228
  </FormItem>
229
229
  </Col>
230
- <Col v-bind="grid8" v-if="data.controlType == 'Hyperlink'">
231
- <FormItem label="链接地址" key="hyperlink" prop="hyperlink">
230
+ <Col v-bind="grid16" v-if="data.controlType == 'Hyperlink'">
231
+ <FormItem label="链接地址模板(可插入属性)" key="hyperlink" prop="hyperlink">
232
232
  <Input type="text" v-model="data.hyperlink" maxlength="200" />
233
233
  </FormItem>
234
234
  </Col>
@@ -245,6 +245,23 @@
245
245
  />
246
246
  </FormItem>
247
247
  </Col>
248
+ <Col v-bind="grid8" v-if="data.controlType == 'ModalForm'">
249
+ <FormItem label="表单视图" key="dataViewSource" prop="dataViewSource">
250
+ <dialog-select
251
+ ref="dataViewSource"
252
+ v-model="data.source"
253
+ source="DataViewSelect"
254
+ source-data-code="code"
255
+ source-display-code="code"
256
+ :param="{ viewType: 'FormView' }"
257
+ ></dialog-select>
258
+ </FormItem>
259
+ </Col>
260
+ <Col v-bind="grid8" v-if="data.controlType == 'ModalForm'">
261
+ <FormItem label="链接文字模板(可插入属性)" key="description" prop="description">
262
+ <Input type="text" v-model="data.description" maxlength="200" />
263
+ </FormItem>
264
+ </Col>
248
265
  <Col v-bind="grid8">
249
266
  <FormItem label="是否显示" key="isShow" prop="isShow">
250
267
  <Switch
@@ -392,7 +409,7 @@
392
409
  </Dropdown>
393
410
  </FormItem>
394
411
  </Col>
395
- <Col v-bind="grid8" v-if="data.controlType != 'Description'">
412
+ <Col v-bind="grid8" v-if="data.controlType != 'Description' && data.controlType != 'ModalForm'">
396
413
  <FormItem label="描述" key="description" prop="description">
397
414
  <Input type="text" v-model="data.description" maxlength="200" />
398
415
  </FormItem>
@@ -179,6 +179,7 @@
179
179
  item.id == 'MultiDialogSelect' ||
180
180
  item.id == 'TreeSelect' ||
181
181
  item.id == 'MultiTreeSelect' ||
182
+ item.id == 'ModalForm' ||
182
183
  item.id == 'Radio' ||
183
184
  item.id == 'CheckGroup'
184
185
  ) {
@@ -64,6 +64,11 @@
64
64
  <span v-html="showData(data, column)"></span>
65
65
  </a>
66
66
  </template>
67
+ <template v-if="column.controlType === 'ModalForm'">
68
+ <a href="#">
69
+ <span v-html="getTemplateReplace(data, column.description)"></span>
70
+ </a>
71
+ </template>
67
72
  <template v-else-if="column.controlType === 'TextInput'">
68
73
  <Input
69
74
  type="text"
@@ -102,10 +102,16 @@
102
102
  <div v-html="showMultiLine(column.description)"></div>
103
103
  </template>
104
104
  <template v-if="column.controlType === 'Hyperlink'">
105
- <a :href="getHyperlink(data, column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
105
+ <a :href="getTemplateReplace(data, column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
106
106
  <span v-html="showData(data, column)"></span>
107
107
  </a>
108
108
  </template>
109
+ <template v-if="column.controlType === 'ModalForm'">
110
+ <a href="#" @click="openModalForm($refs['modalForm_' + column.code][0], parseData(data, column.code))">
111
+ <span v-html="getTemplateReplace(data, column.description)"></span>
112
+ </a>
113
+ <modal-form :ref="'modalForm_' + column.code" :view-code="column.source" :readonly="true"></modal-form>
114
+ </template>
109
115
  <template v-else-if="column.controlType === 'TextInput'">
110
116
  <Input
111
117
  type="text"
@@ -1723,6 +1729,17 @@
1723
1729
  item.needClear = true;
1724
1730
  });
1725
1731
  }
1732
+ },
1733
+ // 打开弹出表单
1734
+ async openModalForm(control, id) {
1735
+ let data;
1736
+ if (control.formView.isCustom) {
1737
+ data = await customModelApi.get(control.formView.model, id);
1738
+ } else {
1739
+ data = await modelApi.get(control.formView.model, id);
1740
+ }
1741
+
1742
+ control.open(data);
1726
1743
  }
1727
1744
  // // 打印
1728
1745
  // print() {
@@ -143,10 +143,15 @@
143
143
  </Tag>
144
144
  </template>
145
145
  <template v-else-if="column.controlType === 'Hyperlink'">
146
- <a :href="getHyperlink(rowData(row, index), column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
146
+ <a :href="getTemplateReplace(rowData(row, index), column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
147
147
  <span v-html="showData(rowData(row, index), column)"></span>
148
148
  </a>
149
149
  </template>
150
+ <template v-else-if="column.controlType === 'ModalForm'">
151
+ <a href="#" @click="openModalForm($refs['modalForm_' + column.code][0], parseData(rowData(row, index), column.code))">
152
+ <span v-html="getTemplateReplace(rowData(row, index), column.description)"></span>
153
+ </a>
154
+ </template>
150
155
  <template v-else-if="column.controlType === 'TextInput'">
151
156
  <Input
152
157
  type="text"
@@ -610,6 +615,12 @@
610
615
  <Button type="default" custom-icon="fa fa-times" @click="$refs.batchEditTable.close()">{{ $t('Front_Btn_Close') }}</Button>
611
616
  </template>
612
617
  </modal-table>
618
+ <modal-form
619
+ v-for="column in columns.filter(item => item.controlType == 'ModalForm')"
620
+ :ref="'modalForm_' + column.code"
621
+ :view-code="column.source"
622
+ :readonly="true"
623
+ ></modal-form>
613
624
  <Modal
614
625
  :title="$t('Front_Label_Preview')"
615
626
  v-model="preview"
@@ -2916,6 +2927,19 @@
2916
2927
  * 点击单元格时触发
2917
2928
  */
2918
2929
  this.$emit('on-cell-click', row, column, data, event);
2930
+ },
2931
+ // 打开弹出表单
2932
+ async openModalForm(control, id) {
2933
+ console.log('control', control);
2934
+
2935
+ let data;
2936
+ if (control.formView.isCustom) {
2937
+ data = await customModelApi.get(control.formView.model, id);
2938
+ } else {
2939
+ data = await modelApi.get(control.formView.model, id);
2940
+ }
2941
+
2942
+ control.open(data);
2919
2943
  }
2920
2944
  }
2921
2945
  };
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
@@ -1 +1 @@
1
- const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
1
+ const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
@@ -771,17 +771,24 @@ export default {
771
771
  return swal;
772
772
  }
773
773
  },
774
- // 获取超链接
775
- getHyperlink(data, hyperlink) {
776
- while (hyperlink.indexOf('{') >= 0) {
777
- let start = hyperlink.indexOf('{');
778
- let end = hyperlink.indexOf('}');
779
- let expression = hyperlink.substring(start + 1, end);
774
+ // 文本模板替换
775
+ getTemplateReplace(data, template) {
776
+ let text = template;
777
+ while (text.indexOf('{') >= 0) {
778
+ let start = text.indexOf('{');
779
+ let end = text.indexOf('}');
780
+ let expression = text.substring(start + 1, end);
781
+
782
+ let value = this.parseData(data, expression);
783
+
784
+ if (value == null) {
785
+ value = '';
786
+ }
780
787
 
781
- hyperlink = hyperlink.substring(0, start) + this.parseData(data, expression) + hyperlink.substring(end + 1);
788
+ text = text.substring(0, start) + value + text.substring(end + 1);
782
789
  }
783
790
 
784
- return hyperlink;
791
+ return text;
785
792
  },
786
793
  // 保留小数
787
794
  keepDecimal(num, digit, fixedDigit) {