mooho-base-admin-plus 2.5.36 → 2.6.1

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.5.36",
4
+ "version": "2.6.1",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
package/src/api/task.js CHANGED
@@ -61,5 +61,12 @@ export default {
61
61
  method: 'post',
62
62
  data: filter
63
63
  });
64
+ },
65
+ queryMyDone(filter) {
66
+ return request({
67
+ url: `api/${res}/queryMyDone`,
68
+ method: 'post',
69
+ data: filter
70
+ });
64
71
  }
65
72
  };
@@ -56,6 +56,26 @@
56
56
  </Select>
57
57
  </FormItem>
58
58
  </Col>
59
+ <Col v-bind="grid8" v-if="data.controlType == 'Tag'">
60
+ <FormItem label="标签样式" key="source" prop="source">
61
+ <Select v-model="data.source" :transfer="true" :clearable="true">
62
+ <Option key="default" value="default">样式一(默认)</Option>
63
+ <Option key="border" value="border">样式二(边框)</Option>
64
+ <Option key="dot" value="dot">样式三(点)</Option>
65
+ </Select>
66
+ </FormItem>
67
+ </Col>
68
+ <Col v-bind="grid24" v-if="data.controlType == 'Tag'">
69
+ <FormItem label="标签颜色" key="param" prop="param">
70
+ <view-table
71
+ ref="tagColorTable"
72
+ view-code="TagColor"
73
+ :static="true"
74
+ :embedded="true"
75
+ @on-change="(row, sender, selected) => onTagColorChange(column, null, row, sender, selected)"
76
+ ></view-table>
77
+ </FormItem>
78
+ </Col>
59
79
  <Col v-bind="grid8" v-if="data.controlType == 'Table'">
60
80
  <FormItem label="数据存储方式" key="tableStoreType" prop="tableStoreType">
61
81
  <RadioGroup v-model="data.tableStoreType" @on-change="tableStoreTypeChange">
@@ -715,6 +735,21 @@
715
735
  if (this.data.isDictItem && this.data.param) {
716
736
  this.data.dictTypeCode = JSON.parse(this.data.param)['type.code'].replace('[', '').replace(']', '');
717
737
  }
738
+
739
+ if (this.data.controlType == 'Tag') {
740
+ setTimeout(() => {
741
+ let tagColor = [];
742
+ if (this.data.param) {
743
+ try {
744
+ tagColor = JSON.parse(this.data.param);
745
+ } catch (e) {
746
+ console.log(e);
747
+ }
748
+ }
749
+
750
+ this.$refs.tagColorTable.loadData(tagColor);
751
+ });
752
+ }
718
753
  },
719
754
  // 关闭
720
755
  close() {
@@ -748,6 +783,13 @@
748
783
  },
749
784
  // 控件类型变更
750
785
  controlTypeChange() {
786
+ if (this.data.controlType == 'Tag') {
787
+ setTimeout(() => {
788
+ this.data.param = null;
789
+ this.$refs.tagColorTable.loadData([]);
790
+ });
791
+ }
792
+
751
793
  if (this.data.sourceModel) {
752
794
  if (this.data.controlType == 'DialogSelect' || this.data.controlType == 'MultiDialogSelect') {
753
795
  this.data.source = this.data.sourceModel + 'Select';
@@ -755,10 +797,6 @@
755
797
  this.data.source = this.data.sourceModel;
756
798
  }
757
799
  }
758
-
759
- setTimeout(() => {
760
- //this.$forceUpdate();
761
- });
762
800
  },
763
801
  // 数据源变更
764
802
  sourceChange(row) {
@@ -974,6 +1012,9 @@
974
1012
  // 选择默认值
975
1013
  async selectDefault(name) {
976
1014
  this.data.defaultValue = '{' + name + '}';
1015
+ },
1016
+ onTagColorChange() {
1017
+ this.data.param = JSON.stringify(this.$refs.tagColorTable.getData());
977
1018
  }
978
1019
  }
979
1020
  };
@@ -67,6 +67,31 @@ export default {
67
67
  }
68
68
 
69
69
  return param;
70
+ },
71
+ // 获取标签颜色
72
+ getTagColor(column, data) {
73
+ let tagColor = [];
74
+ if (column.param) {
75
+ try {
76
+ tagColor = JSON.parse(column.param);
77
+ } catch (e) {
78
+ console.log(e);
79
+ }
80
+ }
81
+
82
+ let color = 'default';
83
+
84
+ tagColor.forEach(item => {
85
+ if (
86
+ item.value.split(',').some(i => {
87
+ return i.trim() == data.trim();
88
+ })
89
+ ) {
90
+ color = item.color;
91
+ }
92
+ });
93
+
94
+ return color;
70
95
  }
