yusheng 10 月之前
父節點
當前提交
b79e45e73b
共有 2 個文件被更改,包括 331 次插入225 次删除
  1. 152 42
      src/views/doc/components/file-search.vue
  2. 179 183
      src/views/doc/components/file-table-list.vue

+ 152 - 42
src/views/doc/components/file-search.vue

@@ -1,46 +1,154 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form
-    size="small"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-    style="width: 500px; display: inline-block"
-  >
-    <el-row :gutter="24">
-      <el-col :span="10">
-        <el-form-item label="文档名称" label-width="80px">
-          <el-input
-            clearable
-            size="small"
-            v-model.trim="where.name"
-            placeholder="请输入文档名称"
-          />
-        </el-form-item>
-      </el-col>
-      <el-col :span="14">
-        <el-form-item label="文档编码" label-width="80px">
-          <el-input
-            clearable
-            size="small"
-            v-model.trim="where.code"
-            placeholder="请输入文档编码"
-            style="width: 65%;"
-          />
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-            style="margin-left: 5px;"
-          >
-            查询
-          </el-button>
-        </el-form-item>
-      </el-col>
-    </el-row>
-  </el-form>
+  <div style="display: flex; align-items: center">
+    <el-form
+      size="small"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+      style="width: 260px; display: inline-block;"
+    >
+      <el-form-item label="文档名称" label-width="80px">
+        <el-input
+          clearable
+          size="small"
+          v-model.trim="where.name"
+          placeholder="请输入文档名称"
+        />
+      </el-form-item>
+    </el-form>
+    <el-button
+      size="small"
+      type="primary"
+      icon="el-icon-search"
+      class="ele-btn-icon"
+      @click="search"
+    >
+      查询
+    </el-button>
+    <el-popover
+      placement="bottom"
+      title="查询"
+      width="600"
+      trigger="manual"
+      v-model="visible"
+    >
+      <el-form
+        size="small"
+        class="ele-form-search"
+        @keyup.enter.native="search"
+        @submit.native.prevent
+        style="width: 500px; display: inline-block"
+      >
+        <el-row :gutter="24">
+          <el-col :span="24">
+            <el-form-item label="文档名称" label-width="80px">
+              <el-input
+                clearable
+                size="small"
+                v-model.trim="where.name"
+                placeholder="请输入文档名称"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="文档编码" label-width="80px">
+              <el-input
+                clearable
+                size="small"
+                v-model.trim="where.code"
+                placeholder="请输入文档编码"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <div style="justify-content: flex-end; display: flex">
+              <el-button size="small" @click="visible = false">
+                关闭
+              </el-button>
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-search"
+                class="ele-btn-icon"
+                @click="search"
+                style="margin-left: 5px"
+              >
+                查询
+              </el-button>
+              <el-button size="small" @click="reset" style="margin-left: 5px">
+                重置
+              </el-button>
+            </div>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-button
+        size="small"
+        type="primary"
+        icon="el-icon-search"
+        class="ele-btn-icon"
+        slot="reference"
+        style="margin-left: 5px;"
+        @click="visible = !visible"
+      >
+        更多查询
+      </el-button>
+    </el-popover>
+  </div>
+
+  <!-- <div>
+    <ele-modal
+      custom-class="ele-dialog-form long-dialog-form"
+      :centered="true"
+      :visible.sync="visible"
+      :title="title"
+      width="600px"
+      :maxable="true"
+      :resizable="true"
+    >
+      <el-form
+        size="small"
+        class="ele-form-search"
+        @keyup.enter.native="search"
+        @submit.native.prevent
+        style="width: 500px; display: inline-block"
+      >
+        <el-row :gutter="24">
+          <el-col :span="24">
+            <el-form-item label="文档名称" label-width="80px">
+              <el-input
+                clearable
+                size="small"
+                v-model.trim="where.name"
+                placeholder="请输入文档名称"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="文档编码" label-width="80px">
+              <el-input
+                clearable
+                size="small"
+                v-model.trim="where.code"
+                placeholder="请输入文档编码"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </ele-modal>
+    <el-button
+      size="small"
+      type="primary"
+      icon="el-icon-search"
+      class="ele-btn-icon"
+      @click="visible = true"
+      style="margin-left: 5px"
+    >
+      查询
+    </el-button>
+  </div> -->
 </template>
 
 <script>
