|
@@ -15,18 +15,18 @@
|
|
|
<a-button class="totBtn" style="margin-right: 20px;" type="primary" @click="handleSaveClick" :loading="saveLoading">保存</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <a-form-model-item label="*地图类型:" prop="type">
|
|
|
+ <a-form-model-item style="margin-left: 12px;" label="*地图类型:" prop="type">
|
|
|
<a-select v-model="mapForm.type" placeholder="请选择" prop="type" :disabled="!!pkId" :showArrow="false">
|
|
|
<a-select-option v-for="(item,index) in mapTypeList" :key="index" :value="item.value">
|
|
|
{{item.name}}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="*地图名称:" prop="name">
|
|
|
+ <a-form-model-item style="margin-left: 12px;" label="*地图名称:" prop="name">
|
|
|
<a-input v-model="mapForm.name" placeholder="请输入" :maxLength="10" />
|
|
|
</a-form-model-item>
|
|
|
<span class="titleBox">权限信息</span>
|
|
|
- <a-form-model-item label="*所属组织:" prop="groupId">
|
|
|
+ <a-form-model-item style="margin-left: 12px;" label="*所属组织:" prop="groupId">
|
|
|
<a-tree-select
|
|
|
v-model="mapForm.groupId"
|
|
|
|
|
@@ -43,7 +43,7 @@
|
|
|
>
|
|
|
</a-tree-select>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="*阅读权限:" prop="groupPurview">
|
|
|
+ <a-form-model-item style="margin-left: 12px;" label="*阅读权限:" prop="groupPurview">
|
|
|
<a-select v-model="mapForm.groupPurview" placeholder="请选择" :disabled="!mapForm.groupId.length" :showArrow="false">
|
|
|
<a-select-option v-for="(item,index) in authList" :key="index" :value="item.value" >
|
|
|
{{item.label}}
|
|
@@ -51,15 +51,16 @@
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
<template v-if="mapForm.groupPurview == 2">
|
|
|
- <a-form-model-item label="可阅读者">
|
|
|
+ <a-form-model-item style="margin-left: 12px;" label="可阅读者">
|
|
|
<a-button class="totBtn" style="margin-top: 6px;float: left;" type="primary" @click="handleAddUserShow">添加员工</a-button>
|
|
|
</a-form-model-item>
|
|
|
<rx-grid
|
|
|
- class="table-style"
|
|
|
- :columns="userColumns"
|
|
|
- :dataSource="userList"
|
|
|
- :defaultPageSize="5"
|
|
|
- :heightauto="true"
|
|
|
+ class="table-style"
|
|
|
+ :columns="userColumns"
|
|
|
+ :dataSource="userList"
|
|
|
+ :defaultPageSize="5"
|
|
|
+ :heightauto="true"
|
|
|
+
|
|
|
>
|
|
|
<template slot="groupSummary" slot-scope="{text}">
|
|
|
<div style="white-space: pre-line">{{ text }}</div>
|
|
@@ -87,8 +88,8 @@
|
|
|
<a-icon type="form" :style="{ color: '#000' }" @click.stop="handleEditTabClick(item,index)"/>
|
|
|
<a-icon type="close" :style="{ color: '#000' }" @click.stop="handleDelTabClick(index)"/>
|
|
|
</span>
|
|
|
- <a-button type="dashed" style="width: 100%;" @click.stop="addLearnInfo"><a-icon type="plus" />新增学习内容</a-button>
|
|
|
- <pageList :contents="item.contents" @delItem="handleDelItemClick" @actionItem="handleActionItemClick"></pageList>
|
|
|
+ <a-button type="dashed" style="width: 100%;color: #aaa;" @click.stop="addLearnInfo"><a-icon type="plus" style="margin-right: 8px;color: #aaa;" />新增学习内容</a-button>
|
|
|
+ <pageList :contents="item.contents" @delItem="handleDelItemClick" @actionItem="handleActionItemClick" @setAddMapData="setAddMapData"></pageList>
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
</template>
|
|
@@ -132,6 +133,7 @@
|
|
|
title="添加学习内容"
|
|
|
centered
|
|
|
okText="保存"
|
|
|
+ :confirmLoading="saveLoading"
|
|
|
@ok="handleSaveLearnOk">
|
|
|
<a-form-model ref="learnRef" :model="learnForm" :rules="learnRules" style="width: 500px;" >
|
|
|
<a-form-model-item label="内容类型" prop="type">
|
|
@@ -181,6 +183,7 @@ import OsGroupApi from '@/api/user/org/osGroup'
|
|
|
import classApi from '@/api/knowledge/classify'
|
|
|
import initMixin from "../aMixin/initMixin"
|
|
|
import getTimeNow from '@/views/modules/knowledge/aJs/getTimeNow'
|
|
|
+import SessionCache from '../aJs/cache'
|
|
|
import { getParentNode } from '@/views/modules/knowledge/aJs/getClassifyTree'
|
|
|
export default {
|
|
|
name: 'knowledgeAddUpdate',
|
|
@@ -244,7 +247,8 @@ export default {
|
|
|
title: '所属组织',
|
|
|
dataIndex: 'groupSummary',
|
|
|
align:'center',
|
|
|
- scopedSlots: {customRender: 'groupSummary'}
|
|
|
+ scopedSlots: {customRender: 'groupSummary'},
|
|
|
+ width: 240
|
|
|
},
|
|
|
{
|
|
|
title: '职位',
|
|
@@ -307,7 +311,8 @@ export default {
|
|
|
infoTypeList:[
|
|
|
{value: '1', label: '外部系统'},
|
|
|
{value: '2', label: '维基知识'}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ timeStamp: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -380,6 +385,21 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if(this.$route.query.timeStamp) {
|
|
|
+ this.timeStamp = this.$route.query.timeStamp
|
|
|
+ if(SessionCache.getCache(this.timeStamp)) {
|
|
|
+ let info = SessionCache.getCache(this.timeStamp)
|
|
|
+ this.mapForm.type = info.type ? this.mapTypeList.find(item => item.value == info.type).value : undefined
|
|
|
+ this.mapForm.name = info.name
|
|
|
+ this.mapForm.groupId = info.groupId ? info.groupId.split(',') : []
|
|
|
+ this.mapForm.groupSummary = info.groupSummary
|
|
|
+ this.mapForm.groupPurview = info.groupPurview && info.groupPurview.toString()
|
|
|
+ if(this.mapForm.groupPurview == 2) {
|
|
|
+ this.userList = info.purviewUsers
|
|
|
+ }
|
|
|
+ this.tabRouteList = info.routes
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
/*OsGroupApi.getAdminOrg().then(resp => {
|
|
|
let data = resp.data;
|
|
@@ -431,14 +451,15 @@ export default {
|
|
|
item.createTime = getTimeNow()
|
|
|
})
|
|
|
this.showUserFlag = false
|
|
|
- if(this.pkId) {
|
|
|
- this.userList = [ ...this.userList, ...res ]
|
|
|
- const map = new Map()
|
|
|
- let filterList = this.userList.filter(el => !map.has(el.userId) && map.set(el.userId,true))
|
|
|
- this.userList = filterList
|
|
|
- } else {
|
|
|
- this.userList = [ ...res ]
|
|
|
- }
|
|
|
+ // if(this.pkId) {
|
|
|
+ this.userList = [ ...this.userList, ...res ]
|
|
|
+ const map = new Map()
|
|
|
+ let filterList = this.userList.filter(el => !map.has(el.userId) && map.set(el.userId,true))
|
|
|
+ this.userList = filterList
|
|
|
+ this.$refs.orgPeopleRef.$refs.mapRef.selectedRowKeys = []
|
|
|
+ // } else {
|
|
|
+ // this.userList = [ ...res ]
|
|
|
+ // }
|
|
|
},
|
|
|
// 移除指定员工
|
|
|
handleRemoveUserClick(record){
|
|
@@ -590,12 +611,14 @@ export default {
|
|
|
},
|
|
|
// 保存学习内容
|
|
|
handleSaveLearnOk() {
|
|
|
+ this.saveLoading = true
|
|
|
this.$refs.learnRef.validate(valid => {
|
|
|
if(valid) {
|
|
|
let tabs = this.tabRouteList[parseInt(this.tabsKeys)-1].contents
|
|
|
if(this.learnForm.type == 1) {
|
|
|
if(tabs.some(item => item.outerSystemName == this.learnForm.outerSystemName) || tabs.some(item => item.outerContentName == this.learnForm.outerContentName)) {
|
|
|
this.$message.error('已添加相同的学习内容')
|
|
|
+ this.saveLoading = false
|
|
|
return
|
|
|
}
|
|
|
tabs.unshift({
|
|
@@ -608,6 +631,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
this.showLearnFlag = false
|
|
|
+ this.saveLoading = false
|
|
|
}
|
|
|
}
|
|
|
)
|
|
@@ -675,6 +699,22 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 存储到浏览器缓存
|
|
|
+ setAddMapData() {
|
|
|
+ if(!this.timeStamp) return
|
|
|
+ let data = {
|
|
|
+ ...this.mapForm,
|
|
|
+ type: parseInt(this.mapForm.type),
|
|
|
+ groupId: this.mapForm.groupId.join(','),
|
|
|
+ groupSummary: this.orgList.length ?
|
|
|
+ this.orgList.filter(item => this.mapForm.groupId.indexOf(item.id) > -1).map(item => { return item.name}).join("/")
|
|
|
+ :
|
|
|
+ this.mapForm.groupSummary,
|
|
|
+ purviewUsers: this.userList,
|
|
|
+ routes: this.tabRouteList
|
|
|
+ }
|
|
|
+ SessionCache.setCache(this.timeStamp,data)
|
|
|
+ },
|
|
|
//加载左树下的子节点
|
|
|
onLoadGroupTree(treeNode) {
|
|
|
if (treeNode.dataRef.children) {
|
|
@@ -732,7 +772,7 @@ export default {
|
|
|
background: #f8f8f8;
|
|
|
form{
|
|
|
background: @white;
|
|
|
- padding: 20px 15px 8px 40px;
|
|
|
+ padding: 20px 40px 8px;
|
|
|
}
|
|
|
.ant-form-item {
|
|
|
width: 50%;
|
|
@@ -784,6 +824,15 @@ export default {
|
|
|
}
|
|
|
/deep/ .ant-tabs .ant-tabs-large-bar .ant-tabs-tab {
|
|
|
margin: 0 10px!important;
|
|
|
+ padding: 23px 0;
|
|
|
+}
|
|
|
+/deep/ .ant-tabs-ink-bar {
|
|
|
+ width: 120px!important;
|
|
|
+ bottom: 3px;
|
|
|
+ height: 1.5px;
|
|
|
+}
|
|
|
+/deep/ .ant-tabs-nav-container {
|
|
|
+ font-size: 14px!important;
|
|
|
}
|
|
|
.totBtn{
|
|
|
float: right;
|
|
@@ -800,4 +849,19 @@ export default {
|
|
|
/* /deep/ .ant-select-selection__choice {
|
|
|
padding: 0 10px;
|
|
|
} */
|
|
|
+/deep/.gridContent {
|
|
|
+ border: none!important;;
|
|
|
+}
|
|
|
+/deep/.ant-table-thead > tr > th {
|
|
|
+ text-align: center;
|
|
|
+ height: 54px;
|
|
|
+}
|
|
|
+/deep/ .ant-table-tbody > tr > td {
|
|
|
+ height: 54px;
|
|
|
+}
|
|
|
+/deep/ .ant-btn-dashed:hover, .ant-btn-dashed:focus {
|
|
|
+ color: #aaa;
|
|
|
+ background-color: #fff;
|
|
|
+ border-color: #ccc;
|
|
|
+}
|
|
|
</style>
|