shuishen
2024-01-08 e6288c1b70304920c7b94bdebbd6e8bd49be6386
文章发布调整
1 files modified
83 ■■■■ changed files
src/views/article/article.vue 83 ●●●● patch | view | raw | blame | history
src/views/article/article.vue
@@ -1,9 +1,10 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
      <template slot="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
          除
@@ -21,18 +22,18 @@
                <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row, 1)">
                    创建议题
                </el-button> -->
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
                <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type"
                    @click.stop="updateFb(row)">
          撤销
        </el-button>
        <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
                <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type"
                    @click.stop="updateFb(row)">
          发布
        </el-button>
      </template>
      <template slot-scope="{ row }" slot="publish">
        <el-tag>{{
                    row.publish == "1" ? "已发布" : row.publish == "0" ? "未发布" : "未发布"
                }}
            <template slot-scope="{ row, size }" slot="publish">
                <el-tag :size="size" :type="showPublish(row.publish).type" v-text="showPublish(row.publish).text">
        </el-tag>
      </template>
@@ -122,13 +123,16 @@
        datetime: "",
        selectionList: [],
        option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 240,
          border: false,
          //stripe:true,
          index: true,
@@ -136,7 +140,9 @@
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
                column: [
                    {
                        overHidden: true,
              label: "文章标题",
              prop: "title",
              span: 24,
@@ -150,10 +156,10 @@
              }, ],
            },
            {
                        width: 110,
              label: "文章封面",
              prop: "url",
              // align:'center',
              width: 80,
              type: "upload",
              listType: "picture-img",
              action: "/api/blade-resource/oss/endpoint/put-file",
@@ -165,6 +171,7 @@
              span: 24,
            },
            {
                        width: 100,
              label: "文章来源",
              prop: "sourceName",
              search: true,
@@ -175,7 +182,8 @@
                message: "请输入文章类型",
                trigger: "blur",
              }, ],
            }, {
                    },
                    {
              label: "文章范围",
              prop: "articleList",
              span: 12,
@@ -191,12 +199,13 @@
              hide: true,
            },
            {
                        width: 100,
              label: "文章类型",
              prop: "articleType",
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
              searchSpan: 3,
                        searchSpan: 4,
              checkStrictly: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=articleType",
              props: {
@@ -212,25 +221,7 @@
              }, ],
            },
            {
              label: "发布时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              searchSpan: 5,
              searchRange: true,
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              search: true,
              rules: [{
                required: true,
                message: "请选择发布时间",
                trigger: "blur",
              }, ],
            },
            {
                        width: 100,
              label: "发布时间",
              prop: "createTime",
              type: "date",
@@ -238,10 +229,10 @@
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            {
                        width: 100,
              label: "发布状态",
              prop: "publish",
              searchSpan: 3,
              width: 80,
                        searchSpan: 4,
              value: "0",
              slot: true,
              search: true,
@@ -262,9 +253,9 @@
              ],
            },
            {
                        width: 100,
              label: "评论区",
              prop: "iscomment",
              width: 80,
              slot: true,
              type: "switch",
              activeColor: "#13ce66",
@@ -464,6 +455,22 @@
          ids.push(ele.id)
        })
        return ids.join(",")
        },
        showPublish () {
            return (data) => {
                if (data == 0) {
                    return {
                        text: '未发布',
                        type: 'info'
                    }
                } else if (data == 1) {
                    return {
                        text: '已发布',
                        type: 'success'
                    }
                }
            }
      }
    },
    methods: {