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