UserManagementIndex.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. <template>
  2. <div class="content-main-manage">
  3. <div class="search-list">
  4. <div class="search-left">
  5. <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
  6. <FormItem label="" prop="orgType">
  7. <Select v-model="tableParams.orgType" placeholder="" label-in-value>
  8. <Option v-for="item in orgTypeData" :value="item.value" :key="item.value">{{ item.label }}</Option>
  9. </Select>
  10. </FormItem>
  11. <FormItem label="" prop="roleId">
  12. <Select v-model="tableParams.roleId" placeholder="角色名称">
  13. <Option v-for="item in roleData" :value="item.value" :key="item.value">{{ item.label }}</Option>
  14. </Select>
  15. </FormItem>
  16. <FormItem label="" prop="isEnabled">
  17. <Select v-model="tableParams.isEnabled" placeholder="启用状态">
  18. <Option v-for="item in enabledData" :value="item.value" :key="item.value">{{ item.label }}</Option>
  19. </Select>
  20. </FormItem>
  21. <FormItem label="" prop="userName">
  22. <Input placeholder="输入用户号" clearable search v-model="tableParams.userName" />
  23. </FormItem>
  24. <FormItem label="" prop="realName">
  25. <Input placeholder="输入姓名关键词" clearable search v-model="tableParams.realName" />
  26. </FormItem>
  27. <FormItem label="">
  28. <DatePicker type="datetimerange" :value="dateRange" format="yyyy-MM-dd HH:mm:ss" placeholder="更新时间范围" class="common-date-picker date-picker-main" :clearable="false" :editable="false" @on-change="changePicker"></DatePicker>
  29. </FormItem>
  30. <FormItem label="" >
  31. <Button type="primary" class="common-btn-search" @click="searchClick">
  32. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
  33. </Button>
  34. <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
  35. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
  36. </Button>
  37. </FormItem>
  38. </Form>
  39. </div>
  40. </div>
  41. <div class="btn-container">
  42. <Button icon="ios-add" class="common-add-btn" @click="addClick">新增用户</Button>
  43. </div>
  44. <div class="manage-main-center">
  45. <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
  46. <template slot="loading">
  47. <Loading-animation></Loading-animation>
  48. </template>
  49. <template slot-scope="{ row }" slot="action">
  50. <Tooltip content="重置密码" placement="top">
  51. <i class="iconfont icon-mima" style="cursor:pointer;color:#858aea;fontSize:16px;marginRight:6px;vertical-align: middle;" @click="resetPwd(row)"></i>
  52. </Tooltip>
  53. <Tooltip content="详情" placement="top">
  54. <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px;vertical-align: middle;" @click="detailClick(row)"></i>
  55. </Tooltip>
  56. <Tooltip content="编辑" placement="top">
  57. <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px;vertical-align: middle;" @click="editClick(row)"></i>
  58. </Tooltip>
  59. <Tooltip content="删除" placement="top">
  60. <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px;vertical-align: middle;" @click="delClick(row)"></i>
  61. </Tooltip>
  62. </template>
  63. </Table>
  64. </div>
  65. <div class="common-page">
  66. <div class="common-page-total">
  67. 共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
  68. </div>
  69. <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
  70. </div>
  71. <Modal
  72. v-model="showModal"
  73. :title="title"
  74. width="36"
  75. ref="modalGrag"
  76. draggable
  77. reset-drag-position
  78. @on-visible-change="modalChange"
  79. :mask-closable="false"
  80. class-name="common-modal">
  81. <Form class="common-form common-form-modal" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120">
  82. <FormItem label="用户号:" prop="userName">
  83. <Input v-model.trim="formOption.userName" placeholder="请输入用户号" maxlength="30" show-word-limit/>
  84. <div class="common-form-item-text">可使用工号、学号等唯一不重复身份识别号</div>
  85. </FormItem>
  86. <FormItem label="用户名:" prop="realName">
  87. <Input v-model.trim="formOption.realName" maxlength="10" show-word-limit />
  88. </FormItem>
  89. <FormItem label="组织机构:" prop="orgIdArr">
  90. <Cascader :data="userStationData[0].children" :render-format="format" :clearable="false" change-on-select v-model="formOption.orgIdArr" placeholder="选择组织机构" class="common-cascader" v-if="userStationData && userStationData.length>0" ref="cascader"></Cascader>
  91. <!-- <Cascader :data="stationOrgData" :render-format="format" :clearable="false" change-on-select v-model="formOption.orgIdArr" placeholder="选择组织机构" class="common-cascader" v-if="userStationData && userStationData.length>0" ref="cascader"></Cascader> -->
  92. </FormItem>
  93. <FormItem label="角色名称:" prop="roleId">
  94. <Select v-model="formOption.roleId" placeholder="角色名称">
  95. <Option v-for="item in roleModalData" :value="item.value" :key="item.value">{{ item.label }}</Option>
  96. </Select>
  97. </FormItem>
  98. <FormItem label="手机号码:" prop="mobilePhone">
  99. <Input v-model.trim="formOption.mobilePhone" placeholder="手机号格式校验" />
  100. </FormItem>
  101. <FormItem label="邮箱:" prop="userMail">
  102. <Input v-model.trim="formOption.userMail" placeholder="邮箱格式校验"/>
  103. </FormItem>
  104. <FormItem label="启用状态:" prop="isEnable" v-if="title == '新增用户'">
  105. <i-switch true-color="#57C44F" v-model="formOption.isEnable" disabled></i-switch>
  106. <span style="color: #718EBD;margin-left:6px">关</span>
  107. <span style="color: #718EBD;margin-left:12px">(所有新增状态均为关闭,需在列表打开)</span>
  108. </FormItem>
  109. </Form>
  110. <div slot="footer">
  111.     <Button @click="modalCancel">取消</Button>
  112.     <Button type="primary" @click="modalOk('formOption')">确定</Button>
  113.   </div>
  114. </Modal>
  115. <Modal
  116. v-model="modalStatus"
  117. :title="commonTitle"
  118. width="30"
  119. ref="modalGrag"
  120. draggable
  121. reset-drag-position
  122. :mask-closable="false"
  123. class-name="common-modal">
  124. <i :class="'iconfont '+ activeClass" :style="{ color: activeColor}" class="modal-icon" v-show="commonTitle!='确认删除'"></i>
  125. <Icon type="ios-information-circle" :style="{ color: activeColor}" class="modal-icon" v-show="commonTitle=='确认删除'"></Icon>
  126. <span class="modal-text">{{modalTitle}}</span>
  127. <div slot="footer">
  128.     <Button @click="commonCancel">取消</Button>
  129.     <Button type="primary" @click="commonOk">确定</Button>
  130.   </div>
  131. </Modal>
  132. <Modal
  133. v-model="detailStatus"
  134. title="用户详情"
  135. width="30"
  136. ref="modalGrag"
  137. draggable
  138. reset-drag-position
  139. footer-hide
  140. :mask-closable="false"
  141. class-name="common-modal">
  142. <Form class="common-form common-form-modal" :model="detailData" :label-width="120">
  143. <FormItem label="用户号:">
  144. <div class="common-form-detail-text">{{detailData.userName}}</div>
  145. </FormItem>
  146. <FormItem label="用户名:">
  147. <div class="common-form-detail-text">{{detailData.realName}}</div>
  148. </FormItem>
  149. <FormItem label="组织机构:">
  150. <div class="common-form-detail-text">{{detailData.orgName}}</div>
  151. </FormItem>
  152. <FormItem label="角色名称:">
  153. <div class="common-form-detail-text">{{detailData.roleName}}</div>
  154. </FormItem>
  155. <FormItem label="手机号码:">
  156. <div class="common-form-detail-text">{{detailData.mobilePhone}}</div>
  157. </FormItem>
  158. <FormItem label="邮箱:">
  159. <div class="common-form-detail-text">{{detailData.userMail}}</div>
  160. </FormItem>
  161. <FormItem label="启用状态:">
  162. <div class="common-form-detail-text">{{detailData.isEnable == 1 ? '开启' : '关闭'}}</div>
  163. </FormItem>
  164. <FormItem label="更新时间:">
  165. <div class="common-form-detail-text">{{detailData.updateTime}}</div>
  166. </FormItem>
  167. <FormItem label="最后登录时间:">
  168. <div class="common-form-detail-text">{{detailData.lastLoginTime}}</div>
  169. </FormItem>
  170. </Form>
  171. </Modal>
  172. </div>
  173. </template>
  174. <script>
  175. const defaultFrom = {userName: '',realName: '',orgId: '',orgIdArr: [],roleId: '',mobilePhone: '',userMail: '',isEnable:0}
  176. export default {
  177. name: "UserManagementIndex",
  178. props: {
  179. userStationData: {
  180. type: Array,
  181. default: () => {
  182. return [];
  183. }
  184. },
  185. currentOrgId: [String,Number]
  186. },
  187. data() {
  188. return {
  189. loading: true,
  190. dateRange: [],
  191. tableParams: {
  192. keywords: '',
  193. orgType: 'all',
  194. orgId: '',
  195. roleId: '',
  196. isEnabled: '',
  197. userName:'',
  198. realName: '',
  199. beginUpdateTime: '',
  200. endUpdateTime: '',
  201. pageNum: 1,
  202. pageSize: 10
  203. },
  204. tableData: [],
  205. tableTotal: 0,
  206. tablePage: 0,
  207. rowObj: {},
  208. enabledData: [
  209. {
  210. value: '-1',
  211. label: '启用状态'
  212. },
  213. {
  214. value: '1',
  215. label: '启用'
  216. },
  217. {
  218. value: '0',
  219. label: '关闭'
  220. },
  221. ],
  222. orgTypeData: [
  223. {
  224. value: 'all',
  225. label: '当前及下级节点所有用户'
  226. },
  227. {
  228. value: 'cur',
  229. label: '仅当前节点用户'
  230. },
  231. ],
  232. roleData: [],
  233. roleModalData: [],
  234. stationTypeData: [],
  235. equipStateData: [],
  236. equipStateModalData: [],
  237. equipTypeData: [],
  238. equipTypeModalData: [],
  239. equipAppModalData: [],
  240. columns: [
  241. {
  242. title: '序号',
  243. type: 'index',
  244. align: 'center',
  245. ellipsis: true,
  246. tooltip: true
  247. },
  248. {
  249. title: '用户号',
  250. key: 'userName',
  251. align: 'center',
  252. ellipsis: true,
  253. tooltip: true
  254. },
  255. {
  256. title: '用户名',
  257. key: 'realName',
  258. align: 'center',
  259. ellipsis: true,
  260. tooltip: true
  261. },
  262. {
  263. title: '组织机构',
  264. key: 'orgName',
  265. align: 'center',
  266. ellipsis: true,
  267. tooltip: true
  268. },
  269. {
  270. title: '角色名称',
  271. key: 'roleName',
  272. align: 'center',
  273. ellipsis: true,
  274. tooltip: true
  275. },
  276. {
  277. title: '更新时间',
  278. align: 'center',
  279. key: 'updateTime',
  280. ellipsis: true,
  281. tooltip: true
  282. },
  283. {
  284. title: '启用状态',
  285. key: 'isEnable',
  286. align: 'center',
  287. width: 120,
  288. render: (h, params) => {
  289. return h('div', [
  290. h('i-switch', {
  291. props: { value: params.row.isEnable,'true-color': '#57C44F', trueValue:1,falseValue: 0
  292. },
  293. nativeOn:{
  294. "mousedown":(event)=>{ // 监听组件原生事件mousedown,此事件在click之前触发
  295. this.rowObj = params.row
  296. if (params.row.isEnable == 1) {
  297. this.commonTitle = '确认关闭'
  298. this.activeColor = '#E92E2E'
  299. this.activeClass = 'icon-guanbi'
  300. this.modalTitle = '关闭后,用户无法登录。关闭不影响用户已经产生的操作记录。'
  301. this.modalStatus = true
  302. } else {
  303. this.commonTitle = '确认启用'
  304. this.activeColor = '#57C44F'
  305. this.activeClass = 'icon-qiyong'
  306. this.modalTitle = '启用后,用户即可正常登录使用。'
  307. this.modalStatus = true
  308. }
  309. },
  310. }
  311. }),
  312. ])
  313. }
  314. },
  315. {
  316. title: '操作',
  317. align: 'center',
  318. slot: 'action',
  319. width: 160,
  320. }
  321. ],
  322. showModal: false,
  323. detailStatus: false,
  324. modalStatus: false,
  325. title: '新增用户',
  326. commonTitle: "确认删除",
  327. activeColor: '#E92E2E',
  328. activeClass: '',
  329. modalTitle: '',
  330. formOption: {userName: '',realName: '',orgId: '',orgIdArr: [],roleId: '',mobilePhone: '',userMail: '',isEnable:0},
  331. ruleValidate: {
  332. userName: [{
  333. required: true,
  334. message: '请输入用户ID',
  335. trigger: 'blur'
  336. }],
  337. realName: [{
  338. required: true,
  339. message: '请输入用户名',
  340. trigger: 'blur'
  341. }],
  342. orgIdArr: [{
  343. required: true,
  344. type: 'array',
  345. message: '请选择组织机构',
  346. trigger: 'change'
  347. }],
  348. roleId: [{
  349. required: true,
  350. type: 'number',
  351. message: '请选择角色名称',
  352. trigger: 'change'
  353. }],
  354. mobilePhone: [
  355. { required: true, message: "请输入手机号码", trigger: "blur" },
  356. { pattern: /^1[3456789]\d{9}$/, message: "手机号码格式不正确", trigger: "blur" } ///^[1][345789]\d{9}$/
  357. ],
  358. userMail: [
  359. { type: 'email', message: '请输入正确格式的邮箱', trigger: 'blur'}
  360. ]
  361. },
  362. detailData: {},
  363. curOrgId: '',
  364. };
  365. },
  366. watch: {
  367. currentOrgId: {
  368.  handler(newValue, oldValue) {
  369. this.curOrgId = newValue
  370. },
  371. }
  372. },
  373. mounted() {
  374. this.getType()
  375. },
  376. methods: {
  377. format (labels, selectedData) {
  378. const index = labels.length - 1;
  379. this.formOption.orgId = selectedData.length >0 ? selectedData[selectedData.length-1].nodeId : ''
  380. return labels[index];
  381. },
  382. changePicker (date) {
  383. this.tableParams.beginUpdateTime = date[0]
  384. this.tableParams.endUpdateTime = date[1]
  385. },
  386. rowClassName(row, index) {
  387. if (index % 2 == 0) {
  388. return "ivu-table-stripe-even";
  389. } else {
  390. return "ivu-table-stripe-odd";
  391. }
  392. },
  393. // 分页
  394. changePage (val) {
  395. this.tableParams.pageNum = val
  396. this.getTableData()
  397. },
  398. //跳转
  399. sizeChange (val) {
  400. this.tableParams.pageSize = val
  401. this.getTableData()
  402. },
  403. getType () {
  404. // 获取用户状态
  405. this.$get('metroapi/dic/queryDictionary', {name:'用户状态'}).then(res=>{
  406. if (res.httpCode == 1 ){
  407. this.equipStateModalData = JSON.parse(JSON.stringify(res.data))
  408. this.equipStateData = res.data
  409. this.equipStateData.unshift({ id: '-1', value: '用户状态' })
  410. } else {
  411. this.equipStateData = []
  412. this.equipStateModalData = []
  413. }
  414. })
  415. //获取角色名称
  416. this.$get('metroapi/role/box').then(res=>{
  417. if (res.httpCode == 1 ){
  418. this.roleModalData = JSON.parse(JSON.stringify(res.data))
  419. this.roleData = res.data
  420. this.roleData.unshift({ value: '-1', label: '角色名称' })
  421. } else {
  422. this.roleData = []
  423. }
  424. })
  425. },
  426. // 获取表格数据
  427. getTableData (orgId) {
  428. if (typeof(orgId) == 'number' && orgId>0) {
  429. this.tableParams.orgId = orgId
  430. } else {
  431. if (orgId === 0) {
  432. this.tableParams.orgId = ''
  433. } else {
  434. this.tableParams.orgId = this.curOrgId
  435. }
  436. }
  437. let params = JSON.parse(JSON.stringify(this.tableParams))
  438. params.roleId = params.roleId == '-1' ? '' : params.roleId
  439. params.isEnabled = params.isEnabled == '-1' ? '' : params.isEnabled
  440. this.loading = true
  441. this.$get('metroapi/user/querySysUserPage', params).then(res=>{
  442. this.loading = false
  443. if (res.httpCode == 1 ){
  444. this.tableData = res.data.data
  445. this.tableTotal = res.data.count
  446. if (res.data.data.length==0) {
  447. this.tablePage = 0
  448. } else {
  449. this.tablePage = res.data.count<= 10 ? 1: Math.ceil(res.data.count/this.tableParams.pageSize)
  450. }
  451. if (res.data.data.length==0 && this.tableParams.pageNum>1) {
  452. this.tableParams.pageNum--
  453. return this.getTableData()
  454. }
  455. } else {
  456. this.tableData = []
  457. this.tableTotal = 0
  458. }
  459. })
  460. },
  461. // 获取新增用户类型
  462. getAddEquipType (params) {
  463. this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
  464. if (res.httpCode == 1 ){
  465. this.equipTypeModalData = res.data.data
  466. } else {
  467. this.equipTypeModalData = []
  468. }
  469. })
  470. },
  471. searchClick () {
  472. this.tableParams.pageNum = 1
  473. this.getTableData()
  474. },
  475. resetClick (name) {
  476. this.dateRange = []
  477. this.tableParams.beginUpdateTime = ''
  478. this.tableParams.endUpdateTime = ''
  479. this.$refs[name].resetFields()
  480. this.tableParams.pageNum = 1
  481. this.getTableData()
  482. },
  483. changeMoldaPicker (val) {
  484. this.formOption.useDate = val
  485. },
  486. addClick () {
  487. this.formOption = JSON.parse(JSON.stringify(defaultFrom))
  488. this.title = '新增用户'
  489. this.showModal = true
  490. },
  491. detailClick (row) {
  492. this.rowObj = row
  493. this.detailStatus = true
  494. this.$get('metroapi/user/userView', {userId:row.userId}).then(res=>{
  495. if (res.httpCode == 1 ){
  496. this.detailData = res.data
  497. } else {
  498. this.$Message.info(res.msg)
  499. }
  500. })
  501. },
  502. editClick (row) {
  503. this.rowObj = row
  504. this.formOption = JSON.parse(JSON.stringify(row));
  505. this.formOption.orgIdArr = this.treeFindPath(this.userStationData[0].children, node => node.value === row.orgId)
  506. this.title = '编辑用户'
  507. this.$nextTick(()=> {
  508. this.showModal = true
  509. })
  510. },
  511. // 根据子节点id递归获取所有父类的id
  512. treeFindPath (tree, func, path = []) {
  513. if (!tree) return []
  514. for (const data of tree) {
  515. path.push(data.value)
  516. if (func(data)) return path
  517. if (data.children) {
  518. const findChildren = this.treeFindPath(data.children, func, path)
  519. if (findChildren.length) return findChildren
  520. }
  521. path.pop()
  522. }
  523. return []
  524. },
  525. delClick (row) {
  526. this.rowObj = row
  527. this.commonTitle = '确认删除'
  528. this.activeColor = '#E92E2E'
  529. this.activeClass = ''
  530. this.modalTitle = '删除不影响用户已经产生的操作记录。'
  531. this.modalStatus = true
  532. },
  533. resetPwd (row) {
  534. this.rowObj = row
  535. this.commonTitle = '密码重置'
  536. this.activeColor = '#858aea'
  537. this.activeClass = ''
  538. this.modalTitle = '用户密码将被重置为123456。'
  539. this.modalStatus = true
  540. },
  541. modalChange (modalStatus) {
  542. if (!modalStatus) {
  543. this.$refs.formOption.resetFields();
  544. }
  545. },
  546. modalOk (formName) {
  547. let params = JSON.parse(JSON.stringify(this.formOption)) //把对象中的数据给了某个变量,改变一个对象的值,另一个对象也变化的解决方法
  548. if (this.title == '新增用户') {
  549. this.$refs[formName].validate((valid) => {
  550. if (valid) {
  551. this.$post('metroapi/user/addSysUser', params).then(res=>{
  552. if (res.httpCode == 1 ){
  553. this.showModal = false
  554. this.$Message.info(res.msg)
  555. this.getTableData()
  556. } else {
  557. this.$Message.info(res.msg)
  558. }
  559. })
  560. } else {
  561. this.showModal = true
  562. }
  563. })
  564. } else {
  565. this.$refs[formName].validate((valid) => {
  566. if (valid) {
  567. this.$post('metroapi/user/updateUser', params).then(res=>{
  568. if (res.httpCode == 1 ){
  569. this.showModal = false
  570. this.$Message.info(res.msg)
  571. this.getTableData()
  572. } else {
  573. this.$Message.info(res.msg)
  574. }
  575. })
  576. } else {
  577. this.showModal = true
  578. }
  579. })
  580. }
  581. },
  582. modalCancel () {
  583. this.showModal = false
  584. },
  585. commonOk () {
  586. if (this.commonTitle == '确认启用') {
  587. let params = {
  588. userId: this.rowObj.userId,
  589. enabled: 1,
  590. type: 0
  591. }
  592. this.getSwitchStatus(params)
  593. } else if (this.commonTitle == '确认关闭') {
  594. let params = {
  595. userId: this.rowObj.userId,
  596. enabled:0,
  597. type: 0
  598. }
  599. this.getSwitchStatus(params)
  600. } else if(this.commonTitle == '确认删除'){
  601. let params = {
  602. userId: this.rowObj.userId,
  603. type: 2
  604. }
  605. this.delData(params)
  606. } else {
  607. let params = {
  608. userId: this.rowObj.userId
  609. }
  610. this.resetPwdData(params)
  611. }
  612. },
  613. commonCancel () {
  614. this.modalStatus = false
  615. },
  616. // 启用 关闭/接口
  617. getSwitchStatus (params) {
  618. this.$get('metroapi/user/operation',params).then(res=>{
  619. if (res.httpCode == 1 ){
  620. if (params.enabled == 0) {
  621. this.rowObj.isEnable = 0
  622. } else {
  623. this.rowObj.isEnable = 1
  624. }
  625. this.modalStatus = false
  626. } else {
  627. this.rowObj.isEnable = 0
  628. this.$Message.info(res.msg)
  629. }
  630. })
  631. },
  632. // 删除接口
  633. delData (params) {
  634. this.$get('metroapi/user/operation',params).then(res=>{
  635. if (res.httpCode == 1 ){
  636. this.modalStatus = false
  637. this.$Message.info(res.msg)
  638. this.getTableData()
  639. } else {
  640. this.$Message.info(res.msg)
  641. }
  642. })
  643. },
  644. // 重置密码
  645. resetPwdData (params) {
  646. this.$post('metroapi/user/intial',params).then(res=>{
  647. if (res.httpCode == 1 ){
  648. this.modalStatus = false
  649. this.$Message.info(res.msg)
  650. this.getTableData()
  651. } else {
  652. this.$Message.info(res.msg)
  653. }
  654. })
  655. }
  656. }
  657. };
  658. </script>
  659. <style scoped lang="stylus">
  660. .content-main-manage {
  661. position: relative;
  662. height: 100%;
  663. }
  664. .search-list {
  665. display: flex;
  666. padding: 10px 0 0;
  667. }
  668. .search-left {
  669. display: flex;
  670. align-items: center;
  671. .ivu-select {
  672. width: 165px;
  673. height: 32px;
  674. }
  675. .ivu-select-single .ivu-select-selection {
  676. height: 100%;
  677. }
  678. >>> .ivu-input {
  679. width: 155px;
  680. height: 32px;
  681. }
  682. >>> .ivu-date-picker-editor .ivu-input {
  683. width: 315px;
  684. }
  685. >>> .ivu-input-prefix, >>> .ivu-input-suffix {
  686. height: 32px;
  687. line-height: 32px;
  688. }
  689. >>> .ivu-input-icon {
  690. height: 32px;
  691. line-height: 32px;
  692. }
  693. >>> .date-picker-main .ivu-date-picker-header {
  694. border-bottom: 0.0052083333rem solid #204384;
  695. }
  696. }
  697. .btn-container {
  698. display: flex;
  699. justify-content: flex-end;
  700. padding-bottom: 10px;
  701. }
  702. .common-form {
  703. display: flex;
  704. flex-wrap: wrap;
  705. }
  706. .common-form-modal {
  707. display: flex;
  708. flex-direction: column;
  709. }
  710. >>> .common-form-list .ivu-form-item {
  711. margin-bottom: 10px;
  712. }
  713. .manage-main-center {
  714. width: 100%;
  715. height: calc(100% - 150px);
  716. }
  717. .common-table {
  718. max-height: 100%;
  719. }
  720. >>> .common-table .ivu-table th {
  721. height: 54px;
  722. }
  723. >>> .common-table .ivu-table td {
  724. height: 55px;
  725. }
  726. >>> .common-table .ivu-spin-fix {
  727. top: 54px;
  728. }
  729. >>> .app-table .ivu-spin-fix {
  730. height: calc(100vh - 375px);
  731. }
  732. >>> .ivu-table-tip {
  733. background: url('../../../assets/images/noData.png') no-repeat center;
  734. }
  735. >>> .app-table .ivu-table-tip {
  736. height: calc(100vh - 375px);
  737. }
  738. >>> .common-table .ivu-table-tip table {
  739. display: none;
  740. }
  741. >>> .modal-table {
  742. overflow: auto !important;
  743. }
  744. >>> .modal-table .ivu-spin-fix {
  745. height: 200px;
  746. }
  747. >>> .modal-table .ivu-table-tip {
  748. height: 200px;
  749. }
  750. .common-page {
  751. margin-top: 15px;
  752. display: flex;
  753. align-items: center;
  754. justify-content: flex-end;
  755. position: absolute;
  756. bottom: 0;
  757. right: 0;
  758. }
  759. .common-page-total {
  760. color: #fff;
  761. padding-right: 10px;
  762. font-size: 14px;
  763. span {
  764. color #409EFF;
  765. }
  766. }
  767. .common-form-item-text {
  768. font-size: 11px;
  769. color: #85A3D4;
  770. }
  771. .common-form-detail-text {
  772. color: #fff;
  773. font-size: 14PX;
  774. }
  775. /* 对话框里的input里的placeholder样式修改 */
  776. /deep/ .ivu-input::-webkit-input-placeholder , /deep/ .ivu-input-number-input::-webkit-input-placeholder{
  777. color: #718EBD;
  778. }
  779. /deep/ .ivu-input::-moz-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{ /* Mozilla Firefox 19+ */
  780. color: #718EBD;
  781. }
  782. /deep/ .ivu-input::-moz-placeholde, /deep/ .ivu-input-number-input::-webkit-input-placeholderr{ /* Mozilla Firefox 4 to 18 */
  783. color: #718EBD;
  784. }
  785. /deep/ .ivu-input::-ms-input-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{ /* Internet Explorer 10-11 */
  786. color: #718EBD;
  787. }
  788. </style>