1
This commit is contained in:
231
iMES.WebApi/wwwroot/BiManage/Base/APP_COMMENT.html
Normal file
231
iMES.WebApi/wwwroot/BiManage/Base/APP_COMMENT.html
Normal file
@@ -0,0 +1,231 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>评论</title>
|
||||
|
||||
<link rel="stylesheet" href="/BiManage/CSS/icfont_qj/iconfont.css">
|
||||
<link rel="stylesheet" type="text/css" href="/BiManage/CSS/bootstrap3.3.5/css/bootstrap.css">
|
||||
<link rel="stylesheet" type="text/css" href="/BiManage/CSS/animate.css">
|
||||
<link rel="stylesheet" type="text/css" href="/BiManage/CSS/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="/BiManage/CSS/default.css">
|
||||
<link href="/BiManage/JS/raty/jquery.raty.css" rel="stylesheet" />
|
||||
|
||||
<script src="/BiManage/JS/jquery-1.11.2.min.js"></script>
|
||||
<script src="/BiManage/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
|
||||
<script src="/BiManage/JS/avalon1.47.js"></script>
|
||||
<script src="/BiManage/JS/SZHLCommon.js?jsver=20160915"></script>
|
||||
<script src="/BiManage/JS/YSteps/Steps.js"></script>
|
||||
<script src="/BiManage/JS/raty/jquery.raty.js"></script>
|
||||
<style>
|
||||
|
||||
|
||||
.faceDiv {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.faceDiv > img {
|
||||
/*border: 1px solid #ccc;*/
|
||||
float: left;
|
||||
margin-left: -1px;
|
||||
margin-top: -1px;
|
||||
position: relative;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 3px 3px 3px 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.faceDiv > img:hover {
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.faceDiv > img:active {
|
||||
padding: 4px 3px 2px 3px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function GetQuery(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(decodeURI(r[2]));
|
||||
else return "";
|
||||
}
|
||||
var model = avalon.define({
|
||||
$id: "COMMENT",
|
||||
ID: ComFunJS.getQueryString("ID", 0), //评论主表Id
|
||||
Type: ComFunJS.getQueryString("Type", "0"), //评论主表ModelCode,如果是不需要添加评论记录的操作不需要传值
|
||||
ConDec: GetQuery("contentdec"),//不需要添加评论记录的描述
|
||||
content: GetQuery("content", ""), //评论内容,会议纪要会加载当前的会议纪要
|
||||
Points: "0",
|
||||
plnr: { "MSGContent": "" },
|
||||
fjData: [],
|
||||
tjfj: function () {
|
||||
isShowImg = false;
|
||||
$("#fj").show();
|
||||
$(".faceDiv").hide();
|
||||
|
||||
$("#file").trigger("click");
|
||||
},
|
||||
scfj: function (el) {
|
||||
model.fjData.remove(el);
|
||||
},
|
||||
AddPL: function () {
|
||||
if ($('#pc').raty('score')) {
|
||||
model.Points = parseInt($('#pc').raty('score')) * 20;
|
||||
}
|
||||
var plcontent = model.content;
|
||||
|
||||
if ($.trim(plcontent) == "") {
|
||||
parent.ComFunJS.winwarning("请输入" + (!model.ConDec ? '评论内容' : model.ConDec + '内容'));
|
||||
return;
|
||||
}
|
||||
if (model.Type != "0") {
|
||||
var ids = "";
|
||||
$(model.fjData).each(function (inx, itm) {
|
||||
if (ids) {
|
||||
ids = ids + "," + itm.ID;
|
||||
}
|
||||
else {
|
||||
ids = itm.ID;
|
||||
}
|
||||
})
|
||||
$.getJSON('/api/Auth/ExeAction?Action=ADDCOMENT', { "P1": plcontent, "Points": model.Points, "MsgType": model.Type, "MsgLYID": model.ID, "fjID": ids }, function (result) {
|
||||
if (result.ErrorMsg == "") {
|
||||
result.Result.FileList = result.Result1;
|
||||
model.plnr = result.Result;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var isShowImg = false;
|
||||
|
||||
avalon.ready(function () {
|
||||
$('#pc').raty();
|
||||
$.ajaxSetup({
|
||||
async: false
|
||||
});
|
||||
|
||||
$(".faceDiv").hide();
|
||||
|
||||
$(".imgBtn").click(function () {
|
||||
if (isShowImg == false) {
|
||||
isShowImg = true;
|
||||
$("#fj").hide();
|
||||
|
||||
$(".faceDiv").show();
|
||||
if ($(".faceDiv").children().length == 0) {
|
||||
for (var i = 0; i < ComFunJS.facePath.length; i++) {
|
||||
$(".faceDiv").append("<img title=\"" + ComFunJS.facePath[i].faceName + "\" src=\"/BiManage/images/face/" + ComFunJS.facePath[i].facePath + "\" />");
|
||||
}
|
||||
$(".faceDiv>img").click(function () {
|
||||
|
||||
ComFunJS.insertAtCursor($("#pl")[0], "[" + $(this).attr("title") + "]");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
isShowImg = false;
|
||||
$("#fj").show();
|
||||
|
||||
$(".faceDiv").hide();
|
||||
}
|
||||
});
|
||||
})
|
||||
function getpl() {
|
||||
model.AddPL();
|
||||
//type==0为不添加评论记录的操作,返回评论内容;type为主表的ModelCode返回添加的评论记录
|
||||
if (model.Type != "0") {
|
||||
return model.plnr;
|
||||
} else {
|
||||
return model.content;
|
||||
}
|
||||
}
|
||||
function getfj() {
|
||||
var ids = "";
|
||||
$(model.fjData).each(function (inx, itm) {
|
||||
if (ids) {
|
||||
ids = ids + "," + itm.ID;
|
||||
}
|
||||
else {
|
||||
ids = itm.ID;
|
||||
}
|
||||
})
|
||||
return ids;
|
||||
}
|
||||
function UploadLoad() {
|
||||
if (document.getElementById("file").files.length > 0) {
|
||||
var formData = new FormData();
|
||||
for (var i = 0; i < document.getElementById("file").files.length; i++) {
|
||||
formData.append("upFile"+i, document.getElementById("file").files[i]);
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/Auth/ExeAction?Action=UPLOADFILE&P1=3&r=" + Math.random(),
|
||||
type: "POST",
|
||||
data: formData,
|
||||
/**
|
||||
*必须false才会自动加上正确的Content-Type
|
||||
*/
|
||||
contentType: false,
|
||||
/**
|
||||
* 必须false才会避开jQuery对 formdata 的默认处理
|
||||
* XMLHttpRequest会对 formdata 进行正确的处理
|
||||
*/
|
||||
processData: false,
|
||||
success: function (result) {
|
||||
var r = $.parseJSON(result);
|
||||
if (r.ErrorMsg == "") {
|
||||
document.getElementById("file").outerHTML = document.getElementById("file").outerHTML;
|
||||
$("#file").change(function () {
|
||||
UploadLoad();
|
||||
});
|
||||
model.fjData.pushArray(r.Result);
|
||||
parent.ComFunJS.winsuccess("上传成功!");
|
||||
}
|
||||
else {
|
||||
parent.ComFunJS.winwarning("上传失败!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body ms-controller="COMMENT">
|
||||
<div class="textarea-bj">
|
||||
<div class="textarea-text">
|
||||
<textarea id="pl" ms-duplex="content" autofocus ms-attr-placeholder="!ConDec?'填写评论...':'请输入'+ConDec" rows="5"></textarea>
|
||||
</div>
|
||||
<div class="operation c666">
|
||||
<div class="pull-left operation-au">
|
||||
<input type="file" style="display:none;" id="file" onchange="UploadLoad()" multiple="multiple">
|
||||
<span ms-click="tjfj()" style="display:none"><i class="iconfont icon-fj ft12"></i>添加附件</span>
|
||||
<span class="imgBtn"><i class="iconfont icon-xiaolian"></i>添加表情</span>
|
||||
<span ms-if="Type == 'GZBG'||Type == 'RWGL'">
|
||||
评分
|
||||
<div id="pc" style="display: inline-block;">
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
<div class="faceDiv" style="overflow:auto;"></div>
|
||||
</div>
|
||||
<div style="margin-top:1px;" id="fj" ms-visible="fjData.size()>0">
|
||||
<div class="oh fj-upload" ms-repeat-file="fjData">
|
||||
<img ms-if="ComFunJS.isPic(file.FileExtendName)" ms-class="img-rounded:ComFunJS.isPic(file.FileExtendName)" ms-on-click="ComFunJS.viewfile(file)" ms-attr-src="{{ComFunJS.getfile(file.ID)}}&width=45&height=45" ms-attr-imgyt="{{ComFunJS.getfile(file.ID)}}" style="cursor:zoom-in;border-radius:2px" />
|
||||
|
||||
<img ms-click="ComFunJS.viewfile(file)" style="height:45px;width:45px" ms-if="!ComFunJS.isPic(file.FileExtendName)" ms-attr-src="/BiManage/images/qywd/{{file.FileExtendName}}.png" onerror="javascript: this.src = '/BiManage/images/qywd/file.png'" />
|
||||
<div class="fj-cont c999 ft14">
|
||||
<p class="word-break">
|
||||
{{file.Name}}.{{file.FileExtendName}}<span>({{Math.round(file.FileSize/1024)}}kb)</span>
|
||||
<button class="btn btn-danger btn-xs pull-right" style="padding-left:15px;padding-right:15px;" ms-click="scfj(file)">删除</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
43
iMES.WebApi/wwwroot/BiManage/Base/Loading.html
Normal file
43
iMES.WebApi/wwwroot/BiManage/Base/Loading.html
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
<style>
|
||||
.szhlloading {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background-color: #12b8f6;
|
||||
margin: 100px auto;
|
||||
-webkit-animation: rotateplane 1.2s infinite ease-in-out;
|
||||
animation: rotateplane 1.2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotateplane {
|
||||
0% {
|
||||
-webkit-transform: perspective(120px);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: perspective(120px) rotateY(180deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotateplane {
|
||||
0% {
|
||||
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
||||
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
||||
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
||||
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="szhlloading"></div>
|
||||
36
iMES.WebApi/wwwroot/BiManage/Base/Vue/Iframe.vue
Normal file
36
iMES.WebApi/wwwroot/BiManage/Base/Vue/Iframe.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<iframe marginwidth="0" :src="url" class="tabiframe" marginheight="0" frameborder="0" scrolling="no" onload="changeFrameHeight()" height="100%" id="main" name="main" width="100%" style="min-height: 600px"></iframe>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: ['pdata'],
|
||||
data: function () {
|
||||
return {
|
||||
url:"",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
mounted: function () {
|
||||
var pro = this;
|
||||
pro.$nextTick(function () {
|
||||
pro.url = pro.pdata.PageUrl;
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
watch: {
|
||||
"pdata.PageUrl": { //深度监听,可监听到对象、数组的变化
|
||||
handler(newV, oldV) {
|
||||
if (newV != oldV) {
|
||||
this.url = newV;
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
55
iMES.WebApi/wwwroot/BiManage/Base/Vue/Loading.vue
Normal file
55
iMES.WebApi/wwwroot/BiManage/Base/Vue/Loading.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div class="szhlloading"></div>
|
||||
</template>
|
||||
<style>
|
||||
.szhlloading {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background-color: #12b8f6;
|
||||
margin: 100px auto;
|
||||
-webkit-animation: rotateplane 1.2s infinite ease-in-out;
|
||||
animation: rotateplane 1.2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotateplane {
|
||||
0% {
|
||||
-webkit-transform: perspective(120px);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: perspective(120px) rotateY(180deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotateplane {
|
||||
0% {
|
||||
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
||||
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
||||
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
||||
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
props: ['pzoption'],
|
||||
data: function () {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
467
iMES.WebApi/wwwroot/BiManage/Base/Vue/Table.vue
Normal file
467
iMES.WebApi/wwwroot/BiManage/Base/Vue/Table.vue
Normal file
@@ -0,0 +1,467 @@
|
||||
|
||||
<template>
|
||||
<el-col :sm="24">
|
||||
<div class="tab-filter-type">
|
||||
<div class="input-group" style="width:520PX;margin-bottom:10PX;">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" style="min-width:120PX;height: 34px;" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{sear.colname}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li v-for="fi in pzoption.collist" @click="sel(fi)"><a href="#" v-text="fi.colname"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" class="form-control" style="height: 34px;" v-model="seastr" @input="seardata" placeholder="输入关键字搜索数据">
|
||||
<span class="input-group-btn" v-show="seastr">
|
||||
<button class="btn btn-default" style="height: 34px;" @click="reset" type="button">重置</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:100%;height:40px; padding-left:10px; line-height:40px; border: 1px solid #EBEEF5;border-bottom: 0px;">
|
||||
{{pzoption.title}},共计找到{{datalength}}条数据
|
||||
<a class="tabletool" @click.stop="dialogFiledVisible = true">字段筛选</a>
|
||||
<a class="tabletool" style="display:none" @click.stop="dialogTableVisible = true">数据过滤</a>
|
||||
<a class="tabletool" @click="exportxls()">导出</a>
|
||||
</div>
|
||||
<pl-table class="qjTable" :height="height" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" style="font-size: 10px" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" :data="pzoption.dataset" @selection-change="handleSelectionChange" stripe border fit use-virtual big-data-checkbox :row-class-name="tableRowClassName">
|
||||
|
||||
<pl-table-column type="selection" width="45" v-if="pzoption.issel">
|
||||
</pl-table-column>
|
||||
|
||||
<pl-table-column v-for="col in pzoption.collist" :prop="col.colid" :label="col.colname" :key="col.colid" v-if="col.isshow" :width="col.width" min-width="120" align="center" :colid="col.colid" :show-overflow-tooltip="col.istip" sortable>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row[col.colid],col}}</span>
|
||||
</template>
|
||||
</pl-table-column>
|
||||
|
||||
|
||||
<pl-table-column type="index" width="60" fixed="left" v-if="pzoption.isxh"> </pl-table-column>
|
||||
<pl-table-column label="操作列" min-width="120" align="center" v-if="iscz&&pzoption.collist.length>6" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-for="czcol in pzoption.czltabledata" v-if="czcol.isshow" @click="mangcol(scope.row,czcol)" :type="czcol.bttype" size="mini">{{czcol.colname}}</el-button>
|
||||
</template>
|
||||
</pl-table-column>
|
||||
<pl-table-column label="操作列" min-width="120" align="center" v-if="iscz&&pzoption.collist.length<7">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-for="czcol in pzoption.czltabledata" v-if="czcol.isshow" @click="mangcol(scope.row,czcol)" :type="czcol.bttype" size="mini">{{czcol.colname}}</el-button>
|
||||
</template>
|
||||
</pl-table-column>
|
||||
</pl-table>
|
||||
|
||||
<el-dialog title="表格筛选" :visible.sync="dialogTableVisible" class="qfiter" center>
|
||||
<el-table :data="childpro.gridData" stripe border fit>
|
||||
<el-table-column label="筛选字段" min-width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.qfiled" placeholder="请选择" size="mini" clearable>
|
||||
<el-option v-for="item in pzoption.collist"
|
||||
:key="item.colid"
|
||||
:label="item.colname"
|
||||
:value="item.colid">
|
||||
</el-option>
|
||||
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="筛选类型" min-width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cal" placeholder="请选择" size="mini" clearable>
|
||||
<el-option label="包含" value="0"></el-option>
|
||||
<el-option label="小于" value="1"></el-option>
|
||||
<el-option label="大于" value="2"></el-option>
|
||||
<el-option label="不等于" value="3"></el-option>
|
||||
<el-option label="等于" value="4"></el-option>
|
||||
<el-option label="在列表中(逗号隔开)" value="5"></el-option>
|
||||
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="筛选值" min-width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.qvalue" size="mini"></el-input>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.native.prevent="delRow(scope.$index,childpro.gridData)"
|
||||
type="text"
|
||||
size="small">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
<el-button type="primary" size="mini" class="mt10 pull-right" @click="addRow">添加过滤<i class="el-icon-plus"></i></el-button>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confiter">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog title="字段筛选" :visible.sync="dialogFiledVisible" center>
|
||||
<el-checkbox v-for="filed in pzoption.collist" v-model="filed.isshow">{{filed.colname}}</el-checkbox>
|
||||
</el-dialog>
|
||||
|
||||
</el-col>
|
||||
|
||||
</template>
|
||||
<style>
|
||||
.qfiter .el-table td, .qfiter .el-table th {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.el-table__fixed-right {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
margin-top: 30PX;
|
||||
}
|
||||
|
||||
.tableRowClassName {
|
||||
}
|
||||
|
||||
.qjTable .el-table td, .qjTable .el-table th {
|
||||
HEIGHT: 44PX !IMPORTANT;
|
||||
FONT-SIZE: 13PX;
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.tabletool {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
color: dodgerblue;
|
||||
font-size: 13PX;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
props: ['pzoption'],
|
||||
components: {
|
||||
'base-loading': httpVueLoader('/BiManage/Base/Vue/Loading.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
datalength:"0",
|
||||
sear: {},
|
||||
seastr: "",
|
||||
dialogFormVisible: false,
|
||||
dialogTableVisible: false,
|
||||
dialogFiledVisible: false,
|
||||
childpro: {
|
||||
gridData: [],
|
||||
multipleSelection: "",
|
||||
locadata: [],
|
||||
height: 480,
|
||||
isxh: false//序号列
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 计算属性的 getter
|
||||
iscz: function () {
|
||||
var chi = this;
|
||||
return _.findIndex(chi.pzoption.czltabledata, function (col) {
|
||||
return col.isshow
|
||||
}) > -1
|
||||
},
|
||||
height: function () {
|
||||
var chi = this;
|
||||
return chi.pzoption.height || chi.childpro.height;
|
||||
},
|
||||
isxh: function () {
|
||||
var chi = this;
|
||||
return chi.pzoption.isxh && chi.childpro.isxh;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sel: function (col) {
|
||||
var pro = this;
|
||||
pro.sear = col;
|
||||
pro.seardata();
|
||||
|
||||
},
|
||||
seardata: function () {
|
||||
var pro = this;
|
||||
if (pro.seastr) {
|
||||
var tabledata = JSON.parse(sessionStorage.getItem("tabledata"));
|
||||
const dv = new DataSet.View().source(tabledata);
|
||||
var redata = [];
|
||||
var qfiled = pro.sear.colid;
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return (row[qfiled] + "").indexOf(pro.seastr) > -1;
|
||||
}
|
||||
});
|
||||
redata = dv.rows;
|
||||
pro.pzoption.dataset = redata;
|
||||
} else {
|
||||
pro.pzoption.dataset = JSON.parse(sessionStorage.getItem("tabledata"));
|
||||
}
|
||||
},
|
||||
reset: function () {
|
||||
this.seastr = "";
|
||||
this.seardata();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.$emit('selection-change', val)
|
||||
},
|
||||
addRow: function () {
|
||||
var chi = this;
|
||||
if (typeof (chi.childpro.gridData) == "undefined") {
|
||||
chi.childpro.gridData = [];
|
||||
}
|
||||
chi.childpro.gridData.push({
|
||||
qfiled: '',
|
||||
qftype: '',
|
||||
cal: '0',
|
||||
qvalue: ''
|
||||
});
|
||||
},
|
||||
delRow: function (index, rows) {
|
||||
rows.splice(index, 1);
|
||||
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
//把每一行的索引放进row
|
||||
row.index = rowIndex;
|
||||
},
|
||||
|
||||
confiter: function () {
|
||||
var chi = this;
|
||||
if (_.findIndex(chi.childpro.gridData, function (o) { return !o.qvalue; }) > -1) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '过滤值不能为空'
|
||||
});
|
||||
} else {
|
||||
chi.dialogTableVisible = false;
|
||||
if (chi.childpro.gridData.length > 0) {
|
||||
var tabledata = JSON.parse(sessionStorage.getItem("tabledata"));
|
||||
const dv = new DataSet.View().source(tabledata);
|
||||
var redata = [];
|
||||
_.forEach(chi.childpro.gridData, function (q) {
|
||||
var calval = q.qvalue;
|
||||
if (calval) {
|
||||
switch (q.cal) {
|
||||
case "0": //包含
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return row[q.qfiled].indexOf(calval) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "1": //小于
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return row[q.qfiled]*1 < calval*1;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "2": //大于
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return row[q.qfiled]*1 > calval*1;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "3": //不等于
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return row[q.qfiled] != calval;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "4": //等于
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
return row[q.qfiled] == calval;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "5": //在列表中
|
||||
{
|
||||
dv.transform({
|
||||
type: 'filter',
|
||||
callback(row) { // 判断某一行是否保留,默认返回true
|
||||
var bl = false;
|
||||
for (var i = 0; i < calval.split(",").length; i++) {
|
||||
if (row[q.qfiled].indexOf(calval.split(",")[i]) > -1) {
|
||||
bl = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
redata = dv.rows;
|
||||
chi.pzoption.dataset = redata;
|
||||
} else {
|
||||
chi.pzoption.dataset = JSON.parse(sessionStorage.getItem("tabledata"));
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
confiled: function myfunction() {
|
||||
var chi = this;
|
||||
chi.dialogFiledVisible = false;
|
||||
|
||||
},
|
||||
mangcol: function (rowdata, coldata) {
|
||||
try {
|
||||
if (coldata.mangefun) {
|
||||
return coldata.mangefun.call(this, rowdata);
|
||||
}
|
||||
if (coldata.jscode) {
|
||||
let jscode = coldata.jscode;
|
||||
let func = new Function('rowdata', jscode);
|
||||
func(rowdata)
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
exportxls: function () {
|
||||
var title = [];
|
||||
_.forEach(this.pzoption.collist, function (obj) {
|
||||
title.push({ "value": obj.colname, "type": "ROW_HEADER_HEADER", "datatype": "string", "colid": obj.colid })
|
||||
})
|
||||
|
||||
this.JSONToExcelConvertor(this.pzoption.dataset, this.pzoption.title + ComFunJS.getnowdate('yyyy-mm-dd'), title);
|
||||
},
|
||||
JSONToExcelConvertor: function (JSONData, FileName, ShowLabel) {
|
||||
|
||||
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
|
||||
|
||||
var excel = '<table>';
|
||||
//设置表头
|
||||
var row = "<tr>";
|
||||
for (var i = 0, l = ShowLabel.length; i < l; i++) {
|
||||
//解决身份证问题
|
||||
row += '<td style="' + "mso-number-format:'\@';\"" + ">" + ShowLabel[i].value + '</td>';
|
||||
}
|
||||
|
||||
//换行
|
||||
excel += row + "</tr>";
|
||||
|
||||
//设置数据
|
||||
for (var i = 0; i < arrData.length; i++) {
|
||||
var row = "<tr>";
|
||||
|
||||
for (var j = 0; j < ShowLabel.length; j++) {
|
||||
//解决身份证问题
|
||||
var value = arrData[i][ShowLabel[j].colid];
|
||||
row += '<td style="' + "mso-number-format:'\@';\"" + ">\t" + value + "</td>";
|
||||
}
|
||||
|
||||
excel += row + "</tr>";
|
||||
}
|
||||
|
||||
excel += "</table>";
|
||||
|
||||
var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
|
||||
excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
|
||||
excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel';
|
||||
excelFile += '; charset=UTF-8">';
|
||||
excelFile += "<head>";
|
||||
excelFile += "<!--[if gte mso 9]>";
|
||||
excelFile += "<xml>";
|
||||
excelFile += "<x:ExcelWorkbook>";
|
||||
excelFile += "<x:ExcelWorksheets>";
|
||||
excelFile += "<x:ExcelWorksheet>";
|
||||
excelFile += "<x:Name>";
|
||||
excelFile += "{worksheet}";
|
||||
excelFile += "</x:Name>";
|
||||
excelFile += "<x:WorksheetOptions>";
|
||||
excelFile += "<x:DisplayGridlines/>";
|
||||
excelFile += "</x:WorksheetOptions>";
|
||||
excelFile += "</x:ExcelWorksheet>";
|
||||
excelFile += "</x:ExcelWorksheets>";
|
||||
excelFile += "</x:ExcelWorkbook>";
|
||||
excelFile += "</xml>";
|
||||
excelFile += "<![endif]-->";
|
||||
excelFile += "</head>";
|
||||
excelFile += "<body>";
|
||||
excelFile += excel;
|
||||
excelFile += "</body>";
|
||||
excelFile += "</html>";
|
||||
|
||||
|
||||
var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile);
|
||||
|
||||
var link = document.createElement("a");
|
||||
link.href = uri;
|
||||
|
||||
link.style = "visibility:hidden";
|
||||
link.download = FileName + ".xls";
|
||||
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'pzoption.collist': { //深度监听,可监听到对象、数组的变化
|
||||
handler(newV, oldV) {
|
||||
var chi = this;
|
||||
if (newV) {
|
||||
|
||||
localStorage.setItem(chi.$root.PageCode + chi.$root.pagedata.ExtData + "fileddata", JSON.stringify(chi.pzoption.collist));
|
||||
chi.sear = chi.pzoption.collist[0];
|
||||
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'pzoption.dataset': { //深度监听,可监听到对象、数组的变化
|
||||
handler(newV, oldV) {
|
||||
if (newV) {
|
||||
this.datalength = newV.length;
|
||||
if (this.childpro.gridData.length == 0 && !this.seastr) {
|
||||
sessionStorage.setItem("tabledata", JSON.stringify(newV));
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
var chi = this;
|
||||
chi.$nextTick(function () {
|
||||
if (localStorage.getItem(chi.$root.PageCode + chi.$root.pagedata.ExtData + "fileddata")) {
|
||||
chi.pzoption.collist = JSON.parse(localStorage.getItem(chi.$root.PageCode + chi.$root.pagedata.ExtData + "fileddata"));
|
||||
}
|
||||
if (chi.pzoption.collist.length > 0) {
|
||||
chi.sear = chi.pzoption.collist[0];
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
249
iMES.WebApi/wwwroot/BiManage/Base/Vue/baselist.vue
Normal file
249
iMES.WebApi/wwwroot/BiManage/Base/Vue/baselist.vue
Normal file
@@ -0,0 +1,249 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- 添加按钮 -->
|
||||
<div class="btn-add">
|
||||
<el-button v-for="czcol in plbtns" @click="plmangcol(czcol)" size="medium" :type="czcol.bttype">{{czcol.czname}}</el-button>
|
||||
<!--<button v-for="czcol in CZData" class="btn btn-info ft12 mr5" @click="plmangcol(czcol)">{{czcol.czname}}</button>
|
||||
|
||||
<button type="button" class="btn btn-info ft12 mr5" v-if="syscz[0].isshow" @click="Add()">新增</button>
|
||||
<button type="button" class="btn btn-danger" @click="DelMItemData()" v-if="syscz[1].isshow"><i class="iconfont icon-shanchu ft12 mr5"></i>批量删除</button>-->
|
||||
</div>
|
||||
<!-- 按条件选择 -->
|
||||
<div class="tab-filter-type pt20">
|
||||
<div class="oh " v-for="item in mrcxdata" v-show="item.lbdata.length>1">
|
||||
<h5 class="pull-left tr">{{item.cxname}}:</h5>
|
||||
<ul class="tab-type ft14">
|
||||
<li v-for="lb in item.lbdata"><span v-bind:class="{ 'active': lb.issel }" @click="sellb(lb,item)" v-text="lb.itemtext"></span></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="default-tab ft14 padding20 hover-btn" style="padding-top: 10px;">
|
||||
|
||||
<base-table :pzoption="tableop" @selection-change="handleSelectionChange">
|
||||
</base-table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: ['pdata'],
|
||||
components: {
|
||||
'base-table': httpVueLoader('/BiManage/Base/Vue/Table.vue')
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
|
||||
plbtns: [],
|
||||
MXCZData: [],
|
||||
syscz: [{ czname: "新增", isshow: false }, { czname: "批量删除", isshow: false }, { czname: "编辑", isshow: false }, { czname: "删除", isshow: false }],
|
||||
ActionData: [],
|
||||
mrcxdata: [],
|
||||
tableop: {
|
||||
title: "自定义应用",
|
||||
tablename: "",
|
||||
issel: true,
|
||||
iscz: true,
|
||||
isadd: true,
|
||||
isedit: true,
|
||||
ispldel: true,
|
||||
isdel: true,
|
||||
dataset: [],
|
||||
pdid: "0",
|
||||
multipleSelection: [],
|
||||
czltabledata: [
|
||||
|
||||
],
|
||||
collist: [
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
Add: function () {
|
||||
var pdid = this.tableop.pdid;
|
||||
ComFunJS.winviewform("/BiManage/AppPage/FORMBI/FormAdd.html?pdid=" + pdid + "&vtype=2", "添加表单", "1000", "", function () {
|
||||
model.refpage();
|
||||
});
|
||||
},
|
||||
ishasqx: function () {
|
||||
|
||||
},
|
||||
plmangcol: function (coldata) {
|
||||
|
||||
if (coldata.czname == "新增") {
|
||||
var pdid = this.tableop.pdid;
|
||||
ComFunJS.winviewform("/BiManage/AppPage/FORMBI/FormAdd.html?pdid=" + pdid + "&vtype=2", "添加表单", "1000", "", function () {
|
||||
model.refpage();
|
||||
});
|
||||
|
||||
} else if (coldata.czname == "批量删除") {
|
||||
this.DelMItemData();
|
||||
} else {
|
||||
try {
|
||||
var ids = [];
|
||||
for (var i = 0; i < this.tableop.multipleSelection.length; i++) {
|
||||
ids.push(this.tableop.multipleSelection[i].ID);
|
||||
}
|
||||
let jscode = coldata.jscode;
|
||||
let func = new Function('ids', jscode);
|
||||
func(ids)
|
||||
} catch (e) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '解析JS代码有误',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.tableop.multipleSelection = val;
|
||||
},
|
||||
DelItemData: function (item) {
|
||||
var pdid = this.tableop.pdid;
|
||||
this.DelData(item.intProcessStanceid)
|
||||
},
|
||||
DelMItemData: function () {
|
||||
var ids = [];
|
||||
for (var i = 0; i < this.tableop.multipleSelection.length; i++) {
|
||||
ids.push(this.tableop.multipleSelection[i].intProcessStanceid);
|
||||
}
|
||||
if (ids.length == 0) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '至少需要选择一条数据才能操作'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.DelData(ids.join());
|
||||
},
|
||||
DelData: function (ids) {
|
||||
var pro = this;
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.getJSON('/api/Bll/ExeAction?Action=FORMBI_DELWFDATA', { "P2": ids }, function (result) {
|
||||
if (result.ErrorMsg == "") {
|
||||
ComFunJS.winsuccess("删除成功");
|
||||
pro.InitWigetData();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
},
|
||||
sellb: function (lb, lbs) {
|
||||
_.forEach(lbs.lbdata, function (obj) {
|
||||
obj.issel = false;
|
||||
})
|
||||
lb.issel = true;
|
||||
this.Query();
|
||||
},
|
||||
Query: function () {
|
||||
var pro = this;
|
||||
var tablepar = JSON.parse(pro.$root.pagedata.ExtData);
|
||||
var querydata = [];
|
||||
_.forEach(pro.mrcxdata, function (obj) {
|
||||
var va = _.find(obj.lbdata, function (cx) {
|
||||
return cx.issel == true;
|
||||
})
|
||||
querydata.push({ colid: obj.cxzd, cal: obj.cal, val: va.itemtext });
|
||||
})
|
||||
|
||||
$.getJSON('/api/Bll/ExeAction?Action=DATABI_GETVUELISTDATA', { P1: tablepar.value.join(), P2: tablepar.dataqx ? "Y" : "N", WD: JSON.stringify(tablepar.WDData), qdata: JSON.stringify(querydata) }, function (resultData) {
|
||||
if (resultData.ErrorMsg == "") {
|
||||
pro.tableop.dataset = resultData.Result2;
|
||||
pro.tableop.pdid = resultData.Result3;
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
InitWigetData: function () {
|
||||
var pro = this;
|
||||
var tablepar = JSON.parse(pro.$root.pagedata.ExtData);
|
||||
var allcz = tablepar.ActionData;// 操作列表
|
||||
var sqdata = pro.$root.pagedata.ActionData.split(',');//授权列表
|
||||
|
||||
pro.tableop.title = tablepar.name;
|
||||
if (pro.tableop.collist.length == 0) {
|
||||
pro.tableop.collist = [];
|
||||
for (var i = 0; i < tablepar.WDData.length; i++) {
|
||||
if (tablepar.WDData[i].colname) {
|
||||
pro.tableop.collist.push({ colid: tablepar.WDData[i].colid, colname: tablepar.WDData[i].colname, isshow: tablepar.WDData[i].isshow, istip: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
pro.plbtns = _.filter(allcz, function (item) { return item.isrowcz == '0' && _.findIndex(sqdata, function (ac) { return ac == item.czname }) > -1 });
|
||||
var rczbtns = _.filter(allcz, function (item) { return item.isrowcz == '1' });
|
||||
pro.tableop.czltabledata = [];
|
||||
_.forEach(rczbtns, function (mxcz) {
|
||||
if (_.findIndex(sqdata, function (ac) { return ac == mxcz.czname }) > -1) {
|
||||
if (mxcz.czname == "编辑") {
|
||||
pro.tableop.czltabledata.push({
|
||||
colname: "编辑", bttype: "text", isshow: true, mangefun: function (rowdata) {
|
||||
ComFunJS.winviewform("/BiManage/AppPage/FORMBI/FormManage.html?piid=" + rowdata.intProcessStanceid + "&vtype=2", "管理表单", "1000", "", function () {
|
||||
model.refpage();
|
||||
});
|
||||
},
|
||||
});
|
||||
} else if (mxcz.czname == "删除") {
|
||||
pro.tableop.czltabledata.push({
|
||||
colname: "删除", bttype: "text", isshow: true, mangefun: function (rowdata) {
|
||||
this.$parent.DelItemData(rowdata);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
pro.tableop.czltabledata.push({
|
||||
colname: mxcz.czname, bttype: mxcz.bttype, isshow: true, mangefun: function (rowdata) {
|
||||
if (mxcz.jscode) {
|
||||
let jscode = mxcz.jscode;
|
||||
let func = new Function('rowdata', jscode);
|
||||
func(rowdata)
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
_.forEach(tablepar.mrcxdata, function (obj) {
|
||||
var temp = [];
|
||||
_.forEach(obj.cxdata.split(','), function (cx) {
|
||||
temp.push({ issel: false, itemtext: cx })
|
||||
})
|
||||
if (temp.length > 0) {
|
||||
temp[0].issel = true;
|
||||
}
|
||||
obj.lbdata = temp;
|
||||
})
|
||||
pro.mrcxdata = tablepar.mrcxdata;//分类操作
|
||||
pro.Query();
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
var pro = this;
|
||||
pro.$nextTick(function () {
|
||||
pro.InitWigetData();
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user