Commit 729b54f6 authored by zhangboyang's avatar zhangboyang

table bug

parent 42488b87
......@@ -14,3 +14,4 @@
/MTM-Vue - 副本
/FTT.Board.VueUI/board
/Product
/MTM-zby
......@@ -76,7 +76,7 @@ export default {
loadData() {
if (!this.chart.IsShow) {
return;
}
} else {
var me = this;
var url = me.Api.url;
var data = {
......@@ -105,6 +105,7 @@ export default {
}
});
}
}
},
beforeDestroy() {
if (this.timer) {
......
......@@ -2,7 +2,7 @@
<div style="font-size:30px" :style="{color:chart.FontColor,background:chart.BackgroundColor}">
<div style="width:100%">
<table style="width:100%;height:100%">
<tr>
<tr style="height:8%">
<td
v-for="(item,index) in titlestore"
class="tableclass"
......@@ -56,17 +56,23 @@ export default {
this.laodDataTime = (count - 5 <= 0 ? 0 : count - 5) * 1000;
} else {
this.laodDataTime =
(this.chart.PageSize * this.chart.RefreshTime - 5) * 1000;
this.chart.PageSize * this.chart.RefreshTime - 5 <= 0
? 1000
: (this.chart.PageSize * this.chart.RefreshTime - 5) * 1000;
}
// console.log("laodDataTime" + this.laodDataTime);
}
},
laodDataTime: function(val, oldval) {
console.log("加载时间变化,new:" + val + " old:" + oldval);
if (val != oldval) {
if (this.timer) {
this.timer = null;
console.log("第2次加载");
clearInterval(this.timer);
this._loadDataInterval();
} else {
console.log("第3次加载");
this._loadDataInterval();
}
}
......@@ -76,6 +82,7 @@ export default {
// console.log("oldval: " + oldval);
if (val != oldval) {
if (this.timer1) {
this.timer1 = null;
clearInterval(this.timer1);
this._itemRefreshTime();
} else {
......@@ -114,20 +121,10 @@ export default {
//获取数据定时器
_loadDataInterval() {
var me = this;
//换页
if (this.chart.RefreshType == 1) {
// this.laodDataTime =(this.chart.PageSize / this.chart.RefreshTime - 5) * 1000;
this.timer = setInterval(function() {
console.log("获取数据" + me.laodDataTime);
// console.log(new Date());
_this.loadData();
}, me.laodDataTime);
}
//换行
if (this.chart.RefreshType == 2) {
// this.laodDataTime =(this.chart.PageSize / this.chart.RefreshTime - 5) * 1000;
clearInterval(this.timer);
if (this.timer == null) {
this.timer = setInterval(function() {
console.log("获取数据" + me.laodDataTime);
console.log("获取数据时间:" + me.laodDataTime);
// console.log(new Date());
_this.loadData();
}, me.laodDataTime);
......@@ -138,6 +135,7 @@ export default {
if (!this.chart.IsShow) {
return;
}
console.log("加载数据");
var url = me.Api.url;
var data = {
ProcName: me.boardstore.ProcName,
......@@ -165,7 +163,7 @@ export default {
} else {
me.pageindex++;
}
if (this.chart.RefreshType == 2) {
if (this.itemdata.length == 0) {
this.loadData();
var data = me._changeDataType(res.rows);
......@@ -175,6 +173,10 @@ export default {
} else {
this._getData(res.rows);
}
}
if (this.chart.RefreshType == 1) {
this.itemdata = me._changeDataType(res.rows);
}
} else {
console.log(res.message);
}
......@@ -201,7 +203,6 @@ export default {
var me = this;
var data = me._changeDataType(rows);
if (this.chart.RefreshType == 2) {
for (let index = 0; index < data.length; index++) {
let element = data[index];
......@@ -209,6 +210,7 @@ export default {
}
// _this.bodystore= _this.bodystore.uniquetwo();
} else if (this.chart.RefreshType == 1) {
debugger;
this.bodystore = data;
}
},
......@@ -253,6 +255,7 @@ export default {
this.itemdata.push(rowdata);
this.itemdata.shift(); //移除第一条
} else if (this.chart.RefreshType == 1) {
debugger;
this.itemdata = this.bodystore;
}
}
......@@ -269,21 +272,21 @@ export default {
created() {
_this = this;
this.loadData();
// var time =
// (this.chart.RefreshTime != 0
// ? this.chart.RefreshTime
// : this.boardstore.RefreshTime) * 1000;
this.laodDataTime =
(this.chart.RefreshTime != 0
? this.chart.RefreshTime
: this.boardstore.RefreshTime) * 1000;
setTimeout(() => {
console.log("第一次加载");
_this._loadDataInterval();
}, 1000);
if (this.chart.RefreshType == 2) {
//执行换行/换页程序
setTimeout(() => {
_this._itemRefreshTime();
}, 3000);
}
}
};
</script>
<style >
......
using FTT.Board.Common;
using FTT.Board.EF;
using System.Linq;
using System.Web.Http;
namespace FTT.Board.Controllers
{
public class Chart1Controller : ApiController
{
/// <summary>
///
/// </summary>
/// <returns></returns>
[System.Web.Http.HttpGet]
public CharPanle Get(int PageSize, int PageIndex, int Flag, int WorkTeamID)
{
CharPanle main= new CharPanle();
using (var db = MsSqlDbContextWraper.NewContext())
{
using (var command = db.MultiResultSql)
{
main = command.Sql("Exec SP_RPT_ProductionPlan @PageSize,@PageIndex,@Flag,@WorkTeamID")
.Parameter("PageSize", PageSize).Parameter("PageIndex", PageIndex).Parameter("Flag", Flag).Parameter("WorkTeamID", WorkTeamID)
.QuerySingle<CharPanle>();
if (main != null) main.Detail = command.QueryMany<NameValue>().ToList();
}
}
return main;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[System.Web.Http.HttpGet]
public string GetTitle(int PageSize, int PageIndex, int Flag, int WorkTeamID)
{
using (var db = MsSqlDbContextWraper.NewContext())
{
using (var command = db.MultiResultSql)
{
return command.Sql("Exec SP_RPT_ProductionPlan @PageSize,@PageIndex,@Flag,@WorkTeamID")
.Parameter("PageSize", PageSize).Parameter("PageIndex", PageIndex).Parameter("Flag", Flag).Parameter("WorkTeamID", WorkTeamID)
.QuerySingle<string>();
}
}
return null;
} /// <summary>
///
/// </summary>
/// <returns></returns>
[System.Web.Http.HttpGet]
public string GetNotice(int PageSize, int PageIndex, int Flag, int WorkTeamID)
{
using (var db = MsSqlDbContextWraper.NewContext())
{
return db.Sql("Exec SP_RPT_ProductionPlan @PageSize,@PageIndex,@Flag,@WorkTeamID")
.Parameter("PageSize", PageSize).Parameter("PageIndex", PageIndex).Parameter("Flag", Flag).Parameter("WorkTeamID", WorkTeamID)
.QuerySingle<string>();
}
return null;
}
///
/// </summary>
/// <returns></returns>
[System.Web.Http.HttpGet]
public string dynamic()
{
using (var db = MsSqlDbContextWraper.NewContext())
{
return db.Sql("Select * From sys.object")
.QuerySingle<dynamic>();
}
return null;
}
}
}
......@@ -164,7 +164,6 @@
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\API\CFG\CFG_BoardController.cs" />
<Compile Include="Controllers\Chart1Controller.cs" />
<Compile Include="Controllers\ChartController.cs" />
<Compile Include="Controllers\API\CFG\CFG_BoardDetailController.cs" />
<Compile Include="Controllers\HomeController.cs" />
......@@ -231,6 +230,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Content\images\" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
......
......@@ -9,7 +9,9 @@
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="db" value="Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=FTT_Board;Data Source=192.168.1.204" />
<!--<add key="db" value="Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=FTT_Board;Data Source=192.168.1.204" />-->
<add key="db" value="Password=a*1;Persist Security Info=True;User ID=sa;Initial Catalog=FTT_MES;Data Source=122.226.244.210,1800" />
</appSettings>
<connectionStrings>
<add name="BoardModelContainer" connectionString="metadata=res://*/BoardModel.csdl|res://*/BoardModel.ssdl|res://*/BoardModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.1.204;initial catalog=FTT_Board;persist security info=True;user id=sa;password=sa;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
......
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