|
@@ -12,6 +12,7 @@ import './index.scss';
|
|
|
import { upload, UploadData } from '@/api/common';
|
|
|
import { isArray } from 'lodash';
|
|
|
import { useCommonStore, useIncidentStore } from '@/store';
|
|
|
+import { BaseMediaUrl, isImage, isVideo } from '@/utils';
|
|
|
import {
|
|
|
DropdownItemOption,
|
|
|
NavBar,
|
|
@@ -28,9 +29,11 @@ import {
|
|
|
Toast,
|
|
|
Step,
|
|
|
Steps,
|
|
|
- Dialog,Popup,
|
|
|
+ Dialog,
|
|
|
+ Popup,
|
|
|
Uploader,
|
|
|
UploaderFileListItem,
|
|
|
+ ImagePreview,
|
|
|
} from 'vant';
|
|
|
/** @ts-ignore */
|
|
|
import icon_communication from '@/assets/icons/incident/communication@2x.png';
|
|
@@ -44,6 +47,11 @@ import icon_plan from '@/assets/icons/incident/plan@2x.png';
|
|
|
import icon_yjck from '@/assets/icons/incident/yjck@2x.png';
|
|
|
/** @ts-ignore */
|
|
|
import icon_yjya from '@/assets/icons/incident/yjya@2x.png';
|
|
|
+
|
|
|
+/** @ts-ignore */
|
|
|
+import icon_video from '@/assets/icons/incident/video.png';
|
|
|
+
|
|
|
+;
|
|
|
import { cloneDeep, take } from 'lodash';
|
|
|
|
|
|
|
|
@@ -74,14 +82,21 @@ export default defineComponent({
|
|
|
if (!store.incidentDetail.baseInfo?.id || message.value == "") {
|
|
|
Toast.fail('信息不完整');
|
|
|
}
|
|
|
- store.addIncidentProcess({
|
|
|
- incidentId: store.incidentDetail.baseInfo?.id,
|
|
|
- des: message.value,
|
|
|
- taskId:currenttaskid.value,
|
|
|
- }).then(() => {
|
|
|
- message.value = "";
|
|
|
+ store
|
|
|
+ .addIncidentProcess({
|
|
|
+ incidentId: store.incidentDetail.baseInfo?.id,
|
|
|
+ des: message.value,
|
|
|
+ taskId: currenttaskid.value,
|
|
|
+ video: videosrclist.map((i: UploadData) => i.url).join(','),
|
|
|
+ pic: imagessrclist.map((i: UploadData) => i.url).join(','),
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ message.value = '';
|
|
|
+ videosrclist.splice(0);
|
|
|
+ imagessrclist.splice(0);
|
|
|
+ form.value = { pic: [], video: [] };
|
|
|
store.getIncidentItem(store.incidentDetail.baseInfo?.id ?? '');
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
|
|
|
};
|
|
@@ -231,7 +246,6 @@ export default defineComponent({
|
|
|
} catch (E) {}
|
|
|
//window.history.back();
|
|
|
}}
|
|
|
-
|
|
|
/>
|
|
|
<Sticky offsetTop={'46px'}>
|
|
|
<div class="title">{store.incidentDetail?.baseInfo?.name}</div>
|
|
@@ -374,7 +388,7 @@ export default defineComponent({
|
|
|
取消
|
|
|
</Button>
|
|
|
<Button
|
|
|
- color='red'
|
|
|
+ color="red"
|
|
|
style={getisbj() ? 'display:none' : ''}
|
|
|
size="small"
|
|
|
type="default"
|
|
@@ -413,7 +427,7 @@ export default defineComponent({
|
|
|
v-slots={{ icon: <img class="icon-i" src={icon_detail} /> }}>
|
|
|
<div>
|
|
|
{process.value
|
|
|
- ?.filter((i) => i.taskId == currenttaskid.value)
|
|
|
+ ?.filter((i) => i.taskId === currenttaskid.value)
|
|
|
.map((i, index) => (
|
|
|
<div class="czxq-item">
|
|
|
<div class="cz-yuan"></div>
|
|
@@ -422,7 +436,7 @@ export default defineComponent({
|
|
|
style={`display:${
|
|
|
index ==
|
|
|
(process.value?.filter(
|
|
|
- (i) => i.taskId == currenttaskid.value,
|
|
|
+ (i) => i.taskId === currenttaskid.value,
|
|
|
)?.length ?? 0) -
|
|
|
1
|
|
|
? 'none'
|
|
@@ -448,7 +462,64 @@ export default defineComponent({
|
|
|
: 'block'
|
|
|
}`}></div>
|
|
|
<div class="cz-time"> {ii.createTime}</div>
|
|
|
- <div class="cz-des"> {ii.des}</div>
|
|
|
+ <div class="cz-des">
|
|
|
+ <div style={'margin-bottom:8px'}>{ii.des}</div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class={'img'}
|
|
|
+ style={
|
|
|
+ ii.pic === '' && ii.video === ''
|
|
|
+ ? 'display:none'
|
|
|
+ : ''
|
|
|
+ }>
|
|
|
+ {((ii.pic ?? '') + ',' + (ii.video ?? '') ?? '')
|
|
|
+ .split(',')
|
|
|
+ .map((iim, idxq) => {
|
|
|
+ iim = iim ?? '';
|
|
|
+ if (isImage({ fileName: iim, url: iim })) {
|
|
|
+ // console.log(iim);
|
|
|
+ return (
|
|
|
+ <img
|
|
|
+ src={BaseMediaUrl + iim}
|
|
|
+ onClick={() => {
|
|
|
+ ImagePreview({
|
|
|
+ images: ii.pic
|
|
|
+ .split(',')
|
|
|
+ .filter((cc) => cc != '')
|
|
|
+ .map((cc) => {
|
|
|
+ return BaseMediaUrl + cc;
|
|
|
+ }),
|
|
|
+ startPosition: idxq,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={
|
|
|
+ 'width:20px;height:30px;object-fit: contain;margin-right:10px;padding:0 10px;background:rgb(240 236 236);'
|
|
|
+ }></img>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (isVideo({ fileName: iim, url: iim })) {
|
|
|
+ // console.log(iim);
|
|
|
+ return (
|
|
|
+ <img
|
|
|
+ onClick={() => {
|
|
|
+ isshowprew.value = true;
|
|
|
+ try {
|
|
|
+ videopsrc.value =
|
|
|
+ BaseMediaUrl + iim;
|
|
|
+ videop.value.play();
|
|
|
+ videop.value.currentTime = 0;
|
|
|
+ } catch (error) {}
|
|
|
+ }}
|
|
|
+ src={icon_video}
|
|
|
+ style={
|
|
|
+ 'width:20px;height:30px;object-fit: contain;margin-right:10px;background:rgb(240 236 236);padding:0 10px;border-radius:4px'
|
|
|
+ }></img>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return <div></div>;
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
))}
|
|
|
</div>
|