@{
|
ViewBag.Title = "页面配置";
|
Layout = "~/Views/Shared/_LayoutVue.cshtml";
|
}
|
<div id="pageSet" v-cloak>
|
<el-card class="box-card">
|
<el-form label-width="90px" v-bind:model="formData" v-bind:rules="formRules" class="demo-ruleForm" v-bind:inline="true" ref="formData">
|
<el-form-item label="功能模块:" prop="power">
|
<hh-select-url v-model="formData.power"
|
url="@Url.Action("GetPowerType")"
|
valuefield="CN_GUID"
|
textfield="CN_S_POWER"
|
datafield="Data">
|
</hh-select-url>
|
</el-form-item>
|
<el-form-item label="编码:">
|
<el-input v-model="formData.code" size="mini"></el-input>
|
</el-form-item>
|
<el-form-item label="名称:">
|
<el-input v-model="formData.name" size="mini"></el-input>
|
</el-form-item>
|
<el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">查 询</el-button>
|
<el-button size="mini" type="primary" v-on:click="add">新增</el-button>
|
</el-form>
|
</el-card>
|
<el-table v-bind:data="pageSetData"
|
class="tb-edit"
|
style="width: 100%;"
|
border
|
highlight-current-row
|
size="mini"
|
v-bind:height="tabHeight"
|
v-on:row-click="pageSetRowClick"
|
ref="list">
|
<el-table-column label="功能模块" prop="CN_S_POWER" width="130" align="center"></el-table-column>
|
<el-table-column label="编码" prop="CN_S_POWER_CODE" width="190"></el-table-column>
|
<el-table-column label="名称" prop="CN_S_POWER_NAME" width="130"></el-table-column>
|
<el-table-column label="是否启用" prop="CN_B_ENABLED" width="70" align="center">
|
<template scope="scope">
|
<el-switch v-model="scope.row.CN_B_ENABLED" size="mini" v-on:change="changeRowData(scope.row)">
|
</el-switch>
|
</template>
|
</el-table-column>
|
<el-table-column label="宽度" prop="CN_F_WIDTH" width="50" align="center"></el-table-column>
|
<el-table-column label="对齐" prop="CN_S_ALIGN" width="60" align="center"></el-table-column>
|
<el-table-column label="方法" prop="CN_S_METHOD_NAME" width="90" align="center"></el-table-column>
|
<el-table-column label="备注" prop="CN_S_REMARK">
|
<template scope="scope">
|
<el-input size="mini"
|
v-model="scope.row.CN_S_REMARK"
|
v-on:blur="remarkInputBlur">
|
</el-input>
|
<span>{{scope.row.CN_S_REMARK}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="排序" prop="CN_N_ORDER" width="150" align="center">
|
<template scope="scope">
|
<el-input-number v-model="scope.row.CN_N_ORDER"
|
v-bind:min="0"
|
size="mini"
|
v-on:change="changeRowData(scope.row)"></el-input-number>
|
<span>{{scope.row.CN_N_ORDER}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column fixed="right"
|
label="操作"
|
width="100"
|
align="center">
|
<template slot-scope="scope">
|
<a href="javascript:void(0)" style="color:#409EFF" v-on:click="edit(scope.row)">编辑</a>
|
<a href="javascript:void(0)" style="color:#409EFF" v-on:click="remove(scope.row)">删除</a>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
@section scripts{
|
<script>
|
new Vue({
|
el: "#pageSet",
|
mixins: [useAutoHeight],
|
computed: {
|
tabHeight: function () {
|
return this.autoHeight - 40;
|
},
|
},
|
data: {
|
pageSetData: [],
|
currentRow: null,
|
formData: {
|
power: '',
|
code: '',
|
name: ''
|
},
|
formRules: {
|
power: [
|
{ required: true, message: ' ', trigger: 'change' }
|
]
|
}
|
},
|
methods: {
|
selectSingleRowEvent: function (callBack) {
|
var selectRow = this.$refs.list.selections;
|
if (selectRow.length != 1) {
|
wms.warning("请选择一条记录");
|
return;
|
}
|
if (callBack)
|
callBack(selectRow[0]);
|
},
|
add: function () {
|
var $this = this;
|
wms.showDialogFrame({
|
title: '新增',
|
dh: 320,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
$this.loadPageSet();
|
},
|
url: "@Url.Action("Edit")?power=" + $this.formData.power
|
});
|
},
|
edit: function (row) {
|
var $this = this;
|
wms.showDialogFrame({
|
title: '修改',
|
dh: 320,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
$this.loadPageSet();
|
},
|
url: "@Url.Action("Edit")?id=" + row.CN_GUID
|
});
|
},
|
remove: function (row) {
|
var $this = this;
|
wms.confirm("请谨慎操作,是否确认删除?", function () {
|
ajaxManage({
|
url: "@Url.Action("Delete")?id=" + row.CN_GUID,
|
success: function (data) {
|
wms.showMsg(data, function () {
|
wms.success("已删除");
|
$this.loadPageSet();
|
});
|
}
|
});
|
});
|
},
|
remarkInputBlur: function () {
|
if (this.currentRow)
|
this.changeRowData(this.currentRow);
|
},
|
pageSetRowClick: function (row, event, column) {
|
this.currentRow = row;
|
},
|
changeRowData: function (row) {
|
ajaxManage({
|
url: "@Url.Action("SetEnabled")",
|
data: row,
|
success: function (data) {
|
wms.showMsg(data, function () {
|
wms.success("已修改");
|
});
|
}
|
});
|
},
|
loadPageSet: function () {
|
var $this = this;
|
if (!$this.formData.power) return false;
|
ajaxManage({
|
url: "@Url.Action("GetPowerEnabled")",
|
data: { power: $this.formData.power, code: $this.formData.code, name: $this.formData.name },
|
success: function (data) {
|
wms.showMsg(data, function () {
|
$this.pageSetData = [];
|
var _data = data.Data;
|
$this.pageSetData = _data;
|
});
|
}
|
});
|
},
|
search: function () {
|
var $this = this;
|
this.$refs["formData"].validate(function (valid) {
|
if (valid) {
|
$this.loadPageSet();
|
} else {
|
wms.warning("请选择功能模块查询");
|
return false;
|
}
|
});
|
}
|
},
|
mounted: function () {
|
this.loadPageSet();
|
}
|
});
|
</script>
|
}
|