Эх сурвалжийг харах

4.1.47 升级ups迁移版本 增加看板终端查询

liuyanpeng 1 жил өмнө
parent
commit
63e9a76573

+ 2 - 2
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.1.46",
+  "version": "4.1.47",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "ins": "npm install --registry http://wuzhixin.vip:4873",
@@ -20,7 +20,7 @@
     "click-outside-vue3": "^4.0.1",
     "dayjs": "^1.11.6",
     "dingtalk-jsapi": "^2.10.3",
-    "pc-component-v3": "^1.0.99",
+    "pc-component-v3": "^1.1.12",
     "uuid": "^8.3.2",
     "v-tooltip": "^4.0.0-beta.17",
     "vue-request": "^1.2.4",

+ 131 - 0
src/device/DeviceManagement.vue

@@ -0,0 +1,131 @@
+<template>
+  <div>
+    <Navbar title="设备信息" :is-go-back="false" />
+    <a-card>
+      <a-form ref="formRef" :model="formState">
+        <a-row :gutter="24">
+          <a-col :span="6">
+            <a-form-item name="name" :label="'查询条件'">
+              <a-input v-model:value="formState.condition" placeholder="请输入终端名称或位置" @press-enter="searchDatas" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="2">
+            <a-button type="primary" :icon="h(SearchOutlined)" @click="searchDatas">搜索</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </a-card>
+    <CommonTable
+      ref="table" :data-source="dataSource" :columns="columns" :is-loading="isLoading" :total="total"
+      @get-pager="getPageParams"
+    >
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.dataIndex === 'status'">
+          <a-tag v-if="record.status" color="success">在线</a-tag>
+          <a-tag v-if="record.status === false" color="warning">离线</a-tag>
+        </template>
+      </template>
+    </CommonTable>
+  </div>
+</template>
+
+<script setup>
+import { ref, h, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../common/Common.js';
+import CommonTable from '../common/CommonTable.vue';
+import { ajaxApi } from '../api/workflow/workflow.js';
+import { SearchOutlined } from '@ant-design/icons-vue';
+
+const table = ref();
+const isLoading = ref(false);
+const dataSource = ref([]);
+
+const formState = ref({
+  condition: '',
+});
+
+const total = ref(0);
+
+const pagination = ref({
+  start: 1,
+  length: 20,
+});
+
+onMounted(() => {
+  searchDatas();
+});
+
+// 查询,回到第一页
+const searchDatas = () => {
+  table.value.backFirstPage();
+};
+
+// 获取分页参数
+const getPageParams = (start, length) => {
+  pagination.value.start = (start - 1) * length;
+  pagination.value.length = length;
+  queryDevice();
+};
+
+// 查询终端数据
+const queryDevice = () => {
+  const params = {
+    condition: formState.value.condition,
+    range: { ...pagination.value },
+  };
+  isLoading.value = true;
+  const url = 'api/DeviceManagementResource/queryDeviceManagementDtoByNameAndPosition';
+  ajaxApi(url, params).then(
+    success => {
+      if (success.dataList && success.dataList.length > 0) {
+        dataSource.value = success.dataList;
+        total.value = success.totalSize;
+      } else {
+        total.value = 0;
+        dataSource.value = [];
+      }
+      isLoading.value = false;
+    },
+    error => {
+      isLoading.value = false;
+      Common.processException(error);
+    },
+  );
+};
+
+const columns = ref([
+  {
+    title: '终端名称',
+    dataIndex: 'name',
+    key: 'name',
+  },
+  {
+    title: '终端类型',
+    dataIndex: 'terminalTypeName',
+    key: 'terminalTypeName',
+  },
+  {
+    title: '终端位置',
+    dataIndex: 'position',
+    key: 'position',
+  },
+  {
+    title: '状态',
+    dataIndex: 'status',
+    key: 'status',
+  },
+]);
+
+// 清空查询条件
+const clearInfo = () => {
+  formState.value.name = '';
+  formState.value.position = '';
+};
+</script>
+
+<style scoped>
+:deep(.ant-card .ant-card-body) {
+  padding-bottom: 0px !important;
+}
+</style>

+ 2 - 0
src/index.js

@@ -79,6 +79,7 @@ import CurdWindowModal from './window1/CurdWindowModal.vue';
 import AuthImage from './widget/AuthImage.vue';
 import ShortcutMenu from './dashboard/ShortcutMenu.vue';
 import FlowChart from './dashboard/FlowChart.vue';
+import DeviceManagement from './device/DeviceManagement.vue';
 
 export {
   App,
@@ -148,4 +149,5 @@ export {
   AuthImage,
   ShortcutMenu,
   FlowChart,
+  DeviceManagement,
 };

+ 2 - 1
src/routes/main_routes.js

@@ -70,7 +70,7 @@ const CasLogin = () => import('../client/CasLogin.vue');
 const PrinterConfiguration = () => import('../printer/PrinterConfiguration.vue');
 const ShortcutMenu = () => import('../dashboard/ShortcutMenu.vue');
 const FlowChart = () => import('../dashboard/FlowChart.vue');
-
+const DeviceManagement = () =>import('../device/DeviceManagement.vue');
 
 import { ProcessReport } from 'pc-component-v3';
 
@@ -391,6 +391,7 @@ export default [
       { path: '/desktop/identityManager', component: IdentityManager }, // 身份源管理
       { path: '/desktop/createIdentity', name:'createIdentity',component: CreateIdentity }, // 身份源管理
       { path: '/desktop/printerConfiguration', component: PrinterConfiguration },
+      { path: '/desktop/deviceManagement', component: DeviceManagement },
 
     ],
   },