71
96
  }
72
97
  };
@@ -93,6 +93,11 @@
93
93
  <div :class="{ error: compareData != null && parseData(data, column.code) != parseData(compareData, column.code) }" v-html="showData(data, column)"></div>
94
94
  </div>
95
95
  </template>
96
+ <template v-else-if="column.controlType === 'Tag'">
97
+ <Tag :color="getTagColor(column, parseData(data, column.code))" :type="column.source == 'default' ? null : column.source">
98
+ {{ showData(data, column) }}
99
+ </Tag>
100
+ </template>
96
101
  <template v-else-if="column.controlType === 'Description'">
97
102
  <div v-html="showMultiLine(column.description)"></div>
98
103
  </template>
@@ -107,7 +112,7 @@
107
112
  :model-value="parseData(data, column.code)"
108
113
  @update:model-value="$event => setData(data, column.code, $event)"
109
114
  :readonly="readonly || column.isReadonly"
110
- :clearable="true"
115
+ :clearable="!(readonly || column.isReadonly)"
111
116
  :style="{ width: column.controlWidth == null ? null : column.controlWidth + 'px' }"
112
117
  :maxlength="column.maxLength"
113
118
  :placeholder="column.description"
@@ -122,7 +127,7 @@
122
127
  :model-value="parseData(data, column.code)"
123
128
  @update:model-value="$event => setData(data, column.code, $event)"
124
129
  :readonly="readonly || column.isReadonly"
125
- :clearable="true"
130
+ :clearable="!(readonly || column.isReadonly)"
126
131
  :style="{ width: column.controlWidth == null ? '100px' : column.controlWidth + 'px' }"
127
132
  :placeholder="column.description"
128
133
  :max="column.maxValue"
@@ -136,7 +141,7 @@
136
141
  :model-value="parseData(data, column.code)"
137
142
  @update:model-value="$event => setData(data, column.code, $event)"
138
143
  :disabled="readonly || column.isReadonly"
139
- :clearable="true"
144
+ :clearable="!(readonly || column.isReadonly)"
140
145
  :style="{
141
146
  width: column.controlWidth == null ? null : column.controlWidth + 'px',
142
147
  'min-width': column.controlWidth == null ? null : column.controlWidth + 'px'
@@ -154,7 +159,7 @@
154
159
  @update:model-value="$event => setArrayData(data, column.code, $event)"
155
160
  :disabled="readonly || column.isReadonly"
156
161
  :multiple="true"
157
- :clearable="true"
162
+ :clearable="!(readonly || column.isReadonly)"
158
163
  :style="{ width: column.controlWidth == null ? null : column.controlWidth + 'px' }"
159
164
  :placeholder="column.description"
160
165
  :transfer="true"
@@ -169,7 +174,7 @@
169
174
  @update:model-value="$event => setData(data, column.code, $event)"
170
175
  :data="getDataSource(data, column)"
171
176
  :disabled="readonly || column.isReadonly"
172
- :clearable="true"
177
+ :clearable="!(readonly || column.isReadonly)"
173
178
  :style="{ width: column.controlWidth == null ? null : column.controlWidth + 'px' }"
174
179
  :placeholder="column.description"
175
180
  :transfer="true"
@@ -184,7 +189,7 @@
184
189
  :disabled="readonly || column.isReadonly"
185
190
  :multiple="true"
186
191
  :show-checkbox="true"
187
- :clearable="true"
192
+ :clearable="!(readonly || column.isReadonly)"
188
193
  :style="{ width: column.controlWidth == null ? null : column.controlWidth + 'px' }"
189
194
  :placeholder="column.description"
190
195
  :transfer="true"
@@ -265,7 +270,7 @@
265
270
  :model-value="parseDataWithOther(data, column)"
266
271
  @update:model-value="$event => setDataWithOther(data, column.code, $event)"
267
272
  :disabled="readonly || column.isReadonly"
268
- :clearable="true"
273
+ :clearable="!(readonly || column.isReadonly)"
269
274
  :style="{ width: column.controlWidth == null ? '40%' : column.controlWidth + 'px' }"
270
275
  :placeholder="column.description"
271
276
  :transfer="true"
@@ -134,6 +134,11 @@
134
134
  v-html="showData(rowData(row, index), column)"
135
135
  ></div>
136
136
  </template>
137
+ <template v-else-if="column.controlType === 'Tag'">
138
+ <Tag size="small" :color="getTagColor(column, parseData(rowData(row, index), column.code))" :type="column.source == 'default' ? null : column.source">
139
+ {{ showData(rowData(row, index), column) }}
140
+ </Tag>
141
+ </template>
137
142
  <template v-else-if="column.controlType === 'Hyperlink'">
