更新
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="form-item-box" :class="props.showBtn?'showBtn-upload':''" :style="{ width: width }">
|
<div
|
||||||
|
class="form-item-box"
|
||||||
|
:class="props.showBtn ? 'showBtn-upload' : ''"
|
||||||
|
:style="{ width: width }"
|
||||||
|
>
|
||||||
<el-upload
|
<el-upload
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
@ -7,23 +11,27 @@
|
|||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
:limit="props.limit"
|
:limit="props.limit"
|
||||||
:action="actionUrl"
|
:action="actionUrl"
|
||||||
:list-type=" props.showBtn ? '' :'picture-card'"
|
:list-type="props.showBtn ? '' : 'picture-card'"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
show-file-list
|
show-file-list
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:on-success="handlerSuccess"
|
:on-success="handlerSuccess"
|
||||||
:before-upload="beforeImgUpload"
|
:before-upload="beforeImgUpload"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template #default>
|
<template #default>
|
||||||
<el-button v-if="props.showBtn" size="small" type="primary">上传文件</el-button>
|
<el-button v-if="props.showBtn" size="small" type="primary"
|
||||||
|
>上传文件</el-button
|
||||||
|
>
|
||||||
<el-icon v-else> <Plus /> </el-icon>
|
<el-icon v-else> <Plus /> </el-icon>
|
||||||
</template>
|
</template>
|
||||||
<template #file="{ file }" v-if="!props.showBtn">
|
<template #file="{ file }" v-if="!props.showBtn">
|
||||||
<div v-if="props.isImg">
|
<div v-if="props.isImg">
|
||||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
||||||
<span class="el-upload-list__item-actions">
|
<span class="el-upload-list__item-actions">
|
||||||
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handlePictureCardPreview(file)"
|
||||||
|
>
|
||||||
<el-icon> <zoom-in /></el-icon>
|
<el-icon> <zoom-in /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@ -75,14 +83,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { COMPONENT_WIDTH } from "@/constant";
|
import { COMPONENT_WIDTH } from "@/constant";
|
||||||
import {
|
import { ref, defineProps, defineEmits, computed, watch, onMounted } from "vue";
|
||||||
ref,
|
|
||||||
defineProps,
|
|
||||||
defineEmits,
|
|
||||||
computed,
|
|
||||||
watch,
|
|
||||||
onMounted
|
|
||||||
} from "vue";
|
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -103,9 +104,9 @@ const props = defineProps({
|
|||||||
default: COMPONENT_WIDTH,
|
default: COMPONENT_WIDTH,
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
showBtn:{
|
showBtn: {
|
||||||
type:Boolean,
|
type: Boolean,
|
||||||
default:false
|
default: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -174,8 +175,6 @@ const getSuffix = (fileName) => {
|
|||||||
//否则返回other
|
//否则返回other
|
||||||
return "OTHER";
|
return "OTHER";
|
||||||
};
|
};
|
||||||
|
|
||||||
const imageUrl = ref("");
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const dialogImageUrl = ref("");
|
const dialogImageUrl = ref("");
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
@ -184,23 +183,36 @@ const headers = ref({
|
|||||||
Authorization: store.getters.token
|
Authorization: store.getters.token
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (props.modelValue) {
|
|
||||||
fileList.value = props.modelValue.map((el) => {
|
|
||||||
return {
|
|
||||||
url: `/mosty-api/mosty-base/minio/image/download/` + el
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const fileList = ref([]);
|
const fileList = ref([]);
|
||||||
|
onMounted(() => {
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => {
|
||||||
|
let arr = val ? val : [];
|
||||||
|
if (arr && arr.length > 0) {
|
||||||
|
if (!props.sfUrl) {
|
||||||
|
fileList.value = arr.map((el) => {
|
||||||
|
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
fileList.value = arr.map((el) => {
|
||||||
|
return { url: el };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const handlerSuccess = (res, file) => {
|
const handlerSuccess = (res, file) => {
|
||||||
file.url = `/mosty-api/mosty-base/minio/image/download/` + res.data;
|
file.url = `/mosty-api/mosty-base/minio/image/download/` + res.data;
|
||||||
fileList.value.push(file);
|
fileList.value.push(file);
|
||||||
props.modelValue.push(res.data);
|
let arr = props.modelValue ? props.modelValue : [];
|
||||||
|
arr.push(res.data);
|
||||||
|
emits("update:modelValue", arr);
|
||||||
emits("handleChange", props.modelValue);
|
emits("handleChange", props.modelValue);
|
||||||
emits("update:modelValue", props.modelValue);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleExceed = (files, fileList) => {
|
const handleExceed = (files, fileList) => {
|
||||||
@ -225,9 +237,6 @@ const beforeImgUpload = (file) => {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleAvatarSuccess = (res, file) => {
|
|
||||||
imageUrl.value = URL.createObjectURL(file.raw);
|
|
||||||
};
|
|
||||||
//查询图片
|
//查询图片
|
||||||
const handlePictureCardPreview = (file) => {
|
const handlePictureCardPreview = (file) => {
|
||||||
dialogImageUrl.value = file.url;
|
dialogImageUrl.value = file.url;
|
||||||
@ -245,6 +254,8 @@ const handleRemove = (file) => {
|
|||||||
emits("handleChange", props.modelValue);
|
emits("handleChange", props.modelValue);
|
||||||
emits("update:modelValue", props.modelValue);
|
emits("update:modelValue", props.modelValue);
|
||||||
};
|
};
|
||||||
|
const propsModelValue = ref();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
<div style="width: 100%;" class="mt10">
|
<div style="width: 100%;" class="mt10">
|
||||||
<el-form-item prop="bkfj" label="上传附件" style="width: 100%;">
|
<el-form-item prop="bkfj" label="上传附件" style="width: 100%;">
|
||||||
<div>
|
<div>
|
||||||
<MOSTY.Upload :limit="10" v-model="listQuery.bkfj" :key="1" />
|
<MOSTY.Upload :limit="10" v-model="listQuery.bkfj" />
|
||||||
<div>支持png、jpg、pdf文件上传</div>
|
<div>支持png、jpg、pdf文件上传</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -246,7 +246,7 @@ const get_bkqy_list = (row) =>{
|
|||||||
// 根据id获取详情
|
// 根据id获取详情
|
||||||
const getDataById = (id) =>{
|
const getDataById = (id) =>{
|
||||||
qcckGet({},'/mosty-gsxt/tbGsxtBk/selectVoById/'+id).then(res=>{
|
qcckGet({},'/mosty-gsxt/tbGsxtBk/selectVoById/'+id).then(res=>{
|
||||||
console.log(res,'=========00');
|
res.bkfj = res.bkfj ? res.bkfj.split(',') : [];
|
||||||
res.bkqyList = res.qyList || [];
|
res.bkqyList = res.qyList || [];
|
||||||
listQuery.value = res || {}
|
listQuery.value = res || {}
|
||||||
})
|
})
|
||||||
@ -288,9 +288,17 @@ const choosed = (val) => {
|
|||||||
listQuery.value.bkDxxx = (val.map(it=>it.id)).join(',');
|
listQuery.value.bkDxxx = (val.map(it=>it.id)).join(',');
|
||||||
let peolist = []
|
let peolist = []
|
||||||
val.forEach(item=>{
|
val.forEach(item=>{
|
||||||
if(item.zdryList) list = list.concat(item.zdryList)
|
if(item.zdryList) peolist = peolist.concat(item.zdryList)
|
||||||
})
|
})
|
||||||
listQuery.value.bkdxList = peolist;
|
let brrPeo = peolist.map(item=>{
|
||||||
|
let bqArr = item.bqList || [];
|
||||||
|
let bqs = bqArr.map(v=>{
|
||||||
|
return { bqZl:v.bqZl , bqId:v.bqId, bqLx:v.bqLx, bqLb:v.bqLb, bqMc:v.bqMc, bqDm:v.bqDm }
|
||||||
|
})
|
||||||
|
return { id:item.id, fjZp:item.fjZp, ryXm:item.ryXm, ryXb:item.ryXb, rySfzh:item.rySfzh, ryHjd:item.hjdXz, ryXjd:item.xzdXz, rySjhm:item.ryLxdh, qtXnsf:item.qtXnsf,clCjh:item.clCjh, clCph:item.clCph, qtTzms:item.qtTzms, bqList:bqs }
|
||||||
|
})
|
||||||
|
|
||||||
|
listQuery.value.bkdxList = brrPeo;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,16 +31,16 @@
|
|||||||
<template #bkDx="{ row }">
|
<template #bkDx="{ row }">
|
||||||
<DictTag :tag="false" :value="row.bkDx" :options="D_GS_BK_DX" />
|
<DictTag :tag="false" :value="row.bkDx" :options="D_GS_BK_DX" />
|
||||||
</template>
|
</template>
|
||||||
<template #bkDxxx="{ row }">
|
<template #bkdxList="{ row }">
|
||||||
<span v-if="row.bkDxxx"><span v-for="(it,idx) in row.bkDxxx" :key="idx"> {{ it.ryXm }} 、</span></span>
|
<span v-if="row.bkdxList"><span class="nowrap" v-for="(it,idx) in row.bkdxList" :key="idx"> {{ it.ryXm }} <span v-if="idx < row.bkdxList.length-1">、</span></span></span>
|
||||||
<span v-else>暂无</span>
|
<span v-else>暂无</span>
|
||||||
</template>
|
</template>
|
||||||
<template #sjrs="{ row }">
|
<template #sjrs="{ row }">
|
||||||
<span v-if="row.bkDxxx"> {{ row.bkDxxx.length }} </span>
|
<span v-if="row.bkdxList"> {{ row.bkdxList.length }} </span>
|
||||||
<span v-else>0</span>
|
<span v-else>0</span>
|
||||||
</template>
|
</template>
|
||||||
<template #qyList="{ row }">
|
<template #qyList="{ row }">
|
||||||
<span v-for="(it,idx) in row.qyList" :key="idx"> {{ it.qymc }} 、</span>
|
<span v-for="(it,idx) in row.qyList" :key="idx"> {{ it.qymc }} <span v-if="idx < row.qyList.length-1">、</span></span>
|
||||||
</template>
|
</template>
|
||||||
<template #yjcs="{row}">
|
<template #yjcs="{row}">
|
||||||
<span @click="openWarning(row)" style="color: #00ffff;" class="mr5 pointer">{{ row.yjcs || 0}}</span>次
|
<span @click="openWarning(row)" style="color: #00ffff;" class="mr5 pointer">{{ row.yjcs || 0}}</span>次
|
||||||
@ -128,13 +128,13 @@ const pageData = reactive({
|
|||||||
tableColumn: [
|
tableColumn: [
|
||||||
{ label: "布控级别", prop: "bkDj", showSolt: true },
|
{ label: "布控级别", prop: "bkDj", showSolt: true },
|
||||||
{ label: "布控标题", prop: "bkBt" },
|
{ label: "布控标题", prop: "bkBt" },
|
||||||
{ label: "布控对象", prop: "bkDx",showSolt: true },
|
{ label: "布控对象", prop: "bkDx",showSolt: true ,showOverflowTooltip:true},
|
||||||
{ label: "布控对象信息", prop: "bkDxxx",showSolt: true },
|
{ label: "布控对象信息", prop: "bkdxList",showSolt: true,showOverflowTooltip:true },
|
||||||
{ label: "布控范围", prop: "qyList", showSolt: true },
|
{ label: "布控范围", prop: "qyList", showSolt: true,showOverflowTooltip:true },
|
||||||
{ label: "涉及人数", prop: "sjrs",showSolt: true },
|
{ label: "涉及人数", prop: "sjrs",showSolt: true },
|
||||||
{ label: "预警次数", prop: "yjcs",showSolt: true },
|
{ label: "预警次数", prop: "yjcs",showSolt: true },
|
||||||
{ label: "开始时间", prop: "bkSjKs"},
|
{ label: "开始时间", prop: "bkSjKs",showOverflowTooltip:true},
|
||||||
{ label: "结束时间", prop: "bkSjJs"},
|
{ label: "结束时间", prop: "bkSjJs",showOverflowTooltip:true},
|
||||||
{ label: "布控发起人", prop: "bkfqrXm"},
|
{ label: "布控发起人", prop: "bkfqrXm"},
|
||||||
{ label: "布控状态", prop: "bkZt",showSolt: true},
|
{ label: "布控状态", prop: "bkZt",showSolt: true},
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user