多媒体信息发布平台
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.

345 lines
11 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
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
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="queryInfo.device_id"
  22. clearable
  23. size="small"
  24. placeholder="请输入设备ID"
  25. style="width: 200px"
  26. class="filter-item"
  27. @clear="getDevice"
  28. @blur="queryDevice(queryInfo.device_id)"
  29. @keyup.enter.native='queryDevice(queryInfo.device_id)'
  30. />
  31. </div>
  32. <div class="form_item">
  33. <span>设备名称</span>
  34. <el-input
  35. v-model="queryInfo.device_name"
  36. clearable
  37. size="small"
  38. placeholder="请输入设备名称"
  39. style="width: 200px"
  40. class="filter-item"
  41. @clear="getDevice"
  42. @blur="getDevice"
  43. @keyup.enter.native="getDevice"
  44. />
  45. </div>
  46. </el-col>
  47. <el-col class="page_add" :span="4">
  48. <el-button class="table_add clear_btn" plain disabled>清空</el-button>
  49. </el-col>
  50. </el-row>
  51. </div>
  52. <!-- table :data="deviceList"-->
  53. <el-row :gutter="15">
  54. <el-col>
  55. <el-table
  56. style="width: 100%;"
  57. :data="deviceList"
  58. :header-cell-style="{ background: '#3a8aeb', color: '#fff' }"
  59. >
  60. <el-table-column type="selection" width="55" />
  61. <el-table-column prop="device_id" label="设备ID" align="center" />
  62. <el-table-column prop="device_account" label="设备账号" align="center" />
  63. <el-table-column prop="device_name" label="设备名称" align="center" />
  64. <el-table-column label="设备方向" align="center" >
  65. <template slot-scope="{row}">
  66. <div>{{row.device_direction==1? '竖屏' : '横屏' }}</div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="organ_name" label="所属机构" align="center"/> >
  70. <el-table-column prop="isDel" label="设备状态" align="center">
  71. <template slot-scope="scope">
  72. <div>{{ scope.row.isDel ? '在线' : '离线' }}</div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="content" label="发布内容" align="center">
  76. <template slot-scope="scope">
  77. <el-button type="text" size="small" @click="handleClick(scope.row)">查看</el-button>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="create_time" label="创建时间" align="center" width="160" >
  81. <template slot-scope="{row}">
  82. <div>{{ row.create_time | parseTime}}</div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column fixed="right" label="操作" align="center" width="160">
  86. <template slot-scope="scope">
  87. <el-button
  88. type="primary"
  89. class="edit_btn"
  90. @click="editFormData(scope.row)"
  91. >编辑</el-button>
  92. <el-button type="danger" class="record_btn" @click="recordData(scope.$index, scope.row)">记录</el-button>
  93. <el-button type="danger">解绑</el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </el-col>
  98. </el-row>
  99. <!-- 编辑设备 -->
  100. <div class="layer">
  101. <el-dialog
  102. :title="dialogTitle"
  103. :close-on-click-modal="false"
  104. :show-close="false"
  105. :visible.sync="addFromVisible"
  106. width="576px"
  107. >
  108. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  109. <el-form-item label="设备账号" prop="account">
  110. <el-input v-model="form.account" autocomplete="off" disabled />
  111. </el-form-item>
  112. <el-form-item label="设备名称" prop="name">
  113. <el-input v-model="form.name" />
  114. </el-form-item>
  115. <el-form-item label="设备方向" prop="orientation">
  116. <el-select v-model="form.orientation" size="small" class="filter-item">
  117. <el-option
  118. v-for="item in deviceData"
  119. :key="item.key"
  120. :label="item.name"
  121. :value="item.key"
  122. />
  123. </el-select>
  124. </el-form-item>
  125. </el-form>
  126. <div slot="footer" class="dialog-footer">
  127. <el-button type="primary" round @click="submitForm('form')"> </el-button>
  128. <el-button round @click="addFromVisible = false"> </el-button>
  129. </div>
  130. </el-dialog>
  131. </div>
  132. <div class="publish_layer">
  133. <el-dialog
  134. title="发布内容"
  135. :close-on-click-modal="false"
  136. :visible.sync="contentVisible"
  137. width="970px"
  138. height="590px"
  139. >
  140. <div class="content_warp">
  141. <h4>图片</h4>
  142. <ul class="item_list">
  143. <li class="item_cont">
  144. <img src="@/assets/images/background.jpg" alt />
  145. <div class="item_format">
  146. <span class="item_type">JPG</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. <img src="@/assets/images/background.jpg" alt />
  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. <h4>音频</h4>
  163. <ul class="item_list">
  164. <li class="item_cont">
  165. <div class="radio_img"></div>
  166. <div class="item_format">
  167. <span class="item_type">Video</span>
  168. <span class="item_time">03:00</span>
  169. </div>
  170. <div class="file_name">防控疫情小贴士</div>
  171. </li>
  172. </ul>
  173. </div>
  174. </el-dialog>
  175. </div>
  176. <!-- 记录 -->
  177. <el-dialog
  178. append-to-body
  179. :close-on-click-modal="false"
  180. :visible.sync="recordVisible"
  181. title="记录"
  182. class="record_layer"
  183. width="750px"
  184. >
  185. <el-table :data="recordData">
  186. <el-table-column property="name" label="操作人" />
  187. <el-table-column property="permissionType" label="角色权限" />
  188. <el-table-column property="account" label="登录账号" />
  189. <el-table-column property="type" label="操作类型" />
  190. <el-table-column property="date" label="操作时间" />
  191. </el-table>
  192. </el-dialog>
  193. </div>
  194. </template>
  195. <script>
  196. import { ReqDeviceEdit ,ReqDeviceList,ReqQueryDevice} from '@/api/device/deviceList.js'
  197. import {parseTime} from '@/utils/index.js'
  198. export default {
  199. name: 'Device',
  200. data() {
  201. return {
  202. queryInfo:{
  203. device_id:'',
  204. device_name:'',
  205. is_state:'',
  206. page:'1',
  207. size:'3'
  208. },
  209. // device_id:'',
  210. dialogTitle: '',
  211. // 编辑的对话框
  212. addFromVisible: false,
  213. contentVisible: false,
  214. recordVisible: false,
  215. // 设备列表的数据
  216. deviceList:[],
  217. stateData: [{ key: '0', name: '全部' }, { key: '1', name: '在线' }, { key: '2', name: '离线' }],
  218. deviceData: [{ key: '1', name: '竖屏' }, { key: '2', name: '横屏' }],
  219. query:{
  220. state:null,
  221. },
  222. // 收集表单数据
  223. form: {
  224. account: null,
  225. name: null,
  226. orientation: null,
  227. device_id:'',
  228. orga_id:'1310000'
  229. },
  230. rules: {
  231. name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }, { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }],
  232. orientation: [{ required: true, message: '请选择设备方向', trigger: 'change' }]
  233. }
  234. }
  235. },
  236. filters: {
  237. parseTime(time, cFormat) {
  238. return parseTime(time, cFormat)
  239. }
  240. },
  241. watch: {},
  242. mounted(){
  243. this.getDevice()
  244. },
  245. methods: {
  246. // 获取设备列表的数据
  247. getDevice(){
  248. const params = this.queryInfo
  249. ReqDeviceList(params).then(res => {
  250. if(res.code==200) {
  251. this.deviceList=res.data.content
  252. }else{
  253. return this.$message.error('获取设备列表失败!')
  254. }
  255. })
  256. },
  257. // 编辑
  258. editFormData(row) {
  259. this.addFromVisible = true
  260. this.form.account = row.device_account
  261. this.form.name=row.device_name
  262. this.form.orientation=row.device_direction==1?'竖屏':'横屏'
  263. this.form.device_id=row.device_id
  264. console.log(this.form.orientation)
  265. },
  266. recordData(index, row) {
  267. this.recordVisible = true
  268. },
  269. // 查看
  270. handleClick(row) {
  271. // console.log(row)
  272. this.contentVisible = true
  273. },
  274. // 修改设备信息并提交
  275. submitForm(formName) {
  276. this.$refs[formName].validate(valid => {
  277. if (valid) {
  278. const params = {
  279. account:this.form.account,
  280. device_name:this.form.name,
  281. device_direction:this.form.orientation,
  282. device_id:this.form.device_id,
  283. orga_id:'13000'
  284. }
  285. console.log(params)
  286. ReqDeviceEdit(params).then(res => {
  287. if(res.code==200) {
  288. this.$message({
  289. type: "success",
  290. message: '修改设备成功'
  291. });
  292. }
  293. this.addFromVisible=false
  294. this.getDevice()
  295. })
  296. } else {
  297. console.log('error submit!!')
  298. return false
  299. }
  300. })
  301. },
  302. // 查询设备
  303. queryDevice(id){
  304. const params={
  305. device_id:id
  306. }
  307. ReqQueryDevice(params).then(res=>{
  308. console.log(res)
  309. if(res.code==200) {
  310. this.getDevice()
  311. }
  312. })
  313. },
  314. }
  315. }
  316. </script>
  317. <style lang="scss" scoped>
  318. .clear_btn {
  319. color: #3a8aeb;
  320. border-color: #3a8aeb;
  321. }
  322. .publish_layer {
  323. ::v-deep .el-dialog__body {
  324. padding: 0 20px 30px 20px;
  325. height: 590px;
  326. overflow-y: auto;
  327. }
  328. }
  329. .content_warp {
  330. padding-top: 16px;
  331. h4 {
  332. margin: 6px 0 16px 0;
  333. font-size: 16px;
  334. color: #333;
  335. }
  336. }
  337. </style>