朱思禹提交:教师信息vue项目

init
Administrator 4 years ago
parent 7391ce45c0
commit 1f3801eebb

@ -28,6 +28,9 @@
<span slot="dictionary" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="associate" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
@ -140,6 +143,8 @@
obj.scopedSlots = {"customRender":"editor"}
}else if ([17,18].some((num)=>{return type === num})){//
obj.scopedSlots = {"customRender":"depart_person"}
}else if(27 === type){
obj.scopedSlots = {"customRender":"associate"}
}
ary.push(obj)
}

@ -1,6 +1,6 @@
<template>
<a-input v-model="data.props.value" :placeholder="data.props.placeholder" :disabled="data.props.is_disabled || data.props.field_input_type === 2"
:allowClear="disabled === false" :maxLength="data.props.max_length !== 'text'?data.props.max_length:null"/>
<a-input v-model="data.props.value" :placeholder="data.props.placeholder" :disabled="data.props.is_disabled || data.props.field_input_type === 2
|| data.field_type === 27" :allowClear="disabled === false" :maxLength="data.props.max_length !== 'text'?data.props.max_length:null"/>
</template>
<script>
import {Input} from 'ant-design-vue'

@ -683,12 +683,16 @@
json.props.value = field_value;
}
}else if([3,4,6,15,25,26].some((type)=>{return type === field_type})){//
}else if([3,4,6,15,25,26,27].some((type)=>{return type === field_type})){//
field_value = field_value.substring(5,field_value.length)//"DICS#"
if (field_type === 3 || (field_type === 6 && json.props.mode === "default")){///
if (field_type === 3 || (field_type === 6 && json.props.mode === "default") || field_type === 27){////
let ary = field_value.split("!")
json.props.value = ary[0];
json.dics_value = ary[1];
if (field_type === 27){
json.props.value = ary[1];
}else{
json.props.value = ary[0];
json.dics_value = ary[1];
}
}else if (field_type === 4 || (field_type === 6 && json.props.mode === "multiple")){///
let valueAry = field_value.split("+")
json.props.value = [];

@ -33,7 +33,7 @@
<a-checkbox v-model="data.props.is_disabled"></a-checkbox>
<a-checkbox v-model="data.props.is_hidden"></a-checkbox>
</div>
<div v-if="data.tag !== 'label'" class="single-attribute-container-style">
<div v-if="[20,21,22,23,24,27].every((num)=>{return num !== data.field_type})" class="single-attribute-container-style">
<div class="attribute-title">校验</div>
<a-checkbox v-model="data.props.is_must"></a-checkbox>
</div>

@ -26,7 +26,8 @@
:is="com" :field="fieldData"></component>
<Upload v-else-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type" :title="fieldData.props.title" :option="fieldData.props.option" :multiple="fieldData.props.multiple"
:canDownload="fieldData.props.can_downLoad" :canUpload="false" :data="getUploadData()"/>
<div v-else-if="fieldData.field_type === 1 || fieldData.field_type === 2 || fieldData.field_type === 5 || fieldData.field_type === 12 || fieldData.field_type === 20">
<div v-else-if="fieldData.field_type === 1 || fieldData.field_type === 2 || fieldData.field_type === 5 || fieldData.field_type === 12
|| fieldData.field_type === 20 || fieldData.field_type === 27">
{{ fieldData.props.value }}
</div>
<div v-else-if="fieldData.field_type === 11" v-html="fieldData.props.value" style="padding-top: 0.65rem"></div>

@ -27,7 +27,7 @@
</span>
<span slot="option" slot-scope="value,record" class="action-container-style">
<template v-if="page === 'config'">
<i class="office-operate-search action-style" title="预览" @click="test"></i>
<i class="office-operate-search action-style" title="预览" @click="preview(record)"></i>
<i class="office-operate-edit action-style" title="编辑" @click="showModal(record)"></i>
<i :class="['office-operate-set','action-style',record.use_flag === 1?'action-disabled':'']" title="设计表单" @click="designForm(record)"></i>
<a-popconfirm placement="topRight" title="确定删除此类目吗?" ok-text="" cancel-text="" @confirm="deleteForm(record)">
@ -191,8 +191,26 @@
}
},
test:function(){
this.$bus.emit("modal_show",[{title:'测试弹出',propsData:{form_name:"测试"},dom_url:"components/common/uploader/Upload.vue"}]);
preview:function(record){
this.InterfaceConfig.callInterface([{
url:InterfaceConfig.getCustomizeFormFieldByFormId.url,
method:InterfaceConfig.getCustomizeFormFieldByFormId.method,
params:{
org_id:this.BaseConfig.person_info_my.bureau_id,
form_id:record.form_id
},
isTestLogin:InterfaceConfig.getCustomizeFormFieldByFormId.isTestLogin
}],(result)=>{
if (result && result[0]){
let data = result[0].data
let fieldList = JSON.parse(data.data.form_json);
let formWidth = JSON.parse(data.data.form_config_json).form_width;
if (data.code === 2000){
StaticParams.showPopModal(this,'预览','views/teacherInfo/formCommon/ViewForm.vue',
{"fieldsList":fieldList,"form_width":formWidth},false,true,null,"80%","preview-style")
}
}
});
},
/*
* 查看字段详情
@ -418,6 +436,13 @@
</script>
<style lang="scss">
.preview-style{
.ant-modal-body{
height: 50rem;
max-height: 800px;
overflow: auto;
}
}
.title-container-style{
justify-content: space-between;
}

@ -47,17 +47,17 @@
</div>
</a-row>
<!-- <a-spin tip="正在加载中,请稍候..." size="large" :spinning="is_spinning" wrapperClassName="spin-self-style">-->
<!-- <div class="itemOuterContainer" style="min-height: 100%">-->
<vue-scroll :ops="ops" style="height: calc(100% - 4rem)">
<draggable group="itemGroup" v-model="fieldsList" class="itemInnerContainer"
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0.5rem auto'}" handle=".move"
filter=".no-field" forceFallback="true" chosenClass="chosen" ghostClass="ghost" @add="onAdd">
<FieldItem v-for="field in fieldsList" :key="field.id" :item="field" @delete="deleteRowData" @copy="copyRowData" :design="true"/>
<div v-if="fieldsList.length <= 0" class="no-field"></div>
</draggable>
</vue-scroll>
<div class="itemOuterContainer" style="height: calc(100% - 3rem);padding: 0.5rem 0;background-color: #f2f2f2">
<vue-scroll :ops="ops" style="height:100%">
<draggable group="itemGroup" v-model="fieldsList" class="itemInnerContainer"
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0 0.5rem',minHeight:draggableMinHeight}" handle=".move"
filter=".no-field" forceFallback="true" chosenClass="chosen" ghostClass="ghost" @add="onAdd">
<FieldItem v-for="field in fieldsList" :key="field.id" :item="field" @delete="deleteRowData" @copy="copyRowData" :design="true"/>
<div v-if="fieldsList.length <= 0" class="no-field"></div>
</draggable>
</vue-scroll>
<!-- </div>-->
</div>
<!-- </a-spin>-->
</a-col>
<a-col :span='4' class="colStyle">
@ -98,6 +98,7 @@ export default {
props:['formData'],
data: function () {
return {
draggableMinHeight:document.body.clientHeight - 8 * 16 + "px",
ops:StaticParams.scrollOption,
selectedItem:{},
commonConfig,
@ -301,7 +302,7 @@ export default {
submitData:function () {//
if (this.fieldsList.length === 3){
Modal.warning({
title: '表单保存失败',
title: '表单提交失败',
content:"表单中最少要包含一个除默认字段(教师编号、教师姓名、单位(部门))的字段",
okText:'我知道了',
centered:true
@ -404,6 +405,10 @@ export default {
field.is_certificate = field.props.is_certificate === true ? 1 : 0
}else if(curType === 17 || curType === 18){
field.is_multiple_choice = field.props.is_multiple_choice === true?1:0;
}else if(curType === 27){
field.data_source_form_id = field.props.data_source_form_id;
field.data_source_field_id = field.props.data_source_field_id;
field.compare_standard = field.props.compare_standard;
}
if(field.is_input_field === 1){
@ -472,25 +477,47 @@ export default {
let j = 0;//51200
let k = 0;//200
let stopTest = false;
ary.forEach((item)=>{
if (item.data){//
for(let m = 0; m < ary.length; m++){
let item = ary[m];
if (item.props.data){//
index += 1
let result = this.testData(item.data,true,index)
let result = this.testData(item.props.data,true,index)
if (result === false){
stopTest = true;
return false
break;
}
}else{
if ([3,4,6].some((type)=>{return type === item.field_type}) && (item.props.datas === null || item.props.datas === undefined ||
(TypesCheck.isString(item.props.datas) && item.props.datas === "") || (TypesCheck.isArray(item.props.datas) && item.props.datas.length === 0))){
Modal.warning({
title: '表单保存失败',
title: '表单提交失败',
content:"请设置“" + item.field_name + "”字段的数据源",
okText:'我知道了',
centered:true
})
stopTest = true;
return false
break;
}else if(item.field_type === 27){
let tips = "";
if (!item.props.data_source_form_id || item.props.data_source_form_id === ""){
// eslint-disable-next-line no-debugger
tips = "请选择“" + item.field_name + "”字段的数据更新来源表单";
}else if (!item.props.data_source_field_id || item.props.data_source_field_id === ""){
tips = "请选择“" + item.field_name + "”字段的数据更新来源字段";
}else if (!item.props.compare_standard){
tips = "请选择“" + item.field_name + "”字段的更新关联数据规则";
}
if (tips !== ""){
Modal.warning({
title: '表单提交失败',
content:tips,
okText:'我知道了',
centered:true
})
stopTest = true;
break;
}
}
if (item.props.max_length){
@ -503,14 +530,14 @@ export default {
}
}
}
});
}
if (stopTest){
return false;
}
if (i > 80){
Modal.warning({
title: '表单保存失败',
title: '表单提交失败',
content:(isChild?'子表单' + index:"") + '字段值最大限制为1-50包含50的字段不能超过80个请更改后再试',
okText:'我知道了',
centered:true
@ -518,7 +545,7 @@ export default {
return false;
}else if(j > 20){
Modal.warning({
title: '表单保存失败',
title: '表单提交失败',
content:(isChild?'子表单' + index:"") + '字段值最大限制为51-200包含200的字段不能超过20个请更改后再试',
okText:'我知道了',
centered:true
@ -526,7 +553,7 @@ export default {
return false;
}else if (k > 20){
Modal.warning({
title: '表单保存失败',
title: '表单提交失败',
content: (isChild?'子表单' + index:"") + '字段值最大限制为200包含不限制以外的字段不能超过20个请更改后再试',
okText:'我知道了',
centered:true

@ -1,32 +1,17 @@
<template>
<div>
<div v-if="attribute.tag === 'input' && attribute.props.field_input_type === 2" class="single-attribute-container-style">
<div class="attribute-title">输入方式</div>
<a-radio-group button-style="solid" v-model="attribute.props.field_input_type" @change="fieldTypeChange">
<!-- <a-radio-button :value="1" class="radio-button-style">用户输入</a-radio-button>-->
<a-radio-button :value="2" class="radio-button-style">自动填充</a-radio-button>
</a-radio-group>
</div>
<div v-if="attribute.tag === 'input' && attribute.props.field_input_type === 2" class="single-attribute-container-style">
<div class="attribute-title">填充内容</div>
<a-radio-group button-style="solid" v-model="attribute.props.filed_auto_input_info">
<a-radio-button value="person_num" class="radio-button-style">编号</a-radio-button>
<a-radio-button value="person_name" class="radio-button-style">姓名</a-radio-button>
<a-radio-button value="org_dept_name" class="radio-button-style">单位(部门)</a-radio-button>
</a-radio-group>
</div>
<template v-if="attribute.tag === 'input' && attribute.props.field_input_type === 1">
<template v-if="attribute.field_type === 27">
<div class="single-attribute-container-style">
<div class="attribute-title">内容更新数据来源表单</div>
<a-spin :spinning="form_loading" :delay="100" size="small" tip="正在加载表单数据,请稍候...">
<a-select style="margin-top: 0.5rem;width: 100%" :allowClear="true" :defaultActiveFirstOption="false"
placeholder="请选择数据来源表单" :showSearch="true" v-model="attribute.props.data_source_form_id"
optionFilterProp="children" @change="resourceFormChange">
<a-select-option v-for="form in formList" :key="form.form_id" :value="form.form_id">
{{ form.form_name }}
</a-select-option>
</a-select>
</a-spin>
<a-select style="margin-top: 0.5rem;width: 100%" :allowClear="true" :defaultActiveFirstOption="false"
placeholder="请选择数据来源表单" :showSearch="true" v-model="attribute.props.data_source_form_id"
optionFilterProp="children" @change="resourceFormChange">
<a-select-option v-for="form in formList" :key="form.form_id" :value="form.form_id">
{{ form.form_name }}
</a-select-option>
</a-select>
</a-spin>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">内容更新数据来源字段</div>
@ -34,7 +19,7 @@
<a-select style="margin-top: 0.5rem;width: 100%" :allowClear="true" :defaultActiveFirstOption="false"
:disabled="!attribute.props.data_source_form_id || attribute.props.data_source_form_id === ''"
placeholder="请选择数据来源字段" :showSearch="true" v-model="attribute.props.data_source_field_id"
optionFilterProp="children">
optionFilterProp="children" @change="resourceFieldChange">
<a-select-option v-for="field in fieldList" :key="field.field_id" :value="field.field_id">
{{ field.field_name }}
</a-select-option>
@ -43,7 +28,7 @@
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">内容更新关联数据规则</div>
<a-radio-group v-model="attribute.props.compare_standard" :disabled="!attribute.props.data_source_form_id || attribute.props.data_source_form_id === ''">
<a-radio-group v-model="attribute.props.compare_standard">
<a-radio class="radioStyle" :value="1">
始终显示最早录入字段
</a-radio>
@ -59,20 +44,37 @@
</a-radio-group>
</div>
</template>
<div class="single-attribute-container-style">
<div class="attribute-title">占位内容</div>
<a-input placeholder="占位内容最多10个字符" v-model="attribute.props.placeholder" :maxLength="10" :allowClear="true"/>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">默认值</div>
<a-input placeholder="默认值最多50个字符" v-model="attribute.props.value" :maxLength="50" :allowClear="true"/>
</div>
<div class="single-attribute-container-style" style="position: relative">
<div class="attribute-title">内容长度限制</div>
<a-switch size="small" :checked="getChecked()" @change="switchChange"
style="position: absolute;right: 0;top: 0.3rem" unCheckedChildren="不限制"/>
<a-input-number :min="1" :step="1" :disabled="attribute.props.max_length === 'text'" :value="getNum()" @change="numChange"/>
</div>
<template v-else>
<div v-if="attribute.tag === 'input' && attribute.props.field_input_type === 2" class="single-attribute-container-style">
<div class="attribute-title">输入方式</div>
<a-radio-group button-style="solid" v-model="attribute.props.field_input_type" @change="fieldTypeChange">
<!-- <a-radio-button :value="1" class="radio-button-style">用户输入</a-radio-button>-->
<a-radio-button :value="2" class="radio-button-style">自动填充</a-radio-button>
</a-radio-group>
</div>
<div v-if="attribute.tag === 'input' && attribute.props.field_input_type === 2" class="single-attribute-container-style">
<div class="attribute-title">填充内容</div>
<a-radio-group button-style="solid" v-model="attribute.props.filed_auto_input_info">
<a-radio-button value="person_num" class="radio-button-style">编号</a-radio-button>
<a-radio-button value="person_name" class="radio-button-style">姓名</a-radio-button>
<a-radio-button value="org_dept_name" class="radio-button-style">单位(部门)</a-radio-button>
</a-radio-group>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">占位内容</div>
<a-input placeholder="占位内容最多10个字符" v-model="attribute.props.placeholder" :maxLength="10" :allowClear="true"/>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">默认值</div>
<a-input placeholder="默认值最多50个字符" v-model="attribute.props.value" :maxLength="50" :allowClear="true"/>
</div>
<div class="single-attribute-container-style" style="position: relative">
<div class="attribute-title">内容长度限制</div>
<a-switch size="small" :checked="getChecked()" @change="switchChange"
style="position: absolute;right: 0;top: 0.3rem" unCheckedChildren="不限制"/>
<a-input-number :min="1" :step="1" :disabled="attribute.props.max_length === 'text'" :value="getNum()" @change="numChange"/>
</div>
</template>
</div>
</template>
@ -107,7 +109,7 @@
ASelectOption:Select.Option
},
mounted(){
if (this.attribute.props.field_input_type === 1){//
if (this.attribute.field_type === 27){//
this.getFormList()
}
},
@ -122,11 +124,10 @@
},
methods:{
resourceFormChange:function(){
this.attribute.props.data_source_field_id = undefined;
// this.attribute.props.compare_standard = 1;
if (this.attribute.props.data_source_form_id && this.attribute.props.data_source_form_id !== ""){
this.getFieldList()
}else{
this.attribute.props.data_source_field_id = undefined;
this.attribute.props.compare_standard = undefined;
}
},
getFieldList:function(){
@ -163,7 +164,10 @@
this.form_loading = false;
let data = result[0].data;
if (data.code === 2000){
this.formList = data.data.form_list
this.formList = data.data.form_list;
if (this.attribute.props.data_source_form_id && this.attribute.props.data_source_form_id !== ""){
this.getFieldList();
}
}
})
},

@ -76,7 +76,6 @@ export const baseFields = [
export const advancedFields = [
{ field_type: 8, field_name: '头像(照片)',tag:"portrait",showTitle:true,content_width:100,props:{max_length:"text"}},
{ field_type: 9, field_name: '图片上传',tag:"img",el:"FileUpload.vue",attributeUrl:"FileUploadAttribute",
props:{value:[],max_length:"text",can_search:false,is_search:false,type:2,title:'上传图片',option:{no_user:""},can_downLoad:true,multiple:true,is_certificate:false,can_delete:true}},
@ -104,11 +103,16 @@ export const businessFields = [
{ field_type: 25, field_name: '学段学科',tag:"stage_subject",el:"StageAndSubjectSelection.vue",attributeUrl:"StageAndSubjectAttribute",
props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],default_value_name:"",data_range:2}},
{ field_type: 26, field_name: '专业',tag:"major",el:"MajorSelection.vue",attributeUrl:"MajorAttribute",
props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],default_value_name:""}}
props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],default_value_name:""}},
{ field_type:27, field_name: '关联其它表单',tag:"associate",el:"Input.vue",attributeUrl:"InputAreaAttribute.vue",
props:{placeholder:"",value:"",can_search:false,is_search:false,max_length:50,
data_source_form_id:undefined,data_source_field_id:undefined,compare_standard:undefined}},
]
export const layoutFields = [
{ field_type: 24, field_name: '栅格',tag:"grid",content_width:100},
{ field_type: 21, field_name: '表格',tag:"table",content_width:100},
{ field_type: 22, field_name: '分割线',tag:"dividing_line",content_width:100}
{ field_type: 22, field_name: '分割线',tag:"dividing_line",el:"DivideLine.vue",attributeUrl:"DivideLineAttribute",
props:{value:"",can_search:false,is_search:false,type:"horizontal",dashed:false,orientation:"center"}}
]

@ -16,6 +16,9 @@
<span slot="dictionary" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="associate" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
@ -118,6 +121,8 @@
obj.scopedSlots = {"customRender":"editor"}
}else if ([17,18].some((num)=>{return type === num})){//
obj.scopedSlots = {"customRender":"depart_person"}
}else if(27 === type){
obj.scopedSlots = {"customRender":"associate"}
}
ary.push(obj)
}

@ -20,6 +20,9 @@
<span slot="dictionary" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="associate" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
@ -130,6 +133,8 @@
obj.scopedSlots = {"customRender":"editor"}
}else if ([17,18].some((num)=>{return type === num})){//
obj.scopedSlots = {"customRender":"depart_person"}
}else if(27 === type){
obj.scopedSlots = {"customRender":"associate"}
}
ary.push(obj)
}

@ -36,6 +36,9 @@
<span slot="dictionary" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="associate" slot-scope="value"><!--字典类型字段-->
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
@ -144,6 +147,8 @@
obj.scopedSlots = {"customRender":"editor"}
}else if ([17,18].some((num)=>{return type === num})){//
obj.scopedSlots = {"customRender":"depart_person"}
}else if(27 === type){
obj.scopedSlots = {"customRender":"associate"}
}
ary.push(obj)
}

Loading…
Cancel
Save