2 Commit-ok 10e28e8c36 ... a4e7dfa1c7

Szerző SHA1 Üzenet Dátum
  大大的豆芽 a4e7dfa1c7 Merge branch 'master' of http://101.37.21.97:3000/wash/wash_admin_ui 4 hónapja
  大大的豆芽 7912e5eb3f . 4 hónapja

+ 4 - 4
.env.development

@@ -5,10 +5,10 @@ VUE_APP_TITLE = 一七生活管理系统(测试)
 ENV = 'development'
 
 # 一七生活管理系统/开发环境
-# VUE_APP_BASE_API_HOST = 'http://localhost:9801'
-# VUE_APP_BASE_API = 'http://localhost:9801'
-VUE_APP_BASE_API_HOST = 'http://139.224.65.227:8091/prod-api'
-VUE_APP_BASE_API = 'http://139.224.65.227:8091/prod-api'
+VUE_APP_BASE_API_HOST = 'http://localhost:9801'
+VUE_APP_BASE_API = 'http://localhost:9801'
+# VUE_APP_BASE_API_HOST = 'http://139.224.65.227:8091/prod-api'
+# VUE_APP_BASE_API = 'http://139.224.65.227:8091/prod-api'
 # VUE_APP_BASE_API_HOST = 'http://192.168.98.9:9801'
 # VUE_APP_BASE_API = 'http://192.168.98.9:9801/'
 

+ 1 - 0
package.json

@@ -47,6 +47,7 @@
     "clipboard": "^2.0.8",
     "core-js": "^3.38.1",
     "echarts": "4.9.0",
+    "@form-create/element-ui": "^2.5.31",
     "element-ui": "2.15.10",
     "file-saver": "^2.0.5",
     "fuse.js": "6.4.3",

+ 81 - 0
src/api/system/group.js

@@ -0,0 +1,81 @@
+import request from '@/utils/request'
+
+// 查询组合数据列表
+export function listGroup(query) {
+    return request({
+        url: '/mapi/system/group/list',
+        method: 'get',
+        params: query
+    })
+}
+
+// 查询组合数据详细
+export function getGroup(id) {
+    return request({
+        url: '/mapi/system/group/' + id,
+        method: 'get'
+    })
+}
+
+// 新增组合数据
+export function addGroup(data) {
+    return request({
+        url: '/mapi/system/group',
+        method: 'post',
+        data: data
+    })
+}
+
+// 修改组合数据
+export function updateGroup(data) {
+    return request({
+        url: '/mapi/system/group',
+        method: 'put',
+        data: data
+    })
+}
+
+// 删除组合数据
+export function delGroup(id) {
+    return request({
+        url: '/mapi/system/group/' + id,
+        method: 'delete'
+    })
+}
+
+
+/**
+ * @description 组合数据--新增
+ * @param {Object} param data {Object} 传值参数
+ */
+export function groupAddApi(data) {
+    return request({
+      url: data.url,
+      method: data.method,
+      data: data.datas,
+    });
+  }
+  
+  /**
+   * @description 组合数据--详情
+   * @param {Number} param id {Number} 组合数据id
+   */
+  export function groupInfoApi(id) {
+    return request({
+      url: `/mapi/system/group/${id}`,
+      method: 'get',
+    });
+  }
+
+// 修改组合数据状态
+export function updateGroupStatus(id,status) {
+    const data = {
+        id,
+        status
+    }
+    return request({
+        url: '/mapi/system/group/updateStatus',
+        method: 'post',
+        data: data
+    })
+}

BIN
src/assets/401_images/401.zip


+ 138 - 0
src/components/from/from.vue

