Commit d7285a00 authored by mengmeng's avatar mengmeng

Merge branch 'fwldev' into 'master'

Fwldev

See merge request !2
parents 588e6b44 821800af
......@@ -10128,9 +10128,9 @@
"dev": true
},
"js-base64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw=="
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.6.1.tgz",
"integrity": "sha512-Frdq2+tRRGLQUIQOgsIGSCd1VePCS2fsddTG5dTCqR0JHgltXWfsxnY0gIXPoMeRmdom6Oyq+UMOFg5suduOjQ=="
},
"js-cookie": {
"version": "2.2.0",
......@@ -10143,6 +10143,11 @@
"integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
"dev": true
},
"js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
"integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
},
"js-message": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.5.tgz",
......@@ -15592,6 +15597,11 @@
"source-map": "^0.4.2"
},
"dependencies": {
"js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
"integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
},
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
......@@ -16779,6 +16789,13 @@
"js-base64": "^2.1.9",
"source-map": "^0.5.6",
"supports-color": "^3.2.3"
},
"dependencies": {
"js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
"integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
}
}
},
"supports-color": {
......
......@@ -25,7 +25,9 @@
"gulp-load-plugins": "^2.0.0",
"gulp-rename": "^1.4.0",
"gulp-sass": "^4.0.2",
"js-base64": "^3.6.1",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"lodash": "^4.17.15",
......
......@@ -10,8 +10,9 @@
window.SITE_CONFIG = {};
window.SITE_CONFIG['version'] = 'v1.0.0';
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>';
///window.SITE_CONFIG['apiURL'] = 'http://192.168.10.129:8080/hmit-admin';
window.SITE_CONFIG['apiURL'] = 'http://119.3.50.187:8011/hmit-admin'; // api请求地址
window.SITE_CONFIG['apiURL'] = 'http://10.55.125.88:8080/hmit-admin';
//window.SITE_CONFIG['apiURL'] = 'http://119.3.50.187:8011/hmit-admin';
//window.SITE_CONFIG['apiURL'] = 'http://192.168.10.67:8080/hmit-admin'; // api请求地址
window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象
'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
......
......@@ -15,20 +15,22 @@ export default {
options: Object,
height: String,
width: String,
// bage: String,
},
data() {
return {};
return {
myChart: "",
};
},
methods: {
getEchart() {
const chart = this.$refs.chartpie;
if (chart) {
const myChart = this.$echarts.init(chart);
let myChart = this.$echarts.init(chart);
this.myChart = myChart;
console.log("aaaa", myChart);
//const myChart = echarts.init(chart, null, { renderer: "svg" });
const option = this.options;
myChart.setOption(option);
myChart.setOption(option, true);
window.addEventListener("resize", function () {
myChart.resize();
});
......@@ -39,11 +41,23 @@ export default {
});
});
},
resize() {
this.myChart.resize();
},
rerender() {
this.myChart.setOption(this.options, true);
},
},
created() {},
mounted() {
// console.log("子组件接受到的", this.options);
this.getEchart();
},
watch: {
options(newval, oldval) {
this.myChart.setOption(newval, true);
},
},
};
</script>
......
......@@ -20,6 +20,8 @@ import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import * as echarts from 'echarts';
import md5 from 'js-md5';
Vue.prototype.$md5 = md5;
Vue.config.productionTip = false
......
......@@ -2,7 +2,7 @@
* 邮箱
* @param {*} s
*/
export function isEmail (s) {
export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
}
......@@ -10,15 +10,38 @@ export function isEmail (s) {
* 手机号码
* @param {*} s
*/
export function isMobile (s) {
export function isMobile(s) {
return /^1[0-9]{10}$/.test(s)
}
/**
* shuzi
* @param {*} s
*/
export function isSpecial(s) {
// return /^(?!<script>){0,50}*$/.test(s)
return /^((?!<script>).){0,50}$/.test(s)
}
export function isSpecial2(s) {
return /^((?!<script>).){0,10}$/.test(s)
}
/**
* shuzi----
* @param {*} s
*/
export function isNumber(s) {
return /^[0-9]{0,11}$/.test(s)
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone (s) {
export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}
......@@ -26,6 +49,6 @@ export function isPhone (s) {
* URL地址
* @param {*} s
*/
export function isURL (s) {
export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s)
}
......@@ -4,94 +4,158 @@
:title="$t('updatePassword.title')"
:close-on-click-modal="false"
:close-on-press-escape="false"
:append-to-body="true">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
:append-to-body="true"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item :label="$t('updatePassword.username')">
<span>{{ $store.state.user.name }}</span>
</el-form-item>
<el-form-item prop="password" :label="$t('updatePassword.password')">
<el-input v-model="dataForm.password" type="password" :placeholder="$t('updatePassword.password')"></el-input>
<el-form-item
prop="password"
:label="$t('updatePassword.password')"
>
<el-input
v-model="dataForm.password"
type="password"
:placeholder="$t('updatePassword.password')"
></el-input>
</el-form-item>
<el-form-item prop="newPassword" :label="$t('updatePassword.newPassword')">
<el-input v-model="dataForm.newPassword" type="password" :placeholder="$t('updatePassword.newPassword')"></el-input>
<el-form-item
prop="newPassword"
:label="$t('updatePassword.newPassword')"
>
<el-input
v-model="dataForm.newPassword"
type="password"
:placeholder="$t('updatePassword.newPassword')"
></el-input>
</el-form-item>
<el-form-item prop="confirmPassword" :label="$t('updatePassword.confirmPassword')">
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('updatePassword.confirmPassword')"></el-input>
<el-form-item
prop="confirmPassword"
:label="$t('updatePassword.confirmPassword')"
>
<el-input
v-model="dataForm.confirmPassword"
type="password"
:placeholder="$t('updatePassword.confirmPassword')"
></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button
type="primary"
@click="dataFormSubmitHandle()"
>{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { clearLoginInfo } from '@/utils'
import debounce from "lodash/debounce";
import { clearLoginInfo } from "@/utils";
export default {
data () {
data() {
return {
visible: false,
dataForm: {
password: '',
newPassword: '',
confirmPassword: ''
}
}
password: "",
newPassword: "",
confirmPassword: "",
},
};
},
computed: {
dataRule () {
dataRule() {
var validateConfirmPassword = (rule, value, callback) => {
if (this.dataForm.newPassword !== value) {
return callback(new Error(this.$t('updatePassword.validate.confirmPassword')))
return callback(
new Error(this.$t("updatePassword.validate.confirmPassword"))
);
}
callback()
callback();
};
var validateNewPass = (rule, value, callback) => {
const reg =
/(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W])(?=.*[\S])^[0-9A-Za-z\S]{8,18}$/g;
if (!reg.test(value)) {
callback(new Error("密码应该为8-18位大小字母、数字、特殊字符组合"));
} else {
callback();
}
};
return {
password: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
newPassword: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
{ validator: validateNewPass, trigger: "blur" },
],
confirmPassword: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateConfirmPassword, trigger: 'blur' }
]
}
}
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
{ validator: validateConfirmPassword, trigger: "blur" },
],
};
},
},
methods: {
init () {
this.visible = true
init() {
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
this.$refs["dataForm"].resetFields();
});
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
dataFormSubmitHandle: debounce(
function () {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false
return false;
}
this.$http.put('/sys/user/password', this.dataForm).then(({ data: res }) => {
this.$http
.put("/sys/user/password", this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false
clearLoginInfo()
this.$router.replace({ name: 'login' })
}
})
}).catch(() => {})
this.visible = false;
clearLoginInfo();
this.$router.replace({ name: "login" });
},
});
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
.catch(() => {});
});
},
1000,
{ leading: true, trailing: false }
),
},
};
</script>
......@@ -5,20 +5,26 @@
>
<div
class="aui-navbar__header"
style="width:460px"
style="width:375px"
>
<h1
class="aui-navbar__brand"
@click="$router.push({ name: 'home' })"
>
<!-- <a
<img
src="../assets/img/logo_icon.png"
alt=""
style="margin-right:5px;width:35px;height:39px;"
>
<a
style="letter-spacing:1px"
class="aui-navbar__brand-lg"
href="javascript:;"
>{{ $t('brand.lg') }}</a> -->
<img
>{{ $t('brand.lg') }}</a>
<!-- <img
src="../assets/img/logo.png"
alt=""
>
> -->
<a
class="aui-navbar__brand-mini"
......
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="评价模块名字" prop="name">
<el-input v-model="dataForm.name" placeholder="评价模块名字"></el-input>
<el-dialog
:visible.sync="visible"
:title="!dataForm.id ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"
>
<el-form-item
label="评价模块名字"
prop="name"
>
<el-input
v-model="dataForm.name"
placeholder="评价模块名字"
></el-input>
</el-form-item>
<el-form-item label="更新者" prop="updater">
<!-- <el-form-item label="更新者" prop="updater">
<el-input v-model="dataForm.updater" placeholder="更新者"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateDate">
<el-input v-model="dataForm.updateDate" placeholder="更新时间"></el-input>
</el-form-item>
</el-form-item> -->
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button
type="primary"
@click="dataFormSubmitHandle()"
>{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import debounce from "lodash/debounce";
export default {
data () {
data() {
return {
visible: false,
dataForm: {
id: '',
name: '',
creator: '',
createDate: '',
updater: '',
updateDate: ''
}
}
id: "",
name: "",
creator: "",
createDate: "",
updater: "",
updateDate: "",
},
};
},
computed: {
dataRule () {
dataRule() {
return {
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
updater: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
/* updater: [
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
updateDate: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
], */
};
},
},
methods: {
init () {
this.visible = true
init() {
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.getInfo()
this.getInfo();
}
})
});
},
// 获取信息
getInfo () {
this.$http.get(`/fhjw/fhiwfunction/${this.dataForm.id}`).then(({ data: res }) => {
getInfo() {
this.$http
.get(`/fhjw/fhiwfunction/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
...res.data,
};
})
.catch(() => {});
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
dataFormSubmitHandle: debounce(
function () {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false
return false;
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/fhjw/fhiwfunction/', this.dataForm).then(({ data: res }) => {
this.$http[!this.dataForm.id ? "post" : "put"](
"/fhjw/fhiwfunction/",
this.dataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
this.visible = false;
this.$emit("refreshDataList");
},
});
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
.catch(() => {});
});
},
1000,
{ leading: true, trailing: false }
),
},
};
</script>
<template>
<el-card shadow="never" class="aui-card--fill">
<el-card
shadow="never"
class="aui-card--fill"
>
<div class="mod-fhjw__fhiwfunction}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<!-- <el-form-item>
<el-input
v-model="dataForm.id"
placeholder="id"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form-item> -->
<!-- <el-form-item>
<el-button
type="info"
@click="exportHandle()"
>{{ $t('export') }}</el-button>
</el-form-item> -->
<el-form-item>
<el-button v-if="$hasPermission('fhjw:fhiwfunction:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button
v-if="$hasPermission('fhjw:fhiwfunction:save')"
type="primary"
@click="addOrUpdateHandle()"
>{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('fhjw:fhiwfunction:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button
v-if="$hasPermission('fhjw:fhiwfunction:delete')"
type="danger"
@click="deleteHandle()"
>{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" label="id" header-align="center" align="center"></el-table-column>
<el-table-column prop="name" label="评价模块名字" header-align="center" align="center"></el-table-column>
<el-table-column prop="creator" label="创建者" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updater" label="更新者" header-align="center" align="center"></el-table-column>
<el-table-column prop="updateDate" label="更新时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
style="width: 100%;"
>
<el-table-column
type="selection"
header-align="center"
align="center"
width="50"
></el-table-column>
<el-table-column
prop="name"
label="评价模块名字"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="createDate"
label="创建时间"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150"
>
<template slot-scope="scope">
<el-button v-if="$hasPermission('fhjw:fhiwfunction:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('fhjw:fhiwfunction:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button
v-if="$hasPermission('fhjw:fhiwfunction:update')"
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>{{ $t('update') }}</el-button>
<el-button
v-if="$hasPermission('fhjw:fhiwfunction:delete')"
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -40,35 +96,40 @@
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './fhiwfunction-add-or-update'
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./fhiwfunction-add-or-update";
export default {
mixins: [mixinViewModule],
data () {
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/fhjw/fhiwfunction/page',
getDataListURL: "/fhjw/fhiwfunction/page",
getDataListIsPage: true,
exportURL: '/fhjw/fhiwfunction/export',
deleteURL: '/fhjw/fhiwfunction',
deleteIsBatch: true
exportURL: "/fhjw/fhiwfunction/export",
deleteURL: "/fhjw/fhiwfunction",
deleteIsBatch: true,
},
dataForm: {
id: ''
}
}
id: "",
},
};
},
components: {
AddOrUpdate
}
}
AddOrUpdate,
},
};
</script>
......@@ -13,26 +13,26 @@
:label-width="$i18n.locale === 'en-US' ? '140px' : '100px'"
>
<el-row :gutter="30">
<el-col :span="13">
<el-col :span="12">
<el-form-item
label="受案号"
prop="caseNum"
>
<el-input
v-model="dataForm.caseNum"
placeholder="受案号"
placeholder="暂无"
readonly
></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="12">
<el-form-item
label="案件名称"
prop="caseName"
>
<el-input
v-model="dataForm.caseName"
placeholder="案件名称"
placeholder="暂无"
readonly
></el-input>
</el-form-item>
......@@ -40,61 +40,76 @@
</el-row>
<el-row :gutter="30">
<el-col :span="13">
<el-col :span="12">
<el-form-item
label="案件比"
prop="caseQuality"
label="受理日期"
prop="acceptanceDate"
>
<el-input
v-model="dataForm.caseQuality"
placeholder="案件比"
v-model="dataForm.acceptanceDate"
readonly
placeholder="暂无"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="12">
<el-form-item
label="受理日期"
prop="acceptanceDate"
label="审结日期"
prop="completeDate"
>
<el-input
v-model="dataForm.acceptanceDate"
v-model="dataForm.completeDate"
placeholder="暂无"
readonly
placeholder="受理日期"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="13">
<el-col :span="8">
<el-form-item
label="强制措施"
prop="coerciveMeasures"
label="当事人"
prop="peopleName"
>
<el-input
v-model="dataForm.coerciveMeasures"
placeholder="强制措施"
v-model="dataForm.peopleName"
placeholder="暂无"
readonly
></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="8">
<el-form-item
label="审结日期"
prop="completeDate"
label="代理人"
prop="agentName"
>
<el-input
v-model="dataForm.completeDate"
placeholder="审结日期"
v-model="dataForm.agentName"
placeholder="暂无"
readonly
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-col :span="8">
<el-form-item
label="承办人"
prop="undertaker"
>
<el-input
v-model="dataForm.undertaker"
placeholder="暂无"
readonly
></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item
label="办理期限"
prop="deadline"
>
......@@ -103,7 +118,7 @@
placeholder="办理期限"
readonly
></el-input>
</el-form-item>
</el-form-item> -->
<el-row
:gutter="30"
class="user"
......@@ -121,7 +136,7 @@
<el-input
v-model="item.detail"
placeholder="案件相关人员"
placeholder="暂无"
readonly
></el-input>
......@@ -136,7 +151,7 @@
<el-input
type="textarea"
v-model="dataForm.caseDetail"
placeholder="案件详情"
placeholder="暂无"
rows="3"
readonly
></el-input>
......@@ -171,6 +186,7 @@ export default {
caseDetail: "",
creator: "",
createDate: "",
agentName: "",
},
list: [],
};
......
......@@ -7,24 +7,27 @@
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
:rules="dataRule"
@keyup.enter.native="getCheck()"
>
<el-form-item>
<el-form-item prop="caseName">
<el-input
v-model="dataForm.caseName"
placeholder="案件名称"
clearable
:maxlength="50"
></el-input>
</el-form-item>
<el-form-item>
<el-form-item prop="caseNum">
<el-input
v-model="dataForm.caseNum"
v-model="caseNum"
placeholder="受案号"
:maxlength="50"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button
......@@ -73,12 +76,12 @@
header-align="center"
align="center"
></el-table-column>
<el-table-column
<!-- <el-table-column
prop="deadline"
label="办理期限"
header-align="center"
align="center"
></el-table-column>
></el-table-column> -->
<el-table-column
prop="acceptanceDate"
label="受理日期"
......@@ -91,7 +94,7 @@
header-align="center"
align="center"
></el-table-column>
<el-table-column
<!-- <el-table-column
prop="coerciveMeasures"
label="强制措施"
header-align="center"
......@@ -112,13 +115,31 @@
<template slot-scope="scope">
<div class="caseDetail">{{scope.row.caseDetail}}</div>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
prop="userName"
prop="undertaker"
label="承办人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="peopleName"
label="当事人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="agentName"
label="代理人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="userName"
label="录入人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="createDate"
label="创建时间"
......@@ -182,6 +203,7 @@
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./fhjwcase-add-or-update";
import Detail from "./fhjwcase-detail";
import { isSpecial } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data() {
......@@ -193,15 +215,77 @@ export default {
deleteURL: "/fhjw/fhjwcase",
deleteIsBatch: true,
},
flag: true,
flag2: true,
dataForm: {
id: "",
caseName: "",
caseNum: "",
},
caseNum: "",
detailVisible: false,
};
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
var validateCaseNum = (rule, value, callback) => {
this.flag2 = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag2 = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
return {
caseName: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
caseNum: [
{ required: true, validator: validateCaseNum, trigger: "blur" },
],
};
},
},
methods: {
filter(value) {
//转义字符方法
value = value.replace("[", "%5B").replace("]", "%5D");
return value;
},
getCheck() {
this.dataForm.caseNum = this.filter(this.caseNum);
if (this.flag && this.flag2) {
this.getDataList();
}
},
detailHandle(id) {
console.log(id);
this.detailVisible = true;
......
......@@ -56,34 +56,13 @@
prop="userName"
>
<el-input
v-model="dataForm.role"
v-model="dataForm.userRole"
placeholder="角色"
readonly
></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item
label="问题"
prop="questionName"
>
<el-input
v-model="dataForm.questionName"
placeholder="问题"
readonly
></el-input>
</el-form-item>
<el-form-item
label="答案"
prop="answer"
readonly
>
<el-input
v-model="dataForm.answer"
placeholder="答案"
></el-input>
</el-form-item> -->
<el-form-item
label="问题及答案"
prop="userName"
......
......@@ -7,17 +7,19 @@
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
:rules="dataRule"
@keyup.enter.native="getCheck()"
>
<el-form-item>
<el-form-item prop="caseName">
<el-input
v-model="dataForm.caseName"
placeholder="案件名称"
clearable
:maxlength="50"
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button
......@@ -53,45 +55,58 @@
align="center"
width="50"
></el-table-column>
<!-- <el-table-column prop="id" label="id" header-align="center" align="center"></el-table-column> -->
<el-table-column
prop="deptName"
label="部门"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="undertaker"
label="承办人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="caseName"
label="案件名称"
header-align="center"
align="center"
>
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<el-button
type="text"
@click="childHandle(scope.row)"
>{{ scope.row.caseName }}</el-button>
</template>
</template> -->
</el-table-column>
<!-- <el-table-column
prop="tempName"
label="模板"
<el-table-column
prop="peopleName"
label="当事人"
header-align="center"
align="center"
></el-table-column> -->
<!-- <el-table-column
prop="questionName"
label="问题"
></el-table-column>
<el-table-column
prop="caseNum"
label="受案号"
header-align="center"
align="center"
></el-table-column>
<!-- <el-table-column prop="id" label="id" header-align="center" align="center"></el-table-column> -->
<el-table-column
prop="answer"
label="答案"
prop="userName"
label="评价人"
header-align="center"
align="center"
></el-table-column> -->
<!-- <el-table-column
prop="userName"
label="用户"
></el-table-column>
<el-table-column
prop="userRole"
label="身份"
header-align="center"
align="center"
></el-table-column> -->
></el-table-column>
<!-- -->
<el-table-column
prop="createDate"
label="创建时间"
......@@ -106,11 +121,11 @@
width="150"
>
<template slot-scope="scope">
<!-- <el-button
<el-button
type="text"
size="small"
@click="detailHandle(scope.row.caseId)"
>详情</el-button> -->
@click="detailHandle(scope.row)"
>详情</el-button>
<el-button
v-if="$hasPermission('fhjw:fhjwcomment:delete')"
type="text"
......@@ -151,6 +166,7 @@ import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./fhjwcomment-add-or-update";
import Detail from "./fhjwcomment-detail";
import { addDynamicRoute } from "@/router";
import { isSpecial } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data() {
......@@ -166,6 +182,7 @@ export default {
detailVisible: false,
showpop: false,
showpop2: false,
flag: true,
dataForm: {
id: "",
caseName: "",
......@@ -174,7 +191,39 @@ export default {
dataListSelections2: "",
};
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
return {
caseName: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
};
},
},
methods: {
getCheck() {
if (this.flag) {
this.getDataList();
}
},
// 多选
dataListSelectionChangeHandle2(val) {
this.dataListSelections2 = val;
......@@ -232,11 +281,13 @@ export default {
})
.catch(() => {});
},
detailHandle(id) {
console.log(id);
detailHandle(row) {
console.log(row.id);
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.detail.dataForm.caseId = id;
this.$refs.detail.dataForm.caseId = row.caseId;
this.$refs.detail.dataForm.userId = row.userId;
this.$refs.detail.dataForm.role = row.role;
this.$refs.detail.init();
});
},
......
......@@ -4,13 +4,13 @@
shadow="never"
class="aui-card--fill"
>
<!-- 查询区域 -->
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
@keyup.enter.native="getCheck()"
>
<el-form-item>
<el-form-item prop="dateVal">
<el-date-picker
class="date-val"
v-model="dataForm.dateVal"
......@@ -18,43 +18,93 @@
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<div class="top">
<!-- <div
ref="chartpie"
style="height:450px;width:100%"
></div> -->
<!-- 顶部柱状图 -->
<!-- <div class="top">
<div class="titleline">
<div class="left">
<img
src="../../../assets/img/logo_tj.png"
alt=""
style="width:20px;height:20px"
>
评价统计
</div>
</div>
<Echarts
:options="optionsAll"
height="450px"
width="100%"
ref="chart"
/>
</div> -->
<!-- 顶部两个饼图区域 -->
<div class="bottom1">
<div style="flex:1;transform: translate3d(0, -10%, 0);height:400px">
<div class="left">
<img
src="../../../assets/img/logo_tj.png"
style="width:20px;height:20px"
>
评价统计
</div>
<Echarts
:options="optionsAll"
height="400px"
width="100%"
ref="chart"
/>
</div>
<div style="flex:1;transform: translate3d(0, -10%, 0);height:400px">
<div class="right">
<img
src="../../../assets/img/logo_tj.png"
style="width:20px;height:20px"
>
评价人员好差评统计
</div>
<Echarts
:options="optionsDaibiao"
height="400px"
width="100%"
ref="chartDaibiao"
/>
</div>
</div>
<!-- 底部遍历出来的饼图区域 -->
<!-- <input
type="text"
:value="options[0]"
> -->
<div class="bottom">
<div
class="item-pie"
v-for="(item,index) in list"
v-for="(item,index) in listTop"
:key="item.id"
>
<!-- <Echarts
:options="optionsDepart[index]"
height="450px"
width="100%"
/> -->
<!-- 遍历饼图 -->
<div
v-if="flag2"
:id="forId(index)"
style="height:300px;width:100%;"
:ref="'chart'+index"
></div>
<!-- <Echarts
:options="options[index]"
height="300px"
width="100%"
:ref="'chart'+index"
/> -->
</div>
</div>
......@@ -65,6 +115,7 @@
<script>
import Echarts from "../../../components/echarts.vue";
import * as echarts from "echarts";
import { isSpecial } from "@/utils/validate";
export default {
name: "fhjwcommentstatistical",
components: { Echarts },
......@@ -75,37 +126,246 @@ export default {
},
chartList: [], //
getId: [], //用来生成echarts
getIDBack: [],
chartList_values: [], //取其值
optionsAll: {},
optionsDepart: {},
list: [
optionsDaibiao: {},
options: [],
data: [],
flag2: false,
flag: false,
flag3: true,
listTop: [
{
id: 9,
title: "院领导",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 1,
title: "第一检察部",
goodnum: 500,
middlenum: 20,
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 2,
title: "第二检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 3,
title: "第三检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 4,
title: "第四检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 5,
title: "第五检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 6,
title: "第六检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 7,
title: "第七检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 8,
title: "溪口检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
],
listTopTemp: [
{
id: 9,
title: "院领导",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 1,
title: "第一检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 2,
title: "第二检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 3,
title: "第三检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 4,
title: "第四检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 5,
title: "第五检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 6,
title: "第六检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 7,
title: "第七检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 8,
title: "溪口检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
],
list2: [
{
id: 1,
title: "第一检察部",
goodnum: 400,
middlenum: 100,
bandnum: 3,
},
{
id: 2,
title: "第二检察部",
goodnum: 800,
goodnum: 400,
middlenum: 50,
bandnum: 1,
bandnum: 2,
},
{
id: 3,
title: "第三检察部",
goodnum: 200,
goodnum: 350,
middlenum: 5,
bandnum: 0,
bandnum: 5,
},
{
id: 4,
title: "第四检察部",
goodnum: 100,
goodnum: 333,
middlenum: 1,
bandnum: 1,
bandnum: 6,
},
{
id: 5,
......@@ -136,24 +396,157 @@ export default {
bandnum: 0,
},
],
listTypeOfMan: [],
};
},
computed: {
dataRule() {
/* var validateCaseName = (rule, value, callback) => {
this.flag3 = true;
if (value && !isSpecial(value)) {
console.log("88888", value);
this.flag3 = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
}; */
return {
dateVal: [
{
required: !this.flag3,
message: this.$t("validate.required"),
trigger: "blur",
},
],
};
},
},
methods: {
getCheck() {
console.log("kkk", this.dataForm.dateVal);
if (this.dataForm.dateVal instanceof Array) {
this.flag3 = true;
this.getAll();
} else {
this.flag3 = false;
}
},
forId(index) {
return "geo_" + index;
},
/* show(option) {
console.log(option.level_incite_user_list, '每个等级的占比情况11');
this.chartList = option.level_incite_user_list;
getInfoQuery() {
this.$http
.get(
"/fhjw/fhjwfeedback/getCount?startDate=" +
this.dataForm.dateVal[0] +
"&endDate=" +
this.dataForm.dateVal[1]
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTop = this.listTopTemp;
this.listTop.forEach((ele) => {
res.data.forEach((eles) => {
if (ele.title === eles.deptName) {
ele.goodnum = eles.committeeCountDTO.good;
ele.middlenum = eles.committeeCountDTO.medium;
ele.bandnum = eles.committeeCountDTO.bad;
ele.totle = eles.committeeCountDTO.totalCount;
}
});
});
console.log("this.list", this.listTop);
})
.then(() => {
//this.init();
this.flag2 = true;
this.getComment();
this.mapTree();
}, */
})
.catch(() => {});
this.$http
.get(
"/fhjw/fhjwcomment/getCountByUserRole?startDate=" +
this.dataForm.dateVal[0] +
"&endDate=" +
this.dataForm.dateVal[1]
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTypeOfMan = [...res.data];
//console.log("llll", ...res.data);
})
.then(() => {
//this.init();
this.flag = true;
this.getTypeOfMan();
})
.catch(() => {});
},
// 获取信息
getInfo() {
console.log("aaaa");
this.$http
.get("/fhjw/fhjwcomment/getCountByDept")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTop.forEach((ele) => {
res.data.forEach((eles) => {
if (ele.title === eles.deptName) {
ele.goodnum = eles.committeeCountDTO.good;
ele.middlenum = eles.committeeCountDTO.medium;
ele.bandnum = eles.committeeCountDTO.bad;
ele.totle = eles.committeeCountDTO.totalCount;
}
});
});
console.log("this.list", this.listTop);
})
.then(() => {
//this.init();
this.flag2 = true;
this.getComment();
this.mapTree();
})
.catch(() => {});
this.$http
.get("/fhjw/fhjwcomment/getCountByUserRole")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTypeOfMan = [...res.data];
})
.then(() => {
//this.init();
console.log("listTypeOfMan", this.listTypeOfMan);
this.flag = true;
this.getTypeOfMan();
})
.catch(() => {});
},
mapTree() {
//遍历画饼图
this.getId = [];
this.chartList_values = Object.values(this.list);
this.chartList_values = Object.values(this.listTop);
this.$nextTick(function () {
for (var i = 0; i < this.chartList_values.length; i++) {
let arr = [];
arr.push(
{
value: this.chartList_values[i].goodnum,
......@@ -169,18 +562,24 @@ export default {
}
);
console.log(arr, "arr========");
//console.log(arr, "arr========");
//拿到channel_grade_name作为变量key
this.getId.push(echarts.init(document.getElementById("geo_" + i)));
this.getId[i].setOption({
this.getIDBack = this.getId;
// console.log("ooooo", this.getId);
//this.getId = getIDBack;
this.getId[i].setOption(
{
title: {
text: this.chartList_values[i].title,
left: "center",
},
color: ["#91cc75", "#FFDC60", "#FF7070"],
color: ["#40B27D", "#FFDC60", "#FF7070"],
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
formatter: "{b} : {c}个({d}%)",
},
legend: {
bottom: 0,
......@@ -202,38 +601,80 @@ export default {
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
normal: {
show: true,
formatter: "{b}: {c}个({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
},
},
},
],
},
true
);
/* window.addEventListener("resize", function () {
this.getId[i].resize();
});
this.$on("hook:destroyed", () => {
window.removeEventListener("resize", function () {
this.getId[i].resize();
});
}); */
}
console.log("uuuu", this.options);
/* window.addEventListener("resize", function () {
this.getId[0].resize();
});
this.$on("hook:destroyed", () => {
window.removeEventListener("resize", function () {
this.getId[0].resize();
});
}); */
});
},
getPie() {
getComment() {
//const myChart = echarts.init(chart, null, { renderer: "svg" });
let legendData = [];
let goodData = [];
let middleData = [];
let badData = [];
this.list.forEach((ele) => {
this.listTop.forEach((ele) => {
legendData.push(ele.title);
goodData.push(ele.goodnum);
middleData.push(ele.middlenum);
badData.push(ele.bandnum);
});
console.log("middleData", middleData);
this.optionsAll = {
color: ["#91cc75", "#FFDC60", "#FF7070"],
title: { text: "评价统计", left: "center" },
color: ["#40B27D", "#FFDC60", "#FF7070"],
//title: { text: "评价统计", left: "center" },
legend: {
bottom: 0,
data: ["好", "中", "差"],
},
grid: {
left: 60,
right: 60,
},
xAxis: {
type: "category",
data: legendData,
axisLabel: {
interval: 0, //强制文字产生间隔
rotate: 45, //文字逆时针旋转45°
textStyle: {
//文字样式
color: "black",
fontSize: 10,
fontFamily: "Microsoft YaHei",
},
},
},
yAxis: {
type: "value",
name: "数量(个)",
},
series: [
{
......@@ -266,12 +707,110 @@ export default {
],
};
},
getTypeOfMan() {
//const myChart = echarts.init(chart, null, { renderer: "svg" });
let legendData = [];
let goodData = [];
let middleData = [];
let badData = [];
this.listTypeOfMan.forEach((ele) => {
legendData.push(ele.userRole);
goodData.push(ele.good);
middleData.push(ele.medium);
badData.push(ele.bad);
});
this.optionsDaibiao = {
color: ["#40B27D", "#FFDC60", "#FF7070"],
//title: { text: "评价统计", left: "center" },
legend: {
bottom: 0,
data: ["好", "中", "差"],
},
grid: {
left: 60,
right: 60,
},
created() {
this.getPie();
xAxis: {
type: "category",
data: legendData,
},
yAxis: {
type: "value",
name: "数量(个)",
},
series: [
{
name: "好",
data: goodData,
type: "bar",
label: {
show: true,
position: "top",
},
},
{
name: "中",
data: middleData,
type: "bar",
label: {
show: true,
position: "top",
},
},
{
name: "差",
data: badData,
type: "bar",
label: {
show: true,
position: "top",
},
mounted() {
},
],
};
},
/* getAll() {
this.listTop = this.list2;
this.getComment();
this.mapTree();
this.getTypeOfMan();
this.$nextTick(() => {
this.$refs.chart.getEchart();
});
}, */
getAll() {
this.flag2 = false;
this.flag = false;
if (this.dataForm.dateVal) {
this.getInfoQuery();
} else {
this.getInfo();
}
},
},
created() {
this.getInfo();
//this.getTypeOfMan();
},
mounted() {},
activated() {
//this.getTypeOfMan();
if (this.flag2 && this.flag) {
this.$refs.chartDaibiao.resize();
this.$refs.chart.resize();
}
/* for (let i = 0; i < this.getIDBack.length; i++) {
window.addEventListener("resize", function () {
this.getIDBack[i].resize();
});
this.$on("hook:destroyed", () => {
window.removeEventListener("resize", function () {
this.getIDBack[i].resize();
});
});
} */
},
};
</script>
......@@ -280,10 +819,18 @@ export default {
.fhjwcommentstatistical {
width: 100%;
.top {
width: 100%;
width: 60%;
margin: 0 auto;
display: flex;
}
}
.titleline {
width: 100%;
display: flex;
line-height: 50px;
font-size: 18px;
border-bottom: 1px solid #eee;
}
.bottom {
width: 100%;
......@@ -299,4 +846,19 @@ export default {
//display: flex;
}
}
.bottom1 {
display: flex;
margin-top: 40px;
font-size: 18px;
line-height: 50px;
.left {
width: calc(100% - 20px);
border-bottom: 1px solid #eee;
margin-right: 20px;
}
.right {
width: calc(100% - 2px);
border-bottom: 1px solid #eee;
}
}
</style>
\ No newline at end of file
......@@ -11,15 +11,42 @@
@keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '120px'"
>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item
label="案件名"
prop="caseName"
>
<el-input
v-model="dataForm.caseName"
placeholder="案件名"
readonly
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="意见类别"
prop="optionStatus"
>
<el-input
v-model="dataForm.optionStatus"
readonly
placeholder="意见类别"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item
label="用户"
prop="userId"
prop="userName"
>
<el-input
v-model="dataForm.userId"
v-model="dataForm.userName"
placeholder="用户"
readonly
></el-input>
......@@ -44,16 +71,6 @@
</el-col>
</el-row>
<el-form-item
label="意见类别"
prop="optionStatus"
>
<el-input
v-model="dataForm.optionStatus"
readonly
placeholder="意见类别"
></el-input>
</el-form-item>
<el-form-item
label="意见、申诉内容"
prop="content"
......
......@@ -7,13 +7,14 @@
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
@keyup.enter.native="getCheck()"
>
<el-form-item>
<el-form-item prop="content">
<el-input
v-model="dataForm.content"
placeholder="意见、申诉内容"
clearable
:maxlength="50"
></el-input>
</el-form-item>
<el-form-item>
......@@ -37,7 +38,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button
......@@ -73,6 +74,39 @@
align="center"
width="50"
></el-table-column>
<el-table-column
prop="deptName"
label="部门"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="undertaker"
label="承办人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="caseName"
label="案件名称"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="peopleName"
label="当事人"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="caseNum"
label="受案号"
header-align="center"
align="center"
></el-table-column>
<!-- <el-table-column prop="id" label="id" header-align="center" align="center"></el-table-column> -->
<el-table-column
prop="content"
......@@ -105,6 +139,12 @@
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="userRole"
label="身份"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="createDate"
label="创建时间"
......@@ -162,6 +202,7 @@
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./fhjwfeedback-add-or-update";
import Detail from "./fhjwfeedback-detail";
import { isEmail, isSpecial } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data() {
......@@ -179,6 +220,7 @@ export default {
content: "",
feedbackType: "",
},
flag: true,
options: [
{
value: 1,
......@@ -196,7 +238,40 @@ export default {
value: "",
};
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
return {
content: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
};
},
},
methods: {
getCheck() {
this.dataForm.caseNum = this.filter(this.caseNum);
if (this.flag) {
this.getDataList();
}
},
detailHandle(id) {
console.log(id);
this.detailVisible = true;
......
......@@ -3,30 +3,18 @@
shadow="never"
class="aui-card--fill"
>
<!-- <span class="label">筛选</span>
<el-date-picker
class="date-val"
v-model="dateVal"
type="monthrange"
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
>
</el-date-picker>
<el-button>查询</el-button> -->
<!-- 查询区域 -->
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item>
<!-- <el-form-item>
<el-input
v-model="dataForm.department"
placeholder="部门名称"
clearable
></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-date-picker
class="date-val"
......@@ -35,66 +23,70 @@
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getAll()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<div class="titleline">
<!-- 顶部两个饼图区域 -->
<div class="bottom">
<div style="flex:1;transform: translate3d(0, -10%, 0);height:400px">
<div class="left">
<img
src="../../../assets/img/logo_tj.png"
alt=""
style="width:20px;height:20px"
>
意见统计
</div>
<Echarts
:options="optionsComment"
id="chartComment"
height="400px"
width="100%"
ref="chartComment"
/>
</div>
<div style="flex:1;transform: translate3d(0, -10%, 0);height:400px">
<div class="right">
<img
src="../../../assets/img/logo_tj.png"
alt=""
style="width:20px;height:20px"
>
代表委员意见统计
</div>
</div>
<div class="bottom">
<!-- <div
ref="chartpie1"
style="width:50%;height:250px;"
></div> -->
<div style="flex:1;transform: translate3d(0, -10%, 0);">
<Echarts
:options="optionsComment"
height="300px"
width="100%"
/>
</div>
<div style="flex:1;transform: translate3d(0, -10%, 0);">
<Echarts
:options="optionsDaibiao"
height="300px"
height="400px"
width="100%"
ref="chartDaibiao"
/>
</div>
<!-- <div
ref="chartpie2"
style="width:50%;height:250px"
></div> -->
</div>
<div class="bottom">
<!-- <div
ref="chartzhuzhuang"
style="width:100%;height:375px;"
></div> -->
<!-- 标题 -->
<div
class="titleline"
style="margin-top:30px"
>
<div class="left">
<img
src="../../../assets/img/logo_tj.png"
style="width:20px;height:20px"
>
反馈统计
</div>
</div>
<!-- 底部折线图区域 -->
<div class="bottom-zhu">
<Echarts
:options="optionsAll"
height="375px"
width="100%"
ref="chartAll"
/>
</div>
......@@ -106,6 +98,7 @@
import Echarts from "../../../components/echarts.vue";
export default {
name: "fhjwstatistical",
inject: ["refresh"],
components: { Echarts },
data() {
return {
......@@ -116,45 +109,86 @@ export default {
optionsComment: {},
optionsDaibiao: {},
optionsAll: {},
flag: false,
};
},
methods: {
getPie1() {
this.optionsComment = {
/* title: {
text: "天气情况统计",
subtext: "虚构数据",
left: "center",
}, */
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
// 获取信息
getInfo() {
this.$http
.get("/fhjw/fhjwfeedback/getCount")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.flag = true;
this.getPieDaibiao(res.data[1].feedbackCount);
this.getZhuzhuang(res.data[2].feedbackCount);
this.getPieComment(res.data[0].feedbackCount);
})
.catch(() => {});
},
getInfoQuery() {
this.$http
.get(
"/fhjw/fhjwfeedback/getCount?startDate=" +
this.dataForm.dateVal[0] +
"&endDate=" +
this.dataForm.dateVal[1]
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.flag = true;
this.getPieDaibiao(res.data[1].feedbackCount);
this.getZhuzhuang(res.data[2].feedbackCount);
this.getPieComment(res.data[0].feedbackCount);
})
.catch(() => {});
},
legend: {
bottom: 0,
left: "center",
data: [
//意见统计
getPieComment(feedbackCount) {
let data = [
{ value: feedbackCount.delayCount, name: "反映拖延消极办案" },
{ value: feedbackCount.illegalCount, name: "反映违规不当办案" },
{
value: feedbackCount.dishonestyCount,
name: "反映办案不廉或作风不正",
},
{
value: feedbackCount.interveneCount,
name: "反映存在插手干预案件办理",
},
{ value: feedbackCount.otherProblemCount, name: "反映其他方面问题" },
];
let legendData = [
"反映拖延消极办案",
"反映违规不当办案",
"反映办案不廉或作风不正",
"反映存在插手干预案件办理",
"反映其他方面问题",
],
];
this.optionsComment = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c}件 ({d}%)",
},
legend: {
bottom: 0,
left: "center",
data: legendData,
},
series: [
{
name: "占比",
type: "pie",
radius: "70%",
radius: "60%",
center: ["50%", "50%"],
selectedMode: "single",
data: [
{ value: 1548, name: "反映拖延消极办案" },
{ value: 735, name: "反映违规不当办案" },
{ value: 510, name: "反映办案不廉或作风不正" },
{ value: 434, name: "反映存在插手干预案件办理" },
{ value: 335, name: "反映其他方面问题" },
],
data: data,
emphasis: {
itemStyle: {
shadowBlur: 10,
......@@ -162,46 +196,61 @@ export default {
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
normal: {
show: true,
formatter: "{b}: {c}件({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
},
},
},
],
};
},
getPie2() {
//代表委员
getPieDaibiao(feedbackCount) {
let data = [
{ value: feedbackCount.delayCount, name: "反映拖延消极办案" },
{ value: feedbackCount.illegalCount, name: "反映违规不当办案" },
{
value: feedbackCount.dishonestyCount,
name: "反映办案不廉或作风不正",
},
{
value: feedbackCount.interveneCount,
name: "反映存在插手干预案件办理",
},
{ value: feedbackCount.otherProblemCount, name: "反映其他方面问题" },
];
let legendData = [
"反映拖延消极办案",
"反映违规不当办案",
"反映办案不廉或作风不正",
"反映存在插手干预案件办理",
"反映其他方面问题",
];
this.optionsDaibiao = {
/* title: {
text: "天气情况统计",
subtext: "虚构数据",
left: "center",
}, */
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
formatter: "{b} : {c}件({d}%)",
},
legend: {
bottom: 0,
left: "center",
data: [
"反映拖延消极办案",
"反映违规不当办案",
"反映办案不廉或作风不正",
"反映存在插手干预案件办理",
"反映其他方面问题",
],
data: legendData,
formatter: function (name) {
//用来格式化图例文本,支持字符串模板和回调函数两种形式。模板变量为图例名称 {name}
return `${name}`;
},
},
series: [
{
name: "占比",
type: "pie",
radius: "70%",
radius: "60%",
center: ["50%", "50%"],
selectedMode: "single",
data: [
{ value: 1548, name: "反映拖延消极办案" },
{ value: 735, name: "反映违规不当办案" },
{ value: 510, name: "反映办案不廉或作风不正" },
{ value: 434, name: "反映存在插手干预案件办理" },
{ value: 335, name: "反映其他方面问题" },
],
data: data,
emphasis: {
itemStyle: {
shadowBlur: 10,
......@@ -209,42 +258,71 @@ export default {
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
normal: {
show: true,
formatter: "{b}: {c}件({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
},
},
},
],
};
},
getZhuzhuang() {
//反馈统计
getZhuzhuang(feedbackCount) {
let data = [
feedbackCount.complainCount,
feedbackCount.feedbackCount,
feedbackCount.committeeCount,
];
let xData = ["控告申诉", "意见反馈", "代表委员有话说"];
this.optionsAll = {
title: {
text: "反馈统计",
left: "center",
},
xAxis: {
type: "category",
data: ["控告申诉", "意见反馈", "代表委员有话说"],
data: xData,
},
yAxis: {
type: "value",
},
series: [
{
barWidth: 40,
label: {
show: true,
position: "top",
},
data: [120, 200, 150],
data: data,
type: "bar",
},
],
};
},
//查询
getAll() {
this.flag = false;
if (this.dataForm.dateVal) {
this.getInfoQuery();
} else {
this.getInfo();
}
},
},
created() {
this.getPie1();
this.getPie2();
this.getZhuzhuang();
this.getInfo();
//this.init();
},
mounted() {
// this.getInfo();
},
activated() {
if (this.flag === true) {
this.$refs.chartComment.resize();
this.$refs.chartDaibiao.resize();
this.$refs.chartAll.resize();
}
},
mounted() {},
};
</script>
......@@ -257,16 +335,34 @@ export default {
display: flex;
line-height: 50px;
font-size: 18px;
//border-bottom: 1px solid #eee;
.left {
width: calc(50% - 20px);
border-bottom: 1px solid #eee;
margin-right: 20px;
}
}
.bottom {
display: flex;
margin-top: 40px;
font-size: 18px;
line-height: 50px;
.left {
width: 50%;
width: calc(100% - 20px);
border-bottom: 1px solid #eee;
margin-right: 20px;
}
.right {
width: 50%;
width: calc(100% - 2px);
border-bottom: 1px solid #eee;
}
}
.bottom {
display: flex;
margin-top: 20px;
.bottom-zhu {
width: calc(50% - 10px);
transform: translate3d(0, -10%, 0);
height: 375px;
margin-top: 30px;
width: 50%;
border-bottom: 1px solid #eee;
}
</style>
\ No newline at end of file
......@@ -7,9 +7,10 @@
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
:rules="dataRule"
@keyup.enter.native="getCheck()"
>
<el-form-item>
<!-- <el-form-item prop="tempName">
<el-input
v-model="dataForm.tempName"
placeholder="问卷名称"
......@@ -17,8 +18,8 @@
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item> -->
<!-- <el-form-item>
<el-button
type="info"
......@@ -119,6 +120,7 @@
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./fhjwtemp-add-or-update";
import { addDynamicRoute } from "@/router";
import { isSpecial } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data() {
......@@ -130,6 +132,7 @@ export default {
deleteURL: "/fhjw/fhjwtemp",
deleteIsBatch: true,
},
flag: true,
dataForm: {
id: "",
tempName: "",
......@@ -139,7 +142,39 @@ export default {
components: {
AddOrUpdate,
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
return {
tempName: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
};
},
},
methods: {
getCheck() {
if (this.flag) {
this.getDataList();
}
},
// 子级
childHandle(row) {
// 路由参数
......
......@@ -42,6 +42,19 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
prop="funcIdList"
label="权限设置"
>
<el-checkbox-group v-model="dataForm.funcIdList">
<el-checkbox
v-for="item in allFuncList"
:label="item.id"
:key="item.id"
>{{item.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<!-- <el-form-item
label="备注"
......@@ -79,8 +92,10 @@ export default {
updateDate: "",
remark: "",
tempName: "",
funcIdList: [],
},
options: [],
allFuncList: [],
};
},
computed: {
......@@ -100,6 +115,13 @@ export default {
trigger: "blur",
},
],
funcIdList: [
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
};
},
},
......@@ -124,6 +146,15 @@ export default {
this.options = res.data;
})
.catch(() => {});
this.$http
.get("/fhjw/fhiwfunction/getAllFuncList")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.allFuncList = res.data;
})
.catch(() => {});
},
// 获取信息
getInfo() {
......
......@@ -66,8 +66,8 @@
align="center"
></el-table-column>
<el-table-column
prop="creator"
label="创建者"
prop="funcName"
label="已授权"
header-align="center"
align="center"
></el-table-column>
......
......@@ -30,6 +30,19 @@
placeholder="手机号"
></el-input>
</el-form-item>
<el-form-item
prop="gender"
:label="$t('user.gender')"
>
<!-- <ren-radio-group
v-model="dataForm.gender"
dict-type="gender"
></ren-radio-group> -->
<el-radio-group v-model="dataForm.gender">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="所属权限"
......@@ -51,7 +64,15 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="身份"
prop="identity"
>
<el-input
v-model="dataForm.identity"
placeholder="身份"
></el-input>
</el-form-item>
<el-form-item
label="身份证号"
prop="userIdno"
......@@ -88,6 +109,8 @@ export default {
userRole: "",
/* caseId: '', */
createDate: "",
gender: "",
identity: "",
},
options: [],
};
......
......@@ -7,6 +7,7 @@
<el-form
:inline="true"
:model="dataForm"
:rules="dataRule"
@keyup.enter.native="getDataList()"
>
<!-- <el-form-item>
......@@ -16,7 +17,7 @@
clearable
></el-input>
</el-form-item> -->
<el-form-item>
<el-form-item prop="mobile">
<el-input
v-model="dataForm.mobile"
placeholder="手机号"
......@@ -24,14 +25,8 @@
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-button
type="info"
@click="exportHandle()"
>{{ $t('export') }}</el-button>
</el-form-item> -->
<el-form-item>
<el-button
v-if="$hasPermission('fhjw:user:save')"
......@@ -39,6 +34,20 @@
@click="addOrUpdateHandle()"
>{{ $t('add') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-upload
class="upload-demo"
ref="upload"
action=""
:http-request="afterRead"
accept=".pdf,.doc,.docx,.xls,.xlsx"
:file-list="datalist"
>
<el-button type="warning">导入</el-button>
</el-upload>
</el-form-item> -->
<!-- <el-form-item>
<el-button
v-if="$hasPermission('fhjw:user:delete')"
......@@ -46,6 +55,9 @@
@click="deleteHandle()"
>{{ $t('deleteBatch') }}</el-button>
</el-form-item> -->
<!-- <el-form-item>
<a href="">点击此处下载导入模板</a>
</el-form-item> -->
</el-form>
<el-table
v-loading="dataListLoading"
......@@ -78,6 +90,24 @@
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="identity"
label="身份"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="gender"
:label="$t('user.gender')"
sortable="custom"
header-align="center"
align="center"
>
<template slot-scope="scope">
<!-- {{ $getDictLabel("gender", scope.row.gender) }} -->
<span>{{genderText(scope.row.gender)}}</span>
</template>
</el-table-column>
<el-table-column
prop="userRole"
label="所属权限"
......@@ -111,12 +141,12 @@
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>{{ $t('update') }}</el-button>
<!-- <el-button
<el-button
v-if="$hasPermission('fhjw:user:delete')"
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>{{ $t('delete') }}</el-button> -->
>{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -143,6 +173,7 @@
<script>
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./user-add-or-update";
import { isEmail, isNumber } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data() {
......@@ -154,14 +185,83 @@ export default {
deleteURL: "/fhjw/user",
deleteIsBatch: true,
},
datalist: [],
flag: true,
dataForm: {
id: "",
mobile: "",
},
};
},
computed: {
dataRule() {
var validateMobile = (rule, value, callback) => {
this.flag = true;
if (value && !isNumber(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(
this.$t("validate.format", { attr: this.$t("user.mobile") })
)
);
} else {
console.log("99999");
}
callback();
};
return {
mobile: [
{ required: true, validator: validateMobile, trigger: "blur" },
],
};
},
},
components: {
AddOrUpdate,
},
methods: {
getCheck() {
if (this.flag) {
this.getDataList();
}
},
genderText(gender) {
return ["男", "女"][gender];
},
//上传附件
afterRead(file) {
let data = new FormData();
data.append("file", file.file);
console.log(file);
const loading = this.$loading({
lock: true,
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
setTimeout(() => {
loading.close();
}, 2000);
// console.log("file", data);
/* getfileUploader(data).then((res) => {
if (res.data.code == 0) {
this.datalist.push({
docId: res.data.data.docId,
name: res.data.data.fileName,
filePath: res.data.data.url,
createDate: currentDate,
});
// console.log("上传完的dataform", this.dataForm);
}
this.dataForm.woWorkorderDocumentDTOList = this.datalist;
}); */
},
},
};
</script>
<style lang="less" scoped>
/deep/.el-upload-list {
display: none;
}
</style>
......@@ -6,26 +6,54 @@
<!-- <div class="title">
欢迎登陆检察阳光码管理系统
</div> -->
<div class="top">
<!-- 顶部标题 -->
<div
class="titleline"
style="margin-top:0"
>
<div
class="left"
style="width:100%"
>
<img
src="../../assets/img/logo_tj.png"
alt=""
style="width:20px;height:20px"
>
部门评价统计
</div>
</div>
<div
class="top"
style="margin-top:10px"
>
<div
class="item"
v-for="item in list"
v-for="item in listTop"
:key="item.id"
>
<div
class="title"
style="line-height:25px"
>{{item.title}}</div>
<div class="item-content">
<img
src="../../assets/img/member_icon_54.png"
alt=""
class="title-img"
>
<div class="right">
<div class="num">{{item.num}}</div>
<div class="title">{{item.title}}</div>
<div class="num">好:{{item.good}}%</div>
<div class="num">中:{{item.middle}}%</div>
<div class="num">差:{{item.bad}}%</div>
</div>
</div>
</div>
</div>
<!-- 顶部标题 -->
<div class="titleline">
<div class="left">
<img
......@@ -33,7 +61,7 @@
alt=""
style="width:20px;height:20px"
>
部门办案情况
测评案件统计
</div>
<div class="right">
<img
......@@ -41,36 +69,50 @@
alt=""
style="width:20px;height:20px"
>
部门办案情况统计
近一年好差评统计趋势图
</div>
</div>
<!-- 底部图形化 -->
<div class="bottom">
<!-- <div
ref="chartpie"
style="width:40%;height:470px;flex:3.5"
></div> -->
<!-- 饼图 -->
<div style="width:40%;transform: translate3d(0, -10%, 0);">
<Echarts
:options="optionHandlingSituation"
height="470px"
height="500px"
width="100%"
ref="pie"
/>
</div>
<!-- 柱状 -->
<div style="width:60%;transform: translate3d(0, -10%, 0);">
<Echarts
:options="optionHandlingSituationZhe"
height="470px"
height="250px"
width="100%"
ref="zhexian"
/>
<Echarts
:options="optionHandlingSituationZhu"
height="250px"
width="100%"
ref="zhuzi"
/>
</div>
<!-- <div
ref="chartzhexian"
style="width:60%;height:470px;flex:6.5"
></div> -->
</div>
<!-- <div class="bottom">
<div style="width:60%;transform: translate3d(0, -10%, 0);">
<Echarts
:options="optionHandlingSituationZhe"
height="470px"
width="100%"
/>
</div>
</div> -->
</el-card>
</template>
......@@ -82,58 +124,333 @@ export default {
return {
optionHandlingSituation: {},
optionHandlingSituationZhe: {},
list: [
optionHandlingSituationZhu: {},
flag: false,
flag2: false,
listTop: [
{
id: 9,
title: "院领导",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 1,
title: "第一检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 2,
title: "第二检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 3,
title: "第三检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 4,
title: "第四检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 5,
title: "第五检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 6,
title: "第六检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 7,
title: "第七检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
{
id: 8,
title: "溪口检察部",
goodnum: 0,
middlenum: 0,
bandnum: 0,
good: "",
middle: "",
bad: "",
totle: 0,
},
],
listTopPie: [
{
id: 9,
title: "院领导",
totle: 0,
},
{
id: 1,
title: "第一检察部",
num: 834,
totle: 0,
},
{
id: 2,
title: "第二检察部",
num: 307,
totle: 0,
},
{
id: 3,
title: "第三检察部",
num: 32,
totle: 0,
},
{
id: 4,
title: "第四检察部",
num: 145,
totle: 0,
},
{
id: 5,
title: "第五检察部",
num: 153,
totle: 0,
},
{
id: 6,
title: "第六检察部",
num: 81,
totle: 0,
},
{
id: 7,
title: "第七检察部",
num: 271,
totle: 0,
},
{
id: 8,
title: "溪口检察部",
num: 8,
totle: 0,
},
],
data: [],
listByMonth: [
/* {
id: 1,
date: "2020-12",
goodnum: 0,
middlenum: 20,
badnum: 0,
},
{
id: 2,
date: "2021-01",
goodnum: 156,
middlenum: 50,
badnum: 1,
},
{
id: 3,
date: "2021-02",
goodnum: 200,
middlenum: 5,
badnum: 0,
},
{
id: 4,
date: "2021-03",
goodnum: 100,
middlenum: 1,
badnum: 5,
},
{
id: 5,
date: "2021-04",
goodnum: 132,
middlenum: 2,
badnum: 2,
},
{
id: 6,
date: "2021-05",
goodnum: 169,
middlenum: 3,
badnum: 1,
},
{
id: 7,
date: "2021-06",
goodnum: 202,
middlenum: 8,
badnum: 10,
},
{
id: 8,
date: "2021-07",
goodnum: 188,
middlenum: 2,
badnum: 0,
},
{
id: 9,
date: "2021-08",
goodnum: 155,
middlenum: 20,
badnum: 0,
},
{
id: 10,
date: "2021-09",
goodnum: 100,
middlenum: 20,
badnum: 0,
},
{
id: 11,
date: "2021-10",
goodnum: 200,
middlenum: 20,
badnum: 0,
},
{
id: 12,
date: "2021-11",
goodnum: 100,
middlenum: 20,
badnum: 0,
}, */
],
};
},
created() {
// this.getSysInfo();
this.getPie();
this.getZhe();
this.getInfo();
},
mounted() {},
methods: {
// 获取信息
getInfo() {
this.$http
.get("/fhjw/fhjwcomment/getCountByDept")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTop.forEach((ele) => {
res.data.forEach((eles) => {
if (ele.title === eles.deptName) {
ele.goodnum = eles.committeeCountDTO.good;
ele.middlenum = eles.committeeCountDTO.medium;
ele.bandnum = eles.committeeCountDTO.bad;
ele.totle = eles.committeeCountDTO.totalCount;
}
});
});
console.log("this.list", this.listTop);
})
.then(() => {
this.init();
this.flag = true;
})
.catch(() => {});
this.$http
.get("/fhjw/fhjwcomment/getCountByMouth")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listByMonth = res.data;
})
.then(() => {
this.flag2 = true;
this.getZhe();
this.getZhu();
})
.catch(() => {});
this.$http
.get("/fhjw/fhjwcomment/getCaseCountByDept")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.listTop.forEach((ele) => {
res.data.forEach((eles) => {
if (ele.title === eles.deptName) {
ele.totle = eles.committeeCountDTO.totalCount;
}
});
this.data.push({ value: ele.totle, name: ele.title });
});
})
.then(() => {
this.getPie();
})
.catch(() => {});
},
init() {
this.listTop.forEach((ele) => {
let totle = ele.goodnum + ele.middlenum + ele.bandnum;
if (totle === 0) {
ele.good = 0;
ele.middle = 0;
ele.bad = 0;
} else {
ele.good = ((ele.goodnum / totle) * 100).toFixed(1);
ele.middle = ((ele.middlenum / totle) * 100).toFixed(1);
ele.bad = ((ele.bandnum / totle) * 100).toFixed(1);
}
});
},
formatterNumber(v) {
return (v * 1).toFixed(1);
},
getSysInfo() {
this.$http
.get("/sys/info")
......@@ -146,16 +463,18 @@ export default {
.catch(() => {});
},
getPie() {
console.log("data", this.data);
this.optionHandlingSituation = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
formatter: "{b} : {c}件({d}%)",
},
legend: {
bottom: 0,
left: "center",
data: [
"院领导",
"第一检察部",
"第二检察部",
"第三检察部",
......@@ -166,23 +485,15 @@ export default {
"溪口检察部",
],
},
series: [
{
name: "占比",
type: "pie",
radius: "70%",
radius: "50%",
center: ["50%", "50%"],
selectedMode: "single",
data: [
{ value: 1548, name: "第一检察部" },
{ value: 735, name: "第二检察部" },
{ value: 510, name: "第三检察部" },
{ value: 434, name: "第四检察部" },
{ value: 335, name: "第五检察部" },
{ value: 335, name: "第六检察部" },
{ value: 335, name: "第七检察部" },
{ value: 335, name: "溪口检察部" },
],
data: this.data,
emphasis: {
itemStyle: {
shadowBlur: 10,
......@@ -190,174 +501,601 @@ export default {
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
normal: {
show: true,
formatter: "{b}: {c}件({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
},
},
},
],
};
},
getZhe() {
let xAxisData = [];
let goodnumData = [];
let middlenumData = [];
let badnumData = [];
let goodpercentData = [];
let middlepercentData = [];
let badpercentData = [];
console.log("ooopppp", xAxisData, goodnumData, middlenumData, badnumData);
this.listByMonth.forEach((ele) => {
xAxisData = xAxisData.concat(ele.createDate);
goodnumData = goodnumData.concat(ele.good);
middlenumData = middlenumData.concat(ele.medium);
badnumData = badnumData.concat(ele.badnum);
let totle = ele.medium + ele.good + ele.bad;
goodpercentData = goodpercentData.concat(
((ele.good / totle) * 100).toFixed(1)
);
middlepercentData = middlepercentData.concat(
((ele.medium / totle) * 100).toFixed(1)
);
badpercentData = badpercentData.concat(
((ele.bad / totle) * 100).toFixed(1)
);
});
console.log("dddddd", xAxisData, goodnumData, middlenumData, badnumData);
this.optionHandlingSituationZhe = {
/* title: {
text: "折线图堆叠",
}, */
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
legend: {
bottom: 0,
left: "center",
data: [
"第一检察部",
"第二检察部",
"第三检察部",
"第四检察部",
"第五检察部",
"第六检察部",
"第七检察部",
"溪口检察部",
],
},
formatter:
"<div style='width:10px;height:10px;background:#40B27D;display:inline-block;border-radius:50%;margin-right:5px'></div>{a0}:{c0}%<br/>" +
"<div style='width:10px;height:10px;background:#4B94E4;display:inline-block;border-radius:50%;margin-right:5px'></div>{a1}:{c1}%<br/>" +
"<div style='width:10px;height:10px;background:#FF7070;display:inline-block;border-radius:50%;margin-right:5px'></div>{a2}:{c2}%",
},
color: ["#40B27D", "#4B94E4", "#FF7070"],
grid: {
top: "30%",
left: "5%",
right: "5%",
bottom: "10%",
bottom: "15%",
containLabel: true,
},
/* toolbox: {
feature: {
saveAsImage: {},
legend: {
data: ["好评占比", "中评占比", "差评占比"],
bottom: 0,
},
}, */
xAxis: {
xAxis: [
{
type: "category",
boundaryGap: false,
data: [
"2020-12",
"2021-01",
"2021-02",
"2021-03",
"2021-04",
"2021-05",
],
data: xAxisData,
axisPointer: {
type: "shadow",
},
yAxis: {
axisTick: {
show: false,
},
},
],
yAxis: [
{
type: "value",
axisLine: {
show: true,
name: "占比(%)",
min: -20,
max: 100,
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "第一检察部",
name: "好评占比",
type: "line",
stack: "总量",
data: [120, 132, 101, 134, 90, 230],
data: goodpercentData,
},
{
name: "第二检察部",
name: "中评占比",
type: "line",
stack: "总量",
data: [220, 182, 191, 234, 290, 330],
data: middlepercentData,
},
{
name: "第三检察部",
name: "差评占比",
type: "line",
stack: "总量",
data: [150, 232, 201, 154, 190, 330],
data: badpercentData,
},
],
};
this.optionHandlingSituationZhu = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
formatter:
"<div style='width:10px;height:10px;background:#40B27D;display:inline-block;border-radius:50%;margin-right:5px'></div>{a0}:{c0}个<br/>" +
"<div style='width:10px;height:10px;background:#4B94E4;display:inline-block;border-radius:50%;margin-right:5px'></div>{a1}:{c1}个<br/>" +
"<div style='width:10px;height:10px;background:#FF7070;display:inline-block;border-radius:50%;margin-right:5px'></div>{a2}:{c2}个",
},
color: ["#40B27D", "#4B94E4", "#FF7070"],
grid: {
top: "20%",
left: "5%",
right: "5%",
bottom: "15%",
containLabel: true,
},
legend: {
data: ["好评数量", "中评数量", "差评数量"],
bottom: 0,
},
xAxis: [
{
name: "第四检察部",
type: "line",
stack: "总量",
data: [320, 332, 301, 334, 390, 330],
type: "category",
data: xAxisData,
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
name: "第五检察部",
type: "line",
stack: "总量",
data: [820, 932, 901, 934, 1290, 1330],
type: "value",
name: "数量(个)",
min: 0,
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "第六检察部",
type: "line",
stack: "总量",
data: [320, 332, 301, 334, 390, 330],
name: "好评数量",
type: "bar",
data: goodnumData,
},
{
name: "第七检察部",
type: "line",
stack: "总量",
data: [100, 200, 300, 500, 200, 100],
name: "中评数量",
type: "bar",
data: middlenumData,
},
{
name: "溪口检察部",
type: "line",
stack: "总量",
data: [500, 100, 500, 200, 50, 10],
name: "差评数量",
type: "bar",
data: badnumData,
},
],
};
},
getZhu() {
let legendData = [];
let goodData = [];
let middleData = [];
let badData = [];
/* this.listByMonth.forEach((ele) => {
legendData = legendData.push(ele.createDate).reverse();
goodData = goodData.push(ele.good).reverse();
middleData = middleData.push(ele.medium).reverse();
badData = badData.push(ele.bad).reverse();
}); */
this.listByMonth.forEach((ele) => {
legendData = legendData.concat(ele.createDate);
goodData = goodData.concat(ele.good);
middleData = middleData.concat(ele.medium);
badData = badData.concat(ele.bad);
});
console.log("么么么么么", badData);
this.optionHandlingSituationZhu = {
color: ["#40B27D", "#FFDC60", "#FF7070"],
//title: { text: "评价统计", left: "center" },
legend: {
bottom: 0,
data: ["好", "中", "差"],
},
grid: {
left: 60,
right: 60,
},
xAxis: {
type: "category",
data: legendData,
},
yAxis: {
type: "value",
},
series: [
{
name: "好",
data: goodData,
type: "bar",
label: {
show: true,
position: "top",
},
},
{
name: "中",
data: middleData,
type: "bar",
label: {
show: true,
position: "top",
},
},
{
name: "差",
data: badData,
type: "bar",
label: {
show: true,
position: "top",
},
},
],
};
},
},
activated() {
// this.getPie();
// this.flag = true;
if (this.flag && this.flag2) {
this.$refs.zhexian.resize();
this.$refs.zhuzi.resize();
this.$refs.pie.resize();
}
},
};
</script>
<style lang="less" scoped>
.top {
@media screen and (max-width: 1200px) {
.top {
display: flex;
justify-content: space-between;
.item {
background: #4f96e1;
color: #fff;
display: flex;
width: 150px;
// width: 150px;
margin-right: 3px;
flex: 1;
height: 90px;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0;
border-radius: 8px;
font-size: 14px;
position: relative;
.num {
font-size: 30px;
font-size: 8px;
}
.item-content {
position: absolute;
width: 80%;
margin: 0 auto;
width: 96%;
margin: 12px auto 0;
top: 50%;
transform: translate(0, -50%);
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
.title-img {
width: 40px;
height: 40px;
width: 25%;
height: 25%;
margin: 0 5px;
//vertical-align: middle;
}
.right {
margin-left: 10px;
// margin-left: 5px;
text-align: right;
}
.title,
.num {
text-align: left;
}
}
}
.titleline {
display: flex;
line-height: 40px;
font-size: 18px;
margin-top: 35px;
// border-bottom: 1px solid #eee;
.left {
width: 40%;
margin-right: 20px;
border-bottom: 1px solid #eee;
}
.right {
width: 60%;
border-bottom: 1px solid #eee;
}
}
.bottom {
width: 100%;
display: flex;
margin-top: 20px;
}
}
@media screen and (min-width: 1200px) and (max-width: 1399px) {
.top {
display: flex;
justify-content: space-between;
.item {
background: #4f96e1;
color: #fff;
display: flex;
// width: 150px;
margin-right: 3px;
flex: 1;
height: 90px;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0;
border-radius: 8px;
font-size: 14px;
position: relative;
.num {
font-size: 8px;
}
.item-content {
position: absolute;
width: 96%;
margin: 12px auto 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
.title-img {
width: 25%;
height: 25%;
margin: 0 5px;
//vertical-align: middle;
}
.right {
// margin-left: 5px;
text-align: right;
}
.title,
.num {
text-align: left;
}
}
}
.titleline {
display: flex;
line-height: 40px;
font-size: 18px;
margin-top: 35px;
// border-bottom: 1px solid #eee;
.left {
width: 40%;
margin-right: 20px;
border-bottom: 1px solid #eee;
}
.right {
width: 60%;
border-bottom: 1px solid #eee;
}
}
.bottom {
width: 100%;
display: flex;
margin-top: 20px;
}
}
.titleline {
@media screen and (min-width: 1400px) and (max-width: 1660px) {
.top {
display: flex;
justify-content: space-between;
.item {
background: #4f96e1;
color: #fff;
display: flex;
// width: 150px;
margin-right: 8px;
flex: 1;
height: 90px;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0;
border-radius: 8px;
font-size: 14px;
position: relative;
.num {
font-size: 8px;
}
.item-content {
position: absolute;
width: 95%;
margin: 12px auto 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
.title-img {
width: 25%;
height: 25%;
margin: 0 5px;
//vertical-align: middle;
}
.right {
margin-left: 5px;
text-align: right;
}
.title,
.num {
text-align: left;
}
}
}
.titleline {
display: flex;
line-height: 50px;
line-height: 40px;
font-size: 18px;
margin-top: 35px;
// border-bottom: 1px solid #eee;
.left {
width: 40%;
margin-right: 20px;
border-bottom: 1px solid #eee;
}
.right {
width: 60%;
border-bottom: 1px solid #eee;
}
}
.bottom {
width: 100%;
display: flex;
margin-top: 20px;
}
}
@media screen and (min-width: 1660px) and (max-width: 1900px) {
.top {
display: flex;
justify-content: space-between;
.item {
background: #4f96e1;
color: #fff;
display: flex;
// width: 150px;
margin-right: 20px;
flex: 1;
height: 90px;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0;
border-radius: 8px;
font-size: 14px;
position: relative;
.num {
font-size: 10px;
}
.item-content {
position: absolute;
width: 90%;
margin: 12px auto 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
.title-img {
width: 25%;
height: 25%;
margin: 0 5px;
//vertical-align: middle;
}
.right {
margin-left: 5px;
text-align: right;
}
.title,
.num {
text-align: left;
}
}
}
.titleline {
display: flex;
line-height: 40px;
font-size: 18px;
margin-top: 35px;
// border-bottom: 1px solid #eee;
.left {
width: 40%;
margin-right: 20px;
border-bottom: 1px solid #eee;
}
.right {
width: 60%;
border-bottom: 1px solid #eee;
}
}
.bottom {
width: 100%;
display: flex;
margin-top: 20px;
}
}
.bottom {
@media screen and (min-width: 1910px) {
.top {
display: flex;
justify-content: space-between;
.item {
background: #4f96e1;
color: #fff;
display: flex;
// width: 150px;
margin-right: 40px;
flex: 1;
height: 90px;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0;
border-radius: 8px;
font-size: 18px;
position: relative;
.num {
font-size: 13px;
}
.item-content {
position: absolute;
width: 90%;
margin: 12px auto 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
.title-img {
width: 25%;
height: 25%;
margin: 0 5px;
//vertical-align: middle;
}
.right {
margin-left: 5px;
text-align: right;
}
.title,
.num {
text-align: left;
}
}
}
.titleline {
display: flex;
line-height: 40px;
font-size: 18px;
margin-top: 35px;
// border-bottom: 1px solid #eee;
.left {
width: 40%;
margin-right: 20px;
border-bottom: 1px solid #eee;
}
.right {
width: 60%;
border-bottom: 1px solid #eee;
}
}
.bottom {
width: 100%;
display: flex;
margin-top: 20px;
}
}
</style>
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
<el-dialog
:visible.sync="visible"
:title="!dataForm.id ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item
prop="name"
:label="$t('role.name')"
>
<el-input
v-model="dataForm.name"
:placeholder="$t('role.name')"
></el-input>
</el-form-item>
<el-form-item prop="remark" :label="$t('role.remark')">
<el-input v-model="dataForm.remark" :placeholder="$t('role.remark')"></el-input>
<el-form-item
prop="remark"
:label="$t('role.remark')"
>
<el-input
v-model="dataForm.remark"
:placeholder="$t('role.remark')"
></el-input>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item size="mini" :label="$t('role.menuList')">
<el-form-item
size="mini"
:label="$t('role.menuList')"
>
<el-tree
:data="menuList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
ref="menuListTree"
accordion
show-checkbox>
show-checkbox
>
</el-tree>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item size="mini" :label="$t('role.deptList')">
<el-form-item
size="mini"
:label="$t('role.deptList')"
>
<el-tree
:data="deptList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
ref="deptListTree"
accordion
show-checkbox>
show-checkbox
>
</el-tree>
</el-form-item>
</el-col>
......@@ -36,113 +67,137 @@
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button
type="primary"
@click="dataFormSubmitHandle()"
>{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import debounce from "lodash/debounce";
export default {
data () {
data() {
return {
visible: false,
menuList: [],
deptList: [],
dataForm: {
id: '',
name: '',
id: "",
name: "",
menuIdList: [],
deptIdList: [],
remark: ''
}
}
remark: "",
},
};
},
computed: {
dataRule () {
dataRule() {
return {
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
};
},
},
methods: {
init () {
this.visible = true
init() {
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
this.$refs.deptListTree.setCheckedKeys([])
Promise.all([
this.getMenuList(),
this.getDeptList()
]).then(() => {
this.$refs["dataForm"].resetFields();
this.$refs.menuListTree.setCheckedKeys([]);
this.$refs.deptListTree.setCheckedKeys([]);
Promise.all([this.getMenuList(), this.getDeptList()]).then(() => {
if (this.dataForm.id) {
this.getInfo()
this.getInfo();
}
})
})
});
});
},
// 获取菜单列表
getMenuList () {
return this.$http.get('/sys/menu/select').then(({ data: res }) => {
getMenuList() {
return this.$http
.get("/sys/menu/select")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.menuList = res.data
}).catch(() => {})
this.menuList = res.data;
})
.catch(() => {});
},
// 获取部门列表
getDeptList () {
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
getDeptList() {
return this.$http
.get("/sys/dept/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.deptList = res.data
}).catch(() => {})
this.deptList = res.data;
})
.catch(() => {});
},
// 获取信息
getInfo () {
this.$http.get(`/sys/role/${this.dataForm.id}`).then(({ data: res }) => {
getInfo() {
this.$http
.get(`/sys/role/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
}).catch(() => {})
...res.data,
};
this.dataForm.menuIdList.forEach((item) =>
this.$refs.menuListTree.setChecked(item, true)
);
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList);
})
.catch(() => {});
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
dataFormSubmitHandle: debounce(
function () {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false
return false;
}
this.dataForm.menuIdList = [
...this.$refs.menuListTree.getHalfCheckedKeys(),
...this.$refs.menuListTree.getCheckedKeys()
]
this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys()
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm).then(({ data: res }) => {
...this.$refs.menuListTree.getCheckedKeys(),
];
this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys();
this.$http[!this.dataForm.id ? "post" : "put"](
"/sys/role",
this.dataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
this.visible = false;
this.$emit("refreshDataList");
},
});
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
.catch(() => {});
});
},
1000,
{ leading: true, trailing: false }
),
},
};
</script>
<template>
<el-card shadow="never" class="aui-card--fill">
<el-card
shadow="never"
class="aui-card--fill"
>
<div class="mod-sys__role">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input>
<el-form
:inline="true"
:rules="dataRule"
:model="dataForm"
@keyup.enter.native="getCheck()"
>
<!-- <el-form-item prop="name">
<el-input
v-model="dataForm.name"
:placeholder="$t('role.name')"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item> -->
<el-form-item>
<el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button
v-if="$hasPermission('sys:role:save')"
type="primary"
@click="addOrUpdateHandle()"
>{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button
v-if="$hasPermission('sys:role:delete')"
type="danger"
@click="deleteHandle()"
>{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table
......@@ -21,15 +41,54 @@
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="name" :label="$t('role.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('role.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('role.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
style="width: 100%;"
>
<el-table-column
type="selection"
header-align="center"
align="center"
width="50"
></el-table-column>
<el-table-column
prop="name"
:label="$t('role.name')"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="remark"
:label="$t('role.remark')"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="createDate"
:label="$t('role.createDate')"
sortable="custom"
header-align="center"
align="center"
width="180"
></el-table-column>
<el-table-column
:label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150"
>
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button
v-if="$hasPermission('sys:role:update')"
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>{{ $t('update') }}</el-button>
<el-button
v-if="$hasPermission('sys:role:delete')"
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -40,34 +99,75 @@
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './role-add-or-update'
import { isSpecial } from "@/utils/validate";
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./role-add-or-update";
export default {
mixins: [mixinViewModule],
data () {
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/role/page',
getDataListURL: "/sys/role/page",
getDataListIsPage: true,
deleteURL: '/sys/role',
deleteIsBatch: true
deleteURL: "/sys/role",
deleteIsBatch: true,
},
flag: true,
dataForm: {
name: ''
}
name: "",
},
};
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(this.$t("validate.format", { attr: "不能带特殊字符" }))
);
} else {
console.log("99999");
}
callback();
};
return {
name: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
};
},
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods: {
getCheck() {
if (this.flag) {
this.getDataList();
}
}
},
},
};
</script>
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="username" :label="$t('user.username')">
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
<el-dialog
:visible.sync="visible"
:title="!dataForm.id ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item
prop="username"
:label="$t('user.username')"
>
<el-input
v-model="dataForm.username"
:placeholder="$t('user.username')"
></el-input>
</el-form-item>
<el-form-item prop="deptName" :label="$t('user.deptName')">
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree>
<el-form-item
prop="deptName"
:label="$t('user.deptName')"
>
<ren-dept-tree
v-model="dataForm.deptId"
:placeholder="$t('dept.title')"
:dept-name.sync="dataForm.deptName"
></ren-dept-tree>
</el-form-item>
<el-form-item prop="password" :label="$t('user.password')" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.password" type="password" :placeholder="$t('user.password')"></el-input>
<el-form-item
prop="password"
:label="$t('user.password')"
:class="{ 'is-required': !dataForm.id }"
>
<el-input
v-model="dataForm.password"
type="password"
:placeholder="$t('user.password')"
></el-input>
</el-form-item>
<el-form-item prop="confirmPassword" :label="$t('user.confirmPassword')" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('user.confirmPassword')"></el-input>
<el-form-item
prop="confirmPassword"
:label="$t('user.confirmPassword')"
:class="{ 'is-required': !dataForm.id }"
>
<el-input
v-model="dataForm.confirmPassword"
type="password"
:placeholder="$t('user.confirmPassword')"
></el-input>
</el-form-item>
<el-form-item prop="realName" :label="$t('user.realName')">
<el-input v-model="dataForm.realName" :placeholder="$t('user.realName')"></el-input>
<el-form-item
prop="realName"
:label="$t('user.realName')"
>
<el-input
v-model="dataForm.realName"
:placeholder="$t('user.realName')"
></el-input>
</el-form-item>
<el-form-item prop="gender" :label="$t('user.gender')">
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group>
</el-form-item>
<el-form-item prop="email" :label="$t('user.email')">
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>
<el-form-item
prop="gender"
:label="$t('user.gender')"
>
<!-- <ren-radio-group
v-model="dataForm.gender"
dict-type="gender"
></ren-radio-group> -->
<el-radio-group v-model="dataForm.gender">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="mobile" :label="$t('user.mobile')">
<el-input v-model="dataForm.mobile" :placeholder="$t('user.mobile')"></el-input>
<el-form-item
prop="mobile"
:label="$t('user.mobile')"
>
<el-input
v-model="dataForm.mobile"
:placeholder="$t('user.mobile')"
></el-input>
</el-form-item>
<el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list">
<el-select v-model="dataForm.roleIdList" multiple :placeholder="$t('user.roleIdList')">
<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option>
<el-form-item
prop="roleIdList"
:label="$t('user.roleIdList')"
class="role-list"
>
<el-select
v-model="dataForm.roleIdList"
multiple
:placeholder="$t('user.roleIdList')"
>
<el-option
v-for="role in roleList"
:key="role.id"
:label="role.name"
:value="role.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="status" :label="$t('user.status')" size="mini">
<el-form-item
prop="undertakerNum"
label="承办人代码"
>
<el-input
v-model="dataForm.undertakerNum"
placeholder="承办人代码"
></el-input>
</el-form-item>
<el-form-item
prop="status"
:label="$t('user.status')"
size="mini"
>
<el-radio-group v-model="dataForm.status">
<el-radio :label="0">{{ $t('user.status0') }}</el-radio>
<el-radio :label="1">{{ $t('user.status1') }}</el-radio>
......@@ -39,166 +125,216 @@
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button
type="primary"
@click="dataFormSubmitHandle()"
>{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { isEmail, isMobile } from '@/utils/validate'
import debounce from "lodash/debounce";
import { isEmail, isMobile } from "@/utils/validate";
export default {
data () {
data() {
return {
visible: false,
roleList: [],
roleIdListDefault: [],
dataForm: {
id: '',
username: '',
deptId: '',
deptName: '',
password: '',
confirmPassword: '',
realName: '',
id: "",
username: "",
deptId: "",
deptName: "",
password: "",
confirmPassword: "",
realName: "",
gender: 0,
email: '',
mobile: '',
email: "",
mobile: "",
roleIdList: [],
status: 1
}
}
status: 1,
undertakerNum: "",
},
};
},
computed: {
dataRule () {
var validatePassword = (rule, value, callback) => {
dataRule() {
/* var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
return callback(new Error(this.$t('validate.required')))
return callback(new Error(this.$t("validate.required")));
}
callback()
callback();
}; */
var validatePassword = (rule, value, callback) => {
const reg =
/(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W])(?=.*[\S])^[0-9A-Za-z\S]{8,18}$/g;
if (!reg.test(value)) {
callback(new Error("密码应该为8-18位大小字母、数字、特殊字符组合"));
} else {
callback();
}
};
var validateConfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
return callback(new Error(this.$t('validate.required')))
return callback(new Error(this.$t("validate.required")));
}
if (this.dataForm.password !== value) {
return callback(new Error(this.$t('user.validate.confirmPassword')))
}
callback()
return callback(new Error(this.$t("user.validate.confirmPassword")));
}
callback();
};
var validateEmail = (rule, value, callback) => {
if (value && !isEmail(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.email') })))
}
callback()
return callback(
new Error(
this.$t("validate.format", { attr: this.$t("user.email") })
)
);
}
callback();
};
var validateMobile = (rule, value, callback) => {
if (value && !isMobile(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.mobile') })))
}
callback()
return callback(
new Error(
this.$t("validate.format", { attr: this.$t("user.mobile") })
)
);
}
callback();
};
return {
username: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
deptName: [
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
],
password: [
{ validator: validatePassword, trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
},
],
password: [{ validator: validatePassword, trigger: "blur" }],
confirmPassword: [
{ validator: validateConfirmPassword, trigger: 'blur' }
{ validator: validateConfirmPassword, trigger: "blur" },
],
realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
email: [
{ validator: validateEmail, trigger: 'blur' }
{
required: true,
message: this.$t("validate.required"),
trigger: "blur",
},
],
email: [{ validator: validateEmail, trigger: "blur" }],
mobile: [
{ validator: validateMobile, trigger: 'blur' }
]
}
}
{ required: true, validator: validateMobile, trigger: "blur" },
],
roleIdList: [
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
},
],
};
},
},
methods: {
init () {
this.visible = true
this.dataForm.deptId = ''
init() {
this.visible = true;
this.dataForm.deptId = "";
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.roleIdListDefault = []
Promise.all([
this.getRoleList()
]).then(() => {
this.$refs["dataForm"].resetFields();
this.roleIdListDefault = [];
Promise.all([this.getRoleList()]).then(() => {
if (this.dataForm.id) {
this.getInfo()
this.getInfo();
}
})
})
});
});
},
// 获取角色列表
getRoleList () {
return this.$http.get('/sys/role/list').then(({ data: res }) => {
getRoleList() {
return this.$http
.get("/sys/role/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.roleList = res.data
}).catch(() => {})
this.roleList = res.data;
})
.catch(() => {});
},
// 获取信息
getInfo () {
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => {
getInfo() {
this.$http
.get(`/sys/user/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.dataForm = {
...this.dataForm,
...res.data,
roleIdList: []
}
roleIdList: [],
};
// 角色配置, 区分是否为默认角色
for (var i = 0; i < res.data.roleIdList.length; i++) {
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
this.dataForm.roleIdList.push(res.data.roleIdList[i])
continue
if (
this.roleList.filter(
(item) => item.id === res.data.roleIdList[i]
)[0]
) {
this.dataForm.roleIdList.push(res.data.roleIdList[i]);
continue;
}
this.roleIdListDefault.push(res.data.roleIdList[i])
this.roleIdListDefault.push(res.data.roleIdList[i]);
}
}).catch(() => {})
})
.catch(() => {});
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
dataFormSubmitHandle: debounce(
function () {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false
return false;
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', {
this.$http[!this.dataForm.id ? "post" : "put"]("/sys/user", {
...this.dataForm,
roleIdList: [
...this.dataForm.roleIdList,
...this.roleIdListDefault
]
}).then(({ data: res }) => {
...this.roleIdListDefault,
],
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
return this.$message.error(res.msg);
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
this.visible = false;
this.$emit("refreshDataList");
},
});
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
.catch(() => {});
});
},
1000,
{ leading: true, trailing: false }
),
},
};
</script>
<style lang="scss">
......
<template>
<el-card shadow="never" class="aui-card--fill">
<el-card
shadow="never"
class="aui-card--fill"
>
<div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input>
<el-form
:inline="true"
:model="dataForm"
:rules="dataRule"
@keyup.enter.native="getCheck()"
>
<el-form-item prop="username">
<el-input
v-model="dataForm.username"
:placeholder="$t('user.username')"
clearable
></el-input>
</el-form-item>
<el-form-item>
<!-- <el-form-item>
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select>
</el-form-item>
</el-form-item> -->
<el-form-item>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
<ren-dept-tree
v-model="dataForm.deptId"
:placeholder="$t('dept.title')"
:query="true"
></ren-dept-tree>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="getCheck()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button
v-if="$hasPermission('sys:user:save')"
type="primary"
@click="addOrUpdateHandle()"
>{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button
v-if="$hasPermission('sys:user:delete')"
type="danger"
@click="deleteHandle()"
>{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
<el-button
v-if="$hasPermission('sys:user:export')"
type="info"
@click="exportHandle()"
>{{ $t('export') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-upload
class="upload-demo"
ref="upload"
action=""
:http-request="afterRead"
accept=".pdf,.doc,.docx,.xls,.xlsx"
:file-list="datalist"
>
<el-button type="warning">导入</el-button>
</el-upload>
</el-form-item> -->
<!-- <el-form-item>
<a href="">点击此处下载导入模板</a>
</el-form-item> -->
</el-form>
<el-table
v-loading="dataListLoading"
......@@ -30,28 +74,120 @@
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
style="width: 100%;"
>
<el-table-column
type="selection"
header-align="center"
align="center"
width="50"
></el-table-column>
<el-table-column
prop="deptName"
:label="$t('user.deptName')"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="username"
:label="$t('user.username')"
sortable="custom"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="realName"
:label="$t('user.realName')"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="undertakerNum"
label="承办人代码"
header-align="center"
align="center"
></el-table-column>
<el-table-column
prop="mobile"
:label="$t('user.mobile')"
sortable="custom"
header-align="center"
align="center"
></el-table-column>
<!-- <el-table-column
prop="sort"
:label="$t('user.sort')"
sortable="custom"
header-align="center"
align="center"
></el-table-column> -->
<!-- <el-table-column
prop="email"
:label="$t('user.email')"
header-align="center"
align="center"
></el-table-column> -->
<el-table-column
prop="gender"
:label="$t('user.gender')"
sortable="custom"
header-align="center"
align="center"
>
<template slot-scope="scope">
{{ $getDictLabel("gender", scope.row.gender) }}
<!-- {{ $getDictLabel("gender", scope.row.gender) }} -->
<span>{{genderText(scope.row.gender)}}</span>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
<el-table-column
prop="status"
:label="$t('user.status')"
sortable="custom"
header-align="center"
align="center"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
<el-tag
v-if="scope.row.status === 0"
size="small"
type="danger"
>{{ $t('user.status0') }}</el-tag>
<el-tag
v-else
size="small"
type="success"
>{{ $t('user.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<el-table-column
prop="createDate"
:label="$t('user.createDate')"
sortable="custom"
header-align="center"
align="center"
width="180"
></el-table-column>
<el-table-column
:label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150"
>
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button
v-if="$hasPermission('sys:user:update')"
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>{{ $t('update') }}</el-button>
<el-button
v-if="$hasPermission('sys:user:delete')"
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -62,37 +198,119 @@
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './user-add-or-update'
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./user-add-or-update";
import { isSpecial2 } from "@/utils/validate";
export default {
mixins: [mixinViewModule],
data () {
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/user/page',
getDataListURL: "/sys/user/page",
getDataListIsPage: true,
deleteURL: '/sys/user',
deleteURL: "/sys/user",
deleteIsBatch: true,
exportURL: '/sys/user/export'
exportURL: "/sys/user/export",
},
datalist: [],
flag: true,
dataForm: {
username: '',
deptId: '',
gender: ''
}
username: "",
deptId: "",
gender: "",
},
};
},
computed: {
dataRule() {
var validateCaseName = (rule, value, callback) => {
this.flag = true;
/* this.dataForm.caseName = this.dataForm.caseName.replace(
/[^u4e00-u9fa5w]/g,
""
); */
if (value && !isSpecial2(value)) {
console.log("88888");
this.flag = false;
return callback(
new Error(
this.$t("validate.format", {
attr: "不能带特殊字符,且长度不能超过10",
})
)
);
} else {
console.log("99999");
}
callback();
};
return {
username: [
{ required: true, validator: validateCaseName, trigger: "blur" },
],
};
},
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods: {
getCheck() {
if (this.flag) {
this.getDataList();
}
}
},
genderText(gender) {
return ["男", "女"][gender];
},
//上传附件
afterRead(file) {
let data = new FormData();
data.append("file", file.file);
console.log(file);
const loading = this.$loading({
lock: true,
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
setTimeout(() => {
loading.close();
}, 2000);
// console.log("file", data);
/* getfileUploader(data).then((res) => {
if (res.data.code == 0) {
this.datalist.push({
docId: res.data.data.docId,
name: res.data.data.fileName,
filePath: res.data.data.url,
createDate: currentDate,
});
// console.log("上传完的dataform", this.dataForm);
}
this.dataForm.woWorkorderDocumentDTOList = this.datalist;
}); */
},
},
};
</script>
<style lang="less" scoped>
/deep/.el-upload-list {
display: none;
}
</style>
......@@ -2,12 +2,23 @@
<div class="aui-wrapper aui-page__login">
<div class="aui-content__wrapper">
<main class="aui-content">
<div class="login-header">
<!-- <h2 class="login-brand">{{ $t('brand.lg') }}</h2> -->
<div
class="login-header"
style="display:flex"
>
<img
src="../../assets/img/logo.png"
src="../../assets/img/logo_icon.png"
alt=""
style="margin-right:10px;width:42px;height:47px; vertical-align: middle;"
>
<h2
style="font-size:32px;line-height:50px;font-weight:700"
class="login-brand title-head"
>{{ $t('brand.lg') }}</h2>
<!-- <img
src="../../assets/img/logo.png"
alt=""
> -->
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>
......@@ -177,6 +188,9 @@ export default {
if (!valid) {
return false;
}
let Base64 = require("js-base64").Base64;
// this.dataForm.password = this.$md5(this.dataForm.password);
this.dataForm.password = Base64.encode(this.dataForm.password);
this.$http
.post("/login", this.dataForm)
.then(({ data: res }) => {
......@@ -196,3 +210,8 @@ export default {
},
};
</script>
<style scoped>
.title-head {
vertical-align: middle;
}
</style>
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