...
|
...
|
@@ -6,7 +6,6 @@ var $ = require('jquery'); |
|
|
var common = require('../common/common');
|
|
|
/**
|
|
|
* 列表显示数据
|
|
|
* @type {common.grid}
|
|
|
*/
|
|
|
var g = new common.grid({
|
|
|
el: '#content-list',
|
...
|
...
|
@@ -14,91 +13,55 @@ var g = new common.grid({ |
|
|
//查询参数
|
|
|
parms: function () {
|
|
|
return {
|
|
|
modelName: common.util.__input('content-filter1'),
|
|
|
englishName: common.util.__input('content-filter2'),
|
|
|
status: common.util.__input('status-filter')
|
|
|
status: common.util.__input('status-filter'),
|
|
|
type: common.util.__input('type-filter')
|
|
|
};
|
|
|
},
|
|
|
//列表显示
|
|
|
columns: [
|
|
|
{display: "姓名", name: "modelName"},
|
|
|
{display: "英文名", name: "englishName"},
|
|
|
{display: "名称", name: "name"},
|
|
|
{
|
|
|
display: "头像", name: "avatar", render: function (item) {
|
|
|
return '<img src="' + item.avatar + '" width="100" height="60"/>'
|
|
|
}
|
|
|
},//图片显示
|
|
|
{display: "国籍", name: "nationality"},
|
|
|
{display: "身高", name: "height"},
|
|
|
{display: "体重", name: "weight"},
|
|
|
{
|
|
|
display: "胸围", render: function (item) {
|
|
|
var a = item.vitalStatistics.split(/[,|/]/g);
|
|
|
return a[0];
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
display: "腰围", render: function (item) {
|
|
|
var a = item.vitalStatistics.split(/[,|/]/g);
|
|
|
return a[1];
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
display: "臀围", render: function (item) {
|
|
|
var a = item.vitalStatistics.split(/[,|/]/g);
|
|
|
return a[2];
|
|
|
}
|
|
|
},
|
|
|
{display: "鞋码", name: "shoeSize"},
|
|
|
{display: "衣服尺码", name: "dressSize"},
|
|
|
{
|
|
|
display: "模特卡", name: "modelCard", render: function (item) {
|
|
|
return '<img src="' + item.modelCard + '" width="100" height="60"/>'
|
|
|
display: "类别", name: "type", render: function (item) {
|
|
|
var type = item.type+"";
|
|
|
var type1 = type.replace(1, "拍摄类型").replace(2, "拍摄风格")
|
|
|
.replace(3, "模特类型").replace(4, "道具类型")
|
|
|
.replace(5, "滤镜效果").replace(6, "摄影场景")
|
|
|
.replace(/\|/g, " ");
|
|
|
return type1;
|
|
|
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
display: "状态", name: "status", render: function (item) {
|
|
|
if (item.status == 1) {
|
|
|
return status = "启用"
|
|
|
return "可用"
|
|
|
}
|
|
|
else {
|
|
|
return status = "禁用"
|
|
|
return "不可用"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
display: "操作", name: "", render: function (item) {
|
|
|
var arr = [];
|
|
|
arr.push('<a class="btn btn-info update" data-index="' + item.__index + '">修改</a>');
|
|
|
arr.push('<a class="btn btn-danger delete" data-index="' + item.__index + '">删除</a>');
|
|
|
return arr.join('');
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
g.init("/shotManage/model/getAllModels");
|
|
|
g.init("/shotManage/shotRequire/index1");
|
|
|
|
|
|
var Bll = {
|
|
|
toast: function (url, item, hint) {
|
|
|
var e = new common.edit("#baseform", {
|
|
|
bucket: "modelCard"
|
|
|
});
|
|
|
//e.on("validate",function(){
|
|
|
// var dressSize=$.trim($("#dressSize").val());
|
|
|
// if(dressSize!='s'){
|
|
|
// return "尺码有误";
|
|
|
// }
|
|
|
// return true;
|
|
|
//});
|
|
|
var a=common.dialog.confirm(hint,
|
|
|
var e = new common.edit("#baseform");
|
|
|
var a = common.dialog.confirm(hint,
|
|
|
common.util.__template2($("#template").html(), item),
|
|
|
function () {
|
|
|
e.submit(url, function (option) {
|
|
|
option.data.modelType = 1;//模特类型,默认拍摄模特
|
|
|
option.data.status = 1;//模特状态,默认启用
|
|
|
option.data.height = parseInt($("#height").val());//模特身高
|
|
|
option.data.weight = parseInt($("#weight").val());//模特体重
|
|
|
option.data.status = 1;//模特状态,默认启用
|
|
|
option.data.vitalStatistics = $("#Bust").val() + '|' + $("#waist").val() + "|" + $("#hips").val();//模特三围,拼接字符串
|
|
|
option.data.status = 1;//状态,默认启用
|
|
|
option.data.type = parseInt($("#type").val());//类别
|
|
|
option.data.id = item.id;//类别
|
|
|
//option.debug = true;//调试状态
|
|
|
option.success = function (res) {
|
|
|
//判断接口请求状态
|
...
|
...
|
@@ -116,24 +79,31 @@ var Bll = { |
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
e.init();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
//添加模特--点击事件
|
|
|
//添加--点击事件
|
|
|
$('#add-content').on('click', function () {
|
|
|
var item = {};
|
|
|
Bll.toast('/shotManage/model/addModel', item, "添加模特");
|
|
|
Bll.toast('/shotManage/shotRequire/add', item, "添加");
|
|
|
});
|
|
|
//修改模特--点击事件
|
|
|
$(document).on('click', '.update', function () {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
var a = item.vitalStatistics.split(/[,|/]/g);
|
|
|
item.Bust = a[0];
|
|
|
item.waist = a[1];
|
|
|
item.hips = a[2];
|
|
|
Bll.toast('/shotManage/model/updateModel', item, "修改模特");
|
|
|
//删除--点击事件
|
|
|
$(document).on('click', '.delete', function() {
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认删除?",
|
|
|
function() {
|
|
|
common.util.__ajax({
|
|
|
url:'/shotManage/shotRequire/update',
|
|
|
data:{
|
|
|
id: item.id,
|
|
|
name: item.name
|
|
|
}
|
|
|
},function() {
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
//查询按钮--点击事件
|
|
|
$(document).on('click', '#filter-btn', function () {
|
...
|
...
|
|