695593266@qq.com 6 месяцев назад
Родитель
Сommit
6386bf67f6
1 измененных файлов с 148 добавлено и 138 удалено
  1. 148 138
      src/views/notifyManage/templateManage/index.vue

+ 148 - 138
src/views/notifyManage/templateManage/index.vue

@@ -2,8 +2,13 @@
   <div class="ele-body">
   <div class="ele-body">
     <el-card shadow="never">
     <el-card shadow="never">
       <!-- 条件区 -->
       <!-- 条件区 -->
-      <search @search="reload"/>
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :pageSize="this.$store.state.tablePageSize">
+      <search @search="reload" />
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :pageSize="this.$store.state.tablePageSize"
+      >
         <template v-slot:toolbar>
         <template v-slot:toolbar>
           <el-button
           <el-button
             size="small"
             size="small"
@@ -11,177 +16,182 @@
             icon="el-icon-plus"
             icon="el-icon-plus"
             class="ele-btn-icon"
             class="ele-btn-icon"
             v-if="$hasPermission('sys:notifytemplate:save')"
             v-if="$hasPermission('sys:notifytemplate:save')"
-
-            @click="handleAddOrEdit('add','')">
+            @click="handleAddOrEdit('add', '')"
+          >
             新建
             新建
           </el-button>
           </el-button>
         </template>
         </template>
         <!-- 操作列 -->
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
         <template v-slot:action="{ row }">
-
           <el-link
           <el-link
             type="primary"
             type="primary"
             :underline="false"
             :underline="false"
             icon="el-icon-edit"
             icon="el-icon-edit"
             v-if="$hasPermission('sys:notifytemplate:update')"
             v-if="$hasPermission('sys:notifytemplate:update')"
-
-            @click="handleAddOrEdit('update',row)">
+            @click="handleAddOrEdit('update', row)"
+          >
             编辑
             编辑
           </el-link>
           </el-link>
           <el-popconfirm
           <el-popconfirm
             class="ele-action"
             class="ele-action"
             title="确定要删除此数据吗?"
             title="确定要删除此数据吗?"
             v-if="$hasPermission('sys:notifytemplate:delete')"
             v-if="$hasPermission('sys:notifytemplate:delete')"
-            @confirm="deleteCategory(row)">
+            @confirm="deleteCategory(row)"
+          >
             <template v-slot:reference>
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
+              <el-link type="danger" :underline="false" icon="el-icon-delete"
+                >删除</el-link
+              >
             </template>
             </template>
           </el-popconfirm>
           </el-popconfirm>
         </template>
         </template>
-        <template v-slot:status="{row}">
+        <template v-slot:status="{ row }">
           <el-tag v-if="row.status" type="success">{{ '启用' }}</el-tag>
           <el-tag v-if="row.status" type="success">{{ '启用' }}</el-tag>
           <el-tag v-else type="danger">{{ '禁用' }}</el-tag>
           <el-tag v-else type="danger">{{ '禁用' }}</el-tag>
-
         </template>
         </template>
       </ele-pro-table>
       </ele-pro-table>
     </el-card>
     </el-card>
     <!--新增、修改-->
     <!--新增、修改-->
