From 9ca0e9dc50759f4c00498e68c0155bcc3db2be2f Mon Sep 17 00:00:00 2001 From: fangyuan <527392886@qq.com> Date: 星期二, 27 十二月 2022 15:20:02 +0800 Subject: [PATCH] 页面修改 --- src/views/manager/User.vue | 150 +++++++++++++++++++++++++------------------------ 1 files changed, 76 insertions(+), 74 deletions(-) diff --git a/src/views/manager/User.vue b/src/views/manager/User.vue index 7642170..815e4cd 100644 --- a/src/views/manager/User.vue +++ b/src/views/manager/User.vue @@ -75,46 +75,41 @@ </span> </el-dialog> - <el-dialog title="缂栬緫" :visible.sync="detailsVisible" width="50%" :append-to-body="true" - :before-close="detailsVisibleclose"> - <el-row :gutter="15"> - <el-form ref="detailsRow" :model="detailsRow" size="medium" - label-width="100px"> - <el-col :span="12"> - <el-form-item label="鐢ㄦ埛鍚�" prop="nickName"> - <el-input v-model="detailsRow.nickName" placeholder="璇疯緭鍏ョ敤鎴峰悕" clearable - :style="{ width: '100%' }"> - </el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="鐢ㄦ埛濮撳悕" prop="realName"> - <el-input v-model="detailsRow.realName" placeholder="璇疯緭鍏ョ敤鎴峰鍚�" clearable - :style="{ width: '100%' }"> - </el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="鎵嬫満鍙风爜" prop="userMobile"> - <el-input v-model="detailsRow.userMobile" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" clearable - :style="{ width: '100%' }"> - </el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="韬唤璇佸彿" prop="userIdcard"> - <el-input v-model="detailsRow.userIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" clearable - :style="{ width: '100%' }"> - </el-input> - </el-form-item> - </el-col> - </el-form> - </el-row> - <span slot="footer" class="dialog-footer"> - <el-button @click="detailsVisible = false">鍙� 娑�</el-button> - <el-button type="primary" @click="update">纭� 瀹�</el-button> - </span> - </el-dialog> + <el-dialog title="缂栬緫" :visible.sync="detailsVisible" width="50%" :append-to-body="true" + :before-close="detailsVisibleclose"> + <el-row :gutter="15"> + <el-form ref="detailsRow" :model="detailsRow" size="medium" label-width="100px"> + <el-col :span="12"> + <el-form-item label="鐢ㄦ埛鍚�" prop="nickName"> + <el-input v-model="detailsRow.nickName" placeholder="璇疯緭鍏ョ敤鎴峰悕" clearable :style="{ width: '100%' }"> + </el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鐢ㄦ埛濮撳悕" prop="realName"> + <el-input v-model="detailsRow.realName" placeholder="璇疯緭鍏ョ敤鎴峰鍚�" clearable :style="{ width: '100%' }"> + </el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎵嬫満鍙风爜" prop="userMobile"> + <el-input v-model="detailsRow.userMobile" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" clearable :style="{ width: '100%' }"> + </el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="韬唤璇佸彿" prop="userIdcard"> + <el-input v-model="detailsRow.userIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" clearable :style="{ width: '100%' }"> + </el-input> + </el-form-item> + </el-col> + </el-form> + </el-row> + <span slot="footer" class="dialog-footer"> + <el-button @click="detailsVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="update">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> @@ -131,13 +126,13 @@ data() { return { - rules: { + rules: { nickName: [{ required: true, message: '璇疯緭鍏ョ敤鎴峰悕 ', trigger: 'blur' }], - realName: [{ + realName: [{ required: true, message: '璇疯緭鍏ョ敤鎴峰鍚�', trigger: 'blur' @@ -147,18 +142,18 @@ message: '璇疯緭鍏ユ墜鏈哄彿 ', trigger: 'blur' }], - userIdcard: [{ + userIdcard: [{ required: true, message: '璇疯緭鍏ヨ韩浠借瘉 ', trigger: 'blur' }], - }, + }, //璇︾粏鍐呭寮规 detailsVisible: false, //璇︾粏鍐呭 - detailsRow: - { - } + detailsRow: + { + } , //琛ㄥ崟鎻愪氦鍐呭 addPublicityForm: { @@ -209,14 +204,18 @@ { //鍒犻櫎 remove(val) { - this.$http.delete('/api/user', { params: { id: val } }).then(res => { - this.$message({ - message: '鍒犻櫎鎴愬姛', - type: 'success' + var _this = this; + this.$confirm('纭鍒犻櫎锛�').then(() => { + _this.$http.delete('/api/user', { params: { id: val } }).then(res => { + _this.$message({ + message: '鍒犻櫎鎴愬姛', + type: 'success' + }) + this.search(); }) + } + ) - this.search(); - }) }, // //鍙戝竷/涓嬫灦 // punlish(val, val2) { @@ -246,16 +245,19 @@ //缂栬緫 details(val) { this.detailsVisible = true; - this.detailsRow = Object.assign({}, val); + this.detailsRow = Object.assign({}, val); }, - update(){ - this.$http.put('/api/user',this.detailsRow).then(res => {this.$message({ - message: '缂栬緫鎴愬姛', - type: 'success'} + update() { + this.$http.put('/api/user', this.detailsRow).then(res => { + this.$message({ + message: '缂栬緫鎴愬姛', + type: 'success' + } ) - this.search();} - ); - this.detailsVisible =false; + this.search(); + } + ); + this.detailsVisible = false; }, //閲嶇疆瀵嗙爜 @@ -267,20 +269,20 @@ }, //娣诲姞 add() { - this.$refs.addPublicityForm.validate(async (vaild) => { + this.$refs.addPublicityForm.validate(async (vaild) => { if (!vaild) return this.$message.error('杈撳叆鏈夎') - let param = null; - param = this.addPublicityForm; - addPublicityList(param).then(res => { - this.$message({ - message: '鎿嶄綔鎴愬姛', - type: 'success' - }); - this.addPublicityForm={}; - this.init(); - } - ) - this.addPublicityVisibel = false; + let param = null; + param = this.addPublicityForm; + addPublicityList(param).then(res => { + this.$message({ + message: '鎿嶄綔鎴愬姛', + type: 'success' + }); + this.addPublicityForm = {}; + this.init(); + } + ) + this.addPublicityVisibel = false; }) }, //鍏抽棴涔嬪墠 -- Gitblit v1.8.0