define(function (require) {
'use strict';
var lib = {
ko: require('ko'),
f7: require('f7'),
$$: require('f7').$,
$: require('jquery'),
htmleditor: require('htmleditor'),
};
var helper = {
view: require('oa!app/helper/view'),
router: require('oa!app/helper/router'),
overlays: require('oa!app/helper/overlays'),
string: require('oa!app/helper/string'),
events: require('oa!app/helper/events'),
language: require('app/helper/language'),
shell: require('oa!app/helper/shell'),
pic: require('oa!app/helper/picCompress'),
settings: require('app/helper/settings'),
};
var model = {
user: require('oa!app/model/IBP/User'),
release: require('oa!app/model/common/Release'),
};
return function (args) {
var me = helper.view.base.call(this, args);
var id = args.query.id || 0;
var uname = model.user.getUserName();
var settings = helper.settings.get();
var fromDetail = args.query.fromDetail || 0;
me.viewModel = {
routeName: lib.ko.observable(),
originName: lib.ko.observable(),
originLBS: lib.ko.observable(""),
iPublic: lib.ko.observable(),
omiPublic: lib.ko.observable(),
remark: lib.ko.observable(),
publicVisible: lib.ko.observable(),
createUserID: lib.ko.observable(),
title: lib.ko.observable(helper.language.getText('Release.CamerApproach')),
disabledckeck: lib.ko.observable(false),
btnVisible: lib.ko.observable(false),
tipVisible: lib.ko.observable(false),
signImgApp: lib.ko.observable(''),//照片
list: lib.ko.observableArray(),
deleteImg: function (data, event) {
me.viewModel.list.remove(function (o) { return o.signImgApp == data.signImgApp; });
event.stopPropagation();
},
//保存
save: function () {
//if (me.viewModel.list().length <= 0) {
// helper.overlays.tipPopup('请先拍照!');
// return;
//}
var SurList = "";
for (var i = 0; i < me.viewModel.list().length; i++) {
if (settings.isAbsUrl) {
SurList += me.viewModel.list()[i]["signImgApp"].replace(settings.siteUrl + '/', '') + ";";
}
else {
SurList += me.viewModel.list()[i]["signImgApp"].replace('/OM/', '') + ";";
}
}
if (id > 0) {
var condition = {
"relaId": id,
"image": SurList,
"type": 0
};
model.release.updateReturnStatus(condition).done(function (res) {