Commit 9c89611f authored by cellee's avatar cellee

小区 h5 链接, 报告员回复修复

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent e2fac3e6
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-12-03 11:27:07 * @Date: 2020-12-03 11:27:07
* @LastEditTime: 2020-12-03 14:04:53 * @LastEditTime: 2021-03-15 11:55:16
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\access.ts * @FilePath: \tostumi\src\access.ts
......
src/assets/h5.png

6.84 KB | W: | H:

src/assets/h5.png

7.79 KB | W: | H:

src/assets/h5.png
src/assets/h5.png
src/assets/h5.png
src/assets/h5.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -80,7 +80,8 @@ const PictureOptionsRow = (props: any) => { ...@@ -80,7 +80,8 @@ const PictureOptionsRow = (props: any) => {
// 加载logo // 加载logo
const uploadButton = ( const uploadButton = (
<div> <div>
{loadding ? <LoadingOutlined /> : <PlusOutlined />} {/* {loadding ? <LoadingOutlined /> : <PlusOutlined />} */}
<PlusOutlined />
<div className="ant-upload-text">Upload</div> <div className="ant-upload-text">Upload</div>
</div> </div>
); );
...@@ -167,7 +168,7 @@ const PictureOptionsRow = (props: any) => { ...@@ -167,7 +168,7 @@ const PictureOptionsRow = (props: any) => {
onRemove={onRemove} // 删除 onRemove={onRemove} // 删除
beforeUpload={beforeUpload} beforeUpload={beforeUpload}
onChange={handleChange} // 点击上传 onChange={handleChange} // 点击上传
disabled={props.over} disabled={props.over || props.overs}
> >
{fileList.length >= limitNum || props.overs ? null : props.disabled ? null : uploadButton} {fileList.length >= limitNum || props.overs ? null : props.disabled ? null : uploadButton}
</Upload> </Upload>
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-01-14 09:23:51 * @Date: 2021-01-14 09:23:51
* @LastEditTime: 2021-03-04 10:27:51 * @LastEditTime: 2021-03-11 14:36:23
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts * @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
message.error(`The information does not exist!`); message.error(`The information does not exist!`);
history.push('/AccountManagement/service'); history.push('/AccountManagement/service');
} else { } else {
console.log(playload); // console.log(playload);
switch (playload.index) { switch (playload.index) {
case 68: // 获取列表 case 68: // 获取列表
{ {
......
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-03-15 11:56:25
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\LContract\Contract.ts
*/
import { getRemoveList } from '@/services/package/contract'; import { getRemoveList } from '@/services/package/contract';
import { message } from 'antd'; import { message } from 'antd';
......
...@@ -116,6 +116,8 @@ const service = (props: any) => { ...@@ -116,6 +116,8 @@ const service = (props: any) => {
let t = { ...term, ...p }; let t = { ...term, ...p };
setTerm(t); setTerm(t);
RA(68, t, module, dispatch); RA(68, t, module, dispatch);
// console.log(page)
}; };
return ( return (
...@@ -161,7 +163,7 @@ const service = (props: any) => { ...@@ -161,7 +163,7 @@ const service = (props: any) => {
}; };
function map(state: any) { function map(state: any) {
console.log(state); // console.log(state);
const loading = state.loading.models.ServicePro; const loading = state.loading.models.ServicePro;
const Init = state.Init; const Init = state.Init;
const { Data, curString, village } = state[module]; const { Data, curString, village } = state[module];
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-03-02 14:39:40 * @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-03-09 10:55:16 * @LastEditTime: 2021-03-15 15:25:59
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx * @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
...@@ -16,14 +16,19 @@ const module = 'ServicePro'; ...@@ -16,14 +16,19 @@ const module = 'ServicePro';
import './service.less'; import './service.less';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow'; import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import moment from 'moment';
const service = (props: any) => { const service = (props: any) => {
const { DataSave, dispatch, loading, match, user, Result } = props; const { DataSave, dispatch, loading, match, Result } = props;
const [term, setTerm] = useState(null as any); // 默认小区 const [term, setTerm] = useState(null as any); // 默认小区
const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址 const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址
const [imgs, setImgs] = useState([] as any); // 回复地址
const [form] = Form.useForm(); const [form] = Form.useForm();
// 监听是否有数据 // 监听是否有数据
useEffect(() => { useEffect(() => {
...@@ -36,6 +41,12 @@ const service = (props: any) => { ...@@ -36,6 +41,12 @@ const service = (props: any) => {
if (DataSave != null) { if (DataSave != null) {
setTerm({ ...DataSave }); setTerm({ ...DataSave });
form.setFieldsValue({
communityName: DataSave.communityName,
reportContent: DataSave.reportContent,
reportImages: DataSave.reportImages ? DataSave.reportImages.split(',') : null,
});
if (DataSave.reportPictures.length > 0) { if (DataSave.reportPictures.length > 0) {
// 图片名any // 图片名any
let a = DataSave.reportPictures.map((item: any, i: any) => { let a = DataSave.reportPictures.map((item: any, i: any) => {
...@@ -51,25 +62,53 @@ const service = (props: any) => { ...@@ -51,25 +62,53 @@ const service = (props: any) => {
// 图片列表 // 图片列表
setImageSrc(a); setImageSrc(a);
} }
if (DataSave.replyData.length > 0) {
// 图片名any
let b = [] as any;
DataSave.replyData[0].replyPictures.map((item: any, i: any) => {
let obj = {
uid: i,
name: i,
status: 'done',
url: item,
};
b.push(obj);
});
// 回复列表
setImgs(b);
form.setFieldsValue({
replyContent: DataSave.replyData[0].replyContent,
});
}
} }
}, [DataSave]); }, [DataSave]);
// 删除结果
useEffect(() => {
if (Result) {
setTimeout(() => {
dispatch({ type: module + '/SA' }); // 清空详情缓存
history.push('/AccountManagement/service');
}, 300);
}
}, [Result]);
//onFinish 提交 //onFinish 提交
const onFinish = (values: any) => { const onFinish = (values: any) => {
values.reportId = match.params.id; values.id = match.params.id;
values.replyId = user.currentUser.userModel.id; values.reportImages = values.reportImages ? values.reportImages.join(',') : null;
values.replyImages = values.replyImages.join(','); values.replyList = [
// console.log(values); {
RA(71, values, module, dispatch); replyContent: values.replyContent,
replyImages: values.replyImages ? values.replyImages.join(',') : null,
},
];
RA(70, values, module, dispatch);
};
// 选择小区名字并赋值
const opname = (value: any) => {
// console.log(value);
if (value) {
RA(72, { communityName: value }, module, dispatch);
}
form.setFieldsValue({
communityName: value,
});
}; };
// 确认删除 // 确认删除
...@@ -78,6 +117,16 @@ const service = (props: any) => { ...@@ -78,6 +117,16 @@ const service = (props: any) => {
RA(73, { ids: match.params.id }, module, dispatch); RA(73, { ids: match.params.id }, module, dispatch);
}; };
// 删除结果
useEffect(() => {
if (Result) {
setTimeout(() => {
dispatch({ type: module + '/SA' }); // 清空详情缓存
history.push('/AccountManagement/service');
}, 300);
}
}, [Result]);
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="edit"> <div className="edit">
...@@ -89,6 +138,7 @@ const service = (props: any) => { ...@@ -89,6 +138,7 @@ const service = (props: any) => {
loading={loading} loading={loading}
Result={Result} Result={Result}
/> />
{/* 信息 */} {/* 信息 */}
<div className="form_s"> <div className="form_s">
<Form <Form
...@@ -100,7 +150,15 @@ const service = (props: any) => { ...@@ -100,7 +150,15 @@ const service = (props: any) => {
onFinish={onFinish} onFinish={onFinish}
> >
{/* 小区名 */} {/* 小区名 */}
<Form.Item label="Community">{term ? term.communityName : null}</Form.Item> <Form.Item label="Community" name="communityName" rules={[{ required: true }]}>
<SearchOptionsCommnity
// ubmit={extendName}
opname={opname}
defaultName={term ? term.communityName : null}
// type={1} // 单选还是多选 单选就直接去掉
disabled
/>
</Form.Item>
{/* 小区地址 */} {/* 小区地址 */}
<Form.Item label="Address"> <Form.Item label="Address">
<span>{term ? `${term.communityAddress} , ${term.postCode}` : null}</span> <span>{term ? `${term.communityAddress} , ${term.postCode}` : null}</span>
...@@ -117,16 +175,11 @@ const service = (props: any) => { ...@@ -117,16 +175,11 @@ const service = (props: any) => {
<span>{term ? term.reporterPhone : null}</span> <span>{term ? term.reporterPhone : null}</span>
</Form.Item> </Form.Item>
{/* 报告描述 */} {/* 报告描述 */}
<Form.Item label="Description"> <Form.Item label="Description" name="reportContent" rules={[{ required: true }]}>
<TextArea <TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} disabled />
rows={4}
style={{ maxWidth: 600, width: '100%' }}
value={term ? term.reportContent : null}
disabled
/>
</Form.Item> </Form.Item>
{/* 报告图片 */} {/* 报告图片 */}
<Form.Item label="Picture"> <Form.Item label="Picture" name="reportImages" rules={[{ required: true }]}>
<PictureOptionsRow <PictureOptionsRow
action="/tos/image/upload" action="/tos/image/upload"
data={{ data={{
...@@ -135,85 +188,50 @@ const service = (props: any) => { ...@@ -135,85 +188,50 @@ const service = (props: any) => {
}} }}
limitNums={10} limitNums={10}
imgs={ImageSrc} imgs={ImageSrc}
over={true}
overs={true} overs={true}
/> />
</Form.Item> </Form.Item>
<hr></hr> <hr></hr>
{/* --------------------------------------------------------------------------------------------- */} {/* --------------------------------------------------------------------------------------------- */}
{/* 回复人信息 */}
{DataSave && DataSave.replyData.length > 0 ? (
<Form.Item label="Replier">
{DataSave.replyData[0].replyName}
<span style={{ display: 'inline-block', margin: '0 10px 0 50px' }}>
Contact Details :{' '}
</span>{' '}
{DataSave.replyData[0].replyPhone}
</Form.Item>
) : (
''
)}
{/* 回复内容 */}
{DataSave && DataSave.replyData.length > 0 && DataSave.replyData[0].replyContent ? (
<Form.Item label="Overview" name="replyContent">
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} disabled />
</Form.Item>
) : (
''
)}
{term && term.replyData.length > 0
? term.replyData.map((v: any, idx: any) => {
let imgs = v.replyPictures.map((item: any, i: any) => {
return {
uid: i,
name: 'Imags',
status: 'done',
url: item,
};
});
return (
<div key={idx}>
{/* 回复人 */}
<Form.Item label="Rapporteur">
<div>
<span>{v.replyName}</span>{' '}
<span className="diys">Contact Details : </span>{' '}
<span>{v.replyPhone}</span>
</div>
</Form.Item>
{/* 回复内容 */}
<Form.Item label="Overview">
<TextArea
rows={4}
style={{ maxWidth: 600, width: '100%' }}
value={v.replyContent}
disabled
/>
</Form.Item>
{/* 回复图片 */}
<Form.Item label="Picture">
<PictureOptionsRow
action="/tos/image/upload"
data={{
imageType: 'tosReportImage',
identification: '',
}}
limitNums={10}
imgs={imgs}
over={true}
/>
</Form.Item>
<hr></hr>
</div>
);
})
: null}
{/* --------------------------------------------------------------------------------------------- */}
{/* 回复描述 */}
<Form.Item label="Overview" name="replyContent" rules={[{ required: true }]}>
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} />
</Form.Item>
{/* 回复图片 */} {/* 回复图片 */}
<Form.Item label="Picture" name="replyImages" rules={[{ required: true }]}> {imgs.length > 0 ? (
<PictureOptionsRow <Form.Item label="Picture" name="replyImages">
action="/tos/image/upload" <PictureOptionsRow
data={{ action="/tos/image/upload"
// imageType: 'tosReportImage', data={{
imageType: 'tosReplyImage', // imageType: 'tosReportImage',
identification: '', imageType: 'tosReplyImage',
}} }}
limitNums={10} limitNums={10}
over={loading} imgs={imgs}
/> overs={true}
</Form.Item> />
{/* --------------------------------------------------------------------------------------------- */} </Form.Item>
{/* 提交 */} ) : (
<Form.Item label=" " colon={false}> ''
<Button type="primary" loading={loading} htmlType="submit"> )}
Submit
</Button>
</Form.Item>
</Form> </Form>
</div> </div>
</div> </div>
...@@ -222,10 +240,9 @@ const service = (props: any) => { ...@@ -222,10 +240,9 @@ const service = (props: any) => {
}; };
function map(state: any) { function map(state: any) {
// console.log(state);
const loading = state.loading.models.ServicePro; const loading = state.loading.models.ServicePro;
const { Init, user } = state; const Init = state.Init;
const { DataSave, Result } = state[module]; const { DataSave, curString, village, Result } = state[module];
return { DataSave, loading, Result, Init, user }; return { DataSave, loading, curString, village, Init, Result };
} }
export default connect(map)(service); export default connect(map)(service);
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-03-02 14:39:40 * @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-03-08 17:03:45 * @LastEditTime: 2021-03-15 15:21:27
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx * @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
...@@ -21,12 +21,16 @@ import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow'; ...@@ -21,12 +21,16 @@ import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import moment from 'moment'; import moment from 'moment';
import { getUrlPicName } from '@/utils/string';
const service = (props: any) => { const service = (props: any) => {
const { DataSave, dispatch, loading, match } = props; const { DataSave, dispatch, loading, match } = props;
const [term, setTerm] = useState(null as any); // 默认小区 const [term, setTerm] = useState(null as any); // 默认小区
const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址 const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址
const [imgs, setImgs] = useState([] as any); // 回复地址
const [form] = Form.useForm(); const [form] = Form.useForm();
// 监听是否有数据 // 监听是否有数据
useEffect(() => { useEffect(() => {
...@@ -50,6 +54,7 @@ const service = (props: any) => { ...@@ -50,6 +54,7 @@ const service = (props: any) => {
let a = DataSave.reportPictures.map((item: any, i: any) => { let a = DataSave.reportPictures.map((item: any, i: any) => {
let img = DataSave.reportImages.split(','); let img = DataSave.reportImages.split(',');
let key = img[i]; let key = img[i];
return { return {
uid: i, uid: i,
name: key, name: key,
...@@ -60,13 +65,35 @@ const service = (props: any) => { ...@@ -60,13 +65,35 @@ const service = (props: any) => {
// 图片列表 // 图片列表
setImageSrc(a); setImageSrc(a);
} }
if (DataSave.replyData.length > 0) {
// 图片名any
let b = [] as any;
DataSave.replyData[0].replyPictures.map((item: any, i: any) => {
let obj = {
uid: i,
name: getUrlPicName(item),
status: 'done',
url: item,
};
b.push(obj);
});
// 回复列表
setImgs(b);
form.setFieldsValue({
replyContent: DataSave.replyData[0].replyContent,
});
}
} }
}, [DataSave]); }, [DataSave]);
//onFinish 提交 //onFinish 提交
const onFinish = (values: any) => { const onFinish = (values: any) => {
values.id = match.params.id; values.id = match.params.id;
values.reportImages = values.reportImages.join(','); values.reportImages = values.reportImages ? values.reportImages.join(',') : null;
values.replyImages = values.replyImages ? values.replyImages.join(',') : null;
RA(70, values, module, dispatch); RA(70, values, module, dispatch);
}; };
...@@ -137,6 +164,26 @@ const service = (props: any) => { ...@@ -137,6 +164,26 @@ const service = (props: any) => {
over={loading} over={loading}
/> />
</Form.Item> </Form.Item>
<hr></hr>
{/* --------------------------------------------------------------------------------------------- */}
{/* 回复内容 */}
<Form.Item label="Overview" name="replyContent" rules={[{ required: true }]}>
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} />
</Form.Item>
{/* 回复图片 */}
<Form.Item label="Picture" name="replyImages">
<PictureOptionsRow
action="/tos/image/upload"
data={{
// imageType: 'tosReportImage',
imageType: 'tosReplyImage',
identification: '',
}}
limitNums={10}
imgs={imgs}
/>
</Form.Item>
<hr></hr>
{/* --------------------------------------------------------------------------------------------- */} {/* --------------------------------------------------------------------------------------------- */}
{/* 提交 */} {/* 提交 */}
<Form.Item label=" " colon={false}> <Form.Item label=" " colon={false}>
......
...@@ -127,7 +127,6 @@ const Account = (props: any) => { ...@@ -127,7 +127,6 @@ const Account = (props: any) => {
// 编辑- 新增 // 编辑- 新增
const edit = (item: any) => { const edit = (item: any) => {
console.log(item);
// 无论编辑还是新增都清掉二级账户选择 // 无论编辑还是新增都清掉二级账户选择
dispatch({ type: 'Account/InfoClear' }); dispatch({ type: 'Account/InfoClear' });
if (item == 1) { if (item == 1) {
......
...@@ -31,6 +31,14 @@ const Detail = (props: any) => { ...@@ -31,6 +31,14 @@ const Detail = (props: any) => {
const [ModelExcel, setModelExcel] = useState(false); const [ModelExcel, setModelExcel] = useState(false);
const [ModelResult, setModelResult] = useState(null as any); const [ModelResult, setModelResult] = useState(null as any);
// 小区二维码地址
// 本地 http://192.168.1.28:8611/ 图片名称 h5
// 新加坡测 http://120.77.240.215:8611/ 图片名称 h51
// 正式 http://47.74.233.180:8611/ 图片名称 h52
const usage = 'http://120.77.240.215:8611/';
const codeUrl = require('@/assets/h51.png');
// match 是路由属性 // match 是路由属性
useEffect(() => { useEffect(() => {
if (match) { if (match) {
...@@ -328,7 +336,7 @@ const Detail = (props: any) => { ...@@ -328,7 +336,7 @@ const Detail = (props: any) => {
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
openDows(require('@/assets/h5.png'), 'code.png'); openDows(codeUrl, 'code.png');
}} }}
> >
Download Download
...@@ -338,12 +346,12 @@ const Detail = (props: any) => { ...@@ -338,12 +346,12 @@ const Detail = (props: any) => {
placeholder="Basic usage" placeholder="Basic usage"
disabled disabled
style={{ width: '280px' }} style={{ width: '280px' }}
value="http://47.74.233.180:8651/tosVisitorNo" value={usage}
/> />
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
copy('http://47.74.233.180:8651/tosVisitorNo'); copy(usage);
}} }}
> >
Copy Copy
......
...@@ -26,6 +26,7 @@ export const getUrlPicName = (str: any) => { ...@@ -26,6 +26,7 @@ export const getUrlPicName = (str: any) => {
} else { } else {
var tmp = str.split('?'); var tmp = str.split('?');
var tmp2 = tmp[0].split('/'); var tmp2 = tmp[0].split('/');
// console.log(tmp2[tmp2.length - 1]);
return tmp2[tmp2.length - 1]; return tmp2[tmp2.length - 1];
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment