File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 23
23
<Icon icon =" fa:sort-amount-desc" class =" mr-5px" />
24
24
排序
25
25
</el-button >
26
+ <el-button
27
+ v-else
28
+ link
29
+ type =" info"
30
+ class =" mr-20px"
31
+ @click.stop =" handleAddModel('create')"
32
+ >
33
+ <Icon icon =" fa:plus" class =" mr-5px" />
34
+ 新建
35
+ </el-button >
26
36
<el-dropdown
27
37
@command =" (command) => handleCategoryCommand(command)"
28
38
placement =" bottom"
228
238
</div >
229
239
</template >
230
240
</Dialog >
241
+ <!-- 表单弹窗:添加流程模型 -->
242
+ <ModelForm :categoryId =" categoryInfo.code" ref =" modelFormRef" @success =" emit('success')" />
231
243
</template >
232
244
233
245
<script lang="ts" setup>
246
+ import ModelForm from ' ./ModelForm.vue'
234
247
import { CategoryApi } from ' @/api/bpm/category'
235
248
import Sortable from ' sortablejs'
236
249
import { propTypes } from ' @/utils/propTypes'
@@ -480,6 +493,12 @@ const handleDeleteGroup = async () => {
480
493
} catch {}
481
494
}
482
495
496
+ // 添加流程模型弹窗
497
+ const modelFormRef = ref ()
498
+ const handleAddModel = (type : string ) => {
499
+ modelFormRef .value .open (type )
500
+ }
501
+
483
502
watch (() => props .categoryInfo .modelList , updateTableData , { immediate: true })
484
503
watch (
485
504
() => props .isCategorySorting ,
Original file line number Diff line number Diff line change 155
155
</Dialog >
156
156
</template >
157
157
<script lang="ts" setup>
158
+ import { propTypes } from ' @/utils/propTypes'
158
159
import { DICT_TYPE , getBoolDictOptions , getIntDictOptions } from ' @/utils/dict'
159
160
import { ElMessageBox } from ' element-plus'
160
161
import * as ModelApi from ' @/api/bpm/model'
@@ -170,7 +171,9 @@ defineOptions({ name: 'ModelForm' })
170
171
const { t } = useI18n () // 国际化
171
172
const message = useMessage () // 消息弹窗
172
173
const userStore = useUserStoreWithOut () // 用户信息缓存
173
-
174
+ const props = defineProps ({
175
+ categoryId: propTypes .number
176
+ })
174
177
const dialogVisible = ref (false ) // 弹窗的是否展示
175
178
const dialogTitle = ref (' ' ) // 弹窗的标题
176
179
const formLoading = ref (false ) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
@@ -232,6 +235,9 @@ const open = async (type: string, id?: string) => {
232
235
categoryList .value = await CategoryApi .getCategorySimpleList ()
233
236
// 查询用户列表
234
237
userList .value = await UserApi .getSimpleUserList ()
238
+ if (props .categoryId ) {
239
+ formData .value .category = props .categoryId
240
+ }
235
241
}
236
242
defineExpose ({ open }) // 提供 open 方法,用于打开弹窗
237
243
You can’t perform that action at this time.
0 commit comments