1产品数据库认领次数计数 2图片后加载功能 3二级超管显示昵称
This commit is contained in:
1 parent
dfcf5e8a2c
commit
bf7b32fb28
20 files changed
+345
-93
No files matched your search
+22
-1
@@ -69,6 +69,7 @@
|
||||
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colSkcId = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
this.colProductName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colProductCat = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -77,6 +78,7 @@
|
||||
this.colDraftId = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colSubSa = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colSubSaNick = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colEditNotes = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.ColDelete = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
@@ -412,6 +414,7 @@
|
||||
this.colCopyCookies,
|
||||
this.colSpuId,
|
||||
this.colSkcId,
|
||||
this.colImgUrl,
|
||||
this.colProductSkcPic,
|
||||
this.colProductName,
|
||||
this.colProductCat,
|
||||
@@ -420,6 +423,7 @@
|
||||
this.colDraftId,
|
||||
this.colMdyTime,
|
||||
this.colSubSa,
|
||||
this.colSubSaNick,
|
||||
this.colNotes,
|
||||
this.colEditNotes,
|
||||
this.ColDelete,
|
||||
@@ -433,6 +437,7 @@
|
||||
this.dgvSelectProduct.Size = new System.Drawing.Size(1430, 552);
|
||||
this.dgvSelectProduct.TabIndex = 190;
|
||||
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
|
||||
this.dgvSelectProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvSelectProduct_Scroll);
|
||||
//
|
||||
// ucSplitPage1
|
||||
//
|
||||
@@ -539,6 +544,13 @@
|
||||
this.colSkcId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
this.colSkcId.Width = 90;
|
||||
//
|
||||
// colImgUrl
|
||||
//
|
||||
this.colImgUrl.HeaderText = "主图路径";
|
||||
this.colImgUrl.Name = "colImgUrl";
|
||||
this.colImgUrl.ReadOnly = true;
|
||||
this.colImgUrl.Visible = false;
|
||||
//
|
||||
// colProductSkcPic
|
||||
//
|
||||
this.colProductSkcPic.HeaderText = "Skc图片";
|
||||
@@ -593,9 +605,16 @@
|
||||
//
|
||||
// colSubSa
|
||||
//
|
||||
this.colSubSa.HeaderText = "二级超管";
|
||||
this.colSubSa.HeaderText = "二级超管账号";
|
||||
this.colSubSa.Name = "colSubSa";
|
||||
this.colSubSa.ReadOnly = true;
|
||||
this.colSubSa.Visible = false;
|
||||
//
|
||||
// colSubSaNick
|
||||
//
|
||||
this.colSubSaNick.HeaderText = "二级超管";
|
||||
this.colSubSaNick.Name = "colSubSaNick";
|
||||
this.colSubSaNick.ReadOnly = true;
|
||||
//
|
||||
// colNotes
|
||||
//
|
||||
@@ -694,6 +713,7 @@
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
|
||||
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
|
||||
@@ -702,6 +722,7 @@
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn ColDelete;
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
if (BaseClass.SaLevel != 1)
|
||||
{
|
||||
dgvSelectProduct.Columns["colSubSa"].Visible = false;
|
||||
dgvSelectProduct.Columns["colSubSaNick"].Visible = false;
|
||||
btnSetSubSa.Visible = false;
|
||||
chkNoSubSa.Visible = false;
|
||||
}
|
||||
@@ -98,16 +99,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
lstAdminTemuDBProductSelect.AddRange(list);
|
||||
this.ucSplitPage1.TotalPage = pageCount;
|
||||
|
||||
if (defaultBitmap == null)
|
||||
defaultBitmap = new Bitmap(80, 80);
|
||||
// 获取Bitmap的Graphics对象
|
||||
using (Graphics g = Graphics.FromImage(defaultBitmap))
|
||||
{
|
||||
// 清除整个Bitmap为蓝色
|
||||
g.Clear(Color.White);
|
||||
}
|
||||
foreach (var prodSelect in lstAdminTemuDBProductSelect)
|
||||
{
|
||||
Image image = null;
|
||||
string imgUrl = prodSelect?.main_img?.Replace("https", "http");
|
||||
string rst = "";
|
||||
if (!string.IsNullOrWhiteSpace(imgUrl))
|
||||
image = GetHtml.GetUrlImg(imgUrl, out rst);
|
||||
if (!string.IsNullOrEmpty(rst))
|
||||
BaseMsgForm.ShowError(rst);
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
int rowIndex = this.dgvSelectProduct.Rows.Add(
|
||||
@@ -121,14 +122,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
"复制Cookies",
|
||||
prodSelect.spu_id,
|
||||
prodSelect.skc_id,
|
||||
image,//prod.main_img,
|
||||
prodSelect.main_img.Replace("https:", "http:"),
|
||||
defaultBitmap,//prod.main_img,
|
||||
prodSelect.product_name,
|
||||
prodSelect.cat_name,
|
||||
prodSelect.ext_code,
|
||||
prodSelect.status,
|
||||
prodSelect.draft_id,
|
||||
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yy/MM/dd HH:mm"),
|
||||
prodSelect.operate_sub_sa_name == "" ? "-" : prodSelect.operate_sub_sa_name,
|
||||
string.IsNullOrEmpty(prodSelect.operate_sub_sa_name) ? "-" : prodSelect.operate_sub_sa_name,
|
||||
string.IsNullOrEmpty(prodSelect.operate_sub_sa_nick) ? "-" : prodSelect.operate_sub_sa_nick,
|
||||
prodSelect.notes,
|
||||
"编辑",
|
||||
"删除",
|
||||
@@ -140,11 +143,52 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ShowDgvImg();
|
||||
this.pbLoading.Visible = false;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
Bitmap defaultBitmap = null;
|
||||
void ShowDgvImg()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
||||
{
|
||||
if (row.Cells["colProductSkcPic"].Displayed == false)
|
||||
continue;
|
||||
|
||||
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
|
||||
continue;
|
||||
|
||||
Image image = null;
|
||||
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
|
||||
string getImgError = "";
|
||||
if (!string.IsNullOrWhiteSpace(imgUrl))
|
||||
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
|
||||
if (!string.IsNullOrEmpty(getImgError))
|
||||
BaseMsgForm.ShowError(getImgError);
|
||||
|
||||
try
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
row.Cells["colProductSkcPic"].Value = image;
|
||||
}));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void dgvSelectProduct_Scroll(object sender, ScrollEventArgs e)
|
||||
{
|
||||
ShowDgvImg();
|
||||
}
|
||||
|
||||
|
||||
public List<TemuDBProductSelect> GetSelectProductList(out int pageCount, int page = 1, int pageSize = 50)
|
||||
{
|
||||
@@ -1023,13 +1067,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstProdId.Contains(p.id.ParseToString())).ToArray();
|
||||
|
||||
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => row.Cells["colSelect"]?.Value.ParseToBool() == true);
|
||||
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colSubSa"].Value = subSaName.ParseToString();
|
||||
row.Cells["colSubSa"].Value = subSa[0];
|
||||
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
|
||||
}
|
||||
foreach (var p in prodList)
|
||||
{
|
||||
p.operate_sub_sa_name = subSaName.ParseToString();
|
||||
p.operate_sub_sa_name = subSa[0];
|
||||
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1040,13 +1087,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstSupplierId.Contains(p.shop_id.ParseToString())).ToArray();
|
||||
|
||||
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => lstSupplierId.Contains(row.Cells["colSupplierId"]?.Value.ParseToString()));
|
||||
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colSubSa"].Value = subSaName.ParseToString();
|
||||
row.Cells["colSubSa"].Value = subSa[0];
|
||||
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
|
||||
}
|
||||
foreach (var p in prodList)
|
||||
{
|
||||
p.operate_sub_sa_name = subSaName.ParseToString();
|
||||
p.operate_sub_sa_name = subSa[0];
|
||||
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,9 @@
|
||||
<metadata name="colSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -168,6 +171,9 @@
|
||||
<metadata name="colSubSa.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colSubSaNick.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
Reference in new issue
Block a user