Merge remote-tracking branch 'origin/fix_2nd_20230103' into fix_2nd_20230103

This commit is contained in:
wangzhijiang
2023-01-06 17:10:06 +08:00
10 changed files with 452 additions and 51 deletions
@@ -4174,42 +4174,46 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String control_type = record1.get("control_type").toString();
//references_col -> #a# #
String references_col = record1.get("references_col").toString();
String[] references_colArr = references_col.split("#");
if(StringUtils.equals(control_type,ControlTypeEnum.FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}else if(StringUtils.equals(control_type,ControlTypeEnum.TEXT_FILE.getValue())
||StringUtils.equals(control_type,ControlTypeEnum.PULL_SINGLE_FILE.getValue())
||StringUtils.equals(control_type,ControlTypeEnum.PULL_MORE_FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}else if(StringUtils.equals(control_type,ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}
if(!Objects.isNull(record1.get("references_col"))){
String references_col = record1.get("references_col").toString();
if(StringUtils.isNotEmpty(references_col)){
String[] references_colArr = references_col.split("#");
if(StringUtils.equals(control_type,ControlTypeEnum.FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}else if(StringUtils.equals(control_type,ControlTypeEnum.TEXT_FILE.getValue())
||StringUtils.equals(control_type,ControlTypeEnum.PULL_SINGLE_FILE.getValue())
||StringUtils.equals(control_type,ControlTypeEnum.PULL_MORE_FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}else if(StringUtils.equals(control_type,ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue())){
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#"+ references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}
StringBuilder references_colSb = new StringBuilder();
for (String col : references_col.split("#")) {
if(StringUtils.isNotEmpty(col) && !StringUtils.equals(col," ")){
references_colSb.append(col).append("#");
StringBuilder references_colSb = new StringBuilder();
for (String col : references_col.split("#")) {
if(StringUtils.isNotEmpty(col) && !StringUtils.equals(col," ")){
references_colSb.append(col).append("#");
}
}
if(StringUtils.isNotEmpty(references_colSb)){
references_col = references_colSb.substring(0,references_colSb.length()-1);
}else {
references_col = references_colSb.toString();
}
record1.put("references_col",references_col);
}
}
if(StringUtils.isNotEmpty(references_colSb)){
references_col = references_colSb.substring(0,references_colSb.length()-1);
}else {
references_col = references_colSb.toString();
}
record1.put("references_col",references_col);
// 处理负责领域
record1.put("duty_territory", dutyTerritoryMap.get(dutyTerritory));
+2
View File
@@ -1376,4 +1376,6 @@ module.exports = {
Updateparametercolumn:'Update The Parameter Column',
columnfirst:'Reference the parameter column first',
columnforced:'Confirm a forced retraction?',
customize:'Customize the header',
customColumn:'Custom column',
}
+2
View File
@@ -1477,4 +1477,6 @@ module.exports = {
brand:'品牌',
allsubitemsitem:'该项目下拥有子项目是否全部删除',
contactTheFounder:'联系创建人',
customize:'自定义表头',
customColumn:'自定义列',
}
@@ -213,7 +213,7 @@
},
{
title: this.$t('brand'),
align: 'center',
align: 'left',
ellipsis: true,
width: 140,
dataIndex: 'brand_text'
@@ -282,7 +282,7 @@
},
{
title: this.$t('brand'),
align: 'center',
align: 'left',
ellipsis: true,
width: 140,
dataIndex: 'brand_text'
@@ -0,0 +1,275 @@
<template>
<a-drawer
:title="$t('customize')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 800}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ',getCheckboxProps: getCheckboxProps }"
:loading="loading">
</a-table>
<!-- <div class="page" v-if="dataList.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => $t('total')+` ${total} `+$t('strip')"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :page-size.sync="pageSize"-->
<!-- :total="total"-->
<!-- :current="pageNo"-->
<!-- @change="onChange"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit(undefined)" type="primary" :loading="confirmLoading">{{$t('determine')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'transferList',
components: {},
props: ['url'],
data() {
return {
visible: false,
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
{
title: this.$t('customColumn'),
dataIndex: 'name',
align: 'left',
ellipsis: true
},
],
dataList: [
{
orderBy: '1',
name: '1',
id: '1',
status:1,
},
{
orderBy: '2',
name: '2',
id: '12',
status:2,
},
{
orderBy: '3',
name: '3',
id: '13',
},
{
orderBy: '4',
name: '4',
id: '15',
},
{
orderBy: '5',
name: '4',
id: '16',
},
{
orderBy: '6',
name: '4',
id: '17',
},
{
orderBy: '7',
name: '4',
id: '18',
},
{
orderBy: '8',
name: '4',
id: '19',
status:2,
},
],
content: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0
}
},
mounted() {
},
methods: {
transferModel() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
// this.replacePage()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
}
this.loading = true
postAction(this.url.transferUrl, query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
// if (this.selectedRowKeys.length > 1) {
// this.selectedRowKeys.shift()
// }
},
getCheckboxProps(record) {
console.log(record.status, 'status');
return ({
props: {
//当状态是1或者2的时候执行disable
disabled: record.status === 1 || record.status === 2
}
})
},
handleCancel() {
this.visible = false
},
handleSubmit(flag) {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.confirmLoading = false
this.$emit('transferListForm',selectedRowKeys.join(','))
this.selectedRowKeys = []
// postAction(this.url.addModel, {
// dummyInventoryBaseId: selectedRowKeys.join(','),
// projectLibraryId: this.$route.query.id,
// flag: flag
// }).then((res) => {
// if (res.success) {
// this.confirmLoading = false
// this.$message.success(this.$t('OperationSuccessful'))
// this.visible = false
// this.selectedRowKeys = []
// this.$emit('transferListForm')
// } else {
// if (res.message == '该虚拟清单的维护清单中没有数据,是否需要添加') {
// this.confirmLoading = false
// this.getAdd()
// return
// }
// this.$message.warning(this.$t('operationFailed'))
// this.confirmLoading = false
// }
// })
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
getAdd() {
let _this = this
this.$confirm({
content: _this.$t('TheDoesNotContainData'),
onOk() {
_this.handleSubmit('1')
}
})
}
}
}
</script>
<style scoped>
.page {
text-align: right;
margin-top: 20px;
}
.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;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
</style>
@@ -161,6 +161,10 @@
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
</div>
</a-popconfirm>
<div class="operator-text" @click="customizeClick">
<a-icon type="setting"/>
{{ $t('customize') }}
</div>
<div class="operator-text" @click="bringInRelevantPersonnelClick">
<a-icon type="user"/>
{{ $t('bringInRelevantPersonnel') }}
@@ -311,6 +315,7 @@
<listEditModel :url="url" @editModelList="addModelList" ref="editModelRef"/>
<batSetting :url="url" @batSettingList="addModelList" ref="batSettingRef"/>
<transferList :url="url" @transferListForm="transferListForm" ref="transferListRef"/>
<customizeList :url="url" @customizeListForm="customizeListForm" ref="customizeListRef"/>
<transferListvirtal :url="url" @transferListFormHomo="transferListFormHomo" ref="transferListvirtalRef"/>
<fixedPlate @fixedPlateForm="addModelList" ref="fixedPlateRef"/>
<a-modal
@@ -467,6 +472,7 @@
import listEditModel from './listEditModel'
import batSetting from './batSetting'
import transferList from './transferList'
import customizeList from './customizeList'
import transferListvirtal from './transferListvirtal'
import fixedPlate from './fixedPlateForm'
import resultReportedUpload from './resultReportedUpload'
@@ -488,6 +494,7 @@
listEditModel,
batSetting,
transferList,
customizeList,
transferListvirtal,
globalAdvancedQuery,
fixedPlate,
@@ -2261,7 +2268,9 @@
}
})
},
customizeClick(){
this.$refs.customizeListRef.transferModel()
},
bringInRelevantPersonnelClick() {
let _this = this
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -243,7 +243,7 @@
},
{
title: this.$t('brand'),
align: 'center',
align: 'left',
width: 180,
ellipsis: true,
dataIndex: 'brandText'
@@ -25,17 +25,24 @@
<a-row :gutter='24' v-if='viewshow'>
<a-col :span='24'>
<a-form-item :label="$t('NareaOfResponsibility')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-multi-select-tag class="box-input" v-model:value="dutyTerritories"
:placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<!-- <a-select mode="multiple" :placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')" v-model:value="dutyTerritories">-->
<!-- <a-select-option v-for="(role,roleindex) in dictOptions" :key="role.id" :value="role.id">-->
<!-- <span style="display: inline-block;width: 100%">-->
<!-- {{ role.roleName }}-->
<!-- </span>-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- <j-multi-select-tag class="box-input" v-model:value="dutyTerritories"-->
<!-- :placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
<a-select
class="box-input" v-model="dutyTerritories"
mode="multiple"
:placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"
showArrow
@change="onChange"
>
<!-- 这个是自定义的一个全选项,展示在所有下拉项的顶部位置 -->
<a-select-option value="0" key="0">{{$t('selectAll')}}</a-select-option>
<!-- 下面的是正常要循环渲染的下拉项 -->
<a-select-option v-for="item in dutylist" :value="item.title">
{{ item.title }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
@@ -75,6 +82,8 @@ export default {
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
dutylist: [],
jobsStr:'',
loading: false,
editId: '',
newVisible: false,
@@ -113,8 +122,50 @@ export default {
mounted() {
this.loadData()
this.initDictData()
this.getdutylist()
},
methods: {
getdutylist(){
getAction('/sys/dict/getDictItems/duty_territory', {}).then((res) => {
if (res.success) {
this.dutylist = res.result
} else {
this.dutylist = []
}
})
},
onChange(val) {
// val 拿到的是数组格式的数据,比如:['测试1','测试3']
const res = this.dutyTerritories.join(',')
this.jobsStr = res
this.dutyTerritories = this.checkAll(val, this.dutylist)
},
checkAll(arr, modelList) {
// arr是onChange中的val数组 modelList是下拉框List
let length = arr.length
let list = arr
// 遍历已经选中的选项
arr.forEach(element => {
// 当数组中存在0,说明此时进行全选/取消全选
if (element === '0') {
// 当数组长度为最大长度且最后一个元素为0时,说明此时在全选的基础上又点击全选,则取消全选
if (length - 1 === modelList.length && arr[length - 1] === '0') {
list = []
// 取消全选时,jobsStr需要重置为空,否则全选的数据还会展示在下拉输入框中
this.jobsStr = ''
} else {
// 当不是取消全选操作,只要数组中出现了0则说明进行了全选操作
list = []
for (let i in modelList) {
list.push(modelList[i].title)
// 全选时,也需要给jobsStr 赋值,拿到所有的下拉选项,并进行数据格式转换
this.jobsStr = list.join(',')
}
}
}
})
return list
},
initDictData() {
//优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) {
@@ -76,10 +76,24 @@
</a-select>
</a-form-item>
<a-form-item v-if='viewshow' :label="$t('NareaOfResponsibility')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-multi-select-tag class="box-input" v-model="dutyTerritories"
:placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<!-- <j-multi-select-tag class="box-input" v-model="dutyTerritories"-->
<!-- :placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
<a-select
class="box-input" v-model="dutyTerritories"
mode="multiple"
:placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"
showArrow
@change="onChange"
>
<!-- 这个是自定义的一个全选项,展示在所有下拉项的顶部位置 -->
<a-select-option value="0" key="0">{{$t('selectAll')}}</a-select-option>
<!-- 下面的是正常要循环渲染的下拉项 -->
<a-select-option v-for="item in dutylist" :value="item.title">
{{ item.title }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item v-if='viewshowbrand' :label="$t('brand')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <j-multi-select-tag v-model="brands"-->
@@ -240,8 +254,10 @@
confirmDirty: false,
viewshow: false,
viewshowbrand: false,
jobsStr:'',
selectedDepartKeys: [], //保存用户选择部门id
brandsList: [], //保存用户选择部门id
dutylist: [], //保存用户选择部门id
checkedDepartKeys: [],
checkedDepartNames: [], // 保存部门的名称 =>title
checkedDepartNameString: '', // 保存部门的名称 =>title
@@ -380,6 +396,15 @@
}
})
},
getdutylist(){
getAction('/sys/dict/getDictItems/duty_territory', {}).then((res) => {
if (res.success) {
this.dutylist = res.result
} else {
this.dutylist = []
}
})
},
loadUserRoles(userid) {
queryUserRole({ userid: userid }).then((res) => {
if (res.success) {
@@ -494,12 +519,45 @@
this.refresh()
this.edit({ activitiSync: '1' })
},
onChange(val) {
// val 拿到的是数组格式的数据,比如:['测试1','测试3']
const res = this.dutyTerritories.join(',')
this.jobsStr = res
this.dutyTerritories = this.checkAll(val, this.dutylist)
},
checkAll(arr, modelList) {
// arr是onChange中的val数组 modelList是下拉框List
let length = arr.length
let list = arr
// 遍历已经选中的选项
arr.forEach(element => {
// 当数组中存在0,说明此时进行全选/取消全选
if (element === '0') {
// 当数组长度为最大长度且最后一个元素为0时,说明此时在全选的基础上又点击全选,则取消全选
if (length - 1 === modelList.length && arr[length - 1] === '0') {
list = []
// 取消全选时,jobsStr需要重置为空,否则全选的数据还会展示在下拉输入框中
this.jobsStr = ''
} else {
// 当不是取消全选操作,只要数组中出现了0则说明进行了全选操作
list = []
for (let i in modelList) {
list.push(modelList[i].title)
// 全选时,也需要给jobsStr 赋值,拿到所有的下拉选项,并进行数据格式转换
this.jobsStr = list.join(',')
}
}
}
})
return list
},
edit(record) {
this.resetScreenSize() // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
let that = this
this.disabled = false
that.initialRoleList()
that.barndslist()
that.getdutylist()
if (record.activitiSync) {
this.disabled = true
}