labelList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <template>
  2. <div class="container">
  3. <fullscreen :fullscreen.sync="fullscreen" class="container-box">
  4. <div class="titbox">
  5. <h2 class="font-ui">用户投诉标签管理</h2>
  6. <div>
  7. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  8. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  9. <!-- <i class="el-icon-folder-opened"></i>-->
  10. <!-- <i class="el-icon-view"></i>-->
  11. <!-- <i class="el-icon-more"></i>-->
  12. </div>
  13. </div>
  14. <div class="search">
  15. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  16. <el-button
  17. class="btn-check"
  18. size="medium"
  19. type="primary"
  20. @click="addRule()"
  21. >添加
  22. </el-button>
  23. </div>
  24. <div class="tabbox">
  25. <el-table
  26. height="calc(100% - 40px)"
  27. v-loading="loading"
  28. class="com-table"
  29. ref="multipleTable"
  30. :data="tableData"
  31. tooltip-effect="dark"
  32. size="small"
  33. border
  34. style="width: 100%"
  35. >
  36. <el-table-column prop="roleCode" label="标签名称"> </el-table-column>
  37. <el-table-column prop="roleName" label="配置工号"> </el-table-column>
  38. <el-table-column prop="opName" label="配置姓名"> </el-table-column>
  39. <el-table-column prop="opName" label="配置时间"> </el-table-column>
  40. <el-table-column label="操作" align="center">
  41. <template slot-scope="scope">
  42. <el-button
  43. size="mini"
  44. type="primary"
  45. plain
  46. @click="updateUser(scope.row)"
  47. >编辑</el-button
  48. >
  49. <el-button
  50. size="mini"
  51. type="danger"
  52. plain
  53. @click="delLine(scope.row)"
  54. >删除</el-button
  55. >
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <el-pagination
  60. class="pageBox"
  61. @current-change="currchange"
  62. layout="prev, pager, next"
  63. background
  64. :total="total"
  65. >
  66. </el-pagination>
  67. </div>
  68. </fullscreen>
  69. <el-dialog
  70. :title="titname"
  71. :visible.sync="dialogStatus"
  72. width="50%"
  73. :close-on-press-escape="false"
  74. :show-close="false"
  75. :destroy-on-close="true"
  76. :modal-append-to-body="false"
  77. :close-on-click-modal="false"
  78. >
  79. <p-form
  80. ref="pForm"
  81. @closeDialog="closeDialog"
  82. :formData="formData"
  83. :form="form"
  84. ></p-form>
  85. <div slot="footer" class="dialog-footer">
  86. <el-button @click="resetUser('ruleForm')">取 消</el-button>
  87. <el-button v-show="subBtn" @click="subUser('ruleForm')"
  88. >确 定</el-button
  89. >
  90. </div>
  91. </el-dialog>
  92. </div>
  93. </template>
  94. <script>
  95. import pForm from "../../../components/p-form";
  96. import mySearch from "../../../components/search";
  97. export default {
  98. components: {
  99. mySearch,
  100. pForm,
  101. },
  102. data() {
  103. return {
  104. loading: false,
  105. defaultProps: {
  106. children: "children",
  107. label: "functionName",
  108. },
  109. menuStatus: false,
  110. formData: {
  111. roleName: "",
  112. id: "",
  113. },
  114. form: {
  115. action: false,
  116. formName: "ruleForm",
  117. labelWidth: "80px",
  118. formStyle: "width: 80%; margin: 0 auto",
  119. initUrl: "/sysmgr/sys/login/addInit", // 初始化接口
  120. url: "", // 提交接口
  121. id: "", // 编辑时用的id 由初始化时获取
  122. type: "post", // 请求方式
  123. params: "", // get请求桉树
  124. events: function () {
  125. // 回调方法
  126. // $vm.$router.push("/leader");
  127. },
  128. body: [
  129. // 渲染表单
  130. {
  131. el: "input", // dom类型
  132. placeholder: "请输入标签名称", // 提示语
  133. label: "标签名称", // 表单title
  134. value: "roleName", // 表单model绑定的值
  135. disabled: false,
  136. clearable: true,
  137. rules: [
  138. // 校验
  139. {
  140. required: true,
  141. message: "请输入标签名称",
  142. trigger: "blur",
  143. },
  144. ],
  145. },
  146. ],
  147. },
  148. inputType: "password",
  149. subBtn: true,
  150. fullscreen: false,
  151. total: 0,
  152. pageSize: 1,
  153. tableData: [],
  154. dialogStatus: false,
  155. titname: "",
  156. disableStatus: false,
  157. searchList: [
  158. {
  159. type: "input",
  160. tit: "标签名称",
  161. value: "",
  162. width: "100%",
  163. options: [],
  164. },
  165. {
  166. type: "input",
  167. tit: "配置工号",
  168. value: "",
  169. width: "100%",
  170. options: [],
  171. },
  172. ],
  173. params: {},
  174. checkedMenu: [], // 选中节点的functionCode
  175. checkedNodes: [], // 选中节点的node值
  176. roleData: "", // 某一条数据
  177. };
  178. },
  179. methods: {
  180. // 提交
  181. subMenu() {
  182. this.$http({
  183. url: "/sysmgr/sys/settings/sysRoleFuncs/updateFunc",
  184. method: "post",
  185. headers: {
  186. "Content-Type": "application/json",
  187. },
  188. data: {
  189. roleCode: this.roleData.roleCode,
  190. roleName: this.roleData.roleName,
  191. funcList: this.checkedNodes,
  192. },
  193. }).then((res) => {
  194. if (res.data.result == 0) {
  195. this.$notify({
  196. title: "成功",
  197. message: res.data.desc,
  198. type: "success",
  199. });
  200. this.menuStatus = false;
  201. this.getList(this.params, this.pageSize);
  202. }
  203. });
  204. },
  205. // 修改弹窗
  206. updateUser(val) {
  207. this.titname = "修改角色";
  208. this.subBtn = true;
  209. this.$http({
  210. url: "/sysmgr/sys/settings/sysRoleInfo/query",
  211. method: "post",
  212. headers: {
  213. "Content-Type": "application/json",
  214. },
  215. data: {
  216. id: val.id,
  217. roleCode: "",
  218. roleName: "",
  219. },
  220. }).then((res) => {
  221. this.formData = res.data;
  222. });
  223. this.dialogStatus = true;
  224. },
  225. // 增加表单处理
  226. subUser(formName) {
  227. this.titname == "修改角色"
  228. ? (this.form.url = "/sysmgr/sys/settings/sysRoleInfo/update")
  229. : (this.form.url = "/sysmgr/sys/settings/sysRoleInfos/add");
  230. this.$refs.pForm.submitForm(this.form.formName);
  231. },
  232. // 取消提交
  233. resetUser() {
  234. this.$refs.pForm.resetForm(this.form.formName);
  235. },
  236. closeDialog() {
  237. console.log("adasd");
  238. this.dialogStatus = false;
  239. this.getList(this.params, this.pageSize);
  240. },
  241. // 增加弹窗
  242. addRule() {
  243. this.titname = "增加角色";
  244. this.subBtn = true;
  245. this.dialogStatus = true;
  246. },
  247. //搜索数据
  248. searchInfo(v) {
  249. this.params = {};
  250. v[0] ? (this.params.roleName = v[0]) : "";
  251. this.getList(this.params, this.pageSize);
  252. },
  253. //获取列表
  254. getList(v, n) {
  255. this.pageSize = n;
  256. this.loading = true;
  257. this.$http({
  258. url: "/sysmgr/sys/settings/sysRoleInfo/queryPage",
  259. method: "post",
  260. headers: {
  261. "Content-Type": "application/json",
  262. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  263. },
  264. data: v,
  265. }).then((res) => {
  266. this.loading = false;
  267. this.tableData = res.data.data;
  268. this.total = res.data.totalRecord;
  269. });
  270. },
  271. //功能栏
  272. iconCli(v) {
  273. if (v === 1) {
  274. this.getList(this.params, this.pageSize);
  275. }
  276. if (v === 2) {
  277. this.fullscreen = !this.fullscreen;
  278. }
  279. },
  280. // 分页
  281. currchange(v) {
  282. this.pageSize = v;
  283. this.getList(this.params, this.pageSize);
  284. },
  285. //删除
  286. delLine(v) {
  287. this.$confirm("即将删除此条数据, 是否删除?", "提示", {
  288. confirmButtonText: "确定",
  289. cancelButtonText: "取消",
  290. type: "warning",
  291. })
  292. .then(() => {
  293. console.log(v);
  294. this.$http({
  295. url: "/sysmgr/sys/settings/sysRoleInfo/del",
  296. method: "post",
  297. headers: {
  298. "Content-Type": "application/json",
  299. },
  300. data: {
  301. id: v.id,
  302. },
  303. }).then((res) => {
  304. if (res.data.result == 0) {
  305. this.$notify({
  306. title: "成功",
  307. message: res.data.desc,
  308. type: "success",
  309. });
  310. this.getList(this.params, this.pageSize);
  311. }
  312. });
  313. })
  314. .catch(() => {});
  315. },
  316. },
  317. mounted() {
  318. this.getList(this.params, this.pageSize);
  319. },
  320. created() {},
  321. };
  322. </script>
  323. <style>
  324. .el-input__suffix {
  325. cursor: pointer;
  326. }
  327. </style>
  328. <style scoped lang="scss">
  329. .titbox {
  330. div {
  331. float: right;
  332. i {
  333. font-size: 22px;
  334. margin-left: 20px;
  335. cursor: pointer;
  336. }
  337. }
  338. }
  339. .tabbox {
  340. margin-top: 15px;
  341. }
  342. .pageBox {
  343. text-align: right;
  344. margin-top: 10px;
  345. }
  346. </style>
  347. <style lang="scss">
  348. .tree-line-style {
  349. .el-tree-node__content {
  350. padding-left: 0 !important;
  351. }
  352. .el-tree-node__expand-icon.is-leaf {
  353. display: none !important;
  354. }
  355. .el-tree-node {
  356. position: relative;
  357. padding-left: 16px; // 缩进量
  358. }
  359. .el-tree-node__children {
  360. padding-left: 16px; // 缩进量
  361. }
  362. // 竖线
  363. .el-tree-node::before {
  364. content: "";
  365. height: 100%;
  366. width: 1px;
  367. position: absolute;
  368. left: -3px;
  369. top: -17px;
  370. border-width: 1px;
  371. border-left: 1px dashed #52627c;
  372. }
  373. // 当前层最后一个节点的竖线高度固定
  374. .el-tree-node:last-child::before {
  375. height: 38px; // 可以自己调节到合适数值
  376. }
  377. // 横线
  378. .el-tree-node::after {
  379. content: "";
  380. width: 24px;
  381. height: 20px;
  382. position: absolute;
  383. left: -3px;
  384. top: 20px;
  385. border-width: 1px;
  386. border-top: 1px dashed #52627c;
  387. }
  388. // 去掉最顶层的虚线,放最下面样式才不会被上面的覆盖了
  389. & > .el-tree-node::after {
  390. border-top: none;
  391. }
  392. & > .el-tree-node::before {
  393. border-left: none;
  394. }
  395. // 展开关闭的icon
  396. .el-tree-node__expand-icon {
  397. font-size: 16px;
  398. // 叶子节点(无子节点)
  399. &.is-leaf {
  400. color: transparent;
  401. // display: none; // 也可以去掉
  402. }
  403. }
  404. }
  405. </style>