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

init
Administrator 4 years ago
parent f180ffea01
commit 677444c0fe

@ -0,0 +1,214 @@
<template>
<modal-panel addChildType="slot" :modalTitle="title" :show="showPanel" modalClassName="select-depart-style" @callback="modalCallback">
<div class="card-container">
<div class="tree-container-style" style="margin-right: 1rem">
<a-tree v-if="treeData.length > 0" :treeData="treeData" :replaceFields="{key:'id',title:'name',children:'subChild'}"
:defaultExpandedKeys="defaultExpandedKeys" @select="treeSelected" :selectedKeys="selectedKey"/>
</div>
<div class="selected-container-style">
<div v-if="selectedDept.length === 0" class="no-selected-dept-style"></div>
<div v-else v-for="dept in selectedDept" :key="dept.id" class="selected-dept-style">
{{dept.name}}
<a-icon class="delete-selected-style" type="minus-circle" title="删除" @click="onDeleteSelectedDepart(dept)"/>
</div>
<div v-if="selectedDept.length > 0" class="clear-all-style" @click="deleteAllSelected()"></div>
</div>
</div>
</modal-panel>
</template>
<script>
import {Tree,Icon} from 'ant-design-vue'
import ModalPanel from '../modal/ModalPanel'
import 'ant-design-vue/es/input/style/css'
import InterfaceConfig from '../../../commonInterface/interfaceConfig'
import StaticParams from '../../../global-llibs/staticParams'
import _ from 'lodash';
export default {
name: "SelectDepartment",
props:{
show:{
type:Boolean,
default:false
},
selectedDepart:{//[{person_id,person_name},{person_id,person_name}]
type:Array,
default:function () {
return []
}
},
modalTitle:{
type:String,
default:"请选择部门"
},
isMultipleChoice:{
type:Boolean,
default:true
}
},
data:function(){
return{
selectedDept:_.cloneDeep(this.selectedDepart),//
title:this.modalTitle,//
showPanel:this.show,//
resource_tree_data:[],//
treeData:[],//
defaultExpandedKeys:[],//
selectedKey:[],
checkedKeys:{
checked:[],
halfChecked:[]
}
}
},
components:{
ModalPanel,
ATree:Tree,
AIcon:Icon,
},
methods:{
deleteAllSelected:function(){
this.selectedDept.splice(0);
},
onDeleteSelectedDepart:function(dept){
// console.log(dept)
this.selectedDept.splice(this.selectedDept.findIndex((item)=>{return parseInt(item.id) === parseInt(dept.id)}),1);
if (parseInt(this.selectedKey[0]) === parseInt(dept.id)){
this.selectedKey = []
}
},
treeSelected:function(selectedKeys,{selected}){
let item = this.resource_tree_data.filter((item)=>{return item.id === selectedKeys[0]})[0];//
if (selected){
this.selectedKey = [item.id]
if (this.isMultipleChoice){//
if (!this.selectedDept.some((selected)=>{return parseInt(selected.id) === item.id})){
this.selectedDept.push(item);
}
}else{
this.selectedDept = [item];
}
}
},
modalCallback:function(ary){
if (ary[0] === "ok"){
this.$emit("selectComplete",this.selectedDept)
}else{
this.$emit("cancel",null)
}
},
getOrgTree:function () {
this.InterfaceConfig.callInterface([{
url:InterfaceConfig.depinfo_getOrgTree.url,
method:InterfaceConfig.depinfo_getOrgTree.method,
params:{org_id:this.BaseConfig.person_info_my.bureau_id},
isTestLogin:InterfaceConfig.depinfo_getOrgTree.isTestLogin,
}],(result)=>{
if (result && result[0]){
let data = result[0].data;
if (data.success){
this.resource_tree_data = _.cloneDeep(data.list);
this.treeData = StaticParams.getOrgTreeData(data.list);
this.defaultExpandedKeys = [this.treeData[0].id];
}
}
});
},
},
mounted(){
if (this.showPanel){
this.getOrgTree();
}
},
watch:{
modalTitle:function (newData) {
this.title = newData;
},
selectedDepart:function(newData){
this.selectedDept = newData;
},
show:function (newData) {
this.showPanel = newData;
this.selectedKey = [];
if (newData === true){
this.getOrgTree()
}
}
}
}
</script>
<style lang="scss">
.select-depart-style{
width: 800px !important;
.ant-modal-body{
padding: 0 !important;
.card-container {
background: #f5f5f5;
overflow: hidden;
padding: 0.5rem;
.tree-container-style{
height: 500px;
width: 30%;
border:1px solid #e5e5e5;
border-radius: 5px;
overflow: auto;
float: left;
position: relative;
background-color: white;
}
.selected-container-style{
width: calc(70% - 1.5rem);
height: calc(500px - 1rem);
float: left;
padding: 0 0 1rem 1rem;
overflow: auto;
background-color: white;
border: 1px solid #e5e5e5;
.no-selected-dept-style{
width: 100%;
height: 100%;
font-size: 1.5rem;
display: flex;
align-items: center;
align-content: center;
justify-items: center;
justify-content: center;
color:#999999;
}
.selected-dept-style{
padding: 0.25rem 0.5rem;
border:1px solid #31a8fa;
float: left;
border-radius: 5px;
margin: 1rem 1rem 0 0;
color:#31a8fa;
cursor:pointer;
position: relative;
&:hover{
.delete-selected-style{
display: inline-block;
}
}
.delete-selected-style{
font-size: 1rem;
position: absolute;
top: -0.5rem;
right:-0.5rem;
color:red;
display: none;
cursor:pointer;
}
}
.clear-all-style{
position: absolute;
bottom:0.2rem;
right:1rem;
color:#31a8fa;
cursor:pointer;
}
}
}
}
}
</style>