@@ -0,0 +1,138 @@
+<template>
+  <div v-if="FromData">
+    <el-dialog :visible.sync="modals" :title="FromData.title" :z-index="1" width="720px" @closed="cancel">
+      <template>
+        <div class="radio acea-row row-middle" v-if="FromData.action === '/marketing/coupon/save.html'">
+          <div class="name ivu-form-item-content">优惠券类型</div>
+          <el-radio-group v-model="type" @input="couponsType">
+            <el-radio :label="0">通用券</el-radio>
+            <el-radio :label="1">品类券</el-radio>
+            <el-radio :label="2">商品券</el-radio>
+          </el-radio-group>
+        </div>
+      </template>
+      <form-create
+        :option="config"
+        :rule="Array.from(this.FromData.rules)"
+        v-model="fapi"
+        @submit="onSubmit"
+        class="formBox"
+        ref="fc"
+        handleIcon="false"
+      ></form-create>
+      <span slot="footer" class="dialog-footer">
+        <el-button v-db-click @click="modals = false">取 消</el-button>
+        <el-button type="primary" v-db-click @click="formSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import formCreate from '@form-create/element-ui';
+import request from '@/libs/request';
+import { mapState } from 'vuex';
+export default {
+  name: 'edit',
+  components: {
+    formCreate: formCreate.$form(),
+  },
+  computed: {
+    ...mapState('userLevel', ['taskId', 'levelId']),
+  },
+  props: {
+    FromData: {
+      type: Object,
+      default: null,
+    },
+    update: {
+      type: Boolean,
+      default: true,
+    },
+  },
+  watch: {
+    FromData() {
+      this.FromData.rules.forEach((e) => {
+        e.title += ':';
+      });
+    },
+  },
+  data() {
+    return {
+      modals: false,
+      type: 0,
+      loading: false,
+      fapi: null,
+      config: {
+        form: {
+          labelWidth: '100px',
+        },
+        resetBtn: false,
+        submitBtn: false,
+        global: {
+          upload: {
+            props: {
+              onSuccess(res, file) {
+                if (res.status === 200) {
+                  file.url = res.data.src;
+                } else {
+                  this.$message.error(res.msg);
+                }
+              },
+            },
+          },
+        },
+      },
+    };
+  },
+  methods: {
+    couponsType() {
+      this.$parent.addType(this.type);
+    },
+    formSubmit() {
+      this.fapi.submit();
+    },
+    // 提交表单 group
+    onSubmit(formData) {
+      let datas = {};
+      datas = formData;
+      if (this.loading) return;
+      this.loading = true;
+      request({
+        url: this.FromData.action,
+        method: this.FromData.method,
+        data: datas,
+      })
+        .then((res) => {
+          if (this.update) this.$parent.getList();
+          this.$message.success(res.msg);
+          this.modals = false;
+          setTimeout(() => {
+            this.$emit('submitFail');
+            this.loading = false;
+          }, 1000);
+        })
+        .catch((res) => {
+          this.loading = false;
+          this.$message.error(res.msg);
+        });
+    },
+    // 关闭按钮
+    cancel() {
+      this.type = 0;
+      // this.$emit('onCancel')
+    },
+  },
+};
+</script>
+
+<style scoped lang="stylus">
+.radio {
+  margin-bottom: 14px;
+}
+.radio ::v-deep .name {
+  width: 125px;
+  text-align: right;
+  padding-right: 12px;
+}
+</style>

+ 5 - 7
src/views/error/401.vue

@@ -1,19 +1,17 @@
 <template>
   <div class="errPage-container">
-    <el-button icon="arrow-left" class="pan-back-btn" @click="back">
-      返回
-    </el-button>
+
     <el-row>
       <el-col :span="12">
         <h1 class="text-jumbo text-ginormous">
-          401错误!
+          登录错误!
         </h1>
-        <h2>您没有访问权限!</h2>
-        <h6>对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面</h6>
+        <h2>登录错误,请联系管理员!</h2>
+        <h6></h6>
         <ul class="list-unstyled">
           <li class="link-type">
             <router-link to="/">
-              回首页
+              
             </router-link>
           </li>
         </ul>

+ 204 - 0
src/views/system/groupData/components/groupFrom.vue

