Commit 1753764d authored by 黄奎's avatar 黄奎

页面修改

parent af209121
......@@ -8,7 +8,7 @@
<div class="content">
<div style="margin-bottom:20px">
<span>分类名称</span>
<el-input type="text" style="width:250px" size="small" maxlength="50" v-model="msg.Name"
<el-input type="text" style="width:250px" size="small" maxlength="100" v-model="msg.Name"
@input="(msg.pageIndex = 1), getList()" clearable>
</el-input>
<el-button @click="(msg.pageIndex = 1), getList()" size="small" type="primary">
......@@ -31,9 +31,12 @@
<el-table-column prop="Sort" label="排序"> </el-table-column>
<el-table-column label="操作" width="250px">
<template slot-scope="scope">
<img @click="showCategoryForm(scope.row)" src="../../assets/img/userman/edit.png" alt="" />
<img @click="RemmoveCategory(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png"
alt="" />
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img class="edit-img" src="../../assets/img/userman/edit.png" @click="showCategoryForm(scope.row)" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../assets/img/userman/del.png" @click="RemmoveCategory(scope.row)" />
</el-tooltip>
</template>
</el-table-column>
</el-table>
......@@ -43,12 +46,13 @@
</div>
<!-- 修改分类 -->
<el-dialog :title="editTitle" :visible.sync="isShowCategoryForm" width="500px">
<el-form :model="postMsg" :rules="rules" label-width="150px">
<el-form :model="postMsg" :rules="rules" label-width="150px" ref="hcategory" >
<el-form-item label="分类名称" prop="Name">
<el-input type="text" style="width:250px" size="small" maxlength="100" v-model="postMsg.Name">
</el-input>
</el-form-item>
<el-form-item label="Logo" prop="file">
<el-form-item label="Logo" prop="Image">
<div>
<el-button @click="openChangeDig()" size="small">选择文件</el-button>
</div>
......@@ -56,18 +60,18 @@
<img v-if="postMsg.Image" :src="postMsg.Image" alt="" style="width:100px;height:100px;" />
</div>
</el-form-item>
<el-form-item label="启用状态" prop="Enable">
<el-form-item label="启用状态">
<el-radio v-model="postMsg.Enable" :label="1">启用</el-radio>
<el-radio v-model="postMsg.Enable" :label="2">禁用</el-radio>
</el-form-item>
<el-form-item label="排序" prop="Sort">
<el-form-item label="排序">
<el-input style="width:250px" size="small" maxlength="200" v-model="postMsg.Sort">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowCategoryForm = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveData()">确 定</el-button>
<el-button size="small" type="primary" @click="saveMsg()">确 定</el-button>
</span>
</el-dialog>
<!-- 选择文件 -->
......@@ -93,7 +97,6 @@
pageSize: 15,
Name: ""
},
dateList: [], //日期
editTitle: "新增分类分类",
postMsg: {
Id: 0,
......@@ -110,18 +113,12 @@
message: "请输入名称",
trigger: "blur"
}],
Sort: [{
Image: [{
required: true,
message: "请输入排序",
message: "请选择文件",
trigger: "blur"
}],
Enable: [{
required: true,
message: "请选择状态",
trigger: "change"
}]
}
},
};
},
created() {},
......@@ -174,16 +171,30 @@
}
this.isShowCategoryForm = true;
},
//新增修改分类
saveData() {
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
//表单验证是否通过
saveMsg( ) {
//提交创建、修改表单
this.$refs["hcategory"].validate(valid => {
if (valid) {
this.saveData();
} else {
this.Error(res.data.message);
return false;
}
});
},
//新增修改分类
saveData() {
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
});
},
//删除分类
RemmoveCategory(item) {
......@@ -207,7 +218,7 @@
}
};
</script>
<style>
<style scope>
.performanceStatics .content {
background: #fff;
margin-top: 10px;
......@@ -215,4 +226,12 @@
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.edit-img {
margin-right: 10px;
}
.indexApp_image {
height: 80px;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment