Jelajahi Sumber

Merge branch 'master' of https://a.leanwo.com:3000/prodog-client-2023/client-base-v4

YangZhiJie 2 tahun lalu
induk
melakukan
34d1adfcda

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.40",
+  "version": "4.0.45",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 1 - 1
src/api/printer/printerWebsocket.js

@@ -65,7 +65,7 @@ export default {
   connectNodeRed: function (resolve, reject, commandStr) {
     const _self = this;
     let printers = null;
-    let socketUrl = 'ws://192.168.1.11:10092';
+    let socketUrl = 'ws://127.0.0.1:10092';
 
     _self.webSocket = new WebSocket(socketUrl);
     _self.webSocket.onopen = function (event) {

+ 40 - 4
src/common/CommonTable.vue

@@ -2,6 +2,7 @@
   <div class="tablePaganations">
     <a-config-provider :locale="locale">
       <a-table
+        id="commonTable"
         class="ant-table-striped"
         bordered
         size="small"
@@ -10,7 +11,7 @@
         :data-source="dataSource"
         :columns="columns"
         :row-key="(record) => record.id"
-        :scroll="scroll"
+        :scroll="{ y: yScroll }"
         :pagination="havePage ? pagination : false"
         :row-class-name="
           (_record, index) => (index % 2 === 1 ? 'table-striped' : null)
@@ -48,36 +49,47 @@ import {
   defineEmits,
   defineExpose,
   watch,
+  onMounted,
 } from 'vue';
+import { getTableScroll } from '../common/tableScroll.js';
 import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
 const locale = ref(zhCN);
+
 const props = defineProps({
+  // 表格数据
   dataSource: {
     type: Object,
     required: true,
   },
+  // 表头数据
   columns: {
     type: Object,
     required: true,
   },
+  // 是否可选择
   isSelect: {
     type: Boolean,
   },
+  // 表格loading
   isLoading: {
     type: Boolean,
   },
+  // 数据总数
   total: {
     type: Number,
     default: 0,
   },
+  // 是否分页
   havePage: {
     type: Boolean,
     default: true,
   },
-  scroll: {
-    type: Object,
-    default: () => ({ y: 400 }),
+  // 表格距底部高度
+  extraHeight: {
+    type: Number,
+    default: undefined,
   },
+  // 选择的key值
   selectedKeys: {
     type: Array,
     default: () => [],
@@ -100,6 +112,9 @@ const pagination = reactive({
   total: props.total,
 });
 
+const yScroll = ref(400); //默认滚动高度
+const extraHeight = ref(undefined); //表格距离底部值
+
 // 最后一次排序信息
 const lastSorter = reactive({ field: '', order: '' });
 
@@ -109,6 +124,26 @@ const state = reactive({
   selectedRowKeys: [],
 });
 
+onMounted(() => {
+  if (!props.havePage) {
+    extraHeight.value = 30;
+  } else {
+    extraHeight.value = props.extraHeight;
+  }
+  onResizeTable();
+  window.onresize = () => {
+    onResizeTable();
+  };
+});
+
+// 表格位置
+const onResizeTable = () => {
+  yScroll.value = getTableScroll({
+    extraHeight: extraHeight.value,
+    id: 'commonTable',
+  });
+};
+
 //点击页码事件
 const changePage = (current, size) => {
   pagination.current = current;
@@ -206,6 +241,7 @@ watch(
   props,
   newData => {
     pagination.total = newData.total;
+    extraHeight.value = newData.extraHeight;
   },
   { immediate: true, deep: true },
 );

+ 3 - 3
src/common/tableScroll.js

@@ -5,8 +5,8 @@
 */
 export const getTableScroll = ({ extraHeight, id }) => {
   if (typeof extraHeight == 'undefined') {
-    //  默认底部分页
-    extraHeight = 50;
+    //  默认底部分页高度
+    extraHeight = 60;
   }
   let tHeader = null;
   if (id) {
@@ -22,5 +22,5 @@ export const getTableScroll = ({ extraHeight, id }) => {
   }
   //窗体高度-表格内容顶部的高度-表格内容底部的高度
   let height = `calc(100vh - ${tHeaderBottom + extraHeight}px)`;
-  return { y: height };
+  return height;
 };

+ 31 - 55
src/identity/AccountAssociation.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="proDog-setting">
     <a-form
+      ref="formRef"
       name="basic"
       :label-col="{ style: { width: '186px' } }"
       :wrapper-col="{ span: 8 }"
@@ -104,26 +105,7 @@
     </a-form>
     <div style="margin: 22px 0 -22px 0">
       <a-button @click="prev"> 上一步 </a-button>
-      <a-button
-        type="primary"
-        :disabled="
-          !identitySetting.spEntityID ||
-            !identitySetting.uid ||
-            !identitySetting.userName ||
-            !identitySetting.userNo ||
-            !identitySetting.clientId ||
-            !identitySetting.roleTemplateNo ||
-            !identitySetting.spEntityID ||
-            !identitySetting.spAssertionConsumeService ||
-            !identitySetting.spAssertionConsumeSuccessRedirectService ||
-            service ||
-            redirect
-            ? true
-            : false
-        "
-        style="margin-left: 8px"
-        @click="createIdentity"
-      >
+      <a-button type="primary" style="margin-left: 8px" @click="createIdentity">
         完成
       </a-button>
     </div>
@@ -150,9 +132,7 @@ const props = defineProps({
     default: () => ({}),
   },
 });
-
-const service = ref(false);
-const redirect = ref(false);
+const formRef = ref();
 const prevDatas = ref({});
 const identitySetting = ref({});
 
@@ -163,33 +143,35 @@ onMounted(() => {
 
 // 新建或更新认证源
 const createIdentity = () => {
-  const jsonStr = JSON.stringify(identitySetting.value);
-  const formData = new FormData();
-  formData.append('attribute', jsonStr);
-  formData.append('id', prevDatas.value.id);
-  formData.append('name', prevDatas.value.name);
-  formData.append('no', prevDatas.value.no);
-  formData.append('logo', prevDatas.value.file);
-  formData.append('active', prevDatas.value.active);
-  formData.append('authType', prevDatas.value.authType);
-  formData.append('description', prevDatas.value.description);
-  saveUpdateAuth(formData).then(
-    success => {
-      if (success.errorCode === 0) {
-        if (!prevDatas.value.id) {
-          message.success('新建认证源成功!');
+  formRef.value.validate().then(success => {
+    const jsonStr = JSON.stringify(identitySetting.value);
+    const formData = new FormData();
+    formData.append('attribute', jsonStr);
+    formData.append('id', prevDatas.value.id);
+    formData.append('name', prevDatas.value.name);
+    formData.append('no', prevDatas.value.no);
+    formData.append('logo', prevDatas.value.file);
+    formData.append('active', prevDatas.value.active);
+    formData.append('authType', prevDatas.value.authType);
+    formData.append('description', prevDatas.value.description);
+    saveUpdateAuth(formData).then(
+      success => {
+        if (success.errorCode === 0) {
+          if (!prevDatas.value.id) {
+            message.success('新建认证源成功!');
+          } else {
+            message.success('更新认证源成功!');
+          }
+          router.push('/desktop/identityManager');
         } else {
-          message.success('更新认证源成功!');
+          message.error(success.errorMessage);
         }
-        router.push('/desktop/identityManager');
-      } else {
-        message.error(success.errorMessage);
-      }
-    },
-    error => {
-      Common.processException(error);
-    },
-  );
+      },
+      error => {
+        Common.processException(error);
+      },
+    );
+  });
 };
 
 const prev = () => {
@@ -207,10 +189,7 @@ let validateService = async (_rule, value) => {
   }
   let no = prevDatas.value.no;
   if (!value.endsWith('/api/saml/sso/' + no)) {
-    service.value = true;
-    return Promise.reject('断言解析地址必须以/api/saml/sso/' + no + '结束');
-  } else {
-    service.value = false;
+    return Promise.reject('断言解析地址必须以/api/saml/sso/' + no + '结束,' + no + '为认证源标识');
   }
 };
 // 验证断言解析成功跳转地址结束字符是否正确
@@ -219,12 +198,9 @@ let redirectService = async (_rule, value) => {
     return Promise.reject('请输入 Prodog 断言解析成功跳转地址');
   }
   if (!value.endsWith('index.html#/samlLogin')) {
-    redirect.value = true;
     return Promise.reject(
       '断言解析成功跳转地址必须以index.html#/samlLogin结束',
     );
-  } else {
-    redirect.value = false;
   }
 };
 const rules = {

+ 33 - 32
src/identity/BasicConfiguration.vue

@@ -1,39 +1,26 @@
 <template>
   <a-form
+    ref="formRef"
     name="basic"
     :label-col="{ style: { width: '120px' } }"
     :wrapper-col="{ span: 8 }"
     :model="identitySetting"
     autocomplete="off"
+    :rules="rulesForStep"
   >
-    <a-form-item
-      has-feedback
-      label="身份提供商 id"
-      name="entityID"
-      :rules="[{ required: true, message: '请输入身份提供商 id!' }]"
-    >
+    <a-form-item has-feedback label="身份提供商 id" name="entityID">
       <a-input
         v-model:value="identitySetting.entityID"
         placeholder="必填,请输入身份提供商 id"
       />
     </a-form-item>
-    <a-form-item
-      has-feedback
-      label="SSO 地址"
-      name="ssoUrl"
-      :rules="[{ required: true, message: '请输入 SSO 地址' }]"
-    >
+    <a-form-item has-feedback label="SSO 地址" name="ssoUrl">
       <a-input
         v-model:value="identitySetting.ssoUrl"
         placeholder="必填,请输入 SSO 地址"
       />
     </a-form-item>
-    <a-form-item
-      has-feedback
-      label="证书"
-      name="certificate"
-      :rules="[{ required: true, message: '请输入证书' }]"
-    >
+    <a-form-item has-feedback label="证书" name="certificate">
       <a-textarea
         v-model:value="identitySetting.certificate"
         :rows="4"
@@ -50,18 +37,7 @@
   </a-form>
   <div style="margin: 22px 0 -22px 0">
     <a-button @click="prev"> 上一步 </a-button>
-    <a-button
-      type="primary"
-      style="margin-left: 8px"
-      :disabled="
-        !identitySetting.entityID ||
-          !identitySetting.ssoUrl ||
-          !identitySetting.certificate
-          ? true
-          : false
-      "
-      @click="next"
-    >
+    <a-button type="primary" style="margin-left: 8px" @click="next">
       下一步
     </a-button>
   </div>
@@ -78,9 +54,32 @@ const props = defineProps({
   },
 });
 
+const formRef = ref();
 // 表单数据
 const identitySetting = ref({});
-
+const rulesForStep = {
+  entityID: [
+    {
+      required: true,
+      message: '请输入身份提供商 id!',
+      trigger: 'change',
+    },
+  ],
+  ssoUrl: [
+    {
+      required: true,
+      message: '请输入 SSO 地址!',
+      trigger: 'change',
+    },
+  ],
+  certificate: [
+    {
+      required: true,
+      message: '请输入证书!',
+      trigger: 'change',
+    },
+  ],
+};
 onMounted(() => {
   identitySetting.value = props.formData;
 });
@@ -102,7 +101,9 @@ const next = () => {
     current: 3,
     formData: identitySetting.value,
   };
-  emit('getDatas', datas);
+  formRef.value.validate().then(success => {
+    emit('getDatas', datas);
+  });
 };
 </script>
 

+ 1 - 0
src/identity/CreateIdentity.vue

@@ -283,6 +283,7 @@ const imgToBase64 = () => {
   image.onload = function () {
     let base64 = imageToBase64(image); //图片转base64
     identityInfo.file = base64toFile(base64, logoName.value); //base64转File
+    identityInfo.logo.push(identityInfo.file);
   };
 };
 

+ 1 - 2
src/identity/IdentityManager.vue

@@ -8,7 +8,6 @@
       class="commonTable"
       :have-page="false"
       :is-loading="isLoading"
-      :scroll-value="{ y: '70vh' }"
       :columns="identityColumns"
       :data-source="identityDatas"
     >
@@ -57,7 +56,7 @@ import { useRouter } from 'vue-router';
 import Common from '../common/Common.js';
 import { message, Modal } from 'ant-design-vue';
 import { ref, onMounted, createVNode } from 'vue';
-import CommonTable from '../print/CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { DownOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import {
   tableColumns,

+ 8 - 5
src/print/PrintCard.vue

@@ -106,8 +106,8 @@
           :is-loading="isLoading"
           :is-select="isSelect"
           :data-source="dataSource"
-          @select-column="selectColumn"
-          @page-params="getPageParams"
+          @get-selected="selectColumn"
+          @get-pager="getPageParams"
         >
           <template #bodyCell="{ column, record }">
             <template v-if="column.key === 'imageUrl'">
@@ -180,7 +180,7 @@ import Common from '../common/Common';
 import CreateJPEG from '../common/X6';
 import { message } from 'ant-design-vue';
 import { base64toFile } from '../common/X6';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { SqlApi, Notify } from 'pc-component-v3';
 import { getImageSrc } from '../common/image-src';
 import { ref, reactive, onMounted, watch } from 'vue';
@@ -313,8 +313,8 @@ const searchPrintInfo = () => {
   }
 };
 // 获取所选项的数据
-const selectColumn = rows => {
-  select.selectedRows = rows;
+const selectColumn = selected => {
+  select.selectedRows = selected.selectedRows;
   // console.log('onSelectChange', select.selectedRows);
 };
 // 展开打印框
@@ -595,4 +595,7 @@ const init = () => {
 .full-modal .ant-modal-body {
   flex: 1;
 }
+.ant-divider-horizontal{
+  margin: 4px 0;
+}
 </style>

+ 24 - 16
src/printer/PrinterConfiguration.vue

@@ -2,21 +2,11 @@
   <Navbar title="设备管理" :is-go-back="false" />
   <main>
     <a-button @click="editPrinter(true)">添加打印机</a-button>
-    <CommonTable
-      id="printTable"
-      :have-page="false"
-      :y-scroll="yScroll"
-      :columns="printerColumns"
-      :data-source="printerDatas"
-    >
+    <CommonTable :columns="printerColumns" :data-source="printerDatas">
       <template #bodyCell="{ record, column }">
         <template v-if="column.key === 'supportRfid'">
-          <span v-if="record.supportRfid === true">
-            是
-          </span>
-          <span v-else>
-            否
-          </span>
+          <span v-if="record.supportRfid === true"> 是 </span>
+          <span v-else> 否 </span>
         </template>
         <template v-if="column.key === 'operation'">
           <span>
@@ -146,6 +136,25 @@
             </a-form-item>
           </a-col>
         </a-row>
+        <a-row :gutter="24">
+          <a-col :span="11">
+            <a-form-item
+              label="打印机分辨率"
+              :label-col="{ span: 8 }"
+              :wrapper-col="{ span: 16 }"
+            >
+              <a-select
+                v-model:value="printerState.printheads"
+                style="width: 220px"
+              >
+                <a-select-option :value="6">152.4</a-select-option>
+                <a-select-option :value="8">203.2</a-select-option>
+                <a-select-option :value="12">304.8</a-select-option>
+                <a-select-option :value="24">609.6</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
       </a-form>
     </a-modal>
   </main>
@@ -165,7 +174,6 @@ import {
   queryAllPrinters,
 } from '../api/printer/printerConfiguration.js';
 
-const yScroll = ref();
 const editTitle = ref('');
 const printerDatas = ref([]);
 const printerNames = ref([]);
@@ -179,7 +187,8 @@ const printerState = ref({
   backLength: 0,
   offsetHeight: 0,
   offsetWidth: 0,
-  darkness: 15,
+  darkness: 30,
+  printheads: 8,
 });
 const base = reactive({
   clientId: '',
@@ -202,7 +211,6 @@ const editPrinter = (flag, record) => {
 onMounted(() => {
   base.clientId = JSON.parse(localStorage.getItem('#LoginInfo')).loginClientId;
   createState.value = JSON.parse(JSON.stringify(printerState.value));
-  yScroll.value = getTableScroll({ id: 'printTable' });
   getMacAddress();
   queryPrinters();
 });

+ 1 - 1
src/printer/configData.js

@@ -21,7 +21,7 @@ export const tableColumns =
       width: 150,
     },
     {
-      title: '是否支持rfid',
+      title: '是否支持Rfid',
       key: 'supportRfid',
       dataIndex: 'supportRfid',
       width: 150,

+ 5 - 27
src/workflow/ExecutionList.vue

@@ -61,14 +61,13 @@
             <button class="btn btn-info" @click="changeFilterData">查询</button>
           </div>
         </div>
-        <ul />
-        <div class="flex-content">
+        <div>
           <CommonTable
             ref="table"
             :columns="columns"
             :data-source="taskInstanceDtos"
             :total="pagination.total"
-            @get-page="getPageParams"
+            @get-pager="getPageParams"
           >
             <template #headerCell="{ column }">
               <template v-if="column.key == 'httpRequestType'">
@@ -148,8 +147,10 @@ import TaskInstanceResource from '../api/base/TaskInstanceResource.js';
 import TaskDefineResource from '../api/task/TaskDefineResource.js';
 import vSelect from 'vue-select';
 import 'vue-select/dist/vue-select.css';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
+
 export default {
+  
   components: {
     vSelect,
     CommonTable,
@@ -249,15 +250,6 @@ export default {
     var _self = this;
     _self.getAllTaskDefineDtos();
     _self.getDatas();
-    // $('.fixed-table').tableFixer({
-    //   left: 3,
-    //   head: true,
-    // });
-
-    // $('.fixed-table').colResizable({
-    //   resizeMode: 'overflow',
-    //   partialRefresh: true,
-    // });
   },
 
   methods: {
@@ -275,7 +267,6 @@ export default {
     },
     changeFilterData: function () {
       var _self = this;
-      // _self.getDatas();
       _self.$refs.table.backFirstPage();
     },
     getAllTaskDefineDtos: function () {
@@ -332,7 +323,6 @@ export default {
             );
           }
 
-          _self.fixedTableHeader();
         },
         errorData => {
           _self.loading = false;
@@ -340,18 +330,6 @@ export default {
         },
       );
     },
-    /**
-     * 冻结表头
-     */
-    fixedTableHeader: function () {
-      const _self = this;
-      _self.$nextTick(function () {
-        $('.fixed-table').tableFixer({
-          left: 3,
-          head: true,
-        });
-      });
-    },
   },
 };
 </script>

+ 2 - 2
src/workflow/TaskProcessManagement.vue

@@ -474,7 +474,7 @@
       :total="pagination.total"
       :columns="columns"
       :data-source="taskDefineDtos"
-      @get-page="getPageParams"
+      @get-pager="getPageParams"
     >
       <template #bodyCell="{ column, record }">
         <template v-if="column.key == 'taskType'">
@@ -580,7 +580,7 @@ import UserResource from '../api/base/UserResource.js';
 import GroupResource from '../api/base/GroupResource.js';
 import 'vue-select/dist/vue-select.css';
 import { Notify, Uuid } from 'pc-component-v3';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { message } from 'ant-design-vue';
 import EditTableCell from './EditTableCell.vue';
 export default {

+ 2 - 2
src/workflow/WorkflowEdit.vue

@@ -45,7 +45,7 @@
         :data-source="workflowDatas"
         :total="pagination.total"
         :row-selection="rowSelection"
-        @get-page="getPageParams"
+        @get-pager="getPageParams"
       >
         <template #headerCell="{ column }">
           <template v-if="column.dataIndex == 'check'">
@@ -254,7 +254,7 @@ import vSelect from 'vue-select';
 import WorkflowEditResource from './WorkflowEditResource.js';
 import 'vue-select/dist/vue-select.css';
 import { Notify, Uuid } from 'pc-component-v3';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 export default {
   components: {
     'v-select': vSelect,