user-attributes.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <!--
  2. * @Author: Liugh
  3. * @Date: 2021-05-17 14:52:53
  4. * @LastEditTime: 2021-05-18 14:06:47
  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-item label="最近同步时间:" style="float:right">
  38. <span>2021-04-08 12:00:00</span>
  39. </el-form-item>
  40. </el-form>
  41. <div class="buttonGroup">
  42. <dg-button type="primary" @click="handleLeading" icon="el-icon-upload2">导入</dg-button>
  43. <dg-button type="primary" @click="handleSynchro" icon="el-icon-refresh">同步</dg-button>
  44. <dg-button type="text" @click="handleInfo">详情</dg-button>
  45. </div>
  46. <Table ref="myTable" :url="tableUrl" :headerData="UserTableData" :condition="reportForm">
  47. <dg-table-column fixed="right" label="操作" align="center">
  48. <template>
  49. <dg-button type="text" @click="handleInfo">详情</dg-button>
  50. </template>
  51. </dg-table-column>
  52. </Table>
  53. </main>
  54. </template>
  55. <script>
  56. import Table from "@/pages/common/table";
  57. import { ApplicationTableData } from "../DataConfig";
  58. import * as dynamicManageApi from "@/api/dynamic-manage";
  59. import detail from "./detail";
  60. const editorArea = ["900px", "660px"];
  61. export default {
  62. name: "user-attributes", // 组件名称
  63. props: {
  64. // 接收父组件的数据
  65. },
  66. data() {
  67. // 组件内部参数
  68. return {
  69. // 参数名称及默认值
  70. form: {},
  71. rules: {},
  72. options: [
  73. {
  74. id: "fruits",
  75. label: "Fruits",
  76. children: [
  77. {
  78. id: "apple",
  79. label: "Apple",
  80. isNew: true
  81. },
  82. {
  83. id: "grapes",
  84. label: "Grapes",
  85. disabled: true
  86. },
  87. {
  88. id: "pear",
  89. label: "Pear"
  90. },
  91. {
  92. id: "strawberry",
  93. label: "Strawberry 🍓"
  94. },
  95. {
  96. id: "watermelon",
  97. label: "Watermelon 🍉"
  98. }
  99. ]
  100. },
  101. {
  102. id: "vegetables",
  103. label: "Vegetables",
  104. children: [
  105. {
  106. id: "corn",
  107. label: "Corn 🌽"
  108. },
  109. {
  110. id: "carrot",
  111. label: "Carrot 🥕"
  112. },
  113. {
  114. id: "eggplant",
  115. label: "Eggplant 🍆"
  116. },
  117. {
  118. id: "tomato",
  119. label: "Tomato 🍅"
  120. }
  121. ]
  122. }
  123. ],
  124. UserTableData,
  125. tableUrl: dynamicManageApi.tableUrl,
  126. reportForm: {}
  127. };
  128. },
  129. computed: {}, // 计算属性
  130. watch: {}, // 侦听器(扩展的计算属性)
  131. components: { Table }, // 注册局部组件
  132. methods: {
  133. /**
  134. * @description:表单查询方法
  135. */
  136. handleSearch() {},
  137. /**
  138. * @description:导入方法
  139. */
  140. handleLeading() {},
  141. /**
  142. * @description:同步方法
  143. */
  144. handleSynchro() {},
  145. /**
  146. * @description:详情
  147. */
  148. handleInfo() {
  149. const layer = this.$dgLayer({
  150. title: "警员详情",
  151. shade: [0.4, "#FFF"],
  152. content: detail,
  153. props: {},
  154. on: {
  155. success() {
  156. layer.close(layer.dialogIndex);
  157. }
  158. },
  159. area: editorArea
  160. });
  161. }
  162. }, // 内部方法
  163. beforeCreate() {}, // 组件创建前
  164. created() {}, // 组件创建完成后
  165. beforeMount() {}, // 组件挂载前
  166. mounted() {}, // 组件挂载完成后
  167. beforeUpdate() {}, // 组件更新前
  168. updated() {}, // 组件挂载完成后
  169. beforeDestroy() {}, // 组件销毁前
  170. destroyed() {} // 组件销毁完成后
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. @import "../index.scss";
  175. </style>