Browse Source

fix: 修复保存信息无效的问题。 fix: 完善佐证材料分类上传

main
wxc 1 year ago
parent
commit
13a3b28500
  1. 352
      src/components/file/upload-group.vue
  2. 2
      src/components/negative/verify.vue
  3. 3
      src/style/public.scss
  4. 16
      src/views/sensitivePerception/ModelClueTask.vue
  5. 31
      src/views/work/Query.vue

352
src/components/file/upload-group.vue

@ -11,9 +11,8 @@
v-model="show" v-model="show"
width="60vw" width="60vw"
:close-on-click-modal="false" :close-on-click-modal="false"
top="2vh"
> >
<el-row :gutter="20" style="min-height: 60vh">
<el-col :span="12">
<el-upload <el-upload
drag drag
multiple multiple
@ -27,101 +26,96 @@
> >
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖拽到此处或<em>点击上传</em> <div>将文件拖拽到此处或<em>点击上传</em></div>
<div class="text-small">文件大小限制为 100MB</div>
</div> </div>
<template #tip>
<div class="el-upload__tip">文件大小限制为 100MB</div>
</template>
</el-upload> </el-upload>
</el-col> <h4>未分类文件</h4>
<el-col :span="12"> <div style="min-height: 60px">
<div class="flex gap v-center" style="height: 32px"> <div
<span style="font-size: 12px" v-if="activeFileIds.length" class="flex between mb-10"
>选中{{ activeFileIds.length }}个文件</span v-for="(item, index) in fileList.filter(
(item) => !item.fileClassId
)"
:key="index"
>
<div class="flex gap v-center">
<div v-if="!item.loading">
<template
v-if="getFileType(item.fileName) === FileType.IMG"
> >
<div
class="img-box"
:style="{
backgroundImage: `url(${BASE_PATH}/file/stream/${item.filePath})`,
}"
@click="filePreview(item)"
></div>
</template>
<template v-else>
<icon
:name="getIconName(item.fileName)"
:size="40"
/>
</template>
</div>
<el-progress
type="circle"
:percentage="item.percent"
:width="40"
color="var(--primary-color)"
v-else
></el-progress>
<span>{{ item.fileName }}</span>
</div>
<div class="flex gap v-center">
<el-select <el-select
size="small"
style="width: 200px" style="width: 200px"
v-model="fileClassId" v-model="item.classId"
clearable clearable
> >
<el-option <el-option
v-for="item in fileClasss" v-for="item in fileClasss"
:value="item.id" :value="item.id"
:label="item.classTitle" :label="item.classTitle"
:key="item"
/> />
</el-select> </el-select>
<div v-if="activeFileIds.length">
<el-button <el-button
type="primary" type="primary"
size="small"
plain plain
@click="handleUpdateFileClass" @click="handleUpdateFileClass(item)"
:disabled="!fileClassId" :disabled="!item.classId"
>修改文件分类</el-button >修改文件分类</el-button
> >
<el-button <el-button type="danger" @click="remove(item)"
size="small" >删除文件</el-button
@click="
activeFileIds = [];
fileClassId = '';
"
>取消选中</el-button
> >
</div> </div>
</div> </div>
<el-scrollbar max-height="500px"> </div>
<div style="margin: 2px"> <h4>已分类文件</h4>
<p> <el-scrollbar max-height="400px">
<span class="text-danger">未分类</span> <el-row :gutter="20">
<span <el-col
style="font-size: 12px; color: #999" :span="12"
class="ml-10" v-for="item in fileClasss"
>可单击选择下面文件进行分类</span :key="item"
class="file-class-item"
> >
</p> <header class="text-primary">
<div class="flex gap"> {{ item.classTitle }}
<template </header>
<div style="min-height: 60px">
<div
class="flex between mb-8 file-list-item file-list-item_active"
v-for="(item, index) in fileList.filter( v-for="(item, index) in fileList.filter(
(item) => !item.fileClassId (file) => file.fileClassId === item.id
)" )"
:key="index" :key="index"
> >
<template v-if="item.loading"> <div class="flex gap v-center">
<el-progress <div v-if="!item.loading">
type="circle"
:percentage="item.percent"
:width="80"
color="var(--primary-color)"
></el-progress>
</template>
<div
v-else
class="pointer"
@click="
() => {
if (
activeFileIds.includes(item.uid)
) {
activeFileIds.splice(
activeFileIds.indexOf(
item.uid
),
1
);
} else {
activeFileIds.push(item.uid);
}
}
"
>
<div
class="item flex end v-center column text-center"
:title="item.fileName"
:active="
activeFileIds.includes(item.uid)
"
>
<template <template
v-if=" v-if="
getFileType(item.fileName) === getFileType(item.fileName) ===
@ -135,121 +129,46 @@
}" }"
@click="filePreview(item)" @click="filePreview(item)"
></div> ></div>
<a
class="remove-btn"
@click="remove(index)"
v-if="removeEnable"
>
<icon
name="el-icon-CircleCloseFilled"
:size="20"
/>
</a>
</template> </template>
<template v-else> <template v-else>
<icon <icon
:name=" :name="getIconName(item.fileName)"
getIconName(item.fileName)
"
:size="40" :size="40"
/> />
<span class="filename">{{
item.fileName
}}</span>
<a
class="remove-btn"
@click.stop="remove(index)"
>
<icon
name="el-icon-CircleCloseFilled"
:size="16"
/>
</a>
</template>
</div>
</div>
</template> </template>
</div> </div>
<div v-for="item in fileClasss" class="file-class-item">
<header class="text-primary">
{{ item.classTitle }}
</header>
<div class="flex gap file-class-body">
<template
v-for="(item, index) in fileList.filter(
(file) => file.fileClassId === item.id
)"
:key="index"
>
<template v-if="item.loading">
<el-progress <el-progress
type="circle" type="circle"
:percentage="item.percent" :percentage="item.percent"
:width="80" :width="40"
color="var(--primary-color)" color="var(--primary-color)"
></el-progress>
</template>
<div
v-else v-else
class="pointer" ></el-progress>
@click=" <span>{{ item.fileName }}</span>
() => { </div>
if ( <div class="flex gap v-center">
activeFileIds.includes( <el-button
item.uid type="info"
) plain
) { @click="cancelFileClass(item)"
activeFileIds.splice( size="small"
activeFileIds.indexOf( >取消分类</el-button
item.uid
),
1
);
} else {
activeFileIds.push(
item.uid
);
}
}
"
>
<div
class="item flex end v-center column text-center"
:title="item.fileName"
:active="
activeFileIds.includes(item.uid)
"
> >
<icon <el-button
:name=" type="danger"
getIconName(item.fileName) @click="remove(item)"
" size="small"
:size="40" >删除文件</el-button
/>
<span class="filename">{{
item.fileName
}}</span>
<a
class="remove-btn"
@click.stop="remove(index)"
> >
<icon
name="el-icon-CircleCloseFilled"
:size="16"
/>
</a>
</div>
</div>
</template>
</div> </div>
</div> </div>
</div> </div>
</el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
</el-scrollbar>
<footer class="flex end mt-20"> <footer class="flex end mt-20">
<el-button type="primary" size="large" @click="handleSubmit" <el-button type="primary" size="large" @click="handleSubmit"
></el-button >确认佐证材料</el-button
> >
</footer> </footer>
</el-dialog> </el-dialog>
@ -278,12 +197,14 @@ const emit = defineEmits(["update:files"]);
const show = ref(false); const show = ref(false);
const fileList = ref(props.files); const fileList = ref(props.files);
const activeFileIds = ref([]);
const fileClassId = ref("");
const fileClasss = ref([]); const fileClasss = ref([]);
if (props.problemSourcesCode === ProblemSources.JWDC) { if (props.problemSourcesCode === ProblemSources.JWDC) {
fileClasss.value = [ fileClasss.value = [
{
id: 6,
classTitle: "处理反馈表",
classRemarks: "",
},
{ {
id: 1, id: 1,
classTitle: "容错免责样本申请表", classTitle: "容错免责样本申请表",
@ -346,14 +267,12 @@ function handleError(e) {
feedback.msgError("上传失败!"); feedback.msgError("上传失败!");
} }
function handleUpdateFileClass() { function handleUpdateFileClass(item) {
fileList.value item.fileClassId = item.classId;
.filter((item) => activeFileIds.value.includes(item.uid)) }
.forEach((file) => {
file.fileClassId = fileClassId.value; function cancelFileClass(item) {
}); item.fileClassId = null;
activeFileIds.value = [];
fileClassId.value = "";
} }
function handleSubmit() { function handleSubmit() {
@ -364,85 +283,26 @@ function handleSubmit() {
show.value = false; show.value = false;
} }
function remove(index) { function remove(item) {
fileList.value.splice(index, 1); fileList.value.splice(fileList.value.indexOf(item), 1);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-upload { h4 {
--el-upload-dragger-padding-horizontal: 80px; margin-top: 20px;
} margin-bottom: 10px;
.item {
width: 80px;
height: 80px;
margin-bottom: 12px;
border-radius: 2px;
color: var(--primary-color);
position: relative;
border: 1px solid transparent;
border-radius: 10px;
&:hover {
background-color: #ededed;
border-color: var(--primary-color);
span.filename {
font-weight: 700;
}
}
&[active="true"] {
background-color: #ededed;
border-color: var(--primary-color);
}
span.filename {
line-height: 1.2;
font-size: 12px;
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
margin-top: 10px;
overflow: hidden;
}
.img-box {
width: 80px;
height: 80px;
background-size: cover;
background-position: center;
border-radius: 2px;
&:hover {
outline: 2px solid #ff9800;
}
}
.remove-btn {
position: absolute;
top: -8px;
right: -8px;
display: block;
border-radius: 50%;
height: 16px;
background-color: #fff;
color: #666;
&:hover {
color: red;
cursor: pointer;
}
}
} }
.file-class-item { .file-class-item {
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12); margin-bottom: 20px;
margin-bottom: 10px;
header { header {
padding: 4px 8px; padding: 4px 0;
border-bottom: 1px solid #e4e7ed;
}
.file-class-body {
min-height: 20px;
padding: 4px 8px;
} }
} }
:deep() { .file-list-item {
.el-dialog .el-dialog__body { padding: 10px;
background-color: #f5f5f5;
} }
.file-list-item_active {
background: #f1f3ff;
} }
</style> </style>

2
src/components/negative/verify.vue

@ -1342,7 +1342,7 @@ async function validate() {
} }
} }
async function getData() { function getData() {
return form.value; return form.value;
} }

3
src/style/public.scss

@ -131,6 +131,9 @@ svg+span {
gap: 20px; gap: 20px;
} }
.text-small {
font-size: 12px;
}
.text-center { .text-center {
text-align: center; text-align: center;
} }

16
src/views/sensitivePerception/ModelClueTask.vue

@ -40,6 +40,12 @@
</header> </header>
<div class="table-container"> <div class="table-container">
<el-table :data="list"> <el-table :data="list">
<el-table-column
label="任务名称"
prop="taskName"
width="200"
show-overflow-tooltip
/>
<el-table-column <el-table-column
label="模型名称" label="模型名称"
prop="modelName" prop="modelName"
@ -59,8 +65,16 @@
<el-table-column label="办结数量" align="center" /> <el-table-column label="办结数量" align="center" />
<el-table-column label="查实数量" align="center" /> <el-table-column label="查实数量" align="center" />
<el-table-column label="涉及单位数" align="center" /> <el-table-column label="涉及单位数" align="center" />
<el-table-column label="涉及人数" align="center" />
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template #default="{ row }"> </template> <template #default="{ row }">
<el-button
type="primary"
link
@click="handleRemoveManuel(row)"
>任务统计</el-button
>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>

31
src/views/work/Query.vue

@ -498,25 +498,36 @@ function reset() {
}; };
getList(); getList();
// //
router.push('/query') router.push("/query");
} }
const route = useRoute() const route = useRoute();
watch(() => route.query, () => { watch(
() => route.query,
() => {
updateQuery()
getList();
}
);
function updateQuery() {
if (route.query.processingStatus) { if (route.query.processingStatus) {
query.value.processingStatus = [route.query.processingStatus] query.value.processingStatus = [route.query.processingStatus];
} else { } else {
query.value.processingStatus = [] query.value.processingStatus = [];
} }
if (route.query.crtTime === 'today') { if (route.query.crtTime === "today") {
query.value.crtTime = [moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"), moment().endOf("day").format("YYYY-MM-DD HH:mm:ss")] query.value.crtTime = [
moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),
];
} else { } else {
query.value.crtTime = [] query.value.crtTime = [];
}
} }
getList()
})
onMounted(() => { onMounted(() => {
updateQuery()
getList(); getList();
}); });

Loading…
Cancel
Save