|
@@ -1,6 +1,7 @@
|
|
|
<script setup name="BasicInfo">
|
|
|
-import { ref } from 'vue'
|
|
|
-import ApprovePersonDialog from '../approvePersonDialog'
|
|
|
+import { ref, nextTick, onMounted } from 'vue'
|
|
|
+import UseSelect from '@/components/scWorkflow/select'
|
|
|
+import flowDefinition from '@/api/flow/definition'
|
|
|
const props = defineProps({
|
|
|
label: {
|
|
|
type: String
|
|
@@ -10,38 +11,21 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
const visiblePopover = ref(false)
|
|
|
-const approvePersonDialogVisible = ref(false)
|
|
|
+const selectVisible = ref(false)
|
|
|
+const useSelectRef = ref(null)
|
|
|
+const nodeRoleList = ref([])
|
|
|
+const nodeRoleManageList = ref([])
|
|
|
+const currentNode = ref('nodeRoleList')
|
|
|
const formRef = ref()
|
|
|
const form = ref({
|
|
|
图标: '',
|
|
|
名称: 'test@example.com',
|
|
|
- 分组: 'Lolowan',
|
|
|
+ 分组: '',
|
|
|
谁可以发起该流程: '100',
|
|
|
管理员: '',
|
|
|
说明: ''
|
|
|
})
|
|
|
-const options = [
|
|
|
- {
|
|
|
- value: 'Option1',
|
|
|
- label: 'Option1'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option2',
|
|
|
- label: 'Option2'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option3',
|
|
|
- label: 'Option3'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option4',
|
|
|
- label: 'Option4'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option5',
|
|
|
- label: 'Option5'
|
|
|
- }
|
|
|
-]
|
|
|
+const options = ref([])
|
|
|
const rules = {
|
|
|
图标: [
|
|
|
{
|
|
@@ -85,8 +69,42 @@ const validate = () => {
|
|
|
}
|
|
|
|
|
|
const openApprovePerson = () => {
|
|
|
- approvePersonDialogVisible.value = !approvePersonDialogVisible.value
|
|
|
+ selectVisible.value = !selectVisible.value
|
|
|
+}
|
|
|
+
|
|
|
+const selectHandle = (type, data, name) => {
|
|
|
+ currentNode.value = name
|
|
|
+ openApprovePerson()
|
|
|
+ nextTick(() => {
|
|
|
+ useSelectRef.value.open(type, data)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const selectContentEv = item => {
|
|
|
+ if (currentNode.value === 'nodeRoleList') {
|
|
|
+ nodeRoleList.value = item
|
|
|
+ } else {
|
|
|
+ nodeRoleManageList.value = item
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+const delRole = (index, itemName) => {
|
|
|
+ if (itemName === 'nodeRoleList') {
|
|
|
+ nodeRoleList.value.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ nodeRoleManageList.value.splice(index, 1)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const getGroupList = async () => {
|
|
|
+ const data = await flowDefinition.flowDefinitionListCategoryApi({})
|
|
|
+ options.value = data || []
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getGroupList()
|
|
|
+})
|
|
|
+
|
|
|
defineExpose({
|
|
|
formRef,
|
|
|
validate
|
|
@@ -125,23 +143,44 @@ defineExpose({
|
|
|
</el-form-item>
|
|
|
<el-form-item label="分组" prop="分组">
|
|
|
<el-select v-model="form.分组">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option v-for="item in options" :key="item.categoryId" :label="item.categoryName" :value="item.categoryId" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="谁可以发起该流程(不选择,默认全员)" prop="谁可以发起该流程">
|
|
|
- <div class="add-btn" @click="openApprovePerson">
|
|
|
+ <div class="add-btn" @click="selectHandle(1, nodeRoleList, 'nodeRoleList')">
|
|
|
<el-icon :size="18"><Plus /></el-icon>
|
|
|
</div>
|
|
|
- <div></div>
|
|
|
+ <div class="tags-list" style="margin-top: 15px; width: 100%">
|
|
|
+ <el-tag
|
|
|
+ v-for="(role, index) in nodeRoleList"
|
|
|
+ :key="role.id"
|
|
|
+ type="info"
|
|
|
+ closable
|
|
|
+ style="margin-right: 8px"
|
|
|
+ @close="delRole(index, 'nodeRoleList')"
|
|
|
+ >{{ role.name }}</el-tag
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="管理员" prop="管理员">
|
|
|
- <div class="add-btn">
|
|
|
+ <div class="add-btn" @click="selectHandle(1, nodeRoleManageList, 'nodeRoleManageList')">
|
|
|
<el-icon :size="18"><Plus /></el-icon>
|
|
|
</div>
|
|
|
+ <div class="tags-list" style="margin-top: 15px; width: 100%">
|
|
|
+ <el-tag
|
|
|
+ v-for="(role, index) in nodeRoleManageList"
|
|
|
+ :key="role.id"
|
|
|
+ type="info"
|
|
|
+ closable
|
|
|
+ style="margin-right: 8px"
|
|
|
+ @close="delRole(index, 'nodeRoleManageList')"
|
|
|
+ >{{ role.name }}</el-tag
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <approve-person-dialog :model-value="approvePersonDialogVisible"></approve-person-dialog>
|
|
|
+ <use-select v-if="selectVisible" ref="useSelectRef" @closed="selectVisible = false" @contentEv="selectContentEv"></use-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
|