define(function(require, exports, module) { var Window = require('system/views/pages/window'); var tpl = require('text!apps/edp/frs/frs008/view.tpl'); var sendWindow = require('apps/edp/frs/frs008/send'); var Router = require(Store.mainRouter); function ViewWindow(options, callback) { this.options = { title: '查看', content: tpl, width: 800, height: 600, modal: true, closed: true, closable: true, draggable: true, data: null } this.callback = callback; this.sender = ""; this.senderid = ""; this.theme = "回复主题:"; this.content="回复:"; _.extend(this.options, options); Window.call(this, this.options); } inherits(ViewWindow, Window); ViewWindow.prototype.init = function() {}; ViewWindow.prototype.customerize = function($container) { var self = this; self.options.data.re = 1; self.optionscopy = self.options; var data = self.options.data; this.$emailReSend = this.getElement('button.resend'); this.$emailFinish = this.getElement('button.finish'); this.$emailReSend.hide(); this.$emailReSend.click(function() { self.close(); params = { data: { sender: [{ username:self.sender, userid:self.senderid, }], content:self.content, theme: self.theme, re: 1, } } self.sendwindow = new sendWindow(params); self.sendwindow.open(); }); this.$emailFinish.click(function() { self.close(); }); this.$content = this.getElement(".Content"); this.$theme = this.getElement(".Theme"); this.$sendDate = this.getElement(".SendDate"); this.$sender = this.getElement(".Sender"); this.$addresseeName = this.getElement(".AddresseeName"); this.$accessoryname = this.getElement(".Accessoryname"); //content this.$content.html(data.content); this.$theme.text(data.theme); this.$sendDate.text(data.senddate); this.$sender.text(data.sender); if (data.category == 1) { this.$content.find('a').on('click', function() { var data_node = JSON.parse($(this).attr('data-node')); self.linknode(data_node); }); } //回复使用的变量 self.content+=data.content; self.theme += data.theme; self.sender = data.sender; self.senderid = data.senderid; var AddresseeNameText = ""; var rebutton = this.$emailReSend; var AddresseeJson = data.addresseeList; Store.logOn = Store.Cache.getJSON('userInfo'); $.each(AddresseeJson, function(i) { AddresseeNameText += "" + AddresseeJson[i].addresseename + ";" + ""; if (AddresseeJson[i].addresseeid === Store.logOn.userId) { rebutton.show(); } }); this.$addresseeName.html(AddresseeNameText); //附件 if (data.accessoryList != undefined) { var AccessoryText = ""; var AccessoryJson = data.accessoryList; $.each(AccessoryJson, function(i) { AccessoryText += "