hhyq 2 жил өмнө
parent
commit
5840be7a93

+ 269 - 3
src/views/announcement/list/index.vue

@@ -1,5 +1,271 @@
 <template>
-    <div>
-        公告列表
+    <div class="app-container">
+      <!-- 筛选 -->
+      <div class="select-box">
+        <div class="search-icon">
+          <i class="el-icon-search"></i>
+          <span>  筛选搜查</span>
+          <div class="search-button">
+            <el-button  @click="resetQuery">重置</el-button>
+            <el-button type="primary"  @click="handleQuery">查询搜索</el-button>
+          </div>
+        </div>
+        <el-form  :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+          <el-form-item class="inline" label="公告标题:  " prop="noticeTitle" >
+            <el-input
+              v-model="queryParams.noticeTitle"
+              placeholder="筛选公告标题"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item class="inline" label="发布时间:  " prop="createTime">
+            <el-date-picker
+              v-model="queryParams.createTime"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              placeholder="选择时间范围"
+              @keyup.enter.native="handleQuery"
+              unlink-panels  >
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
+      </div>
+      
+  
+      <!-- 标题 -->
+      <el-row>
+        <div class="list-title">
+          <div class="title">
+            <span class="el-icon-tickets"></span>
+            <span class="title-font">公告列表</span>
+          </div>
+          <div class="btn-add">
+            <el-button size="small" type="primary" plain @click="handleAdd()">添加</el-button>
+          </div>
+        </div>
+      </el-row>
+  
+      <!-- 列表 -->
+      <el-table v-loading="loading" :data="noticeList">
+        <el-table-column label="ID" align="center" prop="noticeId" width="100" />
+        <el-table-column
+          label="公告标题"
+          align="center"
+          prop="noticeTitle"
+          :show-overflow-tooltip="true"
+        />
+        <el-table-column label="发布时间" align="center" prop="createTime" width="170">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="170">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              v-hasPermi="['system:notice:edit']"
+            >修改</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['system:notice:remove']"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+  
+      <!-- 添加或修改公告对话框 -->
+      <el-dialog title="修改公告" :visible.sync="open" width="780px" append-to-body>
+        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="公告标题" prop="noticeTitle">
+                <el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="内容">
+                <editor v-model="form.noticeContent" :min-height="192"/>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </el-dialog>
     </div>
-</template>
+  </template>
+  
+  <script>
+  import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
+  
+  export default {
+    name: "Notice",
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 公告表格数据
+        noticeList: [],
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          noticeTitle: undefined,
+          createBy: undefined,
+          status: undefined
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          noticeTitle: [
+            { required: true, message: "公告标题不能为空", trigger: "blur" }
+          ]
+        }
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询公告列表 */
+      getList() {
+        this.loading = true;
+        listNotice(this.queryParams).then(response => {
+          this.noticeList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          noticeId: undefined,
+          noticeTitle: undefined,
+          noticeType: undefined,
+          noticeContent: undefined,
+          status: "0"
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        // 路由跳转
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const noticeId = row.noticeId;
+        getNotice(noticeId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改公告";
+        });
+      },
+      /** 提交按钮 */
+      submitForm: function() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.noticeId != undefined) {
+              updateNotice(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const noticeIds = row.noticeId;
+        this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
+          return delNotice(noticeIds);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      }
+    }
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .el-row {
+    margin-bottom: 20px;
+  }
+  .list-title {
+    height: 50px;
+    width: 100%;
+    border: solid 1px #DCDFE6;
+  
+    .title {
+      margin: 14px;
+      float: left;
+    }
+  
+    .title-font {
+      margin-left: 5px;
+    }
+  }
+  
+  .btn-add {
+    margin: 10px;
+    float: right;
+  }
+  .select-box{
+    border: 1px solid rgb(0, 0, 0,0.1);
+    margin-bottom:20px;
+    padding: 20px;
+  }
+  .inline{
+    margin-right: 30px;
+  }
+  .search-icon{
+    padding-bottom: 20px
+  }
+  .search-button{
+    float: right;
+  }
+  </style>
+  

+ 213 - 2
src/views/appuserlist/index.vue

@@ -1,3 +1,214 @@
 <template>
