2e53af87840eaaf696c88b437aaee7128e291649.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <el-input v-model="tab2.table.getdataListParm.parammaps.pastureName" placeholder="牧场名称" style="width: 180px;" class="filter-item" clearable />
  5. <el-select v-model="tab2.table.getdataListParm.parammaps.enable" placeholder="状态" class="filter-item" style="width: 120px;" clearable>
  6. <el-option v-for="item in stateList" :key="item.id" :label="item.name" :value="item.id" />
  7. </el-select>
  8. <el-select v-model="tab2.table.getdataListParm.parammaps.statue" placeholder="是否归属集团" class="filter-item" style="width: 120px;" clearable>
  9. <el-option v-for="item in isBelongGroupList" :key="item.id" :label="item.name" :value="item.id" />
  10. </el-select>
  11. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  12. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  13. </div>
  14. <div class="operation">
  15. <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
  16. </div>
  17. <div class="table">
  18. <el-table
  19. :key="tab2.table.tableKey"
  20. v-loading="tab2.table.listLoading"
  21. element-loading-text="给我一点时间"
  22. :data="tab2.table.list"
  23. border
  24. fit
  25. highlight-current-row
  26. style="width: 100%;"
  27. :row-style="rowStyle"
  28. :cell-style="cellStyle"
  29. class="elTable table-fixed"
  30. >
  31. <el-table-column label="序号" align="center" type="index" width="50px">
  32. <template slot-scope="scope">
  33. <span>{{ scope.$index + (tab2.table.pageNum-1) * tab2.table.pageSize + 1 }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="牧场ID" min-width="130px" align="center">
  37. <template slot-scope="scope">
  38. <span v-if="scope.row.NoEdit">{{ scope.row.pasturecode }}</span>
  39. <el-input v-if="scope.row.Edit" v-model="scope.row.pasturecode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="牧场名称" min-width="130px" align="center">
  43. <template slot-scope="scope">
  44. <span v-if="scope.row.NoEdit">{{ scope.row.pasturename }}</span>
  45. <el-input v-if="scope.row.Edit" v-model="scope.row.pasturename" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="管理员用户名" min-width="130px" align="center">
  49. <template slot-scope="scope">
  50. <span v-if="scope.row.NoEdit">{{ scope.row.user }}</span>
  51. <el-input v-if="scope.row.Edit" v-model="scope.row.user" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="状态" min-width="110px" align="center">
  55. <template slot-scope="scope">
  56. <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="权限归属" min-width="130px" align="center">
  60. <template slot-scope="scope">
  61. <span v-if="scope.row.NoEdit">{{ scope.row.groupsname }}</span>
  62. <el-select v-if="scope.row.Edit" v-model="scope.row.groupsid" :clearable="false" filterable placeholder="权限归属" class="filter-item" style="width: 120px;" clearable>
  63. <el-option v-for="item in belongGroupList" :key="item.id" :label="item.groupsname" :value="item.id" />
  64. </el-select>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="备注" min-width="130px" align="center">
  68. <template slot-scope="scope">
  69. <span v-if="scope.row.NoEdit">{{ scope.row.note }}</span>
  70. <el-input v-if="scope.row.Edit" v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  74. <template slot-scope="{row}">
  75. <!-- 页面权限 -->
  76. <a v-if="row.NoEdit && isRoleEdit" class="correcting" @click="handlePageConfiguration(row)">页面配置</a>
  77. <!-- 新增 -->
  78. <el-button v-if="row.isCreate && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @click="createData(row)" />
  79. <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
  80. <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
  81. <!-- 编辑 -->
  82. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  83. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  84. <!-- 编辑保存 -->
  85. <el-button v-if="row.isUpdateSave && isRoleEdit" class="miniSuccess" icon="el-icon-folder-checked" :disabled="isokDisable" @click="updateData(row)" />
  86. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  87. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getList" />
  92. </div>
  93. <!-- 页面配置 -->
  94. <el-dialog :title="textMap[tab1.pageConfiguration.dialogStatus]" :visible.sync="tab1.pageConfiguration.dialogFormVisible" :close-on-click-modal="false" width="25%">
  95. <div style="height: 400px;overflow-y: auto;">
  96. <el-tree
  97. ref="tree"
  98. v-loading="tab1.pageConfiguration.listLoading"
  99. show-checkbox
  100. node-key="id"
  101. :default-expand-all="true"
  102. :data="tab1.pageConfiguration.data"
  103. :props="tab1.pageConfiguration.defaultProps"
  104. :default-checked-keys="tab1.pageConfiguration.defaultCheckedKeys"
  105. @check-change="handelCheckChange"
  106. />
  107. </div>
  108. <div slot="footer" class="dialog-footer" style="bottom:10px">
  109. <el-button class="cancelClose" @click="tab1.pageConfiguration.dialogFormVisible = false;getList(); ">取消</el-button>
  110. <el-button class="save" :disabled="isokDisable" @click="pageConfigurationData()">确认</el-button>
  111. </div>
  112. </el-dialog>
  113. </div>
  114. </template>
  115. <script>
  116. import { GetDataByName, GetDataByNames, failproccess, transData, ExecDataByConfig, checkButtons } from '@/api/common'
  117. import Cookies from 'js-cookie'
  118. import Pagination from '@/components/Pagination'
  119. export default {
  120. name: 'OperationManagement',
  121. components: { Pagination },
  122. data() {
  123. return {
  124. requestParams: [
  125. { name: 'getGroupsAllList', offset: 0, pagecount: 0, parammaps: {}}
  126. ],
  127. isRoleEdit: [],
  128. stateList: [{ id: 1, name: '启用' }, { id: 0, name: '禁止' }], // 状态
  129. isBelongGroupList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否归属集团
  130. belongGroupList: [], // 权限归属
  131. tab1: {
  132. // 页面配置
  133. pageConfiguration: {
  134. dialogFormVisible: false,
  135. dialogStatus: '',
  136. temp: {},
  137. listLoading: true,
  138. getdataListParm: {
  139. name: 'getMenuandButtonlistMC'
  140. },
  141. parentType: [],
  142. defaultProps: {
  143. children: 'children',
  144. label: 'name'
  145. },
  146. defaultCheckedKeys: [],
  147. arrList: []
  148. }
  149. },
  150. tab2: {
  151. table: {
  152. getdataListParm: {
  153. name: 'groupsrelationlistMCAll',
  154. page: 1,
  155. offset: 1,
  156. pagecount: 10,
  157. returntype: 'Map',
  158. parammaps: {
  159. pastureName: '',
  160. enable: '',
  161. statue: ''
  162. }
  163. },
  164. tableKey: 0,
  165. list: [],
  166. total: 0,
  167. listLoading: true,
  168. temp: {}
  169. },
  170. // 页面配置
  171. pageConfiguration: {
  172. temp: {}
  173. }
  174. },
  175. requestParam: {},
  176. rules: {},
  177. isokDisable: false,
  178. textMap: {
  179. pageConfiguration: '页面配置',
  180. relation: '关联'
  181. },
  182. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  183. cellStyle: { padding: 0 + 'px' }
  184. }
  185. },
  186. created() {
  187. this.getList()
  188. this.getButtons()
  189. this.getDownList()
  190. },
  191. methods: {
  192. getButtons() {
  193. const Edit = 'Role'
  194. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  195. this.isRoleEdit = isRoleEdit
  196. },
  197. getDownList() {
  198. GetDataByNames(this.requestParams).then(response => {
  199. this.belongGroupList = response.data.getGroupsAllList.list
  200. })
  201. },
  202. handleEnableChange() {
  203. console.log('点击了是否启用')
  204. },
  205. handleSearch() {
  206. console.log('点击了查询')
  207. this.tab2.table.getdataListParm.offset = 1
  208. this.getList()
  209. },
  210. handleRefresh() {
  211. console.log('点击了重置')
  212. this.tab2.table.getdataListParm.parammaps.pastureName = ''
  213. this.tab2.table.getdataListParm.parammaps.statue = ''
  214. this.tab2.table.getdataListParm.parammaps.enable = ''
  215. this.tab2.table.getdataListParm.offset = 1
  216. this.getList()
  217. },
  218. createCancel(row) {
  219. console.log('点击了牧场新增取消')
  220. for (let i = 0; i < this.tab2.table.list.length; i++) {
  221. if (row.myId === this.tab2.table.list[i].myId) {
  222. var listIndex2 = this.tab2.table.list.indexOf(this.tab2.table.list[i])
  223. }
  224. if (listIndex2 > -1) {
  225. this.tab2.table.list.splice(listIndex2, 1)
  226. return
  227. }
  228. }
  229. },
  230. updateCancel(row) {
  231. console.log('点击了编辑取消')
  232. // 编辑false,不可编辑true
  233. row.Edit = false
  234. row.NoEdit = true
  235. // 新增false,编辑true,编辑保存false
  236. row.isCreate = false
  237. row.isUpdate = true
  238. row.isUpdateSave = false
  239. this.getList()
  240. },
  241. getPageConfigurationList() {
  242. this.tab1.pageConfiguration.getdataListParm.parammaps = {}
  243. this.tab1.pageConfiguration.getdataListParm.parammaps.pastureid = this.tab2.pageConfiguration.temp.pastureid
  244. this.tab1.pageConfiguration.getdataListParm.parammaps.id = this.tab1.pageConfiguration.temp.id
  245. this.tab1.pageConfiguration.listLoading = true
  246. this.tab1.pageConfiguration.defaultCheckedKeys = []
  247. GetDataByName(this.tab1.pageConfiguration.getdataListParm).then(response => {
  248. if (response.data.list !== null) {
  249. for (let i = 0; i < response.data.list.length; i++) {
  250. if (parseFloat(response.data.list[i].seebutton) > 0 && response.data.list[i].pid !== -1) {
  251. this.tab1.pageConfiguration.defaultCheckedKeys.push(String(response.data.list[i].menu_id))
  252. }
  253. if (parseFloat(response.data.list[i].seebutton) > 0) {
  254. this.tab1.pageConfiguration.arrList.push(String(response.data.list[i].menu_id))
  255. }
  256. }
  257. this.tab1.pageConfiguration.data = transData(response.data.list, 'id', 'pid', 'children')
  258. console.log(this.tab1.pageConfiguration.data)
  259. console.log(response.data.list)
  260. } else {
  261. this.tab1.pageConfiguration.data = []
  262. }
  263. setTimeout(() => {
  264. this.tab1.pageConfiguration.listLoading = false
  265. }, 1000)
  266. })
  267. },
  268. handelCheckChange(id) {
  269. // this.tab1.pageConfiguration.defaultCheckedKeys = this.$refs.tree.getCheckedKeys()
  270. var checkedKeys = this.$refs.tree.getCheckedKeys()
  271. var options = checkedKeys.map((item) => {
  272. var node = this.$refs.tree.getNode(item) // 所有被选中的节点对应的node
  273. const tmpMap = {}
  274. console.log(node, 'node')
  275. tmpMap.pid = node.parent.key
  276. tmpMap.value = node.key
  277. return tmpMap
  278. })
  279. var selectedData = options.map((item) => {
  280. console.log(item)
  281. return item
  282. })
  283. console.log(selectedData)
  284. var arr = []
  285. for (let i = 0; i < selectedData.length; i++) {
  286. if (selectedData[i].pid !== undefined) {
  287. arr.push(selectedData[i].pid, selectedData[i].value)
  288. } else {
  289. arr.push(selectedData[i].value)
  290. }
  291. }
  292. this.tab1.pageConfiguration.arrList = this.unique(arr)
  293. // this.tab1.pageConfiguration.defaultCheckedKeys = this.unique(arr)
  294. },
  295. unique(arr) {
  296. return Array.from(new Set(arr))
  297. },
  298. handlePageConfiguration(row) {
  299. this.tab2.pageConfiguration.temp = Object.assign({}, row)
  300. console.log('点击了行内页面配置')
  301. this.tab1.pageConfiguration.dialogStatus = 'pageConfiguration'
  302. this.tab1.pageConfiguration.dialogFormVisible = true
  303. this.tab1.pageConfiguration.defaultCheckedKeys = []
  304. this.getPageConfigurationList()
  305. },
  306. pageConfigurationData() {
  307. console.log('牧场页面配置保存')
  308. this.isokDisable = true
  309. setTimeout(() => {
  310. this.isokDisable = false
  311. }, 1000)
  312. this.requestParam = {}
  313. this.requestParam.common = { 'returnmap': '0' }
  314. this.requestParam.data = []
  315. this.requestParam.data[0] = { 'name': 'deletemenuPastureMC', 'type': 'e', 'parammaps': {
  316. 'id': this.tab2.pageConfiguration.temp.id
  317. }}
  318. var list = []
  319. for (let i = 0; i < this.tab1.pageConfiguration.arrList.length; i++) {
  320. list.push({ 'id': this.tab1.pageConfiguration.arrList[i] })
  321. }
  322. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': list }}
  323. this.requestParam.data[1].children = []
  324. this.requestParam.data[1].children[0] = { 'name': 'insertRolepastureMC', 'type': 'e', 'parammaps': {
  325. menuid: '@insertSpotList.id',
  326. id: this.tab2.pageConfiguration.temp.id
  327. }}
  328. ExecDataByConfig(this.requestParam).then(response => {
  329. console.log('页面配置保存发送参数', this.requestParam)
  330. if (response.msg !== 'fail') {
  331. this.tab1.pageConfiguration.dialogFormVisible = false
  332. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  333. this.getList()
  334. } else {
  335. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  336. }
  337. })
  338. },
  339. getList() {
  340. this.tab2.table.listLoading = true
  341. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  342. console.log('table数据', response.data.list)
  343. if (response.data.list !== null) {
  344. for (let i = 0; i < response.data.list.length; i++) {
  345. this.$set(response.data.list[i], 'Edit', false) // 编辑
  346. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  347. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  348. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  349. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  350. }
  351. this.tab2.table.list = response.data.list
  352. this.tab2.table.pageNum = response.data.pageNum
  353. this.tab2.table.pageSize = response.data.pageSize
  354. this.tab2.table.total = response.data.total
  355. } else {
  356. this.tab2.table.list = []
  357. }
  358. setTimeout(() => {
  359. this.tab2.table.listLoading = false
  360. }, 100)
  361. })
  362. },
  363. handleCreate() {
  364. console.log('点击了牧场新增')
  365. // 编辑true/不可编辑false
  366. // 新增操true,编辑false,编辑保存false
  367. for (let i = 0; i < this.tab2.table.list.length; i++) {
  368. if (this.tab2.table.list[i].Edit == true) {
  369. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  370. return false
  371. }
  372. }
  373. this.tab2.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'pasturecode': '', 'phone': '', 'contact': '', 'address': '', 'pasturename': '', 'group': '', 'groupsid': '', 'pasturecode': '' })
  374. },
  375. createData(row) {
  376. console.log('点击了牧场新增保存', row)
  377. // 检验牧场ID/牧场名称是否为空
  378. if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
  379. this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
  380. return false
  381. } else if (row.pasturename == '' && row.user == '') {
  382. this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
  383. return false
  384. } else if (row.pasturecode == '') {
  385. this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
  386. return false
  387. } else if (row.pasturename == '') {
  388. this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
  389. return false
  390. } else if (row.user == '') {
  391. this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
  392. return false
  393. }
  394. this.isokDisable = true
  395. setTimeout(() => {
  396. this.isokDisable = false
  397. }, 1000)
  398. this.requestParam = {}
  399. this.requestParam.common = { 'returnmap': '0' }
  400. this.requestParam.data = []
  401. this.requestParam.data[0] = { 'name': 'checkuser', 'type': 'v', 'parammaps': {
  402. 'user': row.user
  403. }}
  404. this.requestParam.data[1] = { 'name': 'insertPasture', 'type': 'e', 'parammaps': {
  405. 'pasturecode': row.pasturecode,
  406. 'pasturename': row.pasturename,
  407. 'groupsid': row.groupsid,
  408. 'user': row.user,
  409. 'note': row.note,
  410. 'enable': row.enable,
  411. 'emp': row.emp,
  412. 'phone': row.phone,
  413. 'address': row.address
  414. }}
  415. this.requestParam.data[2] = { 'name': 'createNewPasture', 'type': 'e', 'parammaps': {
  416. 'user': row.user,
  417. 'pastureid': '@insertPasture.LastInsertId',
  418. 'type': '0'
  419. }}
  420. ExecDataByConfig(this.requestParam).then(response => {
  421. console.log('新增保存发送参数', this.requestParam)
  422. if (response.msg !== 'fail') {
  423. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  424. this.getList()
  425. } else {
  426. const tId = new RegExp("column 'id'")
  427. if (tId.test(response.data)) {
  428. this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
  429. } else {
  430. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  431. }
  432. }
  433. })
  434. },
  435. handleUpdate(row) {
  436. console.log('点击了牧场编辑', row)
  437. for (let i = 0; i < this.tab2.table.list.length; i++) {
  438. if (this.tab2.table.list[i].Edit == true) {
  439. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  440. return false
  441. }
  442. }
  443. // 编辑true,不可编辑false
  444. row.Edit = true
  445. row.NoEdit = false
  446. // 新增false,编辑false,编辑保存true
  447. row.isCreate = false
  448. row.isUpdate = false
  449. row.isUpdateSave = true
  450. if (row.groupsid !== undefined) {
  451. row.groupsid = String(row.groupsid)
  452. }
  453. },
  454. updateData(row) {
  455. console.log('点击了牧场编辑保存')
  456. // 检验牧场ID/牧场名称是否为空
  457. if (row.pasturecode == '' && row.pasturename == '' && row.user == '') {
  458. this.$message({ type: 'error', message: '牧场ID/牧场名称/管理员用户名不能为空', duration: 2000 })
  459. return false
  460. } else if (row.pasturename == '' && row.user == '') {
  461. this.$message({ type: 'error', message: '牧场名称/管理员用户名不能为空', duration: 2000 })
  462. return false
  463. } else if (row.pasturecode == '') {
  464. this.$message({ type: 'error', message: '牧场ID不能为空', duration: 2000 })
  465. return false
  466. } else if (row.pasturename == '') {
  467. this.$message({ type: 'error', message: '牧场名称不能为空', duration: 2000 })
  468. return false
  469. } else if (row.user == '') {
  470. this.$message({ type: 'error', message: '管理员用户名不能为空', duration: 2000 })
  471. return false
  472. }
  473. this.isokDisable = true
  474. setTimeout(() => {
  475. this.isokDisable = false
  476. }, 1000)
  477. this.requestParam = {}
  478. this.requestParam.common = { 'returnmap': '0' }
  479. this.requestParam.data = []
  480. this.requestParam.data[0] = { 'name': 'updatePasture', 'type': 'e', 'parammaps': {
  481. 'id': row.id,
  482. 'pasturecode': row.pasturecode,
  483. 'pasturename': row.pasturename,
  484. 'groupsid': row.groupsid,
  485. 'user': row.user,
  486. 'note': row.note,
  487. 'enable': row.enable,
  488. 'emp': row.emp,
  489. 'phone': row.phone,
  490. 'address': row.address
  491. }}
  492. this.requestParam.data[1] = { 'name': 'updateUserName', 'type': 'e', 'parammaps': {
  493. 'id': row.id,
  494. 'userold': row.userold,
  495. 'user': row.user
  496. }}
  497. ExecDataByConfig(this.requestParam).then(response => {
  498. console.log('编辑保存发送参数', this.requestParam)
  499. if (response.msg !== 'fail') {
  500. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  501. this.getList()
  502. } else {
  503. const tId = new RegExp("column 'id'")
  504. if (tId.test(response.data)) {
  505. this.$notify({ title: '保存失败', message: '集团已存在,不可重复生成', type: 'warning', duration: 2000 })
  506. } else {
  507. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  508. }
  509. }
  510. })
  511. }
  512. }
  513. }
  514. </script>
  515. <style lang="scss" scoped>
  516. .table{margin-top:10px;}
  517. .inside-base {
  518. position: relative;
  519. }
  520. .inside-base-main {
  521. width: 100%;
  522. background: #ffffff;
  523. box-shadow: 0px 0px 10px 0px rgba(231,232,238,1);
  524. border-radius: 4px;
  525. margin-bottom: 30px;
  526. }
  527. // 中间内容
  528. .inside-base-cont {
  529. margin: 0 20px;
  530. }
  531. .role-cont {
  532. position: relative;
  533. font-size: 16px;
  534. color: #333333;
  535. line-height: 40px;
  536. > span {
  537. width: 90px;
  538. height: 40px;
  539. text-align: right;
  540. float: left;
  541. margin-right: 10px;
  542. margin-bottom: 20px;
  543. }
  544. > div {
  545. position: relative;
  546. width: 100%;
  547. float: left;
  548. margin-bottom: 20px;
  549. >>> .el-input__inner {
  550. width: 320px;
  551. }
  552. }
  553. }
  554. .check-page-all {
  555. position: absolute;
  556. top: 13px;
  557. left: 11px;
  558. z-index: 99;
  559. }
  560. /* element-ui css */
  561. .inside-base {
  562. >>> .el-input__inner {
  563. font-size: 16px;
  564. color: #333333;
  565. }
  566. }
  567. </style>