mainSuit.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
  2. import config from '@config/index.js';
  3. function insertPro(data,processModule){//插入添加病情变化模板
  4. let index;
  5. for(let i=0; i<data.length; i++){
  6. if(data[i].flag && data[i].flag==3 ){
  7. index = i;
  8. }
  9. }
  10. for(let j=0; j<processModule.length; j++){
  11. let pos = index + j;
  12. data.splice(pos,0,processModule[j]);
  13. }
  14. return data;
  15. }
  16. //获取主诉模板
  17. export const setMainMoudle = (state,action) => {
  18. const res = Object.assign({},state);
  19. // const emptySpan = JSON.parse(config.textLabel);
  20. // let data = action.data.push(emptySpan);
  21. res.moduleData = action.data;
  22. res.saveText = res.save||[];
  23. res.addSmoduleData = action.addSymptom;
  24. res.addModuleName = action.addModuleName;
  25. res.update=Math.random();
  26. return res;
  27. }
  28. //获取常见症状
  29. export const getCommSymptoms = (state,action) => {
  30. const res = Object.assign({},state);
  31. res.CommonSymptoms = action.data;
  32. return res;
  33. }
  34. //清除常见症状
  35. export const clearCommSymptoms = (state,action) => {
  36. const res = Object.assign({},state);
  37. res.CommonSymptoms = [];
  38. return res;
  39. }
  40. //获取大数据推送症状
  41. export const getBigSymptom = (state,action) => {
  42. const res = Object.assign({},state);
  43. res.showDrop = !res.showDrop;
  44. res.bigDataSymptom = action.data;//推送数据
  45. let inlineDatas = res.data;
  46. const index = action.info.ikey;
  47. let labelInx = getLabelIndex(index);
  48. // 添加症状 暂时剔除没有id、questionMapping字段的数据
  49. let pushDataList = action.data;
  50. /*let pushDataList = action.data.filter(function(item){
  51. return item.id
  52. });*/
  53. let dataList = inlineDatas[labelInx].questionMapping;
  54. for(let k=0; k<dataList.length; k++){
  55. if(dataList[k].controlType == 99){
  56. dataList[k].questionDetailList = pushDataList;
  57. }
  58. }
  59. return res;
  60. }
  61. //点击插入新模板--添加病程变化
  62. export const handleTailClick = (state,action)=>{
  63. const res = Object.assign({},state);
  64. res.showDrop = !res.showDrop;
  65. let num = res.moduleNum.num;
  66. num++;
  67. const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
  68. // const addDatas = JSON.parse(JSON.stringify(fullfillText(action.info).newArr));
  69. let datas = JSON.parse(JSON.stringify(res.data));
  70. let leng = datas.length;
  71. for(let i=0; i<addSmoduleData.length; i++){
  72. addSmoduleData[i].pos = num;
  73. // let pos = leng-1+i;
  74. /* let pos = leng-2+i;
  75. datas.splice(pos,0,addDatas[i]);*/
  76. }
  77. res.data = insertPro(datas,addSmoduleData);
  78. res.saveText = fullfillText(res.data).saveText;
  79. res.moduleNum.num = num;
  80. return res;
  81. }
  82. //将选择的常见症状插入
  83. export const insertMain = (state,action) => {
  84. const res = Object.assign({},state);
  85. const item = action.item.name;
  86. const id = action.item.questionId;
  87. // 将选中的id存起,现病史时获取模板
  88. let data = JSON.parse(JSON.stringify(res.moduleData));
  89. const text = {id:id,name:item,value:item,tagType:config.tagType,exist:1};
  90. let inserIndx = null;
  91. data.map((it,i)=>{
  92. if(it.flag == 1){//在此处插入主诉数据
  93. inserIndx = i;
  94. }
  95. })
  96. data.splice(inserIndx-1,1,text);
  97. // data[inserIndx-1] = text;//替换空标签
  98. res.data = data;
  99. res.saveText = [];//将手动输入的值清掉
  100. // res.saveText[inserIndx] = text.name;
  101. res.saveText = fullfillText(res.data).saveText;
  102. res.mainIds.push(id);
  103. res.editClear = false;//主诉框编辑状态
  104. res.update=Math.random();
  105. return res;
  106. }
  107. function getTextLabel(id,name,flag){
  108. // exist 主症状1,伴随2
  109. return {id:id,name:name,value:name,tagType:config.tagType,exist:flag};
  110. }
  111. //多选标签选中确定处理
  112. export const confirm = (state,action) =>{
  113. const res = Object.assign({},state);
  114. let arr = res.data;
  115. let saveText = JSON.parse(JSON.stringify(res.saveText));
  116. const {exists,withs,ikey,withsName,existsName,ban} = action.data;
  117. let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
  118. let length = exists.length;
  119. let labelIndx = parseInt(ikey);//当前点击标签的index
  120. // 取第一个添加症状的主症状和伴随
  121. if(!arr[labelIndx].pos){
  122. let existsId = getIds(exists);
  123. let withsId = getIds(withs);
  124. res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
  125. }
  126. // 第二病程-伴位置处理
  127. let forwardId;
  128. let text;
  129. for(let n=labelIndx-1; n>0; n--){
  130. if(arr[n].id==8){
  131. forwardId = n;
  132. continue;
  133. }
  134. }
  135. if(forwardId){
  136. text = saveText.slice(forwardId,labelIndx);
  137. let index = text.indexOf('伴');
  138. if(index==-1){//没有伴,直接插入ikey前
  139. if(exists.length > 0){
  140. for(let i=0; i<exists.length; i++){
  141. let pos = labelIndx + i;
  142. arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
  143. res.saveText[pos] = exists[i].name;
  144. }
  145. }
  146. if(withs.length > 0){
  147. let newWiths = JSON.parse(JSON.stringify(withs));
  148. if(banText){
  149. newWiths.unshift(banText);
  150. }
  151. for(let j=0; j<newWiths.length; j++){
  152. let withsPos = labelIndx +length + j;
  153. arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
  154. res.saveText[withsPos] = newWiths[j].name;
  155. }
  156. }
  157. }else{//有伴
  158. if(exists.length > 0){
  159. for(let i=0; i<exists.length; i++){
  160. let pos = index + i;
  161. arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
  162. res.saveText[pos] = exists[i].name;
  163. }
  164. }
  165. if(withs.length>0){//有伴插到ikey前既可
  166. for(let j=0; j<withs.length; j++){
  167. // let withsPos = labelIndx + j;
  168. let withsPos = labelIndx +length + j;
  169. arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
  170. res.saveText[withsPos] = withs[j].name;
  171. }
  172. }
  173. }
  174. }else{
  175. let text = saveText.slice(0,labelIndx);
  176. let index = text.indexOf('伴');
  177. if(index==-1){//没有伴,直接插入ikey前
  178. if(exists.length > 0){
  179. for(let i=0; i<exists.length; i++){
  180. let pos = labelIndx + i;
  181. arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
  182. res.saveText[pos] = exists[i].name;
  183. }
  184. }
  185. if(withs.length > 0){
  186. let newWiths = JSON.parse(JSON.stringify(withs));
  187. if(banText){
  188. newWiths.unshift(banText);
  189. }
  190. for(let j=0; j<newWiths.length; j++){
  191. let withsPos = labelIndx +length + j;
  192. arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
  193. res.saveText[withsPos] = newWiths[j].name;
  194. }
  195. }
  196. }else{//有伴
  197. if(exists.length > 0){
  198. for(let i=0; i<exists.length; i++){
  199. let pos = index + i;
  200. arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
  201. res.saveText[pos] = exists[i].name;
  202. }
  203. }
  204. if(withs.length>0){//有伴插到ikey前既可
  205. for(let j=0; j<withs.length; j++){
  206. // let withsPos = labelIndx + j;
  207. let withsPos = labelIndx +length + j;
  208. arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
  209. res.saveText[withsPos] = withs[j].name;
  210. }
  211. }
  212. }
  213. }
  214. res.data = arr;
  215. res.saveText = fullfillText(arr).saveText;
  216. res.update=Math.random();
  217. return res;
  218. };
  219. // 普通多选确定事件
  220. export const commConfirm=(state,action)=>{
  221. const res = Object.assign({},state);
  222. const {exists,ikey,existsName} = action.data;
  223. // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
  224. let names=existsName;
  225. let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
  226. if(pattern.test(existsName)){
  227. names = existsName.substr(0,existsName.length-1);
  228. }
  229. let arr = res.data;
  230. arr[ikey].value = names;
  231. res.saveText[ikey] = names;
  232. res.selecteds[ikey] = action.data;
  233. res.update=Math.random();
  234. return res;
  235. }
  236. export const setSearch = (state,action)=>{
  237. const res = Object.assign({},state);
  238. res.showDrop = !res.showDrop;//防止不更新
  239. let searchData = action.data;
  240. res.searchDatas = searchData;
  241. res.searchStr = action.inpStr;
  242. return res;
  243. }
  244. //将选中的搜索结果插入
  245. export const insertSearch = (state,action)=>{
  246. // 如果没有模板就插入模板,有模板则只插入所传文字
  247. const res = Object.assign({},state);
  248. let data = res.data;
  249. let moduleData = JSON.parse(JSON.stringify(res.moduleData));
  250. let searchData = action.info.name;
  251. const id = action.info.questionId;
  252. let focusIndex = res.focusIndex;
  253. let span = action.span;
  254. let text = {id:id,name:searchData,value:searchData,tagType:config.tagType};
  255. const emptySpan = JSON.parse(config.textLabel);
  256. if(data.length==0){
  257. let inserIndx = null;
  258. moduleData.map((it,i)=>{
  259. if(it.flag == 1){//在此处插入主诉数据
  260. inserIndx = i;
  261. }
  262. })
  263. // flag=1前是文本标签就替换,否则插入
  264. const iftext = moduleData[inserIndx-1].tagType;
  265. if(iftext==config.tagType){
  266. moduleData.splice(inserIndx-1,1,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1});
  267. }else{
  268. moduleData.splice(inserIndx,0,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1});
  269. }
  270. // moduleData.splice(inserIndx,0,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1},emptySpan);
  271. res.saveText = [];//将手动输入的值清掉
  272. res.data = moduleData;
  273. // res.saveText[inserIndx] = searchData;
  274. res.saveText = fullfillText(res.data).saveText;
  275. res.mainIds.push(id);
  276. res.editClear = false;//主诉框编辑状态
  277. }else{
  278. // 替换
  279. /*span.current.innerText = '';
  280. res.data.splice(focusIndex,1,text);
  281. res.saveText[focusIndex] = searchData;
  282. res.mainIds.push(id);*/
  283. // 追加--前or后?searchStr
  284. /*const searchStr = res.searchStr;
  285. let innerText = span.current.innerText;
  286. let index = innerText.indexOf(searchStr);
  287. let value;
  288. if(index <= 1){//前
  289. value = innerText.replace(searchStr,searchData);
  290. }else{
  291. let temp = innerText.substring(0,innerText.lastIndexOf(searchStr));
  292. value = temp + searchData;
  293. }
  294. // let value = innerText + searchData;
  295. span.current.innerText = value;
  296. res.data[focusIndex].value = value;
  297. res.saveText[focusIndex] = value;*/
  298. /*******************第一病程搜索结果也移植到现病史修改(2-18)********************/
  299. // 位置判断-第一病程-主症状还是伴随 前一个标签存在 并且没有pos;
  300. // 判断在伴的前面还是后面:前exist=1(主),后exist=2(伴)
  301. let nText = {};
  302. if(focusIndex==0){
  303. nText = Object.assign({},text,{exist:1});
  304. }else{
  305. if(!data[focusIndex-1].pos){//第一病程
  306. const preText = res.saveText.slice(0,focusIndex);
  307. const ind = preText.indexOf("伴");
  308. if(ind != -1){
  309. nText = Object.assign({},text,{exist:2});
  310. }else{
  311. nText = Object.assign({},text,{exist:1});
  312. }
  313. }else{//第二及以上病程
  314. nText = Object.assign({},text);
  315. }
  316. }
  317. // 从新插入一个span标签
  318. const searchStr = res.searchStr;
  319. let innerText = span.current.innerText;
  320. const value = innerText.replace(searchStr,"");
  321. let index = innerText.indexOf(searchStr);
  322. if(index < 1){//前
  323. res.data.splice(focusIndex,0,nText);
  324. res.saveText.splice(focusIndex,0,searchData);
  325. res.data[focusIndex+1].value = value;
  326. res.saveText[focusIndex+1] = value;
  327. }else{
  328. res.data.splice(focusIndex+1,0,nText);
  329. res.saveText.splice(focusIndex+1,0,searchData);
  330. res.data[focusIndex].value = value;
  331. }
  332. span.current.innerText = value;
  333. res.mainIds.push(id);
  334. }
  335. // console.log(456,res,action);
  336. res.update=Math.random();
  337. return res;
  338. }
  339. //数字键盘选中事件
  340. export function setNumberValue(state,action){
  341. let res = Object.assign({},state);
  342. const param = action.params;
  343. const index = param.ikey;
  344. let labelInx = getLabelIndex(index);
  345. const subInx = index.substr(index.length-1);
  346. let item = res.data[labelInx];
  347. // if(param.text.trim()){
  348. if(+item.tagType===1){
  349. item.value = param.text;
  350. res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
  351. }else{
  352. item.questionMapping[subInx].value = param.text;
  353. let hasValue = false;
  354. const sub = item.questionMapping.map((it)=>{
  355. if(it.value){ //至少有一个子值才黑显
  356. hasValue = true;
  357. }
  358. return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
  359. });
  360. // res.saveText[labelInx] = sub.join(',');
  361. res.saveText[labelInx] = hasValue?sub.join(''):'';
  362. item.value = sub.join('');
  363. }
  364. /*}else{//删除完标签内容则删除该标签
  365. res.data.splice(labelInx,1);
  366. res.saveText = fullfillText(res.data).saveText;
  367. }*/
  368. res.update = Math.random();
  369. return res;
  370. }
  371. //单选下拉选中
  372. export function setRadioValue(state,action){
  373. let res = Object.assign({},state);
  374. const {ikey,id,text} = action;
  375. let labelInx = getLabelIndex(ikey);
  376. const subInx = ikey.substr(ikey.length-1);
  377. let item = res.data[labelInx];
  378. if(typeof text != 'string'){ //需要展开项--有无治疗类型
  379. const len = +item.copyType === 0?1:0;
  380. res.data.splice(labelInx,len,text);
  381. return res;
  382. }
  383. if(+item.tagType===1){
  384. item.value = text;
  385. res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
  386. item.questionDetailList.map((its)=>{
  387. if(its.id === id){
  388. its.selected = true;
  389. }else{
  390. its.selected = false;
  391. }
  392. });
  393. }else{
  394. item.questionMapping[subInx].value = text;
  395. let hasValue = false;
  396. const sub = item.questionMapping.map((it)=>{
  397. //添加选中状态
  398. it.questionDetailList.map((its)=>{
  399. if(its.id === id){
  400. its.selected = true;
  401. }else{
  402. its.selected = false;
  403. }
  404. });
  405. if(it.value){ //至少有一个子值才黑显
  406. hasValue = true;
  407. }
  408. return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
  409. });
  410. // res.saveText[labelInx] = sub.join(',');
  411. res.saveText[labelInx] = hasValue?sub.join(''):'';
  412. item.value = sub.join('');
  413. }
  414. res.update = Math.random();
  415. return res;
  416. }
  417. //双击标签输入改变值
  418. export const changeLabelVal = (state,action)=>{
  419. const res = Object.assign({},state);
  420. const index = parseInt(action.data.ikey);
  421. const newVal = action.data.changeVal;
  422. let data = res.data;
  423. let item = data[index];
  424. const next = res.data[+index+1];
  425. const nextVal = next.value||next.name;
  426. //标签后是不是标点符号标签,是的话删除本标签时一起删除
  427. let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
  428. if(newVal&&newVal.trim()){
  429. if(item){
  430. item.value = newVal;
  431. res.saveText[index] = newVal;
  432. }
  433. }else{//删除完标签内容则删除该标签
  434. const num = nextIsDot?2:1;
  435. data.splice(index,num);
  436. // data[index].value = "";
  437. // res.data.splice(index,1);
  438. res.saveText.splice(index,1);
  439. // res.saveText[index] = "";
  440. }
  441. res.update = Math.random();
  442. return res;
  443. }
  444. // 数字键盘较特殊,有直接输入
  445. export const changeNumLabelVal = (state,action)=>{
  446. const res = Object.assign({},state);
  447. const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
  448. const index = ikey;
  449. const newVal = changeVal;
  450. let labText = totalVal?totalVal:newVal; //如单选没有前后缀
  451. let item = res.data[index];
  452. const next = res.data[+index+1];
  453. const nextVal = next.value||next.name;
  454. //标签后是不是标点符号标签,是的话删除本标签时一起删除
  455. let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
  456. if(labText.trim()){
  457. if(item){
  458. item.value = newVal;
  459. item.labelPrefix = prefix||'';
  460. item.labelSuffix = suffix||'';
  461. res.saveText[index] = labText;
  462. }
  463. }else{//删除完标签内容则删除该标签
  464. const num = nextIsDot?2:1;
  465. res.data.splice(index,num);
  466. res.saveText = fullfillText(res.data).saveText;
  467. }
  468. res.update = Math.random();//console.log(44,action,res);
  469. return res;
  470. }
  471. // 保存自由输入文本--无模板
  472. export const saveFreeVal = (state,action)=>{
  473. const res = Object.assign({},state);
  474. let data = action.data;
  475. res.saveText[0] = data;
  476. /*if(data.trim()){
  477. res.saveText[0] = data;
  478. }else{
  479. res.saveText = [];
  480. }*/
  481. res.update = Math.random();
  482. return res;
  483. }
  484. export const clearMainSuit = (state,action)=>{//回读和清除
  485. const res = Object.assign({},state);
  486. res.data = action.data;
  487. res.saveText = action.saveText;
  488. // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
  489. res.selecteds = action.selecteds?action.selecteds:[];
  490. res.mainIds = action.mainIds;
  491. if(action.editClear){
  492. res.editClear = action.editClear;
  493. }
  494. if(res.data.length > 0){//回读
  495. res.editClear = false;
  496. }
  497. return res;
  498. }
  499. //文本模式下值保存
  500. export const setTextModeValue = (state,action)=>{
  501. const res = Object.assign({},state);
  502. res.saveText[0] = action.text;
  503. return res;
  504. };
  505. //自由文本
  506. export function setCheckText(state,action) {
  507. let res = Object.assign({},state);
  508. const {i,text} = action;
  509. res.data[i].value=text;
  510. res.saveText[i] = text;
  511. /*if(res.data[i]){
  512. res.data[i].value=text;
  513. }
  514. res.saveText[i] = text;*/
  515. res.update = Math.random();
  516. return res;
  517. }
  518. //复制标签(如血压)事件
  519. export function addLabelItem(state,action){
  520. let res = Object.assign({},state);
  521. const {data,i} = action;
  522. const textLabel = JSON.parse(config.textLabel);
  523. //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
  524. if(!data) return res;
  525. res.data.splice(i+1,0,JSON.parse(data),textLabel);
  526. res.update = Math.random();
  527. return res;
  528. }
  529. //文本输入标签
  530. export function setInputLabel(state,action){
  531. let res = Object.assign({},state);//console.log(state,action)
  532. const {i,text,prefix,suffix,subIndex} = action;
  533. const item = res.data[i];
  534. if(+item.tagType===3){ //multSpred标签
  535. item.questionMapping[subIndex].value = text;
  536. let texts = item.questionMapping.map((it)=>{
  537. return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
  538. });
  539. res.saveText[i] = texts.join('');
  540. res.update = Math.random();
  541. return res;
  542. }else{
  543. if(item){
  544. item.value=text;
  545. }
  546. }
  547. res.saveText[i] = prefix+text+suffix;//console.log(res)
  548. res.update = Math.random();
  549. return res;
  550. }
  551. // backspace删除
  552. export function backspaceText(state,action){
  553. let res = Object.assign({},state);
  554. const {delIndex} = action;
  555. const data = res.data;
  556. if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
  557. // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
  558. // 前一个是文本标签或者子模板 不做处理
  559. }else if(data[delIndex-1].tagType==8){
  560. data.splice(delIndex,1);
  561. res.saveText.splice(delIndex,1);
  562. }
  563. else{
  564. data.splice(delIndex-1,2);
  565. res.saveText.splice(delIndex-1,2);
  566. }
  567. // res.saveText = fullfillText(data).saveText;
  568. res.update = Math.random();
  569. return res;
  570. }
  571. //删除后移除id
  572. export function removeId(state,action){
  573. let res = Object.assign({},state);
  574. const {index,text} = action;
  575. const data = res.data;
  576. const id = data[index].id;
  577. let ids = res.mainIds;
  578. if(ids.includes(id)){
  579. ids.splice(ids.indexOf(id),1);
  580. }
  581. if(!data[index].value && data[index-1].tagType==8){
  582. data.splice(index,1);
  583. res.saveText.splice(index,1);
  584. }else{
  585. data[index].id = "";
  586. data[index].name = text;
  587. data[index].value = text;
  588. }
  589. res.update = Math.random();
  590. return res;
  591. }
  592. // 单列多选
  593. export function multipleComfirn(state,action){
  594. let res = Object.assign({},state);
  595. const {ikey,seleData} = action.data;
  596. let data = res.data;
  597. data[ikey].value = seleData;
  598. res.saveText[ikey] = seleData;
  599. res.selecteds[ikey] = action.data;
  600. res.update = Math.random();console.log(123,action,res);
  601. return res;
  602. }