|  | @@ -1,42 +1,47 @@
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  | -  <el-card>
 |  | 
 | 
											
												
													
														|  | -    <div class="mb10 fx-row fx-end-cen">
 |  | 
 | 
											
												
													
														|  | -      <el-button icon="el-icon-refresh" circle @click="handleQuery"></el-button>
 |  | 
 | 
											
												
													
														|  | -    </div>
 |  | 
 | 
											
												
													
														|  | -    <dynamic-table :rows="rows" :columns="columns">
 |  | 
 | 
											
												
													
														|  | -      <template #index="{$index}">
 |  | 
 | 
											
												
													
														|  | -        {{ (queryParams.pageNum - 1) * queryParams.pageSize + $index + 1 }}
 |  | 
 | 
											
												
													
														|  | -      </template>
 |  | 
 | 
											
												
													
														|  | -      <template #type="{display}">
 |  | 
 | 
											
												
													
														|  | -        {{ translateType(display) }}
 |  | 
 | 
											
												
													
														|  | -      </template>
 |  | 
 | 
											
												
													
														|  | -      <template #action="{row}">
 |  | 
 | 
											
												
													
														|  | -        <div>
 |  | 
 | 
											
												
													
														|  | -          <el-button v-if="row.type == paperWorkType.value" type="text" icon="el-icon-edit"
 |  | 
 | 
											
												
													
														|  | -                     @click="clickEditPaper(row)">编辑
 |  | 
 | 
											
												
													
														|  | -          </el-button>
 |  | 
 | 
											
												
													
														|  | -          <el-button type="text" icon="el-icon-connection" @click="clickPublish(row)">
 |  | 
 | 
											
												
													
														|  | -            发布
 |  | 
 | 
											
												
													
														|  | -            <template v-if="row.publishedCount">({{ row.publishedCount }})</template>
 |  | 
 | 
											
												
													
														|  | -          </el-button>
 |  | 
 | 
											
												
													
														|  | -        </div>
 |  | 
 | 
											
												
													
														|  | -      </template>
 |  | 
 | 
											
												
													
														|  | -    </dynamic-table>
 |  | 
 | 
											
												
													
														|  | -    <pagination v-if="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
 |  | 
 | 
											
												
													
														|  | -                @pagination="getList"></pagination>
 |  | 
 | 
											
												
													
														|  | -    <upload-dialog
 |  | 
 | 
											
												
													
														|  | -      v-if="uploadOption.dialogVisible"
 |  | 
 | 
											
												
													
														|  | -      scene="发布"
 |  | 
 | 
											
												
													
														|  | -      :title="uploadOption.title"
 |  | 
 | 
											
												
													
														|  | -      :pageName="uploadOption.pageName"
 |  | 
 | 
											
												
													
														|  | -      :isZdy="false"
 |  | 
 | 
											
												
													
														|  | -      :selectType="uploadOption.selectType"
 |  | 
 | 
											
												
													
														|  | -      :dialogVisible="uploadOption.dialogVisible"
 |  | 
 | 
											
												
													
														|  | -      :default-selected="uploadOption.defaultSelected"
 |  | 
 | 
											
												
													
														|  | -      @handleClose="handleUploadReady"
 |  | 
 | 
											
												
													
														|  | -      @dialogVisibleClose="uploadOption.dialogVisible=false"
 |  | 
 | 
											
												
													
														|  | -    ></upload-dialog>
 |  | 
 | 
											
												
													
														|  | -  </el-card>
 |  | 
 | 
											
												
													
														|  | 
 |  | +  <div>
 | 
											
												
													
														|  | 
 |  | +    <el-card>
 | 
											
												
													
														|  | 
 |  | +      <mx-condition :query-params="condition" use-alias-mapping @query="handleQuery"></mx-condition>
 | 
											
												
													
														|  | 
 |  | +      <mx-search-group justify="end" v-model="queryParams.keyword"
 | 
											
												
													
														|  | 
 |  | +                       @search="queryParams.pageNum=1,getList()">
 | 
											
												
													
														|  | 
 |  | +      </mx-search-group>
 | 
											
												
													
														|  | 
 |  | +    </el-card>
 | 
											
												
													
														|  | 
 |  | +    <el-card>
 | 
											
												
													
														|  | 
 |  | +      <dynamic-table :rows="rows" :columns="columns">
 | 
											
												
													
														|  | 
 |  | +        <template #index="{$index}">
 | 
											
												
													
														|  | 
 |  | +          {{ (queryParams.pageNum - 1) * queryParams.pageSize + $index + 1 }}
 | 
											
												
													
														|  | 
 |  | +        </template>
 | 
											
												
													
														|  | 
 |  | +        <template #type="{display}">
 | 
											
												
													
														|  | 
 |  | +          {{ translateType(display) }}
 | 
											
												
													
														|  | 
 |  | +        </template>
 | 
											
												
													
														|  | 
 |  | +        <template #action="{row}">
 | 
											
												
													
														|  | 
 |  | +          <div>
 | 
											
												
													
														|  | 
 |  | +            <el-button v-if="row.type == paperWorkType.value" type="text" icon="el-icon-edit"
 | 
											
												
													
														|  | 
 |  | +                       @click="clickEditPaper(row)">编辑
 | 
											
												
													
														|  | 
 |  | +            </el-button>
 | 
											
												
													
														|  | 
 |  | +            <el-button type="text" icon="el-icon-connection" @click="clickPublish(row)">
 | 
											
												
													
														|  | 
 |  | +              发布
 | 
											
												
													
														|  | 
 |  | +              <template v-if="row.publishedCount">({{ row.publishedCount }})</template>
 | 
											
												
													
														|  | 
 |  | +            </el-button>
 | 
											
												
													
														|  | 
 |  | +          </div>
 | 
											
												
													
														|  | 
 |  | +        </template>
 | 
											
												
													
														|  | 
 |  | +      </dynamic-table>
 | 
											
												
													
														|  | 
 |  | +      <pagination v-if="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
 | 
											
												
													
														|  | 
 |  | +                  @pagination="getList"></pagination>
 | 
											
												
													
														|  | 
 |  | +      <upload-dialog
 | 
											
												
													
														|  | 
 |  | +        v-if="uploadOption.dialogVisible"
 | 
											
												
													
														|  | 
 |  | +        scene="发布"
 | 
											
												
													
														|  | 
 |  | +        :title="uploadOption.title"
 | 
											
												
													
														|  | 
 |  | +        :pageName="uploadOption.pageName"
 | 
											
												
													
														|  | 
 |  | +        :isZdy="false"
 | 
											
												
													
														|  | 
 |  | +        :selectType="uploadOption.selectType"
 | 
											
												
													
														|  | 
 |  | +        :dialogVisible="uploadOption.dialogVisible"
 | 
											
												
													
														|  | 
 |  | +        :default-selected="uploadOption.defaultSelected"
 | 
											
												
													
														|  | 
 |  | +        @handleClose="handleUploadReady"
 | 
											
												
													
														|  | 
 |  | +        @dialogVisibleClose="uploadOption.dialogVisible=false"
 | 
											
												
													
														|  | 
 |  | +      ></upload-dialog>
 | 
											
												
													
														|  | 
 |  | +    </el-card>
 | 
											
												
													
														|  | 
 |  | +  </div>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
										
											
												
													
														|  | @@ -45,17 +50,23 @@ import { getHomeworks, getHomeworkStudents, publicStudentHomework } from '@/api/
 | 
											
												
													
														|  |  import consts from '@/common/mx-const'
 |  |  import consts from '@/common/mx-const'
 | 
											
												
													
														|  |  import { download, listCustomerPaperQeustions } from '@/api/webApi/webQue'
 |  |  import { download, listCustomerPaperQeustions } from '@/api/webApi/webQue'
 | 
											
												
													
														|  |  import { mapGetters } from 'vuex'
 |  |  import { mapGetters } from 'vuex'
 | 
											
												
													
														|  | 
 |  | +import MxCondition from '@/components/MxCondition/mx-condition'
 | 
											
												
													
														|  | 
 |  | +import MxSearchGroup from '@/components/MxSearch/mx-search-group'
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
												
													
														|  |    name: 'paper-work-publish',
 |  |    name: 'paper-work-publish',
 | 
											
												
													
														|  | -  components: { DynamicTable },
 |  | 
 | 
											
												
													
														|  | 
 |  | +  components: { MxSearchGroup, MxCondition, DynamicTable },
 | 
											
												
													
														|  |    data() {
 |  |    data() {
 | 
											
												
													
														|  |      return {
 |  |      return {
 | 
											
												
													
														|  |        extraData: { type: consts.enum.generateScene.paperWork.value },
 |  |        extraData: { type: consts.enum.generateScene.paperWork.value },
 | 
											
												
													
														|  |        paperWorkType: Object.freeze(consts.enum.homeworkTypes.find(t => t.value == 1)),
 |  |        paperWorkType: Object.freeze(consts.enum.homeworkTypes.find(t => t.value == 1)),
 | 
											
												
													
														|  | 
 |  | +      condition: { homeworkType: '' },
 | 
											
												
													
														|  | 
 |  | +      conditionOutput: null,
 | 
											
												
													
														|  |        queryParams: {
 |  |        queryParams: {
 | 
											
												
													
														|  |          pageNum: 1,
 |  |          pageNum: 1,
 | 
											
												
													
														|  | -        pageSize: 20
 |  | 
 | 
											
												
													
														|  | 
 |  | +        pageSize: 20,
 | 
											
												
													
														|  | 
 |  | +        keyword: '',
 | 
											
												
													
														|  | 
 |  | +        type: ''
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  |        columns: [
 |  |        columns: [
 | 
											
												
													
														|  |          { prop: 'id', label: '序号', width: '80px', slotBody: 'index' },
 |  |          { prop: 'id', label: '序号', width: '80px', slotBody: 'index' },
 | 
											
										
											
												
													
														|  | @@ -82,12 +93,14 @@ export default {
 | 
											
												
													
														|  |      this.getList()
 |  |      this.getList()
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    methods: {
 |  |    methods: {
 | 
											
												
													
														|  | -    handleQuery() {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    handleQuery(model) {
 | 
											
												
													
														|  |        this.queryParams.pageNum = 1
 |  |        this.queryParams.pageNum = 1
 | 
											
												
													
														|  | 
 |  | +      this.conditionOutput = model
 | 
											
												
													
														|  |        this.getList()
 |  |        this.getList()
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      async getList() {
 |  |      async getList() {
 | 
											
												
													
														|  | -      const res = await getHomeworks(this.queryParams)
 |  | 
 | 
											
												
													
														|  | 
 |  | +      const query = Object.assign(this.queryParams, this.conditionOutput)
 | 
											
												
													
														|  | 
 |  | +      const res = await getHomeworks(query)
 | 
											
												
													
														|  |        this.rows = res.rows || res.data
 |  |        this.rows = res.rows || res.data
 | 
											
												
													
														|  |        this.total = res.total || this.rows.length
 |  |        this.total = res.total || this.rows.length
 | 
											
												
													
														|  |      },
 |  |      },
 |