Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_step into develop
This commit is contained in:
@@ -66,12 +66,12 @@ namespace Client.Config
|
||||
.Elements("Software")
|
||||
.Select(x =>new SubModels.Software()
|
||||
{
|
||||
Path = ValidateSFTPath(x.Element("Path").Value),
|
||||
Arguments = x.Element("Arguments").Value,
|
||||
LongName = ValidateSFTLName(x.Element("LongName").Value),
|
||||
ShortName = ValidateSFTSName(x.Element("ShortName").Value),
|
||||
IconBase64 = ExtractBase64Icon(x.Element("Path").Value),
|
||||
Id = SoftwareId++.ToString()
|
||||
path = ValidateSFTPath(x.Element("Path").Value),
|
||||
arguments = x.Element("Arguments").Value,
|
||||
longName = ValidateSFTLName(x.Element("LongName").Value),
|
||||
shortName = ValidateSFTSName(x.Element("ShortName").Value),
|
||||
iconBase64 = ExtractBase64Icon(x.Element("Path").Value),
|
||||
id = SoftwareId++.ToString()
|
||||
}
|
||||
).ToArray();
|
||||
|
||||
|
||||
@@ -11,17 +11,17 @@ namespace Client.Config.SubModels
|
||||
public class Software
|
||||
{
|
||||
[DataMember]
|
||||
public string Id { get; set; }
|
||||
public string id { get; set; }
|
||||
[DataMember]
|
||||
public string Path { get; set; }
|
||||
public string path { get; set; }
|
||||
[DataMember]
|
||||
public string LongName { get; set; }
|
||||
public string longName { get; set; }
|
||||
[DataMember]
|
||||
public string ShortName { get; set; }
|
||||
public string shortName { get; set; }
|
||||
[DataMember]
|
||||
public string Arguments { get; set; }
|
||||
public string arguments { get; set; }
|
||||
[DataMember]
|
||||
public string IconBase64 { get; set; }
|
||||
public string iconBase64 { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static Client.Utils.Constants;
|
||||
@@ -205,14 +206,9 @@ namespace CMS_Client.Browser_Tools
|
||||
{
|
||||
if (e.Arguments.Count() == 0)
|
||||
return;
|
||||
String id = e.Arguments[0].StringValue;
|
||||
|
||||
Software sft = Config.ExtSoftwaresConfig.FirstOrDefault(X => X.Id == id);
|
||||
|
||||
if (sft != null)
|
||||
{
|
||||
Process.Start(sft.Path, sft.Arguments);
|
||||
}
|
||||
Thread t = new Thread(new ParameterizedThreadStart(OpenNew));
|
||||
t.Start(e.Arguments[0].StringValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,20 +218,36 @@ namespace CMS_Client.Browser_Tools
|
||||
{
|
||||
if (e.Arguments.Count() == 0)
|
||||
return;
|
||||
String id = e.Arguments[0].StringValue;
|
||||
|
||||
Software sft = Config.ExtSoftwaresConfig.FirstOrDefault(X => X.Id == id);
|
||||
Thread t = new Thread(new ParameterizedThreadStart(OpenStartNew));
|
||||
t.Start(e.Arguments[0].StringValue);
|
||||
}
|
||||
|
||||
|
||||
//Function used in Thread
|
||||
private void OpenStartNew(object id)
|
||||
{
|
||||
Software sft = Config.ExtSoftwaresConfig.FirstOrDefault(X => X.id == (string)id);
|
||||
|
||||
if (sft != null)
|
||||
{
|
||||
Process[] p = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(sft.Path)).OrderByDescending(X => X.StartTime).ToArray();
|
||||
Process[] p = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(sft.path)).OrderByDescending(X => X.StartTime).ToArray();
|
||||
|
||||
if (p.Count() > 0 && p[0].MainWindowHandle != IntPtr.Zero)
|
||||
NcWindow.ForceExtFocus(p[0].MainWindowHandle);
|
||||
else
|
||||
Process.Start(sft.Path, sft.Arguments);
|
||||
}
|
||||
}
|
||||
Process.Start(sft.path, sft.arguments);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Function used in Thread
|
||||
private void OpenNew(object id)
|
||||
{
|
||||
Software sft = Config.ExtSoftwaresConfig.FirstOrDefault(X => X.id == (string)id);
|
||||
if (sft != null)
|
||||
Process.Start(sft.path, sft.arguments);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -83,6 +83,9 @@
|
||||
<confirm_request_confirm>Conferma</confirm_request_confirm>
|
||||
<confirm_request_cancel>Annulla</confirm_request_cancel>
|
||||
|
||||
<!-- Utilities -->
|
||||
<utilities_header_label>Utility & Software esterni</utilities_header_label>
|
||||
|
||||
<!-- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Tooltips /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ -->
|
||||
<!-- Footer -->
|
||||
<footer_tooltip_production>Manager della produzione</footer_tooltip_production>
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
<softkey_confirm>Are you sure?</softkey_confirm>
|
||||
<confirm_request_confirm>Confirm</confirm_request_confirm>
|
||||
<confirm_request_cancel>Cancel</confirm_request_cancel>
|
||||
|
||||
<!-- Utilities -->
|
||||
<utilities_header_label>Utilities & External Softwares</utilities_header_label>
|
||||
|
||||
<!-- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Tooltips /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ -->
|
||||
<!-- Footer -->
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
<softkey_confirm>你確定?</softkey_confirm>
|
||||
<confirm_request_confirm>確認</confirm_request_confirm>
|
||||
<confirm_request_cancel>取消</confirm_request_cancel>
|
||||
|
||||
<!-- Utilities -->
|
||||
<utilities_header_label>公用事业和外部软件</utilities_header_label>
|
||||
|
||||
<!-- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Tooltips /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ -->
|
||||
<!-- Footer -->
|
||||
|
||||
@@ -8,42 +8,19 @@ declare let cmsClient: any;
|
||||
software: Object, i: Number
|
||||
}})
|
||||
export default class Utilities extends Vue{
|
||||
|
||||
|
||||
public getUtilities(): Array<Object> {
|
||||
if (typeof cmsClient != "undefined")
|
||||
return JSON.parse(cmsClient.getConfiguredProcesses());
|
||||
else
|
||||
return new Array<Object>();
|
||||
}
|
||||
|
||||
// public arrayJsonSoftware: Array<Object> = cmsClient.getConfiguredProcess();
|
||||
|
||||
/** Cancellare proprietà sotto se quella commentata è ok, attendere conferma Paolo */
|
||||
|
||||
public arrayJsonSoftware: Array<Object> = [{
|
||||
id: 1234567,
|
||||
path: "/test",
|
||||
longName: "CMS Copy",
|
||||
shortName: "CC",
|
||||
iconBase64: ""
|
||||
},{
|
||||
id: 3133213,
|
||||
path: "/test2",
|
||||
longName: "Presetting Tool",
|
||||
shortName: "ES",
|
||||
iconBase64: ""
|
||||
},{
|
||||
id: 46456464,
|
||||
path: "/test2",
|
||||
longName: "Presetting Tool",
|
||||
shortName: "ES",
|
||||
iconBase64: ""
|
||||
},{
|
||||
id: 867866,
|
||||
path: "/test2",
|
||||
longName: "Presetting Tool",
|
||||
shortName: "ES",
|
||||
iconBase64: ""
|
||||
},{
|
||||
id: 827726,
|
||||
path: "/test2",
|
||||
longName: "Presetting Tool",
|
||||
shortName: "ES",
|
||||
iconBase64: ""
|
||||
}];
|
||||
public startUtility(id) {
|
||||
if (typeof cmsClient != "undefined")
|
||||
cmsClient.openOrStartProcess(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,26 +5,14 @@
|
||||
<span>{{'utilities_header_label' | localize("Utilities")}}</span>
|
||||
</div>
|
||||
<div class="utilities-body scrollable">
|
||||
<div class="row" v-for="i in Math.ceil(arrayJsonSoftware.length / 4)" :key="i">
|
||||
<div v-for="software in arrayJsonSoftware.slice((i - 1) * 4, i * 4)" :key="software.id">
|
||||
<cardutilities @on-click-event="cmsClient.openOrStartProcess(software.id)" :title="software.longName" :letters="software.iconBase64 || software.shortName">
|
||||
<div class="row" v-for="i in Math.ceil(getUtilities().length / 4)" :key="i">
|
||||
<div v-for="software in getUtilities().slice((i - 1) * 4, i * 4)" :key="software.id">
|
||||
<cardutilities @on-click-event="startUtility(software.id)" :title="software.longName" :image="software.iconBase64" :letters="software.shortName">
|
||||
</cardutilities>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Cancellare commenti una volta approvato da Paolo -->
|
||||
<!-- </div>
|
||||
<cardutilities title="CMS Copy" letters="CC"></cardutilities>
|
||||
<cardutilities title="Presetting Tool" letters="PT"></cardutilities>
|
||||
<cardutilities title="Easystone" letters="ES"></cardutilities>
|
||||
<cardutilities title="Easyglass" letters="EG"></cardutilities> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script>
|
||||
import cardutilities from "src/modules/base-components/cards/card-utilities.vue";
|
||||
export default {
|
||||
components:{cardutilities}
|
||||
}
|
||||
</script>-->
|
||||
<script src="./utilities.ts" lang="ts"></script>
|
||||
@@ -5,7 +5,10 @@
|
||||
<span>{{title}}</span>
|
||||
</div>
|
||||
<div class="card-utilities-body">
|
||||
<button class="btn" @click="clickEvent"><div class="card-utilities-body-label">{{letters}}</div></button>
|
||||
<button class="btn" @click="clickEvent">
|
||||
<div v-if="!image" class="card-utilities-body-label">{{letters}}</div>
|
||||
<div v-if="image" class="card-utilities-body-label"><img :src="image" /></div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
@@ -14,7 +17,8 @@
|
||||
export default {
|
||||
props:{
|
||||
title: {default:""},
|
||||
letters: {default:""}
|
||||
letters: {default:""},
|
||||
image: {default:""}
|
||||
},
|
||||
methods:{
|
||||
clickEvent(){
|
||||
|
||||
Reference in New Issue
Block a user