提交 ad0972e3 authored 作者: 龙菲's avatar 龙菲

完成首页展览及文物数量统计页面

上级 b945d895
......@@ -39,3 +39,13 @@ export function deleteCultralRelic(data) {
data
})
}
// 获取文物数量统计
export function getCulturalRelicStatistic(params) {
return request({
url: '/bizStatistic/getCulturalRelicStatistic',
method: 'get',
params
})
}
......@@ -39,3 +39,12 @@ export function deleteDisplay(data) {
data
})
}
// 获取展览数量统计
export function getExhibitionStatistic(params) {
return request({
url: '/bizStatistic/getExhibitionStatistic',
method: 'get',
params
})
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ export function login(data) {
data
})
}
export function getInfo(token) {
return request({
url: '/sys/user',
......@@ -68,6 +69,24 @@ export function getUserList(data) {
}
// 增加用户
export function addUser(data) {
return request({
url: 'sys/user',
method: 'post',
data
})
}
// 修改用户信息
export function upadateUser(data) {
return request({
url: 'sys/user',
method: 'put',
data
})
}
// 以用户行为统计排序分页查询资源
export function getListByPageSort(data) {
return request({
......
......@@ -42,3 +42,11 @@ export function getVirtualListById(data) {
})
}
// 获取展览数量统计
export function getVirtualStatistic(params) {
return request({
url: '/bizStatistic/getVirtualStatistic',
method: 'get',
params
})
}
\ No newline at end of file
<template>
<div :id="id" :class="className" :style="{ height: height, width: width }" />
</template>
<script>
// import tdTheme from './theme.json' // 引入默认主题
<div :id="id" :class="className" :style="{ height: height, width: width }" />
</template>
<script>
// import tdTheme from './theme.json' // 引入默认主题
import resizeMixins from "@/utils/resizeMixin";
// import '../map/fujian.js'
// import '../map/fujian.js'
export default {
name: 'echart',
mixins: [resizeMixins],
......@@ -29,38 +29,44 @@
},
options: {
type: Object,
default: ()=>({})
default: () => ({})
}
},
data () {
data() {
return {
chart: null
}
},
watch: {
options: {
handler (options) {
handler(options) {
// 设置true清空echart缓存
this.chart.setOption(options, true)
},
deep: true
}
},
mounted () {
// this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
mounted() {
// this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
this.initChart();
},
methods: {
initChart () {
initChart() {
// 初始化echart
this.dispose()
this.chart = this.$echarts.init(this.$el)
this.$emit('myCharts', this.chart) // 把实例丢出来
this.chart.setOption(this.options, true)
},
// 销毁
dispose() {
if (this.chart) {
this.chart.dispose()
}
}
}
}
</script>
<style>
</style>
\ No newline at end of file
</script>
<style>
</style>
\ No newline at end of file
......@@ -240,7 +240,7 @@
<div class="dialog-footer">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading"
>确定<i class="el-icon-right" style="margin-left: 5px"></i
>确定<i class="el-icon-s-promotion" style="margin-left: 5px"></i
></el-button>
</div>
</div>
......
......@@ -223,7 +223,7 @@
<div class="dialog-footer">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="handleSubmit" :disabled="loading"
>发布<i class="el-icon-right" style="margin-left: 5px"></i
>发布<i class="el-icon-s-promotion" style="margin-left: 5px"></i
></el-button>
</div>
</el-dialog>
......
<!-- -->
<template>
<div style="height: 400px;width: 100%;">
<Echart ref="Echart" :options="options" height='100%' width="100%" v-if="options"></Echart>
</div>
</template>
<script>
import Echart from '@/components/Echarts' //引入echatrs组件
export default {
name: 'CombinationChart',
components: {
Echart
},
props: {
pieData: {
type: Array,
default: () => []///[{name:'name',value:0}]
}
},
data() {
return {
options: null
}
},
watch: {
pieData: function () {
this.getOptions()
}
},
mounted() {
setTimeout(() => {
this.getOptions()
}, 300);
},
methods: {
getOptions() {
var pie_color = ['#32D790', '#F4B561', '#7080DB', '#DF7A90',
'#3CC4EF', '#EF7F3C', '#EF3C81', '#0DBF8C', '#2F73C0', '#C55E18', '#C899FF', '#C6D727',
'#FF688F', '#87A0DC', '#00D9F7', '#A24EED'
];
var legendList = [];
// var pieData = [{
// name: 'A 农、林、牧、渔业',
// value: 290
// }, {
// name: 'G 交通运输、仓储和邮政业',
// value: 450
// }, {
// name: 'H 住宿和餐饮业',
// value: 120
// }, {
// name: 'I 信息传输、软件和信息技术服务业',
// value: 288
// },];
let pieData = this.pieData || []
for (var i = 0; i < pieData.length; i++) {
if (pieData[i]) {
legendList.push(pieData[i].name);
}
}
this.options = {
color: pie_color,
title: {
show: false,
text: '',
textStyle: {
color: '#333333',
fontSize: 16,
},
},
tooltip:{},
grid: {
show: false,
left: '2%',
right: '50%',
bottom: 0,
top: '2%',
containLabel: true
},
legend: {
bottom: '4%',
right: '10%',
orient: 'vertical',
width: 540,
height: 240,
padding: [14, 20],
backgroundColor: 'rgba(236,246,255,0.30)',
borderWidth: 1,
borderColor: '#E7F2FB',
borderRadius: 4,
icon: 'circle',
itemWidth: 8,
itemHeight: 8,
textStyle: {
color: '#333333',
fontSize: 12,
},
data: legendList,
},
xAxis: {
type: 'value',
gridIndex: 0,
name: '个',
nameTextStyle: {
color: '#9B9B9B',
fontSize: 14
},
axisLabel: {
color: '#727272',
fontSize: 14,
},
axisLine: {
show: true,
lineStyle: {
color: '#333333',
opacity: 0.35,
}
},
axisTick: {
show: true,
inside: true,
lineStyle: {
color: '#333333',
opacity: 0.35,
}
},
splitLine: {
show: false
}
},
yAxis: {
type: 'category',
gridIndex: 0,
data: legendList,
inverse: true,
axisLabel: {
color: '#727272',
fontSize: 14,
},
axisLine: {
show: true,
lineStyle: {
color: '#333333',
opacity: 0.35,
}
},
axisTick: {
show: false
},
splitLine: {
show: false
}
},
series: [{
name: '展览数量',
type: 'bar',
xAxisIndex: 0,
yAxisIndex: 0,
data: pieData,
label: {
show: true,
position: 'right',
color: '#4A4A4A',
fontSize: 14,
},
barWidth: 20,
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x1: 0,
y1: 1,
colorStops: [{
offset: 0,
color: '#FF9A91'
}, {
offset: 1,
color: '#F8B44F'
}],
global: false
},
barBorderRadius: [0, 10, 10, 0]
}
}, {
type: 'pie',
radius: ['10%', '36%'],
center: ['75%', '30%'],
data: pieData,
hoverAnimation: false,
label: {
show: true,
position: 'outside',
formatter: '{b}:{d}%',
},
zlevel: 2
}, {
// name: '外圈',
type: 'pie',
radius: ['36%', '37.5%'],
center: ['75%', '30%'],
hoverAnimation: false,
itemStyle: {
color: 'rgb(21 132 214 / 0.1)',
},
emphasis: {
itemStyle: {
color: 'rgb(21 132 214 / 0.1)'
}
},
labelLine: {
show: false
},
data: [{
value: 1
}],
zlevel: 1
}, {
// name: '内圈',
type: 'pie',
radius: ['8.5%', '10%'],
center: ['75%', '30%'],
hoverAnimation: false,
itemStyle: {
color: 'rgb(21 132 214 / 0.1)',
},
emphasis: {
itemStyle: {
color: 'rgb(21 132 214 / 0.1)'
}
},
labelLine: {
show: false
},
data: [{
value: 1
}],
zlevel: 1
}]
}
}
},
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div class="custom-title">
<div class="divider"></div>
<div class="title">{{ title }}</div>
</div>
</template>
<script>
export default {
name: "CustomTitle",
props: {
title: {
type: String,
default: "",
},
},
};
</script>
<style lang="scss" scoped>
.custom-title {
display: flex;
align-items: center;
.divider {
width: 4px;
height: 18px;
background-color: #409eff;
margin-right: 8px;
}
.title {
font-size: 16px;
font-weight: bold;
color: #333;
}
}
</style>
\ No newline at end of file
差异被折叠。
......@@ -73,7 +73,7 @@
<div class="dialog-footer">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="handleSubmit"
>确定<i class="el-icon-right" style="margin-left: 5px"></i
>确定<i class="el-icon-s-promotion" style="margin-left: 5px"></i
></el-button>
</div>
</el-dialog>
......
......@@ -92,7 +92,7 @@
<div class="dialog-footer">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="handleSubmit"
>确定<i class="el-icon-right" style="margin-left: 5px"></i
>确定<i class="el-icon-s-promotion" style="margin-left: 5px"></i
></el-button>
</div>
</el-dialog>
......
......@@ -73,11 +73,11 @@
<div class="dialog-footer">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="handleSubmit"
>确定<i class="el-icon-right" style="margin-left: 5px"></i
>确定<i class="el-icon-s-promotion" style="margin-left: 5px"></i
></el-button>
</div>
</el-dialog>
</template>
</template>
<script>
import { addLiterature, editLiterature } from "@/api/literature";
......@@ -159,18 +159,11 @@ export default {
},
async handleSubmit() {
// debugger
// console.log(this.dialogForm);
// return
let params = JSON.parse(JSON.stringify(this.dialogForm));
// 回填文件
let file = this.$refs.pdf.getFiles();
let formData = new FormData();
// console.log("file", file);
// return
// debugger;
if (file[0].status == "ready") {
// debugger;
formData.append("files", file[0].raw);
let upLoadRes = await uploadFile(formData);
if (upLoadRes.code == 0) {
......
......@@ -49,18 +49,16 @@
<el-form-item label="所属部门" :label-width="formLabelWidth">
<el-cascader
style="width: 100%"
v-model="dialogForm.deptId"
v-model="dialogForm.deptNo"
:options="orgTreeData"
:props="optionProps"
placeholder="请选择所属部门"
:key="deptId"
>
</el-cascader>
</el-form-item>
<el-form-item label="状态" :label-width="formLabelWidth">
<el-form-item label="是否启用" :label-width="formLabelWidth">
<el-switch v-model="status"> </el-switch>
</el-form-item>
</el-form>
</div>
<div class="dialog-footer">
......@@ -73,7 +71,7 @@
</template>
<script>
import { addLiterature, editLiterature } from "@/api/literature";
import { addUser, upadateUser } from "@/api/user";
import ManualUploader from "@/components/Uploader/ManualUploader.vue";
import { mapGetters } from "vuex";
import { uploadFile } from "@/utils/file";
......@@ -91,18 +89,18 @@ export default {
type: Object,
default: () => ({}),
},
orgTreeData:{
type: Object,
orgTreeData: {
type: Array,
default: () => [],
}
},
},
computed: {
...mapGetters(["userInfo"]),
title() {
if (this.dialogForm.literatureId) {
return "修改文献";
if (this.dialogForm.id) {
return "修改用户信息";
} else {
return "添加文献";
return "添加用户";
}
},
},
......@@ -110,16 +108,11 @@ export default {
form: {
handler: function (value) {
let that = this;
that.dialogForm = JSON.parse(JSON.stringify(value));
// 编辑状态
if (that.dialogForm.literatureId) {
if (that.dialogForm.id) {
// 回填状态
that.status = Boolean(Number(that.dialogForm.status));
// 回填文件
if (that.dialogForm.files) {
that.files = that.dialogForm.files;
}
}
},
immediate: true,
......@@ -132,14 +125,108 @@ export default {
deep: true,
immediate: true,
},
// orgTreeData(value){
// console.log(1111,value);
// }
},
data() {
var validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
var pattern =
/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{8,30}$/;
if (!pattern.test(value)) {
callback(
new Error(
"密码长度至少8位,至少含数字,大写字母,小写字母,特殊符其中三种"
)
);
}
callback();
}
};
var validateUserName = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入账号"));
} else {
var pattern = /^[0-9a-zA-Z|_]{4,20}$/g;
if (!pattern.test(value)) {
callback(new Error("账号长度4-20个字符,只能包括字母、数字、下划线"));
} else {
const formData = new FormData();
formData.append("userName", value);
checkUserName(formData)
.then((res) => {
if (res.code == "0") {
callback();
} else {
callback(res.msg);
}
})
.catch((err) => {
console.error(err);
});
}
}
};
var validatePhone = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入手机号"));
} else {
var pattern = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
if (!pattern.test(value)) {
callback(new Error("请输入合法手机号/电话号"));
} else {
const formData = new FormData();
formData.append("phone", value);
checkPhone(formData)
.then((res) => {
console.log(res);
if (res.code == "0") {
callback();
} else {
callback(res.msg);
}
})
.catch((err) => {
console.error(err);
});
}
}
};
return {
dialogForm: {},
formLabelWidth: "100px",
status: false,
files: [], //文献文件
dialogVisible: false,
optionProps: {
value: "id",
label: "label",
children: "children",
checkStrictly: true, //单选选择任意一级选项
},
rules: {
username: [
{ validator: validateUserName, trigger: "blur", required: true },
],
phone: [{ validator: validatePhone, trigger: "blur", required: true }],
nickName: [
{ required: true, message: "请输入昵称", trigger: "blur" },
{
pattern: /^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/,
message:
"昵称长度2~10位,只能包含中文、英文大小写、数字及下划线,不能以下划线开头或结尾",
trigger: "blur",
},
],
password: [
{ validator: validatePass, trigger: "blur", required: true },
],
},
};
},
methods: {
......@@ -157,30 +244,18 @@ export default {
async handleSubmit() {
let params = JSON.parse(JSON.stringify(this.dialogForm));
// 回填文件
let file = this.$refs.pdf.getFiles();
let formData = new FormData();
if (file[0].status == "ready") {
formData.append("files", file[0].raw);
let upLoadRes = await uploadFile(formData);
if (upLoadRes.code == 0) {
params.pdfFile = upLoadRes.data[0].fileId;
} else {
this.$message.error("上传失败!:" + upLoadRes.data.msg);
}
} else if (file[0].status == "success") {
params.pdfFile = file[0].fileId;
}
// 修改状态
params.status = this.status ? 1 : 0;
if (params.literatureId) {
let res = await editLiterature(params);
console.log(22, params);
return;
if (params.id) {
let res = await upadateUser(params);
if (res.code == 0) {
this.$message.success("修改成功!");
this.reload();
}
} else {
let res = await addLiterature(params);
let res = await addUser(params);
if (res.code == 0) {
this.$message.success("添加成功!");
this.reload();
......
export const title = [{
prop: "username",
label: "账号",
columnAlign: 'center',
},
{
prop: "nickName",
label: "昵称",
columnAlign: 'center',
},
{
prop: "deptName",
label: "所属部门",
columnAlign: 'center',
},
{
prop: "phone",
label: "手机号",
columnAlign: 'center',
},
{
prop: "status",
label: "状态",
columnAlign: 'center',
isStatus: true,
width: 100
},
prop: "username",
label: "账号",
columnAlign: 'center',
},
{
prop: "nickName",
label: "昵称",
columnAlign: 'center',
},
{
prop: "realName",
label: "真实姓名",
columnAlign: 'center',
},
// {
// prop: "sex",
// label: "性别",
// columnAlign: 'center',
// },
{
prop: "deptName",
label: "所属部门",
columnAlign: 'center',
showOverFlowToolTip: true
},
{
prop: "phone",
label: "手机号",
columnAlign: 'center',
},
{
prop: "status",
label: "状态",
columnAlign: 'center',
isStatus: true,
},
]
export const operates = {
operate: true,
label: "操作",
width: "260px",
minwidth: "220px",
width: "190px",
titleAlign: "center",
columnAlign: "center",
}
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论