Merge branch 'master' into 标准拆分译文变更
# Conflicts: # src/common/lang/en-us.js # src/common/lang/zh-cn.js # src/views/documentTool/documentSplit/modules/SplitAddForm.vue # src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue
This commit is contained in:
@@ -44,6 +44,12 @@ export default {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => []
|
||||
},
|
||||
// 是否返回区间,只选择一侧,另一侧会返回一个minDate或maxDate
|
||||
returnInterval: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -112,7 +118,14 @@ export default {
|
||||
},
|
||||
// 触发change事件
|
||||
triggerChange () {
|
||||
this.$emit('change', [this.startDate || minDate, this.endDate || maxDate])
|
||||
const startDate = this.startDate || minDate
|
||||
const endDate = this.endDate || maxDate
|
||||
// 是否一侧为空时,返回最大日期或最小日期
|
||||
if (this.returnInterval) {
|
||||
this.$emit('change', [startDate, endDate])
|
||||
} else {
|
||||
this.$emit('change', [this.startDate, this.endDate])
|
||||
}
|
||||
},
|
||||
// 记录最后一次点击的日期
|
||||
clickCalendarDate (val) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
v-on="$listeners"
|
||||
:row-key="rowKey"
|
||||
:bordered="bordered"
|
||||
:scroll="{x: '100%'}"
|
||||
:scroll="scroll"
|
||||
:row-class-name="lineCanExpand"
|
||||
:columns="columns"
|
||||
:expandedRowKeys.sync="expandedRowKeys"
|
||||
@@ -23,6 +23,13 @@
|
||||
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<!--增加数据字典双语翻译的插槽-->
|
||||
<template slot="dictText" slot-scope="text, record, index, column">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</template>
|
||||
<div class="table-text">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<!-- 表格扩展插槽 -->
|
||||
<div slot="expandedRowRender" slot-scope="record, index" style="margin: 0">
|
||||
<!-- 如果表单会依赖某个字段变化就需要加判断,循环判断extraForm中的表单 -->
|
||||
@@ -189,6 +196,13 @@ export default {
|
||||
name: 'JExpandTable',
|
||||
components: { JUpload },
|
||||
props: {
|
||||
scroll: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return { x: '100%' }
|
||||
}
|
||||
},
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
|
||||
@@ -101,7 +101,8 @@ export default {
|
||||
const oldVal = this.checkedValue.join(',')
|
||||
if (newVal !== oldVal) {
|
||||
if (newVal) {
|
||||
this.checkedValue = [...new Set(newVal.split(','))]
|
||||
// 去重、去掉格式不对的
|
||||
this.checkedValue = [...new Set(newVal.split(','))].filter(dateStr => dateStr && /^\d{4}-\d{2}-\d{2}$/.test(dateStr))
|
||||
} else {
|
||||
this.checkedValue = []
|
||||
}
|
||||
|
||||
@@ -250,7 +250,8 @@ export default {
|
||||
{
|
||||
dataIndex: 'finishFlag_dictText',
|
||||
title: this.$t('status'),
|
||||
width: 100
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'dictText' }
|
||||
}
|
||||
],
|
||||
image: false,
|
||||
|
||||
@@ -4,18 +4,30 @@
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24" style="margin: 0;">
|
||||
<!--适用零部件-->
|
||||
<!--文本搜索-->
|
||||
<a-col :md="4" :sm="12">
|
||||
<a-form-item :label="$t('standardRegulationLibrary.applicableComponents')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.applicableComponents')"
|
||||
v-model="queryParam.applicable_components"></a-input>
|
||||
<a-form-item :label="$t('docTool.split.textSearch')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('docTool.split.textSearch')"
|
||||
v-model="queryParam.item_content"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--涉及系统/部件-->
|
||||
<a-col :md="4" :sm="12">
|
||||
<a-form-item :label="$t('standardRegulationLibrary.involvingSystemsComponents')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.involvingSystemsComponents')"
|
||||
v-model="queryParam.keywords"></a-input>
|
||||
<!--<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.involvingSystemsComponents')"-->
|
||||
<!-- v-model="queryParam.part_name"></a-input>-->
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam.part_name"
|
||||
:maxTagCount="1"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="systemPartList"
|
||||
:replaceFields="{key: 'id', value: 'id', title: 'name', children: 'childPartNameList'}"
|
||||
show-search
|
||||
allowClear
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.involvingSystemsComponents')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--适用车型-->
|
||||
@@ -85,7 +97,7 @@
|
||||
:replaceFields="{children: 'children', key: 'id'}">
|
||||
<a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" />
|
||||
<template slot="title" slot-scope="{name, itemName}">
|
||||
<span :style="name && name.indexOf('.')===-1?'font-weight: 600;':''">{{ `${name} ${itemName || ''}` }}</span>
|
||||
<span :style="name && name.indexOf('.')===-1?'font-weight: 600;':''" :title="`${name} ${itemName || ''}`">{{ `${name} ${itemName || ''}` }}</span>
|
||||
</template>
|
||||
</a-tree>
|
||||
</div>
|
||||
@@ -111,7 +123,7 @@
|
||||
</a-button>
|
||||
</div>
|
||||
<!--条文内容-->
|
||||
<div class="standard-content">
|
||||
<div class="standard-content" ref="standardContent">
|
||||
<div class="clause-content-item"
|
||||
v-for="clause in clauseContentList"
|
||||
:key="clause.id"
|
||||
@@ -199,7 +211,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDocSplitEditForm, getStandardInterpretation, previewDocSplit } from '@api/documentToolApi'
|
||||
import {
|
||||
getDocSplitEditForm,
|
||||
getInvolvedSystem,
|
||||
getStandardInterpretation,
|
||||
previewDocSplit
|
||||
} from '@api/documentToolApi'
|
||||
import { FieldType } from '@/enums/commonEnums'
|
||||
import VueDraggableResizable from 'vue-draggable-resizable'
|
||||
import { queryDepartTreeList } from '@api/api'
|
||||
@@ -221,7 +238,16 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
queryParam: {},
|
||||
systemPartList: [], // 涉及系统部件下拉
|
||||
categoryTreeList: [], // 组织机构下拉框数据
|
||||
showClauseLabel: true, // 是否展示条文标签
|
||||
// 条文标签字段
|
||||
@@ -239,7 +265,18 @@ export default {
|
||||
translationContentList: [], // 译文内容的数据
|
||||
clauseLabelInfo: {}, // 条文标签数据
|
||||
clauseLabelHideField: ['item_content', 'item_title', 'translation'],
|
||||
needDictField: [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value],
|
||||
needDictField: [
|
||||
FieldType.USER_SINGLE.value,
|
||||
FieldType.ORGAN_SINGLE.value,
|
||||
FieldType.ORGAN_MORE.value,
|
||||
FieldType.OPTION_SINGLE.value,
|
||||
FieldType.OPTION_MORE.value,
|
||||
FieldType.TREE.value,
|
||||
FieldType.TREE_SINGLE.value,
|
||||
FieldType.TREE_MODAL_SELECT.value,
|
||||
FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value,
|
||||
FieldType.TREE_MODAL_SELECT_SEARCH_CHILD.value
|
||||
],
|
||||
queryParams: {},
|
||||
isDragging: false, // 是否拖拽中
|
||||
standardCatalogueRefX: 280, // 标准目录默认宽度
|
||||
@@ -250,6 +287,7 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.getSysCategoryTree()
|
||||
this.initInvolvedSystem()
|
||||
// 容器实际剩余宽度 = 右侧内容宽度 - 内容中的间距
|
||||
// const boxWidth = this.$refs.sheetBoxRef.getBoundingClientRect().width - this.$refs.clauseLabelChangeRef.getBoundingClientRect().width - (16 * 4)
|
||||
// this.sheetContainerRefX = boxWidth - this.standardCatalogueRefX - this.clauseLabelRefX
|
||||
@@ -260,7 +298,9 @@ export default {
|
||||
this.loading = true
|
||||
getStandardInterpretation({ standard_id: this.spiltInfo.standardId }).then(res => {
|
||||
if (res.success) {
|
||||
this.standardInterpret = res.result[0] || {}
|
||||
const list = res.result || []
|
||||
// 后端说id是随时间递增的,取最新数据也就是取id最大的数据
|
||||
this.standardInterpret = list.sort((a, b) => b.id - a.id)[0] || {}
|
||||
this.selectedTreeKeys = []
|
||||
this.hightMenuId = null
|
||||
this.clauseLabelInfo = this.standardInterpret
|
||||
@@ -275,6 +315,12 @@ export default {
|
||||
handleViewFile (ids) {
|
||||
this.$refs.uploadFile.open(ids)
|
||||
},
|
||||
// 获取涉及系统/部件
|
||||
initInvolvedSystem () {
|
||||
getInvolvedSystem().then(res => {
|
||||
this.systemPartList = res.result.records || res.result || []
|
||||
})
|
||||
},
|
||||
// 获取组织机构树
|
||||
getSysCategoryTree () {
|
||||
queryDepartTreeList().then((res) => {
|
||||
@@ -298,6 +344,12 @@ export default {
|
||||
this.queryParam = {}
|
||||
this.initDetailInfo()
|
||||
},
|
||||
// 清除选中状态
|
||||
clearSelect () {
|
||||
this.selectedTreeKeys = []
|
||||
this.hightMenuId = null
|
||||
this.clauseLabelInfo = {}
|
||||
},
|
||||
/**
|
||||
* 拖拽回调
|
||||
* @param min - 拖拽最小宽度
|
||||
@@ -349,10 +401,15 @@ export default {
|
||||
}
|
||||
previewDocSplit(params).then(res => {
|
||||
if (res.success) {
|
||||
// 清除选中状态
|
||||
this.clearSelect()
|
||||
const data = res.result || {}
|
||||
this.treeData = data.sarFileSplitMenuEO || []
|
||||
this.spiltInfo = data.documentSplitInfo || {}
|
||||
this.clauseContentList = data.documentSplitDetail || []
|
||||
this.$refs.standardContent.scrollTop = 0
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
@@ -782,4 +839,7 @@ export default {
|
||||
.disabledSelect {
|
||||
user-select: none;
|
||||
}
|
||||
.table-page-search-wrapper .ant-form-inline /deep/ .ant-form-item > .ant-form-item-label {
|
||||
min-width: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
:disabledSourceSearch="!selectStandardCanUpdateTypeField.includes(item.dbFieldName)"
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
|
||||
:exclude-standard-numbers="excludeStandardFields.includes(item.dbFieldName) ? excludeStandardNumbers : null"
|
||||
:is-value-have-name="selectStandardValueNeedNameField.includes(item.dbFieldName)"
|
||||
v-model="formInline[item.dbFieldName]" />
|
||||
<!-- 7, 多选组织机构 -->
|
||||
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value"
|
||||
@@ -113,6 +114,7 @@
|
||||
tree-checkable
|
||||
treeCheckStrictly
|
||||
dropdownMatchSelectWidth
|
||||
:replaceFields="notNeedEnTitleTreeField.includes(item.dbFieldName) ? null : {title: isChinese() ? 'title' : 'enTitle'}"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
||||
<!-- 14, 年份选择 -->
|
||||
<j-date v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value"
|
||||
@@ -130,18 +132,27 @@
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
:label-in-value="false"
|
||||
:replaceFields="notNeedEnTitleTreeField.includes(item.dbFieldName) ? null : {title: isChinese() ? 'title' : 'enTitle'}"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
||||
<!--16、树形弹框选择-->
|
||||
<tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
v-model="formInline[item.dbFieldName]"
|
||||
@nameChange="treeSelectNameChange"
|
||||
:filedName="item.dbFieldName"
|
||||
type="checkbox"
|
||||
:options-href="item.fieldHref"
|
||||
:nameStr="formInline[item.dbFieldName + '_dictText']"
|
||||
:dict-id="item.dictId"
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
|
||||
<!-- <tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"-->
|
||||
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
|
||||
<!-- v-model="formInline[item.dbFieldName]"-->
|
||||
<!-- @nameChange="treeSelectNameChange"-->
|
||||
<!-- :filedName="item.dbFieldName"-->
|
||||
<!-- type="checkbox"-->
|
||||
<!-- :options-href="item.fieldHref"-->
|
||||
<!-- :nameStr="formInline[item.dbFieldName + '_dictText']"-->
|
||||
<!-- :dict-id="item.dictId"-->
|
||||
<!-- :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />-->
|
||||
<tree-data-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
v-model="formInline[item.dbFieldName]"
|
||||
:fieldName="item.dbFieldName"
|
||||
:nameStr="formInline[item.dbFieldName + '_dictText']"
|
||||
@nameChange="treeDataSelectNameChange"
|
||||
:optionsHref="item.treeFirstHref"
|
||||
:dict-id="item.dictId"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -173,10 +184,12 @@ import TreeSelection from '../selection/TreeSelection'
|
||||
import STreeSelect from '../STreeSelect'
|
||||
import { isHasPermission } from '../../utils/hasPermission'
|
||||
import { mapGetters } from 'vuex'
|
||||
import TreeDataSelection from '../selection/TreeDataSelection'
|
||||
|
||||
export default {
|
||||
name: 'AddForm',
|
||||
components: {
|
||||
TreeDataSelection,
|
||||
UserSelection,
|
||||
JMultipleDatePicker,
|
||||
StandardSelection,
|
||||
@@ -295,6 +308,14 @@ export default {
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 选标准字段需要在value里面加标准名称的字段
|
||||
selectStandardValueNeedNameField: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -320,7 +341,8 @@ export default {
|
||||
dictNotCodes: ['name_code'], // 用到字典的字段不传dictCode的字段
|
||||
filePerm: { // 上传文件根据权限控制只能查看,没有权限的除了系统管理员外不可见不可下载
|
||||
associated_file: 'enterpriseStandard:associatedFile:look' // 关联文件
|
||||
}
|
||||
},
|
||||
notNeedEnTitleTreeField: ['standard_system'] // 树形不需要enTitle判断的字段,暂时只有结构树不需要
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -361,12 +383,8 @@ export default {
|
||||
},
|
||||
fileIsDownload () { // 文件是否可下载
|
||||
if (Object.keys(this.filePerm).includes(this.uploadName)) {
|
||||
// 系统管理员可下载
|
||||
if (this.isSystemAdmin) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
// 需要特殊判断的字段不可下载
|
||||
return false
|
||||
} else {
|
||||
// 不是需要特殊判断的字段正常可下载
|
||||
return true
|
||||
@@ -577,6 +595,9 @@ export default {
|
||||
treeSelectNameChange (value, fieldName) {
|
||||
this.formInline[fieldName + '_dictText'] = value
|
||||
},
|
||||
treeDataSelectNameChange (value, fieldName) {
|
||||
this.formInline[fieldName + '_dictText'] = value
|
||||
},
|
||||
submit () {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
@@ -628,13 +649,14 @@ export default {
|
||||
|
||||
.form-flex-item-half {
|
||||
width: calc((100% - 10px) / 2);
|
||||
margin: 0 2px;
|
||||
}
|
||||
.form-flex-item-half:nth-child(2n+1) {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.form-flex-item-half:nth-child(2n) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
//.form-flex-item-half:nth-child(2n+1) {
|
||||
// margin-right: 5px;
|
||||
//}
|
||||
//.form-flex-item-half:nth-child(2n) {
|
||||
// margin-left: 5px;
|
||||
//}
|
||||
|
||||
.form-flex-item-line {
|
||||
width: 100%;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
show-search
|
||||
allowClear
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:replaceFields="{title: isChinese() ? 'title' : 'enTitle'}"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
@@ -35,6 +36,7 @@
|
||||
show-search
|
||||
allowClear
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:replaceFields="{title: isChinese() ? 'title' : 'enTitle'}"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
@@ -141,9 +143,28 @@
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
:replaceFields="{key: 'id', value: 'id', title: 'name', children: 'childPartNameList'}"
|
||||
tree-checkable
|
||||
show-search
|
||||
allowClear
|
||||
dropdownMatchSelectWidth
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 树形弹框(带出所有子级) -->
|
||||
<template v-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_CHILD.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
:maxTagCount="1"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
tree-checkable
|
||||
treeCheckStrictly
|
||||
show-search
|
||||
allowClear
|
||||
dropdownMatchSelectWidth
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
@@ -171,6 +192,7 @@
|
||||
show-search
|
||||
allowClear
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:replaceFields="{title: isChinese() ? 'title' : 'enTitle'}"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
@@ -187,6 +209,7 @@
|
||||
show-search
|
||||
allowClear
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:replaceFields="{title: isChinese() ? 'title' : 'enTitle'}"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
@@ -280,13 +303,31 @@
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
:maxTagCount="1"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
:replaceFields="{key: 'id', value: 'id', title: 'name', children: 'childPartNameList'}"
|
||||
tree-checkable
|
||||
show-search
|
||||
allowClear
|
||||
dropdownMatchSelectWidth
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 树形弹框(带出所有子级) -->
|
||||
<template v-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_CHILD.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
:maxTagCount="1"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
tree-checkable
|
||||
treeCheckStrictly
|
||||
show-search
|
||||
allowClear
|
||||
dropdownMatchSelectWidth
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
@@ -432,6 +473,13 @@ export default {
|
||||
if (standardStateIndex !== -1) {
|
||||
this.searchList[standardStateIndex].fieldShowType = FieldType.OPTION_MORE.value
|
||||
}
|
||||
// 把标准名称放到第二个
|
||||
const standardNameIndex = this.searchList.findIndex(item => item.dbFieldName === 'standard_name')
|
||||
const standardName = this.searchList.find(item => item.dbFieldName === 'standard_name')
|
||||
if (standardNameIndex !== -1) {
|
||||
this.searchList.splice(standardNameIndex, 1)
|
||||
this.searchList.splice(1, 0, standardName)
|
||||
}
|
||||
this.getOptionsData() // 获取下拉数据
|
||||
console.log(this.searchList)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export default {
|
||||
/* 分页参数 */
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 50,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
|
||||
|
||||
@@ -20,12 +20,13 @@
|
||||
v-bind="$attrs"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
@dropdownVisibleChange="dropdownVisibleChange"
|
||||
@change="handleInput"
|
||||
>
|
||||
<a-select-option :value="undefined">请选择</a-select-option>
|
||||
<a-select-option :value="undefined">{{ $t('pleaseSelect') }}</a-select-option>
|
||||
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value" :disabled="item.disabled || false">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
|
||||
{{ item.text || item.label }}
|
||||
<span :title=" $i18n.locale === EN ? item.enText : (item.text || item.label) ">
|
||||
{{ $i18n.locale === EN ? item.enText : (item.text || item.label) }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -56,6 +57,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
EN: 'en-us',
|
||||
dictOptions: [],
|
||||
tagType: ''
|
||||
}
|
||||
@@ -105,6 +107,7 @@ export default {
|
||||
// 优先从缓存中读取字典配置
|
||||
if (getDictItemsFromCache(this.dictCode)) {
|
||||
this.dictOptions = getDictItemsFromCache(this.dictCode)
|
||||
console.log('-----------缓存获取', this.dictCode, this.dictOptions)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -112,6 +115,7 @@ export default {
|
||||
ajaxGetDictItems(this.dictCode, null).then((res) => {
|
||||
if (res.success) {
|
||||
this.dictOptions = res.result
|
||||
console.log('-----------接口获取', this.dictCode, this.dictOptions)
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -123,9 +127,15 @@ export default {
|
||||
val = e
|
||||
}
|
||||
console.log(val)
|
||||
// 返回名字
|
||||
if (this.$listeners.nameChange) {
|
||||
this.$emit('nameChange', this.getDictLabelByValue(val))
|
||||
}
|
||||
// 返回选中字典对象
|
||||
if (this.$listeners.dictChange) {
|
||||
const dictItem = this.dictOptions.find(item => item.value === val)
|
||||
this.$emit('dictChange', JSON.parse(JSON.stringify(dictItem || null)))
|
||||
}
|
||||
this.$emit('change', val)
|
||||
// 解决数据规则,选择自定义SQL 规则值无法输入空格
|
||||
this.$emit('input', val)
|
||||
@@ -140,6 +150,9 @@ export default {
|
||||
},
|
||||
getCurrentDictOptions () {
|
||||
return this.dictOptions
|
||||
},
|
||||
dropdownVisibleChange (open) {
|
||||
this.$emit('dropdownVisibleChange', open)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
:class="(openSelectedAll && arrayValue[0] === selectedAllValue) ? 'multi-select-tag-check-all' : ''"
|
||||
v-bind="$attrs">
|
||||
<a-select-option :key="-1" :value="selectedAllValue" v-if="openSelectedAll && dictOptions.length > 0">{{ $t('checkedAll') }}</a-select-option>
|
||||
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text || item.label }}</a-select-option>
|
||||
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ $i18n.locale === EN ? item.enText : (item.text || item.label) }}</a-select-option>
|
||||
</a-select>
|
||||
|
||||
</template>
|
||||
@@ -61,6 +61,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
EN: 'en-us',
|
||||
// 全选的value
|
||||
selectedAllValue,
|
||||
dictOptions: [],
|
||||
@@ -140,20 +141,22 @@ export default {
|
||||
}
|
||||
}
|
||||
this.arrayValue = selectedValue
|
||||
let list = selectedValue
|
||||
// 开启全选时,不把全选的value进行返回
|
||||
if (this.openSelectedAll) {
|
||||
const list = selectedValue.filter(item => item !== selectedAllValue)
|
||||
if (this.$listeners.nameChange) {
|
||||
const labelList = list.map(val => this.getDictLabelByValue(val))
|
||||
this.$emit('nameChange', labelList.join(this.spliter))
|
||||
}
|
||||
this.$emit('change', list.join(this.spliter))
|
||||
} else {
|
||||
if (this.$listeners.nameChange) {
|
||||
this.$emit('nameChange', selectedValue.map(val => this.getDictLabelByValue(val)).join(this.spliter))
|
||||
}
|
||||
this.$emit('change', selectedValue.join(this.spliter))
|
||||
list = selectedValue.filter(item => item !== selectedAllValue)
|
||||
}
|
||||
// 返回名字
|
||||
if (this.$listeners.nameChange) {
|
||||
const labelList = list.map(val => this.getDictLabelByValue(val))
|
||||
this.$emit('nameChange', labelList.join(this.spliter))
|
||||
}
|
||||
// 返回选中字典对象列表
|
||||
if (this.$listeners.dictChange) {
|
||||
const dictList = list.map(val => this.dictOptions.find(item => item.value === val))
|
||||
this.$emit('dictChange', JSON.parse(JSON.stringify(dictList)))
|
||||
}
|
||||
this.$emit('change', list.join(this.spliter))
|
||||
},
|
||||
// 通过val获取字典项
|
||||
getDictLabelByValue (val) {
|
||||
|
||||
@@ -22,7 +22,13 @@
|
||||
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!--增加数据字典双语翻译的插槽-->
|
||||
<template slot="dictText" slot-scope="text, record, index, column">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</template>
|
||||
<div class="table-text">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<!-- 操作栏 -->
|
||||
<template slot="action" slot-scope="text, record, index">
|
||||
<slot name="action" v-bind="{text, record, index}">
|
||||
|
||||
@@ -375,7 +375,7 @@ export default {
|
||||
if (!info.file.status && this.uploadGoOn === false) {
|
||||
info.fileList.pop()
|
||||
}
|
||||
let fileList = info.fileList
|
||||
let fileList = info.fileList.filter(item => item.uploadGoOn)
|
||||
if (info.file.status === 'done') {
|
||||
if (this.number > 0) {
|
||||
fileList = fileList.slice(-this.number)
|
||||
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
methods: {
|
||||
// update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题
|
||||
changeTitle (title) {
|
||||
const projectTitle = '奇瑞法规智库'
|
||||
const projectTitle = '奇瑞标准法规管理系统'
|
||||
// 首页特殊处理
|
||||
if (this.$route.path === indexKey) {
|
||||
document.title = projectTitle
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="illustration" v-if="!mobile">
|
||||
<img src="@/assets/home.png" alt="">
|
||||
<div class="illustration-img"><img src="@/assets/image/loginLogo.png" alt=""></div>
|
||||
<p class="illustration-title">{{$t('login.systemName')}}</p>
|
||||
</div>
|
||||
<route-view></route-view>
|
||||
</div>
|
||||
@@ -124,15 +125,37 @@ function isMobile () {
|
||||
|
||||
.illustration{
|
||||
position: absolute;
|
||||
max-width: 50%;
|
||||
left: 12vw;
|
||||
top: 20vh;
|
||||
max-width: 40%;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
min-width: 400px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
max-width: 70%;
|
||||
|
||||
.illustration-img {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.illustration-title {
|
||||
font-family: PingFang SC, PingFang SC, sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 40px;
|
||||
color: #333333;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1366px) {
|
||||
.illustration{
|
||||
top: 15vh;
|
||||
|
||||
.illustration-img {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.illustration-title {
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<a-layout-sider
|
||||
:collapsedWidth="64"
|
||||
:class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
|
||||
width="208px"
|
||||
:collapsible="collapsible"
|
||||
@@ -165,6 +166,17 @@ export default {
|
||||
<!-- update_begin author:sunjianlei date:20190530 for: 选中首页的时候不显示背景颜色 -->
|
||||
<style lang="less">
|
||||
.ant-menu.ant-menu-root {
|
||||
&:not(.ant-menu-horizontal) .ant-menu-item-selected {
|
||||
background-color: rgba(0, 100, 250, 0.08);
|
||||
}
|
||||
&.ant-menu-inline-collapsed {
|
||||
width: 64px;
|
||||
& > .ant-menu-item,
|
||||
& > .ant-menu-submenu > .ant-menu-submenu-title {
|
||||
padding: 0 24px !important;
|
||||
}
|
||||
}
|
||||
|
||||
& > .ant-menu-item:first-child {
|
||||
//background-color: transparent;
|
||||
|
||||
|
||||
@@ -285,9 +285,9 @@ body {
|
||||
}
|
||||
|
||||
.trigger {
|
||||
font-size: 22px;
|
||||
line-height: 42px;
|
||||
padding: 0 18px;
|
||||
font-size: 12px;
|
||||
//line-height: 42px;
|
||||
padding: 22px;
|
||||
cursor: pointer;
|
||||
transition: color 300ms, background 300ms;
|
||||
|
||||
@@ -343,7 +343,7 @@ body {
|
||||
}
|
||||
|
||||
&.ant-header-side-closed {
|
||||
width: calc(100% - 80px)
|
||||
width: calc(100% - 56px)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,14 @@
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!--增加数据字典双语翻译的插槽-->
|
||||
<template slot="dictText" slot-scope="text, record, index, column">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</template>
|
||||
<div class="table-text">{{ (isChinese() ? text : record[column.key + 'En']) || (isChinese() ? text : record[column.key + 'En']) === 0 ? (isChinese() ? text : record[column.key + 'En']) : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 清单编号/清单名称 -->
|
||||
<template v-slot:toDetail="text, record">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
@@ -198,7 +206,7 @@ export default {
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'country_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
scopedSlots: { customRender: 'dictText' }
|
||||
},
|
||||
{ // 清单编号
|
||||
title: this.$t('standardRegulationLibrary.marketRegulationsList.listNumber'),
|
||||
@@ -219,7 +227,7 @@ export default {
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'drivePosition_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
scopedSlots: { customRender: 'dictText' }
|
||||
},
|
||||
{ // 清单版本
|
||||
title: this.$t('standardRegulationLibrary.marketRegulationsList.listVersion'),
|
||||
@@ -247,7 +255,7 @@ export default {
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'manifestStatus_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
scopedSlots: { customRender: 'dictText' }
|
||||
}
|
||||
],
|
||||
dataList: []
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
|
||||
<a-icon v-if="(nameStr || value) && !disabled" slot="suffix" class="close-icon" type="close-circle" theme="filled" @click="clearInput" />
|
||||
</a-input>
|
||||
<a-button v-if="!disabled" type="primary" class="button-box" @click="standardClick">
|
||||
{{ $t('standardSelect.standardSelection') }}
|
||||
<a-button v-if="!disabled" type="primary" class="button-box" :title="$t('standardSelect.standardSelection')" @click="standardClick">
|
||||
<span v-if="isSmall && $i18n.locale === EN" type="select">{{$t('standardSelect.standardSelection').charAt(0)}}</span>
|
||||
<span v-else>{{ $t('standardSelect.standardSelection') }}</span>
|
||||
</a-button>
|
||||
</div>
|
||||
<standard-selection-modal ref="standardSelectionModal"
|
||||
@@ -61,6 +62,18 @@ export default {
|
||||
default: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const offsetWidth = document.getElementsByClassName('selection-wrapper')[0].offsetWidth
|
||||
if (offsetWidth >= 0 && offsetWidth <= 300) {
|
||||
this.isSmall = true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
EN: 'en-us',
|
||||
isSmall: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 点击选择标准按钮
|
||||
standardClick () {
|
||||
@@ -134,4 +147,15 @@ export default {
|
||||
.close-icon:hover {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
//.small-btn {
|
||||
// max-width: 60px;
|
||||
// span {
|
||||
// display: inline-block;
|
||||
// width: 40px;
|
||||
// overflow-x: hidden;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
//}
|
||||
</style>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :sm="6">
|
||||
<a-col :sm="6" v-show="!splitSearch">
|
||||
<a-form-item :label="$t('standardSelect.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
|
||||
:disabled="disabledSourceSearch"
|
||||
@@ -22,6 +22,24 @@
|
||||
@change="handleTypeChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--标准结构树-->
|
||||
<a-col :md="8" :sm="12" v-if="splitSearch">
|
||||
<a-form-item :label="$t('docTool.comparison.standardStructureTree')">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam.standardSystem"
|
||||
:maxTagCount="1"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
:tree-data="standardStructureTree"
|
||||
tree-checkable
|
||||
show-search
|
||||
allowClear
|
||||
tree-check-strictly
|
||||
:filterTreeNode="filterTreeOption"
|
||||
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.standardStructureTree')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :sm="8">
|
||||
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
|
||||
@@ -38,7 +56,7 @@
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:rowKey="record => {return record.standardNumber + '|' + record.standardName}"
|
||||
:rowKey="record => {return isValueHaveName ? record.standardNumber + '《' + record.standardName + '》' : record.standardNumber}"
|
||||
:scroll="{x: 900}"
|
||||
:data-source="dataList"
|
||||
:pagination="ipagination"
|
||||
@@ -64,8 +82,20 @@
|
||||
<!-- 标准状态 -->
|
||||
<template slot="standardState" slot-scope="text, record">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || global.emptyLine) }}</template>
|
||||
<div class="table-text">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || global.emptyLine) }}</div>
|
||||
<template slot="title">
|
||||
{{
|
||||
record.source === '3' ?
|
||||
(isChinese() ? (record.esStandardState_dictText || global.emptyLine) : (record.esStandardState_dictTextEn || global.emptyLine)) :
|
||||
(isChinese() ? (record.standardState_dictText || global.emptyLine) : (record.standardState_dictTextEn || global.emptyLine))
|
||||
}}
|
||||
</template>
|
||||
<div class="table-text">
|
||||
{{
|
||||
record.source === '3' ?
|
||||
(isChinese() ? (record.esStandardState_dictText || global.emptyLine) : (record.esStandardState_dictTextEn || global.emptyLine)) :
|
||||
(isChinese() ? (record.standardState_dictText || global.emptyLine) : (record.standardState_dictTextEn || global.emptyLine))
|
||||
}}
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
@@ -83,6 +113,7 @@
|
||||
import { ajaxGetDictItems, getStandardList } from '@/api/api'
|
||||
import JDictSelectTag from '../dict/JDictSelectTag'
|
||||
import { StandardSource } from '../../enums/commonEnums'
|
||||
import { getForeignStandardTree } from '@api/standardRegulationLibraryApi'
|
||||
|
||||
export default {
|
||||
name: 'StandardSelectionModal',
|
||||
@@ -127,6 +158,18 @@ export default {
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
// 是否拆分的搜索(来源换成外部标准结构树)
|
||||
splitSearch: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 是否value要有标准名称
|
||||
isValueHaveName: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -189,7 +232,15 @@ export default {
|
||||
}
|
||||
],
|
||||
dataList: [],
|
||||
sourceOptions: []
|
||||
sourceOptions: [],
|
||||
// 标准结构树
|
||||
standardStructureTree: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// 拆分的需要加载标准结构树
|
||||
if (this.splitSearch) {
|
||||
this.loadStandardStructureTree()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -210,6 +261,34 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 加载标准结构树
|
||||
loadStandardStructureTree () {
|
||||
// option 不传显示我的收藏,1不显示我的收藏, 2只能选二级中国及中国下三级,和欧盟EU
|
||||
getForeignStandardTree({ option: 1 }).then(res => {
|
||||
if (res.success) {
|
||||
this.standardStructureTree = res.result || []
|
||||
}
|
||||
})
|
||||
},
|
||||
// tree-select搜索
|
||||
filterTreeOption (input, option) {
|
||||
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
|
||||
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
},
|
||||
// 获取树结构没有被禁用的value值
|
||||
getValuesWhereNotDisabled (tree = []) {
|
||||
const values = []
|
||||
function traverse (node) {
|
||||
if (!node.disabled) { // 只处理 disabled 不为 true 的节点
|
||||
values.push(node.value)
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach(child => traverse(child))
|
||||
}
|
||||
}
|
||||
tree.forEach(node => traverse(node))
|
||||
return values
|
||||
},
|
||||
// 获取表格数据
|
||||
replacePage (arg) {
|
||||
if (arg === 1) {
|
||||
@@ -222,6 +301,10 @@ export default {
|
||||
pageSize: this.ipagination.pageSize,
|
||||
excludeStandardNumbers: this.excludeStandardNumbers
|
||||
}
|
||||
// 标准结构树
|
||||
if (Array.isArray(query.standardSystem)) {
|
||||
query.standardSystem = query.standardSystem.map(item => item.value).join(',')
|
||||
}
|
||||
// 清空在可选范围内进行查询
|
||||
if (!query.source && this.canSelectedSource.length < 3) {
|
||||
query.source = this.canSelectedSource.join(',')
|
||||
@@ -259,21 +342,43 @@ export default {
|
||||
if (this.type === 'checkbox') {
|
||||
if (selectedRowKeys.length > this.selectedRowList.length) {
|
||||
// 说明是增加了数据
|
||||
for (const rowIndex in selectedRows) {
|
||||
if (!this.selectedRowList.find(item => (item.standardNumber + '|' + item.standardName) === (selectedRows[rowIndex].standardNumber + '|' + selectedRows[rowIndex].standardName))) {
|
||||
// 不存在,追加
|
||||
this.selectedRowList.push(selectedRows[rowIndex])
|
||||
if (this.isValueHaveName) {
|
||||
// value里面要带标准名称
|
||||
for (const rowIndex in selectedRows) {
|
||||
if (!this.selectedRowList.find(item => (item.standardNumber + '《' + item.standardName + '》') === (selectedRows[rowIndex].standardNumber + '《' + selectedRows[rowIndex].standardName + '》'))) {
|
||||
// 不存在,追加
|
||||
this.selectedRowList.push(selectedRows[rowIndex])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// value不带标准名称
|
||||
for (const rowIndex in selectedRows) {
|
||||
if (!this.selectedRowList.find(item => item.standardNumber === selectedRows[rowIndex].standardNumber)) {
|
||||
// 不存在,追加
|
||||
this.selectedRowList.push(selectedRows[rowIndex])
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 说明是删除了数据
|
||||
if (selectedRowKeys && selectedRowKeys.length > 0) {
|
||||
// 没有选中数据,说明这一页没有选中数据了
|
||||
for (let i = 0; i < this.selectedRowList.length; i++) {
|
||||
if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber + '|' + this.selectedRowList[i].standardName)) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.selectedRowList.splice(i, 1)
|
||||
i--
|
||||
if (this.isValueHaveName) {
|
||||
// value里面要带标准名称
|
||||
for (let i = 0; i < this.selectedRowList.length; i++) {
|
||||
if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber + '《' + this.selectedRowList[i].standardName + '》')) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.selectedRowList.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < this.selectedRowList.length; i++) {
|
||||
if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber)) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.selectedRowList.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,531 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="$t('userSelect.select')"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
switchFullscreen
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
|
||||
<div class="modal-content">
|
||||
<a-spin :spinning="topLoading">
|
||||
<a-input-search style="margin-bottom: 1px" :placeholder="$t('pleaseEnter') + $t('treeSelection.primaryNodeName')" @search="onSearch" />
|
||||
<a-tree
|
||||
ref="tree"
|
||||
:checkable="checkable"
|
||||
:checkStrictly="true"
|
||||
:replaceFields="replaceFields"
|
||||
:class="treeScreenClass"
|
||||
:treeData="treeData"
|
||||
:autoExpandParent="autoExpandParent"
|
||||
@check="onCheck"
|
||||
@select="onSelect"
|
||||
@expand="onExpand"
|
||||
@load="onLoad"
|
||||
:loadData="loadData"
|
||||
:expandedKeys="expandedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:loadedKeys="loadedKeys"
|
||||
:selectedKeys.sync="selectedKeys">
|
||||
|
||||
<template slot="title" slot-scope="{dataRef}">
|
||||
<span v-if="searchValue && dataRef[replaceFields.title].indexOf(searchValue) > -1">
|
||||
<span style="color: #f50">{{ dataRef[replaceFields.title] }}</span>
|
||||
</span>
|
||||
<span v-else>{{ dataRef[replaceFields.title] }}</span>
|
||||
</template>
|
||||
</a-tree>
|
||||
</a-spin>
|
||||
</div>
|
||||
|
||||
<p class="modal-content-title">{{ $t('treeSelection.selectedData') }}</p>
|
||||
<a-spin :spinning="bottomLoading">
|
||||
<div v-if="dataSourceRight && dataSourceRight.length > 0" class="name-content">
|
||||
<div v-for="(item, index) in dataSourceRight" :key="item[replaceFields.key]" class="name-div">
|
||||
{{ item[replaceFields.title] }}
|
||||
<a-icon type="close" @click="handleDelete(item, index)" />
|
||||
</div>
|
||||
</div>
|
||||
<a-empty v-else />
|
||||
</a-spin>
|
||||
|
||||
<!--底部父子关联操作和确认取消按钮-->
|
||||
<template slot="footer" v-if="treeOpera && checkable">
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(2)">{{ $t('parentChildConnection') }}</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(1)">{{ $t('cancelConnection') }}</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
{{ treeOperationText }} <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- <a-button style="float: left" @click="switchCheckStrictly(parentChildRelate ? 1 : 2)">{{ treeOperationText }}</a-button>-->
|
||||
<a-button @click="handleCancel" type="primary" style="margin-right: 0.8rem">{{ $t('close') }}</a-button>
|
||||
<a-button @click="handleOk" type="primary" >{{ $t('confirm') }}</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction } from '../../api/manage'
|
||||
|
||||
export default {
|
||||
name: 'TreeDataSelectModal',
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
checkable: { // 是否多选
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 是否校验必选
|
||||
checkRequired: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 获取数据的接口
|
||||
optionsHref: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
// 标签库的限制,只能选第三级
|
||||
isTagLibraryRestriction: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dictId: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
treeOpera: { // 是否可以切换父子关联
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
treeScreenClass () {
|
||||
return {
|
||||
'my-dept-select-tree': true,
|
||||
fullscreen: this.fullscreen
|
||||
}
|
||||
},
|
||||
treeOperationText () {
|
||||
return this.parentChildRelate ? this.$t('parentChildConnection') : this.$t('cancelConnection')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 是否只能选第三级
|
||||
isTagLibraryRestriction (val) {
|
||||
if (val) {
|
||||
this.setOnlySelectThreeLevel(this.treeData)
|
||||
}
|
||||
},
|
||||
value (val) {
|
||||
if (val) {
|
||||
this.checkedKeys = val.split(',')
|
||||
}
|
||||
},
|
||||
optionsHref: {
|
||||
immediate: true,
|
||||
handler (val) {
|
||||
console.log('-------------optionsHref', val)
|
||||
if (val === '/laws/standard/partName/queryFirstList') {
|
||||
// 是涉及系统/部件
|
||||
this.replaceFields = { children: 'childPartNameList', title: 'name', key: 'code' }
|
||||
this.lazyLoadHref = '/laws/standard/partName/getChild'
|
||||
this.searchFieldName = 'nodeName'
|
||||
this.lazyLoadPidFieldName = 'parentCode'
|
||||
} else { // 标签库
|
||||
this.replaceFields = { children: 'childrenList', title: 'itemText', key: 'itemValue' }
|
||||
this.lazyLoadHref = '/laws/dictTree/getChild'
|
||||
this.searchFieldName = 'nodeName'
|
||||
this.lazyLoadPidFieldName = 'dictItemId'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// if (this.treeOpera) {
|
||||
// this.switchCheckStrictly(1)
|
||||
// }
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
width: 800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
topLoading: false,
|
||||
bottomLoading: false,
|
||||
parentChildRelate: true, // 父子节点是否关联
|
||||
autoExpandParent: false, // 是否自动展开父节点
|
||||
treeData: [],
|
||||
expandedKeys: [],
|
||||
checkedKeys: [],
|
||||
checkedRows: [],
|
||||
selectedKeys: [],
|
||||
loadedKeys: [],
|
||||
searchValue: '', // 查询框内容
|
||||
replaceFields: {},
|
||||
dataSourceRight: [],
|
||||
lazyLoadHref: '', // 懒加载接口
|
||||
searchFieldName: '', // 查询传的字段名
|
||||
lazyLoadPidFieldName: '' // 懒加载传父级的字段名
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show () {
|
||||
this.visible = true
|
||||
this.treeData = []
|
||||
this.checkedRows = []
|
||||
this.checkedKeys = []
|
||||
this.loadedKeys = []
|
||||
this.selectedKeys = []
|
||||
this.dataSourceRight = []
|
||||
this.searchValue = ''
|
||||
this.getTreeData()
|
||||
if (this.value) {
|
||||
if (this.checkable) {
|
||||
this.checkedKeys = this.value.split(',')
|
||||
} else {
|
||||
this.selectedKeys = this.value.split(',')
|
||||
}
|
||||
// 初始化选中数据列表
|
||||
this.getSelectedList(this.value)
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
onCheck (checkedKeys, info) {
|
||||
console.log('----------onCheck', checkedKeys)
|
||||
console.log('----------info.checked', info.checked)
|
||||
console.log('----------info.node', info.node.dataRef)
|
||||
if (this.checkable) {
|
||||
// 是多选
|
||||
if (this.parentChildRelate) {
|
||||
// 是父子关联
|
||||
if (info.checked) {
|
||||
// 是选中数据了
|
||||
let childrenList = []
|
||||
if (info.node.dataRef[this.replaceFields.children]) {
|
||||
// 有子节点获取子节点数据
|
||||
childrenList = info.node.dataRef[this.replaceFields.children].map(item => item[this.replaceFields.key])
|
||||
}
|
||||
this.checkedKeys = [...this.checkedKeys, ...checkedKeys.checked, ...childrenList]
|
||||
} else {
|
||||
// 是取消选中了,把当前和子节点都取消选中
|
||||
let currAndChildNode = []
|
||||
if (info.node.dataRef[this.replaceFields.children]) {
|
||||
// 有子节点获取子节点数据
|
||||
const childrenNode = info.node.dataRef[this.replaceFields.children].map(item => item[this.replaceFields.key])
|
||||
currAndChildNode = [...childrenNode, info.node.dataRef[this.replaceFields.key]]
|
||||
} else {
|
||||
currAndChildNode = [info.node.dataRef[this.replaceFields.key]]
|
||||
}
|
||||
this.checkedKeys = this.checkedKeys.filter(item => !currAndChildNode.includes(item))
|
||||
}
|
||||
// 处理下方显示已选数据
|
||||
if (info.checked) {
|
||||
console.log('------------增加了数据')
|
||||
// 说明是增加了数据,把点击的数据和子数据追加进去
|
||||
for (const key of checkedKeys.checked) {
|
||||
// 当前选中没在选中列表中的加进去
|
||||
if (!this.dataSourceRight.find(item => item[this.replaceFields.key] === key)) {
|
||||
// 右侧不存在,追加到右侧表格
|
||||
this.dataSourceRight.push(info.node.dataRef)
|
||||
}
|
||||
}
|
||||
if (info.node.dataRef[this.replaceFields.children]) {
|
||||
// 有子集追加
|
||||
for (const keyItem of info.node.dataRef[this.replaceFields.children]) {
|
||||
// 当前选中的子集没在列表中的加进去
|
||||
if (!this.dataSourceRight.find(item => item[this.replaceFields.key] === keyItem[this.replaceFields.key])) {
|
||||
// 右侧不存在,追加到右侧表格
|
||||
this.dataSourceRight.push(keyItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('----------删除了数据')
|
||||
// 说明是删除了数据
|
||||
if (this.checkedKeys && this.checkedKeys.length > 0) {
|
||||
// 还有选中数据,从dataSourceRight里面找到点击的数据和他的子数据清空
|
||||
for (let i = 0; i < this.dataSourceRight.length; i++) {
|
||||
if (!this.checkedKeys.find(item => item === this.dataSourceRight[i][this.replaceFields.key])) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.dataSourceRight.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 已经没有选中数据了,直接清空展示数据
|
||||
this.dataSourceRight = []
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 不是父子关联
|
||||
console.log('-----------checkedKeys', this.checkedKeys, checkedKeys)
|
||||
if (info.checked) {
|
||||
// 是选中数据了
|
||||
this.checkedKeys = [...this.checkedKeys, ...checkedKeys.checked]
|
||||
} else {
|
||||
// 是取消选中了
|
||||
this.checkedKeys = this.checkedKeys.filter(item => item !== info.node.dataRef[this.replaceFields.key])
|
||||
}
|
||||
// 处理下方显示已选数据
|
||||
if (info.checked) {
|
||||
console.log('------------不父子关联增加了数据')
|
||||
// 说明是增加了数据,把点击的数据追加进去
|
||||
for (const key of checkedKeys.checked) {
|
||||
// 当前选中没在选中列表中的加进去
|
||||
if (!this.dataSourceRight.find(item => item[this.replaceFields.key] === key)) {
|
||||
// 右侧不存在,追加到右侧表格
|
||||
this.dataSourceRight.push(info.node.dataRef)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('----------不父子关联删除了数据')
|
||||
// 说明是删除了数据
|
||||
if (this.checkedKeys && this.checkedKeys.length > 0) {
|
||||
// 还有选中数据,从dataSourceRight里面找到点击的数据和他的子数据清空
|
||||
for (let i = 0; i < this.dataSourceRight.length; i++) {
|
||||
if (!this.checkedKeys.find(item => item === this.dataSourceRight[i][this.replaceFields.key])) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.dataSourceRight.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 已经没有选中数据了,直接清空展示数据
|
||||
this.dataSourceRight = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onSelect (selectedKeys, info) {
|
||||
// 取消关联的情况下才走onSelect的逻辑
|
||||
if (!this.parentChildRelate) {
|
||||
if (selectedKeys && selectedKeys.length > 0) {
|
||||
// 说明是选中了数据
|
||||
this.selectedKeys = [...selectedKeys]
|
||||
this.dataSourceRight = [info.node.dataRef]
|
||||
} else {
|
||||
// 没有数据,直接清空
|
||||
this.selectedKeys = []
|
||||
this.dataSourceRight = []
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad (loadedKeys) {
|
||||
this.loadedKeys = loadedKeys
|
||||
},
|
||||
onExpand (expandedKeys) {
|
||||
console.log('========expandedKeys', expandedKeys)
|
||||
this.expandedKeys = expandedKeys
|
||||
},
|
||||
// 异步加载
|
||||
async loadData (node) {
|
||||
console.log('-------------loadData', node)
|
||||
if (node.dataRef.children) {
|
||||
return
|
||||
}
|
||||
this.topLoading = true
|
||||
const params = {}
|
||||
if (this.optionsHref !== '/laws/standard/partName/queryFirstList') {
|
||||
// 不是涉及系统部件
|
||||
params.dictId = this.dictId
|
||||
}
|
||||
// 查询条件的名称
|
||||
if (this.searchValue) {
|
||||
params[this.searchFieldName] = this.searchValue
|
||||
}
|
||||
// 父节点id
|
||||
if (this.optionsHref === '/laws/standard/partName/queryFirstList') {
|
||||
// 是涉及系统部件
|
||||
params[this.lazyLoadPidFieldName] = node.dataRef.code
|
||||
} else {
|
||||
params[this.lazyLoadPidFieldName] = node.dataRef.id
|
||||
}
|
||||
await getAction(this.lazyLoadHref, params).then(res => {
|
||||
if (res.success) {
|
||||
node.dataRef[this.replaceFields.children] = res.result.record || res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
this.topLoading = false
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.visible = false
|
||||
},
|
||||
close () {
|
||||
this.visible = false
|
||||
this.checkedKeys = []
|
||||
this.expandedKeys = []
|
||||
this.loadedKeys = []
|
||||
this.dataSourceRight = []
|
||||
this.treeData = []
|
||||
this.searchValue = ''
|
||||
},
|
||||
onSearch (value) {
|
||||
this.searchValue = value
|
||||
// this.autoExpandParent = true
|
||||
this.getTreeData()
|
||||
this.expandedKeys = []
|
||||
this.loadedKeys = []
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 设置树只能选第三级
|
||||
setOnlySelectThreeLevel (treeData) {
|
||||
for (const item of treeData) {
|
||||
item.disabled = item.level + '' !== '3'
|
||||
item.disableCheckbox = item.level + '' !== '3'
|
||||
if (item.childPartNameList && item.childPartNameList.length > 0) {
|
||||
this.setOnlySelectThreeLevel(item.childPartNameList)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 切换父子关联
|
||||
switchCheckStrictly (v) {
|
||||
if (v === 1) {
|
||||
// 取消父子关联
|
||||
this.parentChildRelate = false
|
||||
} else if (v === 2) {
|
||||
// 增加父子关联
|
||||
this.parentChildRelate = true
|
||||
}
|
||||
},
|
||||
getTreeData () {
|
||||
this.topLoading = true
|
||||
const params = {}
|
||||
if (this.optionsHref !== '/laws/standard/partName/queryFirstList') {
|
||||
// 不是涉及系统部件
|
||||
params.dictId = this.dictId
|
||||
}
|
||||
// 查询条件的名称
|
||||
if (this.searchValue) {
|
||||
params[this.searchFieldName] = this.searchValue
|
||||
}
|
||||
getAction(this.optionsHref, params).then(res => {
|
||||
if (res.success) {
|
||||
this.treeData = res.result.records || res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
this.topLoading = false
|
||||
})
|
||||
},
|
||||
// 已选数据列表的删除
|
||||
handleDelete (record, index) {
|
||||
this.dataSourceRight.splice(index, 1)
|
||||
if (this.checkable) {
|
||||
// 多选从checkedKeys里面筛选出去
|
||||
this.checkedKeys = this.checkedKeys.filter(item => item !== record[this.replaceFields.key])
|
||||
} else {
|
||||
// 单选从selectedKeys里面筛选出去
|
||||
this.selectedKeys = this.selectedKeys.filter(item => item !== record[this.replaceFields.key])
|
||||
}
|
||||
},
|
||||
handleOk () {
|
||||
if (this.checkRequired && (!this.checkedKeys || this.checkedKeys.length === 0)) {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
return
|
||||
}
|
||||
this.$emit('nameChange', this.dataSourceRight.map(item => item[this.replaceFields.title]).join(','))
|
||||
this.$emit('change', this.dataSourceRight.map(item => item[this.replaceFields.key]).join(','))
|
||||
this.$emit('listChange', this.dataSourceRight)
|
||||
this.close()
|
||||
},
|
||||
getSelectedList (codes) {
|
||||
this.bottomLoading = true
|
||||
const params = {
|
||||
selectNodeCodes: codes,
|
||||
dictId: this.dictId
|
||||
}
|
||||
let url
|
||||
// 涉及系统/部件
|
||||
if (this.optionsHref === '/laws/standard/partName/queryFirstList') {
|
||||
url = '/laws/standard/partName/echo'
|
||||
} else { // 标签库
|
||||
url = '/laws/dictTree/echo'
|
||||
}
|
||||
if (!url) {
|
||||
return
|
||||
}
|
||||
postAction(url, params).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSourceRight = JSON.parse(JSON.stringify(res.result))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.bottomLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
/deep/ .ant-modal-content {
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
.my-dept-select-tree{
|
||||
height:350px;
|
||||
|
||||
&.fullscreen{
|
||||
height: calc(100vh - 250px);
|
||||
}
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.modal-content-title {
|
||||
color: #1D2129;
|
||||
font-weight: 500;
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.drawer-bootom-button {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
.name-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
.name-div {
|
||||
width: auto;
|
||||
padding: 5px 16px;
|
||||
margin-right: 12px;
|
||||
margin-top: 8px;
|
||||
background: rgba(0, 100, 250, 0.08);
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
color: @primary-color;
|
||||
white-space: nowrap;
|
||||
/deep/ .anticon {
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="components-input-demo-presuffix">
|
||||
<div class="user-organ-wrap">
|
||||
<a-input class="user-input" @click="openModal" :placeholder="placeholder" v-model="nameStr" :title="nameStr" readOnly>
|
||||
<a-icon v-if="nameStr" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
|
||||
</a-input>
|
||||
<a-button type="primary" class="button-box" @click="openModal" :disabled="disabled" v-if="showBtn && !disabled">
|
||||
{{ $t('select') }}
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
<tree-data-select-modal
|
||||
ref="selectModal"
|
||||
:checkable="checkable"
|
||||
:value="value"
|
||||
:dict-id="dictId"
|
||||
v-bind="$attrs"
|
||||
:options-href="optionsHref"
|
||||
@change="handleChange"
|
||||
@nameChange="nameChange"
|
||||
@listChange="listChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeDataSelectModal from './TreeDataSelectModal'
|
||||
|
||||
export default {
|
||||
name: 'TreeDataSelection',
|
||||
components: { TreeDataSelectModal },
|
||||
props: {
|
||||
checkable: { // 是否多选
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 获取数据的接口
|
||||
optionsHref: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
// 名称字符串
|
||||
nameStr: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
fieldName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
dictId: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
showBtn: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
nameStr: {
|
||||
immediate: true,
|
||||
handler (val) {
|
||||
console.log('----------nameStr', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
confirmLoading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openModal () {
|
||||
this.$refs.selectModal.show()
|
||||
},
|
||||
handleChange (value) {
|
||||
this.$emit('change', value, this.fieldName)
|
||||
},
|
||||
nameChange (value) {
|
||||
this.$emit('nameChange', value, this.fieldName)
|
||||
},
|
||||
listChange (value) {
|
||||
this.$emit('listChange', value, this.fieldName)
|
||||
},
|
||||
handleEmpty () {
|
||||
if (this.disabled) {
|
||||
return
|
||||
}
|
||||
this.handleChange('')
|
||||
this.nameChange('')
|
||||
this.listChange([])
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.user-organ-wrap {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
//height: 39.98px;
|
||||
|
||||
.user-input {
|
||||
resize: none;
|
||||
width: calc(100% - 70px);
|
||||
}
|
||||
|
||||
// 因为需要加title,所以不能把鼠标事件去掉
|
||||
/deep/ .ant-input-disabled {
|
||||
background: #fff;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.button-box {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
deep: true,
|
||||
handler (val) {
|
||||
console.log(this.currentQueryAllData)
|
||||
const arrOne = this.currentQueryAllData.map(item => item.id)
|
||||
const arrOne = this.currentQueryAllData
|
||||
const arrTwo = this.dataSourceRight.map(item => item.id)
|
||||
const temp = []
|
||||
for (const item of arrTwo) {
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
deep: true,
|
||||
handler (val) {
|
||||
console.log(this.currentQueryAllData)
|
||||
const arrOne = this.currentQueryAllData.map(item => item.id)
|
||||
const arrOne = this.currentQueryAllData
|
||||
const arrTwo = this.dataSourceRight.map(item => item.id)
|
||||
const temp = []
|
||||
for (const item of arrTwo) {
|
||||
@@ -240,7 +240,8 @@ export default {
|
||||
isCheckedAll: false, // 是否选中所有
|
||||
url: {
|
||||
userList: '/sys/user/page',
|
||||
userListByIds: '/sys/user/queryByIds'
|
||||
userListByIds: '/sys/user/queryByIds',
|
||||
queryList: '/sys/user/list'
|
||||
},
|
||||
isClickedSearch: false, // 改完搜索条件是否点击过搜索
|
||||
oldQueryParam: {}, // 上一次的搜索条件,用于从一个搜索条件改成另一个搜索条件,但是没有点搜索,这时候全选时传旧的搜索条件
|
||||
@@ -298,7 +299,7 @@ export default {
|
||||
this.checkCurrentAll()
|
||||
} else {
|
||||
const field = 'id'
|
||||
this.dataSourceRight = this.dataSourceRight.filter(item => !this.currentQueryAllData.some(i => i[field] === item[field]))
|
||||
this.dataSourceRight = this.dataSourceRight.filter(item => !this.currentQueryAllData.some(i => i === item[field]))
|
||||
this.selectedRowKeys = JSON.parse(JSON.stringify(this.dataSourceRight)).map(item => item[field])
|
||||
}
|
||||
},
|
||||
@@ -340,14 +341,14 @@ export default {
|
||||
// 获取当前查询条件的所有数据
|
||||
async getCurrentAllData () {
|
||||
const params = Object.assign({}, this.queryParam)
|
||||
params.pageNo = 1
|
||||
params.pageSize = 100000000
|
||||
// params.pageNo = 1
|
||||
// params.pageSize = 100000000
|
||||
params.field = 'id,avatar,username,realname,sex_dictText,phone,orgCodeTxt,roleTxt,status_dictText'
|
||||
params.column = 'createTime'
|
||||
params.order = 'desc'
|
||||
await getAction(this.url.userList, params).then(res => {
|
||||
await getAction(this.url.queryList, params).then(res => {
|
||||
if (res.success) {
|
||||
this.currentQueryAllData = res.result.records || []
|
||||
this.currentQueryAllData = res.result || []
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -544,4 +545,8 @@ export default {
|
||||
/deep/ .ant-form-item-label{
|
||||
min-width: 70px !important;
|
||||
}
|
||||
|
||||
/deep/ .ant-table-hide-scrollbar {
|
||||
margin-right: -8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
headers: '',
|
||||
previewImage: {},
|
||||
uploadFileFlag: 0,
|
||||
fileMaxSize: 500
|
||||
fileMaxSize: 20
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
// const fileTypes = this.accept.split('/')
|
||||
const fileNowTypes = file.type.split('/')
|
||||
// 修改判断方法 限制jpg\jpeg\png\gif 可以上传 其他不能上传。
|
||||
fileFlag = (['PNG', 'JPEG', 'PNG', 'GIF'].includes(fileNowTypes[1].toUpperCase()))
|
||||
fileFlag = (['PNG', 'JPEG', 'PNG'].includes(fileNowTypes[1].toUpperCase()))
|
||||
// console.log('filetype',fileFlag)
|
||||
if (!fileFlag) {
|
||||
this.$message.warning(this.$t('uploadFile.fileFormatIncorrect'))
|
||||
|
||||
@@ -62,6 +62,16 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 首次加载完所有语言包后,浅拷贝存备份(没有找到正常切换语言的api,暂时先这么处理)
|
||||
if (Object.keys(UE.I18N).length > 1) {
|
||||
window.__COPY_UE_I18N__ = { ...UE.I18N }
|
||||
}
|
||||
// 更新语言包(将备份语言包浅拷贝回来,只保留需要的一个需要的语言包)
|
||||
if (localStorage.getItem('language') === 'en-us') {
|
||||
UE.I18N = { en: window.__COPY_UE_I18N__.en }
|
||||
} else {
|
||||
UE.I18N = { ['zh-cn']: window.__COPY_UE_I18N__['zh-cn'] }
|
||||
}
|
||||
UEDITOR_CONFIG.UEDITOR_HOME_URL = '../../../public/ueditor/'
|
||||
// 初始化UE
|
||||
this.editor = UE.delEditor('editor')
|
||||
|
||||
Reference in New Issue
Block a user