修改:文档库的增加数据;

This commit is contained in:
qq787203167
2022-02-12 17:04:11 +08:00
parent cf41526bd2
commit 73eaa05cd6
6 changed files with 389 additions and 298 deletions
+209 -265
View File
@@ -8,162 +8,175 @@
</div> </div>
<a-row :gutter="24" v-if="isDisplayType"> <a-row :gutter="24" v-if="isDisplayType">
<div v-for="item in val.content"> <div v-for="item in val.content">
<a-col :span="12" v-if="item.type === 'INPUT'"> <a-col :span="12" v-if="item.field_show_type === 'text'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input class="box-input" v-model="formInline[item.attrModel]" :placeholder="item.placeholder"/> <a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]"
:placeholder="'请输入'+item.db_field_txt"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'CHECKBOX'"> <a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'" :placeholder="$t('selectStatus')" :type="'checkbox'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SINGLETIME'"> <a-col :span="12" v-else-if="item.field_show_type === 'date'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-date-picker class="box-input" v-model="formInline[item.attrModel]" <a-date-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SMULTITIME'"> <a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.attrModel]" <a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@change="onChange"></a-range-picker> @change="onChange"></a-range-picker>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'NUMBER'"> <a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999"/> <a-input-number class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SELECT'"> <a-col :span="12" v-else-if="item.field_show_type === 'list'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
@input="handleInput(item.attrModel)" :disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')" :type="'select'" :placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SELECTALL'"> <a-col :span="12" v-else-if="item.field_show_type === 'list_multi'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'select'" :placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'RADIO'"> <a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag v-model="formInline[item.attrModel]" <j-dict-select-tag v-model="formInline[item.db_field_name]"
@input="handleInput(item.attrModel)" :disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')" :placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" dictCode="valid_status"/> :type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'TEXTAREA'"> <a-col :span="24" v-else-if="item.field_show_type === 'TEXTAREA'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4"/> <a-textarea :placeholder="$t('selectStatus')"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'FILE'"> <a-col :span="24" v-else-if="item.field_show_type === 'file'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px" <a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px"
@click="clickButtonToUpload(item.attrModel)"> @click="clickButtonToUpload(item.db_field_name)">
{{ (formInline[item.attrModel] === 'null' || formInline[item.attrModel] === '' || {{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
formInline[item.attrModel] == null) ? '上传文件' : '查看已上传文件' formInline[item.db_field_name] == null) ? '上传文件' : '查看已上传文件'
}} }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'STANDARD'"> <a-col :span="24" v-else-if="item.field_show_type === 'STANDARD'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<Standardselection :query="item" v-model="formInline[item.attrModel]"/> <Standardselection :query="item" :disabled="disabled" v-model="formInline[item.db_field_name]"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -174,158 +187,173 @@
<a-row :gutter="24" v-if="!isDisplayType"> <a-row :gutter="24" v-if="!isDisplayType">
<div v-for="(item,index) in dataList" :key="index"> <div v-for="(item,index) in dataList" :key="index">
<a-col :span="12" v-if="item.type === 'INPUT'"> <a-col :span="12" v-if="item.field_show_type === 'text'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input class="box-input" v-model="formInline[item.attrModel]" :placeholder="item.placeholder"/> <a-input class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="item.placeholder"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'CHECKBOX'"> <a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'" :placeholder="$t('selectStatus')" :type="'checkbox'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SINGLETIME'"> <a-col :span="12" v-else-if="item.field_show_type === 'date'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-date-picker class="box-input" v-model="formInline[item.attrModel]" <a-date-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SMULTITIME'"> <a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker v-model="formInline[item.attrModel]" @change="onChange"></a-range-picker> <a-range-picker v-model="formInline[item.db_field_name]"
:disabled="disabled"
@change="onChange"></a-range-picker>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'NUMBER'"> <a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999"/> <a-input-number class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SELECT'"> <a-col :span="12" v-else-if="item.field_show_type === 'list'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'select'" :placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'SELECTALL'"> <a-col :span="12" v-else-if="item.field_show_type === 'list_multi'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]" <j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'select'" :placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/> :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.type === 'RADIO'"> <a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag v-model="formInline[item.attrModel]" :placeholder="$t('selectStatus')" <j-dict-select-tag v-model="formInline[item.db_field_name]" :placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" dictCode="valid_status"/> :disabled="disabled"
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'TEXTAREA'"> <a-col :span="24" v-else-if="item.field_show_type === 'TEXTAREA'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4"/> <a-textarea :placeholder="$t('selectStatus')"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'FILE'"> <a-col :span="24" v-else-if="item.field_show_type === 'file'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px" <a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px"
@click="clickButtonToUpload(item.attrModel)"> @click="clickButtonToUpload(item.db_field_name)">
{{ (formInline[item.attrModel] === 'null' || formInline[item.attrModel] === '' || {{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
formInline[item.attrModel] == null) ? '上传文件' : '查看已上传文件' formInline[item.db_field_name] == null) ? '上传文件' : '查看已上传文件'
}} }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.type === 'STANDARD'"> <a-col :span="24" v-else-if="item.field_show_type === 'STANDARD'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.Required">*</span> <span class="Required" v-if="item.Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br> <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span> <span :class="{'title-text-text':false}">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="item.attrModel"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<Standardselection :query="item" v-model="formInline[item.attrModel]"/> <Standardselection :query="item"
:disabled="disabled"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -333,7 +361,7 @@
</div> </div>
</a-row> </a-row>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model> </a-form-model>
</a-spin> </a-spin>
</template> </template>
@@ -341,6 +369,8 @@
<script> <script>
import uploadFile from '@/components/uploadFile/file' import uploadFile from '@/components/uploadFile/file'
import Standardselection from '@/components/Standardselection/index' import Standardselection from '@/components/Standardselection/index'
import { getAction, postAction } from '@/api/manage'
import eventBUs from '../../common/event'
export default { export default {
name: 'index', name: 'index',
@@ -356,6 +386,14 @@
isDisplayType: { isDisplayType: {
type: Boolean, type: Boolean,
default: false default: false
},
flag: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@@ -371,126 +409,7 @@
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 17 } sm: { span: 17 }
}, },
dataList: [ dataList: [],
{
id: 1,
type: 'INPUT',
name: '名称',
placeholder: '请输入名称',
attrModel: 'name',
enName: 'Name',
text: '基本信息',
Required: true
},
{
id: 2,
type: 'INPUT',
name: '标题',
placeholder: '请输入标题',
attrModel: 'title',
enName: 'title',
text: '基本信息',
Required: true
},
{
id: 3,
type: 'RADIO',
name: '单选',
placeholder: '请输入标题',
enName: 'Single choice',
validStatus: 'valid_status',
attrModel: 'radio',
text: '基本信息',
Required: true
},
{
id: 4,
type: 'CHECKBOX',
name: '多选',
enName: 'title',
placeholder: '请输入标题',
attrModel: 'checkbox',
validStatus: 'valid_status',
text: '基本信息',
Required: true
},
{
id: 5,
type: 'SELECT',
name: '下拉单选',
enName: 'title',
placeholder: '请输入标题',
attrModel: 'selete',
validStatus: 'valid_status',
text: '基本信息',
Required: true
},
{
id: 6,
type: 'SELECTALL',
name: '下拉多选',
enName: 'title',
placeholder: '请输入标题',
validStatus: 'valid_status',
attrModel: 'selectAll',
text: '基本信息',
Required: true
},
{
id: 7,
type: 'NUMBER',
name: '数字输入框',
enName: 'title',
placeholder: '请输入数字输入框',
attrModel: 'number',
text: '基本信息'
},
{
id: 8,
type: 'TEXTAREA',
name: '文本框',
enName: 'title',
placeholder: '请输入文本框',
attrModel: 'textArea',
text: '基本信息'
},
{
id: 9,
type: 'FILE',
name: '上传文件',
enName: 'UploadFile',
placeholder: '请输入文本框',
attrModel: 'file',
text: '文本信息'
},
{
id: 10,
type: 'STANDARD',
name: '标准选择',
enName: 'standard',
placeholder: '请手动输入或者选择标准',
attrModel: 'standard',
text: '关联信息'
},
{
id: 11,
type: 'SINGLETIME',
name: '单日期选择',
enName: 'standard',
placeholder: '请单日期选择',
attrModel: 'time',
text: '基本信息'
},
{
id: 12,
type: 'SMULTITIME',
name: '多日期选择',
enName: 'standardtime',
placeholder: '请多日期选择',
attrModel: 'timeAll',
text: '基本信息'
}
],
validatorRules: {}, validatorRules: {},
confirmLoading: false, confirmLoading: false,
uploadName: '', uploadName: '',
@@ -512,26 +431,28 @@
}, },
mounted() { mounted() {
this.IntegrateData() this.IntegrateData()
if (this.isDisplayType) { this.getForm()
this.headerText.forEach((res) => {
res.content = []
this.dataList.forEach(val => {
if (res.text === val.text) {
res.content.push(val)
}
})
})
}
}, },
methods: { methods: {
sumber() { sumber() {
console.log(this.formInline)
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
console.log(valid) let url = ''
console.log(this.formInline) if (this.formInline.id) {
url = this.url.updateInfo
} else {
url = this.url.addInfo
}
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(res.message)
eventBUs.$emit('searchReset')
this.$emit('addFormClick')
} else {
this.$message.warning(res.message)
}
})
} else { } else {
console.log('error submit!!')
return false return false
} }
}) })
@@ -566,32 +487,32 @@
this.dataList.forEach((res, index) => { this.dataList.forEach((res, index) => {
const rule = [] const rule = []
if (res.Required) { if (res.Required) {
if (res.type === 'INPUT') { if (res.field_show_type === 'text') {
rule.push({ rule.push({
required: true, required: true,
message: res.name + '不能为空', message: res.name + '不能为空',
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.type === 'CHECKBOX' || res.type === 'SELECTALL' || } else if (res.field_show_type === 'CHECKBOX' || res.field_show_type === 'list_multi' ||
res.type === 'SINGLETIME' || res.type === 'SMULTITIME') { res.field_show_type === 'date' || res.field_show_type === 'file') {
rule.push({ rule.push({
required: true, required: true,
message: res.name + '不能为空', message: res.name + '不能为空',
trigger: 'change' trigger: 'change'
}) })
} else if (res.type === 'NUMBER') { } else if (res.field_show_type === 'NUMBER') {
rule.push({ rule.push({
required: true, required: true,
message: res.name + '不能为空', message: res.name + '不能为空',
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.type === 'TEXTAREA') { } else if (res.field_show_type === 'TEXTAREA') {
rule.push({ rule.push({
required: true, required: true,
message: res.name + '不能为空', message: res.name + '不能为空',
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.type === 'RADIO' || res.type === 'SELECT') { } else if (res.field_show_type === 'RADIO' || res.field_show_type === 'list') {
rule.push({ rule.push({
required: true, required: true,
message: res.name + '不能为空', message: res.name + '不能为空',
@@ -605,6 +526,29 @@
}) })
this.$set(this, 'rules', rules) this.$set(this, 'rules', rules)
this.isFormInline = true this.isFormInline = true
this.confirmLoading = false
},
getForm() {
this.confirmLoading = true
let params = {
flag: this.flag
}
getAction(this.url.getAddForm, params).then((res) => {
if (res.success) {
this.dataList = res.result
this.IntegrateData()
if (this.isDisplayType) {
this.headerText.forEach((res) => {
res.content = []
this.dataList.forEach(val => {
if (res.text === val.area) {
res.content.push(val)
}
})
})
}
}
})
} }
} }
} }
+7 -5
View File
@@ -72,15 +72,17 @@
jsonBody: [], jsonBody: [],
checkboxList: [], checkboxList: [],
tableAll: false, tableAll: false,
indeterminate: false indeterminate: false,
searchParmes: {}
} }
}, },
mounted() { mounted() {
eventBUs.$on('searchQuery', target => { eventBUs.$on('searchQuery', target => {
console.log(target) this.searchParmes = target
this.getTableList()
}) })
eventBUs.$on('searchReset', target => { eventBUs.$on('searchReset', target => {
console.log(target) this.getTableList()
}) })
this.getData() this.getData()
this.getTableList() this.getTableList()
@@ -118,11 +120,11 @@
}, },
getTableList() { getTableList() {
let params = { let params = {
...searchParmes,
} }
getAction(this.url.tableList, params).then((res) => { getAction(this.url.tableList, params).then((res) => {
if (res.success) { if (res.success) {
this.jsonBody=res.result this.jsonBody = res.result
} }
}) })
}, },
+88
View File
@@ -0,0 +1,88 @@
<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<search :flag="'1'" :url="url" :searchList="searchList"/>
</div>
<div class="table-operator">
<a-button @click="handleCompare()" type="primary" icon="plus">{{$t('DataComparison')}}</a-button>
</div>
<div>
<tableData
:flag="'1'"
:OperationList="OperationList"
@editTable="editTable"
@deleteTable="deleteTable"
:url="url"
/>
</div>
<addForm ref="addFormClick"/>
</a-card>
</template>
<script>
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import addForm from './modules/addForm'
export default {
name: 'index',
// mixins: [JeroListMixin],
components: {
search,
addForm,
tableData
},
data() {
return {
searchList: [
{ name: '名称', placeholder: '请输入姓名', attrModel: 'name', enName: 'title' },
{ name: '标题', placeholder: '请输入标题', attrModel: 'title', enName: 'title' }
],
OperationList: [
{
text: '编辑',
ClickEvent: 'editTable'
},
{
text: '删除',
ClickEvent: 'deleteTable'
},
{
text: '收藏',
ClickEvent: 'Collection'
},
{
text: '订阅',
ClickEvent: 'subscribe'
}
],
selectedRowKeys: [],
loading: false,
url:{
tableHeader:'document/bussDocumentLibraryEO/getHeader',
seachList:'document/bussDocumentLibraryEO/queryCondition',
tableList:'/document/bussDocumentLibraryEO/queryPageInfo',
}
}
},
methods: {
onSelectChange() {
},
handleCompare() {
this.$refs.addFormClick.add()
},
editTable(item) {
console.log(item)
},
deleteTable(){
console.log(3)
},
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,73 @@
<template>
<a-drawer
:title="title"
:maskClosable="true"
:width="drawerWidth"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<addFormData
ref="addFormDataRef"
isDisplayType
v-if="visible"
:url="url"
/>
<div class="drawer-bootom-button">
<a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"
:cancelText="$t('cancel')">
<a-button style="margin-right: .8rem">{{$t('cancel')}}</a-button>
</a-popconfirm>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import addFormData from '@/components/addForm/index'
export default {
name: 'addForm',
components: {
addFormData
},
data() {
return {
title: '添加',
drawerWidth: 1000,
visible: false,
confirmLoading: false,
url: {}
}
},
methods: {
handleCancel() {
this.visible = false
},
add() {
this.visible = true
},
edit() {
this.visible = true
},
handleSubmit() {
this.$refs.addFormDataRef.sumber()
}
}
}
</script>
<style scoped>
.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;
}
</style>
@@ -73,10 +73,11 @@
url:{ url:{
tableHeader:'document/bussDocumentLibraryEO/getHeader', //表格头部字段 tableHeader:'document/bussDocumentLibraryEO/getHeader', //表格头部字段
seachList:'document/bussDocumentLibraryEO/queryCondition', //搜索字段 seachList:'document/bussDocumentLibraryEO/queryCondition', //搜索字段
tableList:'document/bussDocumentLibraryEO/list', //表格数据 tableList:'document/bussDocumentLibraryEO/queryPageInfo', //表格数据
formList:'document/bussDocumentLibraryEO/getAddForm', //新增表单的字段 getAddForm:'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
formAdd:'document/bussDocumentLibraryEO/addInfo', //新增 addInfo:'document/bussDocumentLibraryEO/addInfo', //新增
updateInfo:'document/bussDocumentLibraryEO/updateInfo', //编辑
getDocumentInfo:'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
} }
} }
}, },
@@ -10,6 +10,8 @@
style="height: 100%;overflow: auto;padding-bottom: 53px;"> style="height: 100%;overflow: auto;padding-bottom: 53px;">
<addFormData <addFormData
ref="addFormDataRef" ref="addFormDataRef"
@addFormClick="addFormClick"
:flag="'1'"
isDisplayType isDisplayType
v-if="visible" v-if="visible"
:url="url" :url="url"
@@ -26,7 +28,6 @@
<script> <script>
import addFormData from '@/components/addForm/index' import addFormData from '@/components/addForm/index'
import { getAction, postAction } from '@/api/manage'
export default { export default {
name: 'docLibraryAddForm', name: 'docLibraryAddForm',
@@ -55,24 +56,11 @@
}, },
}, },
mounted() { mounted() {
this.formData()
}, },
methods: { methods: {
formData(){
let params = {
flag: this.flag
}
getAction(this.url.formList, params).then((res) => {
if(res.success){
}
console.log('res',res)
})
},
handleCancel() { handleCancel() {
this.visible = false this.visible = false
console.log('2222')
}, },
add() { add() {
this.visible = true this.visible = true
@@ -82,15 +70,10 @@
}, },
handleSubmit() { handleSubmit() {
this.$refs.addFormDataRef.sumber() this.$refs.addFormDataRef.sumber()
// postAction(this.url.datarule,params).then(res=>{ },
// if(res.success){ addFormClick(){
// this.$message.success(res.message) this.visible = false
// }else{ },
// this.$message.error(res.message)
// }
// })
console.log('11111')
}
} }
} }
</script> </script>