|
@@ -0,0 +1,151 @@
|
|
|
+<template>
|
|
|
+ <div class="websiteUser">
|
|
|
+ <!-- <Banner /> -->
|
|
|
+ <div class="content">
|
|
|
+ <byTable
|
|
|
+ :source="sourceList.data"
|
|
|
+ :pagination="sourceList.pagination"
|
|
|
+ :config="config"
|
|
|
+ :loading="loading"
|
|
|
+ highlight-current-row
|
|
|
+ @get-list="getList">
|
|
|
+ <template #slotName="{ item }">
|
|
|
+ {{ item.createTime }}
|
|
|
+ </template>
|
|
|
+ </byTable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+/* eslint-disable vue/no-unused-components */
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import byTable from "@/components/byTable/index.vue";
|
|
|
+import byForm from "@/components/byForm/index.vue";
|
|
|
+import { computed, ref } from "vue";
|
|
|
+import {getDictOneByXmhjc} from "@/api/XMHJC/common";
|
|
|
+const loading = ref(false);
|
|
|
+const submitLoading = ref(false);
|
|
|
+const enableStatus = ref([]);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+});
|
|
|
+let dialogVisible = ref(false);
|
|
|
+let modalType = ref("add");
|
|
|
+let rules = ref({
|
|
|
+});
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "序号",
|
|
|
+ prop: "id",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "用户名",
|
|
|
+ prop: "userName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "密码",
|
|
|
+ prop: "password",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "createTime",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "200",
|
|
|
+ align: "right",
|
|
|
+ },
|
|
|
+ // 渲染 el-button,一般用在最后一列。
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "删除",
|
|
|
+ type: "danger",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ del(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+
|
|
|
+let formData = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+});
|
|
|
+const byform = ref(null);
|
|
|
+const getList = async (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy.post("/websiteUsers/page", sourceList.value.pagination).then((message) => {
|
|
|
+ console.log(message);
|
|
|
+ sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+const openModal = () => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ modalType.value = "add";
|
|
|
+ formData.data = {};
|
|
|
+};
|
|
|
+
|
|
|
+//删除
|
|
|
+const del = (row) => {
|
|
|
+ modalType.value = "edit";
|
|
|
+ ElMessageBox.confirm("你是否确认此操作?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ proxy.post("/websiteUsers/delete", { id: row.id }).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+getList();
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.websiteUser {
|
|
|
+ padding: 20px;
|
|
|
+ .delete-btn{
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-left: 25px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|