提交 7fd4cfd5 authored 作者: zgy's avatar zgy

优化显示

上级 0cbebe1a
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by id desc order by sort
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by id desc order by sort
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by id desc order by type
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<Form-item label="标题" prop="postersTitle"> <Form-item label="标题" prop="postersTitle">
<i-input v-model="tbCfPosters.postersTitle" placeholder="标题"/> <i-input v-model="tbCfPosters.postersTitle" placeholder="标题"/>
</Form-item> </Form-item>
<Form-item label="类型" prop="postersType"> <Form-item label="排序" prop="sort">
<i-input v-model="tbCfPosters.postersType" placeholder="类型"/> <i-input v-model="tbCfPosters.sort" placeholder="类型"/>
</Form-item> </Form-item>
<!--<Form-item label="图片" prop="postersPicture"> <!--<Form-item label="图片" prop="postersPicture">
<i-input v-model="tbCfPosters.postersPicture" placeholder="图片"/> <i-input v-model="tbCfPosters.postersPicture" placeholder="图片"/>
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
<img v-bind:src="tbCfPosters.postersPicture" v-show="!!tbCfPosters.postersPicture"/> <img v-bind:src="tbCfPosters.postersPicture" v-show="!!tbCfPosters.postersPicture"/>
<input type="file" placeholder="图片" @change="tirggerFile($event)"/> <input type="file" placeholder="图片" @change="tirggerFile($event)"/>
</Form-item> </Form-item>
<Form-item label="是否展示" prop="isShow">
<i-input v-model="tbCfPosters.isShow" placeholder="是否展示"/>
</Form-item>
<Form-item label="跳转链接" prop="redirectUrl"> <Form-item label="跳转链接" prop="redirectUrl">
<i-input v-model="tbCfPosters.redirectUrl" placeholder="跳转链接"/> <i-input v-model="tbCfPosters.redirectUrl" placeholder="跳转链接"/>
</Form-item> </Form-item>
<Form-item label="是否展示" prop="isShow">
<i-input v-model="tbCfPosters.isShow" placeholder="是否展示"/>
</Form-item>
<Form-item label="备注" prop="remark"> <Form-item label="备注" prop="remark">
<i-input v-model="tbCfPosters.remark" placeholder="备注"/> <i-input v-model="tbCfPosters.remark" placeholder="备注"/>
</Form-item> </Form-item>
......
...@@ -33,21 +33,21 @@ ...@@ -33,21 +33,21 @@
<Card v-show="!showList"> <Card v-show="!showList">
<p slot="title">{{title}}</p> <p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfSort" :rules="ruleValidate" :label-width="80"> <i-form ref="formValidate" :model="tbCfSort" :rules="ruleValidate" :label-width="80">
<Form-item label="模块ID" prop="moduleId"> <!--<Form-item label="模块ID" prop="moduleId">
<i-input v-model="tbCfSort.moduleId" placeholder="模块ID"/> <i-input v-model="tbCfSort.moduleId" placeholder="模块ID"/>
</Form-item> </Form-item>-->
<Form-item label="序号" prop="sort"> <Form-item label="排序" prop="sort">
<i-input v-model="tbCfSort.sort" placeholder="序号"/> <i-input v-model="tbCfSort.sort" placeholder="序号"/>
</Form-item> </Form-item>
<Form-item label="模块" prop="module"> <Form-item label="模块" prop="module">
<i-input v-model="tbCfSort.module" placeholder="模块"/> <i-input v-model="tbCfSort.module" placeholder="模块"/>
</Form-item> </Form-item>
<Form-item label="名称" prop="name"> <!--<Form-item label="名称" prop="name">
<i-input v-model="tbCfSort.name" placeholder="名称"/> <i-input v-model="tbCfSort.name" placeholder="名称"/>
</Form-item> </Form-item>-->
<Form-item label="分类" prop="type"> <!--<Form-item label="分类" prop="type">
<i-input v-model="tbCfSort.type" placeholder="1:分类导航栏 2.爬虫品牌 3.海报图"/> <i-input v-model="tbCfSort.type" placeholder="1:分类导航栏 2.爬虫品牌 3.海报图"/>
</Form-item> </Form-item>-->
<Form-item label="备注" prop="remark"> <Form-item label="备注" prop="remark">
<i-input v-model="tbCfSort.remark" placeholder="备注"/> <i-input v-model="tbCfSort.remark" placeholder="备注"/>
</Form-item> </Form-item>
......
...@@ -5,8 +5,8 @@ $(function () { ...@@ -5,8 +5,8 @@ $(function () {
{label: 'id', name: 'id', index: 'id', key: true, hidden: true}, {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
/*{label: '一级分类ID', name: 'goodtypeId', index: 'goodtype_id', width: 80},*/ /*{label: '一级分类ID', name: 'goodtypeId', index: 'goodtype_id', width: 80},*/
{label: '标题', name: 'classTitle', index: 'class_title', width: 80}, {label: '标题', name: 'classTitle', index: 'class_title', width: 80},
{label: '图片', name: 'picture', index: 'picture', width: 80, formatter: imageFormat},
{label: '排序', name: 'sort', index: 'sort', width: 80}, {label: '排序', name: 'sort', index: 'sort', width: 80},
{label: '图片', name: 'picture', index: 'picture', width: 80, formatter: imageFormat},
{label: '是否展示', name: 'isShow', index: 'is_show', width: 80, formatter: validFormat}, {label: '是否展示', name: 'isShow', index: 'is_show', width: 80, formatter: validFormat},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}] {label: '创建时间', name: 'createTime', index: 'create_time', width: 80}]
}); });
......
...@@ -2,105 +2,105 @@ $(function () { ...@@ -2,105 +2,105 @@ $(function () {
$("#jqGrid").Grid({ $("#jqGrid").Grid({
url: '../tbcfposters/list', url: '../tbcfposters/list',
colModel: [ colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true}, {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '标题', name: 'postersTitle', index: 'posters_title', width: 80}, {label: '标题', name: 'postersTitle', index: 'posters_title', width: 80},
{label: '类型', name: 'postersType', index: 'posters_type', width: 80}, {label: '排序', name: 'sort', index: 'sort', width: 80},
{label: '图片', name: 'postersPicture', index: 'posters_picture', width: 80, formatter: imageFormat}, {label: '图片', name: 'postersPicture', index: 'posters_picture', width: 80, formatter: imageFormat},
{label: '跳转链接', name: 'redirectUrl', index: 'redirect_url', width: 80},
{label: '是否展示', name: 'isShow', index: 'is_show', width: 80, formatter: validFormat}, {label: '是否展示', name: 'isShow', index: 'is_show', width: 80, formatter: validFormat},
{label: '跳转链接', name: 'redirectUrl', index: 'redirect_url', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}, {label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
{label: '备注', name: 'remark', index: 'remark', width: 80} {label: '备注', name: 'remark', index: 'remark', width: 80}
] ]
}); });
}); });
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
data: { data: {
showList: true, showList: true,
title: null, title: null,
tbCfPosters: {}, tbCfPosters: {},
ruleValidate: { ruleValidate: {
name: [ name: [
{required: true, message: '名称不能为空', trigger: 'blur'} {required: true, message: '名称不能为空', trigger: 'blur'}
] ]
}, },
q: { q: {
name: '' name: ''
} }
}, },
methods: { methods: {
query: function () { query: function () {
vm.reload(); vm.reload();
}, },
add: function () { add: function () {
vm.showList = false; vm.showList = false;
vm.title = "新增"; vm.title = "新增";
vm.tbCfPosters = {}; vm.tbCfPosters = {};
}, },
update: function (event) { update: function (event) {
let id = getSelectedRow("#jqGrid"); let id = getSelectedRow("#jqGrid");
if (id == null) { if (id == null) {
return; return;
} }
vm.showList = false; vm.showList = false;
vm.title = "修改"; vm.title = "修改";
vm.getInfo(id); vm.getInfo(id);
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
let url = vm.tbCfPosters.id == null ? "../tbcfposters/save" : "../tbcfposters/update"; let url = vm.tbCfPosters.id == null ? "../tbcfposters/save" : "../tbcfposters/update";
Ajax.request({ Ajax.request({
url: url, url: url,
params: JSON.stringify(vm.tbCfPosters), params: JSON.stringify(vm.tbCfPosters),
type: "POST", type: "POST",
contentType: "application/json", contentType: "application/json",
successCallback: function (r) { successCallback: function (r) {
alert('操作成功', function (index) { alert('操作成功', function (index) {
vm.reload(); vm.reload();
}); });
} }
}); });
}, },
del: function (event) { del: function (event) {
let ids = getSelectedRows("#jqGrid"); let ids = getSelectedRows("#jqGrid");
if (ids == null){ if (ids == null) {
return; return;
} }
confirm('确定要删除选中的记录?', function () { confirm('确定要删除选中的记录?', function () {
Ajax.request({ Ajax.request({
url: "../tbcfposters/delete", url: "../tbcfposters/delete",
params: JSON.stringify(ids), params: JSON.stringify(ids),
type: "POST", type: "POST",
contentType: "application/json", contentType: "application/json",
successCallback: function () { successCallback: function () {
alert('操作成功', function (index) { alert('操作成功', function (index) {
vm.reload(); vm.reload();
}); });
} }
}); });
}); });
}, },
getInfo: function(id){ getInfo: function (id) {
Ajax.request({ Ajax.request({
url: "../tbcfposters/info/"+id, url: "../tbcfposters/info/" + id,
async: true, async: true,
successCallback: function (r) { successCallback: function (r) {
vm.tbCfPosters = r.tbCfPosters; vm.tbCfPosters = r.tbCfPosters;
} }
}); });
}, },
reload: function (event) { reload: function (event) {
vm.showList = true; vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page'); let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', { $("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name}, postData: {'name': vm.q.name},
page: page page: page
}).trigger("reloadGrid"); }).trigger("reloadGrid");
vm.handleReset('formValidate'); vm.handleReset('formValidate');
}, },
reloadSearch: function() { reloadSearch: function () {
vm.q = { vm.q = {
name: '' name: ''
}; };
...@@ -114,28 +114,28 @@ let vm = new Vue({ ...@@ -114,28 +114,28 @@ let vm = new Vue({
handleReset: function (name) { handleReset: function (name) {
handleResetForm(this, name); handleResetForm(this, name);
}, },
tirggerFile: function (event) { tirggerFile: function (event) {
var file = event.target.files[0]; var file = event.target.files[0];
var formData = new FormData(); var formData = new FormData();
formData.append("file", file); formData.append("file", file);
$.ajax({ $.ajax({
url: "../api/upload/image/", url: "../api/upload/image/",
type: "POST", type: "POST",
data: formData, data: formData,
cache: false, //不设置缓存 cache: false, //不设置缓存
processData: false, // 不处理数据 processData: false, // 不处理数据
contentType: false,// 不设置内容类型 contentType: false,// 不设置内容类型
success: function (result) { success: function (result) {
result = JSON.parse(result); result = JSON.parse(result);
//console.log(result) //console.log(result)
if (result.errno == 0) {//成功 if (result.errno == 0) {//成功
vm.tbCfPosters.postersPicture = result.data; vm.tbCfPosters.postersPicture = result.data;
vm.$forceUpdate(); vm.$forceUpdate();
} else { } else {
iview.Message.error(result.errmsg); iview.Message.error(result.errmsg);
} }
} }
}); });
} }
} }
}); });
\ No newline at end of file
...@@ -3,11 +3,11 @@ $(function () { ...@@ -3,11 +3,11 @@ $(function () {
url: '../tbcfsort/list', url: '../tbcfsort/list',
colModel: [ colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true}, {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '模块ID', name: 'moduleId', index: 'module_id', width: 80}, /*{label: '模块ID', name: 'moduleId', index: 'module_id', width: 80},*/
{label: '序号', name: 'sort', index: 'sort', width: 80},
{label: '模块', name: 'module', index: 'module', width: 80}, {label: '模块', name: 'module', index: 'module', width: 80},
{label: '名称', name: 'name', index: 'name', width: 80}, {label: '序号', name: 'sort', index: 'sort', width: 80},
{label: '分类', name: 'type', index: 'type', width: 80}, /*{label: '名称', name: 'name', index: 'name', width: 80},*/
/*{label: '分类', name: 'type', index: 'type', width: 80},*/
{label: '备注', name: 'remark', index: 'remark', width: 80}, {label: '备注', name: 'remark', index: 'remark', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80} {label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
] ]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论