多媒体信息发布平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
8.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索栏 -->
  4. <div class="head-container">
  5. <el-row type="flex">
  6. <el-col :span="20" class="col_flex">
  7. <div class="form_item">
  8. <span>状态</span>
  9. <el-select v-model="query.state" size="small" class="filter-item" style="width: 120px">
  10. <el-option
  11. v-for="item in stateData"
  12. :key="item.key"
  13. :label="item.name"
  14. :value="item.key"
  15. />
  16. </el-select>
  17. </div>
  18. <div class="form_item">
  19. <span>设备ID</span>
  20. <el-input
  21. v-model="query.blurry"
  22. clearable
  23. size="small"
  24. placeholder="请输入设备ID"
  25. style="width: 200px"
  26. class="filter-item"
  27. @keyup.enter.native="crud.toQuery"
  28. />
  29. </div>
  30. <div class="form_item">
  31. <span>设备名称</span>
  32. <el-input
  33. v-model="query.blurry"
  34. clearable
  35. size="small"
  36. placeholder="请输入设备名称"
  37. style="width: 200px"
  38. class="filter-item"
  39. @keyup.enter.native="crud.toQuery"
  40. />
  41. </div>
  42. <rrOperation />
  43. </el-col>
  44. <el-col class="page_add" :span="4">
  45. <el-button class="table_add clear_btn" plain disabled>清空</el-button>
  46. </el-col>
  47. </el-row>
  48. </div>
  49. <!-- table -->
  50. <el-row :gutter="15">
  51. <el-col>
  52. <el-table
  53. style="width: 100%;"
  54. :data="tableData"
  55. :header-cell-style="{ background: '#3a8aeb', color: '#fff' }"
  56. >
  57. <el-table-column :selectable="checkboxT" type="selection" width="55" />
  58. <el-table-column prop="id" label="设备ID" align="center" />
  59. <el-table-column prop="account" label="设备账号" align="center" />
  60. <el-table-column prop="name" label="设备名称" align="center" />
  61. <el-table-column prop="orientation" label="设备方向" align="center" />
  62. <el-table-column prop="organization" label="所属机构" align="center" />
  63. <el-table-column prop="isDel" label="设备状态" align="center">
  64. <template slot-scope="scope">
  65. <div>{{ scope.row.isDel ? '在线' : '离线' }}</div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="content" label="发布内容" align="center">
  69. <template slot-scope="scope">
  70. <el-button type="text" size="small" @click="handleClick(scope.row)">查看</el-button>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="date" label="创建时间" align="center" width="160" />
  74. <el-table-column fixed="right" label="操作" align="center" width="120">
  75. <template slot-scope="scope">
  76. <el-button
  77. type="primary"
  78. class="edit_btn"
  79. @click="editFormData(scope.$index, scope.row)"
  80. >编辑</el-button>
  81. <el-button type="danger" class="record_btn">记录</el-button>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <!--分页组件-->
  86. <pagination />
  87. </el-col>
  88. </el-row>
  89. <!-- 编辑设备 -->
  90. <div class="layer">
  91. <el-dialog
  92. :title="dialogTitle"
  93. :close-on-click-modal="false"
  94. :visible.sync="addFromVisible"
  95. width="576px"
  96. >
  97. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  98. <el-form-item label="设备账号" prop="account">
  99. <el-input v-model="form.account" autocomplete="off" disabled />
  100. </el-form-item>
  101. <el-form-item label="设备名称" prop="name">
  102. <el-input v-model="form.name" />
  103. </el-form-item>
  104. <el-form-item label="设备方向" prop="orientation">
  105. <el-select v-model="form.orientation" size="small" class="filter-item">
  106. <el-option
  107. v-for="item in deviceData"
  108. :key="item.key"
  109. :label="item.name"
  110. :value="item.key"
  111. />
  112. </el-select>
  113. </el-form-item>
  114. </el-form>
  115. <div slot="footer" class="dialog-footer">
  116. <el-button type="primary" round @click="submitForm('form')"> </el-button>
  117. <el-button round @click="addFromVisible = false"> </el-button>
  118. </div>
  119. </el-dialog>
  120. </div>
  121. <div class="publish_layer">
  122. <el-dialog
  123. title="发布内容"
  124. :close-on-click-modal="false"
  125. :visible.sync="contentVisible"
  126. width="970px"
  127. height="590px"
  128. >
  129. <div class="content_warp">
  130. <h4>图片</h4>
  131. <ul class="item_list">
  132. <li class="item_cont">
  133. <img src="@/assets/images/background.jpg" alt />
  134. <div class="item_format">
  135. <span class="item_type">JPG</span>
  136. </div>
  137. <div class="file_name">人工智能</div>
  138. </li>
  139. </ul>
  140. <h4>视频</h4>
  141. <ul class="item_list">
  142. <li class="item_cont">
  143. <img src="@/assets/images/background.jpg" alt />
  144. <div class="item_format">
  145. <span class="item_type">Video</span>
  146. <span class="item_time">03:00</span>
  147. </div>
  148. <div class="file_name">防控疫情小贴士</div>
  149. </li>
  150. </ul>
  151. <h4>音频</h4>
  152. <ul class="item_list">
  153. <li class="item_cont">
  154. <div class="radio_img"></div>
  155. <div class="item_format">
  156. <span class="item_type">Video</span>
  157. <span class="item_time">03:00</span>
  158. </div>
  159. <div class="file_name">防控疫情小贴士</div>
  160. </li>
  161. </ul>
  162. </div>
  163. </el-dialog>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. import crudUser from '@/api/system/user'
  169. import CRUD, { presenter, header, form, crud } from '@crud/crud'
  170. import rrOperation from '@crud/RR.operation'
  171. import pagination from '@crud/Pagination'
  172. const defaultForm = {
  173. account: null,
  174. name: null,
  175. orientation: null
  176. }
  177. export default {
  178. name: 'Device',
  179. components: { rrOperation, pagination },
  180. cruds() {
  181. return CRUD({
  182. title: '用户',
  183. url: 'api/users',
  184. crudMethod: { ...crudUser }
  185. })
  186. },
  187. mixins: [presenter(), header(), form(defaultForm), crud()],
  188. data() {
  189. return {
  190. dialogTitle: '',
  191. addFromVisible: false,
  192. contentVisible: false,
  193. tableData: [
  194. {
  195. id: 'XXXXXXXXX',
  196. account: '13476289682',
  197. name: 'GCXR2',
  198. orientation: '竖屏',
  199. organization: 'xx图书馆',
  200. content: '',
  201. date: '2021-09-14 16:35'
  202. }
  203. ],
  204. stateData: [{ key: '0', name: '全部' }, { key: '1', name: '在线' }, { key: '2', name: '离线' }],
  205. deviceData: [{ key: '0', name: '竖屏' }, { key: '1', name: '横屏' }],
  206. rules: {
  207. name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }, { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }],
  208. orientation: [{ required: true, message: '请选择设备方向', trigger: 'change' }]
  209. }
  210. }
  211. },
  212. computed: {},
  213. watch: {},
  214. methods: {
  215. // 编辑
  216. editFormData(index, row) {
  217. this.dialogTitle = '编辑设备'
  218. this.addFromVisible = true
  219. this.form.account = row.account
  220. this.form.name = row.name
  221. },
  222. // 查看
  223. handleClick(row) {
  224. console.log(row)
  225. this.contentVisible = true
  226. },
  227. submitForm(formName) {
  228. this.$refs[formName].validate(valid => {
  229. if (valid) {
  230. alert('submit!')
  231. } else {
  232. console.log('error submit!!')
  233. return false
  234. }
  235. })
  236. }
  237. }
  238. }
  239. </script>
  240. <style lang="scss" scoped>
  241. .clear_btn {
  242. color: #3a8aeb;
  243. border-color: #3a8aeb;
  244. }
  245. .publish_layer {
  246. ::v-deep .el-dialog__body {
  247. padding: 0 20px 30px 20px;
  248. height: 590px;
  249. overflow-y: auto;
  250. }
  251. }
  252. .content_warp {
  253. padding-top: 16px;
  254. h4 {
  255. margin: 6px 0 16px 0;
  256. font-size: 16px;
  257. color: #333;
  258. }
  259. }
  260. </style>