|
@@ -3,7 +3,7 @@
|
|
v-model="dialogVisible"
|
|
v-model="dialogVisible"
|
|
class="le-dialog"
|
|
class="le-dialog"
|
|
:title="curTitle"
|
|
:title="curTitle"
|
|
- :width="type === 1 ? 680 : 460"
|
|
|
|
|
|
+ :width="[1, 5].indexOf(type) !== -1 ? 680 : 460"
|
|
destroy-on-close
|
|
destroy-on-close
|
|
append-to-body
|
|
append-to-body
|
|
@closed="$emit('closed')"
|
|
@closed="$emit('closed')"
|
|
@@ -130,6 +130,84 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+ <template v-if="type === 5">
|
|
|
|
+ <div class="sc-user-select">
|
|
|
|
+ <div class="sc-user-select__left">
|
|
|
|
+ <div class="sc-user-select__search">
|
|
|
|
+ <el-input v-model="keyword" prefix-icon="Search" placeholder="搜索表单">
|
|
|
|
+ <template #append>
|
|
|
|
+ <el-button icon="Search" @click="search"></el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sc-user-select__select">
|
|
|
|
+ <div class="sc-user-select__tree">
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <el-tree
|
|
|
|
+ ref="formCategoryTree"
|
|
|
|
+ class="menu"
|
|
|
|
+ :data="formCategoryTree"
|
|
|
|
+ :node-key="formCategoryProps.key"
|
|
|
|
+ :props="formCategoryProps"
|
|
|
|
+ highlight-current
|
|
|
|
+ :expand-on-click-node="false"
|
|
|
|
+ :current-node-key="formCategoryId"
|
|
|
|
+ @node-click="formCategoryClick"
|
|
|
|
+ />
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sc-user-select__user">
|
|
|
|
+ <div class="sc-user-select__user__list">
|
|
|
|
+ <el-scrollbar ref="formTemplateScrollbar">
|
|
|
|
+ <el-tree
|
|
|
|
+ ref="formTemplateTree"
|
|
|
|
+ class="menu"
|
|
|
|
+ :data="formTemplate"
|
|
|
|
+ :node-key="formTemplateProps.key"
|
|
|
|
+ :props="formTemplateProps"
|
|
|
|
+ :default-checked-keys="selectedIds"
|
|
|
|
+ show-checkbox
|
|
|
|
+ check-on-click-node
|
|
|
|
+ @check-change="formTemplateClick"
|
|
|
|
+ ></el-tree>
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </div>
|
|
|
|
+ <footer>
|
|
|
|
+ <el-pagination
|
|
|
|
+ v-model:currentPage="currentPage"
|
|
|
|
+ background
|
|
|
|
+ layout="prev,next"
|
|
|
|
+ small
|
|
|
|
+ :total="total"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ @current-change="paginationChange"
|
|
|
|
+ ></el-pagination>
|
|
|
|
+ </footer>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sc-user-select__toicon">
|
|
|
|
+ <el-icon><arrow-right /></el-icon>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sc-user-select__selected">
|
|
|
|
+ <header>已选 ({{ selected.length }})</header>
|
|
|
|
+ <ul style="margin: 0; padding: 0">
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <li v-for="(item, index) in selected" :key="item.id">
|
|
|
|
+ <span class="name">
|
|
|
|
+ <el-avatar size="small">{{ item.name?.substring(0, 1) }}</el-avatar>
|
|
|
|
+ <label>{{ item.name || '-' }}</label>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="delete">
|
|
|
|
+ <el-button type="danger" icon="Delete" circle size="small" @click="deleteSelected(index)" />
|
|
|
|
+ </span>
|
|
|
|
+ </li>
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button type="primary" @click="save">确 认</el-button>
|
|
<el-button type="primary" @click="save">确 认</el-button>
|
|
@@ -142,6 +220,10 @@ import config from '@/config/workflow'
|
|
import department from '@/api/system/department'
|
|
import department from '@/api/system/department'
|
|
import user from '@/api/system/user'
|
|
import user from '@/api/system/user'
|
|
import role from '@/api/system/role'
|
|
import role from '@/api/system/role'
|
|
|
|
+import formCategory from '@/api/flow/formcategory'
|
|
|
|
+import formtemplate from '@/api/flow/formtemplate'
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
modelValue: { type: Boolean, default: false },
|
|
modelValue: { type: Boolean, default: false },
|
|
@@ -164,6 +246,15 @@ export default {
|
|
label: 'name',
|
|
label: 'name',
|
|
children: 'children'
|
|
children: 'children'
|
|
},
|
|
},
|
|
|
|
+ formCategoryProps: {
|
|
|
|
+ key: 'id',
|
|
|
|
+ label: 'name',
|
|
|
|
+ children: 'children'
|
|
|
|
+ },
|
|
|
|
+ formTemplateProps: {
|
|
|
|
+ key: 'id',
|
|
|
|
+ label: 'name'
|
|
|
|
+ },
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
showGrouploading: false,
|
|
showGrouploading: false,
|
|
showUserloading: false,
|
|
showUserloading: false,
|
|
@@ -174,10 +265,16 @@ export default {
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
group: [],
|
|
group: [],
|
|
user: [],
|
|
user: [],
|
|
|
|
+
|
|
role: [],
|
|
role: [],
|
|
- type: 1, // 1: 用户 3: 角色
|
|
|
|
|
|
+ type: 1, // 1: 用户 3: 角色 5: 子表单
|
|
selected: [],
|
|
selected: [],
|
|
- value: []
|
|
|
|
|
|
+ value: [],
|
|
|
|
+
|
|
|
|
+ // 表单分类
|
|
|
|
+ formCategoryTree: [],
|
|
|
|
+ formCategoryId: '',
|
|
|
|
+ formTemplate: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -187,7 +284,8 @@ export default {
|
|
curTitle() {
|
|
curTitle() {
|
|
return {
|
|
return {
|
|
1: '人员选择',
|
|
1: '人员选择',
|
|
- 3: '角色选择'
|
|
|
|
|
|
+ 3: '角色选择',
|
|
|
|
+ 5: '表单分类选择'
|
|
}[this.type]
|
|
}[this.type]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -195,7 +293,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
//打开赋值
|
|
//打开赋值
|
|
open(type, data) {
|
|
open(type, data) {
|
|
- // 1: 用户 3: 角色
|
|
|
|
|
|
+ // 1: 用户 3: 角色 5: 子表单
|
|
this.type = type
|
|
this.type = type
|
|
this.value = JSON.parse(JSON.stringify(data || []))
|
|
this.value = JSON.parse(JSON.stringify(data || []))
|
|
this.selected = JSON.parse(JSON.stringify(data || []))
|
|
this.selected = JSON.parse(JSON.stringify(data || []))
|
|
@@ -206,6 +304,9 @@ export default {
|
|
this.getUser()
|
|
this.getUser()
|
|
} else if (this.type === 3) {
|
|
} else if (this.type === 3) {
|
|
this.getRole()
|
|
this.getRole()
|
|
|
|
+ } else if (this.type === 5) {
|
|
|
|
+ this.getFormCategoryListTreeListEv()
|
|
|
|
+ this.getFormTemplateListEv()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//获取组织
|
|
//获取组织
|
|
@@ -259,9 +360,24 @@ export default {
|
|
this.selected = this.selected.filter(item => item.id != data.id)
|
|
this.selected = this.selected.filter(item => item.id != data.id)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //表单模板点击
|
|
|
|
+ formTemplateClick(data, checked) {
|
|
|
|
+ if (checked) {
|
|
|
|
+ this.selected.push({
|
|
|
|
+ id: data.id,
|
|
|
|
+ name: data.name
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.selected = this.selected.filter(item => item.id != data.id)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//用户分页点击
|
|
//用户分页点击
|
|
paginationChange() {
|
|
paginationChange() {
|
|
- this.getUser()
|
|
|
|
|
|
+ if (this.type === 1) {
|
|
|
|
+ this.getUser()
|
|
|
|
+ } else if (this.type === 5) {
|
|
|
|
+ this.getFormTemplateListEv()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//用户搜索
|
|
//用户搜索
|
|
search() {
|
|
search() {
|
|
@@ -309,6 +425,34 @@ export default {
|
|
}
|
|
}
|
|
this.$emit('update:selected', this.value)
|
|
this.$emit('update:selected', this.value)
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
|
|
+ },
|
|
|
|
+ // 获取表单分类树结构
|
|
|
|
+ async getFormCategoryListTreeListEv() {
|
|
|
|
+ let data = await formCategory.formCategoryListTreeApi({})
|
|
|
|
+ this.formCategoryTree = [{ id: '', name: '所有', children: data }]
|
|
|
|
+ },
|
|
|
|
+ // 分类点击
|
|
|
|
+ formCategoryClick(data) {
|
|
|
|
+ this.keyword = ''
|
|
|
|
+ this.currentPage = 1
|
|
|
|
+ this.formCategoryId = data.id
|
|
|
|
+ this.getFormTemplateListEv()
|
|
|
|
+ },
|
|
|
|
+ // 获取表单分类下的表单模板
|
|
|
|
+ async getFormTemplateListEv() {
|
|
|
|
+ var params = {
|
|
|
|
+ data: {
|
|
|
|
+ name: this.keyword || null,
|
|
|
|
+ formCategoryId: this.formCategoryId || null
|
|
|
|
+ },
|
|
|
|
+ page: this.currentPage,
|
|
|
|
+ pageSize: this.pageSize
|
|
|
|
+ }
|
|
|
|
+ const data = await formtemplate.formTemplateSimpleListApi(params)
|
|
|
|
+ console.log(data, '=')
|
|
|
|
+ this.formTemplate = data.records
|
|
|
|
+ this.total = data.total || 0
|
|
|
|
+ this.$refs.formTemplateScrollbar.setScrollTop(0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|