周兴 2 лет назад
Родитель
Сommit
940b4110cb
1 измененных файлов с 42 добавлено и 54 удалено
  1. 42 54
      src/view/mst/dictionary/index.vue

+ 42 - 54
src/view/mst/dictionary/index.vue

@@ -25,45 +25,42 @@
                   @collapse-change="collapseChange" :set-flag="false"
                   :search-content="searchContent"></SearchCond>
     </div>
-    <div>
-
-      <!--  列表区  -->
-      <div :style="'height: ' + tableHeight+ 'px'"  class="split-div-class">
-        <DkSplit v-model="split">
-          <!-- 左边部分   -->
-          <DkTable slot="left"
-                   ref="leftTable"
-                   :data="searchInfo"
-                   :height="this.tableHeight"
-                   :page-flag="false"
-                   :page-total-flag="false"
-                   :show-setting-flag="false"
-                   :freeze="false"
-                   :choose-flag="false"
-                   @current-change="currentChangeEvent($event)">
-            <DkTableColumn :title="$t('dictionary')" field="dictName"
-                           width="auto" :filter=false :sortable="false"></DkTableColumn>
-          </DkTable>
-          <DkTable slot="right" :id="'table-'+$options.name" ref="table-select" :data="tableData"
-                   :pageFlag="true"
-                   :page-total="pageInfo.total"
-                   :current-page="pageInfo.currentPage"
-                   :choose-flag="false"
-                   :height="tableHeight" primaryKey="dataId"
-                   @pageChange="pageSizeChange">
-            <DkTableColumn field="dataValue" type="link"
-                           @on-link="handleLink(Object.assign($event,{button:'edit'}))"></DkTableColumn>
-            <DkTableColumn field="displayNo"></DkTableColumn>
-            <DkTableColumn field="flgValid" type="switch" @on-switch-change="onSwitchChange"
-                           :switch-disabled="false"></DkTableColumn>
-            <DkTableColumn field="remarks" width="auto"></DkTableColumn>
-          </DkTable>
-        </DkSplit>
-
-      </div>
 
+    <!--  列表区  -->
+    <div :style="'height: ' + tableHeight+ 'px'" class="split-div-class">
+      <DkSplit v-model="split">
+        <!-- 左边部分   -->
+        <DkTable slot="left"
+                 ref="leftTable"
+                 :data="searchInfo"
+                 :height="this.tableHeight"
+                 :page-flag="false"
+                 :page-total-flag="false"
+                 :show-setting-flag="false"
+                 :freeze="false"
+                 :choose-flag="false"
+                 @current-change="currentChangeEvent($event)">
+          <DkTableColumn :title="$t('dictCode')" field="dictName"
+                         width="auto" :filter=false :sortable="false"></DkTableColumn>
+        </DkTable>
+        <DkTable slot="right" :id="'table-'+$options.name" ref="table-select" :data="tableData"
+                 :pageFlag="true"
+                 :page-total="pageInfo.total"
+                 :current-page="pageInfo.currentPage"
+                 :choose-flag="false"
+                 :height="tableHeight" primaryKey="dataId"
+                 @pageChange="pageSizeChange">
+          <DkTableColumn field="dataValue" type="link"
+                         @on-link="handleLink(Object.assign($event,{button:'edit'}))"></DkTableColumn>
+          <DkTableColumn field="displayNo"></DkTableColumn>
+          <DkTableColumn field="flgValid" type="switch" @on-switch-change="onSwitchChange"
+                         :switch-disabled="false"></DkTableColumn>
+          <DkTableColumn field="remarks" width="auto"></DkTableColumn>
+        </DkTable>
+      </DkSplit>
 
     </div>
+
     <!--新建编辑-->
     <DkModal
       :loading="loading"
@@ -132,7 +129,6 @@ export default {
      */
     currentChangeEvent({row}) {
       if (row != null) {
-        console.log("woawia", row)
         this.dictCodeType = row.dictCode
         // 导出额外的条件
         this.exportCondition = {dictCode: this.dictCodeType}
@@ -168,8 +164,8 @@ export default {
      *   @date   : 2022/12/21
      *   @author : 洪旭东
      */
-    getData(params){
-         // return this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params);
+    getData(params) {
+      // return this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params);
       this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
           this.tableData = res.data.list
@@ -203,17 +199,6 @@ export default {
         }
       })
     },
-    /**
-     * @desc   : 调用同一路由,需要使用这个方法去设置created的方法
-     * @author : 周兴
-     * @date   : 2023/2/8 12:55
-     */
-    createdInit() {
-      this.primaryKey = 'dataId'     // 设置主键
-      this.routeObjName = 'dictionaryData'  // 设置路由名称
-      this.getDataKindData() //获取数据字典数据
-
-    },
     // endregion
 
     // region 新建/编辑操作
@@ -231,7 +216,7 @@ export default {
         remarks: ''
       }
       // 加载最大序号
-      this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \''+this.dictCodeType+'\''});
+      this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \'' + this.dictCodeType + '\''});
     },
     /**
      *   @desc   : 给参数赋值
@@ -258,7 +243,7 @@ export default {
      *   @author : 洪旭东
      */
     add() {
-      this.modalTitle = this.setTitle(this.$config.formMode.add, this.formType)
+      this.modalTitle = this.setTitle(this.$config.formMode.add, this.$t('dictionary'))
       this.modalParams = {
         button: this.$config.formMode.add,
       }
@@ -272,7 +257,7 @@ export default {
     initData(type) {
       if (type === this.$config.formMode.add) {
         // 加载最大序号
-        this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \''+this.dictCodeType+'\''});
+        this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \'' + this.dictCodeType + '\''});
       }
     },
     /**
@@ -285,7 +270,7 @@ export default {
         button: this.$config.formMode.edit,
         closeFlag: true
       }
-      this.modalTitle = this.setTitle(this.$config.formMode.edit, this.formType)
+      this.modalTitle = this.setTitle(this.$config.formMode.edit, this.$t('dictionary'))
       if (rows.length > 0) {
         this.detail(rows[0].dataId)
       }
@@ -307,6 +292,9 @@ export default {
     // endregion
   },
   created() {
+    this.primaryKey = 'dataId'     // 设置主键
+    this.routeObjName = 'dictionaryData'  // 设置路由名称
+    this.getDataKindData() //获取数据字典数据
     this.initSearchFlag = false;  // 初始不进行默认查询
   },
 }