-    <div>app用户</div>
-</template>
+    <div class="app-container">
+      <!-- 筛选 -->
+      <el-row>
+        <div class="select-box">
+            <div class="search-title">
+              <i class="el-icon-search"></i>
+              <span>  筛选搜查</span>
+              <div class="search-button">
+                <el-button  @click="resetQuery">重置</el-button>
+                <el-button  type="primary"  @click="handleQuery">查询搜索</el-button>
+              </div>
+            </div>
+            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px" class="search-form">
+              <el-form-item label="编号:" prop="userId">
+                <el-input
+                  v-model="queryParams.userId"
+                  placeholder="请输入用户编号"
+                  clearable
+                  style="width: 240px"
+                  @keyup.enter.native="handleQuery"
+                />
+              </el-form-item>
+              <el-form-item label="手机号码:" prop="phonenumber">
+                <el-input
+                  v-model="queryParams.phonenumber"
+                  placeholder="请输入手机号码"
+                  clearable
+                  style="width: 240px"
+                  @keyup.enter.native="handleQuery"
+                />
+              </el-form-item>
+              <el-form-item label="状态:" prop="status">
+                <el-select
+                  v-model="queryParams.status"
+                  placeholder="用户状态"
+                  clearable
+                  style="width: 240px"
+                >
+                  <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="注册时间:">
+                <el-date-picker
+                  v-model="dateRange"
+                  style="width: 240px"
+                  value-format="yyyy-MM-dd"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                ></el-date-picker>
+              </el-form-item>
+            </el-form>
+          </div>
+      </el-row>
+      <!-- 标题 -->
+      <el-row>
+        <div class="list-title">
+          <div class="title">
+            <span class="el-icon-tickets"></span>
+            <span class="title-font">用户列表</span>
+          </div>
+        </div>
+      </el-row>
+  
+      <el-row>
+        <!--用户数据-->
+        <el-table v-loading="loading" :data="userList"  border>
+          <el-table-column label="编号" align="center"  prop="userId" />
+          <el-table-column label="账号" align="center"  prop="userName"  :show-overflow-tooltip="true" />
+          <el-table-column label="真实姓名" align="center"  prop="nickName"  :show-overflow-tooltip="true" />
+          <el-table-column label="手机号" align="center"  prop="phonenumber" width="120" />
+          <el-table-column label="详细地址" align="center"  prop=""  width="160" :show-overflow-tooltip="true" />
+          <el-table-column label="状态" align="center" prop="status" >
+            <template slot-scope="scope">
+              <span>{{ scope.row.status == "0" ? "未认证" : "已认证"  }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="注册时间" align="center" prop="createTime"  width="160">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="实名时间" align="center" prop=""  width="160">
+            <!-- <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template> -->
+          </el-table-column>
+        </el-table>
+  
+        <pagination
+          v-show="total>0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </el-row>
+    </div>
+  </template>
+  
+  <script>
+  import { listUser} from "@/api/system/user";
+  
+  export default {
+    name: "User",
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 用户表格数据
+        userList: null,
+        // 日期范围
+        dateRange:[],
+        // 表单参数
+        form: {},
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          userName: undefined,
+          phonenumber: undefined,
+          status: undefined,
+        },
+        // 下拉框参数
+        options:[
+          {
+            value:"0",
+            label:"未认证"
+          },
+          {
+            value:"1",
+            label:"已认证"
+          }
+        ]
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询用户列表 */
+      getList() {
+        this.loading = true;
+        listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+            this.userList = response.rows;
+            this.total = response.total;
+            this.loading = false;
+          }
+        );
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.dateRange = [];
+        this.queryParams.userId=undefined;
+        this.queryParams.phonenumber=undefined;
+        this.queryParams.status=undefined;
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+    }
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .select-box{
+    border: 1px solid rgb(0, 0, 0,0.1);
+    border-radius: 5px;
+    padding: 20px;
+  }
+  .search-form{
+    margin-top: 20px;
+    padding: 0 20px;
+  }
+  .search-title{
+    overflow: hidden;
+  }
+  .search-button{
+    float: right;
+  }
+  .el-row {
+    margin-bottom: 20px;
+  }
+  .list-title {
+    height: 50px;
+    width: 100%;
+    border: solid 1px #DCDFE6;
+    border-radius: 5px;
+  
+    .title {
+      margin: 14px;
+      float: left;
+    }
+  
+    .title-font {
+      margin-left: 5px;
+    }
+  }
+  </style>