This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@ -12,37 +12,6 @@
margin-right: 10px;
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td.label {
width: 120px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
/*max-width: 200px;*/
}
#dialogdatatb td {
padding-top: 30px;
}
@ -112,6 +81,18 @@
z-index: 200;
background-color: #EFEFEF;
}
.dropdown .dropdown-wrapper {
border-color: #a9a9a9;
}
.dropdown .dropdown-wrapper > .dropdown-header {
min-height: 26px;
}
.dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text {
line-height: 26px;
}
</style>
<script>
//必须放在地图js之前
@ -125,16 +106,13 @@
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>"></script>
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.40"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.44"></script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/mapcontrol.js")%>"></script>
<script type="text/javascript">
var IsDealer = <%=IsDealer ?"true":"false"%>;
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
var DataGrid = window.DataGrid || window['g5-datagrid'];
function locationrequest(method, param, callback, error) {
_network.request("SystemSettings/ManageLocations.aspx", -1, method, param, callback, error || function (e) {
@ -156,7 +134,7 @@
$('#dialog_address').val('');
$('#dialog_address2').val('');
$('#dialog_city').val('');
editableSelectState.val('');
$('#dialog_state').dropdownVal('');
$('#dialog_zip').val('');
$('#dialog_notes').val('');
$('#imgfilogo').attr('src', '');
@ -179,11 +157,11 @@
var locationdata;
function OnEdit() {
locationdata = undefined;
var index = vue.$refs.grid.selectedIndex;
var index = grid_dt.selectedIndex;
if (index < 0) {
showAlert(GetTextByKey("P_SET_PLEASESELECTLOCATION", "Please select Location."), GetTextByKey("P_SET_EDITLOCATIONS", "Edit Location")); return;
}
var location = vue.$refs.grid.source[index];
var location = grid_dt.source[index];
if (!location) {
locationID = undefined;
pID = undefined;
@ -199,7 +177,7 @@
$('#dialog_address').val(location.Address);
$('#dialog_address2').val(location.Address2);
$('#dialog_city').val(location.City);
editableSelectState.text(location.State);
$('#dialog_state').dropdownVal(location.State);
$('#dialog_zip').val(location.Zip);
$('#dialog_notes').val(location.Notes);
$('#imgfilogo').attr('src', '../titlelogo.ashx?tp=location&cmpid=' + location.ID + "&sn=" + Math.random() + "'");
@ -216,16 +194,12 @@
$('#dialog_name').focus();
}
function OnDblClick(e) {
OnEdit();
}
function OnDelete() {
var index = vue.$refs.grid.selectedIndex;
var index = grid_dt.selectedIndex;
if (index < 0) {
return;
showAlert(GetTextByKey("P_SET_PLEASESELECTLOCATION", "Please select Location."), GetTextByKey("P_SET_EDITLOCATIONS", "Edit Location")); return;
}
var loc = vue.$refs.grid.source[index];
var loc = grid_dt.source[index];
if (!loc) {
return;
}
@ -268,44 +242,33 @@
r.Edit = "\uf044";
r.Delete = "\uf00d";
}
vue.source = data;
grid_dt.setData(data);
//vue.source = data;
}
var vue;
//加载表格
function initGrid() {
showmaskbg(true);
vue = new Vue({
el: "#locationlist",
components: {
'data-grid': DataGrid
},
data: {
columns: CreateStyleColumn(),
source: [],
totalRow: null
},
methods: {
rowdblclick: function () {
OnEdit();
}
}
});
showmaskbg(false);
grid_dt = createGridView('#locationlist');
grid_dt.columns = CreateStyleColumn();
grid_dt.init();
grid_dt.onCellDblClicked = function (_rowindex, colindex) {
if (colindex >= 0)
OnEdit();
};
}
//创建列表的行
function CreateStyleColumn() {
var list_columns = [
{ name: 'Name', caption: GetTextByKey("P_SET_LOCATIONSNAME", "Location Name"), valueIndex: 'Name', type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Code', caption: GetTextByKey("P_SET_CODE", "Code"), valueIndex: 'Code', type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_SET_LOCATIONSNAME", "Location Name"), valueIndex: 'Name', allowFilter: true, type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Code', caption: GetTextByKey("P_SET_CODE", "Code"), valueIndex: 'Code', allowFilter: true, type: 0, css: { 'width': 200, 'text-align': 'left' } },
//{ name: 'Latitude', caption: GetTextByKey("P_SET_LATITUDE", "Latitude"), valueIndex: 'Latitude', type: 0, css: { 'width': 150, 'text-align': 'left' } },
//{ name: 'Longitude', caption: GetTextByKey("P_SET_LONGITUDE", "Longitude"), valueIndex: 'Longitude', type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Address', caption: GetTextByKey("P_SET_ADDRESS1", "Address 1"), valueIndex: 'Address', type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Address2', caption: GetTextByKey("P_SET_ADDRESS2", "Address 2"), valueIndex: 'Address2', type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'City', caption: GetTextByKey("P_SET_CITY", "City"), valueIndex: 'City', type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'State', caption: GetTextByKey("P_SET_STATE", "State"), valueIndex: 'State', type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Zip', caption: GetTextByKey("P_SET_ZIP", "Zip"), valueIndex: 'Zip', type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Address', caption: GetTextByKey("P_SET_ADDRESS1", "Address 1"), valueIndex: 'Address', allowFilter: true, type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Address2', caption: GetTextByKey("P_SET_ADDRESS2", "Address 2"), valueIndex: 'Address2', allowFilter: true, type: 0, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'City', caption: GetTextByKey("P_SET_CITY", "City"), valueIndex: 'City', allowFilter: true, type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'State', caption: GetTextByKey("P_SET_STATE", "State"), valueIndex: 'State', allowFilter: true, type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Zip', caption: GetTextByKey("P_SET_ZIP", "Zip"), valueIndex: 'Zip', allowFilter: true, type: 0, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'LogoUrl', caption: GetTextByKey("P_SET_LOGO", "Logo"), valueIndex: "LogoUrl", type: 7, css: { 'width': 80, 'text-align': 'left' } },
{ name: 'Notes', caption: GetTextByKey("P_SET_NOTES", "Notes"), valueIndex: 'Notes', type: 0, css: { 'width': 280, 'text-align': 'left' } },
{ name: 'AddSub', caption: "", valueIndex: 'Add', type: 5, css: { 'width': 30, 'text-align': 'center' } },
@ -324,6 +287,8 @@
col.width = list_columns[hd].css.width;
col.align = list_columns[hd].css["text-align"]
col.key = list_columns[hd].valueIndex;
col.allowFilter = list_columns[hd].allowFilter;
if (col.name === "Name") {
col.styleFilter = function (e) {
if (e.PId > 0)
@ -332,79 +297,76 @@
return { 'font-weight': 'bold' };
}
}
else if (col.name === "AddSub") {
col.onclick = function (e) {
var index = vue.$refs.grid.selectedIndex;
if (index < 0) return;
var dep = vue.$refs.grid.source[index];
OnAdd(dep.ID);
};
col.filter = function (e) {
if (e.PId > 0)
return "";
else
return "\uf067";
}
col.styleFilter = function (e) {
if (e.PId > 0)
return { 'dispaly': 'none' };
else
return {
'font-family': 'FontAwesome',
'cursor': 'pointer',
'color': 'rgb(123, 28, 33)'
};
}
col.attrs = { 'title': GetTextByKey("P_SET_ADD", 'Add') };
}
else if (col.name === "LogoUrl") {
col.styleFilter = function (item) {
return { width: '60px' };
}
col.type = Object.create(libui.GridColumn, {
create: {
value: function () {
return libui.createElement('img', 'img-logo');
}
},
setValue: {
value: function (element, url) {
element.src = url;
}
}
});
col.styleFilter = function () {
return { "width": "60px", 'margin': 0 };
};
}
else if (col.name === "AddSub") {
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'plus';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnAdd(this.ID);
}
};
col.attrs = { 'title': GetTextByKey("P_SET_ADD", 'Edit') };
}
else if (col.name === "Location") {
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'map-marker-alt';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
locationdata = this;
SelectLocation();
}
};
col.attrs = { 'title': GetTextByKey("P_SET_SELECTLOCATION", 'Select Location') };
}
else if (col.name === "Edit") {
col.onclick = function (e) {
OnEdit();
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnEdit();
}
};
col.styleFilter = function (e) {
return {
'font-family': 'FontAwesome',
'cursor': 'pointer',
'color': 'rgb(123, 28, 33)'
};
}
col.attrs = { 'title': GetTextByKey("P_SET_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.onclick = function (e) {
OnDelete();
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete();
}
};
col.styleFilter = function (e) {
return {
'font-family': 'FontAwesome',
'cursor': 'pointer',
'color': 'rgb(123, 28, 33)'
};
}
col.attrs = { 'title': GetTextByKey("P_SET_DELETE", 'Delete') };
}
else if (col.name === "Location") {
col.onclick = function (e, item) {
locationdata = item;
SelectLocation();
};
col.filter = function (e) {
return "\uf3c5";
}
col.styleFilter = function (e) {
return {
'font-family': 'FontAwesome',
'cursor': 'pointer',
'color': 'rgb(123, 28, 33)'
};
}
col.attrs = { 'title': GetTextByKey("P_SET_SELECTLOCATION", 'Select Location') };
}
columns.push(col);
}
return columns;
@ -419,7 +381,7 @@
'Address': $.trim($('#dialog_address').val()),
'Address2': $.trim($('#dialog_address2').val()),
'City': $.trim($('#dialog_city').val()),
'State': $.trim(editableSelectState.text()),
'State': $.trim($('#dialog_state').dropdownVal()),
'Zip': $.trim($('#dialog_zip').val()),
'Notes': $.trim($('#dialog_notes').val())
};
@ -488,14 +450,14 @@
});
}
var editableSelectState;
$(function () {
setPageTitle(GetTextByKey("P_SET_MANAGELOCATIONS", 'Manage Locations'), true);
initGrid();
$('#btnBrowseLogo').click(browseLogo);
editableSelectState = new $editableselect($("#dialog_state"), 50);
editableSelectState.tabIndex(1);
$('#dialog_state').dropdown([], {
textKey: 'value'
});
OnRefresh();
@ -521,11 +483,14 @@
var statedata = [];
function getStates() {
statedata.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
var data = [];
data.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
editableSelectState.datasource = statedata;
editableSelectState.valuepath = ""
editableSelectState.displaypath = "";
for (var type of data) {
statedata.push({ value: type });
}
$('#dialog_state').dropdownSource(statedata);
}
var fiLogoFile = undefined;
@ -620,6 +585,10 @@
'Latitude': loc.Latitude,
'Longitude': loc.Longitude,
'Address': loc.Address,
'Address2': loc.Address2,
'City': loc.City,
'State': loc.State,
'Zip': loc.Zip,
'Notes': loc.Notes
};
var p = htmldecode(JSON.stringify(item));
@ -650,7 +619,7 @@
else
$('#dialog_address').val(evt.address.address.Match_addr);
$('#dialog_city').val(evt.address.address.City);
editableSelectState.text(evt.address.address.RegionAbbr);
$('#dialog_state').dropdownVal(evt.address.address.RegionAbbr);
$('#dialog_zip').val(evt.address.address.Postal);
}
});
@ -743,7 +712,7 @@
<tr>
<td class="label" data-lgid="P_SET_STATE_COLON">State:</td>
<td colspan="2">
<div id="dialog_state" style="width: 322px; height: 22px;"></div>
<div id="dialog_state" style="width: 324px;" class="dropdown"></div>
</td>
</tr>
<tr>