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

页面修改

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