[update] 调文档库的搜索,表头,新增

This commit is contained in:
lideqin
2023-08-25 17:53:44 +08:00
parent 59e68f795b
commit c4caed0e3f
9 changed files with 596 additions and 592 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ export default {
// 设置日期面板中选中日期的样式 // 设置日期面板中选中日期的样式
.blue { .blue {
background: #bae7ff !important; background: #ffd5d3 !important;
} }
// 设置输入框中的文字显示 // 设置输入框中的文字显示
+306 -337
View File
@@ -1,233 +1,213 @@
<template> <template>
<a-form-model :model="formInline" v-if="isFormInline" class="form-add" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" v-if="isFormInline" class="form-add" :rules="rules" ref="ruleForm">
<div v-for="(val,index) in dataList" :key="index"> <div v-for="(val,index) in dataList" :key="index">
<div v-for="(ol, index) in Object.keys(val)" :key="index"> <div v-if="val && val.length > 0" class="header-text">{{ index }}</div>
<div class="header-text"> <a-row v-if="val && val.length > 0" :gutter="24">
&nbsp;{{ol}} <div v-for="(item, index) in val" :key="index">
<!-- 1, 日期单选 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.DATE_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-model="formInline[item.dbFieldName]"
:disabled="disabled"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
<!-- 2, 单选用户 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.USER_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
type="radio"
selectType="user"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 3, 单选组织机构 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
selectType="organ"
type="radio"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 4, 日期多选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.DATE_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-multiple-date-picker class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 5, 多行文本 -->
<a-col :span="24" v-else-if="item.fieldShowType === FieldType.TEXTAREA.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model-textarea" :prop="item.dbFieldName">
<a-textarea
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"
:disabled="disabled"
:maxLength="500"
v-model="formInline[item.dbFieldName]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<!-- 6, 标准多选 -->
<a-col :span="24" v-else-if="item.fieldShowType === FieldType.STANDARD_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<standard-selection :query="item"
:disabled="disabled"
:standard="formInline"
@change="standardSelectionChange"
v-model="formInline[item.dbFieldName]"/>
</a-form-model-item>
</div>
</a-col>
<!-- 7, 多选组织机构 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
selectType="organ"
type="checkbox"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 8, 上传文件 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.FILE_UP.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.dbFieldName] === 'null' || formInline[item.dbFieldName] === ''
|| formInline[item.dbFieldName] === null || formInline[item.dbFieldName] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<!-- 9, 文本框 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.TEXT_BOX.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.dbFieldName]"
:maxLength="50"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"/>
</a-form-model-item>
</div>
</a-col>
<!-- 10, 下拉单选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-dict-select-tag class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<!-- 11, 下拉多选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-multi-select-tag class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<!-- 树选择 -->
<!-- <a-col :span="12" v-else-if="item.fieldShowType === FieldType.TREE.value">-->
<!-- <div class="box-title-text" :title="item.dbFieldTxt">-->
<!-- <div class="title-text">-->
<!-- <span class="required" v-if="item.fieldMustInput === '1'">*</span>-->
<!-- <span class="title-text-text">{{item.dbFieldTxt}}</span>-->
<!-- </div>-->
<!-- <a-form-model-item class="item-model" :prop="item.dbFieldName">-->
<!-- <a-tree-select-->
<!-- tree-node-filter-prop="title"-->
<!-- v-model="formInline[item.dbFieldName]"-->
<!-- :maxTagCount="1"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- style="width: 100%"-->
<!-- :tree-data="item.tree"-->
<!-- tree-checkable-->
<!-- :placeholder="$t('PleaseSelect')+item.dbFieldTxt"-->
<!-- />-->
<!-- </a-form-model-item>-->
<!-- </div>-->
<!-- </a-col>-->
</div> </div>
<a-row :gutter="24"> </a-row>
<div v-for="(item, index) in val[ol]" :key="index">
<a-col :span="12" v-if="item.field_show_type === FieldType.TEXT_STRING.value || item.field_show_type === FieldType.TEXT_LINK.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]"
:maxLength="50"
:placeholder="$t('pleaseEnter')+item.db_field_txt"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.TEXT_NUMBER.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-input-number class="box-input"
:placeholder="$t('pleaseEnter')+item.db_field_txt"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.PULL_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.PULL_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.DATE_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
@change="dateChange(item)"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
v-model="formInline[item.db_field_name]"
:disabled="disabled"
style="width: 100%"/>
<!-- :disabledDate="disabledDate"-->
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.DATE_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:getCalendarContainer="(trigger) => trigger.parentNode"
@change="onChange(item.db_field_name)"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.FILE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === ''
|| formInline[item.db_field_name] === null || formInline[item.db_field_name] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.TEXT.value || item.field_show_type === 'text'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-textarea" :prop="item.db_field_name">
<a-textarea
:placeholder="$t('pleaseEnter')+item.db_field_txt"
:disabled="disabled"
:maxLength="500"
v-model="formInline[item.db_field_name]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.PERSON.value || item.field_show_type == 'sel_user'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<personnel-selection :query="item"
v-if="isFormInline"
:personneQuery="formInline"
@change="personnelSelectionChange"
:disabled="disabled"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.STANDARD.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<standard-selection :query="item"
:disabled="disabled"
:standard="formInline"
@change="standardSelectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<j-dict-select-tag v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.TREE.value">
<div class="box-title-text" :title="item.db_field_txt">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline[item.db_field_name]"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:tree-data="item.tree"
tree-checkable
:placeholder="$t('PleaseSelect')+item.db_field_txt"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
</div>
</div> </div>
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file> <upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
</a-form-model> </a-form-model>
@@ -240,11 +220,14 @@ import JMultiSelectTag from '../dict/JMultiSelectTag'
import UploadFile from '../UploadFile' import UploadFile from '../UploadFile'
// 选择标准选择器 // 选择标准选择器
import StandardSelection from '../selection/StandardSelection' import StandardSelection from '../selection/StandardSelection'
// 选择用户或组织机构
import UserOrOrganSelection from '../selection/UserOrOrganSelection'
import { FieldType } from '../../enums/commonEnums' import { FieldType } from '../../enums/commonEnums'
import JMultipleDatePicker from '../JMultipleDatePicker'
export default { export default {
name: 'AddForm', name: 'AddForm',
components: { StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile }, components: { JMultipleDatePicker, StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile, UserOrOrganSelection },
props: { props: {
url: { url: {
type: Object, type: Object,
@@ -285,81 +268,81 @@ export default {
add () { add () {
this.formInline = {} this.formInline = {}
this.type = 'add' this.type = 'add'
// this.getForm() this.getForm()
this.dataList = [ // this.dataList = [
{ // {
基本信息: [ // 基本信息: [
{ // {
area: '基本信息', // area: '基本信息',
db_field_name: 'serial_number', // dbFieldName: 'serial_number',
db_field_txt: '编号', // dbFieldTxt: '编号',
db_length: 200, // db_length: 200,
dict_field: '', // dict_field: '',
field_must_input: '1', // fieldMustInput: '1',
field_show_type: '1', // fieldShowType: '1',
tree: [] // tree: []
}, // },
{ // {
area: '基本信息', // area: '基本信息',
db_field_name: 'state', // dbFieldName: 'state',
db_field_txt: '状态', // dbFieldTxt: '状态',
db_length: 36, // db_length: 36,
dict_field: 'state', // dict_field: 'state',
field_must_input: '1', // fieldMustInput: '1',
field_show_type: '3', // fieldShowType: '3',
tree: [] // tree: []
}, // },
{ // {
area: '基本信息', // area: '基本信息',
db_field_name: 'standard_system', // dbFieldName: 'standard_system',
db_field_txt: '标准体系', // dbFieldTxt: '标准体系',
db_length: 100, // db_length: 100,
dict_field: 'standard_system', // dict_field: 'standard_system',
field_must_input: '0', // fieldMustInput: '0',
field_show_type: '3', // fieldShowType: '3',
tree: [] // tree: []
}, // },
{ // {
area: '基本信息', // area: '基本信息',
db_field_name: 'corresponding_standard', // dbFieldName: 'corresponding_standard',
db_field_txt: '对应标准', // dbFieldTxt: '对应标准',
db_length: 200, // db_length: 200,
dict_field: '', // dict_field: '',
field_must_input: '0', // fieldMustInput: '0',
field_show_type: '10', // fieldShowType: '10',
tree: [] // tree: []
} // }
] // ]
}, // },
{ // {
文本信息: [ // 文本信息: [
{ // {
area: '文本信息', // area: '文本信息',
db_field_name: 'release_draft', // dbFieldName: 'release_draft',
db_field_txt: '发言稿(必读)', // dbFieldTxt: '发言稿(必读)',
db_length: 3000, // db_length: 3000,
dict_field: '', // dict_field: '',
field_must_input: '0', // fieldMustInput: '0',
field_show_type: '7', // fieldShowType: '7',
flag: 1, // flag: 1,
tree: [] // tree: []
}, // },
{ // {
area: '文本信息', // area: '文本信息',
db_field_name: 'release_draft', // dbFieldName: 'release_draft',
db_field_txt: '发言稿(必读)', // dbFieldTxt: '发言稿(必读)',
db_length: 3000, // db_length: 3000,
dict_field: '', // dict_field: '',
field_must_input: '0', // fieldMustInput: '0',
field_show_type: '7', // fieldShowType: '7',
flag: 1, // flag: 1,
tree: [] // tree: []
} // }
] // ]
} // }
] // ]
this.ruleList = this.dataList // this.ruleList = this.dataList
this.integrateData() // this.integrateData()
}, },
edit (item) { edit (item) {
this.type = 'edit' this.type = 'edit'
@@ -379,7 +362,7 @@ export default {
getForm (callBack) { getForm (callBack) {
this.confirmLoading = true this.confirmLoading = true
const params = { const params = {
flag: this.flag, module: this.flag,
type: this.type type: this.type
} }
getAction(this.url.getAddForm, params).then((res) => { getAction(this.url.getAddForm, params).then((res) => {
@@ -395,61 +378,52 @@ export default {
integrateData () { integrateData () {
this.isFormInline = false this.isFormInline = false
const ruleList = [] const ruleList = []
this.ruleList.forEach(res => { console.log(this.ruleList)
Object.keys(res).forEach(val => { for (const item in this.ruleList) {
res[val].forEach(ol => { this.ruleList[item].forEach(ol => {
ruleList.push(ol) ruleList.push(ol)
})
}) })
}) }
const rules = {} const rules = {}
ruleList.forEach((res, index) => { ruleList.forEach((res, index) => {
const rule = [] const rule = []
if (res.field_must_input === 1) { if (res.fieldMustInput === '1') {
if (res.field_show_type === '1') { if (res.fieldShowType === '1') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '4' || res.field_show_type === '6' || } else if (res.fieldShowType === '4' || res.fieldShowType === '6' ||
res.field_show_type === '5' || res.field_show_type === '7' res.fieldShowType === '5' || res.fieldShowType === '7'
) { ) {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} else if (res.field_show_type === '2') { } else if (res.fieldShowType === '2') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10' || res.field_show_type === '11') { } else if (res.fieldShowType === '8' || res.fieldShowType === '9' || res.fieldShowType === '10' || res.fieldShowType === '11') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '3') { } else if (res.fieldShowType === '3') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} }
} }
if (res.field_show_type === '1' || res.field_show_type === '8' || res.field_show_type === '9' ||
res.field_show_type === '10' || res.field_show_type === '11') {
rule.push({
max: res.db_length,
message: res.db_field_txt + this.$t('cannotExceed') + res.db_length + this.$t('characters'),
trigger: 'blur'
})
}
if (rule.length > 0) { if (rule.length > 0) {
rules[res.db_field_name] = rule rules[res.dbFieldName] = rule
} }
}) })
this.rules = rules this.rules = rules
@@ -458,8 +432,8 @@ export default {
}, },
// 点击点击上传按钮 // 点击点击上传按钮
clickButtonToUpload (item) { clickButtonToUpload (item) {
this.$refs.uploadFile.open(this.formInline[item.db_field_name]) this.$refs.uploadFile.open(this.formInline[item.dbFieldName])
this.uploadName = item.db_field_name this.uploadName = item.dbFieldName
}, },
// 文件上传改变后的回调 // 文件上传改变后的回调
uploadFileChange (data) { uploadFileChange (data) {
@@ -478,11 +452,6 @@ export default {
this.formInline[value + '_id'] = id this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
}, },
// 人员选择变化
personnelSelectionChange (value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
submit () { submit () {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
+163 -161
View File
@@ -4,57 +4,58 @@
<a-col :md="(24 / (minLength + 1))" :sm="(24 / minLength)" v-for="(item,index) in searchList" :key="index" style="line-height: 48px"> <a-col :md="(24 / (minLength + 1))" :sm="(24 / minLength)" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<template v-if="index < minLength"> <template v-if="index < minLength">
<!-- 树形选择器 --> <!-- 树形选择器 -->
<template v-if="item.field_show_type === FieldType.TREE.value"> <!-- <template v-if="item.fieldShowType === FieldType.TREE.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<a-tree-select <!-- <a-tree-select-->
tree-node-filter-prop="title" <!-- tree-node-filter-prop="title"-->
v-model="queryParam[item.db_field_name]" <!-- v-model="queryParam[item.dbFieldName]"-->
:maxTagCount="1" <!-- :maxTagCount="1"-->
:getPopupContainer="triggerNode=> triggerNode.parentNode" <!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
:tree-data="item.tree" <!-- :tree-data="item.tree"-->
tree-checkable <!-- tree-checkable-->
:placeholder="$t('pleaseSelect')+item.db_field_txt" <!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
/> <!-- />-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 输入框 --> <!-- 输入框 -->
<template <template
v-else-if="[FieldType.TEXT_STRING.value, FieldType.TEXT.value,FieldType.PERSON.value, v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
FieldType.STANDARD.value, FieldType.TEXT_LINK.value].includes(item.field_show_type)"> FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value]
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> .includes(item.fieldShowType)">
<a-input :placeholder="$t('pleaseEnter')+item.db_field_txt" <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
v-model="queryParam[item.db_field_name]"></a-input> <a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
v-model="queryParam[item.dbFieldName]"></a-input>
</a-form-item> </a-form-item>
</template> </template>
<!-- 数字输入框 --> <!-- 数字输入框 -->
<template v-else-if="item.field_show_type === FieldType.TEXT_NUMBER.value"> <!-- <template v-else-if="item.fieldShowType === FieldType.TEXT_NUMBER.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<a-input-number :placeholder="$t('pleaseEnter')+item.db_field_txt" <!-- <a-input-number :placeholder="$t('pleaseEnter')+item.dbFieldTxt"-->
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/> <!-- v-model="queryParam[item.dbFieldName]" :min="1" :max="99999999"/>-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 字典多选框 --> <!-- 字典多选框 -->
<template v-else-if="item.field_show_type === FieldType.PULL_MORE.value"> <!-- <template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<j-multi-select-tag v-model="queryParam[item.db_field_name]" <!-- <j-multi-select-tag v-model="queryParam[item.dbFieldName]"-->
:placeholder="$t('pleaseSelect')+item.db_field_txt" :type="'select'" <!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt" :type="'select'"-->
:triggerChange="false" :dictCode="item.dict_field"/> <!-- :triggerChange="false" :dictCode="item.dict_field"/>-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 日期区间 --> <!-- 日期区间 -->
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.field_show_type)"> <template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker v-model="queryParam[item.db_field_name]" <a-range-picker v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.db_field_txt" :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
format="YYYY-MM-DD" value-format="YYYY-MM-DD" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="onChange(item.db_field_name)"></a-range-picker> @change="onChange(item.dbFieldName)"></a-range-picker>
</a-form-item> </a-form-item>
</template> </template>
<!-- 字典单选框 --> <!-- 字典单选框 -->
<template v-else-if="item.field_show_type === FieldType.PULL_SINGLE.value"> <template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value || item.fieldShowType === FieldType.OPTION_MORE.value">
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam[item.db_field_name]" <j-dict-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.db_field_txt" :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-item> </a-form-item>
@@ -63,55 +64,56 @@
<template v-if="index >= minLength && toggleSearchStatus"> <template v-if="index >= minLength && toggleSearchStatus">
<!-- 树形选择器 --> <!-- 树形选择器 -->
<template v-if="item.field_show_type === FieldType.TREE.value"> <!-- <template v-if="item.fieldShowType === FieldType.TREE.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<a-tree-select <!-- <a-tree-select-->
tree-node-filter-prop="title" <!-- tree-node-filter-prop="title"-->
v-model="queryParam[item.db_field_name]" <!-- v-model="queryParam[item.dbFieldName]"-->
:maxTagCount="1" <!-- :maxTagCount="1"-->
:getPopupContainer="triggerNode=> triggerNode.parentNode" <!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
:tree-data="item.tree" <!-- :tree-data="item.tree"-->
tree-checkable <!-- tree-checkable-->
:placeholder="$t('pleaseSelect')+item.db_field_txt" <!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
/> <!-- />-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 输入框 --> <!-- 输入框 -->
<template v-else-if="[FieldType.TEXT_STRING.value, FieldType.TEXT.value,FieldType.PERSON.value, <template v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
FieldType.STANDARD.value, FieldType.TEXT_LINK.value].includes(item.field_show_type)"> FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value]
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> .includes(item.fieldShowType)">
<a-input :placeholder="$t('pleaseEnter')+item.db_field_txt" <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
v-model="queryParam[item.db_field_name]"></a-input> <a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
v-model="queryParam[item.dbFieldName]"></a-input>
</a-form-item> </a-form-item>
</template> </template>
<!-- 数字输入框 --> <!-- 数字输入框 -->
<template v-else-if="item.field_show_type === FieldType.TEXT_NUMBER.value"> <!-- <template v-else-if="item.fieldShowType === FieldType.TEXT_NUMBER.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<a-input-number :placeholder="$t('pleaseEnter')+item.db_field_txt" <!-- <a-input-number :placeholder="$t('pleaseEnter')+item.dbFieldTxt"-->
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/> <!-- v-model="queryParam[item.dbFieldName]" :min="1" :max="99999999"/>-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 字典多选框 --> <!-- 字典多选框 -->
<template v-else-if="item.field_show_type === FieldType.PULL_MORE.value"> <!-- <template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">-->
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<j-multi-select-tag v-model="queryParam[item.db_field_name]" <!-- <j-multi-select-tag v-model="queryParam[item.dbFieldName]"-->
:placeholder="$t('pleaseSelect')+item.db_field_txt" :type="'select'" <!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt" :type="'select'"-->
:triggerChange="false" :dictCode="item.dict_field"/> <!-- :triggerChange="false" :dictCode="item.dict_field"/>-->
</a-form-item> <!-- </a-form-item>-->
</template> <!-- </template>-->
<!-- 日期区间选择器 --> <!-- 日期区间选择器 -->
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.field_show_type)"> <template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker v-model="queryParam[item.db_field_name]" <a-range-picker v-model="queryParam[item.dbFieldName]"
format="YYYY-MM-DD" value-format="YYYY-MM-DD" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="onChange(item.db_field_name)"></a-range-picker> @change="onChange(item.dbFieldName)"></a-range-picker>
</a-form-item> </a-form-item>
</template> </template>
<!-- 字典选择器 --> <!-- 字典选择器 -->
<template v-else-if="item.field_show_type === FieldType.PULL_SINGLE.value"> <template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value || item.fieldShowType === FieldType.OPTION_MORE.value">
<a-form-item :label="item.db_field_txt" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam[item.db_field_name]" <j-dict-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.db_field_txt" :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-item> </a-form-item>
@@ -134,13 +136,13 @@
<script> <script>
import JDictSelectTag from '../dict/JDictSelectTag' import JDictSelectTag from '../dict/JDictSelectTag'
import JMultiSelectTag from '../dict/JMultiSelectTag'
import { FieldType } from '../../enums/commonEnums' import { FieldType } from '../../enums/commonEnums'
import eventBus from '@/common/event' import eventBus from '@/common/event'
import { getAction } from '@/api/manage'
export default { export default {
name: 'Search', name: 'Search',
components: { JDictSelectTag, JMultiSelectTag }, components: { JDictSelectTag },
props: { props: {
url: { url: {
type: Object, type: Object,
@@ -178,65 +180,65 @@ export default {
} }
}, },
mounted () { mounted () {
// this.getSearch() this.getSearch()
this.searchList = [ // this.searchList = [
{ // {
db_field_name: 'serial_number', // dbFieldName: 'serial_number',
db_field_txt: '编号', // dbFieldTxt: '编号',
dict_field: '', // dict_field: '',
field_show_type: '1', // fieldShowType: '1',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'title', // dbFieldName: 'title',
db_field_txt: '标题', // dbFieldTxt: '标题',
dict_field: '', // dict_field: '',
field_show_type: '1', // fieldShowType: '1',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'state', // dbFieldName: 'state',
db_field_txt: '状态', // dbFieldTxt: '状态',
dict_field: 'state', // dict_field: 'state',
field_show_type: '3', // fieldShowType: '3',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'region', // dbFieldName: 'region',
db_field_txt: '适用地区', // dbFieldTxt: '适用地区',
dict_field: 'region', // dict_field: 'region',
field_show_type: '4', // fieldShowType: '4',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'technology_territory', // dbFieldName: 'technology_territory',
db_field_txt: '技术领域', // dbFieldTxt: '技术领域',
dict_field: 'technology_territory', // dict_field: 'technology_territory',
field_show_type: '0', // fieldShowType: '0',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'issue_time', // dbFieldName: 'issue_time',
db_field_txt: '发布日期', // dbFieldTxt: '发布日期',
dict_field: '', // dict_field: '',
field_show_type: '5', // fieldShowType: '5',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'xin1_che1_xing2_shi2_shi1_ri4_qi1', // dbFieldName: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
db_field_txt: '新车型实施日期', // dbFieldTxt: '新车型实施日期',
dict_field: '', // dict_field: '',
field_show_type: '5', // fieldShowType: '5',
tree: [] // tree: []
}, // },
{ // {
db_field_name: 'implement_time', // dbFieldName: 'implement_time',
db_field_txt: '在产车实施日期', // dbFieldTxt: '在产车实施日期',
dict_field: '', // dict_field: '',
field_show_type: '5', // fieldShowType: '5',
tree: [] // tree: []
} // }
] // ]
}, },
methods: { methods: {
searchQuery () { searchQuery () {
@@ -251,28 +253,28 @@ export default {
// 获取查询条件列表 // 获取查询条件列表
getSearch () { getSearch () {
const params = { const params = {
flag: this.flag module: this.flag
} }
// getAction(this.url.getSearchList, params).then((res) => { getAction(this.url.getSearchList, params).then((res) => {
// if (res.success) { if (res.success) {
// this.searchList = res.result this.searchList = res.result
// // if (this.searchQueryList && this.searchQueryList.length > 0) { // if (this.searchQueryList && this.searchQueryList.length > 0) {
// // for (let i = 0; i < this.searchList.length; i++) { // for (let i = 0; i < this.searchList.length; i++) {
// // // 是要去掉这个字段的搜索?? // // 是要去掉这个字段的搜索??
// // if (this.searchList[i].db_field_name === 'issue_time') { // if (this.searchList[i].db_field_name === 'issue_time') {
// // this.searchList.splice(i, 1) // this.searchList.splice(i, 1)
// // i-- // i--
// // } // }
// // // db_field_name 说明可以被代替位置?? // // db_field_name 说明可以被代替位置??
// // if (this.searchList[i].db_field_name === 'title') { // if (this.searchList[i].db_field_name === 'title') {
// // const data = this.searchList[i + 1] // const data = this.searchList[i + 1]
// // this.searchList[i + 1] = this.searchQueryList[0] // this.searchList[i + 1] = this.searchQueryList[0]
// // this.searchList.push(data) // this.searchList.push(data)
// // } // }
// // } // }
// // } // }
// } }
// }) })
}, },
onChange (item) { onChange (item) {
if (this.queryParam[item] && this.queryParam[item].length > 0) { if (this.queryParam[item] && this.queryParam[item].length > 0) {
@@ -1,9 +1,9 @@
<template> <template>
<div> <div>
<div class="box-title-text"> <div class="box-title-text">
<a-input class="box-input" :value="value" :title="value" @input="indexClick($event)" <a-input class="box-input" :value="value" :title="value" @click="standardClick"
:disabled="isDisabled" :disabled="isDisabled" readonly
:placeholder="!isDisabled?$t('pleaseEnterOrSelect')+query.db_field_txt:query.db_field_txt"/> :placeholder="!isDisabled?$t('pleaseSelect')+query.dbFieldTxt:query.dbFieldTxt"/>
<a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick"> <a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick">
{{this.$t('standardSelect.standardSelection')}} {{this.$t('standardSelect.standardSelection')}}
</a-button> </a-button>
@@ -153,17 +153,17 @@ export default {
serialNumber.push(res.serial_number) serialNumber.push(res.serial_number)
replaceStandardId.push(res.id) replaceStandardId.push(res.id)
}) })
this.$emit('input', serialNumber.join(',')) // this.$emit('input', serialNumber.join(','))
this.$emit('change', this.query.db_field_name, replaceStandardId.join(',')) this.$emit('change', this.query.dbFieldName, replaceStandardId.join(','))
// this.$emit('changecontent', this.content) // this.$emit('changecontent', this.content)
this.visible = false this.visible = false
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
indexClick (event) { // indexClick (event) {
this.$emit('input', event.target.value) // this.$emit('input', event.target.value)
}, // },
onSelectChange (value, row) { onSelectChange (value, row) {
this.selectedRowKeys = value this.selectedRowKeys = value
this.selectedRowList = row this.selectedRowList = row
@@ -8,7 +8,7 @@
{{this.$t('userOrOrganSelect.select')}} {{this.$t('userOrOrganSelect.select')}}
</a-button> </a-button>
</div> </div>
<user-organ-select-modal ref="selectModal" :selectType="selectType" @change="selectChange"></user-organ-select-modal> <user-organ-select-modal v-bind="$attrs" ref="selectModal" :selectType="selectType" @change="selectChange"></user-organ-select-modal>
</div> </div>
</template> </template>
@@ -27,6 +27,10 @@ export default {
type: String, type: String,
default: 'all' default: 'all'
}, },
placeholder: {
type: String,
default: ''
},
value: { value: {
type: Object, type: Object,
default: () => { default: () => {
@@ -37,6 +41,9 @@ export default {
} }
} }
}, },
mounted () {
console.log(this.type)
},
data () { data () {
return { return {
selectValue: [] selectValue: []
@@ -52,7 +59,12 @@ export default {
} else { } else {
this.selectValue = arrOne this.selectValue = arrOne
} }
this.$emit('change', this.selectType)
} }
},
model: {
prop: 'value',
event: 'change'
} }
} }
</script> </script>
@@ -62,10 +62,10 @@
<div class="modal-content-title-div"> <div class="modal-content-title-div">
<p class="modal-content-title">选择</p> <p class="modal-content-title">选择</p>
<div class="table-operator-tab"> <div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'organ' ? 'table-operator-tab-active' : ''" <a v-if="selectType === 'all' || selectType === 'organ'" class="switch-item" :class="switchValue === 'organ' ? 'table-operator-tab-active' : ''"
@click="switchChange('organ')">组织机构 @click="switchChange('organ')">组织机构
</a> </a>
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''" <a v-if="selectType === 'all' || selectType === 'user'" class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">用户列表 @click="switchChange('user')">用户列表
</a> </a>
</div> </div>
@@ -78,7 +78,7 @@
:scroll="{x: 500}" :scroll="{x: 500}"
:data-source="dataSourceOrgan" :data-source="dataSourceOrgan"
:pagination="ipaginationOrgan" :pagination="ipaginationOrgan"
:row-selection="{ selectedRowKeys: selectedRowKeysOrgan, onChange: onSelectChangeOrgan, getCheckboxProps: getCheckboxPropsOrgan }" :row-selection="{ selectedRowKeys: selectedRowKeysOrgan, onChange: onSelectChangeOrgan, getCheckboxProps: getCheckboxPropsOrgan, type: type }"
:loading="loadingLeft" :loading="loadingLeft"
@change="organLeftTableChange"> @change="organLeftTableChange">
</a-table> </a-table>
@@ -90,7 +90,7 @@
:scroll="{x: 500}" :scroll="{x: 500}"
:data-source="dataSourceUser" :data-source="dataSourceUser"
:pagination="ipaginationUser" :pagination="ipaginationUser"
:row-selection="{ selectedRowKeys: selectedRowKeysUser, onChange: onSelectChangeUser, getCheckboxProps: getCheckboxPropsUser }" :row-selection="{ selectedRowKeys: selectedRowKeysUser, onChange: onSelectChangeUser, getCheckboxProps: getCheckboxPropsUser, type: type }"
:loading="loadingLeft" :loading="loadingLeft"
@change="userLeftTableChange"> @change="userLeftTableChange">
</a-table> </a-table>
@@ -139,6 +139,10 @@ export default {
type: String, type: String,
default: 'all' default: 'all'
}, },
type: { // 是单选还是多选
type: String,
default: 'radio'
},
value: { value: {
type: Object, type: Object,
default: () => { default: () => {
@@ -154,30 +158,45 @@ export default {
immediate: true, immediate: true,
handler (val) { handler (val) {
if (this.selectType === 'all') { if (this.selectType === 'all') {
if (val.organ) { if (val.organ && val.organ.length > 0) {
this.loadOrganRight(val.organ, () => { this.dataSourceOrganRight = val.organ
if (val.user) { this.selectedRowKeysOrgan = val.organ.map(item => item.id)
this.loadUserRight(val.user, () => {
this.$emit('change', this.dataSourceOrganRight, this.dataSourceUserRight)
})
} else {
this.$emit('change', this.dataSourceOrganRight, [])
}
})
} else {
this.loadUserRight(val.user, () => {
this.$emit('change', [], this.dataSourceUserRight)
})
} }
} else if (this.selectType === 'organ') { if (val.user && val.user.length > 0) {
this.loadOrganRight(val.organ, () => { this.dataSourceUserRight = val.user
this.$emit('change', this.dataSourceOrganRight) this.selectedRowKeysUser = val.user.map(item => item.id)
}) }
} else if (this.selectType === 'user') { } else if (this.selectType === 'organ' && val.organ && val.organ.length > 0) {
this.loadUserRight(val.user, () => { this.dataSourceOrganRight = val.organ
this.$emit('change', this.dataSourceUserRight) this.selectedRowKeysOrgan = val.organ.map(item => item.id)
}) } else if (this.selectType === 'user' && val.user && val.user.length > 0) {
this.dataSourceUserRight = val.user
this.selectedRowKeysUser = val.user.map(item => item.id)
} }
// if (val.organ) {
// this.loadOrganRight(val.organ, () => {
// if (val.user) {
// this.loadUserRight(val.user, () => {
// this.$emit('change', this.dataSourceOrganRight, this.dataSourceUserRight)
// })
// } else {
// this.$emit('change', this.dataSourceOrganRight, [])
// }
// })
// } else {
// this.loadUserRight(val.user, () => {
// this.$emit('change', [], this.dataSourceUserRight)
// })
// }
// } else if (this.selectType === 'organ') {
// this.loadOrganRight(val.organ, () => {
// this.$emit('change', this.dataSourceOrganRight)
// })
// } else if (this.selectType === 'user') {
// this.loadUserRight(val.user, () => {
// this.$emit('change', this.dataSourceUserRight)
// })
// }
} }
} }
}, },
@@ -299,13 +318,19 @@ export default {
], ],
dataSourceUserRight: [], dataSourceUserRight: [],
url: { url: {
organList: '', organList: '/sys/sysDepart/queryTreeList',
userList: '/sys/user/page' userList: '/sys/user/page'
} }
} }
}, },
created () { mounted () {
this.loadDataOrgan() if (this.selectType === 'all' || this.selectType === 'organ') {
this.switchValue = 'organ'
this.loadDataOrgan()
} else {
this.switchValue = 'user'
this.loadDataUser()
}
}, },
methods: { methods: {
open () { open () {
@@ -348,12 +373,12 @@ export default {
this.loadingLeft = true this.loadingLeft = true
getAction(this.url.organList, params).then((res) => { getAction(this.url.organList, params).then((res) => {
if (res.success) { if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) { if (res.result.current > 1 && res.result.length === 0) {
this.ipaginationOrgan.current = res.result.current - 1 this.ipaginationOrgan.current = res.result.current - 1
this.loadDataOrgan() this.loadDataOrgan()
return return
} }
this.dataSourceOrgan = res.result.records || [] this.dataSourceOrgan = res.result || []
this.ipaginationOrgan.total = res.result.total this.ipaginationOrgan.total = res.result.total
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
@@ -385,19 +410,19 @@ export default {
this.selectedRowKeysOrgan = this.selectedRowKeysOrgan.filter(item => item === record.id) this.selectedRowKeysOrgan = this.selectedRowKeysOrgan.filter(item => item === record.id)
}, },
// 组织机构初始化右侧树列表 // 组织机构初始化右侧树列表
loadOrganRight (ids, callback) { // loadOrganRight (ids, callback) {
this.loadingRight = true // this.loadingRight = true
getAction(this.url.organList, { ids: ids }).then((res) => { // getAction(this.url.organList, { ids: ids }).then((res) => {
if (res.success) { // if (res.success) {
this.dataSourceOrganRight = res.result.records || [] // this.dataSourceOrganRight = res.result.records || []
callback && callback() // callback && callback()
} else { // } else {
this.$message.warn(res.message) // this.$message.warn(res.message)
} // }
}).finally(() => { // }).finally(() => {
this.loadingRight = false // this.loadingRight = false
}) // })
}, // },
/** /**
* 用户相关方法 * 用户相关方法
*/ */
@@ -453,19 +478,19 @@ export default {
this.selectedRowKeysUser = this.selectedRowKeysUser.filter(item => item === record.id) this.selectedRowKeysUser = this.selectedRowKeysUser.filter(item => item === record.id)
}, },
// 用户初始化右侧树列表 // 用户初始化右侧树列表
loadUserRight (ids, callback) { // loadUserRight (ids, callback) {
this.loadingRight = true // this.loadingRight = true
getAction(this.url.userList, { ids: ids }).then((res) => { // getAction(this.url.userList, { ids: ids }).then((res) => {
if (res.success) { // if (res.success) {
this.dataSourceUserRight = res.result.records || [] // this.dataSourceUserRight = res.result.records || []
callback && callback() // callback && callback()
} else { // } else {
this.$message.warn(res.message) // this.$message.warn(res.message)
} // }
}).finally(() => { // }).finally(() => {
this.loadingRight = false // this.loadingRight = false
}) // })
}, // },
handleOk () { handleOk () {
if (this.selectType === 'all') { if (this.selectType === 'all') {
this.$emit('change', this.dataSourceOrganRight, this.dataSourceUserRight) this.$emit('change', this.dataSourceOrganRight, this.dataSourceUserRight)
@@ -487,10 +512,6 @@ export default {
this.selectedRowKeysOrgan = [] this.selectedRowKeysOrgan = []
this.selectedRowKeysUser = [] this.selectedRowKeysUser = []
} }
},
model: {
prop: 'value',
event: 'change'
} }
} }
</script> </script>
+11 -12
View File
@@ -8,18 +8,17 @@ export const YesOrNoEnum = new EsEnums({
// 既可以使用EsEnums 也可以单独写明 // 既可以使用EsEnums 也可以单独写明
export const FieldType = { export const FieldType = {
TREE: { text: '树形结构', value: '0' }, DATE_SINGLE: { text: '单日期选择', value: '1' },
TEXT_STRING: { text: '输入框(字符串)', value: '1' }, USER_SINGLE: { text: '单选用户弹框', value: '2' },
TEXT_NUMBER: { text: '输入框(数字)', value: '2' }, ORGAN_SINGLE: { text: '单选组织机构弹框', value: '3' },
PULL_SINGLE: { text: '单选下拉框', value: '3' }, DATE_MORE: { text: '多日期选择', value: '4' },
PULL_MORE: { text: '多选下拉框', value: '4' }, TEXTAREA: { text: '多行文本', value: '5' },
DATE_SINGLE: { text: '单日期选择', value: '5' }, STANDARD_MORE: { text: '多选标准弹框', value: '6' },
DATE_MORE: { text: '多日期选择', value: '6' }, ORGAN_MORE: { text: '多选组织机构弹框', value: '7' },
FILE: { text: '文件', value: '7' }, FILE_UP: { text: '上传文件', value: '8' },
TEXT: { text: '文本框', value: '8' }, TEXT_BOX: { text: '文本框', value: '9' },
PERSON: { text: '人员选择', value: '9' }, OPTION_SINGLE: { text: '下拉单选', value: '10' },
STANDARD: { text: '标准选择', value: '10' }, OPTION_MORE: { text: '下拉多选', value: '11' }
TEXT_LINK: { text: '输入框(链接)', value: '11' }
} }
export const TagsTypeEnums = new EsEnums({ export const TagsTypeEnums = new EsEnums({
+6 -5
View File
@@ -3,6 +3,7 @@
*/ */
import { getAction, postAction } from '@api/manage' import { getAction, postAction } from '@api/manage'
import { isHasPermission } from '../utils/hasPermission' import { isHasPermission } from '../utils/hasPermission'
import { getTableHeader } from '@api/api'
// 模拟接口返回的表头数据 // 模拟接口返回的表头数据
const TempApiReturnColumns = [ const TempApiReturnColumns = [
@@ -57,7 +58,7 @@ export const ConfigurableTableMixin = {
fixed: 'right', fixed: 'right',
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
}, },
type: '', // 这个字段不知道什么含义 // type: '', // 这个字段不知道什么含义
filters: {}, // 固定的搜索条件 filters: {}, // 固定的搜索条件
needFilterTableBtn: true // 是否需要过滤没有权限的按钮 needFilterTableBtn: true // 是否需要过滤没有权限的按钮
} }
@@ -99,7 +100,7 @@ export const ConfigurableTableMixin = {
this.columns = this.dealColumns(TempApiReturnColumns) this.columns = this.dealColumns(TempApiReturnColumns)
return return
} }
const params = { flag: this.flag } const params = { module: this.flag }
getAction(this.url.tableHeader, params).then(res => { getAction(this.url.tableHeader, params).then(res => {
if (res.success) { if (res.success) {
this.columns = this.dealColumns(res.result || []) this.columns = this.dealColumns(res.result || [])
@@ -131,8 +132,8 @@ export const ConfigurableTableMixin = {
// 是否可排序 // 是否可排序
item.sorter = item.sort === 'true' item.sorter = item.sort === 'true'
item.width = 215 item.width = 215
item.title = item.db_field_txt item.title = item.dbFieldTxt
item.dataIndex = item.db_field_name item.dataIndex = item.dbFieldName
item.align = 'left' item.align = 'left'
tempColumns.push(item) tempColumns.push(item)
}) })
@@ -170,7 +171,7 @@ export const ConfigurableTableMixin = {
...this.searchParams, ...this.searchParams,
orderBy: this.orderBy, orderBy: this.orderBy,
orderByField: this.orderByField, orderByField: this.orderByField,
type: this.type, module: this.flag,
pageNo: pageNo, pageNo: pageNo,
pageSize: pageSize pageSize: pageSize
} }
+6 -6
View File
@@ -1,7 +1,7 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<search ref="searchRef" :flag="'1'" :url="url" @search="searchQuery" @reset="searchReset" /> <search ref="searchRef" :flag="flag" :url="url" @search="searchQuery" @reset="searchReset" />
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleBatchDel"> <div class="operator-text" @click="handleBatchDel">
@@ -135,6 +135,7 @@ export default {
mixins: [ConfigurableTableMixin], mixins: [ConfigurableTableMixin],
data () { data () {
return { return {
flag: '1',
operationList: [ operationList: [
{ {
text: this.$t('docLibrary.cancelCollection'), text: this.$t('docLibrary.cancelCollection'),
@@ -162,11 +163,10 @@ export default {
tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) }, tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
// url传参严格按照当前命名 // url传参严格按照当前命名
url: { url: {
// tableHeader: '/document/bussDocumentLibraryEO/getHeader', // 表格头部字段 tableHeader: '/laws/common/getCommonHeader', // 表格头部字段
tableHeader: '', // 表格头部字段 getSearchList: '/laws/common/getQueryCondition', // 搜索字段
getSearchList: '/document/bussDocumentLibraryEO/queryCondition', // 搜索字段 list: '/laws/common/getCommonPage', // 表格数据
list: 'document/bussDocumentLibraryEO/queryPageInfo', // 表格数据 getAddForm: '/laws/common/getFormModel', // 表单的字段
getAddForm: 'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
addInfo: 'document/bussDocumentLibraryEO/addInfo', // 新增 addInfo: 'document/bussDocumentLibraryEO/addInfo', // 新增
updateInfo: 'document/bussDocumentLibraryEO/updateInfo', // 编辑 updateInfo: 'document/bussDocumentLibraryEO/updateInfo', // 编辑
getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', // 查看 getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', // 查看