Commit 8f654787 authored by huangjie's avatar huangjie

企业管理

parent 5fc7b594
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><path d="M2,15L9,15L9,2.64496C9,1.895135,8.20534,1.4120460000000001,7.53968,1.757201L2.539683,4.3497900000000005C2.208124,4.521710000000001,2,4.86407,2,5.23755L2,15ZM8,14L3,14L3,5.23755L8,2.64496L8,14Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M6.72361,8.947214Q6.7859,8.916069,6.8373,8.869088Q6.88871,8.822107,6.925330000000001,8.762866Q6.96194,8.703625,6.98097,8.636633Q7,8.569642,7,8.5Q7,8.4507543,6.99039,8.4024549Q6.98078,8.354155,6.96194,8.308658Q6.94309,8.263161,6.91573,8.222215Q6.88838,8.181269,6.85355,8.146447Q6.81873,8.111625,6.7777899999999995,8.084265Q6.73684,8.056906,6.69134,8.03806Q6.64584,8.019214999999999,6.59754,8.009607Q6.54925,8,6.5,8Q6.38197,8,6.27639,8.052786L4.276456,9.052755L4.276393,9.052786Q4.214104,9.083931,4.162696,9.130912Q4.111288,9.177893,4.074675,9.237134Q4.038062,9.296375,4.019031,9.363367Q4,9.430358,4,9.5Q4,9.54925,4.009607,9.59755Q4.019215,9.64584,4.03806,9.69134Q4.056906,9.73684,4.084265,9.77779Q4.111625,9.81873,4.146447,9.85355Q4.181269,9.88838,4.222215,9.91573Q4.263161,9.94309,4.308658,9.96194Q4.354155,9.98079,4.4024549,9.99039Q4.4507543,10,4.5,10Q4.618034,10,4.723607,9.94721L6.72361,8.947214Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M6.72361,6.447214Q6.7859,6.416069,6.8373,6.369088Q6.88871,6.322107,6.925330000000001,6.262866Q6.96194,6.203625,6.98097,6.136633Q7,6.069642,7,6Q7,5.9507543,6.99039,5.9024549Q6.98078,5.854155,6.96194,5.808658Q6.94309,5.763161,6.91573,5.722215Q6.88838,5.681269,6.85355,5.646447Q6.81873,5.611625,6.7777899999999995,5.584265Q6.73684,5.556906,6.69134,5.53806Q6.64584,5.519215,6.59754,5.509607Q6.54925,5.5,6.5,5.5Q6.38197,5.5,6.27639,5.552786L4.276456,6.552755L4.276393,6.552786Q4.214104,6.583931,4.162696,6.630912Q4.111288,6.677893,4.074675,6.737134Q4.038062,6.796375,4.019031,6.863367Q4,6.930358,4,7Q4,7.04925,4.009607,7.09755Q4.019215,7.14584,4.03806,7.19134Q4.056906,7.23684,4.084265,7.2777899999999995Q4.111625,7.31873,4.146447,7.35355Q4.181269,7.38838,4.222215,7.41573Q4.263161,7.44309,4.308658,7.46194Q4.354155,7.48079,4.4024549,7.49039Q4.4507543,7.5,4.5,7.5Q4.618034,7.5,4.723607,7.44721L6.72361,6.447214Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g transform="matrix(-1,0,0,1,24,0)"><path d="M14.22361,7.447214Q14.2859,7.416069,14.337299999999999,7.369088Q14.38871,7.322107,14.42533,7.262866Q14.46194,7.203625,14.48097,7.136633Q14.5,7.069642,14.5,7Q14.5,6.9507543,14.49039,6.9024549Q14.48078,6.854155,14.46194,6.808658Q14.44309,6.763161,14.41573,6.722215Q14.38838,6.681269,14.35355,6.646447Q14.31873,6.611625,14.27779,6.584265Q14.23684,6.556906,14.19134,6.53806Q14.14584,6.519215,14.09754,6.509607Q14.04925,6.5,14,6.5Q13.881969999999999,6.5,13.77639,6.552786L11.776456,7.552755L11.776393,7.552786Q11.714104,7.583931,11.662696,7.630912Q11.611288,7.677893,11.574675,7.737134Q11.538062,7.796375,11.519031,7.863367Q11.5,7.930358,11.5,8Q11.5,8.04925,11.509607,8.09755Q11.519214999999999,8.14584,11.53806,8.19134Q11.556906,8.23684,11.584265,8.27779Q11.611625,8.31873,11.646447,8.35355Q11.681269,8.38838,11.722215,8.41573Q11.763161,8.44309,11.808658,8.46194Q11.854155,8.48079,11.9024549,8.49039Q11.9507543,8.5,12,8.5Q12.118034,8.5,12.223607,8.44721L14.22361,7.447214Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M1.5,14L10,14Q10.04924,14,10.09754,14.009607Q10.14584,14.019214999999999,10.19134,14.03806Q10.23684,14.056906,10.27778,14.084265Q10.31873,14.111625,10.35355,14.146447Q10.38837,14.181269,10.41573,14.222215Q10.44309,14.263161,10.46194,14.308658Q10.48078,14.354155,10.49039,14.4024549Q10.5,14.4507543,10.5,14.5Q10.5,14.5492457,10.49039,14.5975451Q10.48078,14.645845,10.46194,14.691342Q10.44309,14.736839,10.41573,14.777785Q10.38837,14.818731,10.35355,14.853553Q10.31873,14.888375,10.27778,14.915735Q10.23684,14.943094,10.19134,14.96194Q10.14584,14.980785000000001,10.09754,14.990393Q10.04924,15,10,15L1.5,15Q1.4507543,15,1.4024549,14.990393Q1.354155,14.980785000000001,1.3086579999999999,14.96194Q1.263161,14.943094,1.222215,14.915735Q1.181269,14.888375,1.146447,14.853553Q1.111625,14.818731,1.084265,14.777785Q1.0569060000000001,14.736839,1.03806,14.691342Q1.019215,14.645845,1.009607,14.5975451Q1,14.5492457,1,14.5Q1,14.4507543,1.009607,14.4024549Q1.019215,14.354155,1.03806,14.308658Q1.0569060000000001,14.263161,1.084265,14.222215Q1.111625,14.181269,1.146447,14.146447Q1.181269,14.111625,1.222215,14.084265Q1.263161,14.056906,1.3086579999999999,14.03806Q1.354155,14.019214999999999,1.4024549,14.009607Q1.4507543,14,1.5,14Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M10.248069,3.065878L13.244209999999999,4.77796Q14,5.20984,14,6.08032L14,9Q14,9.049240000000001,13.99039,9.09754Q13.98078,9.14584,13.96194,9.19134Q13.94309,9.23684,13.91573,9.27778Q13.88838,9.31873,13.85355,9.35355Q13.81873,9.38837,13.77778,9.41573Q13.73684,9.44309,13.69134,9.46194Q13.64584,9.48078,13.59754,9.49039Q13.54925,9.5,13.5,9.5Q13.45075,9.5,13.40245,9.49039Q13.35415,9.48078,13.30866,9.46194Q13.26316,9.44309,13.22221,9.41573Q13.18127,9.38837,13.14645,9.35355Q13.11162,9.31873,13.08426,9.27778Q13.05691,9.23684,13.03806,9.19134Q13.019210000000001,9.14584,13.00961,9.09754Q13,9.049240000000001,13,9L13,6.08032Q13,5.79016,12.74807,5.6462L9.751931,3.934122Q9.694532,3.901322,9.647629,3.854732Q9.600727,3.808142,9.567545,3.750963Q9.534363,3.693785,9.517181,3.629947Q9.5,3.5661094,9.5,3.5Q9.5,3.4507543,9.509607,3.4024549Q9.519214999999999,3.354155,9.53806,3.308658Q9.556906,3.263161,9.584265,3.222215Q9.611625,3.181269,9.646447,3.146447Q9.681269,3.111625,9.722215,3.084265Q9.763161,3.056906,9.808658,3.0380599999999998Q9.854155,3.019215,9.9024549,3.009607Q9.9507543,3,10,3Q10.132782,3,10.248069,3.065878Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g transform="matrix(0,-1,1,0,-4.7998046875,25.7998046875)"><path d="M15.63157,16.9634846875Q15.63157,16.8976546875,15.61453,16.8340746875Q15.5975,16.7704846875,15.56458,16.7134846875Q15.53167,16.6564746875,15.48512,16.6099246875Q15.43858,16.5633846875,15.38157,16.5304646875L13.5,15.4441426875Q13.44299,15.4112286875,13.37941,15.3941920875Q13.31583,15.3771549875,13.25,15.3771549875Q13.18417,15.3771549875,13.12059,15.3941920875Q13.05701,15.4112286875,13,15.4441426875L11.11843,16.5304646875Q11.061423,16.5633846875,11.014877,16.6099246875Q10.968331,16.6564746875,10.935417,16.7134846875Q10.902504,16.7704846875,10.885467,16.8340746875Q10.86843,16.8976546875,10.86843,16.9634846875L10.86843,19.1361246875Q10.86843,19.2019546875,10.885467,19.2655346875Q10.902504,19.3291246875,10.935417,19.3861246875Q10.968331,19.4431346875,11.014877,19.4896846875Q11.061423,19.5362246875,11.11843,19.5691446875L13,20.6554646875Q13.05701,20.6883846875,13.12059,20.7054146875Q13.18417,20.7224546875,13.25,20.7224546875Q13.31583,20.7224546875,13.37941,20.7054146875Q13.44299,20.6883846875,13.5,20.6554646875L15.38157,19.5691446875Q15.43858,19.5362246875,15.48512,19.4896846875Q15.53167,19.4431346875,15.56458,19.3861246875Q15.5975,19.3291246875,15.61453,19.2655346875Q15.63157,19.2019546875,15.63157,19.1361246875L15.63157,16.9634846875ZM14.63157,17.2521546875L13.25,16.4545046875L11.86843,17.2521546875L11.86843,18.8474546875L13.25,19.6451046875L14.63157,18.8474546875L14.63157,17.2521546875Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><path d="M2,15.000014530563355L9,15.000014530563355L9,2.645014530563355C9,1.8951955305633545,8.20534,1.4121065305633544,7.53968,1.7572615305633545L2.539683,4.349854530563355C2.208124,4.521774530563354,2,4.8641245305633545,2,5.237604530563354L2,15.000014530563355ZM6.72361,6.447274530563354Q6.7859,6.416124530563354,6.8373,6.3691445305633545Q6.88871,6.322164530563355,6.92532,6.262924530563354Q6.96194,6.203684530563354,6.98097,6.1366945305633545Q7,6.069704530563355,7,6.000064530563354Q7,5.950814530563354,6.99039,5.902514530563354Q6.98078,5.854214530563355,6.96194,5.808714530563354Q6.94309,5.763224530563354,6.91573,5.722274530563355Q6.88837,5.681324530563354,6.85355,5.646504530563354Q6.81873,5.6116845305633545,6.77778,5.584324530563355Q6.73684,5.556964530563354,6.69134,5.538124530563355Q6.64584,5.519274530563354,6.59755,5.509664530563354Q6.54925,5.500064530563355,6.5,5.500064530563355Q6.38197,5.500064530563355,6.27639,5.5528445305633545L4.27646,6.552814530563355L4.27639,6.5528445305633545Q4.2141,6.583994530563355,4.1627,6.630974530563354Q4.11129,6.677954530563355,4.074669999999999,6.737194530563355Q4.03806,6.796434530563355,4.01903,6.863424530563354Q4,6.930414530563355,4,7.000064530563354Q4,7.049304530563354,4.00961,7.097604530563355Q4.01921,7.145904530563355,4.03806,7.1914045305633545Q4.05691,7.2368945305633545,4.0842600000000004,7.277844530563354Q4.11162,7.318794530563355,4.14645,7.3536145305633545Q4.18127,7.388434530563354,4.2222100000000005,7.415794530563354Q4.26316,7.443154530563355,4.30866,7.461994530563355Q4.35416,7.480844530563354,4.40245,7.490454530563355Q4.45075,7.500064530563354,4.5,7.500064530563354Q4.61803,7.500064530563354,4.72361,7.447274530563354L6.72361,6.447274530563354ZM7,8.500064530563353Q7,8.569704530563355,6.98097,8.636694530563354Q6.96194,8.703684530563354,6.92532,8.762924530563353Q6.88871,8.822164530563356,6.8373,8.869144530563354Q6.7859,8.916124530563355,6.72361,8.947274530563355L4.72361,9.947274530563355Q4.61803,10.000064530563355,4.5,10.000064530563355Q4.45075,10.000054530563354,4.40245,9.990454530563355Q4.35416,9.980844530563354,4.30866,9.961994530563354Q4.26316,9.943154530563355,4.2222100000000005,9.915794530563355Q4.18127,9.888434530563355,4.14645,9.853614530563355Q4.11162,9.818794530563354,4.0842600000000004,9.777844530563355Q4.05691,9.736894530563355,4.03806,9.691404530563355Q4.01921,9.645904530563355,4.00961,9.597604530563355Q4,9.549304530563354,4,9.500064530563353Q4,9.430414530563354,4.01903,9.363424530563353Q4.03806,9.296434530563355,4.074669999999999,9.237194530563354Q4.11129,9.177954530563355,4.1627,9.130974530563353Q4.2141,9.083994530563356,4.27639,9.052844530563355L4.27646,9.052814530563355L6.27639,8.052844530563355Q6.38197,8.000064530563353,6.5,8.000064530563353Q6.54925,8.000064530563353,6.59755,8.009664530563356Q6.64584,8.019274530563354,6.69134,8.038124530563355Q6.73684,8.056964530563356,6.77778,8.084324530563354Q6.81873,8.111684530563355,6.85355,8.146504530563355Q6.88837,8.181324530563355,6.91573,8.222274530563354Q6.94309,8.263224530563354,6.96194,8.308714530563353Q6.98078,8.354214530563354,6.99039,8.402514530563355Q7,8.450814530563354,7,8.500064530563353Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M1.5,14L10,14Q10.04924,14,10.09754,14.009607Q10.14584,14.019214999999999,10.19134,14.03806Q10.23684,14.056906,10.27778,14.084265Q10.31873,14.111625,10.35355,14.146447Q10.38837,14.181269,10.41573,14.222215Q10.44309,14.263161,10.46194,14.308658Q10.48078,14.354155,10.49039,14.4024549Q10.5,14.4507543,10.5,14.5Q10.5,14.5492457,10.49039,14.5975451Q10.48078,14.645845,10.46194,14.691342Q10.44309,14.736839,10.41573,14.777785Q10.38837,14.818731,10.35355,14.853553Q10.31873,14.888375,10.27778,14.915735Q10.23684,14.943094,10.19134,14.96194Q10.14584,14.980785000000001,10.09754,14.990393Q10.04924,15,10,15L1.5,15Q1.4507543,15,1.4024549,14.990393Q1.354155,14.980785000000001,1.3086579999999999,14.96194Q1.263161,14.943094,1.222215,14.915735Q1.181269,14.888375,1.146447,14.853553Q1.111625,14.818731,1.084265,14.777785Q1.0569060000000001,14.736839,1.03806,14.691342Q1.019215,14.645845,1.009607,14.5975451Q1,14.5492457,1,14.5Q1,14.4507543,1.009607,14.4024549Q1.019215,14.354155,1.03806,14.308658Q1.0569060000000001,14.263161,1.084265,14.222215Q1.111625,14.181269,1.146447,14.146447Q1.181269,14.111625,1.222215,14.084265Q1.263161,14.056906,1.3086579999999999,14.03806Q1.354155,14.019214999999999,1.4024549,14.009607Q1.4507543,14,1.5,14Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g transform="matrix(0,-1,1,0,-4.7998046875,25.7998046875)"><path d="M15.38157,16.5304646875Q15.43858,16.5633846875,15.48512,16.6099246875Q15.53167,16.6564746875,15.56458,16.7134846875Q15.5975,16.7704846875,15.61453,16.8340746875Q15.63157,16.8976546875,15.63157,16.9634846875L15.63157,19.1361246875Q15.63157,19.2019546875,15.61453,19.2655346875Q15.5975,19.3291246875,15.56458,19.3861246875Q15.53167,19.4431346875,15.48512,19.4896846875Q15.43858,19.5362246875,15.38157,19.5691446875L13.5,20.6554646875Q13.44299,20.6883846875,13.37941,20.7054146875Q13.31583,20.7224546875,13.25,20.7224546875Q13.18417,20.7224546875,13.12059,20.7054146875Q13.05701,20.6883846875,13,20.6554646875L11.11843,19.5691446875Q11.061423,19.5362246875,11.014877,19.4896846875Q10.968331,19.4431346875,10.935417,19.3861246875Q10.902504,19.3291246875,10.885467,19.2655346875Q10.86843,19.2019546875,10.86843,19.1361246875L10.86843,16.9634846875Q10.86843,16.8976546875,10.885467,16.8340746875Q10.902504,16.7704846875,10.935417,16.7134846875Q10.968331,16.6564746875,11.014877,16.6099246875Q11.061423,16.5633846875,11.11843,16.5304646875L13,15.4441426875Q13.05701,15.4112286875,13.12059,15.3941920875Q13.18417,15.3771549875,13.25,15.3771549875Q13.31583,15.3771549875,13.37941,15.3941920875Q13.44299,15.4112286875,13.5,15.4441426875L15.38157,16.5304646875Z" fill="#FFFFFF" fill-opacity="0.5"/></g><g><path d="M10.248069,3.065878L13.244209999999999,4.77796Q14,5.20984,14,6.08032L14,9Q14,9.049240000000001,13.99039,9.09754Q13.98078,9.14584,13.96194,9.19134Q13.94309,9.23684,13.91573,9.27778Q13.88838,9.31873,13.85355,9.35355Q13.81873,9.38837,13.77778,9.41573Q13.73684,9.44309,13.69134,9.46194Q13.64584,9.48078,13.59754,9.49039Q13.54925,9.5,13.5,9.5Q13.45075,9.5,13.40245,9.49039Q13.35415,9.48078,13.30866,9.46194Q13.26316,9.44309,13.22221,9.41573Q13.18127,9.38837,13.14645,9.35355Q13.11162,9.31873,13.08426,9.27778Q13.05691,9.23684,13.03806,9.19134Q13.019210000000001,9.14584,13.00961,9.09754Q13,9.049240000000001,13,9L13,6.08032Q13,5.79016,12.74807,5.6462L9.751931,3.934122Q9.694532,3.901322,9.647629,3.854732Q9.600727,3.808142,9.567545,3.750963Q9.534363,3.693785,9.517181,3.629947Q9.5,3.5661094,9.5,3.5Q9.5,3.4507543,9.509607,3.4024549Q9.519214999999999,3.354155,9.53806,3.308658Q9.556906,3.263161,9.584265,3.222215Q9.611625,3.181269,9.646447,3.146447Q9.681269,3.111625,9.722215,3.084265Q9.763161,3.056906,9.808658,3.0380599999999998Q9.854155,3.019215,9.9024549,3.009607Q9.9507543,3,10,3Q10.132782,3,10.248069,3.065878Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="0.5"/></g><g transform="matrix(-1,0,0,1,24,0)"><path d="M14.22361,7.447214Q14.2859,7.416069,14.337299999999999,7.369088Q14.38871,7.322107,14.42533,7.262866Q14.46194,7.203625,14.48097,7.136633Q14.5,7.069642,14.5,7Q14.5,6.9507543,14.49039,6.9024549Q14.48078,6.854155,14.46194,6.808658Q14.44309,6.763161,14.41573,6.722215Q14.38838,6.681269,14.35355,6.646447Q14.31873,6.611625,14.27779,6.584265Q14.23684,6.556906,14.19134,6.53806Q14.14584,6.519215,14.09754,6.509607Q14.04925,6.5,14,6.5Q13.881969999999999,6.5,13.77639,6.552786L11.776456,7.552755L11.776393,7.552786Q11.714104,7.583931,11.662696,7.630912Q11.611288,7.677893,11.574675,7.737134Q11.538062,7.796375,11.519031,7.863367Q11.5,7.930358,11.5,8Q11.5,8.04925,11.509607,8.09755Q11.519214999999999,8.14584,11.53806,8.19134Q11.556906,8.23684,11.584265,8.27779Q11.611625,8.31873,11.646447,8.35355Q11.681269,8.38838,11.722215,8.41573Q11.763161,8.44309,11.808658,8.46194Q11.854155,8.48079,11.9024549,8.49039Q11.9507543,8.5,12,8.5Q12.118034,8.5,12.223607,8.44721L14.22361,7.447214Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="0.5"/></g></g></svg>
\ No newline at end of file
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="企业名称" prop="roleName">
<el-input
v-model="queryParams.roleName"
placeholder="请输入企业名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="roleKey">
<el-input
v-model="queryParams.roleKey"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="电话号码" prop="roleKey">
<el-input
v-model="queryParams.roleKey"
placeholder="请输入电话号码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="账号状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="角色状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.sys_user_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:role:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:role:remove']"
>批量删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="60">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) *queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="企业名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="用户名称" prop="roleKey" :show-overflow-tooltip="true" width="150" />
<el-table-column label="手机号码" prop="roleSort" width="100" />
<el-table-column label="企业方案" prop="roleSort" />
<el-table-column label="续约开始时间" prop="roleSort" />
<el-table-column label="续约结束时间" prop="roleSort" />
<el-table-column label="账号状态" align="center" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="企业名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="续约时间" prop="roleName">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业方案" prop="roleName">
<el-select
v-model="queryParams.status"
placeholder="企业方案"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.sys_user_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业规模" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_user_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
addRole,
changeRoleStatus,
dataScope,
delRole,
deptTreeSelect,
getRole,
listRole,
updateRole
} from '@/api/system/role'
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu'
export default {
name: "index",
dicts: ['sys_user_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 角色表格数据
roleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否显示弹出层(数据权限)
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
// 日期范围
dateRange: [],
// 数据范围选项
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
},
{
value: "2",
label: "自定数据权限"
},
{
value: "3",
label: "本部门数据权限"
},
{
value: "4",
label: "本部门及以下数据权限"
},
{
value: "5",
label: "仅本人数据权限"
}
],
// 菜单列表
menuOptions: [],
// 部门列表
deptOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
},
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label"
},
// 表单校验
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
],
roleKey: [
{ required: true, message: "权限字符不能为空", trigger: "blur" }
],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
});
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
let checkedKeys = this.$refs.menu.getCheckedKeys();
// 半选中的菜单节点
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
// 半选中的部门节点
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.data.menus;
return response;
});
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.data.depts;
return response;
});
},
// 角色状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
return changeRoleStatus(row.roleId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 取消按钮(数据权限)
cancelDataScope() {
this.openDataScope = false;
this.reset();
},
// 表单重置
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length!=1
this.multiple = !selection.length
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case "handleDataScope":
this.handleDataScope(row);
break;
case "handleAuthUser":
this.handleAuthUser(row);
break;
default:
break;
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
} else if (type == 'dept') {
let treeList = this.deptOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
}
},
// 树权限(父子联动)
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true: false;
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true: false;
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getMenuTreeselect();
this.open = true;
this.title = "添加角色";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
this.form = response.data;
this.open = true;
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.data.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
this.title = "修改角色";
});
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if(value !== '2') {
this.$refs.dept.setCheckedKeys([]);
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
getRole(row.roleId).then(response => {
this.form = response.data;
this.openDataScope = true;
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.data.checkedKeys);
});
});
this.title = "分配数据权限";
});
},
/** 分配用户操作 */
handleAuthUser: function(row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 提交按钮(数据权限) */
submitDataScope: function() {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
dataScope(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDataScope = false;
this.getList();
});
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="方案名称" prop="roleName">
<el-input
v-model="queryParams.roleName"
placeholder="请输入方案名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:role:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:role:remove']"
>批量删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="60">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) *queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="方案名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="备注" prop="roleKey" width="400">
<template slot-scope="scope">
<el-popover
title=""
:visible-arrow="false"
width="400"
trigger="hover"
popper-class="popovers"
content="备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数">
<div class="over" slot="reference">备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数</div>
</el-popover>
</template>
</el-table-column>
<el-table-column label="方案状态" align="center" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.ent_pro_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="方案名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入方案名称" />
</el-form-item>
<el-form-item label="角色授权">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" maxlength="50" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
export default {
name: "programme",
dicts: ['ent_pro_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 角色表格数据
roleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否显示弹出层(数据权限)
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
// 日期范围
dateRange: [],
// 数据范围选项
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
},
{
value: "2",
label: "自定数据权限"
},
{
value: "3",
label: "本部门数据权限"
},
{
value: "4",
label: "本部门及以下数据权限"
},
{
value: "5",
label: "仅本人数据权限"
}
],
// 菜单列表
menuOptions: [],
// 部门列表
deptOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
},
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label"
},
// 表单校验
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
],
roleKey: [
{ required: true, message: "权限字符不能为空", trigger: "blur" }
],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
});
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
let checkedKeys = this.$refs.menu.getCheckedKeys();
// 半选中的菜单节点
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
// 半选中的部门节点
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.data.menus;
return response;
});
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.data.depts;
return response;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 取消按钮(数据权限)
cancelDataScope() {
this.openDataScope = false;
this.reset();
},
// 表单重置
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length!=1
this.multiple = !selection.length
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case "handleDataScope":
this.handleDataScope(row);
break;
case "handleAuthUser":
this.handleAuthUser(row);
break;
default:
break;
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
} else if (type == 'dept') {
let treeList = this.deptOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
}
},
// 树权限(父子联动)
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true: false;
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true: false;
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getMenuTreeselect();
this.open = true;
this.title = "添加角色";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
this.form = response.data;
this.open = true;
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.data.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
this.title = "修改角色";
});
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if(value !== '2') {
this.$refs.dept.setCheckedKeys([]);
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
getRole(row.roleId).then(response => {
this.form = response.data;
this.openDataScope = true;
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.data.checkedKeys);
});
});
this.title = "分配数据权限";
});
},
/** 分配用户操作 */
handleAuthUser: function(row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 提交按钮(数据权限) */
submitDataScope: function() {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
dataScope(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDataScope = false;
this.getList();
});
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style scoped lang="scss">
.over{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
<style lang="scss">
.popovers {
padding: 6px 12px !important;
line-height: 20px;
color: rgba(35, 35, 35, 0.80);
font-size: 12px;
}
</style>
...@@ -35,7 +35,7 @@ module.exports = { ...@@ -35,7 +35,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://47.104.91.229:9099/prod-api`, // target: `http://47.104.91.229:9099/prod-api`,
target: `http://192.168.0.165:8080`,//施 target: `http://192.168.0.165:9098`,//施
// target: `http://139.9.157.49:9099`,//测试 // target: `http://139.9.157.49:9099`,//测试
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment