Commit 9c89611f authored by cellee's avatar cellee

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

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent e2fac3e6
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @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) => {
// 加载logo
const uploadButton = (
<div>
{loadding ? <LoadingOutlined /> : <PlusOutlined />}
{/* {loadding ? <LoadingOutlined /> : <PlusOutlined />} */}
<PlusOutlined />
<div className="ant-upload-text">Upload</div>
</div>
);
......@@ -167,7 +168,7 @@ const PictureOptionsRow = (props: any) => {
onRemove={onRemove} // 删除
beforeUpload={beforeUpload}
onChange={handleChange} // 点击上传
disabled={props.over}
disabled={props.over || props.overs}
>
{fileList.length >= limitNum || props.overs ? null : props.disabled ? null : uploadButton}
</Upload>
......
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts
......@@ -51,7 +51,7 @@ export default {
message.error(`The information does not exist!`);
history.push('/AccountManagement/service');
} else {
console.log(playload);
// console.log(playload);
switch (playload.index) {
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 { message } from 'antd';
......
......@@ -116,6 +116,8 @@ const service = (props: any) => {
let t = { ...term, ...p };
setTerm(t);
RA(68, t, module, dispatch);
// console.log(page)
};
return (
......@@ -161,7 +163,7 @@ const service = (props: any) => {
};
function map(state: any) {
console.log(state);
// console.log(state);
const loading = state.loading.models.ServicePro;
const Init = state.Init;
const { Data, curString, village } = state[module];
......
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
......@@ -16,14 +16,19 @@ const module = 'ServicePro';
import './service.less';
import TitleBack from '@/components/TitleBack/TitleBack';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import moment from 'moment';
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 [ImageSrc, setImageSrc] = useState([] as any); // 图片地址
const [imgs, setImgs] = useState([] as any); // 回复地址
const [form] = Form.useForm();
// 监听是否有数据
useEffect(() => {
......@@ -36,6 +41,12 @@ const service = (props: any) => {
if (DataSave != null) {
setTerm({ ...DataSave });
form.setFieldsValue({
communityName: DataSave.communityName,
reportContent: DataSave.reportContent,
reportImages: DataSave.reportImages ? DataSave.reportImages.split(',') : null,
});
if (DataSave.reportPictures.length > 0) {
// 图片名any
let a = DataSave.reportPictures.map((item: any, i: any) => {
......@@ -51,25 +62,53 @@ const service = (props: any) => {
// 图片列表
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]);
// 删除结果
useEffect(() => {
if (Result) {
setTimeout(() => {
dispatch({ type: module + '/SA' }); // 清空详情缓存
history.push('/AccountManagement/service');
}, 300);
}
}, [Result]);
//onFinish 提交
const onFinish = (values: any) => {
values.reportId = match.params.id;
values.replyId = user.currentUser.userModel.id;
values.replyImages = values.replyImages.join(',');
// console.log(values);
RA(71, values, module, dispatch);
values.id = match.params.id;
values.reportImages = values.reportImages ? values.reportImages.join(',') : null;
values.replyList = [
{
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) => {
RA(73, { ids: match.params.id }, module, dispatch);
};
// 删除结果
useEffect(() => {
if (Result) {
setTimeout(() => {
dispatch({ type: module + '/SA' }); // 清空详情缓存
history.push('/AccountManagement/service');
}, 300);
}
}, [Result]);
return (
<Spin spinning={loading}>
<div className="edit">
......@@ -89,6 +138,7 @@ const service = (props: any) => {
loading={loading}
Result={Result}
/>
{/* 信息 */}
<div className="form_s">
<Form
......@@ -100,7 +150,15 @@ const service = (props: any) => {
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">
<span>{term ? `${term.communityAddress} , ${term.postCode}` : null}</span>
......@@ -117,16 +175,11 @@ const service = (props: any) => {
<span>{term ? term.reporterPhone : null}</span>
</Form.Item>
{/* 报告描述 */}
<Form.Item label="Description">
<TextArea
rows={4}
style={{ maxWidth: 600, width: '100%' }}
value={term ? term.reportContent : null}
disabled
/>
<Form.Item label="Description" name="reportContent" rules={[{ required: true }]}>
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} disabled />
</Form.Item>
{/* 报告图片 */}
<Form.Item label="Picture">
<Form.Item label="Picture" name="reportImages" rules={[{ required: true }]}>
<PictureOptionsRow
action="/tos/image/upload"
data={{
......@@ -135,85 +188,50 @@ const service = (props: any) => {
}}
limitNums={10}
imgs={ImageSrc}
over={true}
overs={true}
/>
</Form.Item>
<hr></hr>
{/* --------------------------------------------------------------------------------------------- */}
{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>
{/* 回复人信息 */}
{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>
) : (
''
)}
{/* 回复内容 */}
<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%' }} />
{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>
) : (
''
)}
{/* 回复图片 */}
<Form.Item label="Picture" name="replyImages" rules={[{ required: true }]}>
{imgs.length > 0 ? (
<Form.Item label="Picture" name="replyImages">
<PictureOptionsRow
action="/tos/image/upload"
data={{
// imageType: 'tosReportImage',
imageType: 'tosReplyImage',
identification: '',
}}
limitNums={10}
over={loading}
imgs={imgs}
overs={true}
/>
</Form.Item>
{/* --------------------------------------------------------------------------------------------- */}
{/* 提交 */}
<Form.Item label=" " colon={false}>
<Button type="primary" loading={loading} htmlType="submit">
Submit
</Button>
</Form.Item>
) : (
''
)}
</Form>
</div>
</div>
......@@ -222,10 +240,9 @@ const service = (props: any) => {
};
function map(state: any) {
// console.log(state);
const loading = state.loading.models.ServicePro;
const { Init, user } = state;
const { DataSave, Result } = state[module];
return { DataSave, loading, Result, Init, user };
const Init = state.Init;
const { DataSave, curString, village, Result } = state[module];
return { DataSave, loading, curString, village, Init, Result };
}
export default connect(map)(service);
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
......@@ -21,12 +21,16 @@ import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import moment from 'moment';
import { getUrlPicName } from '@/utils/string';
const service = (props: any) => {
const { DataSave, dispatch, loading, match } = props;
const [term, setTerm] = useState(null as any); // 默认小区
const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址
const [imgs, setImgs] = useState([] as any); // 回复地址
const [form] = Form.useForm();
// 监听是否有数据
useEffect(() => {
......@@ -50,6 +54,7 @@ const service = (props: any) => {
let a = DataSave.reportPictures.map((item: any, i: any) => {
let img = DataSave.reportImages.split(',');
let key = img[i];
return {
uid: i,
name: key,
......@@ -60,13 +65,35 @@ const service = (props: any) => {
// 图片列表
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]);
//onFinish 提交
const onFinish = (values: any) => {
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);
};
......@@ -137,6 +164,26 @@ const service = (props: any) => {
over={loading}
/>
</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}>
......
......@@ -127,7 +127,6 @@ const Account = (props: any) => {
// 编辑- 新增
const edit = (item: any) => {
console.log(item);
// 无论编辑还是新增都清掉二级账户选择
dispatch({ type: 'Account/InfoClear' });
if (item == 1) {
......
......@@ -31,6 +31,14 @@ const Detail = (props: any) => {
const [ModelExcel, setModelExcel] = useState(false);
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 是路由属性
useEffect(() => {
if (match) {
......@@ -328,7 +336,7 @@ const Detail = (props: any) => {
<Button
type="link"
onClick={() => {
openDows(require('@/assets/h5.png'), 'code.png');
openDows(codeUrl, 'code.png');
}}
>
Download
......@@ -338,12 +346,12 @@ const Detail = (props: any) => {
placeholder="Basic usage"
disabled
style={{ width: '280px' }}
value="http://47.74.233.180:8651/tosVisitorNo"
value={usage}
/>
<Button
type="link"
onClick={() => {
copy('http://47.74.233.180:8651/tosVisitorNo');
copy(usage);
}}
>
Copy
......
......@@ -26,6 +26,7 @@ export const getUrlPicName = (str: any) => {
} else {
var tmp = str.split('?');
var tmp2 = tmp[0].split('/');
// console.log(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