@@ -0,0 +1,204 @@
+<template>
+  <div>
+    <el-dialog :visible.sync="modals" width="720px" :title="titleFrom" :close-on-click-modal="false">
+      <el-form ref="formValidate" :model="formValidate" label-width="100px" :rules="ruleValidate" @submit.native.prevent>
+        <el-row :gutter="24">
+          <el-col :span="24">
+            <el-form-item label="数据组名称:" prop="name">
+              <el-input v-model="formValidate.name" placeholder="请输入数据组名称" style="width: 90%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="数据字段:" prop="configName">
+              <el-input v-model="formValidate.configName" placeholder="请输入数据字段" style="width: 90%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="数据简介:" prop="info">
+              <el-input v-model="formValidate.info" placeholder="请输入数据简介" style="width: 90%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-for="(item, index) in formValidate.fieldsArr" :key="index">
+            <el-col v-bind="grid">
+              <el-form-item :label="'字段' + (index + 1) + ':'" label-width="90px" :prop="'fieldsArr.' + index + '.name'"
+                :rules="{ required: true, message: '请输入字段名称:姓名', trigger: 'blur' }">
+                <el-input v-model="item.name" placeholder="字段名称:姓名"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-bind="grid" class="goupBox">
+              <el-form-item label-width="0" :prop="'fieldsArr.' + index + '.title'"
+                :rules="{ required: true, message: '请输入字段配置名', trigger: 'blur' }">
+                <el-input v-model="item.title" placeholder="字段配置名:name"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-bind="grid" prop="type" class="goupBox mr15">
+              <el-form-item :prop="'fieldsArr.' + index + '.type'" :rules="{ required: true, message: '请选择字段类型', trigger: 'change' }"
+                label-width="0">
+                <el-select placeholder="字段类型" v-model="item.type">
+                  <el-option value="input">文本框</el-option>
+                  <el-option value="textarea">多行文本框</el-option>
+                  <el-option value="radio">单选框</el-option>
+                  <el-option value="checkbox">多选框</el-option>
+                  <el-option value="select">下拉选择</el-option>
+                  <el-option value="upload">单图</el-option>
+                  <el-option value="uploads">多图</el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1">
+              <i class="el-icon-close cur" v-db-click @click="delGroup(index)"></i>
+            </el-col>
+            <el-col :span="24" v-if="item.type === 'radio' || item.type === 'checkbox' || item.type === 'select'">
+              <el-form-item :prop="'fieldsArr.' + index + '.param'" :rules="{ required: true, message: '请输入参数方式', trigger: 'blur' }">
+                <el-input type="textarea" :rows="4" placeholder="参数方式例如:\n1=白色\n2=红色\n3=黑色" v-model="item.param" style="width: 90%"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-col>
+          <el-col>
+            <el-form-item>
+              <el-button type="primary" v-db-click @click="addType">添加字段</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button v-db-click @click="handleReset">取 消</el-button>
+        <el-button type="primary" v-db-click @click="handleSubmit('formValidate')" :disabled="valids">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { groupAddApi, groupInfoApi } from "@/api/system/group";
+export default {
+  name: 'menusFrom',
+  props: {
+    groupId: {
+      type: Number,
+      default: 0,
+    },
+    titleFrom: {
+      type: String,
+      default: '',
+    },
+    addId: {
+      type: String,
+      default: '',
+    },
+  },
+  data() {
+    return {
+      iconVal: '',
+      grid: {
+        xl: 7,
+        lg: 7,
+        md: 12,
+        sm: 24,
+        xs: 24,
+      },
+      modals: false,
+      modal12: false,
+      ruleValidate: {
+        name: [{ required: true, message: '请输入数据组名称', trigger: 'blur' }],
+        configName: [{ required: true, message: '请输入数据字段', trigger: 'blur' }],
+        info: [{ required: true, message: '请输入数据简介', trigger: 'blur' }],
+        names: [{ required: true, message: '请输入字段名称', trigger: 'blur' }],
+      },
+      FromData: [],
+      valids: false,
+      list2: [],
+      formValidate: {
+        name: '',
+        configName: '',
+        info: '',
+        fieldsArr: [],
+        cate_id: 0,
+      },
+    };
+  },
+  watch: {
+    addId(n) {
+      if (n === 'addId') {
+        this.formValidate.fieldsArr = [];
+      }
+    },
+  },
+  methods: {
+    // 点击添加字段
+    addType() {
+      this.formValidate.fieldsArr.push({
+        name: '',
+        title: '',
+        type: '',
+        param: '',
+      });
+    },
+    // 删除字段
+    delGroup(index) {
+      this.formValidate.fieldsArr.splice(index, 1);
+    },
+    // 详情
+    fromData(id) {
+      groupInfoApi(id)
+        .then(async (res) => {
+          this.formValidate.name = res.data.name;
+          this.formValidate.configName = res.data.configName;
+          this.formValidate.info = res.data.info;
+          this.formValidate.fieldsArr = JSON.parse(res.data.fields)
+          this.formValidate.fields = ''
+        })
+        .catch((res) => {
+          this.$message.error(res.msg);
+        });
+    },
+    // 提交
+    handleSubmit(name) {
+      this.formValidate.fields =  JSON.stringify(this.formValidate.fieldsArr)
+      let data = {
+        url: this.groupId ? `/mapi/system/group/${this.groupId}` : '/mapi/system/group',
+        method: 'post',
+        datas: this.formValidate,
+      };
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          if (this.formValidate.fieldsArr.length === 0) return this.$message.error('请添加字段');
+          groupAddApi(data)
+            .then(async (res) => {
+              this.$modal.msgSuccess('添加成功')
+              this.modals = false;
+              this.$refs[name].resetFields();
+              this.formValidate.fieldsArr = [];
+              this.$emit('getList');
+            })
+            .catch((res) => {
+              console.log("结果", res)
+              this.$message.error("重试");
+            });
+        } else {
+          if (!this.formValidate.name) return this.$message.error('请添加数据组名称!');
+          if (!this.formValidate.configName) return this.$message.error('请添加数据字段!');
+          if (!this.formValidate.info) return this.$message.error('请添加数据简介!');
+        }
+      });
+    },
+    handleReset() {
+      this.modals = false;
+      this.$refs['formValidate'].resetFields();
+      this.$emit('clearFrom');
+    },
+  },
+  created() { },
+  mounted() { },
+};
+</script>
+
+<style scoped>
+.cur {
+  cursor: pointer;
+}
+
+.goupBox ::v-deep .ivu-form-item-content {
+  margin-left: 43px !important;
+}
+</style>

