feat: 细节调整

This commit is contained in:
xuziqiang
2024-06-11 13:37:10 +08:00
parent cbfa942ff6
commit d58f066b39
8 changed files with 116 additions and 78 deletions

View File

@@ -1,5 +1,5 @@
# port
VITE_PORT = 3301
VITE_PORT = 3302
#mode
VITE_GLOB_APP_RUN_TYPE = saas

View File

@@ -6,4 +6,8 @@ export enum enterPrise {
edit = `${BASE_URL}/admin/org/edit`,
save = `${BASE_URL}/admin/org/save`,
link = `${BASE_URL}/admin/org/link`,
getArea = `${BASE_URL}/system/queryAddressTree`,
freeze = `${BASE_URL}/admin/org/freeze`,
getCode = `${BASE_URL}/admin/org/getCode`,
queryRootAc = `${BASE_URL}/admin/org/queryRootAc`,
}

View File

@@ -1,18 +1,19 @@
import { mockData } from './mock';
import { cloneDeep } from 'lodash-es';
import { Modal } from 'ant-design-vue';
import { Modal, message } from 'ant-design-vue';
import { createVNode, ref } from 'vue';
import { NsMessage } from '/nerv-lib/component';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { enterPrise } from '/@/api/origanizemanage';
type status = 'NORMAL' | 'FREEZE';
export const formConfig = [
{
field: 'zuzhi',
field: 'projectId',
label: '组织ID',
component: 'NsInput',
componentProps: {
placeholder: '请输入组织ID',
disabled: true,
},
rules: [
{
@@ -50,19 +51,17 @@ export const formConfig = [
{
field: 'cityName',
label: '省市区',
component: 'NsInputCity',
defaultValue: '',
fieldMap: ['provinceName', 'cityName', 'areaName', 'province', 'city', 'area'],
component: 'NsCascader',
componentProps: {
placeholder: '请选择',
api: '/api/parking_merchant/objs/BaseArea',
isSeparate: true,
api: enterPrise.getArea,
fieldNames: { label: 'regionName', value: 'regionCode' },
showSearch: true,
},
rules: [
{
required: true,
message: '请选择区',
trigger: 'blur',
message: '请选择省市区',
},
],
},
@@ -76,7 +75,7 @@ export const formConfig = [
},
},
{
field: 'person',
field: 'contacts',
label: '联系人',
component: 'NsInput',
componentProps: {
@@ -92,7 +91,7 @@ export const formConfig = [
],
},
{
field: 'phone',
field: 'phoneNumber',
label: '联系电话',
component: 'NsInput',
componentProps: {
@@ -119,14 +118,6 @@ export const tableConfig = (visible) => {
name: 'RoleTypeAdd',
type: 'primary',
handle: () => {
opMap.type = 'add';
opMap.fuc = (formData: any) => {
console.log(formData, 'formData');
mockData.value.push({
id: Math.random().toString().slice(2, 6),
...cloneDeep(formData),
});
};
visible.value = true;
},
},
@@ -144,11 +135,11 @@ export const tableConfig = (visible) => {
},
{
title: '组织ID',
dataIndex: 'orgCode',
dataIndex: 'projectId',
},
{
title: '集团名称',
dataIndex: 'intro',
dataIndex: 'cliqueName',
},
{
title: '组织名称',
@@ -157,6 +148,9 @@ export const tableConfig = (visible) => {
{
title: '状态',
dataIndex: 'status',
customRender: ({ value }) => {
return { NORMAL: '正常', FREEZE: '冻结' }[value as status];
},
},
{
title: '省市区',
@@ -172,15 +166,16 @@ export const tableConfig = (visible) => {
},
{
title: '联系人',
dataIndex: 'person',
dataIndex: 'contacts',
},
{
title: '联系电话',
dataIndex: 'phone',
dataIndex: 'phoneNumber',
},
],
columnActions: {
title: '操作',
autoMergeAction: false,
actions: [
{
label: '编辑',
@@ -211,18 +206,26 @@ export const tableConfig = (visible) => {
},
{
label: '冻结',
name: 'RoleTypeEdit',
handle: (record: any) => {
console.log(record, 'record');
Modal.confirm({
title: '是否冻结该账户',
icon: createVNode(ExclamationCircleOutlined),
content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {
NsMessage.success('冻结成功');
},
class: 'test',
});
name: 'enterPriseFreeze',
confirm: true,
isReload: true,
ifShow: ({ status }) => status === 'NORMAL',
api: enterPrise.freeze,
dynamicParams: 'orgId',
defaultParams: {
isFreeze: true,
},
},
{
label: '解冻',
name: 'enterPriseUnFreeze',
confirm: true,
isReload: true,
ifShow: ({ status }) => status === 'FREEZE',
dynamicParams: 'orgId',
api: enterPrise.freeze,
defaultParams: {
isFreeze: false,
},
},
{

View File

@@ -2,19 +2,13 @@
<template>
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" rowKey="uuid" />
<a-drawer
:width="600"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<ns-drawer v-bind="addDrawerConfig">
<ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" />
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button>
</template>
</a-drawer>
</ns-drawer>
<a-drawer
:width="600"
:visible="borderVisible"
@@ -94,6 +88,15 @@
const tableConfig = computed(() => {
return insertConfig(visible);
});
const getOrgRandomCode = () => {
http.post(enterPrise.getCode).then((res) => {
formData.value.projectId = res.data;
});
};
getOrgRandomCode();
// drawer form
const opMap: any = {
type: 'add',
fuc: () => {},
@@ -120,6 +123,14 @@
serviceVisible.value = false;
};
const addDrawerConfig = ref({
width: '520',
visible: visible,
footerStyle: { textAlign: 'right' },
destroyOnClose: true,
onClose: onClose,
});
const borderAdd = () => {
treeAddVisible.value = true;
treeAdd.value?.toggle();