138
143
  <a :href="getHyperlink(rowData(row, index), column.hyperlink)" :target="column.isNewWindow ? '_blank' : ''">
139
144
  <span v-html="showData(rowData(row, index), column)"></span>
@@ -146,7 +151,7 @@
146
151
  :model-value="parseData(rowData(row, index), column.code)"
147
152
  @update:model-value="$event => setData(rowData(row, index), column.code, $event)"
148
153
  :readonly="isReadonly(rowData(row, index), column)"
149
- :clearable="true"
154
+ :clearable="!isReadonly(rowData(row, index), column)"
150
155
  :style="{ width: column.controlWidth == null ? null : column.controlWidth - 8 + 'px' }"
151
156
  :maxlength="column.maxLength"
152
157
  :pattern="column.pattern"
@@ -176,7 +181,7 @@
176
181
  :model-value="parseData(rowData(row, index), column.code)"
177
182
  @update:model-value="$event => setData(rowData(row, index), column.code, $event)"
178
183
  :readonly="isReadonly(rowData(row, index), column)"
179
- :clearable="true"
184
+ :clearable="!isReadonly(rowData(row, index), column)"
180
185
  :style="{ width: column.controlWidth == null ? null : column.controlWidth - 8 + 'px' }"
181
186
  :placeholder="column.description"
182
187
  @on-change="onDataChange(rowData(row, index), column)"
@@ -189,7 +194,7 @@
189
194
  :model-value="parseData(rowData(row, index), column.code)"
190
195
  @update:model-value="$event => setData(rowData(row, index), column.code, $event)"
191
196
  :disabled="isReadonly(rowData(row, index), column)"
192
- :clearable="true"
197
+ :clearable="!isReadonly(rowData(row, index), column)"
193
198
  :style="{ width: column.controlWidth == null ? null : column.controlWidth - 8 + 'px' }"
194
199
  :placeholder="column.description"
195
200
  :transfer="true"
@@ -205,7 +210,7 @@
205
210
  @update:model-value="$event => setArrayData(rowData(row, index), column.code, $event)"
206
211
  :disabled="isReadonly(rowData(row, index), column)"
207
212
  :multiple="true"
208
- :clearable="true"
213
+ :clearable="!isReadonly(rowData(row, index), column)"
209
214
  :style="{ width: column.controlWidth == null ? null : column.controlWidth - 8 + 'px' }"
210
215
  :placeholder="column.description"
211
216
  :transfer="true"
@@ -288,7 +293,7 @@
288
293
  @update:model-value="$event => setDataWithOther(rowData(row, index), column.code, $event)"
289
294
  size="small"
290
295
  :disabled="isReadonly(rowData(row, index), column)"
291
- :clearable="true"
296
+ :clearable="!isReadonly(rowData(row, index), column)"
292
297
  :style="{
293
298
  width:
294
299
  parseDataWithOther(rowData(row, index), column) == '__Other'
@@ -1618,6 +1623,7 @@
1618
1623
  delete item._needRefresh;
1619
1624
  delete item._needClear;
1620
1625
  delete item._rawData;
1626
+ delete item._disabled;
1621
1627
  });
1622
1628
 
1623
1629
  return data;
@@ -113,10 +113,10 @@
113
113
  let applicationType = row.processInst.applicationType;
114
114
  this.outcomes = [];
115
115
  this.task = row;
116
- this.isRejectable = this.task.activityInst.activity.isRejectable;
117
- this.isBackable = this.task.activityInst.activity.isBackable;
118
- this.isRedirectable = this.task.activityInst.activity.isRedirectable;
119
- this.isMessageEnable = this.task.processInst.isMessageEnable;
116
+ this.isRejectable = this.task.activityInst.activity.isRejectable && this.task.status == 'Pending';
117
+ this.isBackable = this.task.activityInst.activity.isBackable && this.task.status == 'Pending';
118
+ this.isRedirectable = this.task.activityInst.activity.isRedirectable && this.task.status == 'Pending';
119
+ this.isMessageEnable = this.task.processInst.isMessageEnable && this.task.status == 'Pending';
120
120
  this.isCustom = false;
121
121
 
122
122
  setTimeout(async () => {
@@ -126,7 +126,7 @@
126
126
  return;
127
127
  } else if (this.task.activityInst.activity.pageMode == 'Component') {
128
128
  // 动态组件
129
- this.readonly = !this.task.activityInst.activity.isEditable;
129
+ this.readonly = !this.task.activityInst.activity.isEditable || this.task.status != 'Pending';
130
130
  this.customComponent = markRaw(this.$pages[this.task.activityInst.activity.templateUrl]); // 动态组件
131
131
  this.isCustom = true;
132
132
 
@@ -143,7 +143,7 @@
143
143
  });
