[update] 修改内部工作组,企标级别映射,友情链接管理bug

This commit is contained in:
lideqin
2023-09-18 15:53:17 +08:00
parent e9c563383f
commit bae308459b
8 changed files with 170 additions and 142 deletions
+2 -1
View File
@@ -74,6 +74,7 @@ module.exports = {
linkName: 'Link Name',
link: 'Link',
isShelf: 'Shelf Or Not',
sort: 'Sort'
sort: 'Sort',
shelfWarn: 'the link is empty please fill in the link first'
}
}
+2 -1
View File
@@ -77,6 +77,7 @@ module.exports = {
linkName: '链接名称',
link: '链接',
isShelf: '是否上架',
sort: '排序'
sort: '排序',
shelfWarn: '链接为空,请先填写链接'
}
}
+50 -17
View File
@@ -10,8 +10,8 @@
<div class="modal-search-wrapper table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :sm="6">
<a-form-item :label="$t('organization')">
<a-col :span="6">
<a-form-item :label="$t('organization')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.departId"
@@ -24,8 +24,8 @@
/>
</a-form-item>
</a-col>
<a-col :sm="6">
<a-form-item :label="$t('role')">
<a-col :span="6">
<a-form-item :label="$t('role')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag
:placeholder="$t('pleaseSelect') + $t('role')"
v-model="queryParam.roleId"
@@ -33,20 +33,20 @@
</j-search-select-tag>
</a-form-item>
</a-col>
<a-col :sm="6">
<a-form-item :label="$t('user.account')">
<a-col :span="6">
<a-form-item :label="$t('user.account')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')"
v-model="queryParam.account"></a-input>
</a-form-item>
</a-col>
<a-col :sm="6">
<a-form-item :label="$t('userSelect.name')">
<a-col :span="6">
<a-form-item :label="$t('userSelect.name')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')"
v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :sm="6">
<a-form-item :label="$t('user.workNo')">
<a-col :span="6">
<a-form-item :label="$t('user.workNo')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')"
v-model="queryParam.workNo"></a-input>
</a-form-item>
@@ -79,9 +79,9 @@
</div>
<p class="modal-content-title">{{ $t('userSelect.selectedPersonnel') }}</p>
<div v-if="dataSourceRight && dataSourceRight.length > 0" class="name-content">
<div v-for="item in dataSourceRight" :key="item.id" class="name-div">
<div v-for="(item, index) in dataSourceRight" :key="item.id" class="name-div">
{{ item.realname + '(' + item.workNo + ')' }}
<a-icon type="close" @click="handleDelete(item)" />
<a-icon type="close" @click="handleDelete(item, index)" />
</div>
</div>
<a-empty v-else/>
@@ -126,6 +126,12 @@ export default {
categoryTreeList: [], // 组织机构树
rolesList: [], // 角色下拉框
queryParam: {},
labelCol: {
span: 1
},
wrapperCol: {
span: 22
},
columns: [
{
title: this.$t('user.account'),
@@ -190,6 +196,7 @@ export default {
if (value) {
this.selectedRowKeys = value.split(',')
this.getUserListByIds(value)
this.loadData()
}
},
// 获取组织机构树
@@ -258,20 +265,27 @@ export default {
}
} else {
// 说明是删除了数据
for (const rowIndex in this.dataSourceRight) {
if (!selectedRows.find(item => item === this.dataSourceRight[rowIndex].id)) {
// 右侧数据在左侧选中不存在则从右侧删掉
this.dataSourceRight.splice(rowIndex, 1)
if (selectedRowKeys && selectedRowKeys.length > 0) {
// 没有选中数据,说明这一页没有选中数据了
for (let i = 0; i < this.dataSourceRight.length; i++) {
if (!selectedRowKeys.find(item => item === this.dataSourceRight[i].id)) {
// 表格选中中没有找到这一条数据,说明已经被删了
this.dataSourceRight.splice(i, 1)
i--
}
}
} else {
this.dataSourceRight = []
}
}
console.log(this.dataSourceRight)
} else {
this.dataSourceRight = selectedRows
}
},
// 左侧表格改变
leftTableChange (pagination) {
this.ipaginationLeft = pagination
this.ipagination = pagination
this.loadData()
},
// 根据ids获取用户列表
@@ -306,6 +320,18 @@ export default {
this.visible = false
this.dataSourceRight = []
this.selectedRowKeys = []
this.queryParam = {}
this.ipagination = {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
}
}
}
}
@@ -337,17 +363,24 @@ export default {
}
.name-content {
display: flex;
flex-wrap: wrap;
.name-div {
width: auto;
padding: 5px 16px;
margin-right: 12px;
margin-top: 8px;
background: rgba(213, 44, 38, 0.08);
border-radius: 4px 4px 4px 4px;
opacity: 1;
color: #D52C26;
white-space: nowrap;
/deep/ .anticon {
margin-left: 4px;
}
}
}
/deep/ .ant-form-item-label{
min-width: 70px !important;
}
</style>
+8 -2
View File
@@ -5,11 +5,12 @@
:type="inputType"
:autosize="true"
:rows="1"
readonly="readonly"
disabled
class="user-input"
:placeholder="placeholder"
:value="checkedValue"
@click="selectClick"
:title="checkedValue"
>
</a-input>
<a-button type="primary" class="button-box" @click="selectClick">
@@ -101,7 +102,12 @@ export default {
.user-input {
resize: none;
width: calc(100% - 70px);
pointer-events: none;
}
// 因为需要加title,所以不能把鼠标事件去掉
/deep/ .ant-input-disabled {
background: #fff;
color: rgba(0, 0, 0, 0.65);
cursor: default;
}
.button-box {
@@ -13,6 +13,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.enterpriseLevelMap.levelCategory')">
<a-select :placeholder="$t('pleaseEnter') + $t('system.enterpriseLevelMap.levelCategory')"
allowClear
:disabled="true"
v-decorator.trim="[ 'level', validatorRules.level]">
<a-select-option :value="null" :key="-1">请选择</a-select-option>
<a-select-option v-for="item in levelCategoryList" :value="item" :key="item">{{ item }}</a-select-option>
@@ -31,6 +32,7 @@
v-decorator.trim="[ 'notes', validatorRules.notes]"
:placeholder="$t('pleaseEnter')+$t('system.enterpriseLevelMap.remark')"
:maxLength="500"
:disabled="true"
:rows="4" />
</a-form-item>
</a-form>
@@ -71,6 +71,7 @@
</template>
<script>
import '@assets/less/common.less'
import JTable from '@/components/jero/JTable'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import { JeroListMixin } from '@/mixins/JeroListMixin'
@@ -112,7 +113,6 @@ export default {
title: this.$t('system.friendshipLink.isShelf'),
align: 'center',
width: 180,
dataIndex: 'link',
scopedSlots: { customRender: 'isShelf' }
},
{
@@ -145,7 +145,7 @@ export default {
this.dataSource = res.result ? res.result.map(item => {
return {
...item,
grounding: item.grounding === '0' ? false : true
grounding: item.grounding !== '0'
}
}) : []
} else {
@@ -161,6 +161,10 @@ export default {
},
// 是否上架状态改变
switchChange (record) {
if (!record.link) {
this.$message.warning(this.$t('system.friendshipLink.shelfWarn'))
return
}
record.grounding = record.grounding === true ? '1' : '0'
postAction(this.url.edit, record).then(res => {
if (res.success) {
@@ -24,6 +24,21 @@
:placeholder="$t('pleaseEnter')+$t('system.friendshipLink.link')"
></a-input>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.friendshipLink.sort')">
<a-input
v-decorator.trim="[ 'sort', validatorRules.sort]"
:maxLength="50"
@change="e => e.target.value = (e.target.value.replace(/[^0-9]/g, '')).trim()"
:placeholder="$t('pleaseEnter')+$t('system.friendshipLink.sort')"
></a-input>
</a-form-item>
<a-form-item :required="true" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.friendshipLink.isShelf')">
<a-switch
v-decorator="[ 'grounding', { valuePropName: 'checked', rules: validatorRules.grounding }]"
:placeholder="$t('pleaseSelect')+$t('system.friendshipLink.isShelf')"
>
</a-switch>
</a-form-item>
</a-form>
</a-spin>
@@ -59,9 +74,21 @@ export default {
},
link: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('system.friendshipLink.link') }
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.friendshipLink.link') }
],
validateTrigger: 'blur'
},
sort: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.friendshipLink.sort') }
],
validateTrigger: 'blur'
},
grounding: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.friendshipLink.grounding') }
],
validateTrigger: 'change'
}
},
url: {
@@ -75,7 +102,7 @@ export default {
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'name', 'link'))
this.form.setFieldsValue(pick(this.model, 'name', 'link', 'sort', 'grounding'))
})
},
handleCancel () {
@@ -88,6 +115,7 @@ export default {
this.confirmLoading = true
const param = Object.assign({}, values)
param.id = this.model.id
param.grounding = this.model.grounding ? '1' : '0'
const url = this.url.edit
postAction(url, param).then(res => {
if (res.success) {
@@ -1,93 +1,69 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<div class="page-left-box">
<a-input-search v-model="treeInput" :placeholder="$t('system.internalWorkGroup.treeSearchPlaceholder')"
<a-input-search v-model="treeInput"
class="tree-search"
:placeholder="$t('system.internalWorkGroup.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<a-tree
:show-line="true"
:show-icon="true"
:tree-data="treeData"
:selectedKeys="currentTreeNode"
:replaceFields="{children: 'subset', title: 'name', key: 'id'}"
:default-expand-all="defaultExpandAll"
@select="treeSelect">
<!-- <template #iconCustom="{title}">-->
<!-- <div class="tree-node">-->
<!-- <img src="@/assets/image/common/iconTreeFolder.png" class="tree-node-icon" alt="" />-->
<!-- <a-tooltip>-->
<!-- <template #title>-->
<!-- {{ title }}-->
<!-- </template>-->
<!-- <span class="tree-node-title">{{ title }}</span>-->
<!-- </a-tooltip>-->
<!-- </div>-->
<!-- </template>-->
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree
:show-line="true"
:show-icon="true"
:tree-data="treeData"
:selectedKeys="currentTreeNode"
:replaceFields="{children: 'subset', title: 'name', key: 'id'}"
:default-expand-all="defaultExpandAll"
@select="treeSelect">
<!-- 没有删除 -->
<template #customNoDelete="{name, id}">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(id)" @mouseleave="handleTreeMouseout(id)">
<!--<a-tooltip>-->
<!-- <template #title>-->
<!-- {{ name }}-->
<!-- </template>-->
<!-- <span v-if="name.indexOf(treeInput) > -1" class="tree-node-custom-title">-->
<!-- {{ name.substr(0, name.indexOf(treeInput)) }}-->
<!-- <span style="color: #f50">{{ treeInput }}</span>-->
<!-- {{ name.substr(name.indexOf(treeInput) + treeInput.length) }}-->
<!-- </span>-->
<!-- <span v-else class="tree-node-custom-title">{{ name }}</span>-->
<!--</a-tooltip>-->
<a-tooltip>
<template #title>
{{ name }}
</template>
<span class="tree-node-custom-title">{{ name }}</span>
</a-tooltip>
<template v-if="id === mouseInNodeKey">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click="handleTreeAdd" v-has="'sys:innerWorkingGroup:tree:add'"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click="handleTreeEdit" v-has="'sys:innerWorkingGroup:tree:edit'">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
</template>
</div>
</template>
<a-icon type="folder" slot="folder" class="tree-icon" />
<a-icon type="file" slot="file" class="tree-icon" />
<template #custom="{name, id}">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(id)" @mouseleave="handleTreeMouseout(id)">
<!--<a-tooltip>-->
<!-- <template #title>-->
<!-- {{ name }}-->
<!-- </template>-->
<!-- <span v-if="name.indexOf(treeInput) > -1" class="tree-node-custom-title">-->
<!-- {{ name.substr(0, name.indexOf(treeInput)) }}-->
<!-- <span style="color: #f50">{{ treeInput }}</span>-->
<!-- {{ name.substr(name.indexOf(treeInput) + treeInput.length) }}-->
<!-- </span>-->
<!-- <span v-else class="tree-node-custom-title">{{ name }}</span>-->
<!--</a-tooltip>-->
<a-tooltip>
<template #title>
{{ name }}
</template>
<span class="tree-node-custom-title">{{ name }}</span>
</a-tooltip>
<template v-if="id === mouseInNodeKey">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click="handleTreeAdd" v-has="'sys:innerWorkingGroup:tree:add'"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click="handleTreeEdit(name)" v-has="'sys:innerWorkingGroup:tree:edit'">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
<!-- 删除-->
<a-button class="tree-operate-node-btn" @click="handleTreeDelete" v-has="'sys:innerWorkingGroup:tree:delete'">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
</a-button>
<!-- 没有删除 -->
<template #customNoDelete="{name, id}">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(id)" @mouseleave="handleTreeMouseout(id)">
<a-tooltip>
<template #title>
{{ name }}
</template>
<span class="tree-node-custom-title">{{ name }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': id !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click="handleTreeAdd" v-has="'sys:innerWorkingGroup:tree:add'"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click="handleTreeEdit(name)" v-has="'sys:innerWorkingGroup:tree:edit'">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
</div>
</div>
</template>
</div>
</template>
</a-tree>
<template #custom="{name, id}">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(id)" @mouseleave="handleTreeMouseout(id)">
<a-tooltip>
<template #title>
{{ name }}
</template>
<span class="tree-node-custom-title">{{ name }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': id !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click="handleTreeAdd" v-has="'sys:innerWorkingGroup:tree:add'"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click="handleTreeEdit(name)" v-has="'sys:innerWorkingGroup:tree:edit'">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
<!-- 删除-->
<a-button class="tree-operate-node-btn" @click="handleTreeDelete" v-has="'sys:innerWorkingGroup:tree:delete'">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
</a-button>
</div>
</div>
</template>
</a-tree>
</a-spin>
</div>
</div>
<div class="page-right-box">
<div class="table-page-search-wrapper">
@@ -191,6 +167,7 @@ export default {
return {
treeInput: null, // 树查询绑定值
treeData: [],
treeLoading: false,
defaultExpandAll: false, // 左侧树默认展开所有
currentTreeNode: null, // 当前选中的树节点
mouseInNodeKey: null, // 鼠标悬浮的节点key值
@@ -254,11 +231,10 @@ export default {
methods: {
// 获取左侧树数据
initTreeData (params) {
this.treeLoading = true
getWorkGroupTreeList(params).then(res => {
if (res.success) {
this.treeData = this.dealTreeData(res.result)
// this.treeData = res.result
this.treeData[0].scopedSlots = { title: 'customNoDelete' }
} else {
this.treeData = []
}
@@ -266,14 +242,19 @@ export default {
this.$nextTick(() => {
this.defaultExpandAll = true
})
this.treeLoading = false
})
},
// 处理左侧树数据结构
dealTreeData (treeData) {
return treeData.map(item => {
item.scopedSlots = { title: 'custom' }
if (item.subset && item.subset.length > 0) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
item.subset = this.dealTreeData(item.subset)
} else if (item.level === 1) {
item.scopedSlots = { icon: 'folder', title: 'customNoDelete' }
} else {
item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
@@ -365,38 +346,10 @@ export default {
<style scoped lang="less">
.tree-icon {
line-height: 24px;
color: #1D2129;
}
.tree-operate-node {
display: flex;
width: 100%;
align-items: center;
&-btn {
width: 20px;
height: 20px;
background: rgba(213, 44, 38, 0.08);
border-radius: 2px 2px 2px 2px;
border: none;
display: flex;
align-items: center;
justify-content: center;
margin-left: 4px;
padding: 0;
/deep/ .anticon {
margin-top: 2px;
color: #D52C26;
}
img {
width: 13px;
height: 13px;
}
}
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
display: none;
}
///deep/ .ant-tooltip-open {
// background: transparent;
//}
</style>