往来单位 工作流模板 用户管理 调整

szh-new
张同海 3 months ago
parent 0a978fbe2c
commit dbf5c5c3c1

@ -3,10 +3,11 @@
import { TreeNodeData } from 'element-plus/es/components/tree/src/tree.type' import { TreeNodeData } from 'element-plus/es/components/tree/src/tree.type'
import { type ElTree } from 'element-plus' import { type ElTree } from 'element-plus'
import { reactive, ref, watch } from 'vue' 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 { School, Check } from '@element-plus/icons-vue'
import Node from 'element-plus/es/components/tree/src/model/node' 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 type ModelValueType = string | string[] | null | undefined
export interface UserDropdownProps { export interface UserDropdownProps {
@ -91,12 +92,17 @@
dialogVisible.value = true dialogVisible.value = true
} }
const onOpen = () => { const onOpen = () => {
getList().then((res) => { getUsetList().then((res) => {
if (res.succeeded) { 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) => { userOrgOptions.value = res.data.map((e) => {
return { return {
id: e.value, id: e.id,
name: e.label, name: e.userName,
type: 'user', type: 'user',
leaf: true, leaf: true,
avatar: e.avatar, avatar: e.avatar,

@ -1,8 +1,9 @@
<script setup lang="ts"> <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 { componentSizeMap, useFormSize } from 'element-plus'
import { computed, onMounted, reactive } from 'vue' import { computed, onMounted, reactive } from 'vue'
import { useAppStore } from '/@/store/modules/app'
const appStore = useAppStore()
export interface UserTagProps { export interface UserTagProps {
username: string username: string
type?: 'success' | 'info' | 'warning' | 'danger' type?: 'success' | 'info' | 'warning' | 'danger'
@ -29,19 +30,20 @@
name: undefined, name: undefined,
}) })
onMounted(() => { onMounted(() => {
console.log($props.username)
if (!$props.username) { if (!$props.username) {
throw new Error('username is required') throw new Error('username is required')
} }
getList().then((res) => { getUsetList().then((res) => {
if (res.succeeded) { if (res.succeeded) {
res.data.forEach((item) => { res.data.forEach((item) => {
if (item.value == $props.username) { item.value = item.id
userInfo.username = item.value item.label = item.userName
userInfo.name = item.label 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 bookingGridOptions: any
saveNeedNumber: string saveNeedNumber: string
deleteId: string deleteId: string
FlowInstanceHistory:any FlowInstanceHistory: any
inBookingDetailsSave: boolean inBookingDetailsSave: boolean
saveFlag: boolean saveFlag: boolean
ctnallList: any ctnallList: any
FlowInstancesDetailsType:String FlowInstancesDetailsType: String
needSavePages: any needSavePages: any
yardFilter: any yardFilter: any
hasbookingDetail: boolean hasbookingDetail: boolean
agentFilter: any agentFilter: any
slotShow: boolean, slotShow: boolean
ids: any, ids: any
SourceData:any SourceData: any
} }
let timeId: TimeoutHandle let timeId: TimeoutHandle
export const useAppStore = defineStore({ export const useAppStore = defineStore({
@ -76,12 +76,12 @@ export const useAppStore = defineStore({
hasbookingDetail: false, hasbookingDetail: false,
agentFilter: {}, agentFilter: {},
slotShow: false, slotShow: false,
FlowInstanceHistory:[], FlowInstanceHistory: [],
FlowInstancesDetailsType:'', FlowInstancesDetailsType: '',
// 存储列表id集合上下票使用 // 存储列表id集合上下票使用
ids: {}, ids: {},
// 业务来源>业务明细 缓存 // 业务来源>业务明细 缓存
SourceData:[] SourceData: [],
}), }),
getters: { getters: {
getSourceData(): any { getSourceData(): any {
@ -102,10 +102,10 @@ export const useAppStore = defineStore({
getyardFilter(): any { getyardFilter(): any {
return this.yardFilter return this.yardFilter
}, },
getFlowInstancesDetailsType():any { getFlowInstancesDetailsType(): any {
return this.FlowInstancesDetailsType return this.FlowInstancesDetailsType
}, },
getFlowInstanceHistory():any { getFlowInstanceHistory(): any {
return this.FlowInstanceHistory return this.FlowInstanceHistory
}, },
getneedSavePages(): any { getneedSavePages(): any {
@ -246,6 +246,18 @@ export const useAppStore = defineStore({
this.LanguageType = data this.LanguageType = data
}, },
setUserList(data): void { 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 this.UserList = data
}, },
setRolesList(data): void { setRolesList(data): void {

@ -2,7 +2,7 @@
import Segmented from '/@/components/Segmented' import Segmented from '/@/components/Segmented'
import { useVModels } from '@vueuse/core' import { useVModels } from '@vueuse/core'
import { ApprovalNode } from '../nodes/Approval/index' 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 { CircleCheck, CircleClose, Switch, Plus, Minus } from '@element-plus/icons-vue'
import { Field } from '/@/components/Render/interface' import { Field } from '/@/components/Render/interface'
import { FormProperty } from '/@/baseinfo/flowtemplate/Lowflow/views/index' 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> </script>
<template> <template>

@ -14,6 +14,7 @@ enum Api {
GetTables = '/mainApi/Common/GetTables', GetTables = '/mainApi/Common/GetTables',
getClientPermissionTreeList = '/mainApi/Common/GetClientPermissionTreeList', getClientPermissionTreeList = '/mainApi/Common/GetClientPermissionTreeList',
getList = '/mainApi/Common/GetUserList', getList = '/mainApi/Common/GetUserList',
getUsetList = '/mainApi/User/GetUserList',
downloadXml = '/stage-api/workflow/model/download', downloadXml = '/stage-api/workflow/model/download',
getByUsername = '/stage-api/user/info', getByUsername = '/stage-api/user/info',
getById = '/stage-api/role/info', getById = '/stage-api/role/info',
@ -89,6 +90,15 @@ export function getList() {
method: 'get', method: 'get',
}) })
} }
// 获取全部用户
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 }) { export function getTenantAuditInfo(query: { id: string }) {
return request<DataResult>({ return request<DataResult>({

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

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

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

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

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

@ -1,38 +1,71 @@
<template> <template>
<BasicForm @register="registerForm"> </BasicForm> <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> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, unref, watch } from 'vue' import { ref, unref, watch } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { infoformSchema } from './columns.tsx' import { infoformSchema } from './columns.tsx'
import { editDataRule, getDataRuleInfo } from '/@/api/system/datarule' import { editDataRule, getDataRuleInfo } from '/@/api/system/datarule'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const props = defineProps({ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
permissionId: { type: String }, resetFields()
InfoId: { type: String }, setModalProps({ confirmLoading: false, loading: true })
}) isUpdate.value = !!data?.isUpdate
watch( if (unref(isUpdate)) {
() => props.permissionId, rowId.value = data.record.id
(Nval) => { const res = await getDataRuleInfo({ id: unref(rowId) })
setFieldsValue({ if (res.succeeded) {
permissionId: Nval,
})
},
)
watch(
() => props.InfoId,
(Nval) => {
if (Nval) {
rowId.value = Nval
GetData()
} else {
resetFields()
setFieldsValue({ setFieldsValue({
permissionId: props.permissionId, ...res.data,
field1: JSON.parse(res.data.dataRules),
}) })
} }
}, } else {
) console.log(data.permissionId)
setFieldsValue({
permissionId: data.permissionId,
})
}
setModalProps({ loading: false })
})
// Emits // Emits
const emit = defineEmits(['success', 'register']) const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true) const isUpdate = ref(true)
@ -46,15 +79,6 @@
schemas: infoformSchema, schemas: infoformSchema,
showActionButtonGroup: false, 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) { async function handleSave(exit) {
try { try {
const values = await validate() const values = await validate()
@ -89,6 +113,7 @@
createMessage.error(res.message) createMessage.error(res.message)
loading.value = false loading.value = false
} }
exit && closeModal()
} finally { } finally {
loading.value = false loading.value = false
} }

Loading…
Cancel
Save