detail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. <template>
  2. <div class="system-dic-container">
  3. <div class="content">
  4. <div class="cont_box">
  5. <div class="title">设备:{{ detail.name }}</div>
  6. <div class="pro-status"><span :class="developer_status == 2 ? 'on' : 'off'"></span>{{ developer_status == 2 ? '上线' : '下线' }}</div>
  7. <div class="pro-option" @click="CkOption">{{ developer_status == 2 ? '下线' : '上线' }}</div>
  8. </div>
  9. </div>
  10. <div class="content-box">
  11. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  12. <el-tab-pane label="实例信息" name="1">
  13. <div class="pro-box">
  14. <div class="protitle">设备信息</div>
  15. <el-button type="" :icon="Edit" class="buttonedit" @click="onOpenEditDic(detail)">编辑</el-button>
  16. </div>
  17. <div class="ant-descriptions-view">
  18. <table>
  19. <tbody>
  20. <tr class="ant-descriptions-row">
  21. <th class="ant-descriptions-item-label ant-descriptions-item-colon">设备名称</th>
  22. <td class="ant-descriptions-item-content" colspan="1">{{ detail.name }}</td>
  23. <th class="ant-descriptions-item-label ant-descriptions-item-colon">所属产品</th>
  24. <td class="ant-descriptions-item-content" colspan="1">{{ detail.productName }}</td>
  25. <th class="ant-descriptions-item-label ant-descriptions-item-colon">所属部门</th>
  26. <td class="ant-descriptions-item-content" colspan="1">{{ detail.deptName }}</td>
  27. </tr>
  28. <tr class="ant-descriptions-row">
  29. <th class="ant-descriptions-item-label ant-descriptions-item-colon">消息协议</th>
  30. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.messageProtocol }}</td>
  31. <th class="ant-descriptions-item-label ant-descriptions-item-colon">链接协议</th>
  32. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.transportProtocol }}</td>
  33. <th class="ant-descriptions-item-label ant-descriptions-item-colon">设备类型</th>
  34. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.deviceType }}</td>
  35. </tr>
  36. <tr class="ant-descriptions-row">
  37. <th class="ant-descriptions-item-label ant-descriptions-item-colon">创建时间</th>
  38. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.createdAt }}</td>
  39. <th class="ant-descriptions-item-label ant-descriptions-item-colon">注册时间</th>
  40. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.updatedAt }}</td>
  41. <th class="ant-descriptions-item-label ant-descriptions-item-colon">最后上线时间</th>
  42. <td class="ant-descriptions-item-content" colspan="1">{{ prodetail.lastOnlineTime || '' }}</td>
  43. </tr>
  44. <tr class="ant-descriptions-row">
  45. <th class="ant-descriptions-item-label ant-descriptions-item-colon">描述</th>
  46. <td class="ant-descriptions-item-content" colspan="5">{{ prodetail.desc }}</td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </el-tab-pane>
  52. <el-tab-pane label="物模型" name="2">
  53. <div class="wu-box">
  54. <el-tabs type="border-card" v-model="activetab" @tab-click="wuhandleClick">
  55. <el-tab-pane label="属性定义" name="attr">
  56. <div class="wu-title">
  57. <div class="title">属性定义</div>
  58. <div><el-button type="primary" @click="onOpenEditAttr()">添加</el-button></div>
  59. </div>
  60. <el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'attr'">
  61. <el-table-column label="属性标识" align="center" prop="key" />
  62. <el-table-column label="属性名称" prop="name" :show-overflow-tooltip="true" />
  63. <el-table-column prop="valueType" label="数据类型" width="120" align="center">
  64. <template #default="scope">
  65. <span>{{ scope.row.valueType.type }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="accessMode" label="是否只读" width="120" align="center">
  69. <template #default="scope">
  70. <el-tag type="info" size="small" v-if="scope.row.accessMode">只读</el-tag>
  71. <el-tag type="success" size="small" v-else>读写</el-tag>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="说明" prop="desc" :show-overflow-tooltip="true" />
  75. <el-table-column label="操作" width="300" align="center" fixed="right">
  76. <template #default="scope">
  77. <el-button size="small" text type="warning" @click="onEditAttr(scope.row)">修改</el-button>
  78. <el-button size="small" text type="danger" @click="onRowDel(scope.row.key, 'attr')">删除</el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. </el-tab-pane>
  83. <el-tab-pane label="功能定义" name="fun">
  84. <div class="wu-title">
  85. <div class="title">功能定义</div>
  86. <div><el-button type="primary" @click="onOpenEditFun()">添加</el-button></div>
  87. </div>
  88. <el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'fun'">
  89. <el-table-column label="功能标识" align="center" prop="key" />
  90. <el-table-column label="名称" prop="name" :show-overflow-tooltip="true" />
  91. <el-table-column label="描述" prop="desc" :show-overflow-tooltip="true" />
  92. <el-table-column label="操作" width="300" align="center" fixed="right">
  93. <template #default="scope">
  94. <el-button size="small" text type="warning" @click="onEditFun(scope.row)">修改</el-button>
  95. <el-button size="small" text type="danger" @click="onRowDel(scope.row.key, 'fun')">删除</el-button>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </el-tab-pane>
  100. <el-tab-pane label="事件定义" name="event">
  101. <div class="wu-title">
  102. <div class="title">事件定义</div>
  103. <div><el-button type="primary" @click="onOpenEditEvent()">添加</el-button></div>
  104. </div>
  105. <el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'event'">
  106. <el-table-column label="事件标识" align="center" prop="key" />
  107. <el-table-column label="名称" prop="name" :show-overflow-tooltip="true" />
  108. <el-table-column prop="level" label="事件级别" width="120" align="center">
  109. <template #default="scope">
  110. <el-tag type="primary" size="small" v-if="scope.row.level == 0">普通</el-tag>
  111. <el-tag type="warning" size="small" v-if="scope.row.level == 1">警告</el-tag>
  112. <el-tag type="danger" size="small" v-if="scope.row.level == 2">紧急</el-tag>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="描述" prop="desc" :show-overflow-tooltip="true" />
  116. <el-table-column label="操作" width="300" align="center" fixed="right">
  117. <template #default="scope">
  118. <el-button size="small" text type="warning" @click="onEditEvent(scope.row)">修改</el-button>
  119. <el-button size="small" text type="danger" @click="onRowDel(scope.row.key, 'event')">删除</el-button>
  120. </template>
  121. </el-table-column>
  122. </el-table></el-tab-pane
  123. >
  124. <el-tab-pane label="标签定义" name="tab"
  125. ><div class="wu-title">
  126. <div class="title">标签定义</div>
  127. <div><el-button type="primary" @click="onOpenEditTab()">添加</el-button></div>
  128. </div>
  129. <el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'tab'">
  130. <el-table-column label="属性标识" align="center" prop="key" />
  131. <el-table-column label="属性名称" prop="name" :show-overflow-tooltip="true" />
  132. <el-table-column prop="valueType" label="数据类型" width="120" align="center">
  133. <template #default="scope">
  134. <span>{{ scope.row.valueType.type }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="accessMode" label="是否只读" width="120" align="center">
  138. <template #default="scope">
  139. <el-tag type="info" size="small" v-if="scope.row.accessMode">只读</el-tag>
  140. <el-tag type="success" size="small" v-else>读写</el-tag>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="描述" prop="desc" :show-overflow-tooltip="true" />
  144. <el-table-column label="操作" width="300" align="center" fixed="right">
  145. <template #default="scope">
  146. <el-button size="small" text type="warning" @click="onEditTag(scope.row)">修改</el-button>
  147. <el-button size="small" text type="danger" @click="onRowDel(scope.row.key, 'tab')">删除</el-button>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. </el-tab-pane>
  152. </el-tabs>
  153. <pagination
  154. v-show="tableData.total > 0"
  155. :total="tableData.total"
  156. v-model:page="tableData.param.pageNum"
  157. v-model:limit="tableData.param.pageSize"
  158. @pagination="getList"
  159. />
  160. </div>
  161. </el-tab-pane>
  162. <el-tab-pane label="运行状态" name="3">
  163. <div style="background-color: rgb(240, 242, 245); display: flex; padding: 10px;flex-wrap: wrap;">
  164. <div class="ant-card">
  165. <div class="ant-card-body">
  166. <div class="cardflex">
  167. <div>设备状态</div>
  168. <div @click="getrunData()" style="cursor: pointer;">
  169. <el-icon style="font-size: 18px;">
  170. <ele-Refresh />
  171. </el-icon>
  172. </div>
  173. </div>
  174. <div class="statusname" v-if="areaData.status==0">未启用</div>
  175. <div class="statusname" v-if="areaData.status==1">离线</div>
  176. <div class="statusname" v-if="areaData.status==2">在线</div>
  177. <div class="cardflex comtest">
  178. <div>最后上线时间</div>
  179. <div>{{areaData.lastOnlineTime || '未启用'}}</div>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="ant-card" v-for="(item, index) in areaData.properties" :key="index">
  184. <div class="ant-card-body">
  185. <div class="cardflex">
  186. <div>{{item.name}}</div>
  187. <div style="cursor: pointer;">
  188. <el-icon style="font-size: 18px;" @click="getrunData()">
  189. <ele-Refresh />
  190. </el-icon>
  191. <el-icon style="font-size: 18px; margin-left: 10px;" @click="onOpenListDetail(item)">
  192. <ele-Expand />
  193. </el-icon>
  194. </div>
  195. </div>
  196. <div class="statusname">{{item.value}}</div>
  197. <div class="cardflex">
  198. <devantd :json="item.list" :antdid="item.key" v-if="item.type=='int'"/>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </el-tab-pane>
  204. <el-tab-pane label="日志管理" name="4">
  205. <div class="system-user-search mb15">
  206. <el-form :model="logtableData.param" ref="queryRef" :inline="true" label-width="68px">
  207. <el-form-item label="日志类型" prop="types">
  208. <el-select v-model="logtableData.param.types" placeholder="日志类型" clearable size="default">
  209. <el-option v-for="item in logTypeData" :key="item" :label="item" :value="item" />
  210. </el-select>
  211. </el-form-item>
  212. <el-form-item label="创建时间" prop="dateRange">
  213. <el-date-picker
  214. v-model="logtableData.param.dateRange"
  215. size="default"
  216. value-format="YYYY-MM-DD"
  217. type="daterange"
  218. range-separator="-"
  219. start-placeholder="开始日期"
  220. end-placeholder="结束日期"
  221. ></el-date-picker>
  222. </el-form-item>
  223. <el-form-item>
  224. <el-button size="default" type="primary" class="ml10" @click="getlog">
  225. <el-icon>
  226. <ele-Search />
  227. </el-icon>
  228. 查询
  229. </el-button>
  230. <el-button size="default" @click="resetQuery(queryRef)">
  231. <el-icon>
  232. <ele-Refresh />
  233. </el-icon>
  234. 重置
  235. </el-button>
  236. </el-form-item>
  237. </el-form>
  238. </div>
  239. <el-table style="width: 100%" :data="logtableData.data">
  240. <el-table-column label="类型" align="center" prop="type" />
  241. <el-table-column label="时间" prop="ts" :show-overflow-tooltip="true" />
  242. <el-table-column label="内容" prop="content" :show-overflow-tooltip="true" />
  243. <el-table-column label="操作" width="300" align="center" fixed="right">
  244. <template #default="scope">
  245. <el-button size="small" text type="warning" @click="onLogDetail(scope.row)">查看</el-button>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. <pagination
  250. v-show="logtableData.total > 0"
  251. :total="logtableData.total"
  252. v-model:page="logtableData.param.pageNum"
  253. v-model:limit="logtableData.param.pageSize"
  254. @pagination="getList"
  255. />
  256. </el-tab-pane>
  257. </el-tabs>
  258. </div>
  259. <EditDic ref="editDicRef" @typeList="typeList" />
  260. <EditAttr ref="editAttrRef" @typeList="getproperty" />
  261. <EditFun ref="editFunRef" @typeList="getfunction" />
  262. <EditEvent ref="editEventRef" @typeList="getevent" />
  263. <EditTab ref="editTabRef" @typeList="gettab" />
  264. <ListDic ref="listDicRef" />
  265. <el-dialog v-model="dialogVisible" title="返回Json数据" width="30%">
  266. <JsonViewer :value="jsonData" boxed sort theme="jv-dark" @click="onKeyclick" />
  267. <template #footer>
  268. <span class="dialog-footer">
  269. <el-button @click="dialogVisible = false">关闭</el-button>
  270. </span>
  271. </template>
  272. </el-dialog>
  273. </div>
  274. </template>
  275. <script lang="ts">
  276. import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
  277. import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
  278. import 'vue3-json-viewer/dist/index.css';
  279. import EditDic from '../product/component/editPro.vue';
  280. import EditAttr from '../product/component/editAttr.vue';
  281. import EditFun from '../product/component/editFun.vue';
  282. import EditEvent from '../product/component/editEvent.vue';
  283. import EditTab from '../product/component/editTab.vue';
  284. import devantd from '/@/components/devantd/index.vue';
  285. import ListDic from './component/list.vue';
  286. import { useRoute } from 'vue-router';
  287. import api from '/@/api/device';
  288. interface TableDataState {
  289. ids: number[];
  290. tableData: {
  291. data: [];
  292. total: number;
  293. loading: boolean;
  294. param: {
  295. pageNum: number;
  296. pageSize: number;
  297. name: string;
  298. deviceType: string;
  299. status: string;
  300. dateRange: string[];
  301. };
  302. };
  303. logtableData: {
  304. data: [];
  305. total: number;
  306. loading: boolean;
  307. param: {
  308. pageNum: number;
  309. pageSize: number;
  310. name: string;
  311. deviceType: string;
  312. status: string;
  313. dateRange: string[];
  314. };
  315. };
  316. }
  317. export default defineComponent({
  318. name: 'deviceEditPro',
  319. components: { EditDic, EditAttr, EditFun, EditEvent, EditTab,devantd,ListDic },
  320. setup(prop, context) {
  321. const route = useRoute();
  322. const editDicRef = ref();
  323. const editAttrRef = ref();
  324. const editFunRef = ref();
  325. const listDicRef=ref();
  326. const editEventRef = ref();
  327. const editTabRef = ref();
  328. const state = reactive<TableDataState>({
  329. areaData:[],
  330. isShowDialog: false,
  331. dialogVisible: false,
  332. logTypeData: [],
  333. jsonData: '',
  334. activeName: '1', // 分类数据
  335. activetab: 'attr', // 分类数据
  336. detail: [],
  337. prodetail: [],
  338. product_id: 0,
  339. developer_status: 0,
  340. tableData: {
  341. data: [],
  342. total: 0,
  343. loading: false,
  344. param: {
  345. pageNum: 1,
  346. productId: 0,
  347. pageSize: 10,
  348. status: '',
  349. dateRange: [],
  350. },
  351. },
  352. logtableData: {
  353. data: [],
  354. total: 0,
  355. loading: false,
  356. param: {
  357. pageNum: 1,
  358. productId: 0,
  359. pageSize: 10,
  360. status: '',
  361. dateRange: [],
  362. },
  363. },
  364. });
  365. onMounted(() => {
  366. const ids = route.params && route.params.id;
  367. api.instance.detail(ids).then((res: any) => {
  368. state.detail = res.data;
  369. state.developer_status = res.data.status;
  370. state.tableData.param.productId = res.data.product.id;
  371. state.product_id = res.data.product.id;
  372. api.product.detail(res.data.product.id).then((res: any) => {
  373. state.prodetail = res.data;
  374. console.log(res.data);
  375. });
  376. //第一次加载
  377. api.model.property(state.tableData.param).then((res: any) => {
  378. state.tableData.data = res.Data;
  379. state.tableData.total = res.Total;
  380. });
  381. });
  382. });
  383. const onLogDetail = (row: TableDataRow) => {
  384. state.jsonData = JSON.parse(row.content);
  385. console.log(JSON.parse(row.content));
  386. state.dialogVisible = true;
  387. };
  388. //编辑属性
  389. const onEditAttr = (row: TableDataRow) => {
  390. editAttrRef.value.openDialog(row, state.product_id);
  391. };
  392. //编辑功能
  393. const onEditFun = (row: TableDataRow) => {
  394. editFunRef.value.openDialog(row, state.product_id);
  395. };
  396. //编辑事件
  397. const onEditEvent = (row: TableDataRow) => {
  398. editEventRef.value.openDialog(row, state.product_id);
  399. };
  400. //编辑标签
  401. const onEditTag = (row: TableDataRow) => {
  402. editTabRef.value.openDialog(row, state.product_id);
  403. };
  404. //打开添加属性弹窗
  405. const onOpenEditAttr = () => {
  406. editAttrRef.value.openDialog({ product_id: state.product_id, id: 0, accessMode: 0 });
  407. };
  408. //打开添加功能弹窗
  409. const onOpenEditFun = () => {
  410. editFunRef.value.openDialog({ product_id: state.product_id, id: 0 });
  411. };
  412. //打开添加事件弹窗
  413. const onOpenEditEvent = () => {
  414. editEventRef.value.openDialog({ product_id: state.product_id, id: 0, level: 0 });
  415. };
  416. //打开添加事件弹窗
  417. const onOpenEditTab = () => {
  418. editTabRef.value.openDialog({ product_id: state.product_id, id: 0, accessMode: 0 });
  419. };
  420. //查看日志列表
  421. const onOpenListDetail=(row: TableDataRow)=>{
  422. listDicRef.value.openDialog(row, state.detail.id);
  423. };
  424. // 打开修改产品弹窗
  425. const onOpenEditDic = (row: TableDataRow) => {
  426. editDicRef.value.openDialog(row);
  427. };
  428. // 删除产品
  429. const onRowDel = (key, type) => {
  430. let msg = `此操作将永久删除该数据吗?,是否继续?`;
  431. if (key.length === 0) {
  432. ElMessage.error('请选择要删除的数据。');
  433. return;
  434. }
  435. ElMessageBox.confirm(msg, '提示', {
  436. confirmButtonText: '确认',
  437. cancelButtonText: '取消',
  438. type: 'warning',
  439. })
  440. .then(() => {
  441. if (type == 'attr') {
  442. api.model.propertydel(state.product_id, key).then(() => {
  443. ElMessage.success('删除成功');
  444. getproperty();
  445. });
  446. }
  447. if (type == 'fun') {
  448. api.model.functiondel(state.product_id, key).then(() => {
  449. ElMessage.success('删除成功');
  450. getfunction();
  451. });
  452. }
  453. if (type == 'event') {
  454. api.model.eventdel(state.product_id, key).then(() => {
  455. ElMessage.success('删除成功');
  456. getevent();
  457. });
  458. }
  459. if (type == 'tab') {
  460. api.model.tagdel(state.product_id, key).then(() => {
  461. ElMessage.success('删除成功');
  462. tagdel();
  463. });
  464. }
  465. })
  466. .catch(() => {});
  467. };
  468. //根据不同类型获取列表
  469. const getList = () => {
  470. switch (state.activetab) {
  471. case 'attr':
  472. getproperty();
  473. break;
  474. case 'fun':
  475. getfunction();
  476. break;
  477. case 'event':
  478. getevent();
  479. break;
  480. case 'tab':
  481. gettab();
  482. break;
  483. }
  484. };
  485. const getproperty = () => {
  486. api.model.property(state.tableData.param).then((res: any) => {
  487. state.tableData.data = res.Data;
  488. state.tableData.total = res.Total;
  489. });
  490. };
  491. const getfunction = () => {
  492. api.model.function(state.tableData.param).then((res: any) => {
  493. state.tableData.data = res.Data;
  494. state.tableData.total = res.Total;
  495. });
  496. };
  497. const getevent = () => {
  498. api.model.event(state.tableData.param).then((res: any) => {
  499. state.tableData.data = res.Data;
  500. state.tableData.total = res.Total;
  501. });
  502. };
  503. const gettab = () => {
  504. api.model.tag(state.tableData.param).then((res: any) => {
  505. state.tableData.data = res.Data;
  506. state.tableData.total = res.Total;
  507. });
  508. };
  509. const wuhandleClick = (tab: TabsPaneContext) => {
  510. state.activetab = tab.props.name;
  511. switch (tab.props.name) {
  512. case 'attr':
  513. getproperty();
  514. break;
  515. case 'fun':
  516. getfunction();
  517. break;
  518. case 'event':
  519. getevent();
  520. break;
  521. case 'tab':
  522. gettab();
  523. break;
  524. }
  525. };
  526. const handleClick = (tab: TabsPaneContext, event: Event) => {
  527. console.log(tab, event);
  528. if (tab.props.name == 4) {
  529. //获取日志
  530. getlog();
  531. getlogtype();
  532. } else if (tab.props.name == 2) {
  533. getList();
  534. } else if(tab.props.name==3){
  535. getrunData();
  536. }
  537. };
  538. const getrunData=()=>{
  539. api.instance.getrun_status({id:state.detail.id}).then((res: any) => {
  540. state.areaData=res
  541. });
  542. };
  543. const getlogtype = () => {
  544. api.instance.getlogcate({}).then((res: any) => {
  545. state.logTypeData = res.list;
  546. });
  547. };
  548. const getlog = () => {
  549. state.logtableData.param.deviceKey = state.detail.key;
  550. api.instance.getLogList(state.logtableData.param).then((res: any) => {
  551. console.log(res, '22222222');
  552. state.logtableData.data = res.list;
  553. state.logtableData.total = res.Total;
  554. });
  555. };
  556. const CkOption = () => {
  557. if (state.developer_status == 2) {
  558. api.instance.devoffline({id:state.detail.id}).then((res: any) => {
  559. ElMessage.success('操作成功');
  560. state.developer_status = 1;
  561. });
  562. } else {
  563. api.instance.devonline({id:state.detail.id}).then((res: any) => {
  564. ElMessage.success('操作成功');
  565. state.developer_status = 2;
  566. });
  567. }
  568. };
  569. const tinyAreas = () => {
  570. var data=state.data;
  571. const tinyArea = new TinyArea('container', {
  572. height: 60,
  573. autoFit: false,
  574. data,
  575. smooth: true,
  576. areaStyle: {
  577. fill: '#d6e3fd',
  578. },
  579. });
  580. tinyArea.render();
  581. }
  582. return {
  583. tinyAreas,
  584. editDicRef,
  585. editAttrRef,
  586. listDicRef,
  587. editFunRef,
  588. editEventRef,
  589. editTabRef,
  590. onOpenListDetail,
  591. getrunData,
  592. getlog,
  593. getlogtype,
  594. onLogDetail,
  595. CkOption,
  596. onRowDel,
  597. onEditFun,
  598. onEditEvent,
  599. onEditTag,
  600. onEditAttr,
  601. getList,
  602. getproperty,
  603. getfunction,
  604. getevent,
  605. gettab,
  606. wuhandleClick,
  607. onOpenEditTab,
  608. onOpenEditEvent,
  609. onOpenEditAttr,
  610. onOpenEditFun,
  611. onOpenEditDic,
  612. handleClick,
  613. ...toRefs(state),
  614. };
  615. },
  616. });
  617. </script>
  618. <style>
  619. .content {
  620. background: #fff;
  621. width: 100%;
  622. padding: 20px;
  623. }
  624. .content-box {
  625. background: #fff;
  626. width: 100%;
  627. padding: 20px;
  628. margin-top: 20px;
  629. }
  630. .cont_box {
  631. display: flex;
  632. }
  633. .cont_box .title {
  634. font-size: 24px;
  635. }
  636. .cont_box .pro-status {
  637. line-height: 40px;
  638. margin-left: 30px;
  639. }
  640. .cont_box .pro-status .on {
  641. background: #52c41a;
  642. }
  643. .cont_box .pro-status .off {
  644. background: #c41a1a;
  645. }
  646. .cont_box .pro-status span {
  647. position: relative;
  648. top: -1px;
  649. display: inline-block;
  650. width: 6px;
  651. height: 6px;
  652. vertical-align: middle;
  653. border-radius: 50%;
  654. margin-right: 5px;
  655. }
  656. .cont_box .pro-option {
  657. line-height: 40px;
  658. margin-left: 10px;
  659. color: #1890ff;
  660. cursor: pointer;
  661. }
  662. .content-box .pro-box {
  663. display: flex;
  664. padding: 10px;
  665. }
  666. .content-box .pro-box .protitle {
  667. font-size: 18px;
  668. font-weight: bold;
  669. line-height: 35px;
  670. }
  671. .content-box .pro-box .buttonedit {
  672. border: 0px;
  673. color: #1890ff;
  674. }
  675. table {
  676. border-collapse: collapse;
  677. text-indent: initial;
  678. border-spacing: 2px;
  679. }
  680. tbody {
  681. box-sizing: border-box;
  682. display: table-row-group;
  683. vertical-align: middle;
  684. border-color: inherit;
  685. }
  686. tr {
  687. display: table-row;
  688. vertical-align: inherit;
  689. border-color: inherit;
  690. }
  691. .ant-descriptions-view {
  692. width: 100%;
  693. overflow: hidden;
  694. border-radius: 4px;
  695. }
  696. .ant-descriptions-view {
  697. border: 1px solid #e8e8e8;
  698. }
  699. .ant-descriptions-view table {
  700. width: 100%;
  701. table-layout: fixed;
  702. }
  703. .ant-descriptions-view > table {
  704. table-layout: auto;
  705. }
  706. .ant-descriptions-row {
  707. border-bottom: 1px solid #e8e8e8;
  708. }
  709. .ant-descriptions-item-label {
  710. color: rgba(0, 0, 0, 0.85);
  711. font-weight: 400;
  712. font-size: 14px;
  713. line-height: 1.5;
  714. }
  715. .ant-descriptions-item-label {
  716. padding: 16px 24px;
  717. border-right: 1px solid #e8e8e8;
  718. }
  719. .ant-descriptions-item-label {
  720. background-color: #fafafa;
  721. }
  722. .ant-descriptions-item-content {
  723. padding: 16px 24px;
  724. border-right: 1px solid #e8e8e8;
  725. display: table-cell;
  726. color: rgba(0, 0, 0, 0.65);
  727. font-size: 14px;
  728. line-height: 1.5;
  729. }
  730. .wu-box {
  731. border: #e8e8e8 solid 1px;
  732. padding: 20px;
  733. width: 100%;
  734. }
  735. .wu-box .wu-title {
  736. display: flex;
  737. flex-direction: row;
  738. justify-content: space-between;
  739. padding: 20px;
  740. border-bottom: #e8e8e8 1px solid;
  741. }
  742. .wu-box .wu-title .title {
  743. font-size: 18px;
  744. }
  745. .ant-card {
  746. box-sizing: border-box;
  747. margin: 10px;
  748. width: 23.8%;
  749. color: rgba(0, 0, 0, 0.65);
  750. font-size: 14px;
  751. font-variant: tabular-nums;
  752. line-height: 1.5;
  753. list-style: none;
  754. font-feature-settings: 'tnum';
  755. position: relative;
  756. background: #fff;
  757. border-radius: 2px;
  758. transition: all 0.3s;
  759. }
  760. .ant-card-body {
  761. padding: 24px;
  762. zoom: 1;
  763. }
  764. .cardflex {
  765. display: flex;
  766. justify-content: space-between;
  767. }
  768. .statusname {
  769. color: rgba(0, 0, 0, 0.85);
  770. font-size: 30px;
  771. margin-top: 10px;
  772. }
  773. .comtest{
  774. margin-top: 20px;
  775. height: 30px;
  776. line-height: 30px;
  777. }
  778. </style>