+ 247 - 0
src/views/system/groupData/index.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item prop="name">
+        <el-input v-model="queryParams.name" placeholder="请输入数据组名称" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item prop="info">
+        <el-input v-model="queryParams.info" placeholder="请输入数据提示" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item prop="configName">
+        <el-input v-model="queryParams.configName" placeholder="请输入关键字" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:group:add']">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:group:edit']">修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+          v-hasPermi="['system:group:remove']">删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:group:export']">导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <Page uri="/mapi/system/group/list" :request-params="queryParams" ref="pagination" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" fixed="left" />
+        <el-table-column label="组合数据ID" align="center" prop="id" />
+        <el-table-column label="数据组名称" align="center" prop="name" />
+        <el-table-column label="数据提示" align="center" prop="info" />
+        <el-table-column label="关键字" align="center" prop="configName" />
+        <el-table-column label="数据组字段以及类型" align="center" prop="fields" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
+          <template slot-scope="scope">
+            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:group:edit']">修改</el-button>
+            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:group:remove']">删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </Page>
+
+      <!-- 添加或修改组合数据对话框 -->
+      <el-drawer :title="title" :visible.sync="open" size="30%" append-to-body :before-close="checkClose">
+        <el-row :gutter="15" style="margin-bottom: 80px">
+          <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+            <el-col :span="24">
+              <el-form-item label="数据组名称" prop="name">
+                <el-input v-model="form.name" placeholder="请输入数据组名称" maxlength="50" show-word-limit />
+
+              </el-form-item>
+              <el-form-item label="数据提示" prop="info">
+                <el-input v-model="form.info" placeholder="请输入数据提示" maxlength="256" show-word-limit />
+
+              </el-form-item>
+              <el-form-item label="关键字" prop="configName">
+                <el-input v-model="form.configName" placeholder="请输入关键字" maxlength="50" show-word-limit />
+
+              </el-form-item>
+              <el-form-item label="数据组字段以及类型" prop="fields">
+                <el-input v-model="form.fields" type="textarea" placeholder="请输入数据组字段以及类型" maxlength="${length}" show-word-limit />
+
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+
+        <div class="horizontal-view box-shadow drawer-bottom-buttons">
+          <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </el-drawer>
+      <group-from ref="groupfroms" :titleFrom="titleFrom" :groupId="groupId" :addId="addId" @getList="getList"></group-from>
+  </div>
+</template>
+
+<script>
+import request from '@/utils/request'
+import { listGroup, getGroup, delGroup, addGroup, updateGroup , updateGroupStatus } from "@/api/system/group";
+import groupFrom from './components/groupFrom';
+export default {
+  name: "Group",
+  components: { groupFrom },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 组合数据表格数据
+      groupList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        name: null,
+        info: null,
+        configName: null,
+        fields: null
+      },
+      groupId: 0,
+      titleFrom: '',
+      addId: '',
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "数据组名称不能为空", trigger: "blur" }
+        ],
+        info: [
+          { required: true, message: "数据提示不能为空", trigger: "blur" }
+        ],
+        configName: [
+          { required: true, message: "关键字不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询组合数据列表 */
+    getList() {
+      this.$nextTick(() => {
+        this.$refs.pagination.handleSearch(true)
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        info: null,
+        configName: null,
+        fields: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+    //   this.open = true;
+    this.$refs.groupfroms.modals = true;
+      this.title = "添加组合数据";
+      this.$refs.groupfroms.modals = true;
+      this.titleFrom = "添加数据组";
+      this.addId = 'addId';
+      this.groupId = 0;
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      this.titleFrom = "修改数据组";
+      this.groupId = row.id;
+      this.$refs.groupfroms.fromData(row.id);
+      this.$refs.groupfroms.modals = true;
+      this.addId = '';
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateGroup(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addGroup(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除组合数据编号为"' + ids + '"的数据项?').then(function () {
+        return delGroup(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => { });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('mapi/system/group/export', {
+        ...this.queryParams
+      }, `group_${new Date().getTime()}.xlsx`)
+    },
+    checkClose(done) {
+      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function () {
+        done()
+      }).then(() => { }).catch(() => { });
+    },
+
+  }
+};
+</script>