user-attributes.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!--
  2. * @Author: Liugh
  3. * @Date: 2021-05-17 14:52:53
  4. * @LastEditTime: 2021-05-18 09:45:46
  5. * @LastEditors: Do not edit
  6. * @Description:
  7. -->
  8. <template>
  9. <main class="user-attributes">
  10. <el-form ref="ruleForm" inline :rules="rules" :model="form">
  11. <el-form-item label="用户类别">
  12. <el-select v-model="form.userType" placeholder="请选择用户类别">
  13. <el-option label="警员" value="shanghai"></el-option>
  14. <el-option label="辅警" value="beijing"></el-option>
  15. <el-option label="施工人员" value="beijing"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="姓名">
  19. <el-input v-model="form.name" placeholder="请输入姓名"></el-input>
  20. </el-form-item>
  21. <el-form-item label="身份证号">
  22. <el-input v-model="form.idCard" placeholder="请输入身份证号"></el-input>
  23. </el-form-item>
  24. <el-form-item label="所属机构">
  25. <dg-tree-select
  26. v-model="form.institution"
  27. placeholder="请选择所属机构"
  28. :data="options"
  29. clearable
  30. filterable
  31. multiple
  32. ></dg-tree-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <dg-button type="primary" @click="handleSearch" icon="el-icon-search">查询</dg-button>
  36. </el-form-item>
  37. </el-form>
  38. <div class="buttonGroup">
  39. <dg-button type="primary" @click="handleLeading" icon="el-icon-upload2">导入</dg-button>
  40. <dg-button type="primary" @click="handleSynchro" icon="el-icon-refresh">同步</dg-button>
  41. <dg-button type="text" @click="handleInfo">详情</dg-button>
  42. </div>
  43. <Table ref="myTable" :url="tableUrl" :headerData="UserTableData" :condition="reportForm">
  44. <dg-table-column fixed="right" label="操作" align="center">
  45. <template>
  46. <dg-button type="text" @click="handleInfo">详情</dg-button>
  47. </template>
  48. </dg-table-column>
  49. </Table>
  50. </main>
  51. </template>
  52. <script>
  53. import Table from "@/pages/common/table";
  54. import { UserTableData } from "../DataConfig";
  55. import * as dynamicManageApi from "@/api/dynamic-manage";
  56. import detail from "./detail";
  57. const editorArea = ["900px", "660px"];
  58. export default {
  59. name: "user-attributes", // 组件名称
  60. props: {
  61. // 接收父组件的数据
  62. },
  63. data() {
  64. // 组件内部参数
  65. return {
  66. // 参数名称及默认值
  67. form: {},
  68. rules: {},
  69. options: [
  70. {
  71. id: "fruits",
  72. label: "Fruits",
  73. children: [
  74. {
  75. id: "apple",
  76. label: "Apple",
  77. isNew: true
  78. },
  79. {
  80. id: "grapes",
  81. label: "Grapes",
  82. disabled: true
  83. },
  84. {
  85. id: "pear",
  86. label: "Pear"
  87. },
  88. {
  89. id: "strawberry",
  90. label: "Strawberry 🍓"
  91. },
  92. {
  93. id: "watermelon",
  94. label: "Watermelon 🍉"
  95. }
  96. ]
  97. },
  98. {
  99. id: "vegetables",
  100. label: "Vegetables",
  101. children: [
  102. {
  103. id: "corn",
  104. label: "Corn 🌽"
  105. },
  106. {
  107. id: "carrot",
  108. label: "Carrot 🥕"
  109. },
  110. {
  111. id: "eggplant",
  112. label: "Eggplant 🍆"
  113. },
  114. {
  115. id: "tomato",
  116. label: "Tomato 🍅"
  117. }
  118. ]
  119. }
  120. ],
  121. UserTableData,
  122. tableUrl: dynamicManageApi.tableUrl,
  123. reportForm: {}
  124. };
  125. },
  126. computed: {}, // 计算属性
  127. watch: {}, // 侦听器(扩展的计算属性)
  128. components: { Table }, // 注册局部组件
  129. methods: {
  130. /**
  131. * @description:表单查询方法
  132. */
  133. handleSearch() {},
  134. /**
  135. * @description:导入方法
  136. */
  137. handleLeading() {},
  138. /**
  139. * @description:同步方法
  140. */
  141. handleSynchro() {},
  142. /**
  143. * @description:详情
  144. */
  145. handleInfo() {
  146. const layer = this.$dgLayer({
  147. title: "警员详情",
  148. shade: [0.4, "#FFF"],
  149. content: detail,
  150. props: {},
  151. on: {
  152. success() {
  153. layer.close(layer.dialogIndex);
  154. }
  155. },
  156. area: editorArea
  157. });
  158. }
  159. }, // 内部方法
  160. beforeCreate() {}, // 组件创建前
  161. created() {}, // 组件创建完成后
  162. beforeMount() {}, // 组件挂载前
  163. mounted() {}, // 组件挂载完成后
  164. beforeUpdate() {}, // 组件更新前
  165. updated() {}, // 组件挂载完成后
  166. beforeDestroy() {}, // 组件销毁前
  167. destroyed() {} // 组件销毁完成后
  168. };
  169. </script>
  170. <style lang="scss" scoped>
  171. @import "../index.scss";
  172. </style>