更新
This commit is contained in:
@ -1,73 +1,35 @@
|
||||
<template>
|
||||
<div
|
||||
class="form-item-box"
|
||||
:class="props.showBtn ? 'showBtn-upload' : ''"
|
||||
:style="{ width: width }"
|
||||
>
|
||||
<el-upload
|
||||
v-bind="$attrs"
|
||||
:headers="headers"
|
||||
:multiple="false"
|
||||
class="avatar-uploader"
|
||||
:limit="props.limit"
|
||||
:action="actionUrl"
|
||||
:list-type="props.showBtn ? '' : 'picture-card'"
|
||||
:file-list="fileList"
|
||||
show-file-list
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handlerSuccess"
|
||||
:before-upload="beforeImgUpload"
|
||||
>
|
||||
<div class="form-item-box" :class="props.showBtn ? 'showBtn-upload' : ''" :style="{ width: width }">
|
||||
<el-upload v-bind="$attrs" :headers="headers" :multiple="false" class="avatar-uploader" :limit="props.limit"
|
||||
:action="actionUrl" :list-type="props.showBtn ? '' : 'picture-card'" :file-list="fileList" show-file-list
|
||||
:on-exceed="handleExceed" :on-success="handlerSuccess" :before-upload="beforeImgUpload">
|
||||
<template #default>
|
||||
<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 #file="{ file }" v-if="!props.showBtn">
|
||||
<div v-if="props.isImg">
|
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
||||
<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>
|
||||
</span>
|
||||
<span
|
||||
v-if="!disabled"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="handleRemove(file, fileList)"
|
||||
>
|
||||
<el-icon>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file, fileList)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="file-wrap">
|
||||
<span>
|
||||
<svg-icon :icon="getSuffix(file.name)" />
|
||||
</span>
|
||||
<span><svg-icon :icon="getSuffix(file.name)" /></span>
|
||||
<span class="file-name">{{ file.name }}</span>
|
||||
</div>
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span
|
||||
v-if="!disabled"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="handleDownload(file)"
|
||||
>
|
||||
<el-icon>
|
||||
<Download />
|
||||
</el-icon>
|
||||
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
||||
<el-icon><Download /></el-icon>
|
||||
</span>
|
||||
<span
|
||||
v-if="!disabled"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="handleRemove(file, fileList)"
|
||||
>
|
||||
<el-icon>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file, fileList)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@ -80,7 +42,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { COMPONENT_WIDTH } from "@/constant";
|
||||
import { ref, defineProps, defineEmits, computed, watch, onMounted } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
@ -107,17 +68,19 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isAll:{
|
||||
isAll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const actionUrl = computed(() =>{
|
||||
if(props.isAll){
|
||||
return "/mosty-api/mosty-base/minio/image/upload/id"
|
||||
}else{
|
||||
return props.isImg ? "/mosty-api/mosty-base/minio/image/upload/id" : "/mosty-api/mosty-base/minio/file/upload"
|
||||
const actionUrl = computed(() => {
|
||||
if (props.isAll) {
|
||||
return "/mosty-api/mosty-base/minio/image/upload/id";
|
||||
} else {
|
||||
return props.isImg
|
||||
? "/mosty-api/mosty-base/minio/image/upload/id"
|
||||
: "/mosty-api/mosty-base/minio/file/upload";
|
||||
}
|
||||
});
|
||||
|
||||
@ -154,7 +117,17 @@ const getSuffix = (fileName) => {
|
||||
if (suffix === "pdf") return "PDF";
|
||||
|
||||
//视频 音频
|
||||
var videolist = [ "mp4", "m2v", "mkv", "rmvb", "wmv", "avi", "flv", "mov", "m4v" ];
|
||||
var videolist = [
|
||||
"mp4",
|
||||
"m2v",
|
||||
"mkv",
|
||||
"rmvb",
|
||||
"wmv",
|
||||
"avi",
|
||||
"flv",
|
||||
"mov",
|
||||
"m4v"
|
||||
];
|
||||
if (videolist.includes(suffix)) return "VIDEO";
|
||||
|
||||
var musiclist = ["mp3", "wav", "wmv"];
|
||||
@ -179,7 +152,6 @@ const headers = ref({
|
||||
});
|
||||
|
||||
const fileList = ref([]);
|
||||
;
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
@ -187,18 +159,21 @@ watch(
|
||||
if (arr && arr.length > 0) {
|
||||
if (!props.sfUrl) {
|
||||
fileList.value = arr.map((el) => {
|
||||
if(Object.prototype.toString.call(el) === '[object Object]'){
|
||||
return { url: `/mosty-api/mosty-base/minio/image/download/` + el,name:el.name };
|
||||
}else{
|
||||
if (Object.prototype.toString.call(el) === "[object Object]") {
|
||||
return {
|
||||
url: `/mosty-api/mosty-base/minio/image/download/` + el,
|
||||
name: el.name
|
||||
};
|
||||
} else {
|
||||
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fileList.value = arr.map((el) => {
|
||||
if(Object.prototype.toString.call(el) === '[object Object]'){
|
||||
return { url: el,name:el.name };
|
||||
}else{
|
||||
return { url: el };
|
||||
if (Object.prototype.toString.call(el) === "[object Object]") {
|
||||
return { url: el, name: el.name };
|
||||
} else {
|
||||
return { url: el };
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -207,7 +182,6 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
|
||||
const handlerSuccess = (res, file) => {
|
||||
file.url = `/mosty-api/mosty-base/minio/image/download/` + res.data;
|
||||
fileList.value.push(file);
|
||||
@ -257,7 +231,6 @@ const handleRemove = (file) => {
|
||||
emits("update:modelValue", props.modelValue);
|
||||
};
|
||||
const propsModelValue = ref();
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -9,12 +9,6 @@
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<div ref="btns" class="btns flexcb">
|
||||
<div class="">
|
||||
<el-button>批量处理</el-button>
|
||||
<el-button>导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<MyTable
|
||||
:tableData="pageData.tableData"
|
||||
:tableColumn="pageData.tableColumn"
|
||||
@ -51,7 +45,7 @@
|
||||
<template #reference>
|
||||
<el-link size="small" type="success" v-if="row.bkZt == '04'" @click="row.visible = !row.visible,chooseRow.id = row.id">审批</el-link>
|
||||
</template>
|
||||
<el-form :model="chooseRow" ref="elRowForm" :inline="true" label-width="100px" :rules="rules">
|
||||
<el-form :model="chooseRow" ref="elRowForm" v-if="row.visible" :inline="true" label-width="100px" :rules="rules">
|
||||
<el-form-item label="是否通过" prop="sftg" class="mt10 mb10" style="width: 100%;">
|
||||
<MOSTY.Select filterable v-model="chooseRow.sftg" :dictEnum="D_BZ_SF" width="100%" clearable placeholder="请选择是否通过"/>
|
||||
</el-form-item>
|
||||
@ -126,13 +120,6 @@ const searchConfiger = ref([
|
||||
showType: "select",
|
||||
options: D_GS_BK_ZT
|
||||
},
|
||||
{
|
||||
label: "布控时间类型",
|
||||
prop: "bkSjLx",
|
||||
placeholder: "请选择布控时间",
|
||||
showType: "date",
|
||||
options: D_GS_BK_SJLX
|
||||
},
|
||||
]);
|
||||
const queryFrom = ref({});
|
||||
const pageData = reactive({
|
||||
|
@ -22,7 +22,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="感知源信息" prop="sxts" class="ww100">
|
||||
<el-form-item label="感知源信息" class="ww100">
|
||||
<div class="flex ww100">
|
||||
<div class="boo">
|
||||
<span v-if="!listQuery.sxts || listQuery.sxts.length == 0" class="f14 ml10" style="color: #e1e1e1;">感知源信息</span>
|
||||
|
@ -9,12 +9,6 @@
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<div ref="btns" class="btns flexcb">
|
||||
<div class="">
|
||||
<el-button>批量处理</el-button>
|
||||
<el-button>导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<MyTable
|
||||
:tableData="pageData.tableData"
|
||||
:tableColumn="pageData.tableColumn"
|
||||
@ -51,7 +45,7 @@
|
||||
<template #reference>
|
||||
<el-link size="small" type="success" v-if="row.bkZt == '02'" @click="row.visible = !row.visible,chooseRow.id = row.id">审核</el-link>
|
||||
</template>
|
||||
<el-form :model="chooseRow" ref="elRowForm" :inline="true" label-width="100px" :rules="rules">
|
||||
<el-form :model="chooseRow" ref="elRowForm" v-if="row.visible" :inline="true" label-width="100px" :rules="rules">
|
||||
<el-form-item label="是否通过" prop="sftg" class="mt10 mb10" style="width: 100%;">
|
||||
<MOSTY.Select filterable v-model="chooseRow.sftg" :dictEnum="D_BZ_SF" width="100%" clearable placeholder="请选择是否通过"/>
|
||||
</el-form-item>
|
||||
@ -126,13 +120,6 @@ const searchConfiger = ref([
|
||||
showType: "select",
|
||||
options: D_GS_BK_ZT
|
||||
},
|
||||
{
|
||||
label: "布控时间类型",
|
||||
prop: "bkSjLx",
|
||||
placeholder: "请选择布控时间",
|
||||
showType: "date",
|
||||
options: D_GS_BK_SJLX
|
||||
},
|
||||
]);
|
||||
const queryFrom = ref({});
|
||||
const pageData = reactive({
|
||||
|
@ -86,7 +86,7 @@
|
||||
<div style="width: 100%;" class="mt10">
|
||||
<el-form-item prop="bkfj" label="上传附件" style="width: 100%;">
|
||||
<div>
|
||||
<MOSTY.Upload :limit="10" :isImg="false" v-model="listQuery.bkfj" />
|
||||
<MOSTY.Upload :showBtn="true" :limit="10" :isImg="false" :isAll="true" v-model="listQuery.bkfj" />
|
||||
<div>支持png、jpg、pdf文件上传</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -248,7 +248,7 @@ const get_bkqy_list = (row) =>{
|
||||
// 根据id获取详情
|
||||
const getDataById = (id) =>{
|
||||
qcckGet({},'/mosty-gsxt/tbGsxtBk/selectVoById/'+id).then(res=>{
|
||||
res.bkfj = res.bkfj ? res.bkfj.split(',') : [];
|
||||
res.bkfj = res.ossList || [];
|
||||
res.bkqyList = res.qyList ? res.qyList.map(v=>v.id) : [];
|
||||
listQuery.value = res || {}
|
||||
})
|
||||
|
@ -3,7 +3,6 @@
|
||||
<div class="titleBox">
|
||||
<PageTitle title="我的布控">
|
||||
<el-button type="primary" @click="handleAdd('add',null)">发起布控</el-button>
|
||||
<el-button type="primary">导出</el-button>
|
||||
</PageTitle>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
@ -83,7 +82,7 @@ const searchBox = ref(); //搜索框
|
||||
const searchConfiger = ref([
|
||||
{
|
||||
label: "布控级别",
|
||||
prop: "bqjb",
|
||||
prop: "bkDj",
|
||||
placeholder: "请选择布控级别",
|
||||
showType: "select",
|
||||
options: D_GS_BK_DJ
|
||||
@ -102,13 +101,6 @@ const searchConfiger = ref([
|
||||
showType: "select",
|
||||
options: D_GS_BK_ZT
|
||||
},
|
||||
{
|
||||
label: "布控时间类型",
|
||||
prop: "bkSjLx",
|
||||
placeholder: "请选择布控时间",
|
||||
showType: "date",
|
||||
options: D_GS_BK_SJLX
|
||||
},
|
||||
]);
|
||||
const queryFrom = ref({});
|
||||
const pageData = reactive({
|
||||
|
@ -308,7 +308,6 @@ const handleFx = () => {
|
||||
proxy.$message({ type: "danger", message: "解析异常,请重新上传解析" });
|
||||
}
|
||||
|
||||
console.log(message,'===========message');
|
||||
|
||||
if(!message) return proxy.$message({ type: "danger", message: "解析异常,请重新上传解析" });
|
||||
|
||||
|
Reference in New Issue
Block a user