Authored by 王涛

代码优化

Showing 32 changed files with 232 additions and 96 deletions
-- 菜单管理编辑后无法保存,数据库字段"moduleid"长度太短,导致SQL报错
ALTER TABLE sys_menu MODIFY COLUMN moduleid VARCHAR(100) COMMENT '模块id';
... ...
文档管理表结构修改
V1015_2_增加文档管理表字段.sql
新版资源列表 (依赖11个视图)
V1015_3_v32资源视图树结构表结构.sql
V1015_4_v32资源视图表结构.sql
... ...
... ... @@ -55,6 +55,12 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe752;</span>
<div class="name">搜索</div>
<div class="code-name">&amp;#xe752;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe610;</span>
<div class="name">目标库</div>
<div class="code-name">&amp;#xe610;</div>
... ... @@ -492,9 +498,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1633773106250') format('woff2'),
url('iconfont.woff?t=1633773106250') format('woff'),
url('iconfont.ttf?t=1633773106250') format('truetype');
src: url('iconfont.woff2?t=1634540750988') format('woff2'),
url('iconfont.woff?t=1634540750988') format('woff'),
url('iconfont.ttf?t=1634540750988') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
... ... @@ -521,6 +527,15 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-sousuo"></span>
<div class="name">
搜索
</div>
<div class="code-name">.icon-sousuo
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-icon--mubiaoku"></span>
<div class="name">
目标库
... ... @@ -1179,6 +1194,14 @@
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-sousuo"></use>
</svg>
<div class="name">搜索</div>
<div class="code-name">#icon-sousuo</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-icon--mubiaoku"></use>
</svg>
<div class="name">目标库</div>
... ...
@font-face {
font-family: "iconfont"; /* Project id 2843738 */
src: url('iconfont.woff2?t=1633773106250') format('woff2'),
url('iconfont.woff?t=1633773106250') format('woff'),
url('iconfont.ttf?t=1633773106250') format('truetype');
src: url('iconfont.woff2?t=1634540750988') format('woff2'),
url('iconfont.woff?t=1634540750988') format('woff'),
url('iconfont.ttf?t=1634540750988') format('truetype');
}
.iconfont {
... ... @@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-sousuo:before {
content: "\e752";
}
.icon-icon--mubiaoku:before {
content: "\e610";
}
... ...
... ... @@ -6,6 +6,13 @@
"description": "",
"glyphs": [
{
"icon_id": "577365",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e752",
"unicode_decimal": 59218
},
{
"icon_id": "6501157",
"name": "目标库",
"font_class": "icon--mubiaoku",
... ...
... ... @@ -34,7 +34,8 @@
<div style="width: calc(100% - 150px);padding-left: 6px;text-align: left;">
<el-input v-model="keyWord" placeholder="请输入关键字" :size="$global.elementSize"
style="width: 220px;margin-right:10px" clearable/>
<el-button icon="el-icon-search" :size="$global.elementSize" @click="searchFile">搜索</el-button>
<el-button icon="el-icon-search" :size="$global.elementSize" @click="searchFile">
<i class="iconfont icon-sousuo"></i>搜索</el-button>
<el-button :size="$global.elementSize" @click="showUserDialog(true)" v-if="!isView">
<i class="iconfont icon-icon--quanxian"></i>
授权
... ... @@ -77,7 +78,7 @@
:showPage="false" :height="height - 54"></cm-table-page>
</div>
<div v-if="activeBtn == 'view'" style="background-color: white" :style="{'height':(height -50) +'px','max-height':(height -50) + 'px','overflow':'auto'}">
<div style="text-align: left;margin: 6px;border-bottom: solid 1px #F2F6FC;padding-bottom: 5px;" v-if="!isView">
<div style="text-align: left;margin: 6px;border-bottom: solid 1px #F2F6FC;padding-bottom: 5px;">
<!--
<span v-for="(item,index) in historyNode">
<el-link type="primary" @click="clickTopNav(item,index)" style="margin-left: 5px">
... ... @@ -120,7 +121,7 @@
</el-col>
</el-row>
<cm-dialog :title="'新建“' + currentNodeData.name + '“子文件夹'" width="500px" :showDialogVisible="addDialogVisible" :showFooter="false">
<cm-dialog :title="addDialogTitle" width="500px" :showDialogVisible="addDialogVisible" :showFooter="false">
<template v-slot>
<el-form
label-width="120px"
... ...
... ... @@ -23,6 +23,10 @@ export default {
type: String,
default: ''
},
viewTypeName: {
type: String,
default: ''
},
fileIds: {
type: Array,
default: []
... ... @@ -183,18 +187,15 @@ export default {
// 左侧树
let getTree = () => {
// 加载列表
proxy.$http.get("/inspection-report/doc/type/tree", {types: props.types.join(',')}, function (res) {
proxy.$http.get("/inspection-report/file/document/tree", {}, function (res) {
if (res && res.data) {
treeData.value = res.data;
let first = res.data[0];
//currentNodeData.value = first;
let arr = [];
arr.push(first.id);
defaultExpandedKeys.value = arr;
//historyNode.value.push(first);
addHistoryNode(first);
// 加载第一个节点数据
... ... @@ -206,6 +207,9 @@ export default {
// 获取表格树
let getPage = (id) => {
let docIds = props.fileIds.length == 0 ? '' : props.fileIds.join(',')
if(docIds == ''){
return;
}
let params = {
id: id,
name: keyWord.value,
... ... @@ -294,8 +298,7 @@ export default {
proxy.$global.showMsg('放入回收站成功!');
}
reload(false);
reload(true);
}
})
... ... @@ -308,6 +311,7 @@ export default {
* @param type 文件夹或者文档
*/
let addDialogVisible = Vue.ref(false);
let addDialogTitle = Vue.ref('');
let docForm = Vue.ref({
name: '',
docNo: '',
... ... @@ -323,6 +327,11 @@ export default {
};
isUserFolder.value = isUser;
addDialogVisible.value = flg;
let title =`新建树节点“${currentNodeData.value.name}“子文件夹`;
if(isUser){
title =`新建自定义文件夹`;
}
addDialogTitle.value = title
}
/**
... ... @@ -346,10 +355,10 @@ export default {
proxy.$global.showMsg("新建成功!");
}
})
// 属性tree
reload(true);
showFolder(false,isUserFolder.value);
let isUser = !isUserFolder.value;
reload(isUser);
showFolder(false,isUser);
} else {
console.log('error submit!!')
return false
... ... @@ -462,11 +471,6 @@ export default {
let info = [];
arr.map(function (v) {
// info.push({
// id:v.id,
// type:v.type
// })
info.push(`${v.id}__${v.type}`);
})
... ... @@ -479,24 +483,6 @@ export default {
}
/**
* TODO
* @param item
* @param index
*/
let clickTopNav = (item,index) =>{
let arr = historyNode.value;
// // 删除当前节点后面的路径
// arr.filter(function (v,i) {
// if(i > index){
// arr.splice(i,1);
// }
// })
addHistoryNode(item);
getPage(item.id);
}
/**
* 点击标签关闭
* @param index
*/
... ... @@ -522,11 +508,13 @@ export default {
left: 0,
right: 24
}
currentNodeData.value = {
let item = {
docType: props.viewTypeId,
docNo: props.viewTypeId,
name: props.viewTypeName,
id: props.viewTypeId
}
addHistoryNode(item);
getPage(props.viewTypeId);
}
})
... ... @@ -560,6 +548,7 @@ export default {
addDialogVisible,
showFolder,
addDialogTitle,
showUserDialogVisible,
userFileRight,
... ... @@ -568,7 +557,7 @@ export default {
showUploadDialogVisible,
historyNode,
clickTopNav,
tagHandleClose,
isAdmin
... ...
... ... @@ -40,12 +40,12 @@ export default {
// 分页页码设置
pageSizes: {
type: Array,
default: [50,100, 200, 300, 400]
default: [10,50,100, 200, 300, 400]
},
// 默认展示
pageSize: {
type: Number,
default: 50
default: 10
},
// 总数
total: {
... ... @@ -55,7 +55,7 @@ export default {
// 展示组件
layout: {
type: String,
default: "total, sizes, prev, pager, next, jumper"
default: "total, prev,pager,next, sizes, jumper"
},
// 列
columns: {
... ... @@ -90,7 +90,6 @@ export default {
let callback = () =>{
emit('loaddata',props)
console.log("sssssssssssssssssssssss")
}
// 每页展示多少条
... ... @@ -130,6 +129,7 @@ export default {
// 挂载完
Vue.onMounted(() => {
//callback();
})
return {
... ...
... ... @@ -148,8 +148,8 @@ global.getBase64 = (file) =>{
// 组件默认大小
global.elementSize = 'small';
// 组件默认大小 medium / small / mini
global.elementSize = '';
global.height = window.innerHeight - 20;
export default global
... ...
文档管理表结构修改
V1015_3_alter.sql
新版资源列表 (依赖11个视图)
V1015_4_b_res_list_tree_v32.sql
V1015__4_b_res_list_config_v32.sql
<cm-document v-if="initFlg" :isView="true" :viewTypeId="docType" :types="[docType]" :fileIds="docIds" @callback="saveOpsLog"></cm-document>
<cm-document v-if="initFlg" :isView="true"
:viewTypeId="docType"
:viewTypeName="docTypeName"
:types="[docType]"
:fileIds="docIds"
@callback="saveOpsLog"></cm-document>
... ...
... ... @@ -26,6 +26,11 @@ export default {
type: String,
default: ''
},
// 文件类型
docTypeName: {
type: String,
default: ''
},
},
setup(props, {attrs, slots, emit}) {
... ...
... ... @@ -4,6 +4,6 @@
<el-divider content-position="left">项目评价汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="(height - 54)/3"></cm-table-page>
:showPage="true" :height="height"></cm-table-page>
</div>
</div>
... ...
... ... @@ -5,9 +5,25 @@ export default {
data() {
return {}
},
setup() {
let height = Vue.ref(window.innerHeight - 130);
props:{
treeNode: {
type: Object,
default: {}
},
parentNode: {
type: Object,
default: {}
},
projectId: {
type: String,
default: ''
},
height: {
type: Number,
default: 0
},
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
... ... @@ -97,12 +113,21 @@ export default {
let total = Vue.ref(0);
// 获取表格数据
let getPage = () => {
proxy.$http.post("/api-web/bOpsScore/scoreCollect", {
let getPage = (obj) => {
if(!props.treeNode.map || !props.treeNode.map.nodeType){
return;
}
let params = {
"page":1,
"limit":10,
"projectId":"1"
}, function (res) {
"projectId": props.treeNode.map.nodeType.projectId
}
if(obj){
params.page = obj.currentPage;
params.limit = obj.pageSize;
}
proxy.$http.post("/api-web/bOpsScore/scoreCollect", params, function (res) {
if (res && res.data) {
dataList.value = res.data;
total.value = res.count;
... ... @@ -113,11 +138,19 @@ export default {
// 挂载完
Vue.onMounted(() => {
getPage();
if(props.height && props.height == 0){
props.height = window.innerHeight - 130
}
})
// 监听编辑状态
Vue.watch(() => props.treeNode, (newValue, oldVlaue) => {
getPage();
});
return {
columns,
height,
dataList,
currentPage,
total,
... ...
<div>
<!-- 人员信息总汇-->
<project-ry :docType="docType"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"/>
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" :height="(height-50)/3"/>
</div>
<div>
<!-- 项目评价总汇-->
<project-pj :docType="docType"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"/>
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" :height="(height-50)/3"/>
</div>
<div>
<!-- 项目资料总汇-->
<project-zl :docType="docType"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"/>
</div>
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" :height="(height-50)/3"/>
</div>
... ...
... ... @@ -34,7 +34,7 @@ export default {
default: ''
}
},
setup() {
setup(props, {attrs, slots, emit}) {
let height = Vue.ref(window.innerHeight - 130);
const {proxy} = Vue.getCurrentInstance();
... ... @@ -46,7 +46,7 @@ export default {
return {
height
}
}
}
... ...
... ... @@ -4,6 +4,6 @@
<el-divider content-position="left">人员信息汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="(height - 54)/3"></cm-table-page>
:showPage="true" :height="height"></cm-table-page>
</div>
</div>
... ...
... ... @@ -19,10 +19,14 @@ export default {
projectId: {
type: String,
default: ''
}
},
height: {
type: Number,
default: 0
},
},
setup(props, {attrs, slots, emit}) {
let height = Vue.ref(window.innerHeight - 130);
const {proxy} = Vue.getCurrentInstance();
... ... @@ -30,7 +34,25 @@ export default {
prop: 'nickname',
label: '运维人员姓名',
sortable: true,
align: 'left',
}, {
prop: 'phone',
label: '联系电话',
sortable: true,
render: function (row) {
let arr = [];
if(row.phone){
arr.push(row.phone);
}
if(row.tel){
arr.push(row.tel);
}
return arr.join(' / ')
}
},{
prop: 'email',
label: '电子邮箱',
sortable: true,
}, {
prop: 'state',
label: '在职状态',
... ... @@ -88,12 +110,21 @@ export default {
let total = Vue.ref(0);
// 获取表格数据
let getPage = () => {
proxy.$http.post("/api-web/bOpsPerson/personCollect", {
let getPage = (obj) => {
if(!props.treeNode.map || !props.treeNode.map.nodeType){
return;
}
let params = {
"page":1,
"limit":10,
"projectId": props.treeNode.map.nodeType.projectId
}, function (res) {
}
if(obj){
params.page = obj.currentPage;
params.limit = obj.pageSize;
}
proxy.$http.post("/api-web/bOpsPerson/personCollect", params, function (res) {
if (res && res.data) {
dataList.value = res.data
total.value = res.count;
... ... @@ -106,7 +137,11 @@ export default {
// 挂载完
Vue.onMounted(() => {
getPage();
//getPage();
if(props.height && props.height == 0){
props.height = window.innerHeight - 130
}
})
// 监听编辑状态
... ... @@ -117,7 +152,6 @@ export default {
return {
columns,
height,
dataList,
currentPage,
total,
... ...
... ... @@ -4,6 +4,6 @@
<el-divider content-position="left">项目资料汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="false" :height="(height - 54)/3"></cm-table-page>
:showPage="false" :height="height"></cm-table-page>
</div>
</div>
... ...
... ... @@ -5,9 +5,25 @@ export default {
data() {
return {}
},
setup() {
let height = Vue.ref(window.innerHeight - 130);
props:{
treeNode: {
type: Object,
default: {}
},
parentNode: {
type: Object,
default: {}
},
projectId: {
type: String,
default: ''
},
height: {
type: Number,
default: 0
},
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
... ... @@ -54,7 +70,12 @@ export default {
// 获取表格数据
let getPage = () => {
proxy.$http.get("/api-web/bOpsFile/fileCollect?projectId=1", {}, function (res) {
let projectId = props.treeNode.map.nodeType.projectId
if(!projectId){
return;
}
proxy.$http.get(`/api-web/bOpsFile/fileCollect?projectId=${projectId}`, {}, function (res) {
if (res && res.data) {
dataList.value = res.data
total.value = res.count;
... ... @@ -64,13 +85,19 @@ export default {
// 挂载完
Vue.onMounted(() => {
getPage();
if(props.height && props.height == 0){
props.height = window.innerHeight - 130
}
})
// 监听编辑状态
Vue.watch(() => props.treeNode, (newValue, oldVlaue) => {
getPage();
});
return {
columns,
height,
dataList,
currentPage,
total,
... ...
<div class="container" :style="{'height':height+'px','max-height':height+'px','overflow':'auto'}">
<!-- 乙方运营-->
<el-row :gutter="5">
<el-col :span="4">
<div :style="{'min-height':height+'px','height':'100%','overflow':'auto'}" style="background-color: white;border-radius: 3px">
<div class="container" :style="{'height':height+'px','max-height':height+'px'}">
<el-row :gutter="5" >
<el-col :span="4" >
<div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','overflow-y':'auto','overflow-x':'hidden'}">
<el-tree :data="dataSource" :default-expanded-keys="[1]" :props="defaultProps" >
<template #default="{ node, data }">
<div style=" width: 100%;">
... ... @@ -15,11 +14,14 @@
</div>
</el-col>
<el-col :span="20" >
<div :style="{'min-height':height+'px','height':'100%','overflow':'auto'}" style="background-color: white;border-radius: 3px">
<div class="cm-card" :style="{'min-height':height+'px','height':'100%','padding-left':'5px'}" >
<component v-bind:is="componentName"
:docType="docType"
:docTypeName="docTypeName"
:height="height - 100"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"></component>
</div>
</el-col>
</el-row>
</div>
... ...
... ... @@ -49,6 +49,7 @@ export default {
let parentNode = Vue.ref({});
let projectId = Vue.ref('');
let docType = Vue.ref('');
let docTypeName = Vue.ref('');
// 搜索
... ... @@ -84,9 +85,11 @@ export default {
}
let handleNodeClick = (data) => {
let comName = data.map.nodeType.view.code;
if (comName == 'DOCUMENT') {
docType.value = data.map.nodeType.code;
docTypeName.value = data.label;
}
getParent(dataSource.value, data.parentId);
projectId.value = data.map.nodeType.projectId;
... ... @@ -105,7 +108,8 @@ export default {
dataSource,
handleNodeClick,
componentName,
docType
docType,
docTypeName
};
},
}
... ...
<div class="container" :style="{'height':height+'px','max-height':height+'px'}">
<el-row :gutter="5" >
<el-col :span="4" >
<div class="cm-card" :style="{'min-height':height+'px','height':'100%'}">
<div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%'}">
<el-tree :data="treeData" :default-expanded-keys="[1]" @node-click="handleNodeClick"/>
</div>
</el-col>
... ...