Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -928,5 +928,6 @@ module.exports = {
|
|||||||
and: 'and',
|
and: 'and',
|
||||||
judge: 'Judge',
|
judge: 'Judge',
|
||||||
pleaseWaitWhileRunning: 'Please wait while running',
|
pleaseWaitWhileRunning: 'Please wait while running',
|
||||||
roleSwitching: 'Role switching'
|
roleSwitching: 'Role switching',
|
||||||
|
setCreator:'Set Creator',
|
||||||
}
|
}
|
||||||
@@ -934,4 +934,5 @@ module.exports = {
|
|||||||
and: '并且',
|
and: '并且',
|
||||||
pleaseWaitWhileRunning: '运行中请稍等',
|
pleaseWaitWhileRunning: '运行中请稍等',
|
||||||
roleSwitching:'角色切换',
|
roleSwitching:'角色切换',
|
||||||
|
setCreator:'设置创建人',
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<a-drawer
|
||||||
|
:title="$t('setCreator')"
|
||||||
|
:maskClosable="false"
|
||||||
|
:width="600"
|
||||||
|
placement="right"
|
||||||
|
:closable="true"
|
||||||
|
@close="handleCancel"
|
||||||
|
:visible="visible"
|
||||||
|
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-input-search style="margin-bottom: 8px" v-model="searchModel"
|
||||||
|
@search="onSearch"
|
||||||
|
allowClear
|
||||||
|
:placeholder="$t('NodeQuickLookup')"/>
|
||||||
|
<div class="drawer-content">
|
||||||
|
<a-tree
|
||||||
|
v-if="visibleTree"
|
||||||
|
style="margin-bottom: 60px;height: 600px"
|
||||||
|
checkable
|
||||||
|
:autoExpandParent="false"
|
||||||
|
:tree-data="gData"
|
||||||
|
@select="onSelect"
|
||||||
|
@check="checkChange"
|
||||||
|
@expand="onExpand"
|
||||||
|
:defaultExpandedKeys="defaultExpandedKeys"
|
||||||
|
>
|
||||||
|
</a-tree>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
<div class="drawer-bootom-button">
|
||||||
|
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
|
||||||
|
<a-button @click="handleSubmit" type="primary" :loading="submitLoading">{{$t('submit')}}</a-button>
|
||||||
|
</div>
|
||||||
|
</a-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAction, postAction } from '@/api/manage'
|
||||||
|
import eventBUs from '../../common/event'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'index',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
gData: [],
|
||||||
|
searchModel: '',
|
||||||
|
autoExpandParent: true,
|
||||||
|
expandedKeys: [],
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
selectedKey: [],
|
||||||
|
tableKey: '',
|
||||||
|
userIds: [],
|
||||||
|
departId: '',
|
||||||
|
defaultExpandedKeys: [],
|
||||||
|
submitLoading: false,
|
||||||
|
visibleTree: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPush(data) {
|
||||||
|
this.tableKey = data
|
||||||
|
this.searchModel = ''
|
||||||
|
this.visible = true
|
||||||
|
this.visibleTree = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.departId = ''
|
||||||
|
this.queryDepartUserTreeList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSelect(selectedKeys) {
|
||||||
|
this.selectedKey = selectedKeys
|
||||||
|
},
|
||||||
|
onExpand(selectedKeys, val) {
|
||||||
|
if (this.searchModel == '' || !this.searchModel) {
|
||||||
|
if (val.expanded) {
|
||||||
|
if (this.departId == val.node.value) {
|
||||||
|
} else {
|
||||||
|
this.departId = val.node.value
|
||||||
|
this.queryDepartUserTreeList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false
|
||||||
|
this.visibleTree = false
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
let query = {
|
||||||
|
id: this.tableKey,
|
||||||
|
createBy: this.userIds.join(','),
|
||||||
|
}
|
||||||
|
this.submitLoading = true
|
||||||
|
this.confirmLoading = true
|
||||||
|
postAction('/dummy/dummyInventoryBaseEO/edit', query).then((res) => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
this.submitLoading = false
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
|
this.userIds = []
|
||||||
|
this.visible = false
|
||||||
|
this.visibleTree = false
|
||||||
|
this.$emit('clearSelected')
|
||||||
|
} else {
|
||||||
|
this.$message.warning(this.$t('operationFailed'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSearch(e) {
|
||||||
|
this.gData = []
|
||||||
|
this.departId = ''
|
||||||
|
this.visibleTree = false
|
||||||
|
if (e) {
|
||||||
|
this.getUserAndDepart()
|
||||||
|
} else {
|
||||||
|
this.queryDepartUserTreeList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getUserAndDepart() {
|
||||||
|
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
|
||||||
|
this.gData = res || []
|
||||||
|
this.visibleTree = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
queryDepartUserTreeList() {
|
||||||
|
let gData = JSON.parse(JSON.stringify(this.gData))
|
||||||
|
if (gData && gData.length > 0) {
|
||||||
|
gData = JSON.stringify(gData)
|
||||||
|
} else {
|
||||||
|
gData = ''
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
postAction('sys/user/queryDepartUserTreeList', {
|
||||||
|
departId: this.departId,
|
||||||
|
flag: '1',
|
||||||
|
json: gData
|
||||||
|
}).then((res) => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
if (res.success) {
|
||||||
|
this.gData = res.result
|
||||||
|
this.defaultExpandedKeys = [this.departId]
|
||||||
|
this.visibleTree = true
|
||||||
|
} else {
|
||||||
|
this.gData = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkChange(e) {
|
||||||
|
this.userIds = e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.box-title-text {
|
||||||
|
line-height: 1.4;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input {
|
||||||
|
display: inline-block;
|
||||||
|
height: 38px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-box {
|
||||||
|
margin-left: 10px;
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-bootom-button {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
z-index:100;
|
||||||
|
width: 100%;
|
||||||
|
border-top: 1px solid #e8e8e8;
|
||||||
|
padding: 10px 16px;
|
||||||
|
text-align: right;
|
||||||
|
left: 0;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0 0 2px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-content {
|
||||||
|
height: calc(100% - 60px);
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -33,6 +33,10 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
|
<div @click="setCreatorClick" class="operator-text" v-has="'dummyInventoryBase:add'">
|
||||||
|
<a-icon type="plus"/>
|
||||||
|
{{$t('setCreator')}}
|
||||||
|
</div>
|
||||||
<div @click="handleAdd" class="operator-text" v-has="'dummyInventoryBase:add'">
|
<div @click="handleAdd" class="operator-text" v-has="'dummyInventoryBase:add'">
|
||||||
<a-icon type="plus"/>
|
<a-icon type="plus"/>
|
||||||
{{$t('newlyAdded')}}
|
{{$t('newlyAdded')}}
|
||||||
@@ -138,6 +142,7 @@
|
|||||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
<setCreator ref="setCreatorRef" @clearSelected="clearSelected"/>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -147,11 +152,13 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueDraggableResizable from 'vue-draggable-resizable'
|
import VueDraggableResizable from 'vue-draggable-resizable'
|
||||||
import tableDragResize from '@/mixins/tableDragResize'
|
import tableDragResize from '@/mixins/tableDragResize'
|
||||||
|
import setCreator from '@/components/setCreator/index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'index',
|
name: 'index',
|
||||||
components: {
|
components: {
|
||||||
VueDraggableResizable
|
VueDraggableResizable,
|
||||||
|
setCreator
|
||||||
},
|
},
|
||||||
mixins: [tableDragResize],
|
mixins: [tableDragResize],
|
||||||
data() {
|
data() {
|
||||||
@@ -241,6 +248,18 @@
|
|||||||
onSelectChange(value) {
|
onSelectChange(value) {
|
||||||
this.selectedRowKeys = value
|
this.selectedRowKeys = value
|
||||||
},
|
},
|
||||||
|
clearSelected() {
|
||||||
|
this.selectedRowKeys = []
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
setCreatorClick() {
|
||||||
|
if (this.selectedRowKeys.length > 0) {
|
||||||
|
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||||
|
this.$refs.setCreatorRef.getPush(selectedRowKeys.join(','))
|
||||||
|
} else {
|
||||||
|
this.$message.warning(this.$t('PleaseSelectData'))
|
||||||
|
}
|
||||||
|
},
|
||||||
//添加
|
//添加
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.title = this.$t('newlyAdded')
|
this.title = this.$t('newlyAdded')
|
||||||
|
|||||||
Reference in New Issue
Block a user