-    <add-or-edit-dialog v-if="addOrEditDialogFlag" :addOrEditDialogFlag.sync="addOrEditDialogFlag"
-                        ref="addOrEditDialogRef" @done="reload"></add-or-edit-dialog>
+    <add-or-edit-dialog
+      v-if="addOrEditDialogFlag"
+      :addOrEditDialogFlag.sync="addOrEditDialogFlag"
+      ref="addOrEditDialogRef"
+      @done="reload"
+    ></add-or-edit-dialog>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
+  import search from './index-search.vue';
+  import {
+    notifyTemplateDeleteAPI,
+    notifyTemplatePageAPI
+  } from '@/api/notifyManage';
+  import addOrEditDialog from '@/views/notifyManage/templateManage/components/addOrEditDialog.vue';
 
 
-import search from './index-search.vue';
-import {notifyTemplateDeleteAPI, notifyTemplatePageAPI} from "@/api/notifyManage";
-import addOrEditDialog from "@/views/notifyManage/templateManage/components/addOrEditDialog.vue";
+  export default {
+    components: { addOrEditDialog, search },
+    data() {
+      return {
+        addOrEditDialogFlag: false,
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '模板编码',
+            minWidth: '120',
+            align: 'center'
+          },
+          {
+            prop: 'name',
+            label: '模板名称',
+            minWidth: '120',
+            align: 'center'
+          },
 
 
-export default {
-  components: {addOrEditDialog, search},
-  data() {
-    return {
-      addOrEditDialogFlag: false,
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '模板编码',
-          minWidth: '120',
-          align: "center",
-        },
-        {
-          prop: 'name',
-          label: '模板名称',
-          minWidth: '120',
-          align: "center",
-        },
-
-
-        {
-          prop: 'content',
-          label: '模板内容',
-          minWidth: '150',
-        },
-        {
-          prop: 'nickname',
-          label: '默认发送人',
-          width: '100',
-          align: "center",
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          width: '80',
-          align: "center",
-          slot:"status",
-          // formatter: (_row, _column, cellValue) => {
-          //   return _row.status ? '启用' : '禁用';
-          // }
-        },
-        {
-          prop: 'remark',
-          label: '备注',
-          minWidth: '120',
-          align: "center",
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          width: '170',
-          align: "center",
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      searchForm: {},
-      tableData: [],
-      size: 10,
-      page: 1,
-      total: 0
-    };
-  },
-  methods: {
-    //新增或修改模板
-    handleAddOrEdit(type, row) {
-      this.addOrEditDialogFlag = true
-      this.$nextTick(() => {
-        this.$refs.addOrEditDialogRef.init(type, row)
-      })
-    },
-    reload(params) {
-      console.log(params,'=======');
-      this.$refs.table.reload({pageNum: 1, where: params});
-    },
-    async deleteCategory({id}) {
-      await notifyTemplateDeleteAPI([id]);
-      this.$refs.table.reload();
+          {
+            prop: 'content',
+            label: '模板内容',
+            minWidth: '150'
+          },
+          {
+            prop: 'nickname',
+            label: '默认发送人',
+            width: '100',
+            align: 'center'
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            width: '80',
+            align: 'center',
+            slot: 'status'
+            // formatter: (_row, _column, cellValue) => {
+            //   return _row.status ? '启用' : '禁用';
+            // }
+          },
+          {
+            prop: 'remark',
+            label: '备注',
+            minWidth: '120',
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            width: '170',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        searchForm: {},
+        tableData: [],
+        size: 10,
+        page: 1,
+        total: 0
+      };
     },
     },
-    datasource({page, where, limit,...row}) {
-      console.log(page, where, limit,row);
-      return notifyTemplatePageAPI({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-    reset() {
-    },
-  }
-};
+    methods: {
+      //新增或修改模板
+      handleAddOrEdit(type, row) {
+        this.addOrEditDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addOrEditDialogRef.init(type, row);
+        });
+      },
+      reload(params) {
+        console.log(params, '=======');
+        this.$refs.table.reload({ pageNum: 1, where: params });
+      },
+      async deleteCategory({ id }) {
+        await notifyTemplateDeleteAPI([id]);
+        this.$refs.table.reload();
+      },
+      datasource({ page, where, limit, ...row }) {
+        console.log(page, where, limit, row);
+        return notifyTemplatePageAPI({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      reset() {}
+    }
+  };
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.app-container {
-  background: #f0f3f3;
-  min-height: calc(100vh - 84px);
-}
+  .app-container {
+    background: #f0f3f3;
+    min-height: calc(100vh - 84px);
+  }
 
 
-.zw-page-table {
-  background: #ffffff;
-  padding-top: 20px;
-}
+  .zw-page-table {
+    background: #ffffff;
+    padding-top: 20px;
+  }
 
 
-.pagination-wrap {
-  display: flex;
-  justify-content: flex-end;
-  padding: 10px 0;
-}
+  .pagination-wrap {
+    display: flex;
+    justify-content: flex-end;
+    padding: 10px 0;
+  }
 
 
-.table {
-  width: 100%;
-  margin-top: 10px;
-}
+  .table {
+    width: 100%;
+    margin-top: 10px;
+  }
 </style>
 </style>