Ver Fonte

修复查询窗口、日期的控件。

yangzhijie há 4 anos atrás
pai
commit
3a67c8ff5a

+ 5 - 6
examples/App.vue

@@ -1,11 +1,7 @@
 <template>
-  <div class="container bs-docs-container">
+  <div class="container-fluid bs-docs-container">
     <div class="row">
-      <div class="col-md-9">
-        <router-view />
-      </div>
-
-      <div class="col-md-3">
+      <div class="col-md-2">
         <ul class="nav nav-pills nav-stacked">
           <li>
             <router-link :to="{ path: '/desktop/check-box-example'}">复选框</router-link>
@@ -75,6 +71,9 @@
           </li>
         </ul>
       </div>
+      <div class="col-md-10">
+        <router-view />
+      </div>
     </div>
   </div>
 </template>

+ 51 - 0
examples/info/InfoWindowExample.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <InfoWindow :info-window-no="infoWindowNo" :multiple="true" />
+  </div>
+</template>
+<script>
+
+import InfoWindow from '@/info/index.js';
+
+export default {
+  components: {
+    InfoWindow,
+  },
+
+  props: {
+    
+  },
+
+  data: function () {
+    return {
+      'infoWindowNo': null,
+    };
+  },
+
+  watch: {
+    '$route': function (to, from) {
+      this.getInfoWindowNo();
+    },
+  },
+
+  mounted: function () {
+    this.getInfoWindowNo();
+  },
+
+  methods: {    
+    /**
+     * 获取查询窗口的编号
+     */
+    getInfoWindowNo: function () {
+      if (this.$route.params != undefined) {
+        var routeInfoWindowNo = this.$route.params.infoWindowNo;
+        if(this.infoWindowNo != routeInfoWindowNo){
+          this.infoWindowNo = routeInfoWindowNo;
+          console.log('open info window: ' + routeInfoWindowNo);
+        }
+      }
+    },
+  },
+};
+
+</script>

+ 2 - 2
examples/route/index.js

@@ -24,7 +24,7 @@ const SearchWidgetExample = () => import(/* webpackChunkName: "search-widget-exa
 
 
 const ProcessReport = () => import(/* webpackChunkName: "process-report" */ '../../packages/process/src/ProcessReport.vue');
