mooho-base-admin-plus 2.10.63 → 2.10.65

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.63",
4
+ "version": "2.10.65",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
package/src/api/task.js CHANGED
@@ -56,6 +56,17 @@ export default {
56
56
  }
57
57
  });
58
58
  },
59
+ batchRedirect(sourceID, targetID, comment) {
60
+ return request({
61
+ url: `api/${res}/batchRedirect`,
62
+ method: 'post',
63
+ data: {
64
+ sourceID,
65
+ targetID,
66
+ comment
67
+ }
68
+ });
69
+ },
59
70
  batchDo(ids) {
60
71
  return request({
61
72
  url: `api/${res}/batchDo`,
@@ -111,6 +111,7 @@ export default {
111
111
  if (item.defaultValue.startsWith('{today}')) {
112
112
  // 当前日期
113
113
  let date = new Date();
114
+ date.setHours(0, 0, 0, 0);
114
115
 
115
116
  if (item.defaultValue.indexOf('+') != -1) {
116
117
  date.setDate(date.getDate() + parseInt(item.defaultValue.split('+')[1]));
@@ -118,11 +119,27 @@ export default {
118
119
  date.setDate(date.getDate() - parseInt(item.defaultValue.split('-')[1]));
119
120
  }
120
121
 
121
- let value = date.toISOString().replace(/T.*/, '');
122
- setData(data, item, new Date(value));
122
+ let format = 'yyyy-MM-dd HH:mm:ss';
123
+
124
+ if (item.controlType == 'Date') {
125
+ format = 'yyyy-MM-dd';
126
+ } else if (item.controlType == 'Time') {
127
+ format = 'HH:mm:ss';
128
+ } else if (item.controlType == 'DateTime') {
129
+ format = 'yyyy-MM-dd HH:mm:ss';
130
+ } else if (item.controlType == 'Year') {
131
+ format = 'yyyy';
132
+ } else if (item.controlType == 'Month') {
133
+ format = 'yyyy-MM';
134
+ } else {
135
+ format = 'yyyy-MM-dd';
136
+ }
137
+
138
+ setData(data, item, dateFormat(date, format));
123
139
  } else if (item.defaultValue.startsWith('{today(')) {
124
140
  // 当前日期
125
141
  let date = new Date();
142
+ date.setHours(0, 0, 0, 0);
126
143
 
127
144
  if (item.defaultValue.indexOf('+') != -1) {
128
145
  date.setDate(date.getDate() + parseInt(item.defaultValue.split('+')[1]));
@@ -290,7 +290,6 @@
290
290
  import modelApi from '../../api/model';
291
291
  import customModelApi from '../../api/customModel';
292
292
  import DialogSelect from '../input/dialog-select.vue';
293
- import dateFormat from 'date-fns/format';
294
293
 
295
294
  export default {
296
295
  mixins: [mixin, mixinPage],
@@ -775,8 +775,9 @@
775
775
  });
776
776
 
777
777
  this.data = {};
778
-
779
- this.clearValidate();
778
+ setTimeout(() => {
779
+ this.clearValidate();
780
+ });
780
781
  },
781
782
  /**
782
783
  * 重置表格页码
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div>
3
+ <div class="i-layout-page-header">
4
+ <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
+ </div>
6
+ <Card :bordered="false" dis-hover class="ivu-mt">
7
+ <view-form ref="form" view-code="BatchRedirect"></view-form>
8
+ <div style="text-align: center">
9
+ <Button type="info" custom-icon="fa fa-share" @click="batchRedirect()">{{ $t('Front_Btn_Redirect') }}</Button>
10
+ </div>
11
+ </Card>
12
+ </div>
13
+ </template>
14
+ <script>
15
+ import mixinPage from '../../mixins/page';
16
+ import taskApi from '../../api/task';
17
+
18
+ export default {
19
+ name: 'system-batchRedirect',
20
+ mixins: [mixinPage],
21
+ components: {},
22
+ data() {
23
+ return {};
24
+ },
25
+ computed: {},
26
+ created() {},
27
+ methods: {
28
+ // 批量转移
29
+ async batchRedirect() {
30
+ let isOK = await this.$refs.form.validate();
31
+
32
+ if (!isOK) {
33
+ this.error('Front_Msg_Form_Validate_Fail');
34
+ } else {
35
+ let model = this.$refs.form.data;
36
+
37
+ this.confirm('Front_Msg_Sure_To_Redirect_Application|' + model.target.name, async () => {
38
+ await taskApi.batchRedirect(model.sourceID, model.targetID, model.comment);
39
+ this.success('Front_Msg_Success');
40
+ this.resetNotice();
41
+
42
+ setTimeout(() => {
43
+ this.$refs.form.reset();
44
+ });
45
+ });
46
+ }
47
+ }
48
+ }
49
+ };
50
+ </script>