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

2
src/components/negative/verify.vue

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

3
src/style/public.scss

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

16
src/views/sensitivePerception/ModelClueTask.vue

@ -40,6 +40,12 @@
</header>
<div class="table-container">
<el-table :data="list">
<el-table-column
label="任务名称"
prop="taskName"
width="200"
show-overflow-tooltip
/>
<el-table-column
label="模型名称"
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="操作" 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>
</div>

31
src/views/work/Query.vue

@ -498,25 +498,36 @@ function reset() {
};
getList();
//
router.push('/query')
router.push("/query");
}
const route = useRoute()
watch(() => route.query, () => {
const route = useRoute();
watch(
() => route.query,
() => {
updateQuery()
getList();
}
);
function updateQuery() {
if (route.query.processingStatus) {
query.value.processingStatus = [route.query.processingStatus]
query.value.processingStatus = [route.query.processingStatus];
} else {
query.value.processingStatus = []
query.value.processingStatus = [];
}
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")]
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"),
];
} else {
query.value.crtTime = []
query.value.crtTime = [];
}
}
getList()
})
onMounted(() => {
updateQuery()
getList();
});

Loading…
Cancel
Save