Kaynağa Gözat

后台管理系统修改

sunyadv 5 yıl önce
ebeveyn
işleme
c98ad88b69

+ 2 - 2
lib_vue/config/index.js

@@ -20,7 +20,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
         '/api': {    
-            target: 'http://192.168.101.6:8091',  // 接口域名 开发
+            target: 'http://192.168.101.166:8091',  // 接口域名 开发
             secure: true,  // 如果是https接口,需要配置这个参数
             changeOrigin: true,  //是否跨域
             pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径
@@ -28,7 +28,7 @@ module.exports = {
             }
         },
         '/ips': {    
-            target: 'http://192.168.101.6:8080',  // 接口域名 开发
+            target: 'http://192.168.101.166:8080',  // 接口域名 开发
             secure: true,  // 如果是https接口,需要配置这个参数
             changeOrigin: true,  //是否跨域
             pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径

+ 1 - 1
lib_vue/src/routes.js

@@ -78,7 +78,7 @@ let routes = [
         name: '用户管理',
         iconCls: 'iconfont iconyonghu',
         children: [
-            { path: '/user', component: user, name: '用户列表' },
+            // { path: '/user', component: user, name: '用户列表' },
             { path: '/reserve', component: reserve, name: '预约用户' }
         ]
     },

+ 1 - 1
lib_vue/src/views/Home.vue

@@ -18,7 +18,7 @@
                     </span>
                     <el-dropdown-menu slot="dropdown">
                         <el-dropdown-item @click.native="reset">修改密码</el-dropdown-item>
-                        <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item>
+                        <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
                         <el-dropdown-item divided @click.native="logout">退出登录</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>

+ 101 - 21
lib_vue/src/views/agency/agencyDetail.vue

@@ -13,10 +13,13 @@
                         <el-header height="90px;">
                             {{detail.name}}
                             <el-button type="text" @click="editDetail(0)" icon="el-icon-edit" class="agencyHead_edit"></el-button>
-                            <el-button type="text" @click="backToList" class="agencyHead_back"><i class="iconfont iconfanhui1"></i></el-button>
+                            <el-button v-if="$route.params.id!=null" type="text" @click="backToList" class="agencyHead_back"><i class="iconfont iconfanhui1"></i></el-button>
                         </el-header>
                         <el-footer>
-                            <span class="info">{{detail.headIntroduction==null?"暂无简介":detail.headIntroduction}}</span>
+                            <span v-for="item in detail.tags" style="margin-right:10px;">
+                                <el-tag>{{item}}</el-tag>
+                            </span>
+                            <!-- <span class="info">{{detail.headIntroduction==null?"暂无标签":detail.headIntroduction}}</span> -->
                         </el-footer>
                     </el-container>
                 </el-container>
@@ -35,7 +38,7 @@
                     :on-error="handleUploadError">
                     <i slot="default" class="el-icon-plus"></i>
                     <div slot="file" slot-scope="{file}">
-                        <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
+                        <img class="el-upload-list__item-thumbnail" :src="file.picUrl" alt="">
                         <span class="el-upload-list__item-actions">
                             <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
                                 <i class="el-icon-zoom-in"></i>
@@ -59,7 +62,9 @@
             <el-col :span="24" class="agencyBody_main">
                 <el-col :span="24" class="agencyBody_detail">
                     上课时间:
-                    <span class="info" v-if="detail.amTime != null || detail.pmTime != null">{{detail.amTime}} - {{detail.pmTime}}</span>
+                    <span class="info" v-if="detail.amTime != null || detail.pmTime != null">
+                        上午:{{detail.amTime}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下午:{{detail.pmTime}}
+                    </span>
                     <span class="info" v-else>暂无</span>
                 </el-col>
                 <el-col :span="24" class="agencyBody_detail">
@@ -108,8 +113,13 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="机构简介">
-                        <el-input v-model="editForm.headIntroduction" type="textarea" :rows="5" placeholder="请输入机构简介"></el-input>
+                    <el-form-item label="机构标签">
+                        <el-tag :key="tag" v-for="tag in editForm.headIntroduction" closable :disable-transitions="false" @close="handleClose(tag)">{{tag}}</el-tag>
+                        <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small" 
+                            @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
+                        </el-input>
+                        <el-button v-else class="button-new-tag" size="small" @click="showInput">添加标签</el-button>
+                        <!-- <el-input v-model="editForm.headIntroduction" type="textarea" :rows="5" placeholder="请输入机构简介"></el-input> -->
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
@@ -130,8 +140,10 @@
         <el-dialog title="编辑机构信息" v-if="editFormVisibleOther" :visible.sync="editFormVisibleOther" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="editFormOther" label-width="70px" :rules="formRules" ref="editFormOther">
                 <el-form-item label="上课时间" v-if="editType == 1">
-                    <el-time-picker is-range v-model="editFormOther.time" format="HH:mm:ss" value-format="HH:mm:ss"
-                    range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围" style=width:565px;></el-time-picker>
+                    <el-time-picker is-range v-model="editFormOther.amTime" format="HH:mm:ss" value-format="HH:mm:ss"
+                    range-separator="至" start-placeholder="上午开始时间" end-placeholder="上午结束时间" placeholder="选择时间范围" style=width:280px;></el-time-picker>
+                    <el-time-picker is-range v-model="editFormOther.pmTime" format="HH:mm:ss" value-format="HH:mm:ss"
+                    range-separator="至" start-placeholder="下午开始时间" end-placeholder="下午结束时间" placeholder="选择时间范围" style=width:280px;></el-time-picker>
                 </el-form-item>
                 <el-form-item label="收费标准" v-if="editType == 1">
                     <el-input v-model="editFormOther.chargingStandard" autocomplete="off" placeholder="请输入收费标准"></el-input>
@@ -172,7 +184,7 @@
                 disabled: false,
 
                 uploadMsg: {
-                    "id": this.$route.params.id
+                    "id": this.$route.params.id==null?JSON.parse(sessionStorage.getItem('user')).ageId:this.$route.params.id,
                 },
 
                 formRules: {
@@ -191,14 +203,18 @@
                 editLoading: false,
 				editForm: {
 					name: '',
-                    headIntroduction: '',
+                    headIntroduction: [],
                     headPic: [{url:""}],
                 },
+                inputVisible: false,
+                inputValue: '',
 
                 editFormVisibleOther: false,
                 editOtherLoading: false,
                 editFormOther: {
-					time: ['09:00:00','18:00:00'],
+                    time: ['09:00:00','18:00:00'],
+                    amTime: ['09:00:00','12:00:00'],
+                    pmTime: ['14:00:00','18:00:00'],
                     chargingStandard: '',
                     phone: '',
                     address: '',
@@ -221,7 +237,11 @@
                     id: this.detailId
                 }, res => {
                     if (res.code == "ok") {
-                        this.detail = res.data;
+                        var list = res.data;
+                        if(list.headIntroduction != null && list.headIntroduction != "") {
+                            list.tags = list.headIntroduction.split(",")
+                        }
+                        this.detail = list;
                     } else {
                         this.$message({
                             message: res.msg,
@@ -300,22 +320,32 @@
                 this.editOtherLoading = false;
                 if(type == 0) {
                     this.editFormVisible = true;
+                    var array = [];
+                    if(this.detail.headIntroduction != null && this.detail.headIntroduction != "") {
+                        array = this.detail.headIntroduction.split(",")
+                    }
                     this.editForm = {
                         "name": this.detail.name,
-                        "headIntroduction": this.detail.headIntroduction,
+                        "headIntroduction": array,
                         "headPic": [{url:this.detail.briefIntroductionPic}]
                     }
                 } else {
                     this.editFormVisibleOther = true;
-                    const time = this.editFormOther.time;
+                    var time = this.editFormOther.time,
+                        amTime = this.editFormOther.amTime,
+                        pmTime = this.editFormOther.pmTime;  
                     if(this.detail.amTime != null) {
-                        time[0] = this.detail.amTime;
+                        var am = this.detail.amTime.split('-');
+                        amTime = am;
                     }
                     if(this.detail.pmTime != null) {
-                        time[1] = this.detail.pmTime;
+                        var pm = this.detail.pmTime.split('-');
+                        pmTime = pm;
                     }
                     this.editFormOther = {
                         "time": time,
+                        "amTime": amTime,
+                        "pmTime": pmTime,
                         "chargingStandard": this.detail.chargingStandard,
                         "phone": this.detail.phone,
                         "address": this.detail.address,
@@ -326,6 +356,27 @@
                     }
                 }
             },
+            
+            //添加标签
+            handleClose(tag) {
+                this.editForm.headIntroduction.splice(this.editForm.headIntroduction.indexOf(tag), 1);
+            },
+
+            showInput() {
+                this.inputVisible = true;
+                this.$nextTick(_ => {
+                    this.$refs.saveTagInput.$refs.input.focus();
+                });
+            },
+
+            handleInputConfirm() {
+                let inputValue = this.inputValue;
+                if (inputValue) {
+                    this.editForm.headIntroduction.push(inputValue);
+                }
+                this.inputVisible = false;
+                this.inputValue = '';
+            },
 
             //提交
             addSubmit() {
@@ -334,10 +385,15 @@
                         if(this.$refs.upload.uploadFiles.length == 1 && this.$refs.upload.uploadFiles[0].url != this.detail.briefIntroductionPic) {
                             this.$refs.upload.submit();
                         } else {
+                            var headIntroduction = "";
+                            for(var i in this.editForm.headIntroduction) {
+                                headIntroduction += this.editForm.headIntroduction[i] + ","
+                            }
+                            headIntroduction = headIntroduction.substring(0,headIntroduction.length-1);
                             this.http.post( this.port.agency.edit, {
                                 id: this.detail.id,
                                 name: this.editForm.name,
-                                headIntroduction: this.editForm.headIntroduction,
+                                headIntroduction: headIntroduction,
                             },
                             res => {
                                 if (res.code == "ok") {
@@ -369,10 +425,11 @@
             addSubmitOther() {
                 var form = {};
                 if(this.editType == 1) {
+                    var time = ""
                     form = {
                         id: this.detail.id,
-                        amTime: this.editFormOther.time[0],
-                        pmTime: this.editFormOther.time[1],
+                        amTime: this.editFormOther.amTime[0] + '-' + this.editFormOther.amTime[1],
+                        pmTime: this.editFormOther.pmTime[0] + '-' + this.editFormOther.pmTime[1],
                         chargingStandard: this.editFormOther.chargingStandard,
                         phone: this.editFormOther.phone,
                         address: this.editFormOther.address,
@@ -416,10 +473,15 @@
             uploadDiscardFile(params){
                 var fileObj = params.file;
                 var form = new FormData();
+                var headIntroduction = "";
+                for(var i in this.editForm.headIntroduction) {
+                    headIntroduction += this.editForm.headIntroduction[i] + ","
+                }
+                headIntroduction = headIntroduction.substring(0,headIntroduction.length-1);
                 form.append("file", fileObj);
                 form.append("id", this.detail.id);
                 form.append("name", this.editForm.name);
-                form.append("headIntroduction", this.editForm.headIntroduction);
+                form.append("headIntroduction", headIntroduction);
                 this.http.uploadFile( this.port.agency.edit, form,
                 res => {
                     if (res.code == "ok") {
@@ -582,6 +644,24 @@
         line-height: 30px;
     }
 
+    .el-tag + .el-tag {
+        margin-left: 10px;
+    }
+
+    .button-new-tag {
+        margin-left: 10px;
+        height: 32px;
+        line-height: 30px;
+        padding-top: 0;
+        padding-bottom: 0;
+    }
+
+    .input-new-tag {
+        width: 90px;
+        margin-left: 10px;
+        vertical-align: bottom;
+    }
+
     .el-container.is-vertical {
         overflow: hidden;
     }
@@ -682,6 +762,6 @@
     }
 
     .formMap {
-        height: 400px;
+        height: 300px;
     }
 </style>