fix:总部文件以及日常监督统计图echarts最小值

This commit is contained in:
shijing 2023-09-21 17:13:30 +08:00
parent 2599aab7d0
commit de8b198b3c
5 changed files with 341 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"vod-js-sdk-v6": "^1.4.12",
"vod-js-sdk-v6": "^1.4.12",
"vue": "2.6.10",
"vue-pdf": "^4.2.0",
"vue-router": "3.0.6",

View File

@ -175,6 +175,12 @@ export const asyncRoutes = [
meta: { title: '资讯资料分享', icon: 'guide', perms: ['consulting_views'] },
alwaysShow: true,
children: [
{
path: 'deptFile',
name: 'deptFile',
component: () => import('@/views/consulting/deptFile.vue'),
meta: { title: '总部文件', perms: ['test'] }
},
{
path: 'rule',
name: 'rule',

View File

@ -0,0 +1,314 @@
<template>
<div class="app-container">
<el-card>
<el-button type="primary" icon="el-icon-plus" @click="handleAddContent" v-if="checkPermission(['test'])"
>
新增
</el-button>
<el-input
v-model="listQuery.search"
placeholder="输入关键字搜索"
style="width: 200px;"
class="filter-item"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleSearch">搜索</el-button>
</el-card>
<el-card style="margin-top: 10px">
<el-table
v-loading="listLoading"
:data="contentList.results"
border
fit
stripe
highlight-current-row
max-height="600"
>
<el-table-column type="index" width="50" />
<el-table-column label="名称" min-width="110">
<template slot-scope="scope" v-if="scope.row.file_.file">
<a v-if="scope.row.file_.file.indexOf('.pdf')>-1 " :href="`/static/build/generic/web/viewer.html?file=${scope.row.file_.file}`" target="view_window" class="flv">
<el-link type="primary">{{ scope.row.name }}</el-link>
</a>
<el-link v-else :href="scope.row.file_.file" type="primary">{{ scope.row.name }}</el-link>
<!-- <div @click="fileClick(scope.row)">{{ scope.row.name }}</div> -->
</template>
<template slot-scope="scope" v-else>{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="文件描述" >
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column label="创建时间" width='160'>
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="120px"
fixed="right"
>
<template slot-scope="scope">
<el-button
:disabled="!checkPermission(['test'])"
type="primary"
size="small"
icon="el-icon-edit"
@click="handleEdit(scope)"
/>
<el-button
:disabled="!checkPermission(['test'])"
type="danger"
size="small"
icon="el-icon-delete"
@click="handleDelete(scope)"
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="contentList.count > 0"
:total="contentList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card>
<div id="example1"></div>
<el-dialog
:visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑文件' : '新增文件'"
>
<el-form
ref="Form"
:model="Content"
label-width="80px"
label-position="right"
:rules="rule1"
>
<el-form-item label="名称" prop="name">
<el-input v-model="Content.name" placeholder="文件名称" />
</el-form-item>
<el-form-item label="文件描述" prop="description">
<el-input
type="textarea"
:rows="4"
v-model="Content.description"
placeholder="文件描述"
/>
</el-form-item>
<el-form-item label="文件上传" prop="file" v-if="dialogVisible">
<el-upload
ref="upload"
:action="upUrl"
:on-preview="handlePreview"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip"
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirm('Form')">确认</el-button>
</div>
</el-dialog>
<!-- <div>
<p class="over" />
<div id="pdf-content">
<el-container class="container" @contextmenu.native="handlePaste($event)" />
</div>
</div> -->
</div>
</template>
<script>
import {getPolicyList,createPolicy,deletePolicy, updatePolicy} from "@/api/policy";
import pdf from 'pdfobject';
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { upUrl, upHeaders } from "@/api/file";
const defaultContent = {
cate:'总部',
name: "",
description: "",
file:null
};
export default {
components: { Pagination, Treeselect },
data() {
return {
upHeaders: upHeaders(),
upUrl: upUrl(),
fileList:[],
Content: defaultContent,
listLoading:false,
dialogVisible: false,
listQuery: {
page: 1,
cate:'总部',
search:'',
page_size: 20,
},
contentList: {
count:0
},
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
PdfWebPath: '',
pdfTop: 40,
showTips: true
};
},
computed: {},
watch: {
filterOrgText(val) {
this.$refs.tree.filter(val);
},
},
created() {
document.onselectstart = function() {
return false
}
// 禁止鼠标右键功能
document.oncontextmenu = function() {
return false
}
this.getList();
},
methods: {
handlePaste(event) {
// 禁用鼠标右键
event.preventDefault()
return false
},
fileClick(row){
var options = {
height: '10000px',
pdfOpenParams: {
scrollbars: '0',
toolbar: '1',
statusbar: '1'
} // 禁用工具栏代码
}
pdf.embed(row.file_.file,'#pdf-content', options)
// pdf.embed(response.WebPath,'#pdf-content', options)
},
handleSearch(){
this.getList();
},
handlePreview(file) {
if ("url" in file) {
window.open(file.url);
} else {
window.open(file.response.data.path);
}
},
handleUpSuccess(res, file, filelist) {
this.Content.file = res.data.id;
},
handleRemove(file, filelist){
this.Content.file = null;
},
checkPermission,
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
getList() {
getPolicyList(this.listQuery).then((response) => {
if (response.data) {
this.contentList = response.data;
}
});
},
handleAddContent() {
this.Content = Object.assign({}, defaultContent);
this.dialogType = "new";
this.dialogVisible = true;
this.fileList=[]
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.Content = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
if (this.Content.file) {
this.fileList = [
{
name:this.Content.file_.name,
url: this.Content.file,
},
];
}
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deletePolicy(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
console.log(this.Content)
updatePolicy(this.Content.id, this.Content).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("编辑成功");
}
});
} else {
createPolicy(this.Content).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("新建成功");
}
});
}
} else {
return false;
}
});
},
},
};
</script>

View File

@ -100,7 +100,7 @@
top:'3%'
},
grid: {
left: '2%',
left: '1%',
right: '2%',
bottom: '25%',
top: '12%',
@ -341,13 +341,25 @@
data42.push(item4.客户投诉处理满意率设定值)
})
minNumber1 =Math.min(...data1)
minNumber1 = Math.floor(minNumber1)
minNumber1 = Math.floor(minNumber1);
if(minNumber1>0){
minNumber1 = minNumber1-1;
}
minNumber2 =Math.min(...data2)
minNumber2 = Math.floor(minNumber2)
if(minNumber2>0){
minNumber2 = minNumber2-1;
}
minNumber3 =Math.min(...data3)
minNumber3 = Math.floor(minNumber3)
if(minNumber3>0){
minNumber3 = minNumber3-1;
}
minNumber4 =Math.min(...data4)
minNumber4 = Math.floor(minNumber4)
if(minNumber4>0){
minNumber4 = minNumber4-1;
}
markLine4 = sortedArr4[0].客户投诉处理满意率基础值;
function tofixed1(item){
@ -525,14 +537,14 @@
}
};
</script>
<style>
.printContainers{
/* width: 1075px; */
}
<style scoped>
#numTable,#echartsContainer{
/* margin-left: 37px; */
width: 100%;
}
#echartsContainer{
margin-left: 0;
}
#numTable td{
height: 32px;
padding-left: 5px;
@ -544,7 +556,7 @@
width: 100px;
}
#echartsContainer{
margin-top: 30px;
margin-top: 20px;
}
.chartsWraps{
width: 99%;