lijingjia 3 months ago
commit 7eda0c7c70

@ -3,10 +3,11 @@
import { TreeNodeData } from 'element-plus/es/components/tree/src/tree.type'
import { type ElTree } from 'element-plus'
import { reactive, ref, watch } from 'vue'
import { getList } from '/@/views/baseinfo/clientflowtemplate/api'
import { getUsetList } from '/@/views/baseinfo/clientflowtemplate/api'
import { School, Check } from '@element-plus/icons-vue'
import Node from 'element-plus/es/components/tree/src/model/node'
import { useAppStore } from '/@/store/modules/app'
const appStore = useAppStore()
export type ModelValueType = string | string[] | null | undefined
export interface UserDropdownProps {
@ -90,16 +91,18 @@
const open = () => {
dialogVisible.value = true
}
const changeHandle = (v, b) => {
onOpen(b)
}
const onOpen = (v) => {
getList({ queryKey: v }).then((res) => {
const onOpen = () => {
getUsetList().then((res) => {
if (res.succeeded) {
res.data.forEach((item) => {
item.value = item.id
item.label = item.userName
})
appStore.setUserList(res.data)
userOrgOptions.value = res.data.map((e) => {
return {
id: e.value,
name: e.label,
id: e.id,
name: e.userName,
type: 'user',
leaf: true,
avatar: e.avatar,

@ -1,8 +1,9 @@
<script setup lang="ts">
import { getList } from '/@/views/baseinfo/clientflowtemplate/api'
import { getUsetList } from '/@/views/baseinfo/clientflowtemplate/api'
import { componentSizeMap, useFormSize } from 'element-plus'
import { computed, onMounted, reactive } from 'vue'
import { useAppStore } from '/@/store/modules/app'
const appStore = useAppStore()
export interface UserTagProps {
username: string
type?: 'success' | 'info' | 'warning' | 'danger'
@ -29,19 +30,20 @@
name: undefined,
})
onMounted(() => {
console.log($props.username)
if (!$props.username) {
throw new Error('username is required')
}
getList().then((res) => {
getUsetList().then((res) => {
if (res.succeeded) {
res.data.forEach((item) => {
if (item.value == $props.username) {
userInfo.username = item.value
userInfo.name = item.label
item.value = item.id
item.label = item.userName
if (item.id == $props.username) {
userInfo.username = item.id
userInfo.name = item.userName
}
})
appStore.setUserList(res.data)
}
})
})

@ -36,18 +36,18 @@ interface AppState {
bookingGridOptions: any
saveNeedNumber: string
deleteId: string
FlowInstanceHistory:any
FlowInstanceHistory: any
inBookingDetailsSave: boolean
saveFlag: boolean
ctnallList: any
FlowInstancesDetailsType:String
FlowInstancesDetailsType: String
needSavePages: any
yardFilter: any
hasbookingDetail: boolean
agentFilter: any
slotShow: boolean,
ids: any,
SourceData:any
slotShow: boolean
ids: any
SourceData: any
}
let timeId: TimeoutHandle
export const useAppStore = defineStore({
@ -76,12 +76,12 @@ export const useAppStore = defineStore({
hasbookingDetail: false,
agentFilter: {},
slotShow: false,
FlowInstanceHistory:[],
FlowInstancesDetailsType:'',
FlowInstanceHistory: [],
FlowInstancesDetailsType: '',
// 存储列表id集合上下票使用
ids: {},
// 业务来源>业务明细 缓存
SourceData:[]
SourceData: [],
}),
getters: {
getSourceData(): any {
@ -102,10 +102,10 @@ export const useAppStore = defineStore({
getyardFilter(): any {
return this.yardFilter
},
getFlowInstancesDetailsType():any {
getFlowInstancesDetailsType(): any {
return this.FlowInstancesDetailsType
},
getFlowInstanceHistory():any {
getFlowInstanceHistory(): any {
return this.FlowInstanceHistory
},
getneedSavePages(): any {
@ -246,6 +246,18 @@ export const useAppStore = defineStore({
this.LanguageType = data
},
setUserList(data): void {
// data.forEach((e) => {
// let type = true
// this.UserList.forEach((item) => {
// if (e.id == item.id) {
// type = false
// }
// })
// if (type) {
// this.UserList.push(e)
// }
// })
this.UserList = data
},
setRolesList(data): void {

@ -132,6 +132,17 @@ export const formSchema: FormSchema[] = [
}
},
},
{
field: 'isShared',
label: '是否共享',
component: 'Switch',
defaultValue: false,
colProps: { span: 4 },
componentProps: {
checkedChildren: '是',
unCheckedChildren: '否',
},
},
{
label: '附件',
field: 'attachments',

@ -2,7 +2,7 @@
import Segmented from '/@/components/Segmented'
import { useVModels } from '@vueuse/core'
import { ApprovalNode } from '../nodes/Approval/index'
import { computed, inject, Ref, ref, watchEffect } from 'vue'
import { computed, inject, Ref, ref, watchEffect, watch } from 'vue'
import { CircleCheck, CircleClose, Switch, Plus, Minus } from '@element-plus/icons-vue'
import { Field } from '/@/components/Render/interface'
import { FormProperty } from '/@/baseinfo/flowtemplate/Lowflow/views/index'
@ -149,6 +149,15 @@
})
}
})
watch(
() => node.users,
(newVal, oldVal) => {
console.log('State changed:', newVal, oldVal, '?????????????????????????????')
},
{
deep: true, //
},
)
</script>
<template>

@ -14,6 +14,7 @@ enum Api {
GetTables = '/mainApi/Common/GetTables',
getClientPermissionTreeList = '/mainApi/Common/GetClientPermissionTreeList',
getList = '/mainApi/Common/GetUserList',
getUsetList = '/mainApi/User/GetUserList',
downloadXml = '/stage-api/workflow/model/download',
getByUsername = '/stage-api/user/info',
getById = '/stage-api/role/info',
@ -90,6 +91,15 @@ export function getList(params) {
params
})
}
// 获取全部用户
export function getUsetList() {
return request<DataResult>({
url: Api.getUsetList,
method: 'post',
data:{queryCondition:"[]",pageCondition:{pageIndex:1,pageSize:9999,sortConditions:[]}}
})
}
// 详情
export function getTenantAuditInfo(query: { id: string }) {
return request<DataResult>({

@ -491,6 +491,10 @@
})
}
if (type) {
console.log(res.data, '??????????????????')
if (!res.data.serviceItemCodes) {
res.data.serviceItemCodes = []
}
await setFieldsValue({
...res.data,
})

@ -19,7 +19,8 @@ import {
} from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
import { useRoute } from 'vue-router'
const route = useRoute()
// exports {}
let ClientFrtList = []
const res: API.DataResult = await getClientFrtSelectList()
@ -949,10 +950,18 @@ export const formSchema: FormSchema[] = [
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: {
api: GetServiceProjectList,
api: () => {
return new Promise((resolve) => {
GetServiceProjectList({
queryType: 0,
}).then((res) => {
resolve(res.data)
})
})
},
labelField: 'projectName',
valueField: 'projectCode',
resultField: 'data.ext',
resultField: 'ext',
allowClear: true,
mode: 'multiple',
class: 'NoLimitHeight',
@ -965,7 +974,7 @@ export const formSchema: FormSchema[] = [
colProps: { span: 12 },
componentProps: {
api: getNotifications,
labelField: 'label',
labelField: 'name',
valueField: 'value',
resultField: 'data',
allowClear: true,

@ -88,7 +88,6 @@ export const formSchema: FormSchema[] = [
field: 'cnExplain',
label: '中文说明',
component: 'InputTextArea',
required: true,
colProps: { span: 20 },
componentProps: {
rows: 2,

@ -2,12 +2,12 @@
<BasicModal
v-bind="$attrs"
title="用户权限配置"
width="80%"
width="60%"
@register="registerModal"
@ok="handleSubmit"
>
<a-row :gutter="16">
<a-col :span="4">
<a-col :span="6">
<BasicTree
:tree-data="treeData"
:fieldNames="fieldNames"
@ -16,21 +16,8 @@
@select="onselect"
/>
</a-col>
<a-col :span="10">
<dataruleIndex
ref="RefdataruleIndex"
:permissionId="permissionId"
@Create="Create"
@ChangeSelect="ChangeSelect"
/>
</a-col>
<a-col :span="10">
<dataruleInfo
ref="RefdataruleInfo"
:permissionId="permissionId"
:InfoId="InfoId"
@success="success"
/>
<a-col :span="18">
<dataruleIndex :permissionId="permissionId" />
</a-col>
</a-row>
<template #footer>
@ -59,12 +46,8 @@
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicTree, TreeItem } from '/@/components/Tree'
import dataruleIndex from './dataruleIndex.vue'
import dataruleInfo from './dataruleInfo.vue'
import { PopConfirmButton } from '/@/components/Button'
// import { queryTreeListForRole, queryRolePermission, saveRolePermission } from '../role.api';
import { GetClientUserPermissions } from './api'
// const emit = defineEmits(['register']);
//
const treeData = ref<TreeItem[]>([])
//
@ -96,29 +79,7 @@
})
if (type) {
permissionId.value = checkedKeys[0]
InfoId.value = ''
RefdataruleInfo.value.resetFields()
RefdataruleInfo.value.setFieldsValue({ permissionId: permissionId.value })
}
}
const RefdataruleIndex = ref()
const RefdataruleInfo = ref()
//
function Create() {
console.log(permissionId.value)
RefdataruleIndex.value.clearSelectedRowKeys()
RefdataruleInfo.value.resetFields()
RefdataruleInfo.value.setFieldsValue({ permissionId: permissionId.value })
}
//
function success() {
RefdataruleIndex.value.reload()
}
const InfoId = ref('')
//
function ChangeSelect(data) {
InfoId.value = data[0]
}
/**
* 数据重置
@ -133,7 +94,6 @@
* 提交
*/
async function handleSubmit(exit) {
RefdataruleInfo.value.handleSave()
if (exit) {
closeModal()
}

@ -9,11 +9,20 @@
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'roleName'">
<span style="color: #0d84ff" @click="handleEdit(record)">{{ record.roleName }}</span>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: handleAudit.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<dataruleInfo @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
@ -21,17 +30,18 @@
import { indexcolumns } from './columns.tsx'
import { watch } from 'vue'
import { GetDataRuleListByPermission } from './api'
import { useModal } from '/@/components/Modal'
import dataruleInfo from './dataruleInfo.vue'
const props = defineProps({
permissionId: { type: String },
})
// Emits
const emit = defineEmits(['Create', 'ChangeSelect'])
watch(
() => props.permissionId,
(Nval) => {
reload()
},
)
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({
title: '',
api: async () => {
@ -54,15 +64,27 @@
canResize: true,
immediate: false,
clickToRowSelect: true,
rowSelection: {
type: 'radio',
onChange: (selectedRowKeys: string[]) => {
emit('ChangeSelect', selectedRowKeys)
},
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
})
function handleCreate() {
emit('Create')
openModal(true, {
permissionId: props.permissionId,
isUpdate: false,
})
}
function handleAudit(record) {
openModal(true, {
record,
isUpdate: true,
})
}
function handleSuccess() {
reload()
}
defineExpose({
reload,

@ -1,38 +1,71 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<BasicForm @register="registerForm"> </BasicForm>
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref, watch } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { infoformSchema } from './columns.tsx'
import { editDataRule, getDataRuleInfo } from '/@/api/system/datarule'
import { useMessage } from '/@/hooks/web/useMessage'
const props = defineProps({
permissionId: { type: String },
InfoId: { type: String },
})
watch(
() => props.permissionId,
(Nval) => {
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
rowId.value = data.record.id
const res = await getDataRuleInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
permissionId: Nval,
...res.data,
field1: JSON.parse(res.data.dataRules),
})
},
)
watch(
() => props.InfoId,
(Nval) => {
if (Nval) {
rowId.value = Nval
GetData()
}
} else {
resetFields()
console.log(data.permissionId)
setFieldsValue({
permissionId: props.permissionId,
permissionId: data.permissionId,
})
}
},
)
setModalProps({ loading: false })
})
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -46,15 +79,6 @@
schemas: infoformSchema,
showActionButtonGroup: false,
})
async function GetData() {
const res = await getDataRuleInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
field1: JSON.parse(res.data.dataRules),
})
}
}
async function handleSave(exit) {
try {
const values = await validate()
@ -89,6 +113,7 @@
createMessage.error(res.message)
loading.value = false
}
exit && closeModal()
} finally {
loading.value = false
}

Loading…
Cancel
Save