sync
This commit is contained in:
@ -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: 30px;
|
||||
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;
|
||||
}
|
||||
@ -56,8 +25,7 @@
|
||||
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
|
||||
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var DataGrid = window.DataGrid || window['g5-datagrid'];
|
||||
<script type="text/javascript">
|
||||
|
||||
function departmentrequest(method, param, callback, error) {
|
||||
_network.request("SystemSettings/ManageDepartments.aspx", -1, method, param, callback, error || function (e) {
|
||||
@ -87,11 +55,11 @@
|
||||
var departmentID;
|
||||
var pID;
|
||||
function OnEdit() {
|
||||
var index = vue.$refs.grid.selectedIndex;
|
||||
var index = grid_dt.selectedIndex;
|
||||
if (index < 0) {
|
||||
showAlert(GetTextByKey("P_SET_PLEASESELECTDEPARTMENT", "Please select Department."), GetTextByKey("P_SET_EDITLOCATIONS", "Edit Department")); return;
|
||||
}
|
||||
var department = vue.$refs.grid.source[index];
|
||||
var department = grid_dt.source[index];
|
||||
if (!department) {
|
||||
departmentID = undefined;
|
||||
pID = undefined;
|
||||
@ -118,11 +86,11 @@
|
||||
}
|
||||
|
||||
function OnDelete() {
|
||||
var index = vue.$refs.grid.selectedIndex;
|
||||
var index = grid_dt.selectedIndex;
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
var dep = vue.$refs.grid.source[index];
|
||||
var dep = grid_dt.source[index];
|
||||
if (!dep) {
|
||||
return;
|
||||
}
|
||||
@ -160,31 +128,18 @@
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
}
|
||||
vue.source = data;
|
||||
grid_dt.setData(data);
|
||||
}
|
||||
|
||||
var vue;
|
||||
//加载表格
|
||||
function initGrid() {
|
||||
showmaskbg(true);
|
||||
vue = new Vue({
|
||||
el: "#departmentlist",
|
||||
components: {
|
||||
'data-grid': DataGrid
|
||||
},
|
||||
data: {
|
||||
columns: CreateStyleColumn(),
|
||||
source: [],
|
||||
totalRow: null
|
||||
},
|
||||
methods: {
|
||||
rowdblclick: function () {
|
||||
OnEdit();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
showmaskbg(false);
|
||||
grid_dt = createGridView('#departmentlist');
|
||||
grid_dt.columns = CreateStyleColumn();
|
||||
grid_dt.init();
|
||||
grid_dt.onCellDblClicked = function (_rowindex, colindex) {
|
||||
if (colindex >= 0)
|
||||
OnEdit();
|
||||
};
|
||||
}
|
||||
//创建列表的行
|
||||
function CreateStyleColumn() {
|
||||
@ -218,60 +173,42 @@
|
||||
}
|
||||
}
|
||||
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.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.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') };
|
||||
col.attrs = { 'title': GetTextByKey("P_SET_ADD", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Edit") {
|
||||
col.filter = function () {
|
||||
return '\uf044';
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'edit';
|
||||
col.iconType = 'fa-light';
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
}
|
||||
};
|
||||
col.onclick = function (e) {
|
||||
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.filter = function () {
|
||||
return '\uf00d';
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'times';
|
||||
col.iconType = 'fa-light';
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete();
|
||||
}
|
||||
};
|
||||
col.onclick = function (e) {
|
||||
OnDelete();
|
||||
};
|
||||
col.styleFilter = function (e) {
|
||||
return {
|
||||
'font-family': 'FontAwesome',
|
||||
'cursor': 'pointer',
|
||||
'color': 'rgb(123, 28, 33)'
|
||||
};
|
||||
}
|
||||
col.attrs = { 'title': GetTextByKey("P_SET_DELETE", 'Delete') };
|
||||
}
|
||||
columns.push(col);
|
||||
|
Reference in New Issue
Block a user