Browse Source

fit: 知识库管理

main
wxc 6 months ago
parent
commit
8602becb04
  1. 8
      src/api/mobileSupervision/book.ts
  2. 144
      src/views/mobileSupervise/Book.vue
  3. 2
      src/views/mobileSupervise/Selfexamination.vue
  4. 53
      src/views/mobileSupervise/TaskProblem.vue

8
src/api/mobileSupervision/book.ts

@ -0,0 +1,8 @@
import request from "@/api/request";
export function listBook(query) {
return request.get({
url: '/book',
query
});
}

144
src/views/mobileSupervise/Book.vue

@ -0,0 +1,144 @@
<template>
<div class="container">
<header class="mb-20">
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="文件名">
<el-input
placeholder="文件名"
v-model="query.fileName"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="flex between">
<el-button type="primary" @click="handleShowAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
上传知识</el-button
>
<div>
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search" />
</template>
查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
<div class="table-container">
<el-table :data="users">
<el-table-column label="文件名" prop="fileName" />
<el-table-column label="文件路径" prop="filePath" />
<el-table-column
label="创建时间"
prop="createTime"
width="200"
/>
<el-table-column label="操作" width="200">
<template #default="{ row }">
<el-button
type="primary"
link
@click="download(row.filePath)"
v-perms="['user:edit']"
>下载文件</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex end mt-8">
<el-pagination
@size-change="getList"
@current-change="getList"
:page-sizes="[10, 20, 50]"
v-model:page-size="query.size"
v-model:current-page="query.current"
layout="total, sizes, prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</div>
<el-dialog
title="上传知识"
v-model="show"
>
<el-upload
drag
:action="`${BASE_PATH}/book`"
:headers="{ Authorization: getToken() }"
multiple
v-model:file-list="fileList"
@success="handleSuccess"
accept="application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
class="mt-20"
>
<el-icon class="el-icon--upload"
><upload-filled
/></el-icon>
<div class="el-upload__text">
<p>点击或拖拽文件到此区域上传</p>
</div>
</el-upload>
<footer class="flex end mt-20">
<el-button @click="show = false" size="large">取消</el-button>
<el-button type="primary" size="large">确定</el-button>
</footer>
</el-dialog>
</template>
<script setup>
import { getToken } from "@/utils/token";
import { BASE_PATH } from "@/api/request";
import { listBook } from "@/api/mobileSupervision/book";
import feedback from "@/utils/feedback";
const users = ref([]);
const query = ref({
current: 1,
size: 10,
});
const total = ref(0);
function getList() {
listBook(query.value).then((data) => {
users.value = data.records;
total.value = data.total;
});
}
function reset() {
query.value = {
current: 1,
size: 10,
};
getList();
}
getList();
const show = ref(false);
function handleShowAdd() {
show.value = true;
}
const fileList = ref([])
function handleSuccess() {
getList()
}
function download(filePath) {
window.open(`${BASE_PATH}/file/stream/${filePath}`);
}
</script>
<style lang="scss" scoped>
</style>

2
src/views/mobileSupervise/Selfexamination.vue

@ -265,7 +265,7 @@
size="small" size="small"
type="danger" type="danger"
plain plain
@click="form.contents.push({})" @click="form.contents.splice(index, 1)"
> >
<template #icon> <template #icon>
<icon name="el-icon-Delete" /> <icon name="el-icon-Delete" />

53
src/views/mobileSupervise/TaskProblem.vue

@ -82,6 +82,7 @@
prop="problemType" prop="problemType"
width="100" width="100"
align="center" align="center"
show-overflow-tooltip
/> />
<el-table-column <el-table-column
label="问题描述" label="问题描述"
@ -90,8 +91,8 @@
/> />
<el-table-column label="分发状态"> <el-table-column label="分发状态">
<template #default="{ row }"> <template #default="{ row }">
<span v-if="row.taskStatus === 'todo'">执行中</span> <span v-if="row.distributionState === '0'">未分发</span>
<span v-if="row.taskStatus === 'done'">已完成</span> <span v-if="row.distributionState === '1'">已分发</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="240"> <el-table-column label="操作" width="240">
@ -99,7 +100,7 @@
<el-button <el-button
type="primary" type="primary"
link link
@click="handleShowDetail(row)" @click="showDeatil(row)"
>问题详情</el-button >问题详情</el-button
> >
<el-button <el-button
@ -108,12 +109,12 @@
@click="handleProblemsShow(row)" @click="handleProblemsShow(row)"
>问题下发</el-button >问题下发</el-button
> >
<el-button <!-- <el-button
type="primary" type="primary"
link link
@click="handleProblemsShow(row)" @click="handleProblemsShow(row)"
>处置情况</el-button >处置情况</el-button
> > -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -131,6 +132,41 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<el-dialog title="问题详情" v-model="show">
<div>
<div class="row">
<div class="col col-12">
<label>发现时间</label>
<span>{{ activeRow.createTime }}</span>
</div>
<div class="col col-12">
<label>问题来源</label>
<span>{{ getDictLable(dict.taskType, activeRow.taskType) }}</span>
</div>
<div class="col col-12">
<label>涉及单位</label>
<span>{{ activeRow.departName }}</span>
</div>
<div class="col col-12">
<label>涉及人员</label>
<span>{{ activeRow.peoples }}</span>
</div>
<div class="col col-24">
<label>问题类型</label>
<span>{{ activeRow.problemType || '/' }}</span>
</div>
<div class="col col-24">
<label>问题描述</label>
<span>{{ activeRow.thingDesc }}</span>
</div>
<div class="col col-24">
<label>分发状态</label>
<span>{{ getDictLable(dict.distributionState, activeRow.distributionState) }}</span>
</div>
</div>
</div>
</el-dialog>
</template> </template>
<script setup> <script setup>
import { getDictLable } from "@/utils/util"; import { getDictLable } from "@/utils/util";
@ -169,6 +205,13 @@ import { getDictLable } from "@/utils/util";
onMounted(() => { onMounted(() => {
getList() getList()
}) })
const show = ref(false)
const activeRow = ref({})
function showDeatil(row) {
show.value = true
activeRow.value = row
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save