Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
fffcdf3016
File diff suppressed because one or more lines are too long
|
@ -26,7 +26,7 @@
|
||||||
"normalize.css": "7.0.0",
|
"normalize.css": "7.0.0",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"path-to-regexp": "2.4.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": "2.6.10",
|
||||||
"vue-pdf": "^4.2.0",
|
"vue-pdf": "^4.2.0",
|
||||||
"vue-router": "3.0.6",
|
"vue-router": "3.0.6",
|
||||||
|
|
|
@ -42,3 +42,9 @@ export function deleteOrg(id) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function getOrgItem(id) {
|
||||||
|
return request({
|
||||||
|
url: `/system/organization/${id}/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -175,6 +175,12 @@ export const asyncRoutes = [
|
||||||
meta: { title: '资讯资料分享', icon: 'guide', perms: ['consulting_views'] },
|
meta: { title: '资讯资料分享', icon: 'guide', perms: ['consulting_views'] },
|
||||||
alwaysShow: true,
|
alwaysShow: true,
|
||||||
children: [
|
children: [
|
||||||
|
{
|
||||||
|
path: 'deptFile',
|
||||||
|
name: 'deptFile',
|
||||||
|
component: () => import('@/views/consulting/deptFile.vue'),
|
||||||
|
meta: { title: '总部文件', perms: ['test'] }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'rule',
|
path: 'rule',
|
||||||
name: 'rule',
|
name: 'rule',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { login, logout, getInfo, login2, fulllogin } from '@/api/user'
|
import { login, logout, getInfo, login2, fulllogin } from '@/api/user'
|
||||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||||
|
import { getOrgItem} from "@/api/org";
|
||||||
import { resetRouter } from '@/router'
|
import { resetRouter } from '@/router'
|
||||||
|
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
|
@ -68,7 +69,6 @@ const actions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { perms, name, avatar } = data.user
|
const { perms, name, avatar } = data.user
|
||||||
|
|
||||||
// perms must be a non-empty array
|
// perms must be a non-empty array
|
||||||
if (!perms || perms.length <= 0) {
|
if (!perms || perms.length <= 0) {
|
||||||
reject('没有任何权限!')
|
reject('没有任何权限!')
|
||||||
|
@ -104,23 +104,26 @@ const actions = {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo(state.token).then(response => {
|
getInfo(state.token).then(response => {
|
||||||
const { data } = response
|
const { data } = response
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
reject('验证失败,重新登陆.')
|
reject('验证失败,重新登陆.')
|
||||||
}
|
}
|
||||||
|
const { perms, name, avatar, dept, dept_name} = data;
|
||||||
const { perms, name, avatar, dept, dept_name} = data
|
|
||||||
|
|
||||||
// perms must be a non-empty array
|
// perms must be a non-empty array
|
||||||
if (!perms || perms.length <= 0) {
|
|
||||||
reject('没有任何权限!')
|
|
||||||
}
|
|
||||||
|
|
||||||
commit('SET_PERMS', perms)
|
|
||||||
commit('SET_NAME', name)
|
commit('SET_NAME', name)
|
||||||
commit('SET_AVATAR', avatar)
|
commit('SET_AVATAR', avatar)
|
||||||
commit('SET_DEPT', dept)
|
commit('SET_DEPT', dept)
|
||||||
commit('SET_DEPTNAME', dept_name)
|
commit('SET_DEPTNAME', dept_name)
|
||||||
|
if (!perms || perms.length <= 0) {
|
||||||
|
reject('没有任何权限!')
|
||||||
|
}else{
|
||||||
|
if(dept==5||dept==33||dept==34||dept==55||dept==36||dept==37||dept==38
|
||||||
|
||dept==39||dept==40||dept==41||dept==42||dept==67||dept==97){
|
||||||
|
perms.push('test')
|
||||||
|
commit('SET_PERMS', perms);
|
||||||
|
}else{
|
||||||
|
commit('SET_PERMS', perms);
|
||||||
|
}
|
||||||
|
}
|
||||||
resolve(data)
|
resolve(data)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|
|
@ -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>
|
|
@ -100,7 +100,7 @@
|
||||||
top:'3%'
|
top:'3%'
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '2%',
|
left: '1%',
|
||||||
right: '2%',
|
right: '2%',
|
||||||
bottom: '25%',
|
bottom: '25%',
|
||||||
top: '12%',
|
top: '12%',
|
||||||
|
@ -341,13 +341,25 @@
|
||||||
data42.push(item4.客户投诉处理满意率设定值)
|
data42.push(item4.客户投诉处理满意率设定值)
|
||||||
})
|
})
|
||||||
minNumber1 =Math.min(...data1)
|
minNumber1 =Math.min(...data1)
|
||||||
minNumber1 = Math.floor(minNumber1)
|
minNumber1 = Math.floor(minNumber1);
|
||||||
|
if(minNumber1>0){
|
||||||
|
minNumber1 = minNumber1-1;
|
||||||
|
}
|
||||||
minNumber2 =Math.min(...data2)
|
minNumber2 =Math.min(...data2)
|
||||||
minNumber2 = Math.floor(minNumber2)
|
minNumber2 = Math.floor(minNumber2)
|
||||||
|
if(minNumber2>0){
|
||||||
|
minNumber2 = minNumber2-1;
|
||||||
|
}
|
||||||
minNumber3 =Math.min(...data3)
|
minNumber3 =Math.min(...data3)
|
||||||
minNumber3 = Math.floor(minNumber3)
|
minNumber3 = Math.floor(minNumber3)
|
||||||
|
if(minNumber3>0){
|
||||||
|
minNumber3 = minNumber3-1;
|
||||||
|
}
|
||||||
minNumber4 =Math.min(...data4)
|
minNumber4 =Math.min(...data4)
|
||||||
minNumber4 = Math.floor(minNumber4)
|
minNumber4 = Math.floor(minNumber4)
|
||||||
|
if(minNumber4>0){
|
||||||
|
minNumber4 = minNumber4-1;
|
||||||
|
}
|
||||||
markLine4 = sortedArr4[0].客户投诉处理满意率基础值;
|
markLine4 = sortedArr4[0].客户投诉处理满意率基础值;
|
||||||
|
|
||||||
function tofixed1(item){
|
function tofixed1(item){
|
||||||
|
@ -525,14 +537,14 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style scoped>
|
||||||
.printContainers{
|
|
||||||
/* width: 1075px; */
|
|
||||||
}
|
|
||||||
#numTable,#echartsContainer{
|
#numTable,#echartsContainer{
|
||||||
/* margin-left: 37px; */
|
/* margin-left: 37px; */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
#echartsContainer{
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
#numTable td{
|
#numTable td{
|
||||||
height: 32px;
|
height: 32px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
|
@ -544,7 +556,7 @@
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
#echartsContainer{
|
#echartsContainer{
|
||||||
margin-top: 30px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.chartsWraps{
|
.chartsWraps{
|
||||||
width: 99%;
|
width: 99%;
|
||||||
|
|
Loading…
Reference in New Issue