@ -318,6 +318,7 @@
},
show:function (newData) {
this.showPanel = newData;
this.curSelectedKey = "";
if (newData === true){
this.getData()
}

@ -1,13 +1,182 @@
<template>
<div></div>
<div class="personnel-Object-style clearfix" @click="onShow">
<div v-if="!data.props.value || data.props.value.length === 0" class="placeholder-style">
{{data.props.placeholder}}
</div>
<template v-else>
<a-icon type="close-circle" class="clear-style" @click.stop="clearAll"></a-icon>
<template v-if="data.props.is_multiple_choice">
<div v-for="item in data.props.value" :key="item.id" class="multiple-style" :title="item.name">
<div class="name-style">
{{item.name}}
</div>
<span class="icon-container-style" @click.stop="deleteItem(item)">
<a-icon type="close" class="multiple-delete-style"></a-icon>
</span>
</div>
</template>
<div v-else class="single-person-class">
{{data.props.value[0].name}}
</div>
</template>
<select-department :show="showPanel" modalTitle="部门选择" :selectedDepart="cloneData()"
@cancel="closePanel" @selectComplete="selectComplete" :isMultipleChoice="data.props.is_multiple_choice"/>
</div>
</template>
<script>
import {Icon} from 'ant-design-vue'
import SelectDepartment from '../../../components/common/selectDepartment/SelectDepartment'
import _ from 'lodash'
export default {
name: "DepartmentSelection"
name: "DepartmentSelection",
props:["field","disabled"],
data: function () {
return {
data:this.field,
showPanel:false,
curCheckNodes:{
halfChecked:[],
checked:[]
},
}
},
components:{
AIcon:Icon,
SelectDepartment
},
methods:{
deleteItem:function(item){
this.data.props.value.splice(this.data.props.value.findIndex((value)=>{return parseInt(value.id) === parseInt(item.id)}),1);
},
clearAll:function(){
this.data.props.value = [];
},
onShow:function(){
this.showPanel = true;
},
closePanel:function () {
this.showPanel = false;
},
cloneData:function(){
return _.cloneDeep(this.data.props.value)
},
selectComplete:function (selectedData) {
this.data.props.value = _.cloneDeep(selectedData);
this.showPanel = false;
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.personnel-Object-style{
font-size: 0.875rem;
width: 12rem;
min-height: 2rem;
border-radius: 4px;
border:1px solid #d9d9d9;
background-color: white;
padding-right: 1rem;
position: relative;
cursor:pointer;
.placeholder-style{
float: left;
width: 100%;
padding: 0.5rem;
height: 2rem;
display: flex;
align-items: center;
align-content: center;
color: #cccccc;
}
.single-person-class{
float: left;
width: 100%;
padding: 0.5rem 0 0.5rem 0.5rem;
min-height:2rem;
line-height: 1rem;
word-break: break-all;
white-space: pre-wrap;
}
.multiple-style{
height: 1.5rem;
margin-top: 3px;
line-height: 22px;
position: relative;
float: left;
max-width: 99%;
margin-right: 4px;
padding: 0 20px 0 10px;
overflow: hidden;
color: rgba(0, 0, 0, 0.65);
background-color: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 2px;
cursor: default;
transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
.name-style{
display: inline-block;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
transition: margin 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.icon-container-style{
font-style: normal;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: absolute;
right: 4px;
color: rgba(0, 0, 0, 0.45);
font-weight: bold;
line-height: inherit;
cursor: pointer;
transition: all 0.3s;
display: inline-block;
font-size: 12px;
transform: scale(0.83333333) rotate(0deg);
.multiple-delete-style{
display: inline-block;
color: inherit;
font-style: normal;
line-height: 0;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 12px;
font-weight: bold;
cursor: pointer;
}
}
}
.clear-style{
position: absolute;
top:0.5rem;
right: 0.25rem;
font-size: 1rem;
cursor:pointer;
visibility: hidden;
color:#cccccc;
&:hover{
color:#31a8fa;
}
}
&:hover{
border-color: #31a8fa;
.clear-style{
visibility: visible;
}
}
}
</style>

@ -10,7 +10,7 @@
<div class="name-style">
{{item.person_name}}
</div>
<span class="icon-container-style">
<span class="icon-container-style" @click.stop="deleteItem(item)">
<a-icon type="close" class="multiple-delete-style"></a-icon>
</span>
</div>
@ -35,10 +35,6 @@
return {
data:this.field,
showPanel:false,
curCheckNodes:{
halfChecked:[],
checked:[]
},
}
},
components:{
@ -46,12 +42,11 @@
SelectPeople
},
methods:{
deleteItem:function(item){
this.data.props.value.splice(this.data.props.value.findIndex((value)=>{return parseInt(value.id) === parseInt(item.id)}),1);
},
clearAll:function(){
this.data.props.value = [];
this.curCheckNodes = {
halfChecked:[],
checked:[]
}
},
onShow:function(){
this.showPanel = true;
@ -64,7 +59,6 @@
},
selectComplete:function (selectedData) {
this.data.props.value = _.cloneDeep(selectedData[0]);
this.curCheckNodes = _.cloneDeep(selectedData[1]);
this.showPanel = false;
}
}

@ -97,7 +97,7 @@ export const advancedFields = [
export const businessFields = [
/* { field_type: 16, field_name: '',tag:"org_select",el:"OrganizationSelection.vue",attributeUrl:"OrganizationAttribute",
props:{max_length:"text",can_search:true,is_search:true}},*/
{ field_type: 17, field_name: '部门选择',tag:"dept_select",el:"DepartmentSelection.vue",attributeUrl:"DepartmentAttribute",
{ field_type: 17, field_name: '部门选择',tag:"dept_select",el:"DepartmentSelection.vue",attributeUrl:"PersonnelAttribute",
props:{max_length:"text",can_search:true,is_search:true,value:[],is_multiple_choice:true,placeholder:"请选择部门"}},
{ field_type: 18, field_name: '人员选择',tag:"person_select",el:"PersonnelSelection.vue",attributeUrl:"PersonnelAttribute",
props:{max_length:"text",can_search:true,is_search:true,value:[],is_multiple_choice:true,placeholder:"请选择人员"}},

@ -1,5 +1,5 @@
<template>
<div class="category-summary-style" ref="parent">
<div v-if="pageType === 1" class="category-summary-style" ref="parent">
<a-spin :spinning="isLoading" tip="正在加载数据,请稍候..." size="large" style="position: absolute;top: 50%;left: 50%">
</a-spin>
<template v-if="!isLoadingForm">
@ -62,6 +62,8 @@
</template>
</template>
</div>
<edit-and-view-form v-else :pageType="3" :dataNumType="selectedForm.data_num_type" :dataInfo="formData" :showOperateList="false"
@back="returnBack" :form_id="selectedForm.form_id" :businessType="4" :person-info="personInfo"/>
</template>
<script>
@ -74,6 +76,8 @@
import FieldFilter from '../commonComponents/fieldFilter/FieldFilter'
import _ from 'lodash'
import SearchColumnPanel from './SearchColumnPanel'
import ManagementInterfaceConfig from '../teacherInfoManagement/interfaceConfig'
import EditAndViewForm from '../formCommon/EditAndViewForm'
export default {
name: "CategorySummary",
props:["isAdmin"],
@ -93,7 +97,10 @@
totalRow:0,
selectedRows:[],
showFieldFilter:false,
showSearchColumn:false
showSearchColumn:false,
pageType:1,
personInfo:null,
formData:null
}
},
components:{
@ -106,7 +113,8 @@
ShowAttachment,
ModalPanel,
FieldFilter,
SearchColumnPanel
SearchColumnPanel,
EditAndViewForm
},
computed:{
getColumns:function(){
@ -144,6 +152,39 @@
}
},
methods:{
returnBack:function(){
this.pageType = 1;
},
view:function(record){
let params = {
org_id:this.BaseConfig.person_info_my.bureau_id,
system_id:10,
form_id:this.selectedForm.form_id,
value_id:record.value_id,
teacher_id:record.person_id
}
this.InterfaceConfig.callInterface([{
url:ManagementInterfaceConfig.getTeacherInfoByValueId.url,
method:ManagementInterfaceConfig.getTeacherInfoByValueId.method,
params:params,
isTestLogin:ManagementInterfaceConfig.getTeacherInfoByValueId.isTestLogin
}],(data)=>{
let result = data[0].data;
if (result.code === 2000){
this.formData = result.data;
this.personInfo = {
person_id:this.formData.form_data_list[0].person_id,
org_name:this.formData.form_data_list[0].org_name,
dept_name:this.formData.form_data_list[0].dept_name,
person_name:this.formData.form_data_list[0].person_name,
workers_no: this.formData.form_data_list[0].workers_no?this.formData.form_data_list[0].workers_no:"",
dept_id:this.formData.form_data_list[0].dept_id,
}
this.pageType = 2;
}
})
},
onShowSearchColumn:function(){
this.showSearchColumn = true;
},
@ -189,9 +230,7 @@
getImg:function(value){
return JSON.parse(value)[0];
},
view:function(record){
console.log(record)
},
selectedRowsChange:function(selectedRows){
this.selectedRows = selectedRows;
},

Loading…
Cancel
Save