123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- import store from '@/store'
-
- export function getDataConfig(module, field) {
- var storeConfigList = store.getters.configlist
- var moduleConfig = storeConfigList[module]
- if (moduleConfig == undefined) {
- return false
- }
- if (module === 'summary' || module === 'education' || module === 'nursing_record' || module === 'special_record' || module == 'dialysis_remark' || module=='catheter_operation' || module=='befor_symptoms') {
- var Aresult = []
- for (var j = 0; j < moduleConfig.length; j++) {
- var Atemp = []
- var Aconfig = moduleConfig[j]
- Atemp['id'] = Aconfig.value
- Atemp['value'] = Aconfig.content
- Atemp['text'] = Aconfig.title
- Aresult.push(Atemp)
- }
- return Aresult
- } else {
- for (var i = 0; i < moduleConfig.length; i++) {
- var newConfig = moduleConfig[i]
- if (newConfig.field_name === field) {
- var result = []
- if (newConfig.childs != null) {
- for (var j = 0; j < newConfig.childs.length; j++) {
- var tempconfig = newConfig.childs[j]
- var temp = []
- temp['id'] = tempconfig.value
- temp['name'] = tempconfig.name
- result.push(temp)
- }
- }
- return result
- }
- }
- }
- }
-
- export function getDictionaryDataConfig(module, field) {
- var storeConfigList = store.getters.dictionary_configlist
- var moduleConfig = storeConfigList[module]
- if (moduleConfig == undefined) {
- return false
- }
- if (module === 'summary' || module === 'education' || module === 'nursing_record' || module === 'special_record'|| module=='befor_symptoms') {
- var Aresult = []
- for (var j = 0; j < moduleConfig.length; j++) {
- var Atemp = []
- var Aconfig = moduleConfig[j]
- Atemp['id'] = Aconfig.value
- Atemp['value'] = Aconfig.content
- Atemp['text'] = Aconfig.title
- Aresult.push(Atemp)
- }
- return Aresult
- } else {
- for (var i = 0; i < moduleConfig.length; i++) {
- var newConfig = moduleConfig[i]
- if (newConfig.field_name === field) {
- var result = []
- if (newConfig.childs != null) {
- for (var j = 0; j < newConfig.childs.length; j++) {
- var tempconfig = newConfig.childs[j]
- var temp = []
- temp['id'] = tempconfig.value
- temp['name'] = tempconfig.name
- result.push(temp)
- }
- }
- return result
- }
- }
- }
- }
-
-
- export function getManageMentDataConfig(module, field) {
- var storeConfigList = store.getters.manage_configlist
- console.log("storeConfigListwwowowowowwo",storeConfigList)
- var moduleConfig = storeConfigList[module]
- if (moduleConfig == undefined) {
- return false
- }
- if (module === 'summary') {
- console.log("哈哈哈hhhwowowowoo")
- var Aresult = []
- for (var j = 0; j < moduleConfig.length; j++) {
- var Atemp = []
- var Aconfig = moduleConfig[j]
- Atemp['id'] = Aconfig.value
- Atemp['value'] = Aconfig.content
- Atemp['text'] = Aconfig.title
- Aresult.push(Atemp)
- }
- // console.log("Aresultwoowowowowow",Aresult)
- return Aresult
- } else {
- for (var i = 0; i < moduleConfig.length; i++) {
- var newConfig = moduleConfig[i]
- if (newConfig.field_name === field) {
- var result = []
- if (newConfig.childs != null) {
- for (var j = 0; j < newConfig.childs.length; j++) {
- var tempconfig = newConfig.childs[j]
- var temp = []
- temp['id'] = tempconfig.value
- temp['name'] = tempconfig.name
- result.push(temp)
- }
- }
- return result
- }
- }
- }
- }
|