144
144
  } else if (this.task.activityInst.activity.pageMode == 'Form') {
145
145
  this.form = this.$refs.form;
146
- this.readonly = !this.task.activityInst.activity.isEditable;
146
+ this.readonly = !this.task.activityInst.activity.isEditable || this.task.status != 'Pending';
147
147
  this.form.init(this.task.activityInst.activity.formViewCode, async view => {
148
148
  if (view.dataView.isCustom) {
149
149
  this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
@@ -167,7 +167,7 @@
167
167
  return;
168
168
  } else if (applicationType.pageMode == 'Component') {
169
169
  // 动态组件
170
- this.readonly = !this.task.activityInst.activity.isEditable;
170
+ this.readonly = !this.task.activityInst.activity.isEditable || this.task.status != 'Pending';
171
171
  this.customComponent = markRaw(this.$pages[applicationType.templateUrl]); // 动态组件
172
172
  this.isCustom = true;
173
173
 
@@ -184,7 +184,7 @@
184
184
  });
185
185
  } else if (applicationType.pageMode == 'Form') {
186
186
  this.form = this.$refs.form;
187
- this.readonly = !this.task.activityInst.activity.isEditable;
187
+ this.readonly = !this.task.activityInst.activity.isEditable || this.task.status != 'Pending';
188
188
  this.form.init(applicationType.formViewCode, async view => {
189
189
  if (view.dataView.isCustom) {
190
190
  this.model = await customModelApi.get(applicationType.model, row.processInst.modelID);
@@ -208,8 +208,10 @@
208
208
  return;
209
209
  }
210
210
 
211
- let res = await modelApi.query('Outcome', { activityFromID: row.activityInst.activityID });
212
- this.outcomes = res.data;
211
+ if (this.task.status == 'Pending') {
212
+ let res = await modelApi.query('Outcome', { activityFromID: row.activityInst.activityID });
213
+ this.outcomes = res.data;
214
+ }
213
215
  });
214
216
  },
215
217
  // 自定义组件就绪
@@ -4,14 +4,25 @@
4
4
  <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
5
  </div>
6
6
  <Card :bordered="false" dis-hover class="ivu-mt">
7
- <view-table ref="table" view-code="TodoList" :select-enable="true">
8
- <template #filterCommand>
9
- <Button size="small" type="primary" custom-icon="fa fa-check-double" @click="batchDo">{{ $t('Front_Btn_Batch_Do') }}</Button>
10
- </template>
11
- <template #command="{ row }">
12
- <Button size="small" :title="$t('Front_Btn_Detail')" type="info" custom-icon="fa fa-file-alt" @click="$refs.taskForm.open(row)"></Button>
13
- </template>
14
- </view-table>
7
+ <Tabs value="todo">
8
+ <TabPane :label="$t('Front_Label_Todo')" name="todo">
9
+ <view-table ref="table" view-code="TodoList" :select-enable="true">
10
+ <template #filterCommand>
11
+ <Button size="small" type="primary" custom-icon="fa fa-check-double" @click="batchDo">{{ $t('Front_Btn_Batch_Do') }}</Button>
12
+ </template>
13
+ <template #command="{ row }">
14
+ <Button size="small" :title="$t('Front_Btn_Detail')" type="info" custom-icon="fa fa-file-alt" @click="$refs.taskForm.open(row)"></Button>
15
+ </template>
16
+ </view-table>
17
+ </TabPane>
18
+ <TabPane :label="$t('Front_Label_Done')" name="done">
19
+ <view-table ref="table" view-code="DoneList">
20
+ <template #command="{ row }">
21
+ <Button size="small" :title="$t('Front_Btn_Detail')" type="info" custom-icon="fa fa-file-alt" @click="$refs.taskForm.open(row)"></Button>
22
+ </template>
23
+ </view-table>
24
+ </TabPane>
25
+ </Tabs>
15
26
  </Card>
16
27
  <task-form ref="taskForm" @on-after-action="$refs.table.loadData()"></task-form>
17
28
  </div>
@@ -304,6 +304,12 @@
304
304
  padding-right: 8px;
305
305
  }
306
306
 
307
+ .ivu-table-cell .ivu-tag-dot {
308
+ height: 22px;
309
+ line-height: 22px;
310
+ padding: 0 8px;
311
+ }
312
+
307
313
  .ivu-table-wrapper {
308
314
  overflow: initial;
309
315
  }