1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853 |
- var CMSFunction = {
- ComboGrid: {
- SetValue: function (source, text, value) {
- var opts = $.data(source[0], "combogridX").options;
- if (text == "") {
- $(source).find('.combo-text').val(opts.emptyText);
- } else {
- $(source).find('.combo-text').val(text);
- }
- $(source).find('.combogridX-value').val(value);
- $(source).attr("loaded", "true");
-
- if ("undefined" != typeof EasyUIValidate) {
- if (EasyUIValidate.Events.ComboGridXOnChange) {
- EasyUIValidate.Events.ComboGridXOnChange.call(this);
- }
- }
- if (opts.onChange) opts.onChange.call(source);
- },
- OnLoadSuccessFunction: function (source, tableData, callBack) {
- var opts = $.data(source[0], "combogridX").options;
- var callbackCalled = false;
- var text = source.find(".combo-text").val();
- if (text == '' || text == null) {
- source.find('.combogridX-value').val("");
- }
- if (opts.value != '' && opts.value != -1 && $(source).attr("loaded") != "true") {
- callbackCalled = true;
- var dataGrid = source.find('.easyui-cmsXDataTable');
- var formData;
- if (opts.formData) {
- formData = $.unpackFormParams(opts.formData.QueryParamsDatas);
- } else {
- formData = new Object();
- }
- formData.Attribute = "{ \"ID\":\"00000000-0000-0000-0000-000000000000\",\"Value\":\"" + opts.valueField
- + "\",\"ControlType\":\"TextBox\"}";
- formData.Condition = "=";
- formData[opts.valueField + "_QueryTextBox"] = opts.value;
- var jsonString = "({'QueryParamsDatas':'" + $.packFormParams(formData) + "',page: 0,rows: 10 })";
- // var jsonString = "({'QueryParamsDatas':'Attribute|*|{\"ID\":\"00000000-0000-0000-0000-000000000000\",\"Value\":\"" + opts.valueField
- // + "\",\"ControlType\":\"TextBox\"}|@|Condition|*|=|@|ConditionValue|*|" + opts.value
- // + "|@|" + opts.valueField + "_QueryTextBox|*|" + opts.value + "|@|',page: 0,rows: 10 })";
- try {
- var dataGridOptions = dataGrid.cmsXDataTable("options");
- var url = dataGridOptions.url;
- $.post(url, eval(jsonString), function (data) {
- if (data.rows.length > 0) {
- CMSFunction.ComboGrid.SetValue(source, data.rows[0][opts.textField], opts.value);
- if (callBack) {
- callBack.call(source, tableData);
- }
- }
- });
- }
- catch (err) { }
- }
- var nowVal = source.find('.combogridX-value').val();
- if (!(nowVal && nowVal != "") && opts.selectedIndex != null && $(source).attr("loaded") != "true") {
- if (tableData.rows.length > opts.selectedIndex) {
- CMSFunction.ComboGrid.SetValue(source, tableData.rows[opts.selectedIndex][opts.textField], tableData.rows[opts.selectedIndex][opts.valueField]);
- }
- }
- //source.find(".combogridX-expander").width(source.find("table").width() + 16);
- source.find('tr.row>td').css("cursor", "pointer");
- source.find('tr.row').click(function () {
- var comboGrid = $(this).parents('.easyui-combogridX:first');
- var grid = $(this).parents('.easyui-cmsXDataTable:first');
- var opts = $.data(comboGrid[0], "combogridX").options;
- var gridOpts = $.data(grid[0], "cmsXDataTable").options;
- var gridData = gridOpts.data;
- var rowIndex = parseInt($(this).attr("xRowIndex"));
- var rowData = gridData.rows[rowIndex];
- CMSFunction.ComboGrid.SetValue(comboGrid, rowData[opts.textField], rowData[opts.valueField]);
- if (opts.onSelect) opts.onSelect.call(this, rowData);
- comboGrid.find(".combogridX-expander").css("display", "none");
- });
- var expander = source.find(".combogridX-expander");
- // expander.css("width", "");
- source.combogridX("setExpanderPosition", {
- expander: expander, dropdown: source, arrow: source.find('.combo-arrow')
- });
- if (callBack && !callbackCalled) {
- callBack.call(source, tableData);
- }
- }
- },
- Tree: {
- setParentsChecked: function (jq, node, ischeck) {
- var parent = jq.tree('getParent', node.target);
- if (parent) {
- if (parent.checked != ischeck) {
- if (!parent.attributes) parent.attributes = new Object();
- parent.attributes.isRecursionParent = true;
- jq.tree('update',{ target: parent.target, attributes: parent.attributes });
- if (ischeck) {
- jq.tree('check', parent.target);
- } else {
- jq.tree('uncheck', parent.target);
- }
- }
- //CMSFunction.Tree.setParentsChecked(jq, parent, ischeck);
- }
- },
- setChildrenChecked: function (jq, node, checked) {
- var childNodes = jq.tree('getChildren', node.target);
- for (var i = 0; i < childNodes.length; i++) {
- if (childNodes[i].checked != checked) {
- if (!childNodes[i].attributes) childNodes[i].attributes = new Object();
- childNodes[i].attributes.isRecursionChild = true;
- jq.tree('update',{ target: childNodes[i].target, attributes: childNodes[i].attributes });
- if (checked) jq.tree('check', childNodes[i].target);
- else jq.tree('uncheck', childNodes[i].target);
- }
- }
- },
- OnBeforeCheck: function (node, checked) {
- var treeView = $(this);
- var opts = treeView.tree('options');
-
- if (!node.attributes) node.attributes = new Object();
- if (!opts.cascadeCheck) {
- if (checked == node.checked) { return true; }
- if (checked) {
- if (!node.attributes.isRecursionChild) {
- CMSFunction.Tree.setParentsChecked(treeView, node, checked);
- }
- }
- if (!node.attributes.isRecursionParent) {
- CMSFunction.Tree.setChildrenChecked(treeView, node, checked);
- }
- node.attributes.isRecursionParent = false;
- node.attributes.isRecursionChild = false;
- treeView.tree('update',{ target: node.target, attributes: node.attributes });
- // else {
- // //opts.cascadeCheck = false;
- // var childNodes = treeView.tree('getChildren', node.target);
- // for (var i = 0; i < childNodes.length; i++) {
- // if (checked) treeView.tree('check', childNodes[i].target);
- // else treeView.tree('uncheck', childNodes[i].target);
- // }
- // }
- }
- },
- CheckBranch: function () {
- var parentid = event.srcElement.id;
- var myCheck = $(event.srcElement).attr("checked");
- $(event.srcElement).find("input[id^='" + parentid + "']").each(function () {
- if (!myCheck)
- { $(this).removeAttr("checked"); }
- else
- { $(this).attr("checked", myCheck); }
- });
- },
- OnClick: function (node) {
- var tree = $(node.target).parents('.easyui-tree');
- if (tree.tree('getChildren', node.target).length > 0) {
- tree.tree('toggle', node.target);
- }
- }
- },
- DataTable: {
- TriggerIndex: null,
- TriggerData: null,
- /// <summary>
- /// <para>本对象专门用于操作jQueryEasyUI框架的DataGrid</para>
- /// </summary>
- OnLoadSuccessFunction: function (data, callBack) {
- var target = $(this);
- var comboGrid = $(this).parents('.easyui-combogridX:first');
- if (comboGrid.length > 0) {
- CMSFunction.ComboGrid.OnLoadSuccessFunction(comboGrid, data, callBack);
- } else {
- if (callBack) {
- callBack.call(this, data);
- }
- }
- },
- CorssRowsStylerFunction: function (value, row, index) {
- if (index % 2 != 0) { //偶数行
- return 'background-color:#DAEEE1;';
- } else { //奇数行
- }
- },
- ColumnFormatterFunction: function (value, row, index, formatType, formatString, customFormatFun, overflowlength) {
- if (formatType == FormatType.None) {
- if (!value && value != 0) {
- value = "";
- }
- } else if (formatType == FormatType.DateTime) {
- if (!value && value != 0) {
- value = "";
- }
- else {
- try{
- value = value.toDateString(formatString);
- }
- catch(error){}
- }
- }
- if (overflowlength > 3) {
- value = value.toString().length <= overflowlength ? value : value.toString().substring(0, overflowlength - 3) + '...';
- }
- if (customFormatFun) {
- return customFormatFun.call(this, index, row, value);
- }
- return value;
- },
- OperaterColumnFormatterFunction: function (value, row, index, buttonArrayString) {
- var htmlString = " ";
- buttonArrayString = buttonArrayString.replace(/\^\^/g, "\"");
- var buttonArray = $.parseJSON(buttonArrayString);
- for (var i = 0; i < buttonArray.length; i++) {
- htmlString += buttonArray[i][i] + " ";
- }
- return htmlString;
- },
- LinkButtonColumnFormatterFunction: function (value, row, index, text, handleScript, formatType, formatString, overflowlength, emptyText) {
- var content = (text ? text : (!value && value != 0 ? "" : value));
- if(emptyText == undefined){
- emptyText = "";
- }
- if (content.length == 0 && emptyText.length > 0) {
- content = emptyText;
- }
- if (overflowlength > 3) {
- content = content.length < overflowlength ? content : content.substring(0, overflowlength - 3) + '...';
- }
- var html = "<a href=\"javascript:void(0);\" onclick=\"return " + handleScript + "(" + index + ",$(this).closest('.easyui-cmsXDataTable').cmsXDataTable('getRows')[" + index + "]);\" >" + content + "</a>";
- return html;
- },
- GetRowData: function (table) {
- /// <summary>
- /// <para>获取table中所有被选中的数据(最后返回的是数据是JSON格式的String类型数据)</para>
- /// <param name="table">jQuery对象,不传则默认为当前选项卡中的第一个DataGrid</param>
- /// </summary>
- var $table = null;
- if (table == undefined || table == null) {
- var $tabs = $('#index_center').tabs();
- $table = $tabs.tabs('getSelected').find("div.easyui-cmsXDataTable").eq(0);
- } else {
- $table = $(table);
- }
- if ($table == null || $table == undefined) {
- return ""
- }
- ;
- var rowsData = $table.cmsXDataTable('getSelections');
- if (rowsData.length > 0) {
- for (var i = 0; i < rowsData.length; i++) {
- var data = rowsData[i];
- data = BowinFunction.Untility.ConvertObjectDateFormat(data);
- }
- }
- // return rowsData == null ? "" : rowsData.length > 1 ? JSON.stringify(rowsData) : "[" + JSON.stringify(rowsData) + "]";
- return rowsData == null ? "" : JSON.stringify(rowsData);
- },
- GetCurrentRowData: function (obj) {
- /// <summary>
- /// <para>获取ojb对象所在行的数据(最后返回的是数据是JSON格式的String类型数据)</para>
- /// </summary>
- var rowIndex = $(obj).closest('tr').attr("xRowIndex");
- var rowDatas = $(obj).closest('.easyui-cmsXDataTable').cmsXDataTable("getRows");
- var data = BowinFunction.Untility.ConvertObjectDateFormat(rowDatas[rowIndex]);
- return "[" + JSON.stringify(data) + "]";
- }
- },
- DataTableFormatter: {
- TwoDigit: function (index, row, value) {
- if (!value || isNaN(value)) {
- if(value === 0)//判断是否为0
- {
- return value.toFixed(2).toString();
- }
- return "";
- }
- return value.toFixed(2).toString();
- }
- },
- DragDrop: {
- dragX: 0,
- dragY: 0,
- offsetX: 0,
- offsetY: 0,
- isInnerDrag: false,
- curPopupContainerItem: null,
- DropContainerItemClick: function (e) {
- var x = e.x || e.layerX || 0;
- var y = e.y || e.layerY || 0;
- var containerID = $(e.srcElement).parent().parent().attr("id");
- var menuID = containerID + "_menu";
- CMSFunction.DragDrop.curPopupContainerItem = $(e.srcElement).parent();
- $("#" + menuID).menu("show", { left: x, top: y });
- },
- DropFunc: function (e, source) {
- if (CMSFunction.DragDrop.isInnerDrag != true) {
- var newObj = $(source).clone();
- var myLeft = e.currentTarget.clientLeft;
- var myTop = e.currentTarget.clientTop;
- var myWidth = e.currentTarget.clientWidth;
- var myHeight = e.currentTarget.clientHeight;
- var myObj = e.currentTarget;
- var opts = $.data(this, "droppableContainer").options;
- newObj.css('top', CMSFunction.DragDrop.dragY - CMSFunction.DragDrop.offsetY)
- .css('position', 'absolute')
- .css('left', CMSFunction.DragDrop.dragX - CMSFunction.DragDrop.offsetX);
- newObj.find(".draggableTitle").css("color", opts.foreColor)
- newObj.appendTo($(this));
- newObj.draggable({
- handle: '.draggableTitle',
- onDrag: function (e) {
- CMSFunction.DragDrop.dragX = e.clientX;
- CMSFunction.DragDrop.dragY = e.clientY;
- },
- onBeforeDrag: function (e) {
- CMSFunction.DragDrop.offsetX = e.offsetX + e.srcElement.offsetLeft;
- CMSFunction.DragDrop.offsetY = e.offsetY + e.srcElement.offsetTop;
- CMSFunction.DragDrop.isInnerDrag = true;
- },
- onStopDrag: function (e) {
- if (e.clientX < myLeft || e.clientX > myLeft + myWidth || e.clientY < myTop || e.clientY > myTop + myHeight) {
- $(e.srcElement).offsetParent().remove();
- }
- }
- });
- }
- var hidden = $(e.currentTarget.nextSibling);
- hidden.val('');
- $.each($(e.currentTarget).find('.easyui-draggable'), function () {
- var valStr = '';
- if (hidden.val() != '') valStr = ',';
- var titleDiv = $(this).find('.draggableTitle');
- valStr += titleDiv.attr('value') + '|' + titleDiv.html() + '|' + $(this).css('left').replace("px", "") + '|' + $(this).css('top').replace("px", "");
- hidden.val(hidden.val() + valStr);
- });
- }
- }
- };
- //2013-05-31 begin added by pengbb 新增部门选择控件,由项目易系统开发提供
- var departmentSelector = function (dataUrl, multipleChoice, handlers) {
- var win;
- var tree;
- var pitchOnDataGrid;
- var rightTopQuey;
- var hasEasyUI = function (elementTypeName) {
- if ($(elementTypeName).length > 0) {
- return true;
- } else {
- return false;
- }
- }
- //private 创建Html元素
- var createElement = function (elementTypeName, elements, parentElments) {
- $(elementTypeName).removeClass();
- if (typeof parentElments != "undefined" && typeof elements == "string") {
- var elementsObject = $(elements);
- parentElments.append(elementsObject);
- return elementsObject;
- }
- else {
- if (typeof elements == "string")
- return $(elements);
- }
- };
- var createLinkButton = function (elements) {
- var links = elements.find("a");
- for (var i = 0; i < links.length; i++) {
- $(links[i]).linkbutton();
- }
- };
- var createTableString = function (name) {
- var table = "<table";
- return table.concat(" name='", name, "'>", "</table>");
- };
- var registEvent = function (target, eventType, handler) {
- target.unbind(eventType, handler);
- target.bind(eventType, handler);
- }
- //private 选择部门
- var selectWaitOrg = function (node) {
- var selectUser;
- if (multipleChoice) {
- selectUser = tree.tree('getChecked');
- } else {
- var selectUser = new Array();
- selectUser.push(node);
- }
- if (selectUser.length > 0) {
- if (!multipleChoice && selectUser.length > 1) {
- window.top.$.messager.alert("系统消息", "一次只能选择一个部门!");
- }
- else {
- var dataSource = "{\"total\":".concat(selectUser.length, ",", "\"rows\":[");
- for (var i = 0; i < selectUser.length; i++) {
- dataSource = dataSource.concat('{"OrgID":', "\"", selectUser[i].id, "\",", '"DepartmentName":',
- "\"", selectUser[i].text, "\"},"
- );
- }
- dataSource = dataSource.substring(0, dataSource.length - 1);
- dataSource = dataSource.concat("]}");
- pitchOnDataGrid.datagrid("loadData", $.parseJSON(dataSource));
- }
- } else if (multipleChoice == false) {
- window.top.$.messager.alert("系统消息", "未选择任何用户!");
- }
- };
- var InitGridFile = function (dataGrid, pagination, url) {
- return dataGrid.datagrid({
- url: pagination ? url : "",
- queryParams: pagination ? {
- departmentID: DepartmentID,
- userName: rightTopQuey.find("input[name='txtUserName']").val()
- } : "",
- pagination: pagination,
- pageSize: 1,
- pageList: [5, 10],
- loadMsg: "请稍等....",
- columns: [[
- { field: 'id', title: '', checkbox: true },
- { field: 'DepartmentName', title: '部门机构' }
- ]]
- });
- }
- var loadDepartmentTree = function () {
- var inputDepartment = leftQuery.find("input[name='txtDepartmentName']").val();
- $.cmsPost("/Common/GetSelectUserControlDepartmentTree",
- { departmentID: "", departmentName: inputDepartment },
- function (data) {
- $(tree).tree('loadData', data);
- });
- }
- var deleteSelectUser = function () {
- var deleteSource = pitchOnDataGrid.datagrid("getChecked");
- if (deleteSource.length > 0) {
- for (var i = 0; i < deleteSource.length; i++) {
- var rowIndex = pitchOnDataGrid.datagrid("getRowIndex", deleteSource[i]);
- pitchOnDataGrid.datagrid("deleteRow", rowIndex);
- if (multipleChoice) {
- var node = tree.tree("find", deleteSource[i].OrgID);
- tree.tree('uncheck', node.target);
- }
- }
- } else {
- window.top.$.messager.alert("系统消息", "未选中任何行!");
- }
- };
- var close = function () {
- var btnSelectOk = $((rightTopQuey.find("a"))[1]);
- btnSelectOk.unbind();
- btnSelectOk.bind("click", function () {
- var selectUser = pitchOnDataGrid.datagrid("getData");
- if (handlers instanceof Array) {
- for (var i = 0; i < handlers.length; i++) {
- handlers[i](selectUser);
- }
- } else if (typeof handlers != "undefined") {
- handlers(selectUser);
- }
- if (typeof (pitchOnDataGrid.data("SelectedUser")) != "undefined") {
- var catchData = pitchOnDataGrid.data("SelectedUser");
- pitchOnDataGrid.removeData("SelectedUser");
- }
- win.window("close");
- });
- };
- this.show = function () {
- if (true) {
- $("div[name='winOrgWarp']").remove();
- var warpElement = "<div class='selectOrg_warp clear' name='winOrgWarp'></div>";
- //var warp = createElement(".selectOrg_warp", warpElement, win);
- var warp = window.top.$(warpElement).appendTo(window.top.document.body);
- win = warp.window({
- width: 780,
- height: 530,
- modal: true,
- maximizable: false,
- title: '部门信息选择'
- });
- var elementLeft = createElement(".selectOrg_left",
- "<div class='selectOrg_left postion_border panel-margin'></div>", warp);
- var elementRight = createElement(".selectOrg_right",
- "<div class='selectOrg_right postion_border'></div>", warp);
- var leftQueryTable = "<table class='query'><tr>";
- leftQueryTable = leftQueryTable.concat("<td align='right'>渠道名称:</td>");
- leftQueryTable = leftQueryTable.concat("<td align='left'><input type='text' name='txtDepartmentName' class='selectUser_Input selectUser_inputCondition'/></td>");
- leftQueryTable = leftQueryTable.concat("<td colspan='2' align='center' ><a href='#' name='btnQueryDepartment'>查询</a> </td>");
- leftQueryTable = leftQueryTable.concat("</tr></table>");
- leftQuery = createElement(".query", leftQueryTable, elementLeft);
- createLinkButton(leftQuery);
- var left_panel_warp = createElement("div[panel_postion='org_left']", "<div class='panel_Data' panel_postion='org_left'><ul name='departmentTree'></ul></div>", elementLeft);
- left_panel_warp.panel({
- width: 350,
- height: 450,
- title: '部门信息',
- closable: false,
- collapsible: true,
- minimizable: false,
- maximizable: false
- });
- tree = $(left_panel_warp.find("ul[name='departmentTree']")[0]).tree({
- url: dataUrl + "?departmentName=",
- lines: true,
- checkbox: multipleChoice,
- onBeforeLoad: function (node, param) {
- if (node == null) {
- return true;
- } else {
- var children = $(this).tree("getChildren", node.target);
- if (children == "") {
- return true;
- } else {
- return false;
- }
- }
- },
- onClick: function (node) {
- selectWaitOrg(node);
- },
- onCheck: function (node) {
- selectWaitOrg();
- }
- });
- var rightQuery = '<p class="query_p right_query_Postion" pPostion="org_right_top"><a href="#" name="btnDel">删除</a>';
- rightQuery = rightQuery.concat(" <a href='#' name='btnSelectOk' >确定</a></p>");
- rightTopQuey = createElement("p[pPostion='org_right_top']", rightQuery, elementRight);
- createLinkButton(rightTopQuey);
- var left_panel_warp = createElement("div[panel_postion='right_selectOrg']", "<div class='panel_Data' panel_postion='right_selectOrg'></div>", elementRight);
- var pitchOnPanel = left_panel_warp.panel({
- width: 380,
- height: 450,
- title: '已选部门',
- closable: false,
- collapsible: true,
- minimizable: false,
- maximizable: false
- });
- var pitchOnTable = createElement("table[name='pitchOnOrgDataGrid']", createTableString("pitchOnOrgDataGrid"), pitchOnPanel);
- pitchOnDataGrid = (InitGridFile(pitchOnTable, false));
- //查询部门树
- registEvent(leftQuery.find("a:first"), "click", loadDepartmentTree);
- //删除
- registEvent($(rightTopQuey.find("a")[0]), "click", deleteSelectUser);
- //确认
- close(handlers);
- } else {
- $("div[name='winOrgWarp']").window('open');
- }
- }
- };
- //2013-05-31 end added by pengbb 新增部门选择控件,由项目易系统开发提供
- //
- var brandSelector = function (dataUrl, multipleChoice, triggerboxTarget, handlers) {
- var win;
- var tree;
- var pitchOnDataGrid;
- var rightTopQuey;
- var hasEasyUI = function (elementTypeName) {
- if ($(elementTypeName).length > 0) {
- return true;
- } else {
- return false;
- }
- }
- //private 创建Html元素
- var createElement = function (elementTypeName, elements, parentElments) {
- $(elementTypeName).removeClass();
- if (typeof parentElments != "undefined" && typeof elements == "string") {
- var elementsObject = $(elements);
- parentElments.append(elementsObject);
- return elementsObject;
- }
- else {
- if (typeof elements == "string")
- return $(elements);
- }
- };
- var createLinkButton = function (elements) {
- var links = elements.find("a");
- for (var i = 0; i < links.length; i++) {
- $(links[i]).linkbutton();
- }
- };
- var createTableString = function (name) {
- var table = "<table";
- return table.concat(" name='", name, "'>", "</table>");
- };
- var registEvent = function (target, eventType, handler) {
- target.unbind(eventType, handler);
- target.bind(eventType, handler);
- }
- //private 选择品牌
- var selectWaitOrg = function (node) {
- var selectUser;
- if (multipleChoice) {
- selectUser = tree.tree('getChecked');
- } else {
- var selectUser = new Array();
- selectUser.push(node);
- }
- var removeArray = new Array();
- for (var i = 0; i < selectUser.length; i++) {
- if (!selectUser[i].attributes.parentDepartmentID) {//查找根节点
- removeArray.push(selectUser[i]);
- }
- else {
- for (var x = 0; x < selectUser.length; x++) {
- if (selectUser[i].attributes.parentDepartmentID == selectUser[x].id) {//查找父节点
- removeArray.push(selectUser[x]);
- }
- }
- }
- }
- for (var i = 0; i < removeArray.length; i++) { //移除选中项
- for (var x = 0; x < selectUser.length; x++) {
- if (removeArray[i].id == selectUser[x].id) {
- selectUser.splice(x, 1);
- break;
- }
- }
- }
- $(tree).data("Selections", selectUser);
- };
- this.show = function () {
- if (true) {
- $("div[name='winOrgWarp']").remove();
- var warpElement = "<div class='selectOrg_warp clear' name='winOrgWarp'></div>";
- var warp = window.top.$(warpElement).appendTo(window.top.document.body);
- var elementLeft = createElement(".selectOrg_left",
- "<div class='postion_border panel-margin'></div>", warp);
- var elementRight = createElement(".selectOrg_right",
- "<div class='selectOrg_right postion_border'></div>", warp);
- var left_panel_warp = createElement("div[panel_postion='org_left']", "<div class='panel_Data' panel_postion='org_left'><ul name='departmentTree'></ul></div>", elementLeft);
- tree = $(left_panel_warp.find("ul[name='departmentTree']")[0]).tree({
- url: dataUrl + "?departmentName=",
- lines: true,
- checkbox: multipleChoice,
- onBeforeLoad: function (node, param) {
- if (node == null) {
- return true;
- } else {
- var children = $(this).tree("getChildren", node.target);
- if (children == "") {
- return true;
- } else {
- return false;
- }
- }
- },
- onLoadSuccess: function (node, data) {
- var checkedData = $(triggerboxTarget).triggerbox("getValue");
- if (checkedData != "") {
- var checkedArray = checkedData.split(';');
- for (var i = 0; i < checkedArray.length; i++) {
- var checkedNode = tree.tree("find", checkedArray[i]);
- tree.tree("check", checkedNode.target);
- }
- }
- },
- onClick: function (node) {
- selectWaitOrg(node);
- },
- onCheck: function (node) {
- selectWaitOrg();
- }
- });
- win = warp.dialog({
- width: 400,
- height: 600,
- modal: true,
- maximizable: false,
- title: '品牌信息选择',
- buttons:
- [{
- text: '确定',
- handler: function () {
- var result = $(tree).data("Selections") || new Array();
- if (handlers instanceof Array) {
- for (var i = 0; i < result.length; i++) {
- handlers[i](result);
- }
- } else if (typeof handlers != "undefined") {
- handlers(result);
- }
- warp.dialog("close");
- }
- },
- {
- text: '取消',
- handler: function () {
- warp.dialog("close");
- }
- }]
- });
- } else {
- $("div[name='winOrgWarp']").dialog('open');
- }
- }
- };
- var brandSelectorHandlers = function (targe, node) {
- var datas = [];
- $.each(node, function () {
- datas.push([{ 'text': this.text, 'value': this.id }][0]);
- });
- $(targe).triggerbox('setValue', datas);
- };
- //
- //2013-05-29 begin added by pengbb 新增系统菜单控件
- /*用法:定义一个div,指定class 为 easyui-cmsTree
- <div class="easyui-cmsTree" data-options="url:'/Common/GetCurrentUserMenuList'" >
- </div>
- data-options参数如下:
- url:'/Common/GetCurrentUserMenuList'
- onMenuClick:function(node){}
- */
- (function ($) {
- $.parser.plugins.push("cmsTree");
- function _toggleChildMenu(currMenu) {
- //$(currMenu).next('div').toggle();
- if ($(currMenu).next('div').css("display") == "none") {
- $(currMenu).siblings("div").slideUp("normal");
- $(currMenu).next('div').slideDown("normal");
- } else {
- $(currMenu).next('div').slideUp("normal");
- }
- }
- function _hideAllChildMenu(jq) {
- $(jq).find('a+div').hide();
- }
- function _init(jq) {
- var opts = $.data(jq, "cmsTree").options;
- $(jq).addClass("menu_panel");
- //$(jq).height(opts.height);
- var defaultOpenMenu = null;
- var newUrl = opts.url;
- if (opts.loadingMessage) {
- $(jq).html($("<div class=\"panel-loading\"></div>").html(opts.loadingMessage));
- }
- $.post(newUrl, {}, function (responseJson) {
- var rootPanel = jq;
- var i = 0;
- $.each(responseJson, function () {
- var level1Menu = $("<a class=\"menu_item menu_item_level1\" href=\"javascript:void(0);\" click=\"return false;\" title=\"系统首页\"><span style=\"background-position: 0px 0px;background-repeat: no-repeat;\">系统首页</span> </a>");
- var level1MenuOption = this;
- level1Menu.appendTo(rootPanel);
- level1Menu.find("span").text(level1MenuOption.text);
- level1Menu.find("span").addClass("menu_item_level1_title");
- if (level1MenuOption.text != "系统首页" && level1MenuOption.text != "系统注销" && i == 0) {
- i = 1;
- defaultOpenMenu = level1Menu;
- }
- if (level1MenuOption.iconUrl) {
- level1MenuOption.iconUrl = "url(" + level1MenuOption.iconUrl + ")";
- level1Menu.find(">span").css({ backgroundPosition: "10px 6px", backgroundImage: level1MenuOption.iconUrl });
- }
- level1Menu.attr("title", level1MenuOption.text);
- level1Menu.data("menuOption", level1MenuOption);
- if (level1MenuOption.children.length > 0) {
- var level2Panel = $("<div class=\"menu_item_panel\"></div>").appendTo(rootPanel);
- $.each(level1MenuOption.children, function () {
- var level2Menu = $("<a class=\"menu_item menu_item_level2\" href=\"javascript:void(0);\" click=\"return false;\" title=\"系统首页\"><span >系统首页</span> </a>");
- var level2MenuOption = this;
- level2Menu.appendTo(level2Panel);
- level2Menu.find("span").text(level2MenuOption.text);
- level2Menu.find("span").addClass("menu_item_level2_title");
- level2Menu.attr("title", level2MenuOption.text);
- level2Menu.data("menuOption", level2MenuOption);
- if (level2MenuOption.children.length > 0) {
- //menu_item_level2_icon_opened
- //menu_item_level2_icon_closed
- level2Menu.addClass("menu_item_collapsable")
- .find("span").css({ paddingLeft: "20px" }).addClass("menu_item_level2_icon_closed");
- var levelLeafPanel = $("<div class=\"menu_item_leaf_panel\"></div>").appendTo(level2Panel);
- $.each(level2MenuOption.children, function () {
- var levelLeafMenu = $("<a class=\"menu_item menu_item_leaf\" href=\"javascript:void(0);\" click=\"return false;\" title=\"系统首页\"><span style=\"background-position: 0px 0px;background-repeat: no-repeat;background-size: 16px 12px;\">系统首页</span> </a>");
- var levelLeafMenuOption = this;
- levelLeafMenu.appendTo(levelLeafPanel);
- levelLeafMenu.find("span").text(levelLeafMenuOption.text);
- levelLeafMenu.find("span").addClass("menu_item_leaf_title");
- levelLeafMenu.find("span").addClass("menu_item_leaf_icon");
- levelLeafMenu.find("span").css({ backgroundImage: levelLeafMenuOption.iconUrl });
- levelLeafMenu.attr("title", levelLeafMenuOption.text);
- levelLeafMenu.data("menuOption", levelLeafMenuOption);
- });
- }
- });
- }
- _hideAllChildMenu(jq);
- });
- if (defaultOpenMenu) {
- _toggleChildMenu(defaultOpenMenu);
- }
- // $(rootPanel).find("div.menu_item_panel").tinyscrollbar();
- }, "json");
- return { cmsTree: jq };
- }
- $.fn.cmsTree = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsTree.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsTree(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsTree");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsTree", { options: $.extend({}, $.fn.cmsTree.defaults, $.fn.cmsTree.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- initCacheData.clickCallbacks = $.Callbacks();
- cacheData = $.data(_this, "cmsTree", $.extend({}, cacheData, initCacheData));
- _jqThis.find("a.menu_item").live("click", function (event) {
- //alert($(this).attr("title"));
- //alert(JSON.stringify($(this).data("menuOption")));
- //menu_item_level2_icon_opened
- //menu_item_level2_icon_closed
- if ($(this).hasClass("menu_item_collapsable")) {
- var span = $(this).find(">span");
- if (span.hasClass("menu_item_level2_icon_closed")) {
- span.removeClass("menu_item_level2_icon_closed");
- span.addClass("menu_item_level2_icon_opened");
- } else {
- span.removeClass("menu_item_level2_icon_opened");
- span.addClass("menu_item_level2_icon_closed");
- }
- $(this).siblings(".menu_item_collapsable").find(">span").removeClass("menu_item_level2_icon_opened").addClass("menu_item_level2_icon_closed");
- }
- var opts = _jqThis.data("cmsTree").options;
- _toggleChildMenu(this);
- var menuOption = $(this).data("menuOption");
- if (opts.onMenuClick) {
- opts.onMenuClick.call(_this, menuOption);
- }
- return false;
- });
- //_jqThis.find("div.menu_item_panel").tinyscrollbar({ axis: 'x', size: 20});
- }
- });
- };
- $.fn.cmsTree.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsTree").options;
- return opts;
- }
- };
- $.fn.cmsTree.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsTree.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsTree.defaults = {
- url: '',
- loadingMessage: '菜单正在加载中...',
- onMenuClick: function () { } //,
- //height: 700
- };
- })(jQuery);
- //2013-05-29 end added by pengbb 新增系统菜单控件
- //2013-05-21 begin added by pengbb 附件上传控件
- /*用法:定义一个div,指定class 为 easyui-AttachmentUploader
- <div class="easyui-AttachmentUploader" style="width:auto;height:200px;" data-options="formData:{ReferenceID:'999F598B-541E-4863-8354-D54F8D47AFDD',ReferenceKeyName:'CMS_ApplicationBill'}">
- </div>
- data-options参数如下:
- title: "附件列表",
- canUpload: true, //是否可以上传
- formData: {
- ReferenceID: '',
- ReferenceKeyName: 'CMS'
- },
- multi: true, //是否启用批量上传
- fileSizeLimit: 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit)
- fileTypeDesc : 'Image Files', // The description for file types in the browse dialog
- fileTypeExts : '*.gif; *.jpg; *.png', // Allowed extensions in the browse dialog (server-side validation should also be used)
- buttonText: '上传附件',
- buttonClass: '',
- swf: '/Scripts/Plugins/Uploadify/uploadify.swf',
- uploader: '/UploadFile.axd',
- uploadSuccess: function (file, data, response) { },
- uploadFailure: function (file, data, response) { }
- */
- (function ($) {
- $.parser.plugins.push("AttachmentUploader");
- function s4() {
- return Math.floor((1 + Math.random()) * 0x10000)
- .toString(16)
- .substring(1);
- }
- function guid() {
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
- s4() + '-' + s4() + s4() + s4();
- }
- function _init(jq) {
- var opts = $.data(jq, "AttachmentUploader").options;
- var plAttachment = jq;
- var jqThis = $(jq);
- var dgAttachment = jqThis.find("div.upload_filelist>div");
- var btnUpload = jqThis.find("div.upload_tool>input");
- dgAttachment.cmsXDataTable();
- return { AttachmentUploader: jq, btnUpload: btnUpload, dgAttachment: dgAttachment };
- }
- function _deleteAttachment(jq, id) {
- var dgAttachment = $.data(jq, "AttachmentUploader").dgAttachment;
- $.messager.confirm('系统提示', '确定要删除该附件吗?', function (r) {
- if (r) {
- var ops = {
- URL: ("/" + CMS_SystemConfig.VirtualDirectoryPath + '/Common/RemoveAttachment/').replaceDoubleSlashesToSingle() + id,
- Before: function (rows) {
- },
- CallBack: function (result) {
- $.messager.alert('系统提示', '删除成功!', 'info', function () {
- setTimeout(function () { dgAttachment.cmsXDataTable('load') }, 100);
- });
- }
- }
- BowinFunction.Request.AJAX(ops);
- }
- })
- }
- $.fn.AttachmentUploader = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.AttachmentUploader.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.AttachmentUploader(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "AttachmentUploader");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "AttachmentUploader", { options: $.extend({}, $.fn.AttachmentUploader.defaults, $.fn.AttachmentUploader.parseOptions(this), _7be) });
- cacheData.options = $.extend({}, cacheData.options, {
- onUploadSuccess: function (file, data, response) {
- setTimeout(function () { dgAttachment.cmsXDataTable("load"); }, 100);
- if (opts.uploadSuccess) {
- opts.uploadSuccess.call(this, file, data, response);
- }
- },
- onAllComplete: function (event, data) {
- opts.onAllComplete.call(this, event, data);
- },
- onUploadError: function (file, data, response) {
- if (opts.uploadFailure) {
- opts.uploadFailure.call(this, file, data, response);
- }
- }
- });
- var initCacheData = _init(this);
- cacheData = $.data(this, "AttachmentUploader", $.extend({}, cacheData, initCacheData));
- }
- var opts = cacheData.options;
- var btnUpload = cacheData.btnUpload;
- var dgAttachment = cacheData.dgAttachment;
- if (opts.canUpload) {
- btnUpload.show();
- try {
- btnUpload.uploadify("destroy");
- } catch (ignore) { }
- btnUpload.uploadify(opts);
- } else {
- btnUpload.hide();
- }
- });
- };
- $.fn.AttachmentUploader.deleteColumnFormatFun = function (index, row, value) {
- if (row["IsOwn"]) {
- return "<a title=\"删除\" href=\"javascript:void(0);\" onclick=\"$(this).closest('div.easyui-AttachmentUploader').AttachmentUploader('deleteAttachment','" + value + "'); return false;\" >删除</a>";
- } else {
- return "<lable> </lable>";
- }
- };
- $.fn.AttachmentUploader.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "AttachmentUploader").options;
- return opts;
- },
- getDatagrid: function (jq) {
- var dgAttachment = $.data(jq[0], "AttachmentUploader").dgAttachment;
- return dgAttachment;
- },
- deleteAttachment: function (jq, id) {
- return _deleteAttachment(jq[0], id);
- },
- destroy: function (jq) {
- var btnUpload = $.data(jq[0], "AttachmentUploader").btnUpload;
- btnUpload.uploadify("destroy");
- }
- };
- $.fn.AttachmentUploader.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.AttachmentUploader.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.AttachmentUploader.defaults = {
- title: "附件列表",
- canUpload: true,
- formData: {
- ReferenceID: '',
- ReferenceKeyName: 'CMS'
- },
- width: 70, // The width of the browse button
- height: 26, // The height of the browse button
- createUserID: "",
- canDelete: true,
- multi: true,
- fileSizeLimit: 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit)
- fileTypeDesc: '所有文件', // The description for file types in the browse dialog
- fileTypeExts: '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used)
- buttonText: '上传附件',
- buttonClass: '',
- swf: ('/' + CMS_SystemConfig.VirtualDirectoryPath + '/Scripts/Plugins/Uploadify/uploadify.swf').replaceDoubleSlashesToSingle(),
- uploader: ('/' + CMS_SystemConfig.VirtualDirectoryPath + '/UploadFile.axd').replaceDoubleSlashesToSingle(),
- uploadSuccess: function (file, data, response) {
- },
- uploadFailure: function (file, data, response) { },
- onAllComplete: function (event, data) {
- //$('.easyui-window').window('close');
- }
- };
- })(jQuery);
- //2013-05-21 end added by pengbb 附件上传控件
- //2013-08-01 begin added by pengbb 新增弹窗上传控件
- (function ($) {
- $.parser.plugins.push("FileUploaderWindow");
- function s4() {
- return Math.floor((1 + Math.random()) * 0x10000)
- .toString(16)
- .substring(1);
- }
- function guid() {
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
- s4() + '-' + s4() + s4() + s4();
- }
- function _init(jq) {
- var opts = $.data(jq, "FileUploaderWindow").options;
- var plAttachment = jq;
- var jqThis = $(jq);
- var win = jqThis.find(".FileUploaderWindowPanel");
- var fileUploader = win.find(".easyui-AttachmentUploader");
- //win.window();
- return { FileUploaderWindow: jq, FileUploader: fileUploader, Window: win };
- }
- $.fn.FileUploaderWindow = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.FileUploaderWindow.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.FileUploaderWindow(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "FileUploaderWindow");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "FileUploaderWindow", { options: $.extend({}, $.fn.FileUploaderWindow.defaults, $.fn.FileUploaderWindow.parseOptions(this), _7be) });
- var initCacheData = _init(this);
- cacheData = $.data(this, "FileUploaderWindow", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.FileUploaderWindow.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "FileUploaderWindow").options;
- return opts;
- },
- open: function (jq) {
- var data = $.data(jq[0], "FileUploaderWindow");
- var opts = data.options;
- var win = data.Window;
- var fileUploader = data.FileUploader;
- fileUploader.AttachmentUploader(opts);
- win.window().show().window("open");
- },
- close: function (jq) {
- var data = $.data(jq[0], "FileUploaderWindow");
- var opts = data.options;
- var win = data.Window;
- var fileUploader = data.FileUploader;
- fileUploader.AttachmentUploader("destroy");
- win.window("close");
- }
- };
- $.fn.FileUploaderWindow.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.FileUploaderWindow.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.FileUploaderWindow.defaults = $.extend({}, $.fn.AttachmentUploader.defaults, {
- formData: {
- ReferenceID: '',
- ReferenceKeyName: 'TempFile'
- }
- });
- })(jQuery);
- //2013-08-01 end added by pengbb 新增弹窗上传控件
- //2013-04-28 begin added by pengbb 新增triggerbox控件,用于用户选择和部门选择,号码规则选择
- (function ($) {
- $.parser.plugins.push("triggerbox");
- function _init(jq) {
- var widthCss = $(jq).width();
- $(jq).addClass("triggerbox-f").hide();
- var span = $("<span class=\"triggerbox\"></span>").insertAfter(jq);
- var span_text = $("<input type=\"text\" readonly=\"true\" style=\"width:100%;\" class=\"triggerbox-text\">").appendTo(span);
- var span_delete = $("<span><span class=\"triggerbox-delete\"></span></span>").appendTo(span);
- var span_search = $("<span><span class=\"triggerbox-search\"></span></span>").appendTo(span);
- $("<input type=\"hidden\" class=\"triggerbox-value\">").appendTo(span);
- var name = $(jq).attr("name");
- if (name) {
- span.find("input.triggerbox-value").attr("name", name);
- $(jq).removeAttr("name").attr("triggerboxName", name);
- }
- span_text.attr("autocomplete", "off");
- //span.css("width", widthCss);
- span_text.width(widthCss - span_search.width() - span_delete.width() - 10);
- //span_text.width(span.width() - span_search.width() - span_delete.width());
- return { triggerbox: span };
- }
- function _setValue(jq, newData, isValidate) {
- var opts = $.data(jq, "triggerbox").options;
- var data = $.data(jq, "triggerbox").data;
- var span = $.data(jq, "triggerbox").triggerbox;
- data = newData;
- var ss = [];
- for (var i = 0; i < newData.length; i++) {
- var s = newData[i][opts.valueField];
- if (opts.formatter) {
- s = opts.formatter.call(jq, newData[i]);
- }
- ss.push(s);
- }
- var oldTriggerboxValue = span.find("input.triggerbox-value").val();
- span.find("input.triggerbox-text").val(ss.join(opts.separator));
- span.find("input.triggerbox-value").val(JSON.stringify(newData));
- var reg = "/" + opts.separator + "/g";
- span.find("input.triggerbox-text").attr("title", ss.join(opts.separator).replace(eval(reg), "\r\n"));
- if (opts.required && isValidate) {
- //try{
- var _769 = span.find("input.triggerbox-text");
- _769.validatebox("validate");
- // }catch(ignore){}
- }
- // if (ss.join(opts.separator).length > 0 && vv.join(opts.separator).length > 0) {
- // span.find(".triggerbox-delete").css("visibility", "visible");
- // } else {
- // span.find(".triggerbox-delete").css("visibility", "hidden");
- // }
- $.data(jq, "triggerbox", { options: opts, data: data, triggerbox: span });
- if (oldTriggerboxValue != span.find("input.triggerbox-value").val()) {
- var changeFn = opts.change || function () { };
- if (typeof (changeFn) == "function") {
- changeFn.call(jq);
- }
- }
- }
- function _initValidate(_768, doit) {
- var opts = $.data(_768, "triggerbox").options;
- var _769 = $.data(_768, "triggerbox").triggerbox.find("input.triggerbox-text");
- _769.validatebox(opts);
- $(_768).removeClass("easyui-validatebox validatebox-text");
- if (doit) {
- _769.validatebox("validate");
- }
- };
- $.fn.triggerbox = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.triggerbox.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.triggerbox(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var triggerboxData = $.data(this, "triggerbox");
- if (triggerboxData) {
- $.extend(triggerboxData.options, _7be);
- } else {
- triggerboxData = $.data(this, "triggerbox", { options: $.extend({}, $.fn.triggerbox.defaults, $.fn.triggerbox.parseOptions(this), _7be) });
- var initTriggerboxData = _init(this);
- triggerboxData = $.data(this, "triggerbox", $.extend({}, triggerboxData, initTriggerboxData));
- }
- if (triggerboxData.options.data) {
- _setValue(this, triggerboxData.options.data, false);
- }
- triggerboxData.triggerbox.find(".triggerbox-search").unbind(".triggerbox");
- triggerboxData.triggerbox.find(".triggerbox-delete").unbind(".triggerbox");
- //注册事件
- triggerboxData.triggerbox.find(".triggerbox-search").bind("mouseenter.triggerbox", function () {
- $(this).addClass("triggerbox-search-hover");
- }).bind("mouseleave.triggerbox", function () {
- $(this).removeClass("triggerbox-search-hover");
- }).bind("mousedown.triggerbox", function () {
- if (triggerboxData.options.editable) {
- //查询点击事件
- if (triggerboxData.options.onSearch) {
- triggerboxData.options.onSearch.call(_this);
- }
- }
- });
- triggerboxData.triggerbox.find(".triggerbox-search").bind("mouseenter.triggerbox", function () {
- $(this).addClass("triggerbox-search-hover");
- }).bind("mouseleave.triggerbox", function () {
- $(this).removeClass("triggerbox-search-hover");
- }).bind("mousedown.triggerbox", function () {
- if (triggerboxData.options.editable) {
- //查询点击事件
- if (triggerboxData.options.onSearchClick) {
- triggerboxData.options.onSearchClick.call(_this);
- }
- }
- });
- triggerboxData.triggerbox.find(".triggerbox-delete").bind("mouseenter.triggerbox", function () {
- $(this).addClass("triggerbox-delete-hover");
- }).bind("mouseleave.triggerbox", function () {
- $(this).removeClass("triggerbox-delete-hover");
- }).bind("mousedown.triggerbox", function () {
- if (triggerboxData.options.editable) {
- $.fn.triggerbox.methods["clear"]($(_this));
- //$(this).css("visibility", "hidden");
- }
- });
- _initValidate(_this, true);
- });
- };
- $.fn.triggerbox.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "triggerbox").options;
- return opts;
- },
- getData: function (jq) {
- return $.data(jq[0], "triggerbox").data;
- },
- setValue: function (jq, newData) {
- jq.each(function () {
- _setValue(this, newData, true);
- });
- },
- getValue: function (jq) {
- return eval($.data(jq[0], "triggerbox").triggerbox.find("input.triggerbox-value").val());
- },
- clear: function (jq) {
- jq.each(function () {
- var opts = $(this).triggerbox("options");
- opts.data = [];
- $(this).triggerbox("setValue", opts.data);
- });
- }
- };
- $.fn.triggerbox.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.extend({}, $.fn.triggerbox.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"])), $.fn.validatebox.parseOptions(_7c7));
- };
- $.fn.triggerbox.defaults = $.extend({},
- $.fn.validatebox.defaults, {
- valueField: "value",
- textField: "text",
- separator: ",",
- editable: true,
- postData: {},
- change: function () { },
- formatter: function (row) {
- var opts = $(this).triggerbox("options");
- return row[opts.textField];
- }
- }
- );
- })(jQuery);
- //2013-04-28 end added by pengbb 新增triggerbox控件,用于用户选择和部门选择,号码规则选择
- //2013-05-03 begin added by pengbb 新增号码规则选择控件
- function TelNumberRuleSelector(config) {
- var defaultConfig = { onSelect: null, width: 600, height: 400, postData: {} };
- config = $.extend({}, defaultConfig, config);
- var newUrl = "/Common/GetTelNumberRuleListForSelector";
- newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + newUrl).replaceDoubleSlashesToSingle();
- var jqPanel = $("<div class=\"easyui-window\" style=\"width:800px;height:600px; \" title=\"选择号码规则\" data-options=\"modal:true,collapsible:false,shadow:true,minimizable:false,maximizable:false,inline:false,closed:true,resizable:false,maximizable:false \" ></div> ").appendTo(document.body);
- var jqPanelLayout = $('<div style="width:100%;height:100%;" class="layout" ><div style="left: 0px; top: 0px; width:100%; " class="panel layout-panel layout-panel-center"><div class="panel-body panel-body-noheader panel-body-noborder layout-body" title="" style="position: relative; width:100%; height: 320px; overflow: auto;"></div></div><div style="left: 0px; top: 320px; width: 100%;" class="panel layout-panel layout-panel-south"><div class="panel-body panel-body-noheader panel-body-noborder layout-body" title="" style="height: 29px; text-align: right; padding: 5px 0px 0px; width: 100%;"><!-- 窗口操作按扭 --></div></div> </div>').appendTo(jqPanel);
- var jqPanelLayoutCenter = jqPanelLayout.find("div.layout-panel-center>div.layout-body");
- var jqPanelLayoutCenterContent = $('<div style="padding:5px;" ></div>').appendTo(jqPanelLayoutCenter);
- var jqPanelLayoutSouth = jqPanelLayout.find("div.layout-panel-south>div.layout-body");
- var btnYes = $("<a class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-ok'\" style=\"margin-right:5px;\" href=\"javascript:void(0)\" >确定</a>").appendTo(jqPanelLayoutSouth);
- var btnNo = $("<a class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-cancel'\" style=\"margin-right:5px;\" href=\"javascript:void(0)\" >取消</a>").appendTo(jqPanelLayoutSouth);
- if (config.width) {
- jqPanel.width(config.width);
- }
- if (config.height) {
- jqPanel.height(config.height);
- }
- jqPanel.window();
- btnYes.linkbutton();
- btnNo.linkbutton();
- var isIE6 = false;
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- isIE6 = true;
- }
- }
- var centerContentConfig = {
- url: newUrl,
- postData: config.postData,
- onLoaded: function () {
- jqPanelLayoutCenterContent.find("div.cmspanel>div.panel-header>div.panel-tool>a.cmspanel-tool-collapse").click(function () {
- var _this = $(this);
- if (_this.hasClass("panel-tool-expand")) {
- _this.removeClass("panel-tool-expand");
- if (isIE6) {
- _this.closest("div.cmspanel").find("div.panel-body").show();
- } else {
- _this.closest("div.cmspanel").find("div.panel-body").slideDown();
- }
- } else {
- _this.addClass("panel-tool-expand");
- if (isIE6) {
- _this.closest("div.cmspanel").find("div.panel-body").hide();
- } else {
- _this.closest("div.cmspanel").find("div.panel-body").slideUp();
- }
- }
- });
- }
- };
- jqPanelLayoutCenterContent.cmsLoadHtml(centerContentConfig);
- var eventManager = { onSelect: [] };
- var _select = function (fn) {
- eventManager["onSelect"].push(fn);
- }
- if (config.onSelect) {
- eventManager["onSelect"].push(config.onSelect);
- }
- btnYes.unbind(".SelectTelNumberRule");
- btnNo.unbind(".SelectTelNumberRule");
- btnYes.bind("click.SelectTelNumberRule", function () {
- var selectDatas = [];
- $(jqPanel).find("input[type=checkbox]:checked").each(function () {
- selectDatas.push({ text: $(this).attr("text"), value: $(this).val() });
- });
- _postEvent(selectDatas);
- _hide();
- });
- btnNo.bind("click.SelectTelNumberRule", function () {
- _hide();
- });
- var _show = function () {
- jqPanel.window('open');
- };
- var _hide = function () {
- jqPanel.window('close');
- };
- var _postEvent = function (p) {
- $.each(eventManager["onSelect"], function () {
- this.call(_this, p);
- });
- }
- var _this = { jq: jqPanel, show: _show, hide: _hide, select: _select };
- return _this;
- }
- //2013-05-03 end added by pengbb新增号码规则选择控件
- var SelectUserContorl = function (departmentID, multipleChoice, handlers) {
- var groups = {};
- var DepartmentID = departmentID;
- var MultipleChoice = multipleChoice;
- var waitDataGrid;
- var pitchOnDataGrid;
- var rightTopQuey;
- var tree;
- var win;
- var leftQuery;
- //private 创建Html元素
- var createElement = function (elementTypeName, elements, parentElments) {
- $(elementTypeName).removeClass();
- if (typeof parentElments != "undefined" && typeof elements == "string") {
- var elementsObject = $(elements);
- parentElments.append(elementsObject);
- return elementsObject;
- } else {
- if (typeof elements == "string")
- return $(elements);
- }
- };
- var createTableString = function (name) {
- var table = "<table";
- return table.concat(" name='", name, "'>", "</table>");
- };
- var InitGridFile = function (dataGrid, pagination, url) {
- return dataGrid.datagrid({
- url: pagination ? url : "",
- queryParams: pagination ? {
- departmentID: DepartmentID,
- userName: rightTopQuey.find("input[name='txtUserName']").val()
- } : "",
- pagination: pagination,
- pageSize: 1,
- pageList: [5, 10],
- loadMsg: "请稍等....",
- columns: [[
- { field: 'UserID', title: 'UserID', checkbox: true },
- { field: 'DepartmentName', title: '部门机构' },
- { field: 'LoginName', title: '登录名' },
- { field: 'UserName', title: '用户名' }
- ]]
- });
- }
- //private 选择用户
- var selectWaitUser = function () {
- var selectUser = waitDataGrid.datagrid("getChecked");
- if (selectUser.length > 0) {
- if (!multipleChoice && selectUser.length > 1) {
- $.messager.alert("系统消息", "一次只能选择一个用户!");
- } else {
- var dataSource = "{\"total\":".concat(selectUser.length, ",", "\"rows\":[");
- for (var i = 0; i < selectUser.length; i++) {
- dataSource = dataSource.concat('{"UserID":', "\"", selectUser[i].UserID, "\",", '"DepartmentName":',
- "\"", selectUser[i].DepartmentName, "\",\"LoginID\":\"", selectUser[i].LoginName, "\",\"UserName\":\"",
- selectUser[i].UserName, "\"},"
- );
- }
- dataSource = dataSource.substring(0, dataSource.length - 1);
- dataSource = dataSource.concat("]}");
- var currentData = $.parseJSON(dataSource);
- currentData.rows = currentData.rows.sort(function (a, b) {
- return a > b;
- });
- if (typeof (pitchOnDataGrid.data("SelectedUser")) != "undefined") {
- //先拿缓存数据
- var cachData = pitchOnDataGrid.data("SelectedUser");
- for (var i = 0; i < cachData.rows.length; i++) {
- for (var j = 0; j < currentData.rows.length; j++) {
- if (cachData.rows[i].UserID == currentData.rows[j].UserID) {
- currentData.rows.splice(j, 1);
- }
- }
- }
- cachData.rows = $.merge(currentData.rows, cachData.rows);
- pitchOnDataGrid.data("SelectedUser", cachData);
- } else {
- pitchOnDataGrid.data("SelectedUser", currentData);
- }
- pitchOnDataGrid.datagrid("loadData", pitchOnDataGrid.data("SelectedUser"));
- }
- } else {
- $.messager.alert("系统消息", "未选择任何用户!");
- }
- };
- var registEvent = function (target, eventType, handler) {
- target.unbind(eventType, handler);
- target.bind(eventType, handler);
- }
- var close = function () {
- var btnSelectOk = $((rightTopQuey.find("a"))[1]);
- btnSelectOk.unbind();
- btnSelectOk.bind("click", function () {
- var selectUser = pitchOnDataGrid.datagrid("getData");
- if (handlers instanceof Array) {
- for (var i = 0; i < handlers.length; i++) {
- handlers[i](selectUser);
- }
- } else if (typeof handlers != "undefined") {
- handlers(selectUser);
- }
- win.window("close");
- });
- };
- var hasEasyUI = function (elementTypeName) {
- if ($(elementTypeName).length > 0) {
- return true;
- } else {
- return false;
- }
- }
- var createLinkButton = function (elements) {
- var links = elements.find("a");
- for (var i = 0; i < links.length; i++) {
- $(links[i]).linkbutton();
- }
- };
- var getUserInfo = function () {
- waitDataGrid.datagrid('load', {
- departmentID: DepartmentID,
- userName: rightTopQuey.find("input[name='txtUserName']").val()
- }
- );
- }
- var deleteSelectUser = function () {
- var deleteSource = pitchOnDataGrid.datagrid("getChecked");
- if (deleteSource.length > 0) {
- for (var i = 0; i < deleteSource.length; i++) {
- var rowIndex = pitchOnDataGrid.datagrid("getRowIndex", deleteSource[i]);
- pitchOnDataGrid.datagrid("deleteRow", rowIndex);
- }
- }
- //else {
- // $.messager.alert("系统消息", "未选中任何行!");
- // }
- };
- var loadDepartmentTree = function () {
- var inputDepartment = leftQuery.find("input[name='txtDepartmentName']").val();
- $.cmsPost("/Common/GetSelectUserControlDepartmentTree",
- { departmentID: "", departmentName: inputDepartment },
- function (data) {
- $(tree).tree('loadData', data);
- });
- }
- var show = function () {
- if (!hasEasyUI("div[name='winWarp']")) {
- var warpElement = "<div class='selectUser_warp clear'></div>";
- var warp = createElement(".selectUser_warp", warpElement, win);
- win = warp.window({
- width: 760,
- height: 500,
- modal: true,
- maximizable: false,
- title: '用户信息选择'
- });
- var elementLeft = createElement(".selectUser_left",
- "<div class='selectUser_left postion_border'></div>", warp);
- var elementRight = createElement(".selectUser_right",
- "<div class='selectUser_right postion_border'></div>", warp);
- var leftQueryTable = "<table class='query'><tr>";
- leftQueryTable = leftQueryTable.concat("<td align='right'>渠道名称:</td>");
- leftQueryTable = leftQueryTable.concat("<td align='left'><input type='text' name='txtDepartmentName' class='selectUser_Input selectUser_inputCondition'/></td>");
- leftQueryTable = leftQueryTable.concat("<td colspan='2' align='center' ><a id='btn' href='#' name='btnQueryDepartment'>查询</a> </td>");
- leftQueryTable = leftQueryTable.concat("</tr></table>");
- leftQuery = createElement(".query", leftQueryTable, elementLeft);
- createLinkButton(leftQuery);
- var left_panel_warp = createElement("div[panel_postion='left']", "<div class='panel_Data' panel_postion='left'><ul name='departmentTree'></ul></div>", elementLeft);
- left_panel_warp.panel({
- width: 350,
- height: 450,
- title: '部门信息',
- closable: false,
- collapsible: true,
- minimizable: false,
- maximizable: false
- });
- var departmentName = leftQuery.find("input[name='txtDepartmentName']").val();
- tree = $(left_panel_warp.find("ul[name='departmentTree']")[0]).tree({
- url: ("/" + CMS_SystemConfig.VirtualDirectoryPath + ("/Common/GetSelectUserControlDepartmentTree?departmentName=" + departmentName).replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle(),
- lines: true,
- onBeforeLoad: function (node, param) {
- if (node == null) {
- return true;
- } else {
- var children = $(this).tree("getChildren", node.target);
- if (children == "") {
- return true;
- } else {
- return false;
- }
- }
- },
- onClick: function (node) {
- DepartmentID = eval(node).id;
- getUserInfo();
- }
- });
- var rightQuery = '<p class="query_p right_query_Postion" pPostion="right_top">帐号/用户名:<input type="text" name="txtUserName" class="selectUser_Input"/> <a href="#" name="btnQueryUser">查询</a>';
- rightQuery = rightQuery.concat(" <a href='#' name='btnSelectOk' >确定</a></p>");
- rightTopQuey = createElement("p[pPostion='right_top']", rightQuery, elementRight);
- createLinkButton(rightTopQuey);
- var rightWaitChoise_paneDiv = createElement("div[panel_postion='right_middel']", "<div class='panel_Data' panel_postion='right_middel'></div>", elementRight);
- var waitChoisePanel = rightWaitChoise_paneDiv.panel({
- width: 380,
- title: '待选用户',
- closable: false,
- collapsible: true,
- minimizable: false,
- maximizable: false
- });
- var selectAndDeteButtonStr = "<p class='query_p' pPostion='right_bottom'><a href='#' name='btnselectWaitUser' >选择</a> <a href='#' name='btnDelete'>删除</a> </p>";
- var selectAndDeteButton = createElement("p[pPostion='right_bottom']", selectAndDeteButtonStr, elementRight);
- createLinkButton(selectAndDeteButton);
- var left_panel_warp = createElement("div[panel_postion='right_selectUser']", "<div class='panel_Data' panel_postion='right_selectUser'></div>", elementRight);
- var pitchOnPanel = left_panel_warp.panel({
- width: 380,
- height: 150,
- title: '已选用户',
- closable: false,
- collapsible: true,
- minimizable: false,
- maximizable: false
- });
- var waitTable = createElement("table[name='waitDataGrid']", createTableString("waitDataGrid"), waitChoisePanel);
- var pitchOnTable = createElement("table[name='pitchOnDataGrid']", createTableString("pitchOnDataGrid"), pitchOnPanel);
- waitDataGrid = InitGridFile(waitTable, true, ("/" + CMS_SystemConfig.VirtualDirectoryPath + ("/Common/GetSelectUserContorlViewPageList").replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle());
- pitchOnDataGrid = (InitGridFile(pitchOnTable, false));
- //查询部门树
- registEvent(leftQuery.find("a:first"), "click", loadDepartmentTree);
- //选择用户
- registEvent(selectAndDeteButton.find("a:first"), "click", selectWaitUser);
- //删除用户
- registEvent($(selectAndDeteButton.find("a")[1]), "click", deleteSelectUser);
- //关闭
- registEvent(rightTopQuey.find("a:first"), "click", getUserInfo);
- close(handlers);
- } else {
- $("div[name='winWarp']").window('open');
- }
- };
- return { "show": show };
- };
- $.extend($.fn.validatebox.defaults.rules, {
- baseRequired: {
- validator: function (value, param) {
- return value && value != "";
- },
- message: '必填'
- },
- dropdownListRequired: {
- validator: function (value, param) {
- return value != "" && value != "-1" && value != "全部" && value != "请选择";
- },
- message: '必选'
- },
- mobile: {
- validator: function (value, param) {
- return (/^1\d{10}$/gi).test(value);
- },
- message: '手机号码格式不对'
- },
- telnumber: {
- validator: function (value, param) {
- return (/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/gi).test(value);
- },
- message: '号码格式不对'
- },
- IDCard: {
- validator: function (value, param) {
- var idcard = value; //身份证号码
- var Errors = new Array(
- "验证通过!OK",
- "身份证号码位数不对!",
- "身份证号码出生日期超出范围或含有非法字符!",
- "身份证号码校验错误!",
- "身份证地区非法!"
- );
- var area = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外" };
- var idcard, Y, JYM;
- var S, M;
- var idcard_array = new Array();
- idcard_array = idcard.split("");
- //地区检验
- if (area[parseInt(idcard.substr(0, 2))] == null) {
- this.message = Errors[4];
- return false;
- }
- //身份号码位数及格式检验
- switch (idcard.length) {
- case 15:
- if ((parseInt(idcard.substr(6, 2)) + 1900) % 4 == 0 || ((parseInt(idcard.substr(6, 2)) + 1900) % 100 == 0 && (parseInt(idcard.substr(6, 2)) + 1900) % 4 == 0)) {
- ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/; //测试出生日期的合法性
- } else {
- ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/; //测试出生日期的合法性
- }
- if (ereg.test(idcard)) return true;
- else {
- this.message = Errors[2];
- return false;
- }
- break;
- case 18:
- //18位身份号码检测
- //出生日期的合法性检查
- //闰年月日:((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))
- //平年月日:((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))
- if (parseInt(idcard.substr(6, 4)) % 4 == 0 || (parseInt(idcard.substr(6, 4)) % 100 == 0 && parseInt(idcard.substr(6, 4)) % 4 == 0)) {
- ereg = /^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/; //闰年出生日期的合法性正则表达式
- } else {
- ereg = /^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/; //平年出生日期的合法性正则表达式
- }
- if (ereg.test(idcard)) {//测试出生日期的合法性
- //计算校验位
- S = (parseInt(idcard_array[0]) + parseInt(idcard_array[10])) * 7
- + (parseInt(idcard_array[1]) + parseInt(idcard_array[11])) * 9
- + (parseInt(idcard_array[2]) + parseInt(idcard_array[12])) * 10
- + (parseInt(idcard_array[3]) + parseInt(idcard_array[13])) * 5
- + (parseInt(idcard_array[4]) + parseInt(idcard_array[14])) * 8
- + (parseInt(idcard_array[5]) + parseInt(idcard_array[15])) * 4
- + (parseInt(idcard_array[6]) + parseInt(idcard_array[16])) * 2
- + parseInt(idcard_array[7]) * 1
- + parseInt(idcard_array[8]) * 6
- + parseInt(idcard_array[9]) * 3;
- Y = S % 11;
- M = "F";
- JYM = "10X98765432";
- M = JYM.substr(Y, 1); //判断校验位
- if (M == idcard_array[17]) return true; //检测ID的校验位
- else {
- this.message = Errors[3];
- return false;
- };
- }
- else {
- this.message = Errors[2];
- return false;
- };
- break;
- default:
- this.message = Errors[1];
- return false;
- break;
- }
- },
- message: '证件号码格式不对'
- },
- filterWord: {
- validator: function (value, param) {
- var returnValue = true;
- $(param[0]).each(function (i, item) {
- if (item == value) {
- returnValue = false;
- return false;
- }
- });
- return returnValue;
- },
- message: '敏感字过滤'
- },
- onlyNumber: {
- validator: function (value, param) {
- return (/^[0-9]\d*$/gi).test(value);
- },
- message: '仅允许输入数字'
- },
- onlyDiscount: {
- validator: function (value, param) {
- //^0\.[0-9]{1,2}$
- return (/^(?:0(?:\.(?!00)[0-9]{1,2})?|1)$/gi).test(value);
- // return (/^[1-9]([.]{1}[1-9])?$/gi).test(value);
- },
- message: '仅允许输入带二位小数的有效数字'
- },
- onlyChar: {
- validator: function (value, param) {
- return (/^[A-Za-z0-9]+$/gi).test(value);
- },
- message: '仅允许输入英文及数字'
- },
- onlyMoney: {
- validator: function (value, param) {
- return (/^-?\d+(\.\d{1,2})?$/gi).test(value);
- },
- message: '仅允许输入保留二位有效数字'
- }
- });
- $.extend($.fn.validatebox.methods, {
- remove: function (jq, newposition) {
- return jq.each(function () {
- $(this).removeClass("validatebox-text validatebox-invalid").unbind('focus.validatebox').unbind('blur.validatebox');
- });
- },
- reduce: function (jq, newposition) {
- return jq.each(function () {
- var opt = $(this).data().validatebox.options;
- $(this).addClass("validatebox-text").validatebox(opt);
- });
- }
- });
- $.extend($.fn.validatebox.methods, {
- removeForCombobox: function (jq, newposition) {
- return jq.each(function () {
- var comboxText = $(this).next().find("input").first();
- comboxText.removeClass("validatebox-text validatebox-invalid").unbind('focus.validatebox').unbind('blur.validatebox');
- });
- },
- reduceForCombobox: function (jq, newposition) {
- return jq.each(function () {
- var comboxText = $(this).next().find("input").first();
- var opt = comboxText.data().validatebox.options;
- comboxText.addClass("validatebox-text").validatebox(opt);
- });
- }
- });
- //2013-12-05 begin added by pengbb 新增ajax加载html内容控件
- /*用法:定义一个div,指定class 为 easyui-cmsLoadHtml
- <div class="easyui-cmsLoadHtml" data-options="url:'/Common/GetHtmlContent'" >
- </div>
- data-options参数如下:
- url:'/Common/GetHtmlContent',
- loadingMessage:'正在加载中...',
- postData : {}
- */
- (function ($) {
- $.parser.plugins.push("cmsLoadHtml");
- function _init(jq) {
- var opts = $.data(jq, "cmsLoadHtml").options;
- return { cmsLoadHtml: jq };
- }
- function _load(jq) {
- var opts = $.data(jq, "cmsLoadHtml").options;
- if (opts.url && opts.url != "") {
- if (opts.loadingMessage) {
- //loadPanel.prependTo(jq);
- var loadPanel = $("<div style=\"float:left;width:100%; height:100%;position:relative;\"></div>").prependTo(jq);
- $("<div style=\"clear:both;\"></div>").appendTo(jq);
- $("<div class=\"loadhtml-mask\" style=\"display:block\"></div>").appendTo(loadPanel);
- var msg = $("<div class=\"loadhtml-mask-msg\" style=\"display:block;left:50%\"></div>").html(opts.loadingMessage).appendTo(loadPanel);
- msg.css("marginLeft", -msg.outerWidth() / 2);
- }
- setTimeout(function () {
- $.ajax({
- url: opts.url,
- data: $.extend({}, {}, opts.postData),
- cache: false,
- dataType: "html",
- success: function (data) {
- $(jq).html(opts.extractor.call(jq, data));
- if (typeof (opts.onLoaded) == "function") {
- opts.onLoaded.call(jq);
- }
- }
- });
- }, opts.delay);
- }
- };
- $.fn.cmsLoadHtml = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsLoadHtml.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsLoadHtml(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsLoadHtml");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsLoadHtml", { options: $.extend({}, $.fn.cmsLoadHtml.defaults, $.fn.cmsLoadHtml.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsLoadHtml", $.extend({}, cacheData, initCacheData));
- }
- _load(_this);
- });
- };
- $.fn.cmsLoadHtml.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsLoadHtml").options;
- return opts;
- },
- reload: function (jq) {
- _load(jq[0]);
- }
- };
- $.fn.cmsLoadHtml.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsLoadHtml.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsLoadHtml.defaults = {
- url: '',
- delay: 0,
- loadingMessage: '正在加载中...',
- postData: {},
- onLoaded: function () { },
- extractor: function (data) {
- var _1ef = /<body[^>]*>((.|[\n\r])*)<\/body>/im;
- var _1f0 = _1ef.exec(data);
- if (_1f0) {
- return _1f0[1];
- } else {
- return data;
- }
- }
- };
- })(jQuery);
- //2013-12-05 end added by pengbb 新增ajax加载html内容控件
- //2013-12-10 begin added by pengbb 新增下一步审批人控件
- /*用法:定义一个div,指定class 为 easyui-cmsNextApproverSelector
- <div class="easyui-cmsNextApproverSelector" data-options="url:'/Common/GetHtmlContent'" >
- </div>
- data-options参数如下:
- url:'/Common/GetHtmlContent',
- loadingMessage:'正在加载中...',
- postData : {}
- */
- (function ($) {
- $.parser.plugins.push("cmsNextApproverSelector");
- function _init(jq) {
- var opts = $.data(jq, "cmsNextApproverSelector").options;
- var approverCombobox = $("<input />").attr("name", opts.name).appendTo(jq);
- var workPositionLabel = $("<label />").appendTo(jq);
- return { cmsNextApproverSelector: jq, approverCombobox: approverCombobox, workPositionLabel: workPositionLabel };
- }
- function _load(jq) {
- var opts = $.data(jq, "cmsNextApproverSelector").options;
- var approverCombobox = $.data(jq, "cmsNextApproverSelector").approverCombobox;
- var workPositionLabel = $.data(jq, "cmsNextApproverSelector").workPositionLabel;
- var loadingMessage = opts.loadingMessage || "系统正在加载下一步审批人中,请稍候...";
- var approverComboboxDefaultOptions = {
- multiple: false,
- panelHeight: 'auto',
- onSelect: function (record) {
- workPositionLabel.text(record.data[0].label);
- if (typeof (opts.onSelect) == "function") {
- opts.onSelect.call(jq);
- }
- },
- onLoadSuccess: function () {
- if (opts.showProgress) {
- //$.messager.progress('close');
- $.cmsLoading.hide();
- }
- if (approverCombobox.combobox("options").firstLoad) return;
- var getData = approverCombobox.combobox("getData");
- if (getData.length > 0) {
- if (getData[0].data[0].label == "结束") {
- approverCombobox.combobox("select", getData[0].id);
- workPositionLabel.text(getData[0].data[0].label);
- approverCombobox.combobox('disable');
- } else {
- approverCombobox.combobox('setValues', ['请选择']);
- }
- }
- if (typeof (opts.onLoadSuccess) == "function") {
- opts.onLoadSuccess.call(jq);
- }
- },
- onLoadError: function () {
- if (opts.showProgress) {
- //$.messager.progress('close');
- $.cmsLoading.hide();
- }
- //if (approverCombobox.combobox("options").firstLoad) return;
- if (typeof (opts.onLoadError) == "function") {
- opts.onLoadError.call(jq);
- }
- },
- //firstLoad: true,
- onBeforeLoad: function (param) {
- //alert(approverCombobox.combobox("options").firstLoad);
- //if (approverCombobox.combobox("options").firstLoad) {
- // approverCombobox.combobox("options").firstLoad = false;
- // return false;
- //}
- if (opts.showProgress) {
- //$.messager.progress({ msg: loadingMessage, autoClose: true, interval: 600 });
- $.cmsLoading.show(loadingMessage);
- }
- approverCombobox.combobox('enable');
- workPositionLabel.text("");
- $.extend(param, opts.postData);
- }
- };
- approverCombobox.combobox($.extend({}, opts, approverComboboxDefaultOptions));
- }
- $.fn.cmsNextApproverSelector = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsNextApproverSelector.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsNextApproverSelector(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsNextApproverSelector");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsNextApproverSelector", { options: $.extend({}, $.fn.cmsNextApproverSelector.defaults, $.fn.cmsNextApproverSelector.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsNextApproverSelector", $.extend({}, cacheData, initCacheData));
- }
- //cacheData.approverCombobox.combobox("reload");
- _load(_this);
- });
- };
- $.fn.cmsNextApproverSelector.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsNextApproverSelector").options;
- return opts;
- },
- reload: function (jq) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- approverCombobox.combobox("reload");
- },
- getData: function (jq) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- return approverCombobox.combobox("getData");
- },
- setValue: function (jq, val) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- approverCombobox.combobox("setValue", val);
- },
- setValues: function (jq, vals) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- approverCombobox.combobox("setValues", vals);
- },
- getValue: function (jq, vals) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- return approverCombobox.combobox("getValue");
- },
- getValues: function (jq, vals) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- return approverCombobox.combobox("getValues");
- },
- isValid: function (jq) {
- var t = $(jq);
- t.find(".validatebox-text:not(:disabled)").validatebox("validate");
- var _3dd = t.find(".validatebox-invalid");
- _3dd.filter(":not(:disabled):first").focus();
- return _3dd.length == 0;
- },
- validate: function (jq) {
- var approverCombobox = $.data(jq[0], "cmsNextApproverSelector").approverCombobox;
- return approverCombobox.combobox("validate");
- }
- };
- $.fn.cmsNextApproverSelector.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.extend({}, $.fn.cmsNextApproverSelector.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"])), $.fn.validatebox.parseOptions(_7c7));
- //return $.extend({}, $.fn.cmsNextApproverSelector.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsNextApproverSelector.defaults = {
- valueField: 'id',
- textField: 'text',
- url: '',
- loadingMessage: '',
- name: '',
- postData: {},
- showProgress: true,
- onSelect: function () { },
- onLoadSuccess: function () { },
- onLoadError: function () { }
- };
- })(jQuery);
- //2013-12-05 end added by pengbb 新增下一步审批人控件
- //2014-01-19 begin added by pengbb 新增下拉控件
- (function ($) {
- $.parser.plugins.push("cmsCombobox");
- function _getSelectedRecord(jq, selectedValue) {
- var opts = $.data(jq, "cmsCombobox").options;
- var reVal = null;
- $.each(opts.data, function () {
- if (this[opts.valueField] == selectedValue) {
- reVal = this;
- return false;
- }
- });
- return reVal;
- }
- function _init(jq) {
- var opts = $.data(jq, "cmsCombobox").options;
- var jqThis = $(jq);
- if (!opts.url) {
- opts.value = jq.value;
- opts.data = new Array();
- jqThis.find("option").each(function () {
- var rowRecord = new Object();
- rowRecord[opts.valueField] = this.value;
- rowRecord[opts.textField] = this.text;
- opts.data.push(rowRecord);
- });
- }
- $(jq).change(function () {
- opts.value = $(this).val();
- opts.onSelect.call(jq, _getSelectedRecord(jq, opts.value));
- });
- return { cmsCombobox: jq };
- }
- function _loadData(jq, data) {
- var opts = $.data(jq, "cmsCombobox").options;
- opts.data = data || [];
- var optionList = new Array();
- $.each(opts.data, function () {
- optionList.push("<option value=\"" + this[opts.valueField] + "\">" + opts.formatter.call(jq, this) + "</option>");
- });
- $(jq).html(optionList.join(""));
- opts.onLoadSuccess.apply(this);
- }
- function _load(jq) {
- var opts = $.data(jq, "cmsCombobox").options;
- if (opts.url) {
- var params = {};
- opts.onBeforeLoad.call(this, params);
- opts.loader.call(jq, params,
- function (responseJson) {
- _loadData(jq, responseJson);
- }, function () {
- opts.onLoadError.call(this, arguments);
- });
- } else {
- //opts.onLoadSuccess.call(this);
- }
- }
- function _setValue(jq, val) {
- //var opts = $.data(jq, "cmsCombobox").options;
- jq.value = val;
- }
- $.fn.cmsCombobox = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsCombobox.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsCombobox(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsCombobox");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsCombobox", { options: $.extend({}, $.fn.cmsCombobox.defaults, $.fn.cmsCombobox.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsCombobox", $.extend({}, cacheData, initCacheData));
- }
- _load(_this);
- });
- };
- $.fn.cmsCombobox.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsCombobox").options;
- return opts;
- },
- reload: function (jq) {
- },
- getValue: function (jq) {
- return jq.val();
- },
- setValue: function (jq, val) {
- jq.each(function () {
- _setValue(this, val);
- });
- },
- disable: function (jq) {
- jq.disable();
- },
- enable: function (jq) {
- jq.enable();
- }
- };
- $.fn.cmsCombobox.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.combo.parseOptions(_7c7), $.parser.parseOptions(_7c7, ["valueField", "textField", "mode", "method", "url"]));
- };
- $.fn.cmsCombobox.defaults = $.extend({}, $.fn.combo.defaults, {
- autoLoad: false,
- valueField: "value", textField: "text", mode: "local", method: "post", url: null, data: null,
- filter: function (q, row) {
- var opts = $(this).cmsCombobox("options");
- return row[opts.textField].indexOf(q) == 0;
- }, formatter: function (row) {
- var opts = $(this).cmsCombobox("options");
- return row[opts.textField];
- }, loader: function (_7c9, _7ca, _7cb) {
- var opts = $(this).cmsCombobox("options");
- if (!opts.url) {
- return false;
- }
- $.ajax({
- type: opts.method, url: opts.url, data: _7c9, dataType: "json", success: function (data) {
- _7ca(data);
- }, error: function () {
- _7cb.call(this, arguments);
- }
- });
- }, onBeforeLoad: function (_7cc) {
- }, onLoadSuccess: function () {
- }, onLoadError: function () {
- }, onSelect: function (_7cd) {
- }, onUnselect: function (_7ce) {
- }
- });
- })(jQuery);
- //2014-01-19 end added by pengbb 新增下拉控件
- //2013-12-05 begin added by pengbb 新增时间选择控件
- /*用法:指定class 为 easyui-cmsDatebox
- <span class="easyui-cmsDatebox cmsDateTimeBox">
- <input title="" style="width: auto;" readonly="false" class="cmsDateTimeBox-text" type="text">
- <span class="cmsDateTimeBox-select"></span>
- </span>
- */
- (function ($) {
- $.parser.plugins.push("cmsDateTimeBox");
- function _init(jq) {
- var opts = $.data(jq, "cmsDateTimeBox").options;
- var jqThis = $(jq);
- var jqTxtValue = jqThis.find("input.cmsDateTimeBox-text");
- var jqBtnSelect = jqThis.find("span.cmsDateTimeBox-select");
- var wdatePickerOptions = $.extend({}, opts, {
- el: jqTxtValue[0],
- onpicking: function () {
- }, onpicked: function () {
- opts.onSelect.call(jq);
- return true;
- }, onclearing: function () {
- }, oncleared: function () {
- }
- });
- jqBtnSelect.bind("mouseenter.cmsDateTimeBox", function () {
- $(this).addClass("cmsDateTimeBox-select-hover");
- }).bind("mouseleave.cmsDatebox", function () {
- $(this).removeClass("cmsDateTimeBox-select-hover");
- }).bind("mousedown.cmsDatebox", function () {
- WdatePicker(wdatePickerOptions);
- });
- jqTxtValue.click(function () {
- WdatePicker(wdatePickerOptions);
- });
- return { cmsDateTimeBox: jq, txtValue: jqTxtValue, btnSelect: jqBtnSelect };
- }
- $.fn.cmsDateTimeBox = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsDateTimeBox.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsDateTimeBox(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsDateTimeBox");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsDateTimeBox", { options: $.extend({}, $.fn.cmsDateTimeBox.defaults, $.fn.cmsDateTimeBox.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsDateTimeBox", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.cmsDateTimeBox.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsDateTimeBox").options;
- return opts;
- },
- getValue: function (jq) {
- var txtValue = $.data(jq[0], "cmsDateTimeBox").txtValue;
- return txtValue.val();
- },
- setValue: function (jq, val) {
- jq.each(function () {
- var txtValue = $.data(jq[0], "cmsDateTimeBox").txtValue;
- return txtValue.val(val);
- });
- }
- };
- $.fn.cmsDateTimeBox.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsDateTimeBox.defaults = $.extend({}, {}, {
- dateFmt: 'yyyy-MM-dd',
- lang: 'zh-cn',
- onSelect: function () {
- }
- });
- })(jQuery);
- //2014-01-20 end added by pengbb 新增时间选择控件
- //2014-01-21 begin added by pengbb 新增页面操作loading效果
- $.cmsLoading = (function () {
- var defaultSetting = {
- panelElement: document.body,
- defaultMessage: "正在努力处理中..."
- };
- var isInit = false;
- var loadingPanel = null;
- var f_getLoadingPanel = function () {
- return loadingPanel;
- };
- var f_show = function (msg) {
- if (!isInit) {
- this.setting.panelElement = this.setting.panelElement || document.body;
- loadingPanel = $('<div class="loading-panel"><div class="loading-mask" style="display:block"></div><div class="loading-mask-msg" style="display:block;left:46%;"></div></div>').appendTo(this.setting.panelElement);
- isInit = true;
- } else {
- loadingPanel.show();
- }
- loadingPanel.find("div.loading-mask-msg").html(msg || this.setting.defaultMessage);
- };
- var f_hide = function () {
- if (loadingPanel) {
- loadingPanel.hide();
- }
- };
- return { getLoadingPanel: f_getLoadingPanel, show: f_show, hide: f_hide, setting: defaultSetting };
- })();
- //2014-01-21 end added by pengbb 新增页面操作loading效果
- //2014-01-23 begin added by pengbb 新增下一步审批人控件,审批页面使用
- /*用法:定义一个div,指定class 为 easyui-cmsLocalNextApproverSelector
- <div class="easyui-cmsLocalNextApproverSelector" data-options="" >
- <select name="xxx"><option>xxx</option><option>xxx</option><option>xxx</option></select>
- <label></label>
- </div>
- data-options参数如下:
- url:'/Common/GetHtmlContent',
- loadingMessage:'正在加载中...',
- postData : {}
- */
- (function ($) {
- $.parser.plugins.push("cmsLocalNextApproverSelector");
- function _init(jq) {
- var opts = $.data(jq, "cmsLocalNextApproverSelector").options;
- var jqThis = $(jq);
- var approverCombobox = jqThis.find(">select");
- var workPositionLabel = jqThis.find(">label");
- approverCombobox.validatebox(opts);
- approverCombobox.unbind("cmsLocalNextApproverSelector");
- approverCombobox.bind("change.cmsLocalNextApproverSelector", function () {
- var selectedData = _getSelectedData(jq);
- if (selectedData && selectedData.ApprovalPower.length > 0) {
- workPositionLabel.text(selectedData.ApprovalPower[0].NodeName);
- } else {
- workPositionLabel.text("");
- }
- });
- //2014-02-20 end added by pengbb 修改IE8下 下一步审批人为"结束"时验证不通过
- if ($.browser.msie && $.browser.version > 6 && !approverCombobox.attr("disabled")) {
- approverCombobox.validatebox("validate");
- }
- return { cmsNextApproverSelector: jq, approverCombobox: approverCombobox, workPositionLabel: workPositionLabel };
- }
- function _getSelectedData(jq) {
- var opts = $.data(jq, "cmsLocalNextApproverSelector").options;
- var approverCombobox = $.data(jq, "cmsLocalNextApproverSelector").approverCombobox;
- var selectedValue = approverCombobox.val();
- var selectedData = null;
- $.each(opts.data, function () {
- if (this[opts.valueField] == selectedValue) {
- selectedData = this;
- return false;
- }
- });
- return selectedData;
- }
- function _loadData(jq, data) {
- var opts = $.data(jq, "cmsLocalNextApproverSelector").options;
- var approverCombobox = $.data(jq, "cmsLocalNextApproverSelector").approverCombobox;
- approverCombobox.enable();
- opts.data = data || [];
- var optionList = new Array();
- optionList.push("<option value=''>请选择</option>");
- $.each(opts.data, function () {
- if (this[opts.textField] == "结束") {
- optionList.length = 0;
- $(approverCombobox).attr("disabled", "disabled");
- }
- optionList.push("<option value=\"" + this[opts.valueField] + "\">" + opts.formatter.call(jq, this) + "</option>");
- });
- approverCombobox.html(optionList.join(""));
- opts.onLoadSuccess.apply(this);
- }
- function _reload(jq, url, postData) {
- var opts = $.data(jq, "cmsLocalNextApproverSelector").options;
- var approverCombobox = $.data(jq, "cmsLocalNextApproverSelector").approverCombobox;
- var workPositionLabel = $.data(jq, "cmsLocalNextApproverSelector").workPositionLabel;
- approverCombobox.disable();
- workPositionLabel.text("正在加载下一步审批人,请稍等...");
- $.ajax({
- type: "post", url: url, data: postData, dataType: "json", success: function (data) {
- workPositionLabel.text("");
- _loadData(jq, data);
- //解决点击下一步审批人下拉框缩回去的Bug
- if ($.browser.msie && $.browser.version > 6 && !approverCombobox.attr("disabled")) {
- approverCombobox.validatebox("validate");
- }
- }, error: function () {
- workPositionLabel.text("下一步审批人加载失败,请尝试重新打开,若多次出现这种请联系系统管理员");
- opts.onLoadError.apply(this, arguments);
- }
- });
- }
- $.fn.cmsLocalNextApproverSelector = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsLocalNextApproverSelector.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsLocalNextApproverSelector(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var _jqThis = $(_this);
- var cacheData = $.data(_this, "cmsLocalNextApproverSelector");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsLocalNextApproverSelector", { options: $.extend({}, $.fn.cmsLocalNextApproverSelector.defaults, $.fn.cmsLocalNextApproverSelector.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsLocalNextApproverSelector", $.extend({}, cacheData, initCacheData));
- }
- var opts = cacheData.options;
- if (opts.url && (!opts.data || opts.data.length == 0)) {
- _reload(_this, opts.url, opts.postData);
- }
- });
- };
- $.fn.cmsLocalNextApproverSelector.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsLocalNextApproverSelector").options;
- return opts;
- },
- reload: function (jq, p) {
- jq.each(function () {
- _reload(this, p.url, p.postData);
- });
- },
- getValue: function (jq) {
- var approverCombobox = $.data(jq[0], "cmsLocalNextApproverSelector").approverCombobox;
- return approverCombobox.val();
- },
- isValid: function (jq) {
- var t = $(jq);
- t.find("select:not(:disabled)").validatebox("validate");
- var _3dd = t.find(".validatebox-invalid");
- _3dd.filter(":not(:disabled):first").focus();
- return _3dd.length == 0;
- },
- validate: function (jq) {
- var approverCombobox = $.data(jq[0], "cmsLocalNextApproverSelector").approverCombobox;
- return approverCombobox.cmsCombobox("validate");
- }
- };
- $.fn.cmsLocalNextApproverSelector.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.extend({}, $.fn.cmsLocalNextApproverSelector.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"])), $.fn.validatebox.parseOptions(_7c7));
- //return $.extend({}, $.fn.cmsNextApproverSelector.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsLocalNextApproverSelector.defaults = {
- valueField: 'UserID',
- textField: 'UserName',
- url: '',
- loadingMessage: '',
- name: '',
- postData: {},
- data: [],
- showProgress: true,
- onSelect: function () { },
- onLoadSuccess: function () { },
- onLoadError: function () { },
- formatter: function (row) {
- var opts = $(this).cmsLocalNextApproverSelector("options");
- return row[opts.textField];
- }
- };
- })(jQuery);
- //2014-01-23 end added by pengbb 新增下一步审批人控件,审批页面使用
- //2014-02-21 begin added by pengbb 新增平铺品牌选择控件 cmsXBrandItemSelector
- (function ($) {
- $.parser.plugins.push("cmsXBrandItemSelector");
- function _init(jq) {
- var opts = $.data(jq, "cmsXBrandItemSelector").options;
- var _jqThis = $(jq);
- var brandPanel = _jqThis.find(".brandpanel");
- var brandItemPanel = _jqThis.find(".branditempanel");
- //品牌
- var brandXOptionItemList = brandPanel.find(".xoption2 table.xTabOption_item");
- brandXOptionItemList.unbind(".cmsXBrandItemSelector");
- brandXOptionItemList.bind("mouseenter.cmsXBrandItemSelector",
- function () {
- var _this = $(this);
- _this.addClass("xTabOption_item_hover");
- }
- );
- brandXOptionItemList.bind("mouseleave.cmsXBrandItemSelector",
- function () {
- var _this = $(this);
- _this.removeClass("xTabOption_item_hover");
- }
- );
- brandXOptionItemList.bind('click.cmsXBrandItemSelector', function () {
- var _this = $(this);
- if (!_this.hasClass("xTabOption_item_selected")) {
- brandPanel.find(".xTabOption_item_selected").each(function () {
- $(this).removeClass("xTabOption_item_selected");
- });
- _this.addClass("xTabOption_item_selected");
- brandPanel.trigger("selectChanged");
- }
- });
- brandPanel.unbind(".cmsXBrandItemSelector");
- brandPanel.bind("selectChanged.cmsXBrandItemSelector", function () {
- var selectValue = brandPanel.find("table.xTabOption_item_selected:first").attr("xoptionValue");
- if (selectValue != "-1") {
- brandItemPanel.show();
- } else {
- brandItemPanel.hide();
- }
- var brandItemPanelContent = brandItemPanel.find(".branditempanel_content");
- brandItemPanelContent.find("li.xoption").remove();
- $.each(opts.brandList, function () {
- if (this.BrandID == selectValue) {
- $.each(this.BrandItemList, function () {
- var newBrandItemLi = $('<LI class="xoption"><table class="xoption_item" cellpadding="0" cellspacing="0" border="0"><tr><td class="xoption_item_bg_left"> </td><td class="xoption_item_bg_center"> </td><td class="xoption_item_bg_right"> </td></tr></table></LI>').appendTo(brandItemPanelContent);
- newBrandItemLi.find("table").attr("xoptionValue", this.BrandItemID);
- newBrandItemLi.find("table td.xoption_item_bg_center").text(this.BrandItemName);
- });
- }
- });
- opts.selectChanged.call(jq);
- });
- //品牌物品
- var brandItemXOptionItemList = brandItemPanel.find("li.xoption table.xoption_item");
- brandItemXOptionItemList.die(".cmsXBrandItemSelector");
- brandItemXOptionItemList.live("mouseenter.cmsXBrandItemSelector",
- function () {
- var _this = $(this);
- _this.addClass("xoption_item_hover");
- }
- );
- brandItemXOptionItemList.live("mouseleave.cmsXBrandItemSelector",
- function () {
- var _this = $(this);
- _this.removeClass("xoption_item_hover");
- }
- );
- brandItemXOptionItemList.live("click.cmsXBrandItemSelector", function () {
- var _this = $(this);
- if (_this.hasClass("xoption_item_selected")) {
- _this.removeClass("xoption_item_selected");
- _this.find("td.xoption_item_bg_right>i").remove();
- } else {
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- }
- brandItemPanel.trigger("selectChanged");
- });
- brandItemPanel.unbind(".cmsXBrandItemSelector");
- brandItemPanel.bind("selectChanged.cmsXBrandItemSelector", function () {
- opts.selectChanged.call(jq);
- });
- //清除所选按扭
- // brandItemPanel.find("li.branditempanel_tools .xbutton").unbind(".cmsXBrandItemSelector");
- // brandItemPanel.find("li.branditempanel_tools .xbutton").bind("click.cmsXBrandItemSelector", function () {
- // if (brandItemPanel.find("li.xoption_selected a").length > 0) {
- // brandItemPanel.find("li.xoption_selected a").each(function () {
- // var li = $(this).closest("li");
- // li.removeClass("xoption_selected");
- // li.find("i").remove();
- // });
- // brandItemPanel.trigger("selectChanged");
- // }
- // });
- return { cmsXBrandItemSelector: jq, brandPanel: brandPanel, brandItemPanel: brandItemPanel };
- }
- $.fn.cmsXBrandItemSelector = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXBrandItemSelector.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXBrandItemSelector(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXBrandItemSelector");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXBrandItemSelector", { options: $.extend({}, $.fn.cmsXBrandItemSelector.defaults, $.fn.cmsXBrandItemSelector.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXBrandItemSelector", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- function _getValue(jq) {
- var opts = $.data(jq, "cmsXBrandItemSelector").options;
- var brandPanel = $.data(jq, "cmsXBrandItemSelector").brandPanel;
- var brandItemPanel = $.data(jq, "cmsXBrandItemSelector").brandItemPanel;
- var brandPayType = { BrandPayTypeID: "-1", BrandPayTypeName: "全部" };
- var brand = { BrandID: "-1", BrandName: "全部" };
- var brandItemList = [];
- brandPanel.find("table.xTabOption_item_selected:first").each(function () {
- var selectedBrand = $(this);
- brand = { BrandID: selectedBrand.attr("xoptionValue"), BrandName: selectedBrand.find("td.xTabOption_item_bg_center").text() };
- });
- brandItemPanel.find("table.xoption_item_selected").each(function () {
- var selectedBrandItem = $(this);
- brandItemList.push({
- BrandItemID: selectedBrandItem.attr("xoptionValue"),
- BrandItemName: selectedBrandItem.find("td.xoption_item_bg_center").text()
- });
- });
- return {
- BrandPayType: brandPayType,
- Brand: brand,
- BrandItemList: brandItemList
- };
- }
- function _clearBrandSelections(jq) {
- var brandPanel = $.data(jq, "cmsXBrandItemSelector").brandPanel;
- var brandItemPanel = $.data(jq, "cmsXBrandItemSelector").brandItemPanel;
- brandPanel.find("table.xTabOption_item_selected").removeClass("xTabOption_item_selected");
- var btnSelectAll = brandPanel.find("table.xTabOption_item[xoptionValue='-1']");
- btnSelectAll.addClass("xTabOption_item_selected");
- brandItemPanel.find("table.xoption_item").remove();
- brandItemPanel.hide();
- }
- function _clearBrandItemSelections(jq) {
- var brandItemPanel = $.data(jq, "cmsXBrandItemSelector").brandItemPanel;
- //brandItemPanel.find("table.xoption_item").remove();
- brandItemPanel.find("table.xoption_item_selected").removeClass("xoption_item_selected");
- //brandItemPanel.hide();
- }
- $.fn.cmsXBrandItemSelector.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXBrandItemSelector").options;
- return opts;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- clearBrandSelections: function (jq) {
- jq.each(function () {
- _clearBrandSelections(this);
- });
- },
- clearBrandItemSelections: function (jq) {
- jq.each(function () {
- _clearBrandItemSelections(this);
- });
- }
- };
- $.fn.cmsXBrandItemSelector.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXBrandItemSelector.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"]));
- };
- $.fn.cmsXBrandItemSelector.defaults = {
- selectChanged: function () {
- var val = $(this).cmsXBrandItemSelector("getValue");
- //alert(val.Brand.BrandName);
- //if (val.BrandItemList.length > 0) {
- // var ss = [];
- // $.each(val.BrandItemList, function () {
- // ss.push(this.BrandItemName);
- // });
- // alert(ss.join(","));
- //}
- },
- brandList: []
- };
- })(jQuery);
- //2014-02-21 end added by pengbb 新增平铺品牌选择控件
- //2014-02-24 begin added by pengbb 新增平铺选择控件 cmsXTileSelector
- (function ($) {
- $.parser.plugins.push("cmsXTileSelector");
- function _init(jq) {
- var opts = $.data(jq, "cmsXTileSelector").options;
- var _jqThis = $(jq);
- //var btnSelectAll = _jqThis.find(".col2 .selectall .xoption a");
- var tileItemPanel = _jqThis.find(".tileItemPanel,.tileItemPanel_more");
- if (tileItemPanel.find(".tileItemPanel_tools").length > 0) {
- var tileItemPanelMore = _jqThis.find(".tileItemPanel_more");
- var btnShowMore = tileItemPanel.find(".tileItemPanel_tools table.xbutton");
- btnShowMore.unbind(".cmsXTileSelector");
- btnShowMore.bind("click.cmsXTileSelector", function () {
- var btn = $(this);
- if (btn.hasClass("tileItemPanel_more_hide")) {
- btn.find("td.xbutton_bg_center").text("更多");
- btn.removeClass("tileItemPanel_more_hide");
- tileItemPanelMore.hide();
- } else {
- btn.addClass("tileItemPanel_more_hide");
- tileItemPanelMore.show();
- btn.find("td.xbutton_bg_center").text("收起");
- }
- });
- }
- //选项
- var optionItemList = tileItemPanel.find(".xoption table.xoption_item");
- var btnAllOptionItem = tileItemPanel.find(".xoption table.xoption_item[xoptionValue='-1']");
- optionItemList.unbind(".cmsXTileSelector");
- optionItemList.bind("mouseenter.cmsXTileSelector",
- function () {
- var _this = $(this);
- _this.addClass("xoption_item_hover");
- }
- );
- optionItemList.bind("mouseleave.cmsXTileSelector",
- function () {
- var _this = $(this);
- _this.removeClass("xoption_item_hover");
- }
- );
- optionItemList.bind('click.cmsXTileSelector', function () {
- var _this = $(this);
- var _thisValue = _this.attr("xoptionvalue");
- var isBtnAll = _thisValue == "-1";
- var isSelected = _this.hasClass("xoption_item_selected");
- if (opts.multiple) {
- if (isSelected && isBtnAll) return;
- if (_this.hasClass("xoption_item_selected")) {
- _this.removeClass("xoption_item_selected");
- _this.find("td.xoption_item_bg_right>i").remove();
- } else {
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- }
- if (!isBtnAll) {
- if (tileItemPanel.find(".xoption table.xoption_item_selected").length > 0) {
- btnAllOptionItem.removeClass("xoption_item_selected");
- btnAllOptionItem.find("td.xoption_item_bg_right>i").remove();
- } else {
- btnAllOptionItem.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(btnAllOptionItem.find("td.xoption_item_bg_right"));
- }
- } else {
- var btnOtherOptionItemList = tileItemPanel.find(".xoption table.xoption_item[xoptionValue!='-1']");
- btnOtherOptionItemList.removeClass("xoption_item_selected");
- btnOtherOptionItemList.find("td.xoption_item_bg_right>i").remove();
- }
- } else {
- if (_this.hasClass("xoption_item_selected")) {
- return;
- } else {
- optionItemList.removeClass("xoption_item_selected");
- optionItemList.find("td.xoption_item_bg_right>i").remove();
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- }
- }
- opts.selectChanged.call(jq);
- });
- return { cmsXTileSelector: jq, tileItemPanel: tileItemPanel };
- }
- $.fn.cmsXTileSelector = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXTileSelector.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXTileSelector(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXTileSelector");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXTileSelector", { options: $.extend({}, $.fn.cmsXTileSelector.defaults, $.fn.cmsXTileSelector.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXTileSelector", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- function _getValue(jq) {
- var opts = $.data(jq, "cmsXTileSelector").options;
- var tileItemPanel = $.data(jq, "cmsXTileSelector").tileItemPanel;
- var selectedValueList = [];
- tileItemPanel.find("li.xoption table.xoption_item_selected").each(function () {
- var selectedItem = $(this);
- var selectedValue = new Object();
- selectedValue[opts.valueField] = selectedItem.attr("xoptionValue");
- selectedValue[opts.textField] = selectedItem.find("td.xoption_item_bg_center").text();
- selectedValueList.push(selectedValue);
- });
- return selectedValueList;
- }
- function _clearSelections(jq) {
- var tileItemPanel = $.data(jq, "cmsXTileSelector").tileItemPanel;
- tileItemPanel.find("li.xoption table.xoption_item_selected td.xoption_item_bg_right i").remove();
- tileItemPanel.find("li.xoption table.xoption_item_selected").removeClass("xoption_item_selected");
- var btnAllOptionItem = tileItemPanel.find("li.xoption table.xoption_item[xoptionValue='-1']");
- btnAllOptionItem.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(btnAllOptionItem.find("td.xoption_item_bg_right"));
- }
- $.fn.cmsXTileSelector.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXTileSelector").options;
- return opts;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- clearSelections: function (jq) {
- jq.each(function () {
- _clearSelections(this);
- });
- }
- };
- $.fn.cmsXTileSelector.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXTileSelector.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"]));
- };
- $.fn.cmsXTileSelector.defaults = {
- valueField: "Value",
- textField: "Text",
- selectChanged: function () {
- },
- multiple: true
- };
- })(jQuery);
- //2014-02-24 end added by pengbb 新增平铺品牌选择控件
- //2014-02-24 begin added by pengbb 新增平铺号码规则选择控件 cmsXTelnumberRuleSelector
- (function ($) {
- $.parser.plugins.push("cmsXTelnumberRuleSelector");
- function _init(jq) {
- var opts = $.data(jq, "cmsXTelnumberRuleSelector").options;
- var _jqThis = $(jq);
- var telnumberRuleTypePanel = _jqThis.find(".telnumberRuleTypePanel");
- var telnumberRulePanel = _jqThis.find(".telnumberRulePanel");
- //规则分类
- var telNumberRuleTypeOptionItemList = telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item");
- telNumberRuleTypeOptionItemList.die(".cmsXTelnumberRuleSelector");
- telNumberRuleTypeOptionItemList.live("mouseenter.cmsXTelnumberRuleSelector",
- function () {
- var _this = $(this);
- _this.addClass("xoption_item_hover");
- }
- );
- telNumberRuleTypeOptionItemList.live("mouseleave.cmsXTelnumberRuleSelector",
- function () {
- var _this = $(this);
- _this.removeClass("xoption_item_hover");
- }
- );
- telNumberRuleTypeOptionItemList.live("click.cmsXTelnumberRuleSelector", function () {
- var _this = $(this);
- if (!_this.hasClass("xoption_item_selected")) {
- var oldSelectedTelNumberRuleTypeOptionItemList = telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item_selected");
- oldSelectedTelNumberRuleTypeOptionItemList.removeClass("xoption_item_selected");
- oldSelectedTelNumberRuleTypeOptionItemList.find("td.xoption_item_bg_right>i").remove();
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- telnumberRuleTypePanel.trigger("selectChanged");
- }
- });
- telnumberRuleTypePanel.unbind(".cmsXTelnumberRuleSelector");
- telnumberRuleTypePanel.bind("selectChanged.cmsXTelnumberRuleSelector", function () {
- telnumberRulePanel.find(".xoption").remove();
- var selectedTelNumberRuleTypeID = telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item_selected:first").attr("xoptionValue");
- if (selectedTelNumberRuleTypeID == -1) {
- telnumberRulePanel.hide();
- //$.each(opts.telNumberRuleList, function () {
- // $.each(this.TelNumberRuleList, function () {
- // var newTelNumberRuleLi = $('<LI class="xoption"><A hideFocus href="javascript:void(0);" ><SPAN class="xoption_val"></SPAN></A></LI>').appendTo(telnumberRulePanel);
- // newTelNumberRuleLi.find("a>span").attr("xoptionValue", this.TelNumberRuleID);
- // newTelNumberRuleLi.find("a>span").text(this.TelNumberRuleName);
- // });
- //});
- } else {
- telnumberRulePanel.show();
- $.each(opts.telNumberRuleList, function () {
- if (this.TelNumberRuleTypeID == selectedTelNumberRuleTypeID) {
- $.each(this.TelNumberRuleList, function () {
- var newTelNumberRuleLi = $('<LI class="xoption"><table class="xoption_item" cellpadding="0" cellspacing="0" border="0"><tr><td class="xoption_item_bg_left"> </td><td class="xoption_item_bg_center"> </td><td class="xoption_item_bg_right"> </td></tr></table></LI>').appendTo(telnumberRulePanel);
- newTelNumberRuleLi.find("table").attr("xoptionValue", this.TelNumberRuleID);
- newTelNumberRuleLi.find("table td.xoption_item_bg_center").text(this.TelNumberRuleName);
- });
- }
- });
- }
- opts.selectChanged.call(jq);
- });
- //规则
- var telnumberRuleOptionItemList = telnumberRulePanel.find(".xoption table.xoption_item");
- telnumberRuleOptionItemList.die(".cmsXTelnumberRuleSelector");
- telnumberRuleOptionItemList.live("mouseenter.cmsXTelnumberRuleSelector",
- function () {
- var _this = $(this);
- _this.addClass("xoption_item_hover");
- }
- );
- telnumberRuleOptionItemList.live("mouseleave.cmsXTelnumberRuleSelector",
- function () {
- var _this = $(this);
- _this.removeClass("xoption_item_hover");
- }
- );
- telnumberRuleOptionItemList.live('click.cmsXTelnumberRuleSelector', function () {
- var _this = $(this);
- if (_this.hasClass("xoption_item_selected")) {
- _this.removeClass("xoption_item_selected");
- _this.find("td.xoption_item_bg_right>i").remove();
- } else {
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- }
- telnumberRulePanel.trigger("selectChanged");
- });
- telnumberRulePanel.unbind(".cmsXTelnumberRuleSelector");
- telnumberRulePanel.bind("selectChanged.cmsXTelnumberRuleSelector", function () {
- opts.selectChanged.call(jq);
- });
- telnumberRulePanel.find(".telnumberRulePanelTool table.xbutton").die(".cmsXTelnumberRuleSelector");
- telnumberRulePanel.find(".telnumberRulePanelTool table.xbutton").live("click.cmsXTelnumberRuleSelector", function () {
- telnumberRulePanel.find(".xoption table.xoption_item").each(function () {
- var _this = $(this);
- if (!_this.hasClass("xoption_item_selected")) {
- _this.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(_this.find("td.xoption_item_bg_right"));
- }
- });
- telnumberRulePanel.trigger("selectChanged");
- });
- return { cmsXTelnumberRuleSelector: jq, telnumberRuleTypePanel: telnumberRuleTypePanel, telnumberRulePanel: telnumberRulePanel };
- }
- $.fn.cmsXTelnumberRuleSelector = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXTelnumberRuleSelector.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXTelnumberRuleSelector(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXTelnumberRuleSelector");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXTelnumberRuleSelector", { options: $.extend({}, $.fn.cmsXTelnumberRuleSelector.defaults, $.fn.cmsXTelnumberRuleSelector.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXTelnumberRuleSelector", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- function _getValue(jq) {
- var opts = $.data(jq, "cmsXTelnumberRuleSelector").options;
- var telnumberRuleTypePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRuleTypePanel;
- var telnumberRulePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRulePanel;
- var selectedValueList = [];
- var selectedTelNumberRuleType = {};
- telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item_selected:first").each(function () {
- selectedTelNumberRuleType["TelNumberRuleTypeID"] = $(this).attr("xoptionValue");
- selectedTelNumberRuleType["TelNumberRuleTypeName"] = $(this).find("td.xoption_item_bg_center").text();
- });
- telnumberRulePanel.find("table.xoption_item_selected").each(function () {
- var _this = $(this);
- selectedValueList.push({
- TelNumberRuleName: _this.find("td.xoption_item_bg_center").text(),
- TelNumberRuleID: _this.attr("xoptionValue")
- });
- });
- return { TelNumberRuleType: selectedTelNumberRuleType, TelNumberRuleList: selectedValueList };
- }
- function _clearSelections(jq) {
- var telnumberRuleTypePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRuleTypePanel;
- var telnumberRulePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRulePanel;
- var selectedTelnumberRuleTypeOptionItemList = telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item_selected");
- selectedTelnumberRuleTypeOptionItemList.removeClass("xoption_item_selected");
- selectedTelnumberRuleTypeOptionItemList.find("td.xoption_item_bg_right>i").remove();
- var telnumberRuleTypePanelSelectAll = telnumberRuleTypePanel.find("li.telnumberRuleTypeItem table.xoption_item[xoptionValue='-1']");
- telnumberRuleTypePanelSelectAll.addClass("xoption_item_selected");
- $('<i class="xoption_item_icon_selected" > </i>').appendTo(telnumberRuleTypePanelSelectAll.find("td.xoption_item_bg_right"));
- telnumberRulePanel.find("li.xoption table.xoption_item_selected td.xoption_item_bg_right i").remove();
- telnumberRulePanel.find("li.xoption table.xoption_item_selected").removeClass("xoption_item_selected");
- telnumberRulePanel.hide();
- }
- function _load(jq, param) {
- var opts = $.data(jq, "cmsXTelnumberRuleSelector").options;
- param = $.extend({}, { url: '', postData: {} }, param);
- if (param.url) {
- $.ajax({
- type: "post", url: param.url, data: param.postData, dataType: "json", success: function (data) {
- _loadData(jq, data);
- }, error: function () {
- if (typeof (opts.onLoadError) == "function") {
- opts.onLoadError.call(jq);
- }
- }
- });
- }
- }
- function _loadData(jq, data) {
- var opts = $.data(jq, "cmsXTelnumberRuleSelector").options;
- var telnumberRuleTypePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRuleTypePanel;
- var telnumberRulePanel = $.data(jq, "cmsXTelnumberRuleSelector").telnumberRulePanel;
- opts.telNumberRuleList = data || [];
- telnumberRuleTypePanel.find("li.telnumberRuleTypeItem").remove();
- telnumberRulePanel.find("li.xoption").remove();
- telnumberRulePanel.hide();
- $('<li class="telnumberRuleTypeItem"><table class="xoption_item xoption_item_selected" xoptionValue="-1" cellpadding="0" cellspacing="0"border="0"><tr><td class="xoption_item_bg_left"> </td><td class="xoption_item_bg_center">全部</td><td class="xoption_item_bg_right"> <i class="xoption_item_icon_selected"> </i></td></tr></table></li>').appendTo(telnumberRuleTypePanel);
- $.each(opts.telNumberRuleList, function () {
- var newTelNumberRuleTypeLi = $('<LI class="telnumberRuleTypeItem"><table class="xoption_item" cellpadding="0" cellspacing="0" border="0"><tr><td class="xoption_item_bg_left"> </td><td class="xoption_item_bg_center"> </td><td class="xoption_item_bg_right"> </td></tr></table></LI>').appendTo(telnumberRuleTypePanel);
- newTelNumberRuleTypeLi.find("table").attr("xoptionValue", this.TelNumberRuleTypeID);
- newTelNumberRuleTypeLi.find("table td.xoption_item_bg_center").text(this.TelNumberRuleTypeName);
- //$.each(this.TelNumberRuleList,function() {
- // var newTelNumberRuleLi = $('<LI class="xoption"><A hideFocus href="javascript:void(0);" ><SPAN class="xoption_val"></SPAN></A></LI>').appendTo(telnumberRulePanel);
- // newTelNumberRuleLi.find("a>span").attr("xoptionValue", this.TelNumberRuleID);
- // newTelNumberRuleLi.find("a>span").text(this.TelNumberRuleName);
- //});
- });
- if (typeof (opts.onLoadSuccess) == "function") {
- opts.onLoadSuccess.call(jq);
- }
- }
- $.fn.cmsXTelnumberRuleSelector.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXTelnumberRuleSelector").options;
- return opts;
- },
- getTelNumberRuleList: function (jq) {
- var opts = $.data(jq[0], "cmsXTelnumberRuleSelector").options;
- return opts.telNumberRuleList;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- clearSelections: function (jq) {
- jq.each(function () {
- _clearSelections(this);
- });
- },
- //param:{url:'',postData:{}}
- load: function (jq, param) {
- jq.each(function () {
- _load(this, param);
- });
- }
- };
- $.fn.cmsXTelnumberRuleSelector.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXTelnumberRuleSelector.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsXTelnumberRuleSelector.defaults = {
- selectChanged: function () {
- //alert(JSON.stringify($(this).cmsXTelnumberRuleSelector("getValue")));
- //alert(0);
- },
- multiple: true,
- telNumberRuleList: [],
- onLoadSuccess: function (data) {
- },
- onLoadError: function () {
- }
- };
- })(jQuery);
- //2014-02-24 end added by pengbb 新增平铺号码规则选择控件
- //2014-02-25 begin added by pengbb 新增号码精确查询输入控件 cmsXExactTelNumberInput
- (function ($) {
- $.parser.plugins.push("cmsXExactTelNumberInput");
- function _init(jq) {
- var opts = $.data(jq, "cmsXExactTelNumberInput").options;
- var _jqThis = $(jq);
- var numberInputList = _jqThis.find("li.numbercolumn span.numberinput>input");
- var btnOK = _jqThis.find("li.toolcolumn .xbutton");
- numberInputList.unbind(".cmsXExactTelNumberInput");
- numberInputList.bind("keydown.cmsXExactTelNumberInput", function (event) {
- //48-57,96-105,退格:8,左:37,右:39
- var keyCode = event.keyCode;
- if (!((48 <= keyCode && keyCode <= 57) || (96 <= keyCode && keyCode <= 105) || keyCode == 8)) {
- return false;
- }
- this.value = "";
- });
- numberInputList.bind("keyup.cmsXExactTelNumberInput", function (event) {
- var keyCode = event.keyCode;
- if (keyCode == 37) {
- $(this).closest("li").prev("li").find("span.numberinput>input").focus();
- } else if (keyCode == 39) {
- $(this).closest("li").next("li").find("span.numberinput>input").focus();
- } else {
- if (this.value != "") {
- $(this).closest("li").next("li").find("span.numberinput>input").focus();
- } else {
- if (keyCode == 8) {
- $(this).closest("li").prev("li").find("span.numberinput>input").focus().val("");
- }
- }
- }
- });
- btnOK.unbind(".cmsXExactTelNumberInput");
- btnOK.bind("click.cmsXExactTelNumberInput", function () {
- opts.inputCompleted.call(jq, _getValue(jq));
- });
- return { cmsXExactTelNumberInput: jq, numberInputList: numberInputList, btnOK: btnOK };
- }
- $.fn.cmsXExactTelNumberInput = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXExactTelNumberInput.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXExactTelNumberInput(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXExactTelNumberInput");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXExactTelNumberInput", { options: $.extend({}, $.fn.cmsXExactTelNumberInput.defaults, $.fn.cmsXExactTelNumberInput.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXExactTelNumberInput", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- function _getValue(jq) {
- var opts = $.data(jq, "cmsXExactTelNumberInput").options;
- var numberInputList = $.data(jq, "cmsXExactTelNumberInput").numberInputList;
- var valueList = [];
- numberInputList.each(function () {
- if (this.value == "") {
- valueList.push("_");
- } else {
- valueList.push(this.value);
- }
- });
- return valueList.join("");
- }
- function _reset(jq) {
- var numberInputList = $.data(jq, "cmsXExactTelNumberInput").numberInputList;
- numberInputList.each(function () {
- this.value = "";
- });
- };
- $.fn.cmsXExactTelNumberInput.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXExactTelNumberInput").options;
- return opts;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- reset: function (jq) {
- jq.each(function () {
- _reset(this);
- });
- }
- };
- $.fn.cmsXExactTelNumberInput.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXExactTelNumberInput.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"]));
- };
- $.fn.cmsXExactTelNumberInput.defaults = {
- inputCompleted: function (val) {
- //alert("value:" + $(this).cmsXExactTelNumberInput("getValue"));
- }
- };
- })(jQuery);
- //2014-02-25 end added by pengbb 新增号码精确查询输入控件
- //2014-02-25 begin added by pengbb 新增已选条件控件 cmsXSelectedCondition
- (function ($) {
- $.parser.plugins.push("cmsXSelectedCondition");
- function _init(jq) {
- var opts = $.data(jq, "cmsXSelectedCondition").options;
- var _jqThis = $(jq);
- var selectedConditionPanel = _jqThis.find(".selectedConditionPanel");
- var conditionTool = selectedConditionPanel.find("li.conditionTool");
- var conditionItemPanel = selectedConditionPanel;
- var btnReset = conditionTool.find("table.xbutton_reset");
- var btnQuery = conditionTool.find("table.xbutton_query");
- btnReset.unbind(".cmsXSelectedCondition");
- btnReset.bind("click.cmsXSelectedCondition", function () {
- conditionItemPanel.find(">li.conditionItem").remove();
- conditionItemPanel.trigger("onItemChanged");
- opts.onReset.call(jq);
- });
- btnQuery.unbind(".cmsXSelectedCondition");
- btnQuery.bind("click.cmsXSelectedCondition", function () {
- var formDataJson = _getConditionJson(jq);
- opts.onQuery.call(jq, formDataJson);
- });
- conditionItemPanel.find(">li.conditionItem i").die(".cmsXSelectedCondition");
- conditionItemPanel.find(">li.conditionItem i").live("click.cmsXSelectedCondition", function () {
- var li = $(this).closest("li");
- li.remove();
- var d = new Object();
- d.name = li.attr("conditionName");
- d.value = li.attr("conditionValue");
- opts.onConditionRemoved.call(jq, d);
- conditionItemPanel.trigger("onItemChanged");
- });
- conditionItemPanel.unbind("onItemChanged.cmsXSelectedCondition");
- conditionItemPanel.bind("onItemChanged.cmsXSelectedCondition", function () {
- var formDataJson = _getConditionJson(jq);
- opts.onConditionChanged.call(jq, formDataJson);
- });
- //$('<LI class="conditionItem"><span class="conditionText">百万号段:全部 <i class="deleteButton"> </i></span></LI>').appendTo(conditionItemPanel);
- return { cmsXSelectedCondition: jq, selectedConditionPanel: selectedConditionPanel, conditionItemPanel: conditionItemPanel, conditionTool: conditionTool, btnQuery: btnQuery, btnReset: btnReset };
- }
- $.fn.cmsXSelectedCondition = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXSelectedCondition.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXSelectedCondition(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXSelectedCondition");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXSelectedCondition", { options: $.extend({}, $.fn.cmsXSelectedCondition.defaults, $.fn.cmsXSelectedCondition.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXSelectedCondition", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- function _getConditionJson(jq) {
- var opts = $.data(jq, "cmsXSelectedCondition").options;
- var conditionItemPanel = $.data(jq, "cmsXSelectedCondition").conditionItemPanel;
- var formDataJson = new Object();
- conditionItemPanel.find("li.conditionItem").each(function () {
- var jqItem = $(this);
- var d = new Object();
- d.name = jqItem.attr("conditionName");
- d.value = jqItem.attr("conditionValue");
- if (d.name) {
- if (formDataJson[d.name]) {
- formDataJson[d.name] += "," + d.value;
- } else {
- formDataJson[d.name] = d.value;
- }
- }
- });
- return formDataJson;
- }
- //condition:{name:'',value:'',text:''}
- function _addCondition(jq, condition) {
- var opts = $.data(jq, "cmsXSelectedCondition").options;
- var conditionItemPanel = $.data(jq, "cmsXSelectedCondition").conditionItemPanel;
- if (condition && condition.name && condition.text) {
- var newConditionLi = conditionItemPanel.find("li.conditionItem[conditionName='" + condition.name + "']");
- if (newConditionLi.length == 0) {
- newConditionLi = $('<LI class="conditionItem"><span class="conditionText"><p></p><i class="deleteButton"> </i></span></LI>').appendTo(conditionItemPanel);
- }
- newConditionLi.attr("conditionName", condition.name);
- newConditionLi.attr("conditionValue", condition.value);
- newConditionLi.find(">span>p").html(condition.text);
- conditionItemPanel.trigger("onItemChanged");
- }
- }
- function _removeCondition(jq, conditionName) {
- var opts = $.data(jq, "cmsXSelectedCondition").options;
- var conditionItemPanel = $.data(jq, "cmsXSelectedCondition").conditionItemPanel;
- var a = conditionItemPanel.find("li.conditionItem[conditionName='" + conditionName + "']");
- if (a.length > 0) {
- a.remove();
- conditionItemPanel.trigger("onItemChanged");
- }
- }
- $.fn.cmsXSelectedCondition.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXSelectedCondition").options;
- return opts;
- },
- getConditionJson: function (jq) {
- return _getConditionJson(jq[0]);
- },
- //condition:{name:'',value:'',text:''}
- addCondition: function (jq, condition) {
- jq.each(function () {
- _addCondition(this, condition);
- });
- },
- removeCondition: function (jq, conditionName) {
- jq.each(function () {
- _removeCondition(this, conditionName);
- });
- }
- };
- $.fn.cmsXSelectedCondition.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXSelectedCondition.defaults, $.parser.parseOptions(_7c7, ["valueField", "textField"]));
- };
- $.fn.cmsXSelectedCondition.defaults = {
- onConditionChanged: function (formDataJson) {
- //alert("onConditionChanged:" + JSON.stringify(formDataJson));
- },
- onQuery: function (formDataJson) {
- //alert("onQuery:" + JSON.stringify(formDataJson));
- },
- onConditionRemoved: function (removedCondition) {
- },
- onReset: function () {
- }
- };
- })(jQuery);
- //2014-02-25 end added by pengbb 新增已选条件控件
- //2014-02-28 begin added by pengbb 新增cmsXDataTable
- (function ($) {
- $.parser.plugins.push("cmsXDataTable");
- function _init(jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var _jqThis = $(jq);
- var header = _jqThis.find(">div.xDataTable_bodyPanel .xDataTableHeader");
- var table = _jqThis.find(">div.xDataTable_bodyPanel .xDataTable");
- var parentCtrl = _jqThis.parent();
- var totalWidth = 0;
- var columnList = new Array();
- var contentContainer = table.parent();
- // var container = _jqThis.find(".xDataTable_container");
- // container.scroll(function () {
- // table.find("tr.header").css("top", container.scrollTop());
- // });
- //初始化列属性
- var columnIndex = 0;
- header.find("tr.header>th").each(function () {
- var jqThColumn = $(this);
- var newColumn = $.extend({}, $.fn.cmsXDataTable.column.defaults, $.parser.parseOptions(jqThColumn, []));
- // newColumn.columnType = $(this).attr("columnType");
- // if(newColumn.columnType)
- // newColumn.columnType = newColumn.columnType.replace(/[\']*/g, "");
- if (newColumn.validateOption) {
- if (newColumn.validateOption.required == "true") {
- newColumn.validateOption.required = true;
- }
- else {
- newColumn.validateOption.required = false;
- }
- }
- newColumn.columnIndex = (columnIndex++);
- newColumn.element = this;
- if (newColumn.columnType == "checkbox") {
- jqThColumn.find("input[type='checkbox']").unbind(".cmsXDataTable");
- jqThColumn.find("input[type='checkbox']").bind("click.cmsXDataTable", function () {
- var isChecked = !!$(this).attr("checked");
- var allRow = table.find("tr.row>td[columnIndex='" + newColumn.columnIndex + "'] input[type='checkbox']");
- allRow.attr("checked", isChecked);
- if (isChecked) {
- allRow.closest("tr").addClass("row_selected");
- } else {
- allRow.closest("tr").removeClass("row_selected");
- }
- });
- table.find("tr.row>td[columnIndex='" + newColumn.columnIndex + "'] input[type='checkbox']").die(".cmsXDataTable");
- table.find("tr.row>td[columnIndex='" + newColumn.columnIndex + "'] input[type='checkbox']").live("click.cmsXDataTable", function () {
- var isChecked = !!$(this).attr("checked");
- if (isChecked) {
- $(this).closest("tr").addClass("row_selected");
- } else {
- $(this).closest("tr").removeClass("row_selected");
- }
- });
- newColumn.width = 24;
- }
- else {
- if (newColumn.width) {
- if (newColumn.width < 1) {
- newColumn.width = parentCtrl.width() * newColumn.width;
- }
- } else if (header.find("tr.header>th").length > 0){
- newColumn.width = parseInt(parentCtrl.width() / header.find("tr.header>th").length);
- }
- }
- if (newColumn.hidden) {
- jqThColumn[0].style.display = "none";
- }
- jqThColumn.attr('align', newColumn.align);
- jqThColumn.css("width", newColumn.width + "px");
- totalWidth += newColumn.width;
- columnList.push(newColumn);
- });
- var comboGrid = header.parents('.easyui-combogridX:first');
- if (comboGrid.length > 0) {
- if ((totalWidth + 24) > 150) {
- comboGrid.find('.combogridX-expander').width(totalWidth + 24);
- } else {
- comboGrid.find('.combogridX-expander').width(150);
- }
- }
-
- _calMaxSize(jq);
- var pagerPanel = _jqThis.find(".xDataTablePanel_pager");
- if (opts.pagerType == 0 && opts.pagination) {
- pagerPanel.find("input.xDataTablePanel_pager-page-list").unbind("cmsXDataTable");
- pagerPanel.find("input.xDataTablePanel_pager-page-list").bind("blur.cmsXDataTable", function () {
- opts.pageNumber = 1;
- opts.pageSize = $(this).val();
- _load(jq, opts.queryParams, false);
- });
- pagerPanel.find("input.xDataTablePanel_pager-page-list").bind("keydown.cmsXDataTable", function () {
- var keyCode = event.keyCode;
- if (!((48 <= keyCode && keyCode <= 57) || (96 <= keyCode && keyCode <= 105) || keyCode == 8 || keyCode == 13)) {
- return false;
- }
- });
- pagerPanel.find("input.xDataTablePanel_pager-page-list").bind("keyup.cmsXDataTable", function () {
- var keyCode = event.keyCode;
- if (!((48 <= keyCode && keyCode <= 57) || (96 <= keyCode && keyCode <= 105) || keyCode == 8 || keyCode == 13)) {
- return false;
- }
-
- if ($(this).val() >= 500) $(this).val(500);
- //enter
- if (keyCode == 13) {
- $(this).blur();
- opts.pageNumber = 1;
- opts.pageSize = $(this).val();
- _load(jq, opts.queryParams, false);
- }
- });
- pagerPanel.find("input.xDataTablePanel_pager-num").unbind("cmsXDataTable");
- pagerPanel.find("input.xDataTablePanel_pager-num").bind("keydown.cmsXDataTable", function () {
- var keyCode = event.keyCode;
- if (!((48 <= keyCode && keyCode <= 57) || (96 <= keyCode && keyCode <= 105) || keyCode == 8 || keyCode == 13)) {
- return false;
- }
- });
- pagerPanel.find("input.xDataTablePanel_pager-num").bind("keyup.cmsXDataTable", function () {
- var keyCode = event.keyCode;
- if (!((48 <= keyCode && keyCode <= 57) || (96 <= keyCode && keyCode <= 105) || keyCode == 8 || keyCode == 13)) {
- return false;
- }
- //enter
- if (keyCode == 13) {
- $(this).blur();
- var newPageNumber = $.trim($(this).val());
- if (newPageNumber != "") {
- opts.pageNumber = parseInt(newPageNumber);
- _load(jq, opts.queryParams, false);
- }
- }
- });
- var btnPagerFirst = pagerPanel.find("a.pager-first");
- btnPagerFirst.unbind("cmsXDataTable");
- btnPagerFirst.bind("click.cmsXDataTable", function () {
- if ($(this).hasClass("l-btn-disabled")) {
- return false;
- }
- opts.pageNumber = 1;
- _load(jq, opts.queryParams, false);
- });
- var btnPagerPrev = pagerPanel.find("a.pager-prev");
- btnPagerPrev.unbind("cmsXDataTable");
- btnPagerPrev.bind("click.cmsXDataTable", function () {
- if ($(this).hasClass("l-btn-disabled")) {
- return false;
- }
- opts.pageNumber = opts.pageNumber - 1;
- _load(jq, opts.queryParams, false);
- });
- var btnPagerNext = pagerPanel.find("a.pager-next");
- btnPagerNext.unbind("cmsXDataTable");
- btnPagerNext.bind("click.cmsXDataTable", function () {
- if ($(this).hasClass("l-btn-disabled")) {
- return false;
- }
- opts.pageNumber = opts.pageNumber + 1;
- _load(jq, opts.queryParams, false);
- });
- var btnPagerLast = pagerPanel.find("a.pager-last");
- btnPagerLast.unbind("cmsXDataTable");
- btnPagerLast.bind("click.cmsXDataTable", function () {
- if ($(this).hasClass("l-btn-disabled")) {
- return false;
- }
- opts.pageNumber = opts.totalPage;
- _load(jq, opts.queryParams, false);
- });
- } else {
- var btnPagerNext = pagerPanel.find(".xDataTablePanel_pager_Simp");
- btnPagerNext.unbind("cmsXDataTable");
- btnPagerNext.bind("click.cmsXDataTable", function () {
- if ($(this).hasClass("l-btn-disabled")) {
- return false;
- }
- opts.pageNumber = opts.pageNumber + 1;
- _load(jq, opts.queryParams, false);
- });
- }
- contentContainer.scroll(function() {
- var headerContainer = header.parent();
- headerContainer.scrollLeft($(this).scrollLeft());
- });
- return { cmsXDataTable: jq, table: table, totalWidth: totalWidth, header: header, columnList: columnList, pagerPanel: pagerPanel, btnPagerFirst: btnPagerFirst, btnPagerPrev: btnPagerPrev, btnPagerNext: btnPagerNext, btnPagerLast: btnPagerLast };
- }
- var _loadAll = function (jq, formData) {
- var table = $.data(jq, "cmsXDataTable").table;
- var opts = $.data(jq, "cmsXDataTable").options;
- table.find("tr.row").remove();
- opts.data = { total: 0, rows: [] };
- _load(jq, formData, true);
- };
- var _calMaxSize = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
-
- if (opts.pagerType == 0) {
- var tablePanel = $(jq).find(".xDataTable").parent();
- if (opts.maxHeight) {
- tablePanel.css("maxHeight", opts.maxHeight + "px");
- } else {
- var documentHeight = $(document).height();
- // var bodyHeigh = $("body").height();
- // var bodyTop = $('body').offset().top;
- // var tablePanelHeight = tablePanel.height();
- var maxHeight = documentHeight - 4 - tablePanel.offset().top - $(jq).find(".xDataTablePanel_pager").height();
-
- //教务系统的特殊情况start
- if ($("#BatchModifydiv").length > 0) {
- if ($("#BatchModifydiv").css("display") != "none") {
- maxHeight += $("#BatchModifydiv").height();
- }
- }
- //教务系统的特殊情况end
- // if ((bodyHeigh - tablePanelHeight + maxHeight) > (documentHeight - bodyTop - 30))
- // {
- // maxHeight = maxHeight - ((bodyHeigh - tablePanelHeight + maxHeight) - (documentHeight - bodyTop - 30));
- // }
- tablePanel.css("maxHeight", maxHeight + "px");
- }
- }
- };
- var _load = function (jq, formData, isLoadAll, orderby, isAsc) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var table = $.data(jq, "cmsXDataTable").table;
- var parent = table.closest(".xDataTable_bodyPanel");
- if (!table.css("height") || table.css("height") == "") {
- parent.css("height", "100%;");
- }
- if (typeof (opts.onBeforeLoad) == "function" && opts.onBeforeLoad.call(jq, formData) == false) {
- return;
- }
- //loading msg
- if (opts.loadMsg) {
- $("<div class=\"datagrid-mask\" style=\"display:block\"></div>").appendTo(jq).height($(jq).outerHeight());
- var msg = $("<div class=\"datagrid-mask-msg\" style=\"display:block;left:50%\"></div>").html(opts.loadMsg).appendTo(jq);
- msg.css("marginLeft", -msg.outerWidth() / 2);
- }
- opts.queryParams = formData || opts.queryParams;
- if (opts.pagination) {
- formData = $.extend({}, opts.queryParams, { page: opts.pageNumber - 1, rows: opts.pageSize });
- if (orderby) {
- formData = $.extend({}, formData, { OrderBy: orderby, IsAsc: isAsc });
- }
- } else if (orderby) {
- formData = $.extend({}, opts.queryParams, { OrderBy: orderby, IsAsc: isAsc });
- }
- if (!orderby) {
- _clearOrderByAsc(jq);
- }
- $.ajax({
- type: "post", url: opts.url, data: formData, dataType: "json", success: function (data) {
- data = $.extend({}, { total: 0, rows: [] }, data);
- $(jq).find(".datagrid-mask,.datagrid-mask-msg").remove();
- _loadData(jq, data, isLoadAll);
- }, error: function (e) {
- $(jq).find(".datagrid-mask,.datagrid-mask-msg").remove();
- if (typeof (opts.onLoadError) == "function") {
- opts.onLoadError.call(jq);
- }
- }
- });
- };
- var _getHighlightProp = function (jq, rowIndex) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var row = opts.data.rows[rowIndex];
- var result = "";
- if (opts.rowHighlightColor) {
- if (opts.rowHighlightFun) {
- if (opts.rowHighlightFun.call(this, rowIndex, row)) {
- result = " style=\"background-color: " + opts.rowHighlightColor + "\"";
- }
- }
- }
- return result;
- }
- var _loadData = function (jq, data, isLoadAll) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var header = $.data(jq, "cmsXDataTable").header;
- var table = $.data(jq, "cmsXDataTable").table;
- var totalWidth = $.data(jq, "cmsXDataTable").totalWidth;
- var columnList = $.data(jq, "cmsXDataTable").columnList;
- var pagerPanel = $.data(jq, "cmsXDataTable").pagerPanel;
- var btnPagerFirst = $.data(jq, "cmsXDataTable").btnPagerFirst;
- var btnPagerPrev = $.data(jq, "cmsXDataTable").btnPagerPrev;
- var btnPagerNext = $.data(jq, "cmsXDataTable").btnPagerNext;
- var btnPagerLast = $.data(jq, "cmsXDataTable").btnPagerLast;
- var tableid = table.closest(".easyui-cmsXDataTable").attr("id");
- var tableDataHidden = $("#" + tableid + "_datajson");
- var treeColumn;
- $.each(columnList, function () {
- if (this.columnType == 'tree') {
- treeColumn = this;
- return false;
- }
- });
- if (treeColumn) {
- var tmpRows = new Array();
- _orderDataForTree(data.rows, treeColumn.field, treeColumn.parentIDField, treeColumn.orderByField, tmpRows);
- data.rows = tmpRows;
- }
- if (opts.pagerType == 0 || !opts.data || isLoadAll) {
- //这两句的顺序可不能错,remove的时候原来会触发textbox的propertychange事件,
- //因为暂时没办法阻止这个触发,只好让它触发够了再重新赋值……
- table.find("tr.row").remove();
- opts.data = data;
- } else {
- for (var i = 0; i < data.rows.length; i++) {
- opts.data.rows.push(data.rows[i]);
- }
- }
- if (opts.isPostBack)
- tableDataHidden.val(JSON.stringify(opts.data));
- var deep = 0;
- $.each(data.rows, function (rowIndex) {
- var rowData = this;
- var tdHtmlList = [];
- var realRowIndex = rowIndex;
- if (opts.pagerType == 1 && opts.pagination) {
- realRowIndex += (opts.pageNumber - 1) * opts.pageSize;
- }
- //add by heyw,增加扩展行开始
- //正常行增加一列,并带有展开按钮
- if (opts.hasSubRow == true) {
- if (opts.expandOnLoad == true) {
- tdHtmlList.push("".concat('<td style="width: 20px; line-height: 16px;"><div class="subrow-expander tree-expanded" style="cursor: pointer;" rowIndex="' + realRowIndex + '"></div></td>'));
- }
- else {
- tdHtmlList.push("".concat('<td style="width: 20px; line-height: 16px;"><div class="subrow-expander tree-collapsed" style="cursor: pointer;" rowIndex="' + realRowIndex + '"></div></td>'));
- }
- }
- //add by heyw,增加扩展行结束
- $.each(columnList, function () {
- var columnOpts = this;
- var tdStyle = "width:" + parseInt(columnOpts.width) + "px;";
- if (opts.hasSubRow == true && columnOpts.field == "") { return; }
- if (columnOpts.hidden) {
- tdStyle = "display:none;";
- }
- if (columnOpts.columnType == "checkbox") {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><input type="checkbox" value="', eval("rowData." + columnOpts.field), '"'));
- if (rowData[columnOpts.checkfield]) {
- tdHtmlList.push("".concat(' checked '));
- }
- tdHtmlList.push("".concat('/></td>'));
- var selectAll = $(header.find('.header th').get(columnOpts.columnIndex)).find('input[type="checkbox"]');
- selectAll.removeAttr("checked");
- } else if (columnOpts.columnType == "radiobox") {
- var controlName = columnOpts.field;
- if (columnOpts.customName && columnOpts.customName != "") {
- controlName = columnOpts.customName;
- }
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><input type="radio" name="', controlName, '_', realRowIndex.toString(), '" value="', columnOpts.radioValue.toString(), '"'));
- if (columnOpts.radioValue == eval("rowData." + columnOpts.field)) {
- tdHtmlList.push("".concat(' checked="checked" '));
- }
- tdHtmlList.push("".concat('/></td>'));
- } else if (columnOpts.columnType == "checkbutton") {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><input type="checkbox" name="', columnOpts.field, '_', realRowIndex.toString(), '"'));
- if (eval("rowData." + columnOpts.field)) {
- tdHtmlList.push("".concat(' checked="checked" '));
- }
- tdHtmlList.push("".concat('/></td>'));
- } else if (columnOpts.columnType == "imagebutton") {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><a href="#this"'));
- if (columnOpts.handle) {
- tdHtmlList.push("".concat(' onclick="return ', columnOpts.handle, '(', rowIndex, ",$(this).closest('.easyui-cmsXDataTable').cmsXDataTable('getRows')[" + rowIndex + '])"'));
- }
- tdHtmlList.push("".concat('><img src="', eval("rowData." + columnOpts.field), '" style="border: 0px; width:', columnOpts.imageWidth, '; height:', columnOpts.itemHeight, '" />'));
- tdHtmlList.push("".concat('</a></td>'));
- } else if (columnOpts.columnType == "textbox" || columnOpts.columnType == "triggerbox") {
- var formatterValue = columnOpts.formatter.call(jq, eval("rowData." + columnOpts.field), rowData, rowIndex, columnOpts.overflowlength);
- if (formatterValue != 0) {
- formatterValue = formatterValue || "";
- }
- if (!columnOpts.isMultiline) {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><input type="text" style="width: 98%;" value="', formatterValue, '" /></td>'));
- } else {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '"><textarea rows="3" style="width: 98%;">', formatterValue, '</textarea></td>'));
- }
- } else if (columnOpts.columnType == "dropdownlist" || columnOpts.columnType == "dictionary") {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '">'));
- tdHtmlList.push("".concat('<select id="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '" name="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '" style="width: 98%;"/>'));
- tdHtmlList.push("".concat('</td>'));
- } else if (columnOpts.columnType == "autocomplete") {
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '">'));
- tdHtmlList.push("".concat('<input type="text" id="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '_text" name="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '_text" style="width: 98%;"/>'));
- tdHtmlList.push("".concat('<input type="hidden" id="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '" name="', tableid, '_', columnOpts.fieldname, '_', columnOpts.columnIndex, '" value="', eval("rowData." + columnOpts.field), '" />'));
- tdHtmlList.push("".concat('</td>'));
- } else if (columnOpts.columnType == "tree") {
- var fullID = _getFullID(data.rows, rowData, columnOpts.parentIDField, columnOpts.field);
- deep = fullID.split('.').length - 1;
- tdHtmlList.push("".concat('<td fullTreeID="', fullID, '" columnIndex="', columnOpts.columnIndex, '" align="left" style="', tdStyle, '">', _treeFormatter(columnOpts, rowData, data.rows[rowIndex + 1], deep), ' </td>'));
- } else {
- var formatterValue = columnOpts.formatter.call(jq, eval("rowData." + columnOpts.field), rowData, rowIndex, columnOpts.overflowlength, columnOpts.emptyText);
- if (formatterValue != 0) {
- formatterValue = formatterValue || columnOpts.defaultValue;
- }
- var titleValue;
- if (!columnOpts.columnType) {
- titleValue = eval("rowData." + columnOpts.field) == null ? '' : columnOpts.formatter.call(jq, eval("rowData." + columnOpts.field), rowData, rowIndex, 0, columnOpts.emptyText);
- if (titleValue != 0) {
- titleValue = titleValue || columnOpts.defaultValue;
- }
- } else {
- titleValue = eval("rowData." + columnOpts.field) == null ? '' : eval("rowData." + columnOpts.field);
- }
- if (titleValue.toString().indexOf('<') >= 0) {
- titleValue = eval("rowData." + columnOpts.field) == null ? '' : eval("rowData." + columnOpts.field);
- }
- tdHtmlList.push("".concat('<td columnIndex="', columnOpts.columnIndex, '" style="', tdStyle, '" title="', titleValue, '">', formatterValue, ' </td>'));
- }
- });
- var rowStyle = opts.rowStyle.call(jq, realRowIndex, rowData);
- var highlightProp = _getHighlightProp(jq, rowIndex);
- if (realRowIndex % 2 == 0) {
- $(''.concat('<tr class="row row2"' + highlightProp + ' style="' + rowStyle + '" xRowIndex="', realRowIndex, '">', tdHtmlList.join(""), '</tr>')).appendTo(table);
- } else {
- $(''.concat('<tr class="row"' + highlightProp + ' style="' + rowStyle + '" xRowIndex="', realRowIndex, '">', tdHtmlList.join(""), '</tr>')).appendTo(table);
- }
- //add by heyw,增加扩展行开始
- //填写扩展行内容
- if (opts.hasSubRow == true) {
- var subRowHtml = opts.subRowFomatter(rowData, rowIndex);
- if (opts.expandOnLoad == true) {
- $(''.concat('<tr class="row" style="' + rowStyle + '"' + highlightProp + ' rowIndex="', realRowIndex, '"><td colspan=' + columnList.length + '>', subRowHtml, '</td></tr>')).appendTo(table);
- }
- else {
- $(''.concat('<tr class="row" style="' + rowStyle + '"' + highlightProp + ' style="display: none;" rowIndex="', realRowIndex, '"><td colspan=' + columnList.length + '>', subRowHtml, '</td></tr>')).appendTo(table);
- }
- }
- //add by heyw,增加扩展行结束
- });
- //add by heyw,增加扩展行开始
- //绑定展开按钮事件
- table.find("tr.row>td>div.subrow-expander").each(function () {
- this.onclick = function () {
- var subRow = table.find("tr.row[rowIndex=" + $(this).attr("rowIndex") + "]");
- var oldDisplay = subRow.css("display");
- if (oldDisplay == "none") {
- subRow.css("display", "");
- $(this).attr("class", "tree-expanded");
- }
- else {
- subRow.css("display", "none");
- $(this).attr("class", "tree-collapsed");
- }
- }
- });
- if (opts.isMouseOverHighlight) {
- table.find("tr.row").mouseover(function() {
- $(this).css("background-color", opts.rowHighlightColor);
- $(this).find("td").css("background-color", opts.rowHighlightColor);
- $(this).bind("mouseout.hightlight", function() {
- $(this).css("background-color", "");
- $(this).find("td").css("background-color", "");
- $(this).unbind("mouseout.hightlight");
- });
- });
- }
- if (opts.checkOnSelect) {
- var checkboxColumnIndexList = $.map(
- $.grep(columnList, function (x){ return x.columnType == "checkbox"; }),
- function(x) { return x.columnIndex; });
- table.find('tr.row').click(function() {
- if (event.srcElement.type == "checkbox") return;
- for (var i = 0; i < checkboxColumnIndexList.length; i ++) {
- var checkboxList = $(this).find('td[columnIndex=' + checkboxColumnIndexList[i] + '] input[type="checkbox"]');
- for (var j = 0; j < checkboxList.length; j ++) {
- checkbox = $(checkboxList[j]);
- var isChecked = !checkbox.attr("checked");
- checkbox.attr("checked", isChecked);
- if (isChecked) {
- $(this).addClass("row_selected");
- } else {
- $(this).removeClass("row_selected");
- }
- }
- }
- });
- }
- if (opts.onClickRow) {
- table.find('tr.row').css("cursor", "pointer").click(function () {
- var grid = $(this).parents('.easyui-cmsXDataTable:first');
- var gridOpts = $.data(grid[0], "cmsXDataTable").options;
- var gridData = gridOpts.data;
- var rowIndex = parseInt($(this).attr("xRowIndex"));
- var rowData = gridData.rows[rowIndex];
- opts.onClickRow.call(grid, rowIndex, rowData);
- });
- }
- if (opts.onDblClickRow) {
- table.find('tr.row').css("cursor", "pointer").dblclick(function () {
- var grid = $(this).parents('.easyui-cmsXDataTable:first');
- var gridOpts = $.data(grid[0], "cmsXDataTable").options;
- var gridData = gridOpts.data;
- var rowIndex = parseInt($(this).attr("xRowIndex"));
- var rowData = gridData.rows[rowIndex];
- opts.onDblClickRow.call(grid, rowIndex, rowData);
- });
- }
- //add by heyw,增加扩展行结束
- //add by heyw,创建自定义控件开始
- _createTableControls(jq);
- //add by heyw,创建自定义控件结束
- opts.totalPage = Math.ceil(opts.data.total / opts.pageSize);
- if (opts.pagerType == 0 && opts.pagination) {
- btnPagerFirst.removeClass("l-btn-disabled");
- btnPagerPrev.removeClass("l-btn-disabled");
- btnPagerNext.removeClass("l-btn-disabled");
- btnPagerLast.removeClass("l-btn-disabled");
- if (opts.pageNumber == 1) {
- btnPagerFirst.addClass("l-btn-disabled");
- btnPagerPrev.addClass("l-btn-disabled");
- }
- if (opts.pageNumber >= opts.totalPage) {
- btnPagerNext.addClass("l-btn-disabled");
- btnPagerLast.addClass("l-btn-disabled");
- }
- pagerPanel.find("input.xDataTablePanel_pager-num").val(opts.pageNumber);
- pagerPanel.find(".xDataTablePanel_pager-totalInfo").html("共" + opts.totalPage + "页");
- pagerPanel.find(".xDataTablePanel_pager_info").html("显示" + ((opts.pageNumber - 1) * opts.pageSize + 1) + "到" + ((opts.pageNumber - 1) * opts.pageSize + data.rows.length) + ",共" + data.total + "条记录");
- } else {
- pagerPanel.find(".xDataTablePanel_pager_Simp").removeClass("l-btn-disabled");
- if (opts.pageNumber >= opts.totalPage) {
- pagerPanel.find(".xDataTablePanel_pager_Simp").addClass("l-btn-disabled");
- }
- }
- if (typeof (opts.onLoadSuccess) == "function") {
- opts.onLoadSuccess.call(jq, data);
- }
- if (opts.isAutoHeight) {
- if (table.parent().height() < table.height()) {
- table.parent().height(table.height());
- }
- if (table[0].offsetWidth > table.parent()[0].offsetWidth) {
- table.parent().height(table.height() + 16);
- }
- }
-
- var firstRow = table.find("tr");
- if (firstRow.length > 0) { //一行都没有一般就不会错位
- header.find("tr.header>th").each(function(i, v) {
- var width = $($(firstRow[0]).find("td")[i]).width();
- $(this).width(width);
- });
- }
- };
- var _getFullID = function (dataRows, rowData, parentField, idField) {
- var id = rowData[idField];
- if (!rowData[parentField]) return id;
- var parentData = $.grep(dataRows, function (v) { return v[idField] == rowData[parentField]; })[0];
- return id + "." + _getFullID(dataRows, parentData, parentField, idField);
- };
- var _generalComparer = function (a, b) {
- if (a == null && b == null) {
- return 0;
- }
- else if (a == null) {
- return -1;
- }
- else if (b == null) {
- return 1;
- }
- else if (a == b) {
- return 0;
- }
- else if (a > b) {
- return 1;
- }
- else {
- return -1;
- }
- };
- var _orderDataForTree = function (dataRows, idField, parentField, orderField, result) {
- var topRows = $.grep(dataRows, function (v) { return v[parentField] == null; })
- .sort(function (a, b) { return _generalComparer(a[orderField], b[orderField]); });
- $.each(topRows, function (i, v) {
- result.push(v);
- _pushChild(dataRows, v, idField, parentField, orderField, result);
- })
- };
- var _pushChild = function (dataRows, value, idField, parentField, orderField, result) {
- var childRows = $.grep(dataRows, function (v) { return v[parentField] == value[idField]; })
- .sort(function (a, b) { return _generalComparer(a[orderField], b[orderField]); });
- $.each(childRows, function (i, v) {
- result.push(v);
- _pushChild(dataRows, v, idField, parentField, orderField, result);
- });
- };
- var _treeFormatter = function (columnOpts, rowData, nextRowData, deep) {
- var html = new Array();
- var i;
- for (i = 0; i < deep; i++) {
- html.push('<span class="tree-indent"></span>');
- }
- //有无子集
- if (nextRowData && eval("nextRowData." + columnOpts.parentIDField) == eval("rowData." + columnOpts.field)) {
- html.push('<span class="tree-hit tree-expanded"></span>');
- }
- else {
- html.push('<span class="tree-indent"></span>');
- }
- html.push('<span class="tree-icon tree-folder"></span>');
- html.push('<span class="tree-title">' + rowData[columnOpts.textField] + '</span>');
- return html.join('');
- };
- var _getRealRowIndex = function (opts, rowIndex) {
- var realRowIndex = rowIndex;
- if (opts.pagerType == 1 && opts.pagination) {
- realRowIndex += (opts.pageNumber - 1) * opts.pageSize;
- }
- return realRowIndex;
- }
- var _createTableControls = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var table = $.data(jq, "cmsXDataTable").table;
- var columnList = $.data(jq, "cmsXDataTable").columnList;
- $.each(columnList, function () {
- var columnOpts = this;
- var columnIndex = columnOpts.columnIndex;
- var isEditableColumn = true;
- if (columnOpts.columnType == "autocomplete") {
- _createAutoCompleteControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "textbox" && !columnOpts.isMultiline) {
- _createTextBoxControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "textbox" && columnOpts.isMultiline) {
- _createMultilineControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "triggerbox") {
- _createTriggerBoxControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "radiobox") {
- _createRadioBoxControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "checkbutton") {
- _createCheckButtonControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "dropdownlist") {
- _createDropdownControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "dictionary") {
- _createDictionaryControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "tree") {
- isEditableColumn = false;
- _createTreeControl(columnOpts, table);
- }
- else if (columnOpts.columnType == "linkbutton" || columnOpts.columnType == "imagebutton") {
- var enableFieldName = columnOpts.enableFieldName;
- if (enableFieldName && enableFieldName != "") {
- $.each(opts.data.rows, function (index, rowData) {
- var realRowIndex = _getRealRowIndex(opts, index);
- var tableRow = table.find("tr.row[xRowIndex=" + realRowIndex.toString() + "]");
- if (!eval("rowData." + enableFieldName)) {
- //$(tableRow.find("td")[columnIndex]).html($(tableRow.find("td")[columnIndex]).text());
- $(tableRow.find("td")[columnIndex]).find('*').attr("disabled", "disabled");
- $(tableRow.find("td")[columnIndex]).find('*').addClass("disabledLink");
- }
- });
- }
- var visibleFieldName = columnOpts.visibleFieldName;
- if (visibleFieldName && visibleFieldName != "") {
- $.each(opts.data.rows, function (index, rowData) {
- var realRowIndex = _getRealRowIndex(opts, index);
- var tableRow = table.find("tr.row[xRowIndex=" + realRowIndex.toString() + "]");
- if (!eval("rowData." + visibleFieldName)) {
- $(tableRow.find("td")[columnIndex]).html(" ");
- }
- });
- }
- isEditableColumn = false;
- }
- else {
- isEditableColumn = false;
- }
- if (isEditableColumn) {
- var enableFieldName = columnOpts.enableFieldName;
- if (enableFieldName && enableFieldName != "") {
- $.each(opts.data.rows, function (index, rowData) {
- var realRowIndex = _getRealRowIndex(opts, index);
- var tableRow = table.find("tr.row[xRowIndex=" + realRowIndex.toString() + "]");
- if (eval("!rowData." + enableFieldName)) {
- $(tableRow.find("td")[columnIndex]).children().attr("disabled", "disabled");
- }
- });
- }
- var visibleFieldName = columnOpts.visibleFieldName;
- if (visibleFieldName && visibleFieldName != "") {
- $.each(opts.data.rows, function (index, rowData) {
- var realRowIndex = _getRealRowIndex(opts, index);
- var tableRow = table.find("tr.row[xRowIndex=" + realRowIndex.toString() + "]");
- if (eval("!rowData." + visibleFieldName)) {
- $(tableRow.find("td")[columnIndex]).children().css("display", "none");
- }
- });
- }
- }
- });
- };
- var _createTreeControl = function (columnOpts, table) {
- $(table).find(".tree-hit").each(function () {
- $(this).mouseover(function (e) {
- if ($(e.target).hasClass("tree-expanded"))
- $(e.target).addClass("tree-expanded-hover");
- else
- $(e.target).addClass("tree-collapsed-hover");
- });
- $(this).mouseout(function (e) {
- if ($(e.target).hasClass("tree-expanded-hover"))
- $(e.target).removeClass("tree-expanded-hover");
- else
- $(e.target).removeClass("tree-collapsed-hover");
- });
- $(this).click(function (e) {
- if ($(e.target).hasClass("tree-expanded-hover")) {
- $(e.target).removeClass("tree-expanded");
- $(e.target).removeClass("tree-expanded-hover");
- $(e.target).addClass("tree-collapsed");
- $(e.target).addClass("tree-collapsed-hover");
- }
- else {
- $(e.target).removeClass("tree-collapsed");
- $(e.target).removeClass("tree-collapsed-hover");
- $(e.target).addClass("tree-expanded");
- $(e.target).addClass("tree-expanded-hover");
- }
- var childRows = $(table).find("td[fullTreeID$='" + $(e.target).parent().attr("fullTreeID") + "']");
- childRows = $.grep(childRows, function (v) {
- return $(v).attr("fullTreeID") != $(e.target).parent().attr("fullTreeID");
- });
- $.each(childRows, function () {
- if ($(this).parent().css("display") == "none") {
- $(this).parent().css("display", "");
- } else {
- $(this).parent().css("display", "none");
- }
- });
- });
- });
- };
- var _createTextBoxControl = function (columnOpts, table) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var textControl = $($(this).find("td")[columnOpts.columnIndex]).find('input');
- textControl.on('input propertychange', function (e) {
- var textValue;
- if (!columnOpts.validateOption) {
- textValue = $(this).val();
- } else {
- switch (columnOpts.validateOption.validType) {
- case "onlyMoney" :
- case "onlyDiscount" :
- case "onlyNumber" :
- if (isNaN($(this).val())) {
- textValue = null;
- } else {
- textValue = parseFloat($(this).val());
- }
- break;
- default :
- textValue = $(this).val();
- break;
- }
- }
- _changeDataJson(table, rowIndex, columnOpts.field, textValue, columnOpts);
- });
- if (columnOpts.validateOption) {
- textControl.validatebox(columnOpts.validateOption);
- }
- });
- };
- var _createMultilineControl = function (columnOpts, table) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var textControl = $($(this).find("td")[columnOpts.columnIndex]).find('textarea');
- textControl.on('textarea propertychange', function (e) {
- var textValue;
- if (!columnOpts.validateOption) {
- textValue = $(this).val();
- } else {
- switch (columnOpts.validateOption.validType) {
- case "onlyMoney" :
- case "onlyDiscount" :
- case "onlyNumber" :
- if (isNaN($(this).val())) {
- textValue = null;
- } else {
- textValue = parseFloat($(this).val());
- }
- break;
- default :
- textValue = $(this).val();
- break;
- }
- }
- _changeDataJson(table, rowIndex, columnOpts.field, textValue, columnOpts);
- });
- if (columnOpts.validateOption) {
- textControl.validatebox(columnOpts.validateOption);
- }
- });
- };
- var _createTriggerBoxControl = function (columnOpts, table) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var textControl = $($(this).find("td")[columnOpts.columnIndex]).find('input');
- var jq = table.closest(".easyui-cmsXDataTable")[0];
- var opts = $.data(jq, "cmsXDataTable").options;
- textControl.triggerbox({
- valueField: columnOpts.targetField,
- textField: columnOpts.targetTextField,
- separator: ",",
- editable: true,
- postData: {},
- change: function () {
- var selectedData = $(this).triggerbox("getData");
- if (selectedData.length > 0) {
- var value;
- if (Object.prototype.toString.call(opts.data.rows[rowIndex][columnOpts.field]) === "[object Array]") {
- value = selectedData;
- } else {
- value = $.map(selectedData, function(x) { return x[columnOpts.targetField];}).join(',');
- }
- var text = $.map(selectedData, function(x) { return x[columnOpts.targetTextField];}).join(',');
- _changeDataJson(table, rowIndex, columnOpts.field, value, columnOpts);
- _changeDataJson(table, rowIndex, columnOpts.textfield, text, columnOpts);
- } else {
- if (Object.prototype.toString.call(opts.data.rows[rowIndex][columnOpts.field]) === "[object Array]") {
- _changeDataJson(table, rowIndex, columnOpts.field, [], columnOpts);
- } else {
- _changeDataJson(table, rowIndex, columnOpts.field, null, columnOpts);
- }
- _changeDataJson(table, rowIndex, columnOpts.textfield, null, columnOpts);
- }
- },
- onSearch: columnOpts.triggerHandle
- });
- var newArray = new Array();
- var newObj = new Object();
- if (Object.prototype.toString.call(opts.data.rows[rowIndex][columnOpts.field]) === "[object Array]") {
- newArray = opts.data.rows[rowIndex][columnOpts.field];
- } else {
- newObj[columnOpts.targetField] = opts.data.rows[rowIndex][columnOpts.field];
- newObj[columnOpts.targetTextField] = opts.data.rows[rowIndex][columnOpts.textfield];
- newArray.push(newObj);
- }
- textControl.triggerbox('setValue', newArray);
- });
- }
- var _createRadioBoxControl = function (columnOpts, table) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var radioControl = $($(this).find("td")[columnOpts.columnIndex]).find('input');
- radioControl.click(function () {
- _changeDataJson(table, rowIndex, columnOpts.field, $(this).val(), columnOpts);
- });
- });
- };
- var _createCheckButtonControl = function (columnOpts, table) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var checkButtonControl = $($(this).find("td")[columnOpts.columnIndex]).find('input');
- checkButtonControl.click(function () {
- _changeDataJson(table, rowIndex, columnOpts.field, $(this).prop("checked"), columnOpts);
- });
- });
- };
- var _createDropdownControl = function (columnOpts, table) {
- var jq = table.closest(".easyui-cmsXDataTable")[0];
- var opts = $.data(jq, "cmsXDataTable").options;
- $.ajax({
- // try to leverage ajaxQueue plugin to abort previous requests
- mode: "abort",
- // limit abortion to this input
- dataType: "json",
- url: columnOpts.url,
- data: $.extend({
- bindType: 0
- }, {}),
- success: function (data) {
- if (data && data.length) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var selectControl = $($(this).find("td")[columnOpts.columnIndex]).find('select');
- selectControl.empty();
- $("<option value='-1'>---请选择---</option>").appendTo(selectControl);
- $.each(data, function () {
- if (this[columnOpts.valueField] == eval("opts.data.rows[rowIndex]." + columnOpts.fieldname)) {
- $("<option value='" + this[columnOpts.valueField] + "' selected>" + this[columnOpts.textField] + "</option>").appendTo(selectControl);
- } else {
- $("<option value='" + this[columnOpts.valueField] + "'>" + this[columnOpts.textField] + "</option>").appendTo(selectControl);
- }
- });
-
- $(selectControl).bind("click", function () {
- var selectedValue = $(this).val();
- if (selectedValue == "-1") selectedValue = null;
- _changeDataJson(table, rowIndex, columnOpts.fieldname, selectedValue, columnOpts);
- });
- if (columnOpts.validateOption) {
- $(selectControl).validatebox(columnOpts.validateOption);
- }
- });
- }
- }
- });
- };
- var _createDictionaryControl = function (columnOpts, table) {
- var jq = table.closest(".easyui-cmsXDataTable")[0];
- var opts = $.data(jq, "cmsXDataTable").options;
- var dictionaryCode = columnOpts.dictionaryCode;
- if (dictionaryCode && dictionaryCode != "") {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Common/DictionaryDropDown', { bindType: 0, dictionaryCode: dictionaryCode }, function (dictionaryData) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true; //跳过标题行
- var rowIndex = $(this).attr("xRowIndex");
- var selectControl = $($(this).find("td")[columnOpts.columnIndex]).find('select');
- selectControl.empty();
- $.each(dictionaryData, function () {
- if (this.Value == opts.data.rows[rowIndex][columnOpts.fieldname]) {
- $("<option value='" + this.Value + "' selected>" + this.Text + "</option>").appendTo(selectControl);
- } else {
- $("<option value='" + this.Value + "'>" + this.Text + "</option>").appendTo(selectControl);
- }
- });
- $(selectControl).bind("click", function () {
- var selectedValue = $(this).val();
- if (selectedValue == "-1") selectedValue = null;
- _changeDataJson(table, rowIndex, columnOpts.fieldname, selectedValue, columnOpts);
- });
- if (columnOpts.validateOption) {
- $(selectControl).validatebox(columnOpts.validateOption);
- }
- });
- });
- }
- };
- var _createAutoCompleteControl = function (columnOpts, table) {
- var top = 10;
- //这里开始要修改成一次过读出数据……
- $.ajax({
- // try to leverage ajaxQueue plugin to abort previous requests
- mode: "abort",
- // limit abortion to this input
- dataType: "json",
- url: columnOpts.url,
- data: $.extend({
- q: "",
- limit: 99999
- }, {}),
- success: function (data) {
- if (data && data.length) {
- $(table).find("tr").each(function () {
- if ($(this).find("th").length > 0) return true;
- var rowIndex = $(this).attr("xRowIndex");
- var textControl = $($(this).find("td")[columnOpts.columnIndex]).find('input[type="text"]');
- var valueBox = $($(this).find("td")[columnOpts.columnIndex]).find('input[type="hidden"]');
- $.each(data, function () {
- if (this[columnOpts.valueField].toString() == $(valueBox).val()) {
- $(textControl).val(this[columnOpts.textField]);
- }
- });
- $(textControl).autocomplete(data, {
- max: top,
- minChars: 1,
- width: columnOpts.width,
- scrollHeight: columnOpts.scrollHeight,
- matchContains: columnOpts.matchContains,
- mustMatch: columnOpts.mustMatch,
- cacheLength: 99999, //1- 无缓存
- autoFill: columnOpts.autoFill,
- dataType: 'json',
- parse: function (data) {
- var parsed = [];
- for (var i = 0; i < data.length; i++) {
- parsed[parsed.length] = {
- data: data[i],
- value: data[i][columnOpts.valueField].toString(),
- result: data[i][columnOpts.textField]
- };
- }
- return parsed;
- },
- formatItem: columnOpts.formatter,
- formatMatch: function (row, i, max) {
- return row[columnOpts.textField];
- },
- formatResult: function (row) {
- $(valueBox).val(row[columnOpts.valueField]);
- _changeDataJson(table, rowIndex, columnOpts.fieldname, row[columnOpts.valueField], columnOpts);
- return row[columnOpts.textField];
- }
- });
- if (columnOpts.validateOption) {
- $(textControl).validatebox(columnOpts.validateOption);
- }
- });
- }
- }
- });
- }
- var _changeDataJson = function (table, rowIndex, fieldName, value, columnOpts) {
- var jq = table.closest(".easyui-cmsXDataTable")[0];
- var config = $.data(jq, "cmsXDataTable");
- var opts = config.options;
- if (opts.data.rows.length <= rowIndex) return;
- eval("opts.data.rows[rowIndex]." + fieldName + " = value");
- //$.data(jq, "cmsXDataTable", config);
- if (!opts.isPostBack) return;
- var tableid = table.closest(".easyui-cmsXDataTable").attr("id");
- var tableDataHidden = $("#" + tableid + "_datajson");
- var data = JSON.parse($(tableDataHidden).val());
-
- eval("data.rows[rowIndex]." + fieldName + " = value");
- $(tableDataHidden).val(JSON.stringify(data));
- if (columnOpts) {
- if (columnOpts.onChanged) columnOpts.onChanged.call(columnOpts, rowIndex, data.rows[rowIndex]);
- }
- };
- var _getRowDataByObj = function (jq, obj) {
- var rowIndex = parseInt($(obj).closest("tr").attr("xRowIndex"));
- var opts = $.data(jq, "cmsXDataTable").options;
- var data = opts.data;
- return data.rows[rowIndex];
- };
- var _getRows = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- if (!opts.isPostBack)
- return opts.data.rows;
- else {
- var tableid = $(jq).attr("id");
- var tableDataHidden = $("#" + tableid + "_datajson");
- if (tableDataHidden.val() != "") {
- return JSON.parse(tableDataHidden.val()).rows;
- } else {
- return [];
- }
- }
- };
- var _getTotal = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- return opts.data.total;
- };
- var _getSelections = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var table = $.data(jq, "cmsXDataTable").table;
- var selectionsList = new Array();
- table.find("tr.row_selected").each(function () {
- selectionsList.push(opts.data.rows[$(this).attr("xRowIndex")]);
- });
- return selectionsList;
- };
- var _clearSelections = function (jq) {
- var opts = $.data(jq, "cmsXDataTable").options;
- var table = $.data(jq, "cmsXDataTable").table;
- var columnList = $.data(jq, "cmsXDataTable").columnList;
- var checkboxIndex = 0;
- $.each(columnList, function () {
- if (this.columnType == "checkbox") {
- checkboxIndex = this.columnIndex;
- return false;
- }
- });
- table.find("tr.row_selected").removeClass("row_selected").each(function () {
- $(this).find(">td[columnIndex='" + checkboxIndex + "']>input[type='checkbox']").attr("checked", false);
- });
- };
- var _deleteSubRowItem = function (jq, delData) {
- var tableSettings = $.data(jq, "cmsXDataTable");
- var table = $.data(jq, "cmsXDataTable").table;
- var opts = tableSettings.options;
- var data = opts.data;
- var rowIndex = delData.rowIndex;
- var delValue = delData.value;
- var listElement = delData.listElement;
- var valueElement = delData.valueElement;
- //debugger;
- if (opts.onSubRowItemDelete) {
- var deleted = $.grep(data.rows[rowIndex][listElement], function (v, i) {
- var elementTree = valueElement.split('.');
- var firstElement = elementTree[0];
- elementTree.splice(0, 1);
- var lastElement = elementTree.join('.');
- var expression = 'new Object(v["' + firstElement + '"])';
- if (lastElement != "") {
- expression += '.' + lastElement;
- }
- return eval(expression) == delValue;
- });
- opts.onSubRowItemDelete(deleted[0]);
- }
- var afterDel = $.grep(data.rows[rowIndex][listElement], function (v, i) {
- var elementTree = valueElement.split('.');
- var firstElement = elementTree[0];
- elementTree.splice(0, 1);
- var lastElement = elementTree.join('.');
- var expression = 'new Object(v["' + firstElement + '"])';
- if (lastElement != "") {
- expression += '.' + lastElement;
- }
- return eval(expression) != delValue;
- });
- data.rows[rowIndex][listElement] = afterDel;
- tableSettings.options.data = data;
- $.data(jq, "cmsXDataTable", tableSettings);
- if (opts.isPostBack) {
- var tableid = table.closest(".easyui-cmsXDataTable").attr("id");
- var tableDataHidden = $("#" + tableid + "_datajson");
- $(tableDataHidden).val(JSON.stringify(data));
- }
- tableSettings.table.find("tr.row[rowIndex=" + rowIndex + "]>td").html(opts.subRowFomatter(data.rows[rowIndex], rowIndex));
- }
- var _clearOrderByAsc = function (jq) {
- var headerTable = $(jq).find('.xDataTableHeader');
- $.each(headerTable.find('th div a'), function (i, v) {
- $(v).attr('asc', '1');
- });
- }
- $.fn.cmsXDataTable = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsXDataTable.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsXDataTable(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsXDataTable");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsXDataTable", { options: $.extend({}, $.fn.cmsXDataTable.defaults, $.fn.cmsXDataTable.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsXDataTable", $.extend({}, cacheData, initCacheData));
- }
- if (cacheData.options.autoLoad) {
- if (cacheData.data && cacheData.data.length > 0) {
- _loadData(this, cacheData.data, false);
- } else {
- var conditionControls = $.grep($("[data-condition='" + this.id + "']"), function(x) {
- var opts = $.parser.parseOptions(x, []);
- return !$(x).closest("ul").attr("dynamicWhere") && opts.value && opts.value != "" && opts.value != "-1";
- });
- var isReady = true;
- $.each(conditionControls, function (i, x) {
- var isCombobox = $(x).hasClass('easyui-combobox');
- var isComboGrid = $(x).hasClass('easyui-combogridX');
- var comboboxData = $.data(x, 'combobox');
- var combogridData = $.data(x, 'combogridX');
- if (!isCombobox && !isComboGrid) {
- return true;
- }
- if (isCombobox && !comboboxData) {
- isReady = false;
- return false;
- }
- if (isComboGrid && !combogridData) {
- isReady = false;
- return false;
- }
- if (comboboxData) {
- if (comboboxData.options.value && comboboxData.options.value != ''
- && comboboxData.options.value != '-1' && $(x).next().find(".combo-value").val() == "") {
- isReady = false;
- return false;
- } else {
- return true;
- }
- } else {
- if (combogridData.options.value && combogridData.options.value != '' && combogridData.options.value != -1
- && combogridData.options.text != '' && $(x).attr("loaded") != "true") {
- isReady = false;
- return false;
- } else {
- return true;
- }
- }
- });
- if (isReady && $(this).length > 0 && $.data(this, "cmsXDataTable")) {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _load(this, $.getDataGridParams(this.id), false);
- }
- }
- }
- });
- };
- $.fn.cmsXDataTable.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsXDataTable").options;
- return opts;
- },
- load: function (jq, formData) {
- jq.each(function () {
- var conditionControls = $.grep($("[data-condition='" + this.id + "']"), function(x) {
- var opts = $.parser.parseOptions(x, []);
- return !$(x).closest("ul").attr("dynamicWhere") && opts.value && opts.value != "" && opts.value != "-1";
- });
- var isReady = true;
- $.each(conditionControls, function (i, x) {
- var isCombobox = $(x).hasClass('easyui-combobox');
- var isComboGrid = $(x).hasClass('easyui-combogridX');
- var comboboxData = $.data(x, 'combobox');
- var combogridData = $.data(x, 'combogridX');
- if (!isCombobox && !isComboGrid) {
- return true;
- }
- if (isCombobox && !comboboxData) {
- isReady = false;
- return false;
- }
- if (isComboGrid && !combogridData) {
- isReady = false;
- return false;
- }
- if (comboboxData) {
- if (comboboxData.options.value && comboboxData.options.value != ''
- && comboboxData.options.value != '-1' && $(x).next().find(".combo-value").val() == "") {
- isReady = false;
- return false;
- } else {
- return true;
- }
- } else {
- if (combogridData.options.value && combogridData.options.value != '' && combogridData.options.value != -1
- && combogridData.options.text != '' && $(x).attr("loaded") != "true") {
- isReady = false;
- return false;
- } else {
- return true;
- }
- }
- });
- if (isReady && $(this).length > 0 && $.data(this, "cmsXDataTable")) {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _load(this, formData, false);
- }
- });
- },
- clearOrderByAsc: function (jq) {
- jq.each(function () {
- _clearOrderByAsc(this);
- });
- },
- loadNextPage: function (jq) {
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- if (opts.data) {
- if (opts.pagerType == 0) {
- if ((opts.pageNumber - 1) * opts.pageSize + opts.data.rows.length < opts.data.total) {
- opts.pageNumber += 1;
- _load(this, opts.queryParams, false);
- }
- } else if (opts.pagerType == 1) {
- if (opts.data.rows.length < opts.data.total) {
- opts.pageNumber += 1;
- _load(this, opts.queryParams, false);
- }
- }
- }
- });
- },
- loadAll: function (jq, formData) {
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _load(this, formData, true);
- });
- },
- reload: function (jq) {
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _load(this, null, true);
- });
- },
- orderLoad: function (jq, orderby) {
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _load(this, null, true, orderby.field, orderby.isAsc);
- });
- },
- loadData: function (jq, data) {
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- opts.pageNumber = 1;
- _loadData(this, data, true);
- });
- },
- getRowDataByObj: function (jq, obj) {
- return _getRowDataByObj(jq[0], obj);
- },
- getRows: function (jq) {
- return _getRows(jq[0]);
- },
- getTotal: function (jq) {
- return _getTotal(jq[0]);
- },
- getSelections: function (jq) {
- return _getSelections(jq[0]);
- },
- clearSelections: function (jq) {
- jq.each(function () {
- _clearSelections(this);
- });
- },
- deleteSubRowItem: function (jq, delData) {
- jq.each(function () {
- _deleteSubRowItem(this, delData);
- }
- );
- },
- setDataValueByIndex: function (jq, parameters) {
- var rowIndex = parameters.rowIndex;
- var columnName = parameters.columnName;
- var newValue = parameters.newValue;
- jq.each(function () {
- var opts = $.data(this, "cmsXDataTable").options;
- var table = $.data(this, "cmsXDataTable").table;
- var columnList = $.data(this, "cmsXDataTable").columnList;
- var columnOptsList = $.grep(columnList, function (x) { return x.field == columnName; });
- var columnOpts = null;
- if (columnOptsList.length > 0) {
- columnOpts = $.grep(columnList, function (x) { return x.field == columnName; })[0];
- }
- _changeDataJson(table, rowIndex, columnName, newValue, columnOpts);
- });
- },
- calMaxSize: function (jq) {
- jq.each(function() {
- _calMaxSize(this);
- });
- }
- };
- $.fn.cmsXDataTable.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsXDataTable.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsXDataTable.column = {
- defaults: {
- defaultValue: ' ',
- field: '',
- formatter: function (value, row, index) {
- return value;
- }
- }
- };
- $.fn.cmsXDataTable.defaults = {
- pageNumber: 1,
- pageSize: 10,
- loadMsg: "努力加载中...",
- emptyMsg: "",
- pagination: true,
- autoLoad: true,
- rowHighlightColor: null,
- isMouseOverHighlight: false,
- RowHighlightFun: "true",
- isAutoHeight: true,
- onSubRowItemDelete: null,
- checkOnSelect: true,
- rowStyle: function (index, row) {
- },
- onLoadSuccess: function (data) {
- },
- onLoadError: function () {
- },
- onBeforeLoad: function (param) {
- },
- //暂未实现
- onClickRow: function (rowIndex, rowData) {
- },
- //暂未实现
- onDblClickRow: function (rowIndex, rowData) {
- },
- //暂未实现
- onClickCell: function (rowIndex, field, value) {
- },
- //暂未实现
- onDblClickCell: function (rowIndex, field, value) {
- }
- };
- $(window).resize(function () {
- $(".cmsXDataTable").cmsXDataTable("calMaxSize");
- });
- })(jQuery);
- //2014-02-28 end added by pengbb 新增cmsXDataTable
- //2014-03-25 begin added by pengbb 新增cmsPanel控件
- (function ($) {
- $.parser.plugins.push("cmsPanel");
- function _init(jq) {
- var opts = $.data(jq, "cmsPanel").options;
- var _jqThis = $(jq);
- var isIE6 = false;
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- isIE6 = true;
- }
- }
- var btnCollapsable = _jqThis.find(">div.panel-header>div.panel-tool>a.cmspanel-tool-collapse");
- btnCollapsable.unbind(".cmsPanel");
- btnCollapsable.bind("click.cmsPanel", function () {
- var _this = $(this);
- if (_this.hasClass("panel-tool-expand")) {
- _this.removeClass("panel-tool-expand");
- if (isIE6) {
- _jqThis.find("div.panel-body").show();
- } else {
- _jqThis.find("div.panel-body").slideDown();
- }
- if (typeof (opts.onExpanded) == "function") {
- opts.onExpanded.call(jq);
- }
- } else {
- _this.addClass("panel-tool-expand");
- if (isIE6) {
- _jqThis.find("div.panel-body").hide();
- } else {
- _jqThis.find("div.panel-body").slideUp();
- }
- if (typeof (opts.onExpanded) == "function") {
- opts.onCollapsed.call(jq);
- }
- }
- });
- return { cmsPanel: jq };
- }
- $.fn.cmsPanel = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsPanel.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsPanel(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsPanel");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsPanel", { options: $.extend({}, $.fn.cmsPanel.defaults, $.fn.cmsPanel.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsPanel", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.cmsPanel.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsPanel").options;
- return opts;
- }
- };
- $.fn.cmsPanel.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsPanel.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsPanel.defaults = {
- onExpanded: function () {
- },
- onCollapsed: function () {
- }
- };
- })(jQuery);
- //2014-03-25 end added by pengbb 新增cmspanel控件
- //2014-03-25 begin added by pengbb 新增cmsMenu控件
- (function ($) {
- $.parser.plugins.push("cmsMenu");
- var isIE6 = false;
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- isIE6 = true;
- }
- }
- function _onMenuClick(jq, clickMenu) {
- var opts = $.data(jq, "cmsMenu").options;
- var _this = $(clickMenu);
- var node = { text: _this.attr("menuTitle"), url: _this.attr("menuUrl"), mnuNo: _this.attr("menuNo") };
- if (typeof (opts.onMenuClick) == "function") {
- opts.onMenuClick.call(jq, node);
- }
- }
- function _toggleChildMenu(currMenu) {
- var menuItemPanel = $(currMenu);
- if (!menuItemPanel.hasClass('nav_left_menuitem_expand')) {
- menuItemPanel.closest("li").siblings("li").removeClass('gradient');
- menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_expand').find(".nav_left_menuitem_right>div").removeClass('down_arrow');
- menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_expand').removeClass('nav_left_menuitem_expand');
- menuItemPanel.closest("li").siblings("li").find('>div.nav_left_menuitem_childpanel').slideUp("normal");
- menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideDown("normal");
- menuItemPanel.closest("li").addClass('gradient');
- menuItemPanel.addClass('nav_left_menuitem_expand');
- menuItemPanel.find(".nav_left_menuitem_right>div").addClass('down_arrow');
- } else {
- menuItemPanel.closest("li").removeClass('gradient');
- menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideUp("normal");
- menuItemPanel.removeClass('nav_left_menuitem_expand');
- menuItemPanel.find(".nav_left_menuitem_right>div").removeClass('down_arrow');
- }
- }
- function _toggleSecondChildMenu(currMenu) {
- var menuItemPanel = $(currMenu);
- if (!menuItemPanel.hasClass('nav_left_menuitem_second_expand')) {
- menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_second_expand').find(".node_plus").removeClass('node_minus');
- menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_second_expand').next().next('div.nav_left_menuitem_childpanel').slideUp("normal");
- menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_second_expand').removeClass('nav_left_menuitem_second_expand');
- menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideDown("normal");
- menuItemPanel.addClass('nav_left_menuitem_second_expand');
- menuItemPanel.find(".node_plus").addClass('node_minus');
- } else {
- menuItemPanel.removeClass('nav_left_menuitem_second_expand');
- menuItemPanel.find(".node_plus").removeClass('node_minus');
- menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideUp("normal");
- }
- }
- function _toggleThirdChildMenu(currMenu) {
- // var menuItemPanel = $(currMenu);
- // if (!menuItemPanel.hasClass('nav_left_menuitem_third_expand')) {
- //
- // //menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_third_expand').find(".node_plus").removeClass('node_minus');
- // menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_third_expand').removeClass('nav_left_menuitem_second_expand');
- // menuItemPanel.closest("li").siblings("li").find('div.nav_left_menuitem_third_expand').slideUp("normal");
- // menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideDown("normal");
- // menuItemPanel.addClass('nav_left_menuitem_third_expand');
- // //menuItemPanel.find(".node_plus").addClass('node_minus');
- // } else {
- //
- // menuItemPanel.removeClass('nav_left_menuitem_third_expand');
- // //menuItemPanel.find(".node_plus").removeClass('node_minus');
- // menuItemPanel.next().next('div.nav_left_menuitem_childpanel').slideUp("normal");
- // }
- }
- function _init(jq) {
- var opts = $.data(jq, "cmsMenu").options;
- var _jqThis = $(jq);
- //一级菜单
- _jqThis.find(".nav_left_menuitem").unbind(".cmsMenu");
- _jqThis.find(".nav_left_menuitem").bind("click.cmsMenu",
- function (event) {
- _toggleChildMenu(this);
- _onMenuClick(jq, $(this).find(".nav_left_menuitem_link"));
- return false;
- }
- );
- //二级菜单
- _jqThis.find(".nav_left_menuitem_second").unbind(".cmsMenu");
- _jqThis.find(".nav_left_menuitem_second").bind("click.cmsMenu",
- function (event) {
- _toggleSecondChildMenu(this);
- _onMenuClick(jq, $(this).find(".nav_left_menuitem_link"));
- return false;
- }
- );
- //二级菜单hover效果
- _jqThis.find(".nav_left_menuitem_second").bind("mouseenter.cmsMenu", function () {
- if (!$(this).hasClass("nav_left_menuitem_second_hover")) {
- $(this).addClass("nav_left_menuitem_second_hover");
- }
- });
- _jqThis.find(".nav_left_menuitem_second").bind("mouseleave.cmsMenu", function () {
- if ($(this).hasClass("nav_left_menuitem_second_hover")) {
- $(this).removeClass("nav_left_menuitem_second_hover");
- }
- });
- //三级菜单
- _jqThis.find(".nav_left_menuitem_third").unbind(".cmsMenu");
- _jqThis.find(".nav_left_menuitem_third").bind("click.cmsMenu",
- function (event) {
- _toggleThirdChildMenu(this);
- _onMenuClick(jq, $(this).find(".nav_left_menuitem_link"));
- return false;
- }
- );
- //三级菜单hover效果
- _jqThis.find(".nav_left_menuitem_third").bind("mouseenter.cmsMenu", function () {
- if (!$(this).hasClass("nav_left_menuitem_third_hover")) {
- $(this).addClass("nav_left_menuitem_third_hover");
- }
- });
- _jqThis.find(".nav_left_menuitem_third").bind("mouseleave.cmsMenu", function () {
- if ($(this).hasClass("nav_left_menuitem_third_hover")) {
- $(this).removeClass("nav_left_menuitem_third_hover");
- }
- });
- return { cmsMenu: jq };
- }
- $.fn.cmsMenu = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.cmsMenu.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.cmsMenu(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "cmsMenu");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "cmsMenu", { options: $.extend({}, $.fn.cmsMenu.defaults, $.fn.cmsMenu.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "cmsMenu", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.cmsMenu.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "cmsMenu").options;
- return opts;
- }
- };
- $.fn.cmsMenu.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.cmsPanel.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.cmsMenu.defaults = {
- onMenuClick: function (node) { }
- };
- })(jQuery);
- //2014-04-21 end added by pengbb 新增cmsMenu控件
- //2014-06-26 begin added by heyw 新增autoComplete控件
- (function ($) {
- $.parser.plugins.push("autoComplete");
- function _init(jq) {
- var opts = $.data(jq, "autoComplete").options;
- var top = 10;
- var _jqThis = $(jq);
- var isIE6 = false;
- if ($.browser.msie) {
- if ($.browser.version < 7) {
- isIE6 = true;
- }
- }
- var mainBox = _jqThis;
- var valueBox = $("#" + _jqThis.attr("id") + "_value");
- $(mainBox).autocomplete(opts.url, {
- max: top,
- minChars: 1,
- width: opts.width,
- scrollHeight: opts.scrollHeight,
- matchContains: opts.matchContains,
- mustMatch: opts.mustMatch,
- cacheLength: 50, //1- 无缓存
- autoFill: opts.autoFill,
- dataType: 'json',
- parse: function (data) {
- var parsed = [];
- for (var i = 0; i < data.length; i++) {
- parsed[parsed.length] = {
- data: data[i],
- value: data[i][opts.valueField].toString(),
- result: data[i][opts.textField]
- };
- }
- return parsed;
- },
- formatItem: opts.formatter,
- formatMatch: function (row, i, max) {
- return row[opts.textField];
- },
- formatResult: function (row) {
- $(valueBox).val(row[opts.valueField]);
- return row[opts.textField];
- }
- });
- if ($(valueBox).val())
- mainBox[0].setDefaultValue($(valueBox).val(), opts.textField, opts.valueField);
- return { autoComplete: jq };
- }
- $.fn.autoComplete = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.autoComplete.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.autoComplete(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "autoComplete");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "autoComplete", { options: $.extend({}, $.fn.autoComplete.defaults, $.fn.autoComplete.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "autoComplete", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.autoComplete.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "autoComplete").options;
- return opts;
- },
- setDefaultValue: function (jq, value) {
- }
- };
- $.fn.autoComplete.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.autoComplete.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.autoComplete.defaults = {
- width: 600,
- scrollHeight: 380,
- matchContains: true,
- mustMatch: true,
- autoFill: false,
- url: "",
- textField: "",
- valueField: "",
- defaltValue: "",
- formatter: function (row, i, max) {
- return i;
- }
- };
- })(jQuery);
- //2014-06-26 begin added by heyw 新增autoComplete控件
- //2014-08-13 begin added by heyw 新增draggableList控件
- (function ($) {
- $.parser.plugins.push("draggableList");
- function _init(jq) {
- var opts = $.data(jq, "draggableList").options;
- var listID = jq.id;
- var div = $("<div></div>").appendTo(jq);
- $.ajax({
- type: "post", url: opts.url, success: function (data) {
- var length = 0;
- $.each(data, function () {
- var htmlList = new Array();
- var className = listID + "_" + this[opts.valueField];
- htmlList.push("<div class=\"easyui-draggable " + className + "\" style=\"cursor: pointer; height: " + opts.itemHeight + "px; line-height: " + opts.itemHeight + "px; float: left;\">");
- if (opts.iconField && opts.iconField != "") {
- htmlList.push("<img style=\"margin-left: 2px; margin-top: 2px; margin-bottom: 2px; float: left;\" src=\"" + this[opts.iconField] + "\" border=\"0\" />");
- }
- htmlList.push("<div class=\"draggableTitle\" style=\"margin-left: 2px; margin-top: 2px; margin-bottom: 2px; color: " + opts.foreColor + "; position: relative; float: left;\" value=\"" + this[opts.valueField] + "\">" + this[opts.titleField] + "</div>");
- htmlList.push("</div>");
- var itemElement = $(htmlList.join(""));
- itemElement.appendTo(div);
- length += itemElement.width();
- $("." + className).draggable({
- handle: ".draggableTitle",
- proxy: "clone",
- revert: true,
- onDrag: function (e) {
- CMSFunction.DragDrop.dragX = e.clientX;
- CMSFunction.DragDrop.dragY = e.clientY;
- },
- onBeforeDrag: function (e) {
- CMSFunction.DragDrop.isInnerDrag = false;
- CMSFunction.DragDrop.offsetX = e.offsetX + e.srcElement.offsetLeft - e.srcElement.parentElement.offsetLeft;
- CMSFunction.DragDrop.offsetY = e.offsetY + e.srcElement.offsetTop - e.srcElement.parentElement.offsetTop;
- }
- });
- });
- div.width(length);
- //$(jq).height(opts.itemHeight + 16);
- }
- });
- return { draggableList: jq };
- }
- $.fn.draggableList = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.draggableList.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.draggableList(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "draggableList");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "draggableList", { options: $.extend({}, $.fn.draggableList.defaults, $.fn.draggableList.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "draggableList", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.draggableList.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "draggableList").options;
- return opts;
- },
- setDefaultValue: function (jq, value) {
- }
- };
- $.fn.draggableList.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.draggableList.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.draggableList.defaults = {
- url: "",
- titleField: "",
- valueField: "",
- iconField: "",
- itemHeight: 0,
- foreColor: "#000000"
- };
- })(jQuery);
- //2014-08-13 begin added by heyw 新增draggableList控件
- //2014-08-18 begin added by heyw 新增droppableContainer控件
- (function ($) {
- $.parser.plugins.push("droppableContainer");
- function _init(jq) {
- var opts = $.data(jq, "droppableContainer").options;
- var listID = jq.id;
- var myLeft = jq.clientLeft;
- var myTop = jq.clientTop;
- var myWidth = jq.clientWidth;
- var myHeight = jq.clientHeight;
- document.body.oncontextmenu = function (e) {
- e = e || window.event;
- var target = e.target || e.srcElement;
- if (($(target).hasClass("easyui-draggable") && $(target).parent().hasClass("easyui-droppableContainer"))
- || ($(target).parent().hasClass("easyui-draggable") && $(target).parent().parent().hasClass("easyui-droppableContainer"))) {
- CMSFunction.DragDrop.DropContainerItemClick(e);
- return false;
- }
- }
- if (opts.url && opts.url != "") {
- $.ajax({
- type: "post", url: opts.url, success: function (data) {
- $.each(data, function () {
- var htmlList = new Array();
- var className = listID + "_" + this[opts.valueField];
- htmlList.push("<div class=\"easyui-draggable " + className + "\" style=\"cursor: pointer; position: absolute; height: " + opts.itemHeight + "px; line-height: " + opts.itemHeight + "px; float: left; left: " + this[opts.leftField] + "px; top: " + this[opts.topField] + "px; \">");
- if (opts.iconField && opts.iconField != "") {
- htmlList.push("<img style=\"margin-top: 2px; margin-bottom: 2px; margin-left: 2px; float: left;\" border=\"0\" src=\"" + this[opts.iconField] + "\">");
- }
- htmlList.push("<div class=\"draggableTitle\" style=\"color: " + opts.foreColor + "; margin-left: 2px; margin-top: 2px; margin-bottom: 2px; float: left;\" value=\"" + this[opts.valueField] + "\">" + this[opts.titleField] + "</div>");
- htmlList.push("</div>");
- $(htmlList.join("")).appendTo(jq);
- $("." + className).draggable({
- handle: ".draggableTitle",
- onDrag: function (e) {
- CMSFunction.DragDrop.dragX = e.clientX;
- CMSFunction.DragDrop.dragY = e.clientY;
- },
- onBeforeDrag: function (e) {
- CMSFunction.DragDrop.isInnerDrag = true;
- CMSFunction.DragDrop.offsetX = e.offsetX;
- CMSFunction.DragDrop.offsetY = e.offsetY;
- },
- onStopDrag: function (e) {
- if (e.clientX < myLeft || e.clientX > myLeft + myWidth || e.clientY < myTop || e.clientY > myTop + myHeight) {
- $(e.srcElement).offsetParent().remove();
- }
- }
- });
- });
- }
- });
- }
- else if (opts.items && opts.items.length > 0) {
- $.each(opts.items, function () {
- var htmlList = new Array();
- var className = listID + "_" + this.value;
- htmlList.push("<div class=\"easyui-draggable " + className + "\" style=\"cursor: pointer; position: absolute; height: " + opts.itemHeight + "px; line-height: " + opts.itemHeight + "px; float: left; left: " + this.left + "px; top: " + this.top + "px; \">");
- if (this.icon && this.icon != "") {
- htmlList.push("<img style=\"margin-top: 2px; margin-bottom: 2px; margin-left: 2px; float: left;\" border=\"0\" src=\"" + this.icon + "\">");
- }
- htmlList.push("<div class=\"draggableTitle\" style=\"color: " + opts.foreColor + "; margin-left: 2px; margin-top: 2px; margin-bottom: 2px; float: left;\" value=\"" + this.value + "\">" + this.title + "</div>");
- htmlList.push("</div>");
- $(htmlList.join("")).appendTo(jq);
- $("." + className).draggable({
- handle: ".draggableTitle",
- onDrag: function (e) {
- CMSFunction.DragDrop.dragX = e.clientX;
- CMSFunction.DragDrop.dragY = e.clientY;
- },
- onBeforeDrag: function (e) {
- CMSFunction.DragDrop.isInnerDrag = true;
- CMSFunction.DragDrop.offsetX = e.offsetX;
- CMSFunction.DragDrop.offsetY = e.offsetY;
- },
- onStopDrag: function (e) {
- if (e.clientX < myLeft || e.clientX > myLeft + myWidth || e.clientY < myTop || e.clientY > myTop + myHeight) {
- $(e.srcElement).offsetParent().remove();
- }
- }
- });
- });
- }
- $(jq).droppable({});
- var hidden = $(jq).next();
- hidden.val('');
- $.each($(jq).find('.easyui-draggable'), function () {
- var valStr = '';
- if (hidden.val() != '') valStr = ',';
- var titleDiv = $(this).find('.draggableTitle');
- valStr += titleDiv.attr('value') + '|' + titleDiv.html() + '|' + $(this).css('left').replace("px", "") + '|' + $(this).css('top').replace("px", "");
- hidden.val(hidden.val() + valStr);
- });
- return { droppableContainer: jq };
- }
- $.fn.droppableContainer = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.droppableContainer.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.droppableContainer(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "droppableContainer");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "droppableContainer", { options: $.extend({}, $.fn.droppableContainer.defaults, $.fn.droppableContainer.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "droppableContainer", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.droppableContainer.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "droppableContainer").options;
- return opts;
- },
- getContainerItems: function (jq) {
- var hidden = jq.next();
- var valStr = hidden.val();
- var items = valStr.split(',');
- var result = new Array();
- $.each(items, function () {
- var colVals = this.split('|');
- result.push({
- Icon: null,
- Value: colVals[0],
- Title: colVals[1],
- Left: parseInt(colVals[2]),
- Top: parseInt(colVals[3])
- });
- });
- return result;
- }
- };
- $.fn.droppableContainer.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.droppableContainer.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.droppableContainer.defaults = {
- title: "",
- value: "",
- icon: "",
- height: 0,
- foreColor: "#000000"
- };
- })(jQuery);
- //2014-08-18 begin added by heyw 新增droppableContainer控件
- //2015-12-08 begin added by heyw 新增combogridX控件
- (function ($) {
- $.parser.plugins.push("combogridX");
- function _init(jq) {
- var opts = $.data(jq, "combogridX").options;
- var bubbleKeyup = true;
- var oldValue;
- var lastScoreHeight = 0;
- var expander = $(jq).find(".combogridX-expander");
- if (opts.panelWidth) {
- $(expander).width(opts.panelWidth);
- }
- $(document).click(function () {
- if ($(event.srcElement).parents(".easyui-combogridX").length == 0) {
- $('.combogridX-expander').css("display", "none");
- }
- });
- var gridTable = $(jq).find('.easyui-cmsXDataTable');
- var beforeScrollTop = $(gridTable).scrollTop();
- $(expander).scroll(function (event) {
- event = event || window.event;
- var afterScrollTop = $(gridTable).scrollTop;
- delta = afterScrollTop - beforeScrollTop;
- beforeScrollTop = afterScrollTop;
- var scrollTop = $(this).scrollTop();
- var scrollHeight = $(gridTable).height();
- var windowHeight = $(this).height();
- if (scrollTop + windowHeight >= (scrollHeight - 10) && lastScoreHeight != scrollHeight) { //滚动到底部执行事件
- lastScoreHeight = scrollHeight;
- gridTable.cmsXDataTable("loadNextPage");
- return;
- }
- });
- $(jq).find(".combo-arrow").mouseover(function () {
- $(this).addClass("combogridX-arrow-hover");
- });
- $(jq).find(".combo-arrow").mouseout(function () {
- $(this).removeClass("combogridX-arrow-hover");
- });
- $(jq).find(".combo-clear").mouseover(function () {
- $(this).addClass("combo-clear-hover");
- });
- $(jq).find(".combo-clear").mouseout(function () {
- $(this).removeClass("combo-clear-hover");
- });
- var comboText = $(jq).find(".combo-text");
- var controlWidth = comboText.width() + 4;
- if ($(jq).attr("width")) {
- controlWidth = parseInt($(jq).attr("width"));
- }
- comboText.width(controlWidth - 36 - 3);
- $(jq).width(controlWidth);
- $(jq).find(".combo-arrow").offset({
- top: $(jq).find(".combo-arrow").offset().top,
- left: $(jq).find(".combo-arrow").offset().left + 18
- });
- if (comboText.attr("placeholder") && $(jq).attr("placeholder") != "") {
- comboText.placeholder();
- }
- //设置相应事件
- if (opts.enabled == true) {
- $(jq).find(".combo-arrow").click(function () {
- var dropdown = $(this).parents('.easyui-combogridX:first');
- var expander = dropdown.find(".combogridX-expander");
- var display = expander.css("display");
- $('.combogridX-expander').css("display", "none");
- if (display == "none") {
- _showExpander(expander, dropdown, $(this));
- }
- else expander.css("display", "none");
- });
- $(jq).find(".combo-clear").click(function () {
- var dropdown = $(this).parents('.easyui-combogridX:first');
- var comboText = dropdown.find(".combo-text");
- CMSFunction.ComboGrid.SetValue(dropdown, "", "-1");
- if (opts.isAutoComplete) {
- _autoComplete(comboText, true, oldValue, { keyCode: 8 });
- }
- $('.combogridX-expander').css("display", "none");
- if (opts.onSelect) opts.onSelect.call(this, null);
- });
- }
- if (opts.value != '' && opts.value != -1 && opts.text != '') {
- CMSFunction.ComboGrid.SetValue($(jq), opts.text, opts.value);
- }
- if (opts.isAutoComplete) {
- $(jq).find(".combo-text")
- // .keyup(function (ev) {
- // _autoComplete($(this), bubbleKeyup, oldValue, ev);
- // })
- .keydown(function (ev) {
- // oldValue = $(this).val();
- // if (ev.keyCode == 229) {
- // bubbleKeyup = false;
- // } else {
- // bubbleKeyup = true;
- // }
- var selfControl = $(this);
- clearTimeout(selfControl.timeoutFunc);
- $(this).timeoutFunc = setTimeout(function() {
- _autoComplete(selfControl, bubbleKeyup, null, ev);
- }, 300);
- });
- }
- return { combogridX: jq };
- }
- function _autoComplete(comboText, bubbleKeyup, oldValue, ev) {
- // if (!bubbleKeyup && ev.keyCode != 32 && ev.keyCode != 13
- // && (oldValue.indexOf(comboText.val()) >= 0
- // || (ev.keyCode == 229 && comboText.val().indexOf(oldValue) >= 0)
- // )) {
- // bubbleKeyup = false;
- // return;
- // }
- var dropdown = comboText.parents('.easyui-combogridX:first');
- var grid = dropdown.find('.easyui-cmsXDataTable');
- var opts = $.data(dropdown[0], "combogridX").options;
- var formData = opts.formData;
- if (comboText.val().length >= opts.minReloadCharactor) {
- var expander = dropdown.find(".combogridX-expander");
- var arrow = dropdown.find(".combo-arrow");
- var display = expander.css("display");
- if (display == "none") {
- _showExpander(expander, dropdown, arrow);
- }
- var queryParamString = "";
- if (formData) {
- queryParamString = formData.QueryParamsDatas;
- }
- var queryText = comboText.val();
- if (queryText == opts.emptyText) {
- queryText = "";
- }
- var jsonString = "({'QueryParamsDatas':'Attribute|*|{\"ID\":\"00000000-0000-0000-0000-000000000000\",\"Value\":\"" + opts.textField
- + "\",\"ControlType\":\"TextBox\"}|@|Condition|*|中|@|ConditionValue|*|" + comboText.val()
- + "|@|" + opts.textField + "_QueryTextBox|*|" + queryText + "|@|" + queryParamString + "'})";
- try {
- grid.cmsXDataTable("loadAll", eval(jsonString));
- }
- catch (err) { }
- }
- }
- function _showExpander(expander, dropdown, arrow) {
- expander.css("display", "block");
- _setExpanderPosition(expander, dropdown, arrow);
- }
- function _setExpanderPosition(expander, dropdown, arrow) {
- var panelLeft = expander.position().left;
- var panelWidth = expander.width();
- var panelHeight = expander.height();
- var dropdownLeft = dropdown.position().left;
- var dropdownTop = dropdown.offset().top;
- var dropdownHeight = dropdown.height();
- var panelTop = (dropdownTop + dropdownHeight);
- var arrowLeft = arrow.position().left;
- var documentWidth = $(window).width();
- var documentHeight = $(window).height() - 5;
- var newTop = 0;
- var newLeft = 0;
- if (panelTop + panelHeight >= documentHeight) {
- if (panelHeight < dropdownTop) {
- newTop = dropdownTop - panelHeight;
- } else if (dropdownTop >= (documentHeight - panelTop)) { //当下拉控件位置偏下……
- newTop = 0;
- expander.height(documentHeight - panelTop);
- } else { //当下拉控件位置偏上……
- newTop = panelTop;
- expander.height(documentHeight - panelTop);
- }
- } else {
- newTop = panelTop;
- }
- if (dropdownLeft + panelWidth > documentWidth - 16) {
- newLeft = arrowLeft + arrow.width() - panelWidth;
- if (newLeft < 2) newLeft = 2;
- }
- else {
- newLeft = dropdownLeft;
- }
- //设置高度如果用offset的话,第一次点击时,如果窗口被滚动过,会忽略滚动条来设置高度,第二次又不会了,不知道为什么……
- expander.position({
- top: newTop
- });
- expander.offset({
- left: newLeft
- });
- }
- function _setValue(jq, val, callback) {
- if (!val) {
- CMSFunction.ComboGrid.SetValue($(jq), "", "");
- return;
- } else if (val == "" || val == "-1") {
- CMSFunction.ComboGrid.SetValue($(jq), "", val);
- return;
- }
- var opts = $.data(jq, "combogridX").options;
- var grid = $(jq).find('.easyui-cmsXDataTable:first');
- var jsonString = "({'QueryParamsDatas':'Attribute|*|{\"ID\":\"00000000-0000-0000-0000-000000000000\",\"Value\":\"" + opts.valueField
- + "\",\"ControlType\":\"TextBox\"}|@|Condition|*|=|@|ConditionValue|*|" + opts.value
- + "|@|" + opts.valueField + "_QueryTextBox|*|" + val + "|@|',page: 0,rows: 10 })";
- try {
- var gridOptions = grid.cmsXDataTable("options");
- var url = gridOptions.url;
- $.post(url, eval(jsonString), function (data) {
- if (data.rows.length > 0) {
- CMSFunction.ComboGrid.SetValue($(jq), data.rows[0][opts.textField], val);
- if (callback) {
- callback.call($(jq));
- }
- }
- });
- }
- catch (err) { }
- // var gridOpts = $.data(grid[0], "cmsXDataTable").options;
- // var gridData = gridOpts.data;
- // CMSFunction.ComboGrid.SetValue($(jq), "", "-1");
- // if (gridData) {
- // $.each(gridData.rows, function (i, v) {
- // if (v[opts.valueField] == val) {
- // CMSFunction.ComboGrid.SetValue($(jq), v[opts.textField], v[opts.valueField]);
- // return false;
- // }
- // });
- // }
- }
- function _getValue(jq) {
- return $(jq).find('.combogridX-value').val();
- }
- function _getSelectedRow(jq) {
- var value = _getValue(jq);
- var opts = $.data(jq, "combogridX").options;
- var grid = $(jq).find('.easyui-cmsXDataTable:first');
- var gridOpts = $.data(grid[0], "cmsXDataTable").options;
- var gridData = gridOpts.data;
- var selectedRow = null;
- if (gridData) {
- $.each(gridData.rows, function (i, v) {
- if (v[opts.valueField] == value) {
- selectedRow = v;
- return false;
- }
- });
- }
- return selectedRow;
- }
- function _getText(jq) {
- return $(jq).find('.combo-text').val();
- }
- function _loadData(jq, data) {
- jq.each(function () {
- var grid = $(jq).parent().find('.easyui-cmsXDataTable:first');
- if (!$.data(grid[0], "cmsXDataTable")) return;
- grid.cmsXDataTable("loadData", data);
- });
- }
- function _reload(jq, formData) {
- jq.each(function () {
- var grid = $(jq).parent().find('.easyui-cmsXDataTable:first');
- if (!$.data(grid[0], "cmsXDataTable")) return;
- var opts = $.data(grid[0], "cmsXDataTable").options;
- opts.pageNumber = 1;
- if (typeof formData == "string") {
- opts.url = formData;
- grid.cmsXDataTable("loadAll", '');
- }
- else {
- $.data(this, "combogridX").options.formData = formData;
- grid.cmsXDataTable("loadAll", formData);
- }
- });
- }
- function _select(jq, index) {
- var grid = $(jq).parent().find('.easyui-cmsXDataTable:first');
- var opts = $.data(jq, "combogridX").options;
- if (!$.data(grid[0], "cmsXDataTable")) return;
- var data = grid.cmsXDataTable("getRows");
- if (data[index]) {
- var selectedText = eval("data[index]." + opts.textField);
- var selectedValue = eval("data[index]." + opts.valueField);
- CMSFunction.ComboGrid.SetValue($(jq), selectedText, selectedValue);
- }
- }
- $.fn.combogridX = function (_7be, _7bf, _7bg) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.combogridX.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf, _7bg);
- } else {
- return this.combogridX(_7be, _7bf, _7bg);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "combogridX");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "combogridX", { options: $.extend({}, $.fn.combogridX.defaults, $.fn.combogridX.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "combogridX", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.combogridX.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "combogridX").options;
- return opts;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- getSelectedRow: function (jq) {
- return _getSelectedRow(jq[0]);
- },
- setValue: function (jq, val, callback) {
- _setValue(jq[0], val, callback);
- },
- select: function (jq, index) {
- _select(jq[0], index);
- },
- getText: function (jq) {
- return _getText(jq[0]);
- },
- reload: function (jq, formData) {
- _reload(jq, formData);
- },
- loadData: function (jq, data) {
- _loadData(jq, data);
- },
- setExpanderPosition: function (jq, opts) {
- _setExpanderPosition(opts.expander, opts.dropdown, opts.arrow);
- }
- };
- $.fn.combogridX.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.combogridX.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.combogridX.defaults = {
- textField: "",
- valueField: "",
- isAutoComplete: true,
- minReloadCharactor: 0,
- onSelect: function (value) { },
- onChange: function () { },
- panelHeight: 300,
- formData: null,
- value: "",
- enabled: true,
- };
- })(jQuery);
- //2014-08-18 begin added by heyw 新增droppableContainer控件
- $(function () {
- $.parser.parseEasyUI(["autoComplete"]);
- $.parser.parseEasyUI(["combogridX"]);
- $.parser.parseEasyUI(["draggableList"]);
- $.parser.parseEasyUI(["droppableContainer"]);
- $.parser.parseEasyUI(["checkList"]);
- $.parser.parseEasyUI(["richtext"]);
- //$(".popupWindowContent").width(window.);
- });
- $.extend({
- packFormParams: function (obj) {
- var result = [];
- for (var p in obj) {
- result.push(p.toString() + "|*|" + obj[p] + "|@|");
- }
- return result.join('');
- },
- unpackFormParams: function (str) {
- var json = [];
- var props = str.split('|@|');
- json.push("({");
- for (var i = 0; i < props.length; i++) {
- if (props[i] == "") continue;
- var kv = props[i].split('|*|');
- if (i != 0) { json.push(","); }
- json.push('"' + kv[0] + '":"' + kv[1] + '"');
- }
- json.push("})");
- return eval(json.join(""));
- },
- popupTopWindow: function (title, url, width, height, func, data) {
- var containerTop = top.$('#sysWindow').parent();
- var windowID = "sysWindow" + Math.floor(Math.random() * 100000 + 1);
- $("<div id=\"" + windowID + "\" />").appendTo(containerTop);
- var loU = url.split("?");
- var newUrl = url;
- if (loU.length > 1) {
- newUrl += "&WindowID=" + windowID;
- } else {
- newUrl += "?WindowID=" + windowID;
- }
- if (data) {
- top.$('#' + windowID).data("inputData", data);
- }
- var windowHeight = $(top.document).height();
- if (windowHeight < height) {
- height = windowHeight;
- }
- top.$('#' + windowID).dialog({
- title: title,
- width: width,
- height: height,
- content: '<iframe id="iframe1" frameborder="0" scrolling="no" ></iframe>',
- modal: true,
- onClose: function () {
- if (func)
- func.call(this, top.$('#' + windowID).data("resultData"));
- },
- onOpen: function () {
- $(this).find("iframe").attr("src", newUrl);
- }
- });
- return top.$('#' + windowID);
- },
- popupTopWindowOutsite: function (title, url, width, height, func, data) {
- var containerTop = top.$('#sysWindow').parent();
- var windowID = "sysWindow" + Math.floor(Math.random() * 100000 + 1);
- $("<div id=\"" + windowID + "\" />").appendTo(containerTop);
- if (data) {
- top.$('#' + windowID).data("inputData", data);
- }
- var windowHeight = $(top.document).height();
- if (windowHeight < height) {
- height = windowHeight;
- }
- top.$('#' + windowID).dialog({
- title: title,
- width: width,
- height: height,
- content: '<iframe id="iframe1" frameborder="0" scrolling="yes" ></iframe>',
- modal: true,
- onClose: function () {
- if (func)
- func.call(this, top.$('#' + windowID).data("resultData"));
- },
- onOpen: function () {
- $(this).find("iframe").attr("src", url);
- }
- });
- return top.$('#' + windowID);
- },
- closeCurPopupTopWindow: function () {
- var windowID = $.SystemGeneral.getUrlParam("WindowID");
-
- top.$("#" + windowID).dialog("close");
- },
- getPopupTopWindowInputData: function () {
- var windowID = $.SystemGeneral.getUrlParam("WindowID");
-
- return top.$('#' + windowID).data("inputData");
- }
- });
- //2016-02-25 begin added by heyw 新增checkList控件
- (function ($) {
- $.parser.plugins.push("checkList");
- function _init(jq) {
- var opts = $.data(jq, "checkList").options;
- if (opts.url && opts.url != "") {
- $.ajax({
- type: "post", url: opts.url, success: function (data) {
- opts.data = data;
- opts.values = $.map($.grep(data, function (x) { return x.IsSelected; }), function (x) { return x[opts.valueField]; });
- _getInitValuesAndLoad(jq, opts);
- }
- });
- }
- else {
- _getInitValuesAndLoad(jq, opts);
- }
- return { checkList: jq };
- }
- var _getInitValuesAndLoad = function (jq, opts) {
- if (opts.valueUrl && opts.valueUrl != "") {
- $.ajax({
- type: "post", url: opts.valueUrl, success: function (valueData) {
- opts.values = valueData;
- _bind(jq);
- }
- });
- }
- else {
- _bind(jq);
- }
- };
- var _bind = function (jq) {
- var opts = $.data(jq, "checkList").options;
- var listID = jq.id;
- var html = new Array();
- var textField = opts.textField;
- var valueField = opts.valueField;
- if (!(textField && textField != "")) {
- textField = "Text";
- }
- if (!(valueField && valueField != "")) {
- valueField = "Value";
- }
- var styleHtml = new Array();
- if (!opts.isShow) styleHtml.push('display: none;');
- var pages = Math.ceil(opts.data.length / opts.columnCount);
- html.push('<table border="0" width="100%"');
- if (styleHtml.length > 0) html.push(' style="' + styleHtml.join('') + '"');
- html.push('>');
- for (var i = 0; i < pages; i++) {
- html.push('<tr>');
- for (var j = 0; j < opts.columnCount; j++) {
- var curIndex = (i * opts.columnCount + j);
- if (opts.data.length > curIndex) {
- var checked = $.inArray(opts.data[curIndex][valueField], opts.values) >= 0;
- var checkedString = "";
- if (checked) checkedString = " checked";
- var enabledString = "";
- if (!opts.isEnabled) enabledString = " disabled";
- html.push('<td>');
- html.push(''.concat('<input name="', opts.checkName, '"', checkedString, ' type="checkbox" value="',
- opts.data[curIndex][valueField], '"', enabledString, '/>', opts.data[curIndex][textField]));
- html.push('</td>');
- }
- else {
- html.push('<td> </td>');
- }
- }
- html.push('</tr>');
- }
- html.push('</table>');
- var div = $(''.concat("<div>", html.join(''), "</div>")).appendTo(jq);
- if (opts.onclick) {
- $(jq).find('input[name="' + opts.checkName + '"]').click(opts.onclick);
- }
- if (opts.onLoadSuccess) {
- opts.onLoadSuccess.call(jq, opts.data);
- }
- };
- $.fn.checkList = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.checkList.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.checkList(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "checkList");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "checkList", { options: $.extend({}, $.fn.checkList.defaults, $.fn.checkList.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "checkList", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.checkList.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "checkList").options;
- return opts;
- }
- };
- $.fn.checkList.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.checkList.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.checkList.defaults = {
- url: "",
- valueUrl: "",
- textField: "",
- valueField: "",
- columnCount: 1,
- data: [],
- values: [],
- onLoadSuccess: function (data) { },
- isEnabled: true,
- isShow: true
- };
- })(jQuery);
- //2016-02-25 begin added by heyw 新增richtext控件
- //2021-05-10 modify by heyw 实际控件从ueditor改为kindeditor
- (function ($) {
- $.parser.plugins.push("richtext");
- var ueList = new Object();
- function _init(jq) {
- var id = $(jq).attr("id");
- var name = $(jq).attr("name");
- // var ue = new baidu.editor.ui.Editor();
- // ue.render(id);
- var ke;
- KindEditor.ready(function(K) {
- ke = K.create('#'+id, {
- uploadJson: K.options.basePath + 'asp.net/upload_json.ashx',
- fileManagerJson: K.options.basePath + 'asp.net/file_manager_json.ashx'
- });
- if (!ueList["richtext_" + id]) {
- //ueList["richtext_" + id] = { name: name, editor: ue };
- ueList["richtext_" + id] = { name: name, editor: ke };
- }
- });
- $(jq).closest('form').submit(function () {
- $(".easyui-richtext").richtext("sync");
- });
- return { richtext: jq };
- }
- function _getValue(jq) {
- var id = $(jq).attr("id");
- //var ue = ueList["richtext_" + id].editor;
- //return ue.getContent();
- var ke = ueList["richtext_" + id].editor;
- ke.sync();
- return editor.html();
- }
- function _setValue(jq, value) {
- var id = $(jq).attr("id");
- // var ue = ueList["richtext_" + id].editor;
- // return ue.setContent(value);
- var ke = ueList["richtext_" + id].editor;
- return editor.html(value);
- }
- function _sync(jq) {
- var id = $(jq).attr("id");
- var opts = ueList["richtext_" + id]
- // var ue = opts.editor;
- //
- // ue.sync();
- // var content = ue.getContent();
- // content = UE.utils.unhtml(content);
- // content = content.replace(/'/g,'');
- var ke = opts.editor;
-
- var content = ke.html();
- content = KindEditor.escape(content);
- $('[name="' + opts.name + '"]').val(content);
- }
- $.fn.richtext = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.richtext.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.richtext(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "richtext");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "richtext", { options: $.extend({}, $.fn.richtext.defaults, $.fn.richtext.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "richtext", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.richtext.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "richtext").options;
- return opts;
- },
- getValue: function (jq) {
- return _getValue(jq[0]);
- },
- setValue: function (jq, val) {
- $.each(jq, function (i, v) {
- _setValue(jq[i], val);
- });
- },
- sync: function (jq) {
- $.each(jq, function (i, v) {
- _sync(jq[i]);
- });
- }
- };
- $.fn.richtext.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.richtext.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.richtext.defaults = {
- isEnabled: true,
- isShow: true
- };
- })(jQuery);
- //2016-02-25 begin added by heyw 新增checkList控件
- (function ($) {
- $.parser.plugins.push("qqList");
- function _init(jq) {
- var opts = $.data(jq, "qqList").options;
- if (opts.url && opts.url != "") {
- $.ajax({
- type: "post", url: opts.url, success: function (data) {
- opts.data = data;
- _bind(jq);
- }
- });
- }
- else {
- _bind(jq);
- }
- return { qqList: jq };
- }
- var _bind = function (jq) {
- var opts = $.data(jq, "qqList").options;
- var listID = jq.id;
- var html = new Array();
- var textField = opts.textField;
- var valueField = opts.valueField;
- if (!(textField && textField != "")) {
- textField = "Text";
- }
- if (!(valueField && valueField != "")) {
- valueField = "Value";
- }
- var styleHtml = new Array();
- var pages = Math.ceil(opts.data.length / opts.columnCount);
- html.push('<table border="0" width="100%"');
- if (styleHtml.length > 0) html.push(' style="' + styleHtml.join('') + '"');
- html.push('>');
- for (var i = 0; i < pages; i++) {
- html.push('<tr>');
- for (var j = 0; j < opts.columnCount; j++) {
- var curIndex = (i * opts.columnCount + j);
- if (opts.data.length > curIndex) {
- var enabledString = "";
- var qqNo = opts.data[curIndex][valueField];
- if (!opts.isEnabled) enabledString = " disabled";
- html.push('<td>');
- html.push('<a name="', opts.itemName, '" href="tencent://Message/?Uin=' + qqNo + '&websiteName=q-zone.qq.com&Menu=yes"' + enabledString + '>')
- html.push('<div><span style="text-align: center;"><img src="http://q2.qlogo.cn/headimg_dl?dst_uin=' + qqNo + '&spec=100" ');
- html.push('style="border: 0px; width: ' + opts.itemWidth + '; height: ' + opts.itemHeight + '"/></span>');
- html.push(''.concat('<span style="text-align: center;">', opts.data[curIndex][textField], '</span>'));
- html.push('</div></a></td>');
- }
- else {
- html.push('<td> </td>');
- }
- }
- html.push('</tr>');
- }
- html.push('</table>');
- var div = $(''.concat("<div>", html.join(''), "</div>")).appendTo(jq);
- if (opts.onclick) {
- $(jq).find('a[name="' + opts.itemName + '"]').click(opts.onclick);
- }
- if (opts.onLoadSuccess) {
- opts.onLoadSuccess.call(jq, opts.data);
- }
- };
- $.fn.qqList = function (_7be, _7bf) {
- if (typeof _7be == "string") {
- var _7c0 = $.fn.qqList.methods[_7be];
- if (_7c0) {
- return _7c0(this, _7bf);
- } else {
- return this.qqList(_7be, _7bf);
- }
- }
- _7be = _7be || {};
- return this.each(function () {
- var _this = this;
- var cacheData = $.data(_this, "qqList");
- if (cacheData) {
- $.extend(cacheData.options, _7be);
- } else {
- cacheData = $.data(_this, "qqList", { options: $.extend({}, $.fn.qqList.defaults, $.fn.qqList.parseOptions(this), _7be) });
- var initCacheData = _init(_this);
- cacheData = $.data(_this, "qqList", $.extend({}, cacheData, initCacheData));
- }
- });
- };
- $.fn.qqList.methods = {
- options: function (jq) {
- var opts = $.data(jq[0], "qqList").options;
- return opts;
- }
- };
- $.fn.qqList.parseOptions = function (_7c7) {
- var t = $(_7c7);
- return $.extend({}, $.fn.qqList.defaults, $.parser.parseOptions(_7c7, []));
- };
- $.fn.qqList.defaults = {
- url: "",
- textField: "",
- columnCount: 1,
- data: [],
- onLoadSuccess: function (data) { },
- isEnabled: true,
- isShow: true
- };
- })(jQuery);
|