@@ -54,7 +162,8 @@
       };
       return {
         // 表单数据
-        where: { ...defaultWhere }
+        where: { ...defaultWhere },
+        visible: false
       };
     },
     computed: {
@@ -67,6 +176,7 @@
       /* 搜索 */
       search() {
         this.$emit('search', this.where);
+        this.visible = false;
       },
       /*  重置 */
       reset() {

+ 179 - 183
src/views/doc/components/file-table-list.vue

@@ -7,7 +7,7 @@
       :datasource="datasource"
       height="calc(45vh)"
       tool-class="ele-toolbar-form"
-      :initLoad="false"
+       :initLoad="false"
       row-key="id"
       :current.sync="current"
       :selection.sync="selection"
@@ -15,212 +15,207 @@
       @row-click="rowClick"
       @selection-change="selectionClick"
       @done="done"
-      :page-size="20"
       :toolbar="!isPop"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <div style="display: flex; flex-wrap: wrap; align-items: center">
-          <div>
-            <el-dropdown trigger="click" v-if="lcyStatus == 1">
-              <el-button type="primary">
-                新建<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item
-                  @click.native="
-                    parenOpen('add', {
-                      power: 'add',
-                      dataKey: 'parentData',
-                      isArr: false
-                    })
-                  "
-                  >新建文件夹</el-dropdown-item
-                >
-                <el-dropdown-item
-                  @click.native="
-                    openEdit('add', '', {
-                      power: 'add',
-                      dataKey: 'parentData',
-                      isArr: false
-                    })
-                  "
-                  >新建文档</el-dropdown-item
-                >
-              </el-dropdown-menu>
-            </el-dropdown>
-            <el-dropdown trigger="click" v-if="lcyStatus == 1">
-              <el-button type="primary">
-                编辑<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item
-                  @click.native="
-                    parenOpen('edit', {
-                      power: 'revise',
-                      dataKey: 'parentData',
-                      isArr: false
-                    })
-                  "
-                  >修改</el-dropdown-item
-                >
-                <el-dropdown-item
-                  @click.native="
-                    parenOpen('del', {
-                      power: 'del',
-                      dataKey: 'parentData',
-                      isArr: false
-                    })
-                  "
-                  >删除</el-dropdown-item
-                >
-              </el-dropdown-menu>
-            </el-dropdown>
-            <el-button
-              v-if="lcyStatus == 1"
-              type="primary"
+        <!-- <div style="display: contents;"> -->
+          <el-dropdown trigger="click" v-if="lcyStatus == 1">
+          <el-button type="primary">
+            新建<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
               @click.native="
-                openEditAll({
+                parenOpen('add', {
                   power: 'add',
                   dataKey: 'parentData',
                   isArr: false
                 })
               "
+              >新建文件夹</el-dropdown-item
             >
-              批量上传
-            </el-button>
-            <el-button
-              type="primary"
+            <el-dropdown-item
               @click.native="
-                checkEnter({
-                  power: 'checkEnter',
-                  dataKey: 'current',
-                  isArr: true
+                openEdit('add', '', {
+                  power: 'add',
+                  dataKey: 'parentData',
+                  isArr: false
                 })
               "
-              :disabled="
-                selection.length > 1 || selection[0]?.checkOutStatus == 0
-              "
-              v-if="lcyStatus == 1"
+              >新建文档</el-dropdown-item
             >
-              检入
-            </el-button>
-            <el-button
-              type="primary"
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-dropdown trigger="click" v-if="lcyStatus == 1">
+          <el-button type="primary">
+            编辑<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
               @click.native="
-                checkOut({
-                  power: 'checkOut',
-                  dataKey: 'current',
-                  isArr: true
-                })
-              "
-              :disabled="
-                selection.length > 1 || selection[0]?.checkOutStatus == 1
-              "
-              v-if="lcyStatus == 1"
-            >
-              检出
-            </el-button>
-
-            <el-popconfirm
-              class="ele-action"
-              v-if="lcyStatus == 1 && fileType === 0"
-              title="归档后文档无法修改,是否确认归档"
-              @confirm="
-                updateLcyStatus({
-                  power: 'archive',
-                  dataKey: 'current',
-                  isArr: true
+                parenOpen('edit', {
+                  power: 'revise',
+                  dataKey: 'parentData',
+                  isArr: false
                 })
               "
+              >修改</el-dropdown-item
             >
-              <template v-slot:reference>
-                <el-button type="primary"> 归档 </el-button>
-              </template>
-            </el-popconfirm>
-            <el-button
-              type="primary"
-              v-if="lcyStatus == 2"
-              @click="
-                noUpdateLcyStatus({
-                  power: 'cancelArchive',
-                  dataKey: 'current',
-                  isArr: true
+            <el-dropdown-item
+              @click.native="
+                parenOpen('del', {
+                  power: 'del',
+                  dataKey: 'parentData',
+                  isArr: false
                 })
               "
+              >删除</el-dropdown-item
             >
-              取消归档
-            </el-button>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-button
+          v-if="lcyStatus == 1"
+          type="primary"
+          @click.native="
+            openEditAll({
+              power: 'add',
+              dataKey: 'parentData',
+              isArr: false
+            })
+          "
+        >
+          批量上传
+        </el-button>
 
-            <el-button
-              type="primary"
-              v-if="
-                (lcyStatus == 1 || lcyStatus == 2) &&
-                (fileType == 0 || fileType == 1)
-              "
-              @click="
-                openSendEdit({
-                  power: 'release',
-                  dataKey: 'current',
-                  isArr: true
-                })
-              "
-            >
-              发布
-            </el-button>
-            <el-button
-              v-if="fileType == 2"
-              type="primary"
-              @click="processSubmit_template"
-            >
-              发布
-            </el-button>
+    
+        <el-button
+          type="primary"
+          @click.native="
+            checkEnter({
+              power: 'checkEnter',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+          :disabled="selection.length > 1 || selection[0]?.checkOutStatus == 0"
+          v-if="lcyStatus == 1"
+        >
+          检入
+        </el-button>
+        <el-button
+          type="primary"
+          @click.native="
+            checkOut({
+              power: 'checkOut',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+          :disabled="selection.length > 1 || selection[0]?.checkOutStatus == 1"
+          v-if="lcyStatus == 1"
+        >
+          检出
+        </el-button>
 
-            <el-button
-              v-if="fileType === 0 && lcyStatus != 4"
-              type="primary"
-              :disabled="selection.length > 1"
-              @click="
-                processSubmit({
-                  power: 'abolish',
-                  dataKey: 'current',
-                  isArr: true
-                })
-              "
-            >
-              废止
-            </el-button>
+        <el-popconfirm
+          class="ele-action"
+          v-if="lcyStatus == 1 && fileType === 0"
+          title="归档后文档无法修改,是否确认归档"
+          @confirm="
+            updateLcyStatus({
+              power: 'archive',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+        >
+          <template v-slot:reference>
+            <el-button type="primary"> 归档 </el-button>
+          </template>
+        </el-popconfirm>
+        <el-button
+          type="primary"
+          v-if="lcyStatus == 2"
+          @click="
+            noUpdateLcyStatus({
+              power: 'cancelArchive',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+        >
+          <!-- {
+              power: 'cancelArchive',
+              dataKey: 'current',
+              isArr: true
+            } -->
+          取消归档
+        </el-button>
 
-            <el-button
-              type="primary"
-              @click.native="
-                getFile({
-                  power: 'download',
-                  dataKey: 'current',
-                  isArr: true
-                })
-              "
-            >
-              下载
-            </el-button>
-            <el-button
-              :disabled="selection.length > 1"
-              type="primary"
-              v-if="fileType == 1"
-              @click.native="move"
-            >
-              移动
-            </el-button>
-          </div>
-          <div>
-            <fileSearch
-              @search="reload"
-              style="margin-left: 20px; "
-            ></fileSearch
-          ></div>
-        </div>
+        <el-button
+          type="primary"
+          v-if="
+            (lcyStatus == 1 || lcyStatus == 2) &&
+            (fileType == 0 || fileType == 1)
+          "
+          @click="
+            openSendEdit({
+              power: 'release',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+        >
+          发布
+        </el-button>
+        <el-button
+          v-if="fileType == 2"
+          type="primary"
+          @click="processSubmit_template"
+        >
+          发布
+        </el-button>
+
+        <el-button
+          v-if="fileType === 0 && lcyStatus != 4"
+          type="primary"
+          :disabled="selection.length > 1"
+          @click="
+            processSubmit({
+              power: 'abolish',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+        >
+          废止
+        </el-button>
 
+        <!-- <el-button type="primary"> 上传 </el-button> -->
+        <el-button
+          type="primary"
+          @click.native="
+            getFile({
+              power: 'download',
+              dataKey: 'current',
+              isArr: true
+            })
+          "
+        >
+          下载
+        </el-button>
+        <el-button
+          :disabled="selection.length > 1"
+          type="primary"
+          v-if="fileType == 1"
+          @click.native="move"
+        >
+          移动
+        </el-button>
+        <fileSearch @search="reload" style="margin-left: 20px;"></fileSearch>
         <!-- </div> -->
+       
       </template>
 
       <!-- 操作列 -->
@@ -604,7 +599,8 @@
             directoryId: this.parentData?.id,
             lcyStatus: this.lcyStatus,
             fileType: this.fileType,
-            isQueryAll: this.$hasPermission('fm:doc:viewAll') ? 1 : ''
+            isQueryAll:this.$hasPermission('fm:doc:viewAll')?1:''
+            
           });
         }
       },
@@ -920,7 +916,7 @@
   .el-tabs__content {
     height: calc(100% - 39px);
   }
-  :deep(.ele-table-tool-title-content) {
-    display: contents;
+  :deep(.ele-table-tool-title-content){
+         display: contents;
   }
 </style>