Browse Source

fix():修改计费规则传参

tags/PMS_Frontend_v1.0.6-develop
guoxin 1 year ago
parent
commit
20d1dc1069
  1. 49
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
  2. 218
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
  3. 285
      src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss
  4. 72
      src/pages/SystemMgm/OrgnizationMgm/loadable.jsx

49
src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx

@ -30,7 +30,7 @@ const FormModal = (props) => {
const defaultData = { const defaultData = {
feeName: '', feeName: '',
freeTimeAble: 0, freeTimeAble: 0,
operationId: '',
operator_name: '',
feeCode: '', feeCode: '',
freeTime: '', freeTime: '',
description: '', description: '',
@ -255,7 +255,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="feeName" name="feeName"
label="规则名称" label="规则名称"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入规则名称" style={{ width: 200, marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入规则名称" style={{ width: 200, marginLeft: 10 }} autoComplete="off" />
@ -264,16 +264,16 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="feeCode" name="feeCode"
label="规则编码" label="规则编码"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入规则编码" style={{ width: 200, marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入规则编码" style={{ width: 200, marginLeft: 10 }} autoComplete="off" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="operationId"
name="operator_name"
label="商户名称" label="商户名称"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Select <Select
@ -299,8 +299,8 @@ const FormModal = (props) => {
<div className="row"> <div className="row">
<Form.Item <Form.Item
name="freeTime" name="freeTime"
label="普通免费分钟数"
className="yisa-label"
label="普通免费分钟数 "
className="yisa-label minSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入免费分钟数" style={{ marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入免费分钟数" style={{ marginLeft: 10 }} autoComplete="off" />
@ -320,7 +320,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="evFreeTime" name="evFreeTime"
label="免费分钟数" label="免费分钟数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
@ -333,7 +333,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="evCarDiscount" name="evCarDiscount"
label="折扣系数" label="折扣系数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
@ -387,14 +387,14 @@ const FormModal = (props) => {
// console.log(fields); // console.log(fields);
return ( return (
<div className="yisa-table"> <div className="yisa-table">
<div className="row-line" key={key}>
<div className="row-line" key={'rules-'+key}>
<div className="timeAdd"> <div className="timeAdd">
<Space direction="vertical" size={12}> <Space direction="vertical" size={12}>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "date"]} name={[name, "date"]}
label="生效日期" label="生效日期"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<DatePicker <DatePicker
@ -453,10 +453,10 @@ const FormModal = (props) => {
<Form.List name={[name, "details"]}> <Form.List name={[name, "details"]}>
{(fields, { add, remove }) => ( {(fields, { add, remove }) => (
<> <>
{fields.map(({ key, name, ...restField }, j) => {
{fields.map(({ key, name, ...restField }, i) => {
// console.log(fields); // console.log(fields);
return ( return (
<div key={key}>
<div key={'details-'+key}>
<div className="row"> <div className="row">
<Form.Item <Form.Item
{...restField} {...restField}
@ -466,7 +466,7 @@ const FormModal = (props) => {
> >
<TimePicker format={format} style={{ marginLeft: 10 }} /> <TimePicker format={format} style={{ marginLeft: 10 }} />
</Form.Item> </Form.Item>
to
<label className="mid">to</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "end"]} name={[name, "end"]}
@ -479,7 +479,7 @@ const FormModal = (props) => {
label="" label=""
> >
{ {
!j ?
!i ?
<PlusCircleOutlined <PlusCircleOutlined
onClick={() => onClick={() =>
add({ add({
@ -510,10 +510,9 @@ const FormModal = (props) => {
<Form.List name={[name, "items"]}> <Form.List name={[name, "items"]}>
{(fields, { add, remove }) => ( {(fields, { add, remove }) => (
<> <>
{fields.map(({ key, name, ...restField }, j) => {
// console.log(fields);
{fields.map(({ key, name, ...restField }, z) => {
return ( return (
<div className="row-line" key={key}>
<div className="row-line" key={'items-'+key}>
<div className="row"> <div className="row">
<Form.Item <Form.Item
name={[name, "type"]} name={[name, "type"]}
@ -539,8 +538,11 @@ const FormModal = (props) => {
]} ]}
/> />
</Form.Item> </Form.Item>
<Form.Item
noStyle
shouldUpdate>
{ {
getValue == 3 ?
form?.getFieldValue('rules')[j].details[i].items[z].type == '3' ?
<div className="row"> <div className="row">
<Form.Item <Form.Item
{...restField} {...restField}
@ -549,7 +551,7 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>/</label>
<label className="mid">/</label>
</div> </div>
: :
<div className="row"> <div className="row">
@ -561,7 +563,7 @@ const FormModal = (props) => {
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>分钟</label>
<label className="mid">分钟</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "unit"]} name={[name, "unit"]}
@ -569,7 +571,7 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>/</label>
<label className="mid">/</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "period"]} name={[name, "period"]}
@ -577,9 +579,10 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>分钟</label>
<label className="mid">分钟</label>
</div> </div>
} }
</Form.Item>
<Form.Item <Form.Item
className="btm-box" className="btm-box"
> >

218
src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx

@ -21,7 +21,7 @@ const FormModal = (props) => {
yisaData = {}, yisaData = {},
addVisible, addVisible,
closAddModal = () => { }, closAddModal = () => { },
setGetAddVisible=()=>{}
setGetAddVisible = () => { }
} = props } = props
// //
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -78,11 +78,13 @@ const FormModal = (props) => {
}; };
const [formData, setFormData] = useState(defaultData) const [formData, setFormData] = useState(defaultData)
const [getNewCar, setGetNewCar] = useState(false) const [getNewCar, setGetNewCar] = useState(false)
//
const getNewCarRef = useRef(null)
getNewCarRef.current = false
//
const [getPerson, setGetPerson] = useState()
const [getPerson, setGetPerson] = useState(false)
// //
// const getNewCarRef = useRef(null)
// getNewCarRef.current = false
// //
// const getNewCarDisability = useRef(null)
// getNewCarDisability.current = false
// //
const [getValue, setGetValue] = useState(1) const [getValue, setGetValue] = useState(1)
const [getValue2, setGetValue2] = useState(1) const [getValue2, setGetValue2] = useState(1)
@ -99,72 +101,71 @@ const FormModal = (props) => {
// //
const handleForm = (changedValues, allValues) => { const handleForm = (changedValues, allValues) => {
// let obj = {};
console.log('表单', changedValues, allValues);
let obj = {};
let key = Object.keys(changedValues)[0]; let key = Object.keys(changedValues)[0];
let val = Object.values(changedValues)[0]; let val = Object.values(changedValues)[0];
console.log('val', val);
console.log('key', key);
if(key == 'newCarStatus'){
getNewCarRef.current = val
}
// switch (key) {
// case "freeTimeAble":
// obj[key] = val ? 1 : 0;
// break;
// case "newCarStatus":
// obj[key] = val ? 1 : 0;
// break;
// case "rules":
// let _arr = allValues["rules"];
// if (val?.length) {
// //
// let curNum = val.length - 1;
// let curObj = val[curNum];
// if (curObj) {
// let _key = Object.keys(curObj)[0];
// let _val = Object.values(curObj)[0];
// if (_key == "unitUp") {
// _arr[curNum][_key] = _val ? 1 : 0;
// } else if (_key == "details" || _key == "holiday") {
// let _curNum = _val.length - 1;
// let _curObj = _val[curNum];
// if (_curObj) {
// let _dkey = Object.keys(_curObj)[0];
// let _dval = Object.values(_curObj)[0];
// if (_dkey == "items") {
// let _iurNum = _dval.length - 1;
// let _iurObj = _dval[curNum];
// if (_iurObj) {
// let _ikey = Object.keys(_iurObj)[0];
// let _ival = Object.values(_iurObj)[0];
// console.log('_ikey', _ikey, _ival);
// _arr[curNum][_key][_curNum][_dkey][_iurNum][_ikey] = _ival;
// }
// } else {
// _arr[curNum][_key][_curNum][_dkey] = _dval;
// }
// }
// } else {
// _arr[curNum][_key] = _val;
// }
// }
// }
// if (val?.date) {
// _arr[0].date = val.date;
// }
// obj[key] = _arr;
// break;
// default:
// obj[key] = val;
// break;
// }
if (key == 'newCarStatus') {
setGetNewCar(val)
}
if (key == 'newCarDisability') {
setGetPerson(val)
}
switch (key) {
case "freeTimeAble":
obj[key] = val ? 1 : 0;
break;
case "newCarStatus":
obj[key] = val ? 1 : 0;
break;
case "rules":
let _arr = allValues["rules"];
if (val?.length) {
//
let curNum = val.length - 1;
let curObj = val[curNum];
if (curObj) {
let _key = Object.keys(curObj)[0];
let _val = Object.values(curObj)[0];
if (_key == "unitUp") {
_arr[curNum][_key] = _val ? 1 : 0;
} else if (_key == "details" || _key == "holiday") {
let _curNum = _val.length - 1;
let _curObj = _val[curNum];
if (_curObj) {
let _dkey = Object.keys(_curObj)[0];
let _dval = Object.values(_curObj)[0];
if (_dkey == "items") {
let _iurNum = _dval.length - 1;
let _iurObj = _dval[curNum];
if (_iurObj) {
let _ikey = Object.keys(_iurObj)[0];
let _ival = Object.values(_iurObj)[0];
_arr[curNum][_key][_curNum][_dkey][_iurNum][_ikey] = _ival;
}
} else {
_arr[curNum][_key][_curNum][_dkey] = _dval;
}
}
} else {
_arr[curNum][_key] = _val;
}
}
}
if (val?.date) {
_arr[0].date = val.date;
}
obj[key] = _arr;
break;
default:
obj[key] = val;
break;
}
let newObj = { ...form.getFieldsValue() }; let newObj = { ...form.getFieldsValue() };
form.setFieldsValue(newObj); form.setFieldsValue(newObj);
changeGetNewCar()
// changeGetNewCar()
// changeNewCarDisability()
}; };
const changeGetNewCar = ()=>{
setGetNewCar(getNewCarRef.current)
}
// //
const handelTime = (arr, type) => { const handelTime = (arr, type) => {
@ -219,16 +220,12 @@ const FormModal = (props) => {
if (JSON.stringify(yisaData) != "{}") { if (JSON.stringify(yisaData) != "{}") {
newObj = handelDate(yisaData, 2) newObj = handelDate(yisaData, 2)
} }
// console.log(newObj);
form.setFieldsValue(newObj); form.setFieldsValue(newObj);
}, [yisaData]);
}, []);
useEffect(() => { useEffect(() => {
operationName() operationName()
}, []) }, [])
useEffect(() => {
console.log(getNewCar);
}, [getNewCar])
@ -253,7 +250,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="feeName" name="feeName"
label="规则名称" label="规则名称"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入规则名称" style={{ width: 200, marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入规则名称" style={{ width: 200, marginLeft: 10 }} autoComplete="off" />
@ -262,7 +259,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="feeCode" name="feeCode"
label="规则编码" label="规则编码"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入规则编码" style={{ width: 200, marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入规则编码" style={{ width: 200, marginLeft: 10 }} autoComplete="off" />
@ -271,7 +268,7 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="operationId" name="operationId"
label="商户名称" label="商户名称"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Select <Select
@ -298,82 +295,86 @@ const FormModal = (props) => {
<Form.Item <Form.Item
name="freeTime" name="freeTime"
label="普通免费分钟数" label="普通免费分钟数"
className="yisa-label"
className="yisa-label minSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<Input placeholder="请输入免费分钟数" style={{ marginLeft: 10 }} autoComplete="off" /> <Input placeholder="请输入免费分钟数" style={{ marginLeft: 10 }} autoComplete="off" />
</Form.Item> </Form.Item>
<label className="yisa-label">单位分钟免费停车时间</label> <label className="yisa-label">单位分钟免费停车时间</label>
</div> </div>
<Form.Item name="freeTimeAble" valuePropName="checked"> <Form.Item name="freeTimeAble" valuePropName="checked">
<Checkbox>免费分钟数不纳入计费时长</Checkbox> <Checkbox>免费分钟数不纳入计费时长</Checkbox>
</Form.Item> </Form.Item>
<Form.Item valuePropName="checked" name="newCarStatus"> <Form.Item valuePropName="checked" name="newCarStatus">
<Checkbox>新能源车</Checkbox> <Checkbox>新能源车</Checkbox>
</Form.Item> </Form.Item>
{
getNewCar?
{getNewCar ?
<div > <div >
<div className="place">
<Form.Item <Form.Item
name="evFreeTime" name="evFreeTime"
label="免费分钟数" label="免费分钟数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
style={{ width: 200, marginLeft: 10 }} style={{ width: 200, marginLeft: 10 }}
placeholder="请输入免费分钟数" placeholder="请输入免费分钟数"
/> />
<label>单位分钟免费停车时间</label>
</Form.Item> </Form.Item>
<label>单位分钟免费停车时间</label>
</div>
<div className="place">
<Form.Item <Form.Item
name="evCarDiscount" name="evCarDiscount"
label="折扣系数" label="折扣系数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
style={{ width: 200, marginLeft: 10 }} style={{ width: 200, marginLeft: 10 }}
placeholder="请输入0-100的值" placeholder="请输入0-100的值"
/> />
<label>单位%</label>
</Form.Item> </Form.Item>
<label>单位%</label>
</div>
</div> : ''}
</div> : ''
}
<Form.Item valuePropName="checked" name="newCarDisability"> <Form.Item valuePropName="checked" name="newCarDisability">
<Checkbox>残疾人车</Checkbox> <Checkbox>残疾人车</Checkbox>
</Form.Item> </Form.Item>
{ {
getPerson === true ?
getPerson == true ?
<div > <div >
<div className="place">
<Form.Item <Form.Item
name="disabledFreeTime" name="disabledFreeTime"
label="免费分钟数" label="免费分钟数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
style={{ width: 200, marginLeft: 10 }} style={{ width: 200, marginLeft: 10 }}
placeholder="请输入免费分钟数" placeholder="请输入免费分钟数"
/> />
<label>单位分钟免费停车时间</label>
</Form.Item> </Form.Item>
<label>单位分钟免费停车时间</label>
</div>
<div className="place">
<Form.Item <Form.Item
name="disabledCarDiscount" name="disabledCarDiscount"
label="折扣系数" label="折扣系数"
className="yisa-label"
className="yisa-label timeSearch"
rules={[{ required: true, message: "请输入${label}" }]} rules={[{ required: true, message: "请输入${label}" }]}
> >
<Input <Input
style={{ width: 200, marginLeft: 10 }} style={{ width: 200, marginLeft: 10 }}
placeholder="请输入0-100的值" placeholder="请输入0-100的值"
/> />
<label>单位%</label>
</Form.Item> </Form.Item>
<label>单位%</label>
</div>
</div> : '' </div> : ''
} }
@ -385,14 +386,14 @@ const FormModal = (props) => {
// console.log(fields); // console.log(fields);
return ( return (
<div className="yisa-table"> <div className="yisa-table">
<div className="row-line" key={key}>
<div className="row-line" key={'rules-' + key}>
<div className="timeAdd"> <div className="timeAdd">
<Space direction="vertical" size={12}> <Space direction="vertical" size={12}>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "date"]} name={[name, "date"]}
label="生效日期" label="生效日期"
className="yisa-label"
className="yisa-label inputSearch"
rules={[{ required: true, message: "请选择${label}" }]} rules={[{ required: true, message: "请选择${label}" }]}
> >
<DatePicker <DatePicker
@ -451,10 +452,10 @@ const FormModal = (props) => {
<Form.List name={[name, "details"]}> <Form.List name={[name, "details"]}>
{(fields, { add, remove }) => ( {(fields, { add, remove }) => (
<> <>
{fields.map(({ key, name, ...restField }, j) => {
{fields.map(({ key, name, ...restField }, i) => {
// console.log(fields); // console.log(fields);
return ( return (
<div key={key}>
<div key={'details-' + key}>
<div className="row"> <div className="row">
<Form.Item <Form.Item
{...restField} {...restField}
@ -464,7 +465,7 @@ const FormModal = (props) => {
> >
<TimePicker format={format} style={{ marginLeft: 10 }} /> <TimePicker format={format} style={{ marginLeft: 10 }} />
</Form.Item> </Form.Item>
to
<label className="mid">to</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "end"]} name={[name, "end"]}
@ -477,7 +478,7 @@ const FormModal = (props) => {
label="" label=""
> >
{ {
!j ?
!i ?
<PlusCircleOutlined <PlusCircleOutlined
onClick={() => onClick={() =>
add({ add({
@ -508,10 +509,9 @@ const FormModal = (props) => {
<Form.List name={[name, "items"]}> <Form.List name={[name, "items"]}>
{(fields, { add, remove }) => ( {(fields, { add, remove }) => (
<> <>
{fields.map(({ key, name, ...restField }, j) => {
// console.log(fields);
{fields.map(({ key, name, ...restField }, z) => {
return ( return (
<div className="row-line" key={key}>
<div className="row-line" key={'items-' + key}>
<div className="row"> <div className="row">
<Form.Item <Form.Item
name={[name, "type"]} name={[name, "type"]}
@ -537,8 +537,11 @@ const FormModal = (props) => {
]} ]}
/> />
</Form.Item> </Form.Item>
<Form.Item
noStyle
shouldUpdate>
{ {
getValue == 3 ?
form?.getFieldValue('rules')[j].details[i].items[z].type == '3' ?
<div className="row"> <div className="row">
<Form.Item <Form.Item
{...restField} {...restField}
@ -547,7 +550,7 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>/</label>
<label className="mid">/</label>
</div> </div>
: :
<div className="row"> <div className="row">
@ -558,8 +561,7 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>分钟</label>
<label className="mid">分钟</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "unit"]} name={[name, "unit"]}
@ -567,7 +569,7 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>/</label>
<label className="mid">/</label>
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, "period"]} name={[name, "period"]}
@ -575,9 +577,11 @@ const FormModal = (props) => {
> >
<Input style={{ width: 50, marginLeft: 10 }} /> <Input style={{ width: 50, marginLeft: 10 }} />
</Form.Item> </Form.Item>
<label>分钟</label>
<label className="mid">分钟</label>
</div> </div>
} }
</Form.Item>
<Form.Item <Form.Item
className="btm-box" className="btm-box"
> >

285
src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss

@ -1,57 +1,57 @@
@import "@/assets/css/mixin.scss"; @import "@/assets/css/mixin.scss";
$color-container-bg : var(--color-container-bg);
$color-user-list-bg : var(--color-user-list-bg);
$color-text : var(--color-text);
$color-primary : var(--color-primary);
$color-container-bg: var(--color-container-bg);
$color-user-list-bg: var(--color-user-list-bg);
$color-text: var(--color-text);
$color-primary: var(--color-primary);
.paid-ChargeRules{
.paid-ChargeRules {
display: flex; display: flex;
padding: 15px; padding: 15px;
width: 100%; width: 100%;
.paid-search{
.search{
.paid-search {
.search {
font-size: 16px; font-size: 16px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700; font-weight: 700;
text-align: left; text-align: left;
color: #eeeff1; color: #eeeff1;
} }
label{
margin:0 10px;
label {
margin: 0 10px;
} }
.yisa-search{
.yisa-search {
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
label{
label {
line-height: 31px; line-height: 31px;
} }
} }
.ant-select:not(.ant-select-customize-input) .ant-select-selector{
.ant-select:not(.ant-select-customize-input) .ant-select-selector {
background-color: #50586c !important; background-color: #50586c !important;
} }
.ant-select-arrow .anticon{
.ant-select-arrow .anticon {
background-color: #50586c !important; background-color: #50586c !important;
} }
.ant-input:placeholder-shown{
.ant-input:placeholder-shown {
background-color: #50586c !important; background-color: #50586c !important;
} }
.timePicker{
.timePicker {
width: 350px; width: 350px;
margin-top: 22px; margin-top: 22px;
.btnBox{
display:flex ;
.btnBox {
display: flex;
margin-top: 20px; margin-top: 20px;
.yisa-btn{
.yisa-btn {
margin-left: 20px; margin-left: 20px;
height: 36px; height: 36px;
border: none; border: none;
width: 150px; width: 150px;
} }
.root_gfkk{
.root_gfkk {
margin-left: 20px; margin-left: 20px;
.export-content{
.export-content {
width: 130px; width: 130px;
height: 33px; height: 33px;
display: flex; display: flex;
@ -64,73 +64,79 @@ $color-primary : var(--color-primary);
margin-right: 10px; margin-right: 10px;
} }
} }
} }
} }
} }
.paid-result{
.paid-result {
width: 100%; width: 100%;
height: 834px; height: 834px;
background: #505a6f; background: #505a6f;
border-radius: 20px; border-radius: 20px;
margin-left: 17px; margin-left: 17px;
.result{
.result {
padding: 25px; padding: 25px;
.font{
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
.font {
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
font-weight: 400; font-weight: 400;
text-align: left; text-align: left;
color: #eeeff1; color: #eeeff1;
margin-bottom: 10px; margin-bottom: 10px;
display: inline-block; display: inline-block;
em{
em {
color: #3aa8fe; color: #3aa8fe;
margin: 0 5px; margin: 0 5px;
} }
} }
.yisa-table .ant-table-thead .ant-table-cell{
.yisa-table .ant-table-thead .ant-table-cell {
background-color: #616b83 !important; background-color: #616b83 !important;
color: #ffffff !important; color: #ffffff !important;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
border-right: none !important; border-right: none !important;
border-top-color: #888f9d !important; border-top-color: #888f9d !important;
border-color: #888f9d !important; border-color: #888f9d !important;
} }
.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table, .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table,
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {
border-top: none !important; border-top: none !important;
border-left: none !important; border-left: none !important;
} }
.ant-table-tbody .ant-table-row .ant-table-cell{
.ant-table-tbody .ant-table-row .ant-table-cell {
background-color: #3e4557 !important; background-color: #3e4557 !important;
color: #ffffff !important; color: #ffffff !important;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
font-weight: 400; font-weight: 400;
border-right: none !important; border-right: none !important;
border-left: none !important; border-left: none !important;
border-bottom-color: #626b7e !important; border-bottom-color: #626b7e !important;
} }
} }
} }
} }
.revenue{
.tab-title{
.revenue {
.tab-title {
text-align: center; text-align: center;
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
} }
width: 700px !important; width: 700px !important;
.tab-index{
.tab-top{
.tab-index {
.tab-top {
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
height: 30px; height: 30px;
@ -138,25 +144,27 @@ $color-primary : var(--color-primary);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
border-bottom: 1px solid #e4e7ed; border-bottom: 1px solid #e4e7ed;
.tab-li{
.tab-li {
margin-left: 20px; margin-left: 20px;
cursor: pointer; cursor: pointer;
} }
.active{
color:#409eff ;
.active {
color: #409eff;
cursor: pointer; cursor: pointer;
margin-left: 20px; margin-left: 20px;
border-bottom: 1px solid #409eff !important; border-bottom: 1px solid #409eff !important;
margin-bottom: -1px !important; margin-bottom: -1px !important;
} }
} }
.tab-bottom{
.yisa-tab{
.ant-table-cell{
.tab-bottom {
.yisa-tab {
.ant-table-cell {
background-color: #616b83 !important; background-color: #616b83 !important;
color: #ffffff !important; color: #ffffff !important;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
border-right: none !important; border-right: none !important;
@ -167,42 +175,42 @@ $color-primary : var(--color-primary);
} }
} }
} }
.blackRecordBtn{
.blackRecordBtn {
background: #409eff; background: #409eff;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
} }
.black{
div{
.black {
div {
cursor: pointer; cursor: pointer;
margin-top: 5px; margin-top: 5px;
} }
} }
.addRuleModal{
.addRuleModal {
width: 700px !important; width: 700px !important;
.addRule::-webkit-scrollbar-track{
.addRule::-webkit-scrollbar-track {
background: white; background: white;
} }
.addRule::-webkit-scrollbar-thumb{
.addRule::-webkit-scrollbar-thumb {
background: gray; background: gray;
} }
.addRule::-webkit-scrollbar{
.addRule::-webkit-scrollbar {
width: 3px; width: 3px;
} }
.addRule{
.addRule {
max-height: 473px; max-height: 473px;
overflow-y: auto; overflow-y: auto;
.yisa-search{
.yisa-search {
margin: 20px 0 0 20px; margin: 20px 0 0 20px;
} }
.line{
.line {
line-height: 49px; line-height: 49px;
} }
.submitBtn{
.submitBtn {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
.submit{
.submit {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #409eff; background: #409eff;
@ -211,7 +219,7 @@ $color-primary : var(--color-primary);
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
.cancel{
.cancel {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #fff; background: #fff;
@ -221,37 +229,43 @@ $color-primary : var(--color-primary);
margin-left: 20px; margin-left: 20px;
} }
} }
.place{
display: flex;
}
} }
.yisa-table{
.yisa-table {
margin-top: 20px; margin-top: 20px;
border-top: 1px solid gray; border-top: 1px solid gray;
.timeAdd{
.timeAdd {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 23px; margin-top: 23px;
} }
.TimeRuler{
.TimeRuler {
margin-top: 20px; margin-top: 20px;
.ruler{
.ruler {
text-align: center; text-align: center;
} }
.mid{
line-height: 35px;
}
} }
.time{
.time {
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
.rule{
.rule {
line-height: 31px; line-height: 31px;
} }
.ruleTime{
.details{
.ruleTime {
.details {
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
position: relative; position: relative;
.detailsBottom{
.detailsBottom {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
} }
.addTime{
.addTime {
position: absolute; position: absolute;
top: 51px; top: 51px;
right: -55px; right: -55px;
@ -259,14 +273,14 @@ $color-primary : var(--color-primary);
} }
} }
.addTime{
.addTime {
font-size: 18px; font-size: 18px;
margin-left: 20px; margin-left: 20px;
width: 31px; width: 31px;
cursor: pointer; cursor: pointer;
height: 30px; height: 30px;
} }
.delTime{
.delTime {
font-size: 18px; font-size: 18px;
margin-left: 20px; margin-left: 20px;
width: 31px; width: 31px;
@ -274,27 +288,27 @@ $color-primary : var(--color-primary);
height: 30px; height: 30px;
} }
} }
.notime{
.notime {
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
.rule{
.rule {
line-height: 31px; line-height: 31px;
} }
.ruleTime{
.details{
.ruleTime {
.details {
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
position: relative; position: relative;
.detailsBottom{
.detailsBottom {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
} }
.addTime{
.addTime {
position: absolute; position: absolute;
top: 51px; top: 51px;
right: -55px; right: -55px;
} }
.addTimeTip{
.addTimeTip {
position: absolute; position: absolute;
top: 6px; top: 6px;
right: 40px; right: 40px;
@ -303,14 +317,14 @@ $color-primary : var(--color-primary);
} }
} }
.addTime{
.addTime {
font-size: 18px; font-size: 18px;
margin-left: 20px; margin-left: 20px;
width: 31px; width: 31px;
cursor: pointer; cursor: pointer;
height: 30px; height: 30px;
} }
.delTime{
.delTime {
font-size: 18px; font-size: 18px;
margin-left: 20px; margin-left: 20px;
width: 31px; width: 31px;
@ -319,41 +333,53 @@ $color-primary : var(--color-primary);
} }
} }
} }
.addRule{
.yisa-label{
.ant-form-item-label{
label{
.addRule {
.yisa-label {
.ant-form-item-label {
label {
margin-top: 5px; margin-top: 5px;
// width: 150px;
} }
} }
} }
}
.row{
.ant-form-item-label>label{
width: 50px;
}
.ant-form-item-row {
flex-wrap: unset;
flex-direction: row;
}
.inputSearch label{
width: 90px;
}
.minSearch label{
width: 180px;
}
.timeSearch label{
width: 111px;
}
}
.row {
display: flex; display: flex;
.yisa-label{
.yisa-label {
margin: 0 0 0 27px; margin: 0 0 0 27px;
} }
}
.hide{
}
.hide {
display: none; display: none;
}
} }
.ant-form-vertical .ant-form-item{
flex-direction:row
}
}
.ruleModal{
.yisa-search{
.ruleModal {
.yisa-search {
margin: 20px 0 0 20px; margin: 20px 0 0 20px;
} }
.line{
.line {
line-height: 49px; line-height: 49px;
} }
.submitBtn{
.submitBtn {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
.submit{
.submit {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #409eff; background: #409eff;
@ -362,7 +388,7 @@ $color-primary : var(--color-primary);
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
.cancel{
.cancel {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #fff; background: #fff;
@ -373,15 +399,15 @@ $color-primary : var(--color-primary);
} }
} }
} }
.deleteModal{
.delete{
.deleteModal {
.delete {
text-align: center; text-align: center;
font-size: 18px; font-size: 18px;
} }
.submitBtn{
.submitBtn {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
.submit{
.submit {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #409eff; background: #409eff;
@ -390,7 +416,7 @@ $color-primary : var(--color-primary);
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
.cancel{
.cancel {
width: 80px; width: 80px;
height: 35px; height: 35px;
background: #fff; background: #fff;
@ -401,77 +427,82 @@ $color-primary : var(--color-primary);
} }
} }
} }
.bindModal{
.bindModal {
width: 1000px !important; width: 1000px !important;
.selectChange{
.selectChange {
text-align: center; text-align: center;
} }
.patkPay{
.patkPay {
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
margin: 20px 0 0 20px; margin: 20px 0 0 20px;
.bind{
.bind {
margin-left: 20px; margin-left: 20px;
.colorBtn{
.colorBtn {
height: 36px; height: 36px;
} }
} }
} }
.bindTable{
.bindTable {
margin-top: 30px; margin-top: 30px;
} }
.ant-table-thead .ant-table-cell{
.ant-table-thead .ant-table-cell {
background-color: #616b83 !important; background-color: #616b83 !important;
color: #ffffff !important; color: #ffffff !important;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-family:
Microsoft YaHei,
Microsoft YaHei-Bold;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
border-right: none !important; border-right: none !important;
border-top-color: #888f9d !important; border-top-color: #888f9d !important;
border-color: #888f9d !important; border-color: #888f9d !important;
} }
.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table, .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table,
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {
border-top: none !important; border-top: none !important;
border-left: none !important; border-left: none !important;
} }
.ant-table-tbody>tr.ant-table-placeholder:hover>td{
.ant-table-tbody > tr.ant-table-placeholder:hover > td {
background: none !important; background: none !important;
} }
.ant-table-tbody .ant-table-row .ant-table-cell{
.ant-table-tbody .ant-table-row .ant-table-cell {
background-color: #3e4557 !important; background-color: #3e4557 !important;
color: #ffffff !important; color: #ffffff !important;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-family:
Microsoft YaHei,
Microsoft YaHei-Regular;
font-weight: 400; font-weight: 400;
border-right: none !important; border-right: none !important;
border-left: none !important; border-left: none !important;
border-bottom-color: #626b7e !important; border-bottom-color: #626b7e !important;
} }
.bind-btn{
.bind-btn {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
.bindBtn{
.bindBtn {
margin-left: 30%; margin-left: 30%;
.colorReset{
.colorReset {
margin-left: 30px; margin-left: 30px;
} }
} }
} }
.bind-content{
.content{
.bind-content {
.content {
width: 200px; width: 200px;
max-height: 100px; max-height: 100px;
background-color: #3e4557; background-color: #3e4557;
margin-left: 84px; margin-left: 84px;
overflow: hidden; overflow: hidden;
overflow: scroll; overflow: scroll;
.bind-nav{
.bind-nav {
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
} }
.bind-nav:hover{
.bind-nav:hover {
cursor: pointer; cursor: pointer;
background-color: #3aa8fe; background-color: #3aa8fe;
} }

72
src/pages/SystemMgm/OrgnizationMgm/loadable.jsx

@ -22,7 +22,7 @@ function OrgnizationMgm() {
const [tabActive, setTabActive] = useState("1") const [tabActive, setTabActive] = useState("1")
const [orgModalVisible, setOrgModalVisible] = useState(false) //& const [orgModalVisible, setOrgModalVisible] = useState(false) //&
const [orgEditStatus, setOrgEditStatus] = useState(true) // const [orgEditStatus, setOrgEditStatus] = useState(true) //
const [activeOrgTree, setActiveOrgTree] = useState({isTop: true})
const [activeOrgTree, setActiveOrgTree] = useState({ isTop: true })
const [baseForm] = Form.useForm() const [baseForm] = Form.useForm()
const [orgForm] = Form.useForm() const [orgForm] = Form.useForm()
@ -31,7 +31,7 @@ function OrgnizationMgm() {
} }
const getAreaTree = () => { const getAreaTree = () => {
ajax.getAreaTree().then((e) => {
ajax.getDepartName().then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
setAreaTree(e.data) setAreaTree(e.data)
setDefaultTreeActiveKey([e.data[0].id]) setDefaultTreeActiveKey([e.data[0].id])
@ -42,7 +42,7 @@ function OrgnizationMgm() {
const ajaxGetOrgDetail = (id) => { const ajaxGetOrgDetail = (id) => {
handleCancel() handleCancel()
return new Promise((resolved, rejected) => { return new Promise((resolved, rejected) => {
ajax.getOrgDetail({id: id}).then((e) => {
ajax.getOrgDetail({ id: id }).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
resolved(e.data) resolved(e.data)
} else { } else {
@ -55,7 +55,7 @@ function OrgnizationMgm() {
} }
const getRoleTree = (id) => { const getRoleTree = (id) => {
ajax.getOrgRoleNodeList({id: id}).then((e) => {
ajax.getOrgRoleNodeList({ id: id }).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
setRoleTree(e.data) setRoleTree(e.data)
} }
@ -68,11 +68,11 @@ function OrgnizationMgm() {
testTemp = e.data testTemp = e.data
recursionTree(testTemp) recursionTree(testTemp)
setOrgTree(testTemp) setOrgTree(testTemp)
handleTreeClick(undefined, {node: testTemp[0]})
handleTreeClick(undefined, { node: testTemp[0] })
} }
}) })
} }
const handleOrgAdd = (e, {isTop, level, pid, id, name}) => {
const handleOrgAdd = (e, { isTop, level, pid, id, name }) => {
e.stopPropagation() e.stopPropagation()
e.nativeEvent.stopImmediatePropagation() e.nativeEvent.stopImmediatePropagation()
orgForm.setFieldsValue({ orgForm.setFieldsValue({
@ -85,14 +85,14 @@ function OrgnizationMgm() {
setOrgEditStatus(false) setOrgEditStatus(false)
} }
const handleOrgDel = (e, {name, id}) => {
const handleOrgDel = (e, { name, id }) => {
e.stopPropagation() e.stopPropagation()
e.nativeEvent.stopImmediatePropagation() e.nativeEvent.stopImmediatePropagation()
Modal.confirm({ Modal.confirm({
title: '确认删除', title: '确认删除',
content: `是否确认删除组织: ${name} ?`, content: `是否确认删除组织: ${name} ?`,
onOk: () => { onOk: () => {
ajax.delAreaTree({id: id}).then((e) => {
ajax.delAreaTree({ id: id }).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
message.success(e.message) message.success(e.message)
getAreaTree() getAreaTree()
@ -103,7 +103,8 @@ function OrgnizationMgm() {
} }
}) })
} }
const handleOrgEdit = (e, {isTop, level, pid, id, name}) => {
const handleOrgEdit = (e, { isTop, level, pid, id, name }) => {
console.log(isTop);
e.stopPropagation() e.stopPropagation()
e.nativeEvent.stopImmediatePropagation() e.nativeEvent.stopImmediatePropagation()
orgForm.setFieldsValue({ orgForm.setFieldsValue({
@ -111,7 +112,7 @@ function OrgnizationMgm() {
'depart_id': pid ? [pid, id] : [id], 'depart_id': pid ? [pid, id] : [id],
'name': name 'name': name
}) })
setActiveOrgTree({isTop: isTop})
setActiveOrgTree({ isTop: isTop })
setOrgModalVisible(true) setOrgModalVisible(true)
setOrgEditStatus(true) setOrgEditStatus(true)
} }
@ -130,7 +131,7 @@ function OrgnizationMgm() {
}) })
} }
const ajaxOrgRoleSave = ({id, role}) => {
const ajaxOrgRoleSave = ({ id, role }) => {
return new Promise((resloved, rejected) => { return new Promise((resloved, rejected) => {
ajax.saveOrgRoleNode({ ajax.saveOrgRoleNode({
id: id, id: id,
@ -138,6 +139,9 @@ function OrgnizationMgm() {
}).then((e) => { }).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
resloved(e.message) resloved(e.message)
message.success(e.message)
}else{
message.error(e.message)
} }
}).catch((err) => { }).catch((err) => {
rejected(err) rejected(err)
@ -150,6 +154,9 @@ function OrgnizationMgm() {
ajax.saveAreaTree(data).then((e) => { ajax.saveAreaTree(data).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
resolved(e.message) resolved(e.message)
message.success(e.message)
}else{
message.error(e.message)
} }
}).catch((err) => { }).catch((err) => {
rejected(err) rejected(err)
@ -162,6 +169,9 @@ function OrgnizationMgm() {
ajax.editAreaTree(data).then((e) => { ajax.editAreaTree(data).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
resolved(e.message) resolved(e.message)
message.success(e.message)
}else{
message.error(e.message)
} }
}).catch((err) => { }).catch((err) => {
rejected(err) rejected(err)
@ -169,7 +179,7 @@ function OrgnizationMgm() {
}) })
} }
const handleTreeClick = (e, {node}) => {
const handleTreeClick = (e, { node }) => {
// //
if (node.level > 2) { if (node.level > 2) {
@ -224,7 +234,7 @@ function OrgnizationMgm() {
return true return true
} }
const handleUploadChange = ({file}) => {
const handleUploadChange = ({ file }) => {
const res = file.response const res = file.response
if (res && res.status == 20000) { if (res && res.status == 20000) {
baseForm.setFieldValue('img_url', res.data) baseForm.setFieldValue('img_url', res.data)
@ -288,11 +298,15 @@ function OrgnizationMgm() {
const handleOrgConfirm = () => { const handleOrgConfirm = () => {
orgForm.validateFields().then((data) => { orgForm.validateFields().then((data) => {
let arr =data.depart_id
console.log(arr);
// let strArr=arr.map(num=>parseInt(num))
console.log(arr.at(-2));
if (data.id) { if (data.id) {
ajaxAreaEdit(Object.assign({}, { ajaxAreaEdit(Object.assign({}, {
id: data.id, id: data.id,
name: data.name, name: data.name,
pid: [...data.depart_id].pop()
pid: arr.at(-1)
})).then((msg) => { })).then((msg) => {
message.success(msg) message.success(msg)
setOrgModalVisible(false) setOrgModalVisible(false)
@ -303,7 +317,7 @@ function OrgnizationMgm() {
} else { } else {
ajaxAreaSave(Object.assign({}, { ajaxAreaSave(Object.assign({}, {
name: data.name, name: data.name,
pid: [...data.depart_id].pop(),
pid:arr.at(-1),
level: data.level level: data.level
})).then((msg) => { })).then((msg) => {
message.success(msg) message.success(msg)
@ -344,10 +358,10 @@ function OrgnizationMgm() {
<Form.Item name="id" hidden></Form.Item> <Form.Item name="id" hidden></Form.Item>
<Form.Item name="name" hidden></Form.Item> <Form.Item name="name" hidden></Form.Item>
<Form.Item label="机构名称" name="name"> <Form.Item label="机构名称" name="name">
<Space/><Space/>{activeOrg.name}
<Space /><Space />{activeOrg.name}
</Form.Item> </Form.Item>
<Form.Item label="平台名称" name="platform"> <Form.Item label="平台名称" name="platform">
<Input disabled={!editStatus}/>
<Input disabled={!editStatus} />
</Form.Item> </Form.Item>
<Form.Item label="平台logo" name="img_url"> <Form.Item label="平台logo" name="img_url">
<Upload <Upload
@ -430,19 +444,23 @@ function OrgnizationMgm() {
// getRoleTree() // getRoleTree()
}, []) }, [])
const treeTitleRender = ({name, children, level, pid, id, virtually_code, lng_lat, code}) => {
const treeTitleRender = ({ name, children, level, pid, id, virtually_code, lng_lat, code }) => {
return <> return <>
<span className='label-text'>{name}</span> <span className='label-text'>{name}</span>
{ {
level > 2 ? <>
<PlusCircleOutlined className='label-icon' onClick={(e) => handleOrgAdd(e, {level, pid, isTop: true, id, name})} />
<EditOutlined className="label-icon" onClick={(e) => handleOrgEdit(e, {level, pid, isTop: false, id, name})}/>
<DeleteOutlined className="label-icon" onClick={(e) => handleOrgDel(e, {name, id})} />
</> : <>
<PlusCircleOutlined className='label-icon' onClick={(e) => handleOrgAdd(e, {level, pid, isTop: false, id, name})} />
<EditOutlined className="label-icon" onClick={(e) => handleOrgEdit(e, {level, pid, isTop: true, id, name})}/>
</>
level === 1 ? <>
<PlusCircleOutlined className='label-icon' onClick={(e) => handleOrgAdd(e, { level, pid, isTop: false, id, name })} />
<EditOutlined className="label-icon" onClick={(e) => handleOrgEdit(e, { level, pid, isTop: true, id, name })} />
</> :''
} }
{
level >= 2 ? <>
<PlusCircleOutlined className='label-icon' onClick={(e) => handleOrgAdd(e, { level, pid, isTop: true, id, name })} />
<EditOutlined className="label-icon" onClick={(e) => handleOrgEdit(e, { level, pid, isTop: false, id, name })} />
<DeleteOutlined className="label-icon" onClick={(e) => handleOrgDel(e, { name, id })} />
</>:''
}
</> </>
} }
@ -464,7 +482,7 @@ function OrgnizationMgm() {
<Tabs <Tabs
defaultActiveKey="1" defaultActiveKey="1"
onChange={(v) => setTabActive(v)} onChange={(v) => setTabActive(v)}
items={Object.keys(activeOrg).length ? (activeOrg.level < 3 ? tabRender : null) : null }
items={Object.keys(activeOrg).length ? (activeOrg.level < 3 ? tabRender : null) : null}
/> />
{ {
Object.keys(activeOrg).length ? ( Object.keys(activeOrg).length ? (

Loading…
Cancel
Save