Commit 4525a9fb by zhao_shaonan

新增基础查询界面配置、样式等文件

parent 563cb2c1
......@@ -3,22 +3,28 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"css-loader": "^5.0.1",
"echarts": "^4.9.0",
"element-ui": "^2.4.5",
"file-saver": "^2.0.5",
"js-cookie": "^2.2.1",
"qs": "^6.9.4",
"sass-resources-loader": "^2.1.1",
"script-loader": "^0.7.2",
"style-loader": "^2.0.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-wechat-title": "^2.0.7",
"vuedraggable": "^2.24.3",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.0.0-beta.1"
"vuex-persistedstate": "^4.0.0-beta.1",
"xlsx": "^0.16.9"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
......
No preview for this file type
......@@ -8,7 +8,7 @@
export default {};
</script>
<style lang="scss" scoped>
<style lang="scss">
/*每个页面公共css */
@import url("assets/styles/iconfont.css");
@import "assets/styles/main.scss";
......
......@@ -5,6 +5,7 @@ var relUrlIp = window.location.host.substring(
let base = {
bigurl: "",
mapurl: "",
codeUrl:'',
// bigwfwurl: "",
// bigservicesurl: "",
// alyIP: "",
......@@ -39,7 +40,10 @@ if (
base.ZhiTu_url = "http://39.99.159.210:8053";
//------------------------------脑图后台服务路径**公安网**--------------------------------
base.bigwfwurl = "http://77.1.24.51:8050";
} else if (relUrlIp == "47.92.48.137") {
} else if (relUrlIp == "47.92.48.137" || relUrlIp == "192.168.0.111" || relUrlIp=="localhost") {
//------------------------------刑侦字典服务路径**阿里云**--------------------------------
base.BaseURL="http://192.168.31.210:8080"/*杨洋本地端口号8080*/
//base.BaseURL="http://192.168.31.210:8001"/*192.168.31.210*//*localhost*/
//------------------------------刑侦后台服务路径**阿里云**--------------------------------
base.XingZhen = "http://68.174.69.95";
//------------------------------地图后台服务路径**阿里云**--------------------------------
......
import { get, post } from "@/utils/http.js";
/*import { get, post } from "@/utils/http.js";
import base from "@/api/base";
import axios from "axios";
......@@ -10,11 +10,11 @@ export const test = params =>
export const test1 = params =>
get("http://39.99.159.210:8051/getXyrSaxxDg", params);
export const login = params =>
post("https://uniapp.b2b2c.niuteam.cn/api/login/login", params);
/!*export const login = params =>
post("https://uniapp.b2b2c.niuteam.cn/api/login/login", params);*!/
export const code = params =>
post("https://uniapp.b2b2c.niuteam.cn/api/captcha/captcha", params);
export const js_test = () =>
axios.get("json/test.json");
axios.get("json/test.json");*/
import request from "@/utils/axiosHttp.js";
/*code*/
export default {
/*登录*/
login(username, password) {
return request({
url: "/login",
params: { username, password },
method: "post"
});
},
/*code*/
axiosCode(type) {
return request({
url: "/queryTreeDataByType",
params: { type },
method: "get"
});
},
/*级联code*/
axiosJlCode(type, startId) {
return request({
url: "/queryTreeDataByType",
params: { type, startId },
method: "get"
});
},
/*保存查询字段*/
saveField(params) {
return request({
url: "/saveTableTitleRedis",
data: params,
method: "post"
});
},
/*查询*/
doQuery(params) {
return request({
url: "EsAsjQuery",
data:JSON.parse(params),
method: "post"
});
},
/*查询*/
doXyrQuery(params) {
return request({
url: "/EsXyrQuery",
data: JSON.parse(params),
method: "post"
});
},
/*查询*/
doBhrQuery(params) {
return request({
url: "/EsShrQuery",
data: JSON.parse(params),
method: "post"
});
},
/*获取表头*/
getField(params) {
return request({
url: "/getTableTitleRedis",
params: {type:params},
method: "get"
});
}
};
/*/!*保存查询字段*!/
const saveField = params =>{
return post(`${base.BaseURL}/saveTableTitleRedis`,params);
}
/!*获取表头*!/
const getField = params =>{
return get(`${base.BaseURL}/getTableTitleRedis`,params);
}
const doQuery = params =>{
return post(`${base.BaseURL}/EsAsjQuery`,params);
}*/
/*查询数据*/
/*export {
login,
axiosCode,
saveField,
getField,
doQuery
}*/
This source diff could not be displayed because it is too large. You can view the blob instead.
@import './main.scss';
.wrap{
.checkboxGroup{margin: 0 0 0 140px;}
.flTtitle{display:inline-block;height:40px;line-height: 40px;padding:0 24px;border-radius: 0px 0px 22px 4px;background: $title-color;color:#fff;margin-left: 34px;font-size:16px;}
.settingField{
i{margin-right:4px;vertical-align: middle;}
float:right;margin-right:20px;color:$base-color; line-height: 40px;position: relative;top:20px;cursor: pointer;
}
.pageGuide{float:right;color:#999999; line-height: 40px;margin-right:34px;position: relative;top:20px;cursor: pointer;}
.paneDiv{
margin:0 34px;
.selectLabel{
display: inline-block;
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #1a81e1;
line-height: 20px;
color: #1a81e1;
margin-left: 5px;
cursor: pointer;
}
.titleWrap{
margin-top:15px; margin-bottom: 10px;
.two-title{display: inline-block;width:127px;text-align: right;font-weight:600;font-size: 16px;color: #333333;vertical-align: middle;}
.border{display:inline-block;width: 6px;height: 20px;background: $border-bg;vertical-align: middle;margin-left: 10px;}
.dashedBorder{display: inline-block;width: calc(100% - 167px);margin-left: 9px;position: relative;top: -2px;border-bottom: 1px dashed #CFCFCF;}
}
}
}
/*dialog*/
.settingDialog{
margin:14px 20px;
padding-bottom:20px;
.dragwrap{
display: flex;
.contentH{max-height:400px;overflow-y: auto;}
.selected{
width:200px;display: inline-block;margin-right:40px;
li{
color:$base-color;cursor: pointer;
div{display: inline-block}
}
}
.waiting{
flex:1;display: inline-block;
li{
color:#333333;cursor: pointer;display: inline-block;width:25%;
div{display: inline-block}
}
}
.select-header{
font-weight: bold;
line-height: 19px;
color: #333333;
margin:8px 0;
}
}
}
.zdycol3{display: inline-block;width:33%; vertical-align: middle;}
.zdycol2{display: inline-block;width:33%;margin-right: 33%; vertical-align: middle;}
.zdycol1{
display: inline-block;width:100%; vertical-align: middle;
.el-input{width:600px;}
}
.formWrap{
width:$wrap-width;
background: #FFFFFF;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
opacity: 1;
border-radius: 4px;
margin:16px auto;
padding-bottom: 32px;
.zdybtn{
width: 156px;
height: 44px;
border-radius: 4px;
}
.search{background: $base-color;box-shadow: 0px 4px 4px rgba(26, 129, 225, 0.2);}
.delete{border: 1px solid #666666;background: none;color: #333333;}
.el-date-editor.el-input{width:100%;}
.el-form-item{margin-bottom:5px;}
.checkboxGroup{
}
}
/*已选条件*/
#selectedConditions{
padding:10px 0;
position: fixed;
top:$header-height;
width:$wrap-width;
left:50%;
margin-left: -$wrap-width/2;
z-index:10;
.conditionTitle{display: inline-block;width:164px;text-align: right;color:$base-color;padding-right:12px;vertical-align: top;line-height: 32px;}
.conditionWrap{display: inline-block;width:calc(100% - 176px)}
.inline{display: inline-block;}
.el-tag{
height: 32px;
background: #FFFFFF;
border: 1px solid $base-color;
border-radius: 2px;
color:#333333;
font-weight: 100;
}
.el-tag .el-tag__close{color:$base-color;}
.el-tag + .el-tag {
margin-left: 10px;margin-bottom:5px;
}
.button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
}
// 参考文档:https://element.faas.ele.me/#/zh-CN/component/color#fu-zhu-se
/*参考文档:https://element.faas.ele.me/#/zh-CN/component/color#fu-zhu-se*/
//主色调,蓝色:#1AB1E1,绿色 #4CAF50,蓝色:#03A9F4,黄色:#FF9800,粉色:#FF547B,棕色:#C3A769,浅绿色:#65C4AA,黑色:#333333,紫色:#B323B4,淡粉色:#FF8B8B,element UI:#409eff
$base-color: #1AB1E1;
/*
主色调,蓝色:#1AB1E1,绿色 #4CAF50,蓝色:#03A9F4,黄色:#FF9800,粉色:#FF547B,棕色:#C3A769,浅绿色:#65C4AA,黑色:#333333,紫色:#B323B4,淡粉色:#FF8B8B,element UI:#409eff
*/
$base-color: #1A81E1;
$base-color-success: #0BD9B6;
$base-color-warning: #F56C6C;
$base-color-info: #FE9200;
$body-bg: #F1F3F6;
/* 文字基本颜色 */
$ns-text-color: #333333; //基本色
$ns-text-color: #333333; /*基本色*/
/* 文字尺寸 */
$ns-font-size-sm: 12px;
......@@ -15,16 +18,22 @@ $ns-font-size-base: 14px;
$ns-font-size-lg: 16px;
$ns-font-size-tab-title: 24px;
$ns-font-size-title: 30px;
/*头部*/
$header-height:60px;
$header-fontSize:24px;
/*区域宽度*/
$wrap-width:1400px;
$title-color:#69ABE9;
$border-bg:#409EFF;
body {
line-height: 1.8;
font-family: 'Helvetica Neue', Helvetica, 'Microsoft Yahei', 'PingFang SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', sans-serif;
background-color: #f7f7f7;
font-size: $ns-font-size-base;
background-color: $body-bg;
font-size: $ns-font-size-sm;
color: $ns-text-color;
}
#nprogress .bar {
background: $base-color !important; //自定义颜色
background: $base-color !important;/*自定义颜色*/
}
html,
......@@ -66,8 +75,10 @@ i,
em {
font-style: normal;
}
// 去掉a标签的默认样式
body{
background: $body-bg;
}
/*去掉a标签的默认样式*/
a {
text-decoration: none;
color: $ns-text-color;
......@@ -75,7 +86,9 @@ a {
color: $base-color;
}
}
.ar{text-align: right;}
.ac{text-align: center;}
.al{text-align: left;}
.el-main {
border-top: solid 1px #f2f2f2;
overflow: initial;
......@@ -88,8 +101,155 @@ img {
max-width: 100%;
vertical-align: middle;
}
// 居中
.overflow{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
display: inline-block;
vertical-align: middle;
}
.width120{max-width:120px;}
.inline{vertical-align: middle;display: inline-block;}
/* 居中*/
.ns-text-align {
text-align: center;
}
/*表头配置面板样式*/
/* line 99, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag {
width: 100%;
height: auto;
}
/* line 103, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .selected-header {
padding: 10px;
}
/* line 105, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .selected-header > div {
padding-bottom: 5px;
border-bottom: 1px dashed #ccc;
}
/* line 110, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .selected-header ul div {
background-color: #ed4848;
}
/* line 115, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .waiting-header {
padding: 10px;
}
/* line 117, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .waiting-header > div {
padding-bottom: 5px;
border-bottom: 1px dashed #ccc;
}
/* line 122, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag ul {
*zoom: 1;
width: 100%;
list-style-type: none;
margin: 5px 0;
padding: 0;
}
/* line 18, ../sass/sass/mixins/_clearfix.scss */
#set_table_panel .table-header-drag ul:before, #set_table_panel .table-header-drag ul:after {
content: " ";
display: table;
}
/* line 23, ../sass/sass/mixins/_clearfix.scss */
#set_table_panel .table-header-drag ul:after {
clear: both;
overflow: hidden;
}
/* line 128, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag ul li {
float: left;
margin: 2px;
cursor: pointer;
}
/* line 132, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag ul li div {
text-align: center;
padding: 0 20px;
background-color: #39980f;
color: #fff;
height: 28px;
line-height: 28px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-o-border-radius: 3px;
-ms-border-radius: 3px;
}
/* line 147, ../sass/sass/_queryList.scss */
#set_table_panel .table-header-drag .tips {
width: auto;
padding: 0 10px;
color: #999;
font-size: 12px;
}
.el-dialog__header {
padding: 10px;
text-align: left;
border-bottom: 1px solid #ccc;
}
.el-dialog__body{padding:0 10px !important;}
.el-button+.el-button{margin:0px;}
.el-pagination{text-align: center;}
.el-button{margin-right:16px !important;}
.zdyInputCol2{
.el-input{width:calc((100% - 58px)/2) !important;}
}
/*头部*/
.headerT{
height: $header-height;
background: $base-color;
line-height: $header-height;
box-shadow: 0px 1px 2px rgba(26, 129, 225, 0.3);
color:#fff;
font-size:$header-fontSize;
font-weight: 600;
text-indent: 80px;
position: fixed;
top:0px;
width:100%;
left:0px;
z-index:10;
}
/*头部、已选条件fixed 防止文字上浮*/
.coverText{
height: 16px;
position: fixed;
top: 60px;
width: 100%;
z-index: 10; background: #F1F3F6;
}
.none {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.ajxq_s,.ajxq_n{
line-height:26px;
/*overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;*/
}
.paneDiv .el-input,.paneDiv .el-date-editor--daterange.el-input__inner{width:calc(100% - 36px)}
.el-table th>.cell{color:#333333;font-size:14px;}
/*用采合一*/
.popUl{width:187px;background-color:#f3f7f8;border:1px solid #bbb;padding:0 1px;margin-bottom:-10px;position:relative;border-radius:4px;box-shadow: 3px 3px 5px #999;}
.popUl li{clear:both;display:block;height:30px;line-height:30px;border-top:1px #dedede dashed;padding-left:10px;margin:2px 1px 0 1px;cursor:pointer;color:#444;}
.popUl li i{color: #51b1df;position: relative;top: 1px;margin-right:2px;}
.popUl li a{display:block;color:#444;margin-left:25px;}
.popUl li:hover{background-color:#ededed;font-weight:bold;}
.popUl li:hover i{font-weight:100;}
.popUl li:hover a{color:#FF6600;}
.popUl li .icon,.search_icon,.note_icon,.peer_icon,.associate_icon{width:16px;height:16px;float:left;margin-top:6px;}
.popUl h4{height:26px;line-height:26px;background-color:#efefef;text-align:center;font-size:12px;color:#333;}
.popUl .el-radio{line-height: 30px;}
.popUl .el-radio__label{padding-left:0px;}
/**/
@import './main.scss';
.tableList{
.total{
color:#999; float: left; margin-left: 200px;position: relative;top: -4px;
}
.setting{color:$base-color;margin-right:40px;position: relative;top: -4px;}
.export{
height: 32px;
line-height: 32px;
background: #FFFFFF;
border: 1px solid #707070;
opacity: 1;
border-radius: 4px; vertical-align: middle;padding:0px;width:88px;color:#333;margin-top:-12px;}
/*结果筛选*/
.sxWrap{
margin:0px 34px;
display: flex;
.cxjgsxTitle{
font-size: 16px;
font-weight: bold;
line-height: 21px;
color: #FE9200;
margin-top:24px;
display: inline-block;
}
.sxcontent{
flex:1;margin-top:24px;
.flTitle{width:120px;text-align: right;display: inline-block;color: #333333;vertical-align: top;font-size:14px;}
.radioGroup{display: inline-block;width:calc(100% - 124px);vertical-align: middle;
color: #666666;
}
}
}
}
<template>
<div class="loading-layer" v-show="isShow">
<div class="loading-layer" v-show="loading">
<div class="loading-anim">
<div class="box">
<div class="border out ns-border-color"></div>
<div class="border in ns-border-color"></div>
<div class="border mid ns-border-color"></div>
<i class="el-icon-loading"></i><span style="position: relative; top: -6px;">{{text}}</span>
</div>
</div>
</div>
......@@ -13,12 +11,17 @@
<script>
export default {
name: "loading-cover",
props:{
loading:Boolean,
text:{
type:String,
default:'正在加载中...'
}
},
data() {
return {
isShow: true
};
},
created() {},
methods: {
show() {
this.isShow = true;
......@@ -42,7 +45,11 @@ export default {
}
.box {
background: red;
font-size: 17px;
}
.box i{
font-size: 28px;
font-weight: 600;
}
.loading-layer {
......@@ -52,6 +59,7 @@ export default {
top: 0;
left: 0;
z-index: 997;
background: rgba(0,0,0,0.3);
}
.loading-anim {
......
......@@ -79,13 +79,11 @@ export default {
// this.keyNode.push(data.$treeNodeId)
this.codeObj.push(data)
} else if (!data.children && !checked) {
debugger
var index = this.codeObj.findIndex(item => {
return item.id === data.id
})
this.codeObj.splice(index, 1)
console.log(this.codeObj);
}
return
},
......@@ -95,7 +93,6 @@ export default {
},
handleClose () {
this.codeShow = false
console.log(this.codeObj);
this.keyNode = []
this.codeObj.forEach(item => {
this.keyNode.push(item.label)
......
......@@ -562,10 +562,8 @@ export default {
switchingConditions() {
/*展开收起条件*/
this.toggleZd = !this.toggleZd;
console.log(this.toggleZd);
this.propQueryField.forEach(val => {
if (Object.prototype.hasOwnProperty.call(val, "hidden")) {
console.log(!this.toggleZd);
console.log(this.propQueryField);
this.$set(val, "hidden", !this.toggleZd); /*修改对象得值并触发视图*/
}
......@@ -582,8 +580,6 @@ export default {
this.propQueryField.forEach(val => {
this.formData[val.id] = val.value;
});
console.log(this.formData);
console.log(JSON.stringify(this.formData));
},
handleCurrentChange(val) {
//此方法调用接口获取当前页数据
......
<template>
<div class="formWrap">
<div>
<span class="flTtitle">查询条件</span>
<span class="pageGuide">页面引导</span>
<span class="settingField" @click="centerDialogVisible = true"
><i class="iconfont icontiaojie"></i>配置查询条件</span
>
</div>
<el-form
label-position="right"
label-width="140px"
ref="ajxxForm"
:model="formD"
>
<form-item
:formField="ajxxDefaultField"
:formDa="formD"
v-show="ajxxDefaultField.data.length != 0"
@getSelected="getSelected"
></form-item>
<form-item
:formField="xyrxxDefaultField"
:formDa="formD"
v-show="xyrxxDefaultField.data.length != 0"
@getSelected="getSelected"
></form-item>
<form-item
:formField="shrxxDefaultField"
:formDa="formD"
v-show="shrxxDefaultField.data.length != 0"
@getSelected="getSelected"
></form-item>
<form-item
:formField="flxxDefaultField"
:formDa="formD"
v-show="flxxDefaultField.data.length != 0"
@getSelected="getSelected"
></form-item>
</el-form>
<div class="ar" style="margin-top:20px;margin-right:34px;">
<el-button
type="primary"
size="small"
class="zdybtn search"
@click="doQuery('ajxx')"
>案件信息查询</el-button
>
<el-button
type="primary"
size="small"
class="zdybtn search"
@click="doQuery('xyrxx')"
>嫌疑人信息查询</el-button
>
<el-button
type="primary"
size="small"
class="zdybtn search"
@click="doQuery('shrxx')"
>受害人信息查询</el-button
>
<el-button plain size="small" class="zdybtn delete">清空</el-button>
</div>
<el-dialog
title="配置查询条件"
:visible.sync="centerDialogVisible"
width="1000px"
custom-class="cxtjDialog"
center
>
<setting-dialog
@emitDialog="emitDialog"
@close="close"
:AjxxDefaultFormField="ajxxDefaultField"
:xyrxxDefaultField="xyrxxDefaultField"
:shrxxDefaultField="shrxxDefaultField"
:flxxDefaultField="flxxDefaultField"
:waitAjxxField="waitAjxxField"
:waitShrxxField="waitShrxxField"
:waitXyrxxField="waitXyrxxField"
:waitFlxxField="waitFlxxField"
@loading="loading"
></setting-dialog>
</el-dialog>
</div>
</template>
<script>
import formItem from "./formItem_components.vue";
import settingDialog from "@/views/jccx/dialog.vue";
import "@/assets/styles/iconfont.css";
import request from "@/api/interface/dictionaryCode.js";
export default {
name: "formWrap",
components: {
formItem,
settingDialog
},
props: {
formData: Object,
AjxxFormField: Object,
XyrxxFormField: Object,
ShrxxFormField: Object,
FlxxFormField: Object,
AjxxDefaultFormField: Object,
XyrxxDefaultFormField: Object,
ShrxxDefaultFormField: Object,
FlxxDefaultFormField: Object,
fieldType: String
},
data() {
return {
formD: this.formData,
ajxxField: this.AjxxFormField,
xyrxxField: this.XyrxxFormField,
shrxxField: this.ShrxxFormField,
flxxField: this.FlxxFormField,
ajxxDefaultField: this.AjxxDefaultFormField,
xyrxxDefaultField: this.XyrxxDefaultFormField,
shrxxDefaultField: this.ShrxxDefaultFormField,
flxxDefaultField: this.FlxxDefaultFormField,
isMultiple: false,
centerDialogVisible: false,
waitAjxxField: [],
waitShrxxField: [],
waitXyrxxField: [],
waitFlxxField: [],
type: this.fieldType
};
},
methods: {
loading(data){
this.$emit("emitLoading",data)
},
getSelected(data) {
this.$emit("getSeletedList", data);
},
doQuery(type) {
let self = this;
self.formD.page = 1;
self.$emit("doQueryList", type, self.formD, "isButton");
},
emitDialog(flag, ajxxL, xyrL, shrL, flxxL, ajxxO, xyrO, shrO, flxxO) {
/*保存的字段匹配*/
let self = this;
let obj1 = JSON.parse(ajxxL);
let obj2 = JSON.parse(xyrL);
let obj3 = JSON.parse(shrL);
let obj4 = JSON.parse(flxxL);
self.centerDialogVisible = flag;
/*保存*/
let params = {};
params.name = "基础查询保存查询字段";
params.type = self.type;
params.list = [];
self.$set(params.list, 0, obj1);
self.$set(params.list, 1, obj2);
self.$set(params.list, 2, obj3);
self.$set(params.list, 3, obj4);
request.saveField(JSON.stringify(params)).then(res => {
if (res.success === true) {
self.$message({
type: "succes",
message: "保存成功"
});
self.ajxxDefaultField = JSON.parse(ajxxO);
self.xyrxxDefaultField = JSON.parse(xyrO);
self.shrxxDefaultField = JSON.parse(shrO);
self.flxxDefaultField = JSON.parse(flxxO);
self.init();
self.initCode();
self.$emit("closeLoading",false)
} else {
self.$message({
type: "error",
message: "保存失败"
});
self.$emit("closeLoading",false)
}
});
},
close(flag) {
this.centerDialogVisible = flag;
},
init() {
let self = this;
self.waitAjxxField = self.ajxxField.data.filter(
item => !self.ajxxDefaultField.data.some(ele => ele.name === item.name)
);
self.waitShrxxField = self.shrxxField.data.filter(
item => !self.shrxxDefaultField.data.some(ele => ele.name === item.name)
);
self.waitXyrxxField = self.xyrxxField.data.filter(
item => !self.xyrxxDefaultField.data.some(ele => ele.name === item.name)
);
self.waitFlxxField = self.flxxField.data.filter(
item => !self.flxxDefaultField.data.some(ele => ele.name === item.name)
);
},
initCode() {
let self = this;
self.ajxxDefaultField.data.forEach(val => {
if (val.type == "code") {
if (val.codeOptions.length == 0) {
request.axiosCode(val.codeTree).then(response => {
if (response.success === true) {
self.$set(val, "codeOptions", response.data.list);
}
});
}
}
});
self.xyrxxDefaultField.data.forEach(val => {
if (val.type == "code") {
if (val.codeOptions.length == 0) {
request.axiosCode(val.codeTree).then(response => {
if (response.success === true) {
self.$set(val, "codeOptions", response.data.list);
}
});
}
}
});
self.shrxxDefaultField.data.forEach(val => {
if (val.type == "code") {
if (val.codeOptions.length == 0) {
request.axiosCode(val.codeTree).then(response => {
if (response.success === true) {
self.$set(val, "codeOptions", response.data.list);
}
});
}
}
});
}
},
mounted() {
let self = this;
self.init();
self.initCode();
},
watch: {
AjxxDefaultFormField(val) {
this.ajxxDefaultField = val;
},
XyrxxDefaultFormField(val) {
this.xyrxxDefaultField = val;
},
ShrxxDefaultFormField(val) {
this.shrxxDefaultField = val;
},
FlxxDefaultFormField(val) {
this.flxxDefaultField = val;
this.initCode();
this.init();
},
formData(data) {
this.formD = data;
}
}
};
</script>
<style scoped lang="scss">
@import "../assets/styles/form.scss";
</style>
<template>
<div class="headerT">{{headerTitle}}</div>
</template>
<script>
export default {
name: "headerT",
props: {
headerTitle:String
}
}
</script>
<style scoped lang="scss">
@import '../assets/styles/main.scss';
</style>
<template>
<el-popover
ref="popover"
placement="bottom-start"
trigger="click"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
ref="tree"
class="select-tree"
:style="{ 'min-width': treeWidth }"
highlight-current
:data="data"
:props="props"
:expand-on-click-node="false"
:filter-node-method="filterNode"
:default-expand-all="false"
@node-click="onClickNode"
/>
<el-input
slot="reference"
ref="input"
v-model="labelModel"
clearable
@clear="clearSeleted"
:class="{ rotate: showStatus }"
:placeholder="placeholder"
>
<i slot="suffix" class="iconfont iconzidianmaxuanze"></i>
</el-input>
</el-popover>
</template>
<script>
export default {
name: "ElSelectTree",
// 设置绑定参数
model: {
prop: "value",
event: "selected"
},
props: {
sendId: String,
// 接收绑定参数
value: String,
// 输入框宽度
width: String,
// 选项数据
options: {
type: Array,
required: true
},
// 输入框占位符
placeholder: {
type: String,
required: false,
default: "请选择"
},
// 树节点配置选项
props: {
type: Object,
required: false,
default: () => ({
parent: "parentId",
value: "id",
label: "label",
children: "children"
})
}
},
data() {
return {
// 树状菜单显示状态
showStatus: false,
// 菜单宽度
treeWidth: "auto",
// 输入框显示值
labelModel: "",
// 实际请求传值
valueModel: ""
};
},
computed: {
// 是否为树状结构数据
dataType() {
const jsonStr = JSON.stringify(this.options);
/*if (process.client) {*/
return jsonStr.indexOf(this.props.children) !== -1;
/* }*/
},
// 若非树状结构,则转化为树状结构数据
data() {
return this.dataType ? this.options : this.switchTree();
}
},
watch: {
labelModel(val) {
if (!val) {
this.valueModel = "";
}
/* if (process.client) {*/
this.$refs.tree.filter(val);
/* }*/
},
value(val) {
if (this.sendId && val == "") {
this.$emit("emitQkValue", this.sendId, val);
}
this.labelModel = this.queryTree(this.data, val);
}
},
created() {
// 检测输入框原有值并显示对应 label
if (this.value) {
this.labelModel = this.queryTree(this.data, this.value);
}
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
/* if (process.client) {*/
this.treeWidth = `${(this.width ||
this.$refs.input.$refs.input.clientWidth) - 24}px`;
/* }*/
});
},
methods: {
clearSeleted() {
this.$emit("getSeleted", this.labelModel);
},
// 单击节点
onClickNode(node) {
this.labelModel = node[this.props.label];
this.valueModel = node[this.props.value];
if (this.sendId) {
this.$emit("emitValue", this.sendId, node.id, node.parentId);
}
this.onCloseTree();
this.$emit("getSeleted", this.labelModel);
},
// 偏平数组转化为树状层级结构
switchTree() {
return this.cleanChildren(this.buildTree(this.options, "0"));
},
// 隐藏树状菜单
onCloseTree() {
/*if (process.client) {
this.$refs.popover.showPopper = false;
}*/
this.$refs.popover.showPopper = false;
},
// 显示时触发
onShowPopover() {
this.showStatus = true;
/* if (process.client) {
this.$refs.tree.filter(false);
}*/
this.$refs.tree.filter(false);
},
// 隐藏时触发
onHidePopover() {
this.showStatus = false;
this.$emit("selected", this.valueModel);
},
// 树节点过滤方法
filterNode(query, data) {
if (!query) return true;
/*if (process.client) {*/
return data[this.props.label].indexOf(query) !== -1;
/* }*/
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = [];
stark = stark.concat(tree);
/* if (process.client) {*/
while (stark.length) {
const temp = stark.shift();
if (temp[this.props.children]) {
stark = stark.concat(temp[this.props.children]);
}
if (temp[this.props.value] === id) {
return temp[this.props.label];
}
}
/* }*/
return "";
},
// 将一维的扁平数组转换为多层级对象
buildTree(data, id = "0") {
const fa = parentId => {
const temp = [];
/*if (process.client) {*/
for (let i = 0; i < data.length; i++) {
const n = data[i];
if (n[this.props.parent] === parentId) {
n.children = fa(n.rowGuid);
temp.push(n);
}
}
/* }*/
return temp;
};
return fa(id);
},
// 清除空 children项
cleanChildren(data) {
const fa = list => {
list.map(e => {
/*if (process.client) {*/
if (e.children.length) {
fa(e.children);
} else {
delete e.children;
}
/* }*/
return e;
});
return list;
};
return fa(data);
}
}
};
</script>
<style>
.el-input.el-input--suffix {
cursor: pointer;
overflow: hidden;
}
.el-input.el-input--suffix.rotate .el-input__suffix {
transform: rotate(180deg);
}
.select-tree {
max-height: 350px;
overflow-y: scroll;
}
/* 菜单滚动条 */
.select-tree::-webkit-scrollbar {
z-index: 11;
width: 6px;
}
.select-tree::-webkit-scrollbar-track,
.select-tree::-webkit-scrollbar-corner {
background: #fff;
}
.select-tree::-webkit-scrollbar-thumb {
border-radius: 5px;
width: 6px;
background: #b4bccc;
}
.select-tree::-webkit-scrollbar-track-piece {
background: #fff;
width: 6px;
}
</style>
......@@ -6,10 +6,11 @@ import store from "./store";
import "./plugins/element.js";
import Util from "./utils/util";
import VueWechatTitle from "vue-wechat-title";
Vue.prototype.bus = new Vue;
import Nsloading from "./components/Loading.vue";
import Loading from "./components/Loading.vue";
Vue.prototype.$store = store;
Vue.use(Loading);
const LoadingCons = Vue.extend(Nsloading);
// 常用工具函数
Vue.prototype.$util = Util;
......@@ -26,7 +27,6 @@ Vue.directive("nsLoading", {
el.instance = instance;
Vue.nextTick(() => {
el.instance.isShow = binding.value;
console.log(123);
});
console.log(el.instance);
console.log(binding);
......
import Vue from "vue";
import VueRouter from "vue-router";
import store from "../store";
/*import store from "../store";
import { getToken } from "../utils/auth";
import { Message } from "element-ui";
import { Message } from "element-ui";*/
import indexRoutes from "./modules/index";
import otherRoutes from "./modules/other";
......@@ -40,7 +40,8 @@ const router = new VueRouter({
routes: mainRouters
});
router.beforeEach((to, from, next) => {
/*router.beforeEach((to, from, next) => {
debugger
const token = getToken();
if (!token) {
if (to.path === '/login') {
......@@ -57,6 +58,6 @@ router.beforeEach((to, from, next) => {
return;
}
next();
});
});*/
export default router;
......@@ -7,7 +7,7 @@ export default[
path: "/home",
name: "Home",
meta: {
title: "test",
title: "Home",
auth: 5
},
component: () => import("@/views/Home.vue")
......@@ -20,5 +20,14 @@ export default[
auth: "5"
},
component: () => import("@/components/demoPrototype/queryPages/callQuery.vue")
},
{
path: "/jccxIndex",
name: "jccxIndex",
meta: {
title: '基础查询界面',
auth: "5"
},
component: () => import("@/views/jccx/index.vue")
}
]
......@@ -33,7 +33,6 @@ const actions = {
return login({ username, password, captcha_id, captcha_code })
.then(res => {
const { code, data } = res;
if (code == 0) {
commit("SET_TOKEN", data.token);
commit("SET_Auth", "3");
......
[
{
title: "案件信息",
id: "1",
data: [
{ name: "案事件编号", id: "asjbh" },
{ name: "接警编号", id: "jjbh" },
{ name: "现场勘验编号", id: "xckybh" },
{ name: "侦查阶段", id: "zcjddm" }
]
},
{
title: "嫌疑人信息",
id: "2",
data: [
{
name: "抓获日期",
id: "zhrq"
},
{
name: "抓获单位",
id: "zhdwGajgjgdm"
},
{
name: "姓名",
id: "zhfzxyrXm"
},
{
name: "证件号码",
id: "zhfzxyrCyzjZjhm"
},
{
name: "出生日期",
id: "zhfzxyrCsrqRqgzxx"
}
]
},
{
title: "受害人信息",
id: "3",
data: [
{
name: "被害时间",
id: "bhsjKssj"
},
{
name: "姓名",
id: "bhrXm"
}
]
},
{
title: "分类信息",
id: "flxx",
data: [
{ name: "案件类别", id: "ajlbfl" },
{ name: "侦查阶段", id: "zcjdfl" },
{ name: "立案时间", id: "lasjfl" },
{ name: "立案单位", id: "ladwfl" },
{ name: "案发日期", id: "afrqfl" },
{ name: "案发地区划", id: "afdqhfl" },
{ name: "涉案金额", id: "sajefl" },
{ name: "年龄段", id: "nldfl" },
{ name: "性别", id: "xbfl" },
{ name: "国籍", id: "gjfl" }
]
}
];
import service from "axios";
import Message from "element-ui";
import url from "@/api/base";
// axios 配置
service.defaults.timeout = 50000;
service.defaults.headers.post["Content-Type"] = "application/json;charset=utf-8";
service.defaults.baseURL = url.BaseURL;
service.defaults.withCredentials = true;
//设置全局锁,防止登陆多次跳转登陆页
window.tiplock = false;
// response 拦截器
service.interceptors.response.use(
response => {
let data = response.data;
if (data.code == 20004) {
if (!window.tiplock) {
window.tiplock = true;
window.open('/login');
}
}
return data;
},
function(error) {
Message.Message({
type: "error",
message: error
});
return error;
}
);
export default service;
......@@ -2,19 +2,19 @@ import axios from "axios";
// import { getToken } from "./auth.js";
import { Message } from "element-ui";
import store from "@/store";
import qs from "qs";
/*import qs from "qs";*/
axios.defaults.timeout = 0;
axios.defaults.timeout = 50000;
axios.defaults.headers = {
"X-Requested-With": "XMLHttpRequest"
};
axios.defaults.responseType = "json";
// axios.defaults.withCredentials = true;
axios.defaults.withCredentials = true;
// request 请求拦截器
axios.interceptors.request.use(
config => {
config.headers['Content-Type'] = 'application/x-www-form-urlencoded';
config.headers["Content-Type"] = "application/json;charset=utf-8";
// config.headers['Content-Type'] = 'multipart/form-data';
// 请求前进行拦截, 验证是否已经登录等
......@@ -64,10 +64,10 @@ export function get(url, params) {
params: params
})
.then(res => {
resolve(res.data);
resolve(res);
})
.catch(err => {
reject(err.data);
reject(err);
});
});
}
......@@ -77,9 +77,53 @@ export function get(url, params) {
* @param data
* @returns {Promise}
*/
export function post(url, params) {
return new Promise((resolve, reject) => {
axios
.post(url, JSON.parse(params))
.then(response => {
resolve(response);
var urlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
var logs = {
ip: urlIp,
request: url,
params: params
};
store.commit("user/SET_Logs", logs);
})
.catch(err => {
reject(err.data);
});
});
}
export function postForm(url, params) {
return new Promise((resolve, reject) => {
axios
.post(url, params)
.then(response => {
resolve(response);
var urlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
var logs = {
ip: urlIp,
request: url,
params: params
};
store.commit("user/SET_Logs", logs);
})
.catch(err => {
reject(err.data);
});
});
}
/*export function post(url, params) {
debugger
return new Promise((resolve, reject) => {
axios.post(url, qs.stringify(params)).then(
response => {
resolve(response);
......@@ -97,6 +141,6 @@ export function post(url, params) {
reject(err.data);
});
});
}
}*/
export default axios;
import loading from '@c/Loading.vue'
const Loading={
install:function(Vue){
Vue.components('Loading',loading)
}
}
export default Loading;
/*
验证规则
*/
var checkSfzhm = (rule, value, callback) => {//身份证号码
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (value) {
if (!reg.test(value)) {
return callback(new Error("请输入正确的身份证号"));
} else {
callback();
}
}
};
var checkSjhm = (rule, value, callback) => {//手机号码
let reg = /^1[345789]\d{9}$/;
if (value) {
if (!reg.test(value)) {
return callback(new Error("请输入正确的手机号码"));
} else {
callback();
}
}
};
var checkNumber = (rule, value, callback) => {//数字
let reg = /^[0-9]*$/;
if (value) {
if (!reg.test(value)) {
return callback(new Error("由数字组成"));
} else {
callback();
}
}
};
var checkJyaq = (rule, value, callback) => {//简要案情
if(value){
if ((value.indexOf("and")!= -1|| value.indexOf("AND")!= -1) &&(value.indexOf("or")!= -1 || value.indexOf("OR")!= -1) ) {
return callback(new Error("只可以使用 and 和 or 中的其中一个"));
}else {
callback();
}
}else{
callback();
}
};
// 、验证是否身份证号
function isSFZH(value) {
var isCardNo = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return isCardNo.test(value);
}
//验证是否手机号
function isSJH(value) {
var isPhone = /^1[345789]\d{9}$/;
return isPhone.test(value);
}
//验证是否数字
function isNumber(value) {
var isNum = /^[0-9]*$/;
return isNum.test(value);
}
// 验证是否案件编号
function isAj(value) {
var isAj = /^A[0-9]{22}$/;
return isAj.test(value);
}
// 验证是否车牌号
function isYczc(value) {
var isYczc = /^[A-Za-z0-9]{6}$/;
return isYczc.test(value);
}
// 验证是否密码6位数字字母组合
function isPassword(value) {
var isYczc = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6}$/;
return isYczc.test(value);
}
//验证是否小写字母
function validateLowerCase(val) {
const reg = /^[a-z]+$/;
return reg.test(val);
}
//验证是否大写字母
function validateUpperCase(val) {
const reg = /^[A-Z]+$/;
return reg.test(val);
}
//验证是否大小写字母
function validatAlphabets(val) {
const reg = /^[A-Za-z]+$/;
return reg.test(val);
}
//导出
export {
//很关键
isSFZH,
isSJH,
isNumber,
isYczc,
isAj,
isPassword,
validateLowerCase,
validateUpperCase,
validatAlphabets
};
checkSfzhm,
checkSjhm,
checkNumber,
checkJyaq
}
/* eslint-disable */
/* Blob.js
* A Blob implementation.
* 2014-05-27
*
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/eboyjr
* License: X11/MIT
* See LICENSE.md
*/
/*global self, unescape */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
(function (view) {
"use strict";
view.URL = view.URL || view.webkitURL;
if (view.Blob && view.URL) {
try {
new Blob;
return;
} catch (e) {}
}
// Internally we use a BlobBuilder implementation to base Blob off of
// in order to support older browsers that only have BlobBuilder
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
var
get_class = function(object) {
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
}
, FakeBlobBuilder = function BlobBuilder() {
this.data = [];
}
, FakeBlob = function Blob(data, type, encoding) {
this.data = data;
this.size = data.length;
this.type = type;
this.encoding = encoding;
}
, FBB_proto = FakeBlobBuilder.prototype
, FB_proto = FakeBlob.prototype
, FileReaderSync = view.FileReaderSync
, FileException = function(type) {
this.code = this[this.name = type];
}
, file_ex_codes = (
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
).split(" ")
, file_ex_code = file_ex_codes.length
, real_URL = view.URL || view.webkitURL || view
, real_create_object_URL = real_URL.createObjectURL
, real_revoke_object_URL = real_URL.revokeObjectURL
, URL = real_URL
, btoa = view.btoa
, atob = view.atob
, ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array
;
FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
}
if (!real_URL.createObjectURL) {
URL = view.URL = {};
}
URL.createObjectURL = function(blob) {
var
type = blob.type
, data_URI_header
;
if (type === null) {
type = "application/octet-stream";
}
if (blob instanceof FakeBlob) {
data_URI_header = "data:" + type;
if (blob.encoding === "base64") {
return data_URI_header + ";base64," + blob.data;
} else if (blob.encoding === "URI") {
return data_URI_header + "," + decodeURIComponent(blob.data);
} if (btoa) {
return data_URI_header + ";base64," + btoa(blob.data);
} else {
return data_URI_header + "," + encodeURIComponent(blob.data);
}
} else if (real_create_object_URL) {
return real_create_object_URL.call(real_URL, blob);
}
};
URL.revokeObjectURL = function(object_URL) {
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
real_revoke_object_URL.call(real_URL, object_URL);
}
};
FBB_proto.append = function(data/*, endings*/) {
var bb = this.data;
// decode data to a binary string
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
var
str = ""
, buf = new Uint8Array(data)
, i = 0
, buf_len = buf.length
;
for (; i < buf_len; i++) {
str += String.fromCharCode(buf[i]);
}
bb.push(str);
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
if (FileReaderSync) {
var fr = new FileReaderSync;
bb.push(fr.readAsBinaryString(data));
} else {
// async FileReader won't work as BlobBuilder is sync
throw new FileException("NOT_READABLE_ERR");
}
} else if (data instanceof FakeBlob) {
if (data.encoding === "base64" && atob) {
bb.push(atob(data.data));
} else if (data.encoding === "URI") {
bb.push(decodeURIComponent(data.data));
} else if (data.encoding === "raw") {
bb.push(data.data);
}
} else {
if (typeof data !== "string") {
data += ""; // convert unsupported types to strings
}
// decode UTF-16 to binary string
bb.push(unescape(encodeURIComponent(data)));
}
};
FBB_proto.getBlob = function(type) {
if (!arguments.length) {
type = null;
}
return new FakeBlob(this.data.join(""), type, "raw");
};
FBB_proto.toString = function() {
return "[object BlobBuilder]";
};
FB_proto.slice = function(start, end, type) {
var args = arguments.length;
if (args < 3) {
type = null;
}
return new FakeBlob(
this.data.slice(start, args > 1 ? end : this.data.length)
, type
, this.encoding
);
};
FB_proto.toString = function() {
return "[object Blob]";
};
FB_proto.close = function() {
this.size = this.data.length = 0;
};
return FakeBlobBuilder;
}(view));
view.Blob = function Blob(blobParts, options) {
var type = options ? (options.type || "") : "";
var builder = new BlobBuilder();
if (blobParts) {
for (var i = 0, len = blobParts.length; i < len; i++) {
builder.append(blobParts[i]);
}
}
return builder.getBlob(type);
};
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
/* eslint-disable */
require('script-loader!file-saver');
require('./Blob');
require('script-loader!xlsx/dist/xlsx.core.min');
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}});
}
;
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}};
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
var cell = {v: data[R][C]};
if (cell.v == null) continue;
var cell_ref = XLSX.utils.encode_cell({c: C, r: R});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
}
else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
console.log('a')
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
console.log(data);
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), "test.xlsx")
}
function formatJson(jsonData) {
console.log(jsonData)
}
export function export_json_to_excel(th, jsonData, defaultTitle) {
/* original data */
var data = jsonData;
data.unshift(th);
var ws_name = "SheetJS";
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx")
}
......@@ -39,7 +39,7 @@ export default {
},
data () {
return {
loading: true,
loading: false,
tokeb: "",
captcha: {
id: "",
......
<template>
<div id="selectedConditions" class="formWrap" ref="select">
<div class="conditionTitle">已选条件:</div>
<div class="conditionWrap">
<el-tag
:key="tag.id"
v-for="tag in dynamicTags"
closable
:disable-transitions="false"
@close="handleClose(tag)"
>
<div v-if="tag.type == 'zdyText'" class="inline">
{{ tag.name }}{{ tag.value }}{{ tag.value2 }}
</div>
<div v-else-if="tag.type == 'daterange'" class="inline">
{{ tag.name }}{{ tag.value1 }}{{ tag.value2 }}
</div>
<div v-else class="inline">{{ tag.name }}{{ tag.value }}</div>
</el-tag>
</div>
</div>
</template>
<script>
export default {
name: "selectedConditions",
props: {
selectList: {
type: Array,
default: () => []
}
},
data() {
return {
dynamicTags: this.selectList,
height: 0
};
},
watch: {
selectList(val) {
let self = this;
self.dynamicTags = val;
self.$nextTick(() => {
self.height = self.$refs.select.offsetHeight;
self.$emit("getHeight", self.height);
});
}
},
methods: {
handleClose(tag) {
let self = this;
if (tag.type == "zdyText") {
self.$emit("cValue", tag.id, tag.id2);
} else {
self.$emit("cValue", tag.id);
}
self.dynamicTags.splice(self.dynamicTags.indexOf(tag), 1);
self.$nextTick(() => {
self.height = self.$refs.select.offsetHeight;
self.$emit("getHeight", this.height);
});
}
}
};
</script>
<style scoped lang="scss">
@import "../../assets/styles/form.scss";
</style>
<template>
<div class="login">
<el-form>
<el-form-item prop="vercode">
<el-input
v-model="vercode"
autocomplete="off"
placeholder="请输入验证码"
maxlength="4"
<div class="login-container">
<el-form
:model="ruleForm2"
:rules="rules2"
status-icon
ref="ruleForm2"
label-position="left"
label-width="0px"
class="demo-ruleForm login-page"
>
<template slot="prepend">
<i class="iconfont iconyanzhengma"></i>
</template>
<template slot="append">
<img :src="captcha.img" mode class="captcha" @click="getCaptcha" />
</template>
</el-input>
<h3 class="title">系统登录</h3>
<el-form-item prop="username">
<el-input
type="text"
v-model="ruleForm2.username"
auto-complete="off"
placeholder="用户名"
></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
v-model="ruleForm2.password"
auto-complete="off"
placeholder="密码"
></el-input>
</el-form-item>
<el-form-item
><el-button type="primary" @click="toLogin"
<el-form-item style="width:100%;">
<el-button
type="primary"
style="width:100%;"
@click="handleSubmit"
:loading="logining"
>登录</el-button
></el-form-item
>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { code } from "@/api/home.js";
import request from "@/api/interface/dictionaryCode.js";
export default {
name: "Login",
components: {},
data() {
return {
vercode: "",
captcha: {
id: "",
img: ""
}
};
logining: false,
ruleForm2: {
username: "admin",
password: "0"
},
rules2: {
username: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }]
},
created() {
this.getCaptcha();
checked: false
};
},
methods: {
getCaptcha() {
code({
captcha_id: this.captcha.id
}).then(res => {
if (res.code >= 0) {
this.captcha.id = res.data.id;
this.captcha.img = res.data.img;
this.captcha.img = this.captcha.img.replace(/\r\n/g, "");
}
console.log(res);
handleSubmit() {
let self = this;
self.$refs.ruleForm2.validate(valid => {
if (valid) {
self.logining = true;
request.login(self.ruleForm2.username,self.ruleForm2.password).then(res => {
if (res.code == 20000) {
sessionStorage.setItem("user", self.ruleForm2.username);
self.$router.push({ path: "/home" });
} else {
self.logining = false;
self.$alert("用户名或密码错误!", "提示", {
confirmButtonText: "ok"
});
},
toLogin() {
var self = this;
var data = {
username: "xxs",
password: "123456",
captcha_code: this.vercode,
captcha_id: this.captcha.id
};
self.$store
.dispatch("user/login", data)
.then(res => {
if (res.code >= 0) {
self.$message({
message: "登录成功!",
type: "success"
}
return res.data;
});
this.$router.push("/home");
} else {
self.getCaptcha();
self.$message({
message: res.message,
type: "warning"
});
return false;
}
})
.catch(() => {
self.getCaptcha();
});
}
}
};
</script>
<style lang="scss" scoped>
.el-form {
.captcha {
vertical-align: top;
max-width: inherit;
max-height: 38px;
line-height: 38px;
cursor: pointer;
}
.dynacode {
cursor: pointer;
}
[class*=" el-icon-"],
[class^="el-icon-"] {
font-size: 16px;
}
<style scoped>
.login-container {
position: relative;
top: 138px;
bottom: 20px;
width: 100%;
height: 100%;
/* 登录框上下对齐 */
display: flex;
align-items: center;
}
.login-page {
-webkit-border-radius: 5px;
border-radius: 5px;
margin: 0px auto;
width: 350px;
padding: 20px 35px 35px 15px;
background: #fff;
border: 1px solid #eaeaea;
box-shadow: 0 0 25px #cac6c6;
}
label.el-checkbox.rememberme {
margin: 0px 0px 15px;
text-align: left;
}
</style>
......@@ -4,7 +4,8 @@
<div @click="getCode">字典</div>
<!-- <div @click="getXs">线索</div> -->
<div @click="xss">线索123</div>
<el-upload class="upload-demo"
<el-upload
class="upload-demo"
ref="upload"
action="http://192.168.0.142:8080/shsexscj/addShsexscj"
:http-request="httpRequest"
......@@ -12,90 +13,97 @@
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileLists"
:auto-upload="false">
<el-button slot="trigger"
size="small"
type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;"
:auto-upload="false"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button
style="margin-left: 10px;"
size="small"
type="success"
@click="submitUpload">上传到服务器</el-button>
@click="submitUpload"
>上传到服务器</el-button
>
</el-upload>
<div @click="getcontent">huoqu</div>
</div>
</template>
<script>
import { testLogin, testCode, testXs, testXss } from "@/api/test.js";
import { testLogin, testCode, testXss } from "@/api/test.js";
import axios from "axios";
import qs from "qs";
export default {
name: "test",
components: {},
data () {
data() {
return {
xs: {
xm: '1234'
xm: "1234"
},
upFile: {},
fileLists: []
};
},
created () { },
created() {},
methods: {
getcontent () {
getcontent() {
testXss({
shsexsbh: "X4302000000002020100045"
}).then(res => {
console.log(res);
})
});
},
submitUpload () {
submitUpload() {
this.$refs.upload.submit();
this.xss()
this.xss();
},
httpRequest (data) {
httpRequest(data) {
console.log(data);
// this.file = data.file
//this.getPicturePicture()
},
handleRemove (file, fileList) {
this.fileLists = fileList
handleRemove(file, fileList) {
this.fileLists = fileList;
},
handlePreview (file) {
handlePreview(file) {
console.log(file);
},
handleChange (file, fileList) {
this.fileLists.push(file)
handleChange(file) {
this.fileLists.push(file);
},
xss () {
var params = new FormData()
params.append("xs.xm", '123')
xss() {
var params = new FormData();
params.append("xs.xm", "123");
for (var i = 0; i < this.fileLists.length; i++) {
params.append('xsfj', this.fileLists[i].raw)
params.append("xsfj", this.fileLists[i].raw);
}
axios.post("http://192.168.0.142:8080/shsexscj/addShsexscj", params).then(res => {
axios
.post("http://192.168.0.142:8080/shsexscj/addShsexscj", params)
.then(res => {
console.log(res);
})
});
},
login () {
login() {
testLogin({
username: "admin",
password: "0"
}).then(res => {
})
.then(res => {
console.log(res);
}).catch(err => {
console.log(err);
})
.catch(err => {
console.log(err);
});
},
getCode () {
getCode() {
testCode({
type: "CODE_XSLYDM"
}).then(res => {
})
.then(res => {
console.log(res);
}).catch(err => {
console.log(err);
})
.catch(err => {
console.log(err);
});
}
// getXs () {
// testXs({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment