dinghao
6 months ago
12 changed files with 1120 additions and 471 deletions
@ -0,0 +1,13 @@ |
|||
// import request from '@/utils/request';
|
|||
|
|||
// export function login(data) {
|
|||
// return request({
|
|||
// url: '/carbon-smart/api/user/queryUserByPage',
|
|||
// method: 'post',
|
|||
// data,
|
|||
// });
|
|||
// }
|
|||
|
|||
export const origanizemanage = { |
|||
list: '/carbon-smart/api/user/queryUserByPage', |
|||
}; |
@ -0,0 +1,166 @@ |
|||
import { ref } from 'vue'; |
|||
|
|||
export const formConfig = (disabled: Boolean) => { |
|||
return ref([ |
|||
{ |
|||
field: 'field111', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
schemas: [ |
|||
{ |
|||
label: '部门名称', |
|||
field: 'name', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: disabled, |
|||
placeholder: '请输入部门名称', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入部门名称', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '上级部门', |
|||
field: 'department', |
|||
component: 'NsSelect', |
|||
componentProps: { |
|||
disabled: true, |
|||
options: [ |
|||
{ |
|||
label: '部门1', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '部门2', |
|||
value: 2, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
label: '部门编码', |
|||
field: 'code', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: disabled, |
|||
placeholder: '请输入部门编码', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入部门编码', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '排序', |
|||
field: 'order', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: disabled, |
|||
placeholder: '请输入排序', |
|||
maxLength: 2, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'remark', |
|||
label: '备注', |
|||
component: 'NsTextarea', |
|||
componentProps: { |
|||
disabled: disabled, |
|||
placeholder: '请输入', |
|||
maxLength: 300, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]); |
|||
}; |
|||
|
|||
export const formConfig2 = (disabled2: Boolean) => { |
|||
return ref([ |
|||
{ |
|||
field: 'field111', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
schemas: [ |
|||
{ |
|||
label: '角色名称', |
|||
field: 'departname', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: disabled2, |
|||
placeholder: '请输入角色名称', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入角色名称', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '上级领导', |
|||
field: 'department', |
|||
component: 'NsSelect', |
|||
componentProps: { |
|||
disabled: true, |
|||
}, |
|||
}, |
|||
{ |
|||
label: '节点编码', |
|||
field: 'code', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: disabled2, |
|||
placeholder: '请输入节点编码', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入节点编码', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '是否部门领导', |
|||
field: 'isleader', |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
disabled: disabled2, |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '是', value: 1 }, |
|||
{ label: '否', value: 2 }, |
|||
], |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择是否部门领导', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'remark', |
|||
label: '备注', |
|||
component: 'NsTextarea', |
|||
componentProps: { |
|||
disabled: disabled2, |
|||
placeholder: '请输入', |
|||
maxLength: 300, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]); |
|||
}; |
@ -0,0 +1,74 @@ |
|||
<template> |
|||
<a-modal title="企业信息" :width="600" v-model:visible="visible" @ok="handleOk"> |
|||
<ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" /> |
|||
</a-modal> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
export default defineComponent({ |
|||
name: 'AddBorderVisible', |
|||
setup() { |
|||
let formData = ref({}); |
|||
const formRef = ref(); |
|||
const visible = ref(false); |
|||
const toggle = () => { |
|||
visible.value = !visible.value; |
|||
}; |
|||
const formSchema = reactive([ |
|||
{ |
|||
field: 'name', |
|||
label: '企业名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入企业名称', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入企业名称', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'Isshare', |
|||
label: '点位数据', |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '分享', value: 1 }, |
|||
{ label: '不分享', value: 2 }, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择是否分享', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
const handleOk = () => { |
|||
formRef.value?.triggerSubmit().then(() => { |
|||
toggle(); |
|||
}); |
|||
}; |
|||
return { handleOk, formData, formSchema, visible, toggle, formRef }; |
|||
}, |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less" scoped> |
|||
// :deep(.ns-child-form) { |
|||
// width: 1100px !important; |
|||
// justify-content: flex-start !important; |
|||
// } |
|||
// :deep(.ant-input-group-addon) { |
|||
// border: 0px solid #dcdfe2 !important; |
|||
// } |
|||
</style> |
@ -1,101 +1,109 @@ |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import { mockData } from './mock'; |
|||
import { cloneDeep } from 'lodash-es'; |
|||
import { Modal } from 'ant-design-vue'; |
|||
import { createVNode, ref } from 'vue'; |
|||
import { NsMessage } from '/nerv-lib/component'; |
|||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; |
|||
|
|||
export const tableConfig = { |
|||
title: '企业管理', |
|||
api: '/carbon_emission/device/getDeviceList', |
|||
|
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
}, |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '设备id', |
|||
dataIndex: 'id', |
|||
export const formConfig = [ |
|||
{ |
|||
field: 'zuzhi', |
|||
label: '组织ID', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入组织ID', |
|||
}, |
|||
{ |
|||
title: '设备编号', |
|||
dataIndex: 'deviceCode', |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入组织编号', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'jituanname', |
|||
label: '企业名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入企业名称', |
|||
maxLength: 20, |
|||
}, |
|||
{ |
|||
title: '设备名称', |
|||
dataIndex: 'deviceName', |
|||
textNumber: 8, |
|||
textEllipsis: true, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入企业名称', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'jituanname', |
|||
label: '集团名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入集团名称', |
|||
maxLength: 20, |
|||
}, |
|||
{ |
|||
title: '设备类别', |
|||
dataIndex: 'position', |
|||
}, |
|||
{ |
|||
field: 'cityName', |
|||
label: '省市区', |
|||
component: 'NsInputCity', |
|||
defaultValue: '', |
|||
fieldMap: ['provinceName', 'cityName', 'areaName', 'province', 'city', 'area'], |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
api: '/api/parking_merchant/objs/BaseArea', |
|||
isSeparate: true, |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
actions: [ |
|||
rules: [ |
|||
{ |
|||
label: '删除', |
|||
name: 'AppointMessageRefund', |
|||
confirm: true, |
|||
required: true, |
|||
message: '请选择区域', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'address', |
|||
label: '地址', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入地址', |
|||
maxLength: 50, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'person', |
|||
label: '联系人', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入联系人', |
|||
maxLength: 10, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
field: 'createTime', |
|||
label: '支付时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['queryStartDate', 'queryEndDate'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
}, |
|||
required: true, |
|||
message: '请输入联系人', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'phone', |
|||
label: '联系电话', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入联系电话', |
|||
maxLength: 11, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
field: 'payWay', |
|||
label: '支付方式', |
|||
component: 'NsSelect', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ |
|||
label: '全部', |
|||
value: '', |
|||
}, |
|||
{ |
|||
label: '现金', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '支付宝', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '微信', |
|||
value: 3, |
|||
}, |
|||
// {
|
|||
// label: '丰收互联',
|
|||
// value: 4,
|
|||
// },
|
|||
// {
|
|||
// label: '银联云闪付',
|
|||
// value: 5,
|
|||
// },
|
|||
// {
|
|||
// label: '余额',
|
|||
// value: 6,
|
|||
// },
|
|||
{ |
|||
label: '优惠支付', |
|||
value: 7, |
|||
}, |
|||
], |
|||
}, |
|||
required: true, |
|||
message: '请输入联系电话', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
// pagination: { pageSizeOptions: false },
|
|||
rowKey: 'uuid', |
|||
}; |
|||
]; |
|||
|
@ -0,0 +1,43 @@ |
|||
import { ref } from 'vue'; |
|||
|
|||
export const mockData = ref([ |
|||
{ |
|||
id: 3, |
|||
zuzhi: '22', |
|||
jituanname: 'axb', |
|||
zuzhiname: '张三', |
|||
status: '男', |
|||
area: '123456789', |
|||
address: '1234567889', |
|||
person: '1', |
|||
phone: '1', |
|||
}, |
|||
]); |
|||
|
|||
export const mockData2 = ref([ |
|||
{ |
|||
information: '铁路局1/产品部1/产品总监1', |
|||
}, |
|||
]); |
|||
|
|||
export const treeData = ref([ |
|||
{ |
|||
title: '铁路总局', |
|||
key: '0-0', |
|||
children: [ |
|||
{ title: '济阳站', key: '0-0-0' }, |
|||
{ title: '临沂站', key: '0-0-1' }, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
export const treeData2 = [ |
|||
{ |
|||
title: '全部', |
|||
key: '0-0', |
|||
children: [ |
|||
{ title: '产品部', key: '0-0-0' }, |
|||
{ title: '运维部', key: '0-0-1' }, |
|||
], |
|||
}, |
|||
]; |
@ -0,0 +1,126 @@ |
|||
import { mockData } from './mock'; |
|||
import { cloneDeep } from 'lodash-es'; |
|||
import { Modal } from 'ant-design-vue'; |
|||
import { createVNode, ref } from 'vue'; |
|||
import { NsMessage } from '/nerv-lib/component'; |
|||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; |
|||
export const formConfig = [ |
|||
{ |
|||
field: 'field111', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '用户信息', |
|||
schemas: [ |
|||
{ |
|||
label: '账号', |
|||
field: 'zhanghao', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入账号', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入账号', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '姓名', |
|||
field: 'name', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入姓名', |
|||
maxLength: 20, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入姓名', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '性别', |
|||
field: 'sex', |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '男', value: 1 }, |
|||
{ label: '女', value: 2 }, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
label: '手机号', |
|||
field: 'phone', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入手机号', |
|||
maxLength: 11, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入正确手机号格式', |
|||
pattern: /^[1][3-9][0-9]{9}$/, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '邮箱', |
|||
field: 'email', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入邮箱', |
|||
maxLength: 30, |
|||
}, |
|||
}, |
|||
{ |
|||
label: '组织关系', |
|||
field: 'relation', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: true, |
|||
maxLength: 30, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]; |
|||
export const formConfig2 = (casData: any) => { |
|||
return ref([ |
|||
{ |
|||
field: 'information', |
|||
component: 'NsCascader', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
displayRender: ({ labels }: any) => { |
|||
casData.value = labels; |
|||
return labels.join('/'); |
|||
}, |
|||
options: [ |
|||
{ |
|||
value: '1', |
|||
label: '铁路局', |
|||
children: [ |
|||
{ |
|||
value: '2', |
|||
label: '产品部', |
|||
children: [ |
|||
{ |
|||
value: '3', |
|||
label: '产品总监', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]); |
|||
}; |
@ -0,0 +1,43 @@ |
|||
import { ref } from 'vue'; |
|||
|
|||
export const mockData = ref([ |
|||
{ |
|||
id: 3, |
|||
zhanghao: 'axb', |
|||
name: '张三', |
|||
sex: '男', |
|||
phone: '123456789', |
|||
email: '1234567889', |
|||
relation: '1', |
|||
role: '1', |
|||
status: '1', |
|||
}, |
|||
]); |
|||
|
|||
export const mockData2 = ref([ |
|||
{ |
|||
information: '铁路局1/产品部1/产品总监1', |
|||
}, |
|||
]); |
|||
|
|||
export const treeData = ref([ |
|||
{ |
|||
title: '铁路总局', |
|||
key: '0-0', |
|||
children: [ |
|||
{ title: '济阳站', key: '0-0-0' }, |
|||
{ title: '临沂站', key: '0-0-1' }, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
export const treeData2 = [ |
|||
{ |
|||
title: '全部', |
|||
key: '0-0', |
|||
children: [ |
|||
{ title: '产品部', key: '0-0-0' }, |
|||
{ title: '运维部', key: '0-0-1' }, |
|||
], |
|||
}, |
|||
]; |
Loading…
Reference in new issue