-const InfoWindow = () => import(/* webpackChunkName: "info-window" */ '../../packages/info/src/InfoWindow.vue');
+const InfoWindowExample = () => import(/* webpackChunkName: "info-window" */ '../../examples/info/InfoWindowExample.vue');
 const DocGeneratorSelected = () => import(/* webpackChunkName: "doc-generator-selected" */ '../../packages/info/src/DocGeneratorSelected.vue');
 
 export default {
@@ -103,7 +103,7 @@ export default {
         { path: 'process-report/:no', component: ProcessReport },
 
         /** 查询窗口 */
-        { path: 'info/:infoWindowNo', component: InfoWindow },
+        { path: 'info/:infoWindowNo', component: InfoWindowExample },
 
         /** 查询窗口 */
         { path: 'doc-generator-selected', component: DocGeneratorSelected },

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pc-component-v3",
-  "version": "1.0.15",
+  "version": "1.0.16",
   "description": "",
   "main": "dist/pc-component-v3.js",
   "scripts": {

+ 6 - 0
packages/client-organization/src/ClientOrganization.vue

@@ -97,6 +97,9 @@ export default {
               'name': {
                 'displayValue': [node.name],
               },
+              'organization.name': {
+                'displayValue': [node.name],
+              },
             },
           };
           this.$emit('dataSelected', modelData1);
@@ -108,6 +111,9 @@ export default {
               'name': {
                 'displayValue': [node.name],
               },
+              'organization.name': {
+                'displayValue': [node.name],
+              },
             },
           };
           this.$emit('deleteSelected', modelData1);

+ 1 - 1
packages/common/UserStorageResource.js

@@ -84,7 +84,7 @@ export default {
         url: Common.getApiURL(requestUrl),
         type: 'get',
 				
-        dataType: 'text',
+        dataType: 'json',
 				
 				
         beforeSend: function(request) {

+ 37 - 18
packages/datetime-v2/src/DateTimeV2.vue

@@ -1,5 +1,8 @@
 <template>
-  <div class="datetime-container input-group" :class="{'has-error' : isValid === false}">
+  <div
+    class="datetime-container input-group"
+    :class="{'has-error' : isValid === false}"
+  >
     <input
       id="datetime"
       type="datetime-local"
@@ -17,7 +20,11 @@
       @change="textValueChanged($event)"
     />
 
-    <span v-if="isValid === false" class="glyphicon glyphicon-remove datetime-item-3 form-control-feedback" aria-hidden="true" />
+    <span
+      v-if="isValid === false"
+      class="glyphicon glyphicon-remove datetime-item-3 form-control-feedback"
+      aria-hidden="true"
+    />
   </div>
 </template>
 
@@ -32,13 +39,13 @@ export default {
   },
 
   props: {
-    'dateValue':{
+    'dateValue': {
       type: String,
       default: null,
     },
-    'readonly':{
+    'readonly': {
       type: Boolean,
-      default: null,
+      default: false,
     },
   },
 
@@ -54,8 +61,8 @@ export default {
   computed: {
 
     /**
-         * 把(YYYY-MM-DD HH:mm:ss)格式的日期字符串转换成datetime-local(YYYY-MM-DDTHH:mm:ss)
-         */
+             * 把(YYYY-MM-DD HH:mm:ss)格式的日期字符串转换成datetime-local(YYYY-MM-DDTHH:mm:ss)
+             */
     dateTime: function () {
       if (this.dateValue == null || this.dateValue.length == 0) {
         return null;
@@ -67,7 +74,7 @@ export default {
   },
 
   mounted: function () {
-        
+
   },
 
   methods: {
@@ -76,7 +83,7 @@ export default {
          */
     isValidDateTime: function (text) {
       if (text == null || text.length == 0) {
-        return false;
+        return true;
       }
       return moment(text, 'YYYY-MM-DD HH:mm:ss', true).isValid();
     },
@@ -86,7 +93,11 @@ export default {
 
       // 日期时间校验
       if (this.isValidDateTime(newValue)) {
-        this.isValid = true;
+        if (this.readonly == true && (newValue == null || newValue.length == 0)) {
+          this.isValid = false;
+        } else {
+          this.isValid = true;
+        }
         console.log('DateTimeV2 input value changed: orginal value: %s, current value: %s', this.dateValue, newValue);
         this.$emit('on-value-change', newValue);
       } else {
@@ -96,8 +107,8 @@ export default {
 
 
     /**
-         * 值改变事件
-         */
+             * 值改变事件
+             */
     datetimeLocalValueChanged: function (event) {
       let newValue = event.target.value;
       let parsedDateTime = '';
@@ -107,7 +118,11 @@ export default {
 
       // 日期时间校验
       if (this.isValidDateTime(parsedDateTime)) {
-        this.isValid = true;
+        if (this.readonly == true && (parsedDateTime == null || parsedDateTime.length == 0)) {
+          this.isValid = false;
+        } else {
+          this.isValid = true;
+        }
         console.log('DateTimeV2 value changed: orginal value: %s, current value: %s', newValue, parsedDateTime);
         this.$emit('on-value-change', parsedDateTime);
       } else {
@@ -120,7 +135,7 @@ export default {
 
 <style>
 .form-inline .datetime-container {
-    display : inline-flex !important;
+    display: inline-flex !important;
     vertical-align: middle;
 }
 </style>
@@ -134,8 +149,7 @@ export default {
     vertical-align: middle;
     min-width: 200px;
     /* display : inline-flex; */
-    display : block;
-    
+    display: block;
 }
 
 .datetime-item-1 {
@@ -150,11 +164,16 @@ export default {
     position: absolute;
     border-radius: 4px 0px 0px 4px !important;
     display: inline;
-    width: calc(100% - 45px) !important;
+    width: calc(100% - 39px) !important;
 }
 
 .datetime-item-3 {
-    right: 45px;
+    right: 39px;
+}
+
+/*控制下拉小箭头的*/
+input[type="datetime-local"]::-webkit-calendar-picker-indicator {
+    padding-right: 0px;
 }
 </style>
 

+ 5 - 0
packages/datetime-v2/src/date.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-calendar2-date" viewBox="0 0 16 16">
+  <path d="M6.445 12.688V7.354h-.633A12.6 12.6 0 0 0 4.5 8.16v.695c.375-.257.969-.62 1.258-.777h.012v4.61h.675zm1.188-1.305c.047.64.594 1.406 1.703 1.406 1.258 0 2-1.066 2-2.871 0-1.934-.781-2.668-1.953-2.668-.926 0-1.797.672-1.797 1.809 0 1.16.824 1.77 1.676 1.77.746 0 1.23-.376 1.383-.79h.027c-.004 1.316-.461 2.164-1.305 2.164-.664 0-1.008-.45-1.05-.82h-.684zm2.953-2.317c0 .696-.559 1.18-1.184 1.18-.601 0-1.144-.383-1.144-1.2 0-.823.582-1.21 1.168-1.21.633 0 1.16.398 1.16 1.23z"/>
+  <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H2z"/>
+  <path d="M2.5 4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V4z"/>
+</svg>

+ 2 - 2
packages/info/src/EnumSelectWidgetInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <label :for="'enum-select-widget-' + field.id" class="m-form-group-label">{{ field.name }}</label>
-    <select :id="'enum-select-widget-' + field.id" v-model="selectedValue" class="form-control form-control-complex form-input">
+    <!-- <label :for="'enum-select-widget-' + field.fieldName" class="m-form-group-label">{{ field.name }}</label> -->
+    <select :id="'enum-select-widget-' + field.fieldName" v-model="selectedValue" class="form-control form-control-complex form-input">
       <option value="" />
       <option v-for="keyValue in field.keyValues" :key="keyValue.keyStr" :value="keyValue.keyStr">{{ keyValue.value }}</option>
     </select>

+ 1 - 1
packages/info/src/QueryCondition.vue

@@ -95,7 +95,7 @@ export default {
   },
     
 
-  emits: ['simpleSearch', 'complexSearch', 'refreshSearch', 'executeProcess', 'executeExport'],
+  emits: ['simpleSearch', 'complexSearch', 'refreshSearch', 'executeProcess', 'executeExport', 'changeSearch'],
 
   data: function () {
     return {

+ 8 - 9
packages/info/src/QueryConditionComplex.vue

@@ -10,7 +10,6 @@
           class="form-group m-form-group"
         >
           <label
-            v-if="item.displayType != 'ListBoxEnumEditor'"
             v-tooltip.right="Language.getHelpTrl($i18n.locale, item)"
             :for="item.id"
             class="m-form-group-label"
@@ -221,7 +220,7 @@
           <button
             id="filter"
             type="button"
-            class="btn btn-primary m-btn"
+            class="btn btn-default m-btn"
             @click="complexSearch()"
           >
             {{ $t('lang.QueryConditionComplex.filter') }}
@@ -230,7 +229,7 @@
           <template v-if="!isSearchWidget">
             <button
               type="button"
-              class="btn btn-success m-btn"
+              class="btn btn-default m-btn"
               @click="executeExport()"
             >
               {{ $t('lang.QueryConditionComplex.export') }}
@@ -239,7 +238,7 @@
             <template v-for="infoButton in infoButtons" :key="infoButton.name">
               <button
                 v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)"
-                class="btn btn-info btn-process m-btn"
+                class="btn btn-default btn-process m-btn"
                 @click="executeProcess(infoButton)"
               >
                 {{ Language.getNameTrl($i18n.locale, infoButton) }}
@@ -440,11 +439,11 @@ export default {
     margin-right: 5px !important;
     margin-bottom: 5px !important;
 }
-/* .m-form-group-label{
-		width: 100px;
-		text-align: right;
-		padding-right: 10px;
-	} */
+
+.m-form-group-label{
+		white-space: nowrap;
+    text-overflow: ellipsis;
+} 
 
 @media (max-width: 768px) {
     .m-form-group-label {

+ 9 - 4
packages/info/src/QueryConditionSimple.vue

@@ -15,7 +15,7 @@
         <button
           id="filter"
           type="button"
-          class="btn btn-primary m-btn"
+          class="btn btn-default m-btn"
           @click="simpleSearch()"
         >
           {{ $t('lang.QueryConditionSimple.filter') }}
@@ -24,7 +24,7 @@
         <button
           id="filter"
           type="button"
-          class="btn btn-primary m-btn"
+          class="btn btn-default m-btn"
           @click="refreshSearch()"
         >
           {{ $t('lang.QueryConditionSimple.refresh') }}
@@ -33,7 +33,7 @@
         <template v-if="!isSearchWidget">
           <button
             type="button"
-            class="btn btn-success m-btn"
+            class="btn btn-default m-btn"
             @click="executeExport()"
           >
             {{ $t('lang.QueryConditionSimple.export') }}
@@ -42,7 +42,7 @@
           <template v-for="infoButton in infoButtons" :key="infoButton.name">
             <button
               v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)"
-              class="btn btn-info btn-process m-btn"
+              class="btn btn-default btn-process m-btn"
               @click="executeProcess(infoButton)"
             >
               {{ Language.getNameTrl($i18n.locale, infoButton) }}
@@ -144,4 +144,9 @@ export default {
 .input-simple {
     width: 100% !important;
 }
+
+.m-btn {
+    float: left;
+    margin-right: 5px;
+}
 </style>