|
@@ -1,8 +1,8 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import style from './index.less';
|
|
|
import { Tab, ConfirmModal, Notify } from '@commonComp';
|
|
|
-import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin,whichTemp,floderSlide,floderAction } from '@store/actions/tabTemplate';
|
|
|
-import { initItemList,initAdminItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin } from '@store/async-actions/tabTemplate';
|
|
|
+import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin,whichTemp,floderSlide,floderAction,folderModal } from '@store/actions/tabTemplate';
|
|
|
+import { initItemList,initAdminItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin,getFloderList } from '@store/async-actions/tabTemplate';
|
|
|
import { connect } from "react-redux";
|
|
|
import store from '@store';
|
|
|
import { billing } from '@store/async-actions/pushMessage';
|
|
@@ -12,6 +12,8 @@ import PushItemsContainer from '@containers/PushItemsContainer';
|
|
|
import { pushAllDataList, getWindowInnerHeight, didPushParamChange } from '@utils/tools';
|
|
|
import CopyRightContainer from "@containers/CopyRightContainer";
|
|
|
import MedicalInfoContainer from '@containers/MedicalInfoContainer';
|
|
|
+import FolderName from '@components/FolderName';
|
|
|
+import slideDown from '@common/images/slideDown.png';
|
|
|
import CaseQuailty from "../CaseQuailty";
|
|
|
|
|
|
class PushContainer extends Component {
|
|
@@ -44,7 +46,14 @@ class PushContainer extends Component {
|
|
|
okColor: 'red',
|
|
|
num: 0, //计数
|
|
|
deptId:'', //科室id
|
|
|
+
|
|
|
floderName:'', //文件夹名称
|
|
|
+ folderListShow:false,
|
|
|
+ folderNameVal:'',
|
|
|
+ folderId:'',
|
|
|
+ spell:'',
|
|
|
+ fstName:'',
|
|
|
+ tmpFolder:''
|
|
|
}
|
|
|
this.$cont = React.createRef();
|
|
|
this.itemList = null;
|
|
@@ -63,6 +72,8 @@ class PushContainer extends Component {
|
|
|
this.whichTemp = this.whichTemp.bind(this);
|
|
|
this.floderSlideToggle = this.floderSlideToggle.bind(this);
|
|
|
this.floderRename = this.floderRename.bind(this);
|
|
|
+ this.handleInputFloder = this.handleInputFloder.bind(this);
|
|
|
+ this.setFolderId = this.setFolderId.bind(this);
|
|
|
}
|
|
|
componentDidMount() {
|
|
|
// const height = getWindowInnerHeight()-160;
|
|
@@ -112,10 +123,11 @@ class PushContainer extends Component {
|
|
|
* 删除模板
|
|
|
* @param {模板id} id
|
|
|
*/
|
|
|
- handleTemplateDel(id) {
|
|
|
+ handleTemplateDel(id,folderId) {
|
|
|
this.setState({
|
|
|
message: this.delDiv(),
|
|
|
type: 1,
|
|
|
+ folderId:folderId,
|
|
|
id: id,
|
|
|
okText: '删除',
|
|
|
okBorderColor: 'red',
|
|
@@ -147,46 +159,87 @@ class PushContainer extends Component {
|
|
|
let val = (e.target.value).substring(0, 30)
|
|
|
this.onchange(val)
|
|
|
}
|
|
|
- handleInputFst(e){
|
|
|
+ handleInputFloder(e){
|
|
|
let val = (e.target.value).substring(0,30)
|
|
|
this.setState({
|
|
|
floderName: val
|
|
|
+ },()=>{
|
|
|
+ this.setState({
|
|
|
+ message:this.changeFloderTitle()
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
- changeTitle() {
|
|
|
+ handleInputFst(e){
|
|
|
+ let val = (e.target.value).substring(0,30)
|
|
|
+ console.log(val)
|
|
|
+ this.setState({
|
|
|
+ fstName: val
|
|
|
+ }, () => {
|
|
|
+ this.setState({
|
|
|
+ message: this.changeTitle(),
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ changeTitle() {//模板名称修改
|
|
|
return <div className={style['box']}>
|
|
|
- <input className={style['ipt']}
|
|
|
- placeholder="请输入模板名称"
|
|
|
- type="text"
|
|
|
- value={this.state.title}
|
|
|
- maxLength='30'
|
|
|
- onInput={(e) => {
|
|
|
- this.handleInput(e)
|
|
|
- }}
|
|
|
- onPropertyChange={(e) => { // 兼容ie
|
|
|
- this.handleInput(e)
|
|
|
- }}
|
|
|
- onKeyPress={e => this.keypress(e)}
|
|
|
- />
|
|
|
- <div className={style['line']}></div>
|
|
|
+ <div className={style['iptWrap']}>
|
|
|
+ <div className={style.name}>
|
|
|
+ <span className={style.leftName}>模板名称:</span>
|
|
|
+ <input className={style['ipt']}
|
|
|
+ placeholder="请输入模板名称"
|
|
|
+ type="text"
|
|
|
+ maxLength='30'
|
|
|
+ value={this.state.title}
|
|
|
+ onInput={(e) => {
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onPropertyChange={(e) => { // 兼容ie
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onKeyPress={e => this.keypress(e)}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className={`${style.name} ${style.firstname}`}>
|
|
|
+ <span className={style.leftName}>模板名首拼:</span>
|
|
|
+ <input className={style['ipt']}
|
|
|
+ placeholder=""
|
|
|
+ type="text"
|
|
|
+ maxLength='30'
|
|
|
+ value={this.state.fstName}
|
|
|
+ onInput={(e) => {
|
|
|
+ this.handleInputFst(e)
|
|
|
+ }}
|
|
|
+ onPropertyChange={(e) => { // 兼容ie
|
|
|
+ this.handleInputFst(e)
|
|
|
+ }}
|
|
|
+ onKeyPress={e => this.keypress(e)}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
}
|
|
|
/**
|
|
|
* 改变模板标题
|
|
|
* @param {模板id和模板title} obj
|
|
|
*/
|
|
|
- handleTitleChange(id, text,deptId) {
|
|
|
+ handleTitleChange(id, text,deptId,folderId,spell,folderName) {
|
|
|
store.dispatch(changeVisible(true))
|
|
|
+ this.props.admin&&store.dispatch(getFloderList())
|
|
|
this.setState({
|
|
|
type: 3,
|
|
|
currId: id,
|
|
|
title: text,
|
|
|
text: text,
|
|
|
deptId: deptId,
|
|
|
+ fstName:spell,
|
|
|
okText: '保存',
|
|
|
okBorderColor: '#3B9ED0',
|
|
|
okColor: '#fff',
|
|
|
- oKBg: '#3B9ED0'
|
|
|
+ oKBg: '#3B9ED0',
|
|
|
+ folderId:folderId,
|
|
|
+ spell:spell,
|
|
|
+ folderNameVal:folderName,
|
|
|
+ tmpFolder:folderName,
|
|
|
}, () => {
|
|
|
this.setState({
|
|
|
message: this.changeTitle(),
|
|
@@ -196,9 +249,9 @@ class PushContainer extends Component {
|
|
|
|
|
|
handleAllCheckboxAdmin() { //全.反选
|
|
|
let tmpFlg = this.props.allCheckedAdmin;
|
|
|
- if (this.props.checkItemsAdmin.length < this.props.adminItems.length && this.props.allCheckedAdmin) {
|
|
|
+ if (this.props.checkItemsAdmin.length < this.props.folderListContentArr.length && this.props.allCheckedAdmin) {
|
|
|
tmpFlg = false;
|
|
|
- } else if (this.props.checkItemsAdmin.length == this.props.adminItems.length && !this.props.allCheckedAdmin) {
|
|
|
+ } else if (this.props.checkItemsAdmin.length == this.props.folderListContentArr.length && !this.props.allCheckedAdmin) {
|
|
|
tmpFlg = true;
|
|
|
} //两种特殊情况处理
|
|
|
store.dispatch(allCheckedAdmin(!tmpFlg))
|
|
@@ -240,37 +293,43 @@ class PushContainer extends Component {
|
|
|
let tmpPage = ++page
|
|
|
store.dispatch(initItemList(tmpPage,true))
|
|
|
}
|
|
|
- floderRename(){//文件夹重命名
|
|
|
+ floderRename(name,id){//文件夹重命名
|
|
|
this.setState({
|
|
|
type: 5,
|
|
|
- message:'文件夹重命名',
|
|
|
- title: '文件夹重命名',
|
|
|
- text: 'text',
|
|
|
+ title: '重命名文件夹',
|
|
|
okText: '保存',
|
|
|
+ floderName:name,
|
|
|
+ folderId:id,
|
|
|
okBorderColor: '#3B9ED0',
|
|
|
okColor: '#fff',
|
|
|
- oKBg: '#3B9ED0'
|
|
|
+ oKBg: '#3B9ED0',
|
|
|
+ },()=>{
|
|
|
+ this.setState({
|
|
|
+ message:this.changeFloderTitle()
|
|
|
+ })
|
|
|
})
|
|
|
store.dispatch(changeVisible(true))
|
|
|
}
|
|
|
- changeTitle() {
|
|
|
+ changeFloderTitle() {
|
|
|
return <div className={style['box']}>
|
|
|
<div className={style['iptWrap']}>
|
|
|
<div className={style.name}>
|
|
|
- <span className={style.leftName}>文件夹名称:</span>
|
|
|
- <input className={style['ipt']}
|
|
|
+ <span className={style.leftName}>名称:</span>
|
|
|
+ <input
|
|
|
placeholder="请输入文件夹名称"
|
|
|
type="text"
|
|
|
maxLength='30'
|
|
|
+ value={this.state.floderName}
|
|
|
onInput={(e) => {
|
|
|
- this.handleInput(e)
|
|
|
+ this.handleInputFloder(e)
|
|
|
}}
|
|
|
onPropertyChange={(e) => { // 兼容ie
|
|
|
- this.handleInput(e)
|
|
|
+ this.handleInputFloder(e)
|
|
|
}}
|
|
|
onKeyPress={e => this.keypress(e)}
|
|
|
/>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
}
|
|
|
floderDelete(){//文件夹删除
|
|
@@ -278,45 +337,49 @@ class PushContainer extends Component {
|
|
|
}
|
|
|
|
|
|
makeSure() {
|
|
|
- if (this.state.type == 1) {
|
|
|
+ const {type,id,title,tmpFolder,folderNameVal,text,fstName,spell,currId,deptId,folderId} = this.state
|
|
|
+ if (type == 1) {
|
|
|
if(this.props.admin){
|
|
|
- store.dispatch(delItemAdmin(this.state.id))
|
|
|
+ store.dispatch(delItemAdmin(id,folderId))
|
|
|
}else{
|
|
|
- store.dispatch(delItem(this.state.id))
|
|
|
+ store.dispatch(delItem(id))
|
|
|
}
|
|
|
store.dispatch(changeVisible(false))
|
|
|
- } else if (this.state.type == 2) {
|
|
|
+ } else if (type == 2) {
|
|
|
if(this.props.admin){
|
|
|
store.dispatch(delBatchItemAdmin(this.props.checkItemsAdmin))
|
|
|
}else{
|
|
|
store.dispatch(delBatchItem(this.props.checkItems))
|
|
|
}
|
|
|
store.dispatch(changeVisible(false))
|
|
|
- } else if (this.state.type == 3) {
|
|
|
- if (this.state.title == this.state.text) {
|
|
|
+ } else if (type == 3) {
|
|
|
+ if (title == text &&tmpFolder==folderNameVal&&fstName==spell) {
|
|
|
store.dispatch(changeVisible(false))
|
|
|
Notify.success('标题修改成功');
|
|
|
return;
|
|
|
}
|
|
|
- if ((this.state.title).trim() == '') {
|
|
|
+ if (title.trim() == '') {
|
|
|
Notify.info('请输入模板名称');
|
|
|
return;
|
|
|
}
|
|
|
let tempObj = {
|
|
|
- id: this.state.currId,
|
|
|
- title: this.state.title,
|
|
|
- deptId:this.state.deptId
|
|
|
+ id: currId,
|
|
|
+ title: title,
|
|
|
+ deptId:deptId,
|
|
|
+ folderId:folderId,
|
|
|
+ folderName:folderNameVal,
|
|
|
+ spell:fstName
|
|
|
}
|
|
|
if(this.props.admin){
|
|
|
store.dispatch(changeTitleAsyncAdmin(tempObj))
|
|
|
}else{
|
|
|
store.dispatch(changeTitleAsync(tempObj))
|
|
|
}
|
|
|
- } else if (this.state.type == 4) { //模板引入
|
|
|
+ } else if (type == 4) { //模板引入
|
|
|
if(this.props.admin){
|
|
|
- store.dispatch(setPageViewAdmin(this.state.id))
|
|
|
+ store.dispatch(setPageViewAdmin(id))
|
|
|
}else{
|
|
|
- store.dispatch(setPageView(this.state.id))
|
|
|
+ store.dispatch(setPageView(id))
|
|
|
}
|
|
|
store.dispatch(changeVisible(false))
|
|
|
}
|
|
@@ -334,8 +397,25 @@ class PushContainer extends Component {
|
|
|
floderActionDo(id){
|
|
|
store.dispatch(floderAction(id))
|
|
|
}
|
|
|
+ handleFolderShow(){
|
|
|
+ const {folderListShow} = this.state
|
|
|
+ this.setState({
|
|
|
+ folderListShow:!folderListShow
|
|
|
+ })
|
|
|
+ }
|
|
|
+ setFolderId(id,name){//文件夹
|
|
|
+ this.setState({
|
|
|
+ folderId :id,
|
|
|
+ folderNameVal:name,
|
|
|
+ folderListShow:false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ newFolder(flg){
|
|
|
+ store.dispatch(folderModal(flg))
|
|
|
+ }
|
|
|
render() {
|
|
|
- const { activeId, checkItems,selectTemp, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin,clearSearch } = this.props;
|
|
|
+ const { activeId, checkItems,selectTemp,folderListContentArr, visible, showMsg,hasMore,current,floderListAdmin, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin,clearSearch } = this.props;
|
|
|
+ const { type,okBorderColor,okColor,oKBg,okText,message,folderListShow } = this.state
|
|
|
return <div className={style["container"]} ref={this.$cont} >
|
|
|
<Tab tabs={this.state.tabs}
|
|
|
activeId={activeId}
|
|
@@ -371,6 +451,7 @@ class PushContainer extends Component {
|
|
|
floderAction={this.floderActionDo}
|
|
|
floderDelete={this.floderDelete}
|
|
|
floderRename={this.floderRename}
|
|
|
+ folderListContentArr={folderListContentArr}
|
|
|
></TemplateItems>
|
|
|
<MedicalInfoContainer></MedicalInfoContainer>
|
|
|
</TemplateContainer>
|
|
@@ -379,14 +460,47 @@ class PushContainer extends Component {
|
|
|
visible={visible}
|
|
|
confirm={this.makeSure}
|
|
|
close={this.handleClose}
|
|
|
- title={this.state.title}
|
|
|
+ title={type==5?'重命名文件夹':type==3?'修改模板':null}
|
|
|
cancel={this.handleClose}
|
|
|
- okText={this.state.okText}
|
|
|
- okBorderColor={this.state.okBorderColor}
|
|
|
- okColor={this.state.okColor}
|
|
|
- oKBg={this.state.oKBg}
|
|
|
+ okText={okText}
|
|
|
+ width={type==5||type==3?500:300}
|
|
|
+ height={type==3&&admin?280:200}
|
|
|
+ okBorderColor={okBorderColor}
|
|
|
+ okColor={okColor}
|
|
|
+ oKBg={oKBg}
|
|
|
+ borderBtm={type==5||type==3?'1px solid #ccc':null}
|
|
|
>
|
|
|
- {this.state.message}
|
|
|
+ {message}
|
|
|
+ {
|
|
|
+ admin&&type==3?<div className={style.department}>
|
|
|
+ <span className={style.leftName}>存储为:</span>
|
|
|
+ <div className={style.selectFolder}>
|
|
|
+ <input className={style.selectFolderIpt}
|
|
|
+ type="text"
|
|
|
+ maxLength='30'
|
|
|
+ readOnly
|
|
|
+ value={this.state.folderNameVal}
|
|
|
+ onClick={(e) => {
|
|
|
+ this.handleFolderShow(e)
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <img src={slideDown} alt=""/>
|
|
|
+ </div>
|
|
|
+ {
|
|
|
+ floderListAdmin.length>0&&folderListShow&&<ul className={`${style.departLis} ${style.departLisFolder}`}>
|
|
|
+ {
|
|
|
+ floderListAdmin.map((item,idx)=>{
|
|
|
+ return <li onClick={()=>this.setFolderId(item.id,item.name)}>
|
|
|
+ {item.name}
|
|
|
+ </li>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </ul>
|
|
|
+ }
|
|
|
+ <span className={style.newFolder} onClick={()=>this.newFolder(true)}>新建文件夹</span>
|
|
|
+ {/* <span className={style.mangerFolder}>管理文件夹</span> */}
|
|
|
+ </div>:null
|
|
|
+ }
|
|
|
</ConfirmModal>
|
|
|
<CopyRightContainer />
|
|
|
</div>
|
|
@@ -413,6 +527,9 @@ const mapStateToProps = (state) => {//console.log(state)
|
|
|
clearSearch:state.print.clearSearch,
|
|
|
|
|
|
selectTemp:state.tabTemplate.selectTemp,
|
|
|
+ floderListAdmin:state.tabTemplate.floderListAdmin,
|
|
|
+ folderListContentArr:state.tabTemplate.folderListContentArr,
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|