master
xy 2 years ago
parent bbf3fcb915
commit 58840df292

@ -5,14 +5,14 @@
<template #reference>
<el-button type="primary" class="dropdown-button" @click="popoverShow = !popoverShow">
<div class="btn-slot">
<i class="el-icon-search el-icon--left"></i><p class="dropdown-button__text">{{selectLabel}}</p><i class="el-icon-arrow-down el-icon--right"></i>
<i class="el-icon-search el-icon--left"></i><p class="dropdown-button__text">{{selected || '搜索内部资料'}}</p><i class="el-icon-arrow-down el-icon--right"></i>
</div>
</el-button>
</template>
<template>
<div class="dropdown-box">
<div class="left">
<div class="left-item" v-for="i in [{label:'制度文件',value:5},{label:'工作流程',value:1},{label:'岗位工作及标准',value:3},{label:'表单中心',value:2},{label:'部门工作职责',value:4}]" @click="selectLabel = i.label,selectValue = i.value">
<div class="left-item" v-for="i in typeList" @click="selectLabel = i.label,$store.commit('reception/SET_SELECTED',{ key: 'leixing',value: i.value })">
{{ i.label }}
</div>
</div>
@ -46,7 +46,7 @@
</template>
</el-dropdown>
<div class="search__bottom--input">
<el-input placeholder="请输入内容" size="" v-model="inputValue" clearable>
<el-input placeholder="请输入内容" size="" :value="keyword" clearable @input="e => inputValue = e">
<template #append>
<el-button style="background: #247EC3;color: #fff;border: none;border-bottom-left-radius: 0;border-top-left-radius: 0;" @click="search"> </el-button>
</template>
@ -81,18 +81,27 @@ export default {
data() {
return {
popoverShow: false,
selectLabel: '搜索内部资料',
selectLabel: '',
selectValue: '',
inputValue: '',
typeList: [{label:'制度文件',value:5},{label:'工作流程',value:1},{label:'岗位工作及标准',value:3},{label:'表单中心',value:2},{label:'部门工作职责',value:4}]
}
},
methods: {
search () {
this.$store.commit('reception/SET_SELECTED',{ key: 'keyword', value: this.inputValue })
this.$router.push(`/index/list${this.selectValue == 2 ? '2' : '1'}?leixing=${this.selectValue}&keyword=${this.inputValue}&t=${new Date().getTime()}`)
this.$router.push(`/index/list1?${this.$store.getters.select}`)
}
},
computed: {
selected () {
return this.selectLabel ? this.selectLabel : (this.typeList.find(i => i.value == this.$route.query.leixing)?.label || '搜索内部资料')
},
keyword () {
return this.inputValue ? this.inputValue : (this.$route.query.keyword || '')
}
},
computed: {},
mounted() {
this.popoverShow = true
}

@ -206,9 +206,8 @@ export default {
initLoad() {
let clientHeight = document.documentElement.clientHeight;
let lxheader = document
.querySelector(".v-header")
.getBoundingClientRect();
let lxHeader_height = lxheader.height + 25; //
.querySelector(".v-header")?.getBoundingClientRect();
let lxHeader_height = lxheader?.height + 25; //
let paginationHeight = 37; //
let topHeight = 50; //
this.tableHeight =

@ -62,6 +62,7 @@ export const constantRoutes = [
children: [
{
path: 'home',
name: 'Home',
component: () => import('@/views/reception/home'),
meta: { title: '内部质量保证体系资料汇编'}
},
@ -79,11 +80,6 @@ export const constantRoutes = [
path: 'list1',
component: () => import('@/views/reception/list1'),
meta: { title: '内部质量保证体系资料汇编'}
},
{
path: 'list2',
component: () => import('@/views/reception/list2'),
meta: { title: '内部质量保证体系资料汇编'}
}
],
hidden: true

@ -5,6 +5,13 @@ const getters = {
avatar: state => state.user.avatar,
name: state => state.user.name,
roles: state => state.user.roles,
permission_routes: state => state.permission.routes
permission_routes: state => state.permission.routes,
select: state => {
let res = ''
for(let key in state.reception.select) {
res += `${key}=${state.reception.select[key]}&`
}
return `${res}&t=${new Date().getTime()}`
}
}
export default getters

@ -6,6 +6,7 @@ import permission from './modules/permission'
import settings from './modules/settings'
import user from './modules/user'
import form from './modules/form'
import reception from './modules/reception'
Vue.use(Vuex)
@ -15,7 +16,8 @@ const store = new Vuex.Store({
permission,
settings,
user,
form
form,
reception
},
getters
})

@ -0,0 +1,33 @@
const state = {
select: {
tag_id: '',
dept_id: '',
keyword: '',
leixing: ''
}
}
const mutations = {
SET_SELECTED: (state, { key, value, refresh = false }) => {
if (refresh) {
for(let key in state.select) {
state.select[key] = ''
}
}
if (state.select.hasOwnProperty(key)) {
state.select[key] = value
}
}
}
const actions = {
}
export default {
namespaced: true,
state,
mutations,
actions
}

@ -93,6 +93,9 @@ export default {
},
change(e) {
this.update();
},
update () {
let tagObjs = [];
this.value.forEach((i) => {
let tag = deepCopy(this.tags.find((tag) => tag.id === i));
@ -103,7 +106,7 @@ export default {
});
});
this.$emit("update", tagObjs);
},
}
},
computed: {
disabled() {

@ -1,5 +1,5 @@
<script>
import { save, show, index } from "@/api/system/baseForm";
import { save, show, index, destroy } from "@/api/system/baseForm";
import { getparameter } from "@/api/system/dictionary";
import { domMap } from "@/const/inputType";
import { addPropsMap } from "@/const/addProps";
@ -20,7 +20,7 @@ export default {
top: '8vh',
title: "新增",
visible: this.dialogVisible,
width: "700px",
width: "750px",
},
on: {
"update:visible": (val) => {
@ -204,6 +204,7 @@ export default {
type: "add",
dialogVisible: false,
form: {},
originalForm: {},
rules: {},
file: {},
};
@ -229,7 +230,7 @@ export default {
h("el-option", {
props: {
label: i.key || i.value || i.name || i.no || i.mingcheng || i.id,
value: info._relations ? i[info._relations.foreign_key] : i.value,
value: i.id,
},
})
)
@ -346,29 +347,36 @@ export default {
async getDetail() {
const res = await show({ id: this.id, table_name: this.tableName });
this.$integrateData(this.form, res);
this.form = Object.assign({}, this.form);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === 'files')) {
res[i._relations.link_with_name] ? (
this.file[i.field] = res[i._relations.link_with_name] instanceof Array ? res[i._relations.link_with_name].map(i => {
return {
name: i?.original_name,
name: i?.name,
url: i?.url,
response: i
}
}) : [{
name: res[i._relations.link_with_name]?.original_name,
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name]
}]
) : this.file[i.field] = []
}
if (i.field === 'shenhebumen') {
this.form['shenhebumen'] = res[i._relations.link_with_name]?.dept_id
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res)
});
console.log('11',this.form)
},
submit() {
let promiseAll = []
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
@ -396,7 +404,22 @@ export default {
if (validate) {
let copyForm = deepCopy(this.form)
this.formInfo.forEach((info) => {
if (info.field === 'biaoqian') return
if (info._relations?.link_relation === 'newHasMany' || info._relations?.link_relation === 'hasMany') {
if (this.originalForm[info._relations.link_with_name]) {
this.originalForm[info._relations.link_with_name].map(i => {
promiseAll.push(destroy({
id: i.id,
table_name: info._relations.link_table_name
}))
})
}
}
if (info.field === 'biaoqian') {
copyForm[info._relations.link_with_name].forEach(i => delete i.id)
delete copyForm[info.field]
return
}
if (copyForm[info._relations?.link_with_name]?.length > 0) {
delete copyForm[info.field]
}
@ -433,14 +456,17 @@ export default {
}
];
} else {
let copyRelation = info._params.find(param => param[info._relations?.foreign_key] === copyForm[info.field])
delete copyRelation.id
copyForm[info._relations.link_with_name] = [
{
[info._relations.foreign_key]: copyForm[info.field],
...copyRelation,
}
]
let copyRelation = deepCopy(info._params.find(param => param.id == this.form[info.field]))
if (copyRelation) {
delete copyRelation.id
copyForm[info._relations.link_with_name] = [
{
id: this.form[info._relations?.link_with_name]?.id,
[info.field === 'shenhebumen' ? 'dept_id' : info._relations.foreign_key]: this.form[info.field],
...copyRelation,
}
]
}
}
delete copyForm[info.field]
@ -460,7 +486,8 @@ export default {
// }
// }
});
save(Object.assign(copyForm, { table_name: this.tableName })).then(
promiseAll.push(save(Object.assign(copyForm, { table_name: this.tableName })))
Promise.all(promiseAll).then(
(res) => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,

@ -150,6 +150,7 @@ export default {
})
return
}
this.detail.id_material_shenhebumen_depts_material_id_relation = [this.detail.id_material_shenhebumen_depts_material_id_relation]
save(Object.assign({ table_name: this.tableName },this.detail)).then(res => {
this.$message({
type: 'success',

@ -0,0 +1,571 @@
<script>
import { save, show, index, destroy } from "@/api/system/baseForm";
import { getparameter } from "@/api/system/dictionary";
import { domMap } from "@/const/inputType";
import { addPropsMap } from "@/const/addProps";
import {deepCopy} from "@/utils";
export default {
props: {
formInfo: {
type: Array,
default: () => [],
},
tableName: {
type: String,
default: 'materials'
},
},
render(h) {
return h(
"el-dialog",
{
props: {
top: '7.5vh',
title: "新增表单文件",
visible: this.dialogVisible,
width: "850px",
},
on: {
"update:visible": (val) => {
this.dialogVisible = val;
},
},
},
[
h('el-scrollbar', {
style: {
'height': '54vh'
}
}, [h(
"el-form",
{
ref: "elForm",
style: {
'padding-right': '12px'
},
props: {
model: this.form,
labelWidth: "80px",
rules: this.rules,
labelPosition: "right",
size: "small"
},
},
(() => {
let dom = [];
this.formInfo.filter(i => i.form_show).forEach((i, index) => {
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${i.field}`,
style: {
width: "100%",
},
props: {
label: i.name,
prop: i.field,
required:
i.validation instanceof Array
? !!i.validation.find((i) => i === "required")
: false,
},
},
this.$scopedSlots[i.field]
? this.$scopedSlots[i.field]({ fieldInfo: i, form: this.form, file: this.file })
: [
h(
domMap.get(i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
props: {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: this.form[i.field],
},
attrs: {
placeholder: i.help || `请填写${i.name}`,
},
on: {
[this.getEventType(i.edit_input)]: (e) => {
if (i.field) {
this.form[i.field] = e;
this.form = Object.assign({}, this.form);
}
},
},
scopedSlots:
i.edit_input === "file" ||
i.edit_input === "files"
? {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
class: {
"el-icon-circle-check":
file.status === "success",
"el-icon-loading":
file.status === "uploading",
},
style: {
color:
file.status === "success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
},
class: {
"uploaded-a":
file.status === "success",
},
style: {
'padding': '0 4px'
},
},
file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
});
return dom;
})()
)]),
h("template", { slot: "footer" }, [
h(
"el-button",
{
on: {
click: () => (this.dialogVisible = false),
},
},
"取 消"
),
h(
"el-button",
{
props: {
type: "warning",
plain: true,
},
on: {
click: () => this.init(),
},
},
"重 置"
),
h(
"el-button",
{
props: {
type: "primary",
},
on: {
click: this.submit,
},
},
"确 定"
),
]),
]
);
},
data() {
return {
id: "",
type: "add",
dialogVisible: false,
form: {},
originalForm: {},
rules: {},
file: {},
};
},
methods: {
fileRemoveHandler(file, field) {
this.file[field] = this.file[field].filter((item) => item !== file);
this.file = Object.assign({}, this.file);
},
//on
getEventType(info) {
if (info === "checkbox") {
return "change";
}
return "input";
},
//
optionsRender(h, info) {
if (info.edit_input === "checkbox" || info.edit_input === "radio") {
return info._params && info._params instanceof Array
? info._params.map((i) =>
h("el-option", {
props: {
label: i.key || i.value || i.name || i.no || i.mingcheng || i.id,
value: i.id,
},
})
)
: [];
}
if (info.edit_input === "file" || info.edit_input === "files") {
return [
h(
"el-button",
{
slot: "trigger",
props: {
size: "small",
type: "primary",
},
},
"选取文件"
),
h(
"el-button",
{
style: {
"margin-left": "10px",
},
props: {
size: "small",
type: "success",
},
on: {
["click"]: (e) => {
this.$refs[`elEdit_${info.field}`].submit();
},
},
},
"上传到服务器"
),
h(
"div",
{
class: "el-upload__tip",
slot: "tip",
},
"文件不超过500kb"
),
];
}
},
extraProps(info) {
let props = {};
if (info.edit_input === "file" || info.edit_input === "files") {
props.fileList = this.file[info.field];
props.beforeUpload = (file) => {
if (file.size / 1000 > 500) {
this.$message({
type: "warning",
message: "上传图片大小超过500kb",
});
return false;
}
};
props.onSuccess = (response, file, fileList) => {
this.file[info.field] = fileList;
};
props.onRemove = (file, fileList) => {
this.file[info.field] = fileList;
};
props.onError = (err, file, fileList) => {
this.file[info.field] = fileList;
this.$message({
type: "warning",
message: err,
});
};
}
return props;
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["elForm"].clearValidate();
},
show() {
this.dialogVisible = true;
},
hidden() {
this.dialogVisible = false;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
async getDetail() {
const res = await show({ id: this.id, table_name: this.tableName });
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === 'files')) {
res[i._relations.link_with_name] ? (
this.file[i.field] = res[i._relations.link_with_name] instanceof Array ? res[i._relations.link_with_name].map(i => {
return {
name: i?.name,
url: i?.url,
response: i
}
}) : [{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name]
}]
) : this.file[i.field] = []
}
if (i.field === 'shenhebumen') {
this.form['shenhebumen'] = res[i._relations.link_with_name]?.dept_id
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res)
});
console.log('11',this.form)
},
submit() {
let promiseAll = []
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
//TODO:
if (/^\/manage/.test(this.$route.path)) {
this.form['zhuangtai'] = 0
}
if (this.tableName === 'materials') {
this.form['leixing'] = 2
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.$refs["elForm"].validate((validate) => {
if (validate) {
let copyForm = deepCopy(this.form)
this.formInfo.forEach((info) => {
if (info._relations?.link_relation === 'newHasMany' || info._relations?.link_relation === 'hasMany') {
if (this.originalForm[info._relations.link_with_name]) {
this.originalForm[info._relations.link_with_name].map(i => {
promiseAll.push(destroy({
id: i.id,
table_name: info._relations.link_table_name
}))
})
}
}
if (info.field === 'biaoqian') {
copyForm[info._relations.link_with_name].forEach(i => delete i.id)
delete copyForm[info.field]
return
}
if (copyForm[info._relations?.link_with_name]?.length > 0) {
delete copyForm[info.field]
}
if (info._relations?.link_relation === 'newHasMany' || info._relations?.link_relation === 'hasMany') {
if (info.edit_input === 'files') {
copyForm[info._relations.link_with_name] = this.file[info.field]?.map(i => {
let copyRelation = i?.response ? deepCopy(i?.response) : ''
delete copyRelation.id
return {
upload_id: i?.response?.id,
...copyRelation
}
});
} else {
copyForm[info._relations.link_with_name] = copyForm[info.field]?.map( i => {
let copyRelation = info._params.find(param => param[info._relations?.foreign_key] === i) ? deepCopy(info._params.find(param => param[info._relations?.foreign_key] === i)) : ''
delete copyRelation.id
return {
[info._relations.foreign_key]: i,
...copyRelation
}
})
}
delete copyForm[info.field]
}
if (info._relations?.link_relation === 'newHasOne' || info._relations?.link_relation === 'hasOne') {
if (info.edit_input === 'file') {
copyForm[info._relations.link_with_name] = [
{
upload_id: this.file[info.field]?.response?.id,
...this.file[info.field]
}
];
} else {
let copyRelation = deepCopy(info._params.find(param => param.id == this.form[info.field]))
if (copyRelation) {
delete copyRelation.id
copyForm[info._relations.link_with_name] = [
{
id: this.form[info._relations?.link_with_name]?.id,
[info.field === 'shenhebumen' ? 'dept_id' : info._relations.foreign_key]: this.form[info.field],
...copyRelation,
}
]
}
}
delete copyForm[info.field]
}
if (!copyForm[info._relations?.link_with_name]) {
delete copyForm[info._relations?.link_with_name]
}
// if (info._relations?.link_with_name) {
// if (info.edit_input === "files" || info.edit_input === "file") {
// this.form[info._relations.link_with_name] = this.file[info.field].map(i => i?.response);
// delete this.form[info.field]
// } else {
// this.form[info._relations.link_with_name] = this.form[info.field] instanceof Array ? this.form[info.field].map(i => {
// return info._params.find(param => i === param[info._relations.foreign_key])
// }) : [info._params.find(param => this.form[info.field] === param[info._relations.foreign_key])]
// delete this.form[info.field]
// }
// }
});
promiseAll.push(save(Object.assign(copyForm, { table_name: this.tableName })))
Promise.all(promiseAll).then(
(res) => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
}
);
}
});
},
},
computed: {},
watch: {
formInfo: {
handler: function (newVal) {
this.form = {};
this.rules = {};
this.file = {};
newVal.forEach((i) => {
if (i.field) {
this.form[i.field] = "";
if (
i.validation instanceof Array &&
i.validation.length > 0 &&
!!i.validation.find((i) => i === "required")
) {
this.rules[i.field] = [
{ required: true, message: `请填写${i.name}` },
];
}
if (i.edit_input === "files") {
this.form[i.field] = [];
}
if (i.edit_input === "files" || i.edit_input === "file") {
this.file[i.field] = [];
}
if (i.edit_input === "checkbox") {
this.form[i.field] = [];
}
if (i._relations) {
this.form[i._relations?.link_with_name] = []
}
}
});
},
//immediate: true,
},
dialogVisible(val) {
if (val) {
if (this.type === "editor") {
this.$nextTick(() => this.getDetail());
}
} else {
this.id = "";
this.type = "";
this.init();
this.$refs["elForm"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
.uploaded-a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
.uploaded-a:hover {
color: red;
text-decoration: underline;
}
</style>

@ -314,6 +314,7 @@
:field-info="fieldInfo"
:form="form"
:file="file"
@formDialog="$refs['formDialog'].setType('add'),$refs['formDialog'].show()"
@update="(val) => ($set(file, 'fujian', val))"
></flow>
</template>
@ -337,6 +338,8 @@
@refresh="$refs['xyTable'].getTableData()"
></imports>
<formDialog :table-name="customForm.tableName"
:form-info="form" ref="formDialog"></formDialog>
</div>
</template>
@ -361,6 +364,7 @@ import imports from "./imports.vue";
import flow from "@/views/flow/flow.vue";
import biaoqian from "./biaoqian.vue";
import examine from "./examine.vue";
import formDialog from "@/views/component/formDialog.vue";
export default {
components: {
LxHeader,
@ -372,6 +376,7 @@ export default {
flow,
biaoqian,
formDialog
},
mixins: [authMixin],
provide: {
@ -463,8 +468,10 @@ export default {
//
submit(scope, setType) {
let row = deepCopy(scope.row)
row.id_material_shenhebumen_depts_material_id_relation = [row.id_material_shenhebumen_depts_material_id_relation]
save(
Object.assign(deepCopy(scope.row), {
Object.assign(row, {
zhuangtai: setType,
table_name: this.customForm.tableName,
})

@ -426,7 +426,9 @@ export default {
//
submit (scope, setType) {
save(Object.assign( deepCopy(scope.row), { 'zhuangtai': setType,'table_name': this.customForm.tableName })).then(res => {
let row = deepCopy(scope.row)
row.id_material_shenhebumen_depts_material_id_relation = [row.id_material_shenhebumen_depts_material_id_relation]
save(Object.assign(row , { 'zhuangtai': setType,'table_name': this.customForm.tableName })).then(res => {
this.$message({
type: 'success',
message: '操作成功'
@ -441,7 +443,7 @@ export default {
async getFormDetail() {
this.select.filter[0] = {
key: "zhuangtai",
op: "range",
op: this.$route.meta.params?.zhuangtai?.length === 1 ? "eq" : 'range',
value: this.$route.meta.params?.zhuangtai,
};
if (this.$route.meta.params?.custom_form) {
@ -461,13 +463,26 @@ export default {
//
//
let baseTable = new Map([
['departments', async () => {
const res = await listdept()
return res
}],
['admins',[]]
])
[
"material_shenhebumen_depts",
async () => {
const res = await listdept();
return res;
},
],
["admins", []],
]);
let { fields, relation } = res;
let fieldRes = await fieldIndex(
{
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: "sort",
sort_type: "asc",
},
false
);
if (
!fields ||
!relation ||
@ -476,28 +491,32 @@ export default {
) {
throw new Error("fields或relation格式错误");
}
fields.forEach((i, index) => {
i._relations = relation.find((j) => j.local_key === i.field);
if (i.select_item && typeof i.select_item === 'object') {
let keys = Object.keys(i.select_item)
i._params = keys.map(key => {
fieldRes?.data?.forEach((i, index) => {
i._relations = relation.find((j) => j.link_table_name.split('_')[1] === i.field);
if (i.select_item && typeof i.select_item === "object") {
let keys = Object.keys(i.select_item);
i._params = keys.map((key) => {
return {
key,
value: i.select_item[key]
}
})
value: i.select_item[key],
};
});
}
if (i.edit_input === 'file' || i.edit_input === 'files') {
return
if (i.edit_input === "file" || i.edit_input === "files") {
return;
}
if (i._relations) {
if (baseTable.get(i._relations.link_table_name)) {
baseTable.get(i._relations.link_table_name)().then(res => i._params = res)
baseTable
.get(i._relations.link_table_name)()
.then((res) => (i._params = res));
} else {
i._params = i._relations.parameter_id
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
i._params = res.detail;
})
? getparameter({ id: i._relations.parameter_id }, false).then(
(res) => {
i._params = res.detail;
}
)
: this.index({
table_name: i._relations.link_table_name,
page: 1,
@ -508,48 +527,43 @@ export default {
}
}
});
let fieldRes = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc'
},false)
this.form = fieldRes?.data || [];
this.table = this.form
?.filter((i) => i.list_show)
.map((i) => {
let linkOb = {};
if (i.edit_input === 'richtext') {
linkOb.customFn = row => {
if (i.edit_input === "richtext") {
linkOb.customFn = (row) => {
return (
<el-scrollbar>
<div style={{ 'max-height': '50px' }} domPropsInnerHTML={row[i.field]}></div>
<div
style={{ "max-height": "50px" }}
domPropsInnerHTML={row[i.field]}
></div>
</el-scrollbar>
)
}
);
};
}
if (i.select_item && typeof i.select_item === 'object' && !(i.select_item instanceof Array)) {
let keys = Object.keys(i.select_item)
linkOb.customFn = row => {
let paramMap = new Map()
keys.forEach(key => {
paramMap.set(i.select_item[key],key)
})
if (
i.select_item &&
typeof i.select_item === "object" &&
!(i.select_item instanceof Array)
) {
let keys = Object.keys(i.select_item);
linkOb.customFn = (row) => {
let paramMap = new Map();
keys.forEach((key) => {
paramMap.set(i.select_item[key], key);
});
return (
<span>
{ paramMap.get(row[i.field]?.toString()) }
</span>
)
}
return <span>{paramMap.get(row[i.field]?.toString())}</span>;
};
}
if (i._relations) {
let { link_relation, foreign_key, link_with_name } = i._relations
if (link_relation === 'newHasOne' || link_relation === 'hasOne') {
linkOb.customFn = row => {
let { link_relation, foreign_key, link_with_name } = i._relations;
if (link_relation === "newHasOne" || link_relation === "hasOne") {
linkOb.customFn = (row) => {
if (i.edit_input === "file") {
return (
<a
@ -562,21 +576,21 @@ export default {
} else {
return (
<span>
{ row[link_with_name]?.name ||
{row[link_with_name]?.name ||
row[link_with_name]?.no ||
row[link_with_name]?.value }
row[link_with_name]?.value}
</span>
);
}
}
};
}
if (link_relation === "hasMany" || link_relation === 'newHasMany') {
if (link_relation === "hasMany" || link_relation === "newHasMany") {
linkOb.customFn = (row) => {
return (
<div>
{row[link_with_name]?.map((o) => (
<span>{o?.name || o?.no || o?.value}</span>
<p>{ o?.name || o?.no || o?.value || o?.biaoti || o?.mingcheng }</p>
))}
</div>
);
@ -599,7 +613,6 @@ export default {
label: "序号",
});
console.log(111,this.form)
},
},

@ -1,146 +0,0 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '500px'
},
chartData: {
type: Object
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.setOptions(this.chartData);
},
setOptions(chartdata) {
console.log(chartdata.xArr)
this.chart.setOption({
dataZoom: [
//x
{
startValue: 0,
endValue: 6, //
type: 'slider',
show: true,
xAxisIndex: [0],
handleSize: 0, // 2
height: 8, //
left: 50, //
right: 40, //
bottom: 26, //
handleColor: '#EFEFEF', //h
handleStyle: {
borderColor: '#409EFF',
borderWidth: '1',
shadowBlur: 2,
background: '#EFEFEF',
shadowColor: '#EFEFEF'
},
fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
// 410
//01
offset: 0,
color: '#409EFF'
},
{
offset: 1,
color: '#409EFF'
}
]),
backgroundColor: '#EFEFEF', //
showDataShadow: false, // auto
showDetail: false, // true
handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
filterMode: 'filter'
}
//
// {
// type: 'inside',
// show: true,
// xAxisIndex: [0],
// start: 0, //1
// end: 50,
// },
],
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: chartdata.xArr,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
minInterval: 1,
axisTick: {
show: false
}
}],
series: [{
name: '数据',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: chartdata.yArr,
animationDuration
}]
})
}
}
}
</script>

@ -1,448 +0,0 @@
<template>
<div>
<div class="boxlist">
<div class="box box1">
<div class="boxtitle">
<span>营业统计</span>
<i class="el-icon-data-line statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">服务金额</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.business.server_money_total}}
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.business.nurse_money_total}}</span>
<span>护工金额</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.business.remain_money_total}}</span>
<span>留存金额</span>
</div>
</div>
</div>
</div>
</div>
<div class="box box2">
<div class="boxtitle">
<span>人效统计</span>
<i class="el-icon-user statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总服务时长</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.person_efficiency.server_time_total}}
分钟
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.person_efficiency.expect}}</span>
<span> 照护人员数</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.person_efficiency.act}} </span>
<span>天数</span>
</div>
</div>
</div>
</div>
</div>
<div class="box box3">
<div class="boxtitle">
<span>客户统计</span>
<i class="el-icon-s-custom statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">活跃客户</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.customer.active}}
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.customer.add}}</span>
<span>新增</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.customer.wash}}</span>
<span>流失</span>
</div>
</div>
</div>
</div>
</div>
<div class="box box4">
<div class="boxtitle">
<span>订单统计</span>
<i class="el-icon-document statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">服务订单</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">{{totaldata.order.server_total}}
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.order.cycle_total}}</span>
<span>周期性订单</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.order.unit_total}}</span>
<span>单次订单</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
props: {
countsData: {
type: Object
},
totaldata: {
type: Object,
default: {
"business": {
"server_money_total": 0,
"nurse_money_total": 0,
"remain_money_total": 0
},
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
},
"order": {
"server_total": 0,
"cycle_total": 0,
"unit_total": 0
},
}
}
},
components: {
CountTo
},
methods: {
handleRoute(type) {
this.$emit('handleRoute', type)
},
toCaculateper(f1, f2) {
return ((f1 / (f2 == 0 ? 1 : f2)) * 100).toFixed(2) + "%"
}
}
}
</script>
<style lang="scss" scoped>
.boxlist {
display: flex;
}
.statIcon {
font-size: 24px;
}
.index_icon {
position: absolute;
top: 1.25rem;
right: 1.25rem;
width: 3.5625rem;
}
.index_bg {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
.boxcontentitem-small {
font-size: 16px;
display: flex;
flex-direction: column;
}
.box {
position: relative;
width: 33%;
margin-left: 0.5%;
margin-right: 0.5%;
margin-bottom: 2.375rem;
box-shadow: 0px 8px 15px 0px rgba(212, 84, 32, 0.3100);
border-radius: 8px;
box-sizing: border-box;
opacity: 0.8;
padding: 1.25rem 0;
.boxcontentsubtitle {
color: #FFFFFF;
text-align: center;
display: flex;
justify-content: center;
font-size: 1.0625rem;
margin-top: 1.25rem;
}
.boxfooter {
font-size: 1.0625rem;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
display: flex;
justify-content: center;
}
.boxtitle {
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
padding: 0 1.25rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.boxcontent {
display: flex;
//justify-content: space-around;
align-items: center;
.boxline {
width: 1px;
height: 4.0625rem;
background: #FFFFFF00;
opacity: 0.3;
margin-left: 2.0625rem;
margin-right: 2.0625rem;
}
.boxcontentitem {
display: flex;
flex-direction: column;
font-size: 19px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
text-align: center;
min-width: 100%;
.boxcontentitem-big {
font-size: 2.625rem;
font-family: Arial;
font-weight: 400;
color: #FFFFFF;
}
}
}
}
.box1 {
background: linear-gradient(134deg, #D1AC7B, #DFC69C);
.boxcline {
width: 100%;
background: #DFC69C;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.bline {
background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 60%);
height: 0.25rem;
width: 100%;
margin-top: 1.25rem;
}
.box2 {
background: linear-gradient(134deg, #9193BC, #B7B9D4);
.boxcline {
width: 100%;
background: #B7B9D4;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.box3 {
background: linear-gradient(-55deg, #F6A868, #F4C59E);
.boxcline {
width: 100%;
background: #F4C59E;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.box4 {
background: linear-gradient(-55deg, #64A48E, #9ECABB);
.boxcline {
width: 100%;
background: #9ECABB;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.panel-group {
// margin-top: 18px;
margin-left: -2% !important;
margin-right: -3% !important;
.card-panel-col {
margin: 0 2%;
margin-bottom: 32px;
}
.card-panel {
height: 130px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
text-align: center;
// background: #fff;
// box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
// border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
// .icon-people {
// background: #40c9c6;
// }
// .icon-message {
// background: #36a3f7;
// }
// .icon-money {
// background: #f4516c;
// }
// .icon-shopping {
// background: #34bfa3
// }
}
.icon-people {
color: #fff;
}
.icon-message {
color: #fff;
}
.icon-money {
color: #fff;
}
.icon-shopping {
color: #fff
}
.card-panel-icon-wrapper {
float: right;
margin: 22px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 42px;
}
.card-panel-description {
// float: right;
font-weight: bold;
margin: 16px 12px;
.card-panel-text {
line-height: 25px;
color: rgb(255, 255, 255);
font-size: 26px;
margin-bottom: 20px;
width: 70%;
text-align: left;
}
p {
text-align: left;
font-size: 19px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width:550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
</style>

@ -1,55 +0,0 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.$_resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
beforeDestroy() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
// to fixed bug when cached by keep-alive
// https://github.com/PanJiaChen/vue-element-admin/issues/2116
activated() {
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
deactivated() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_initResizeEvent() {
window.addEventListener('resize', this.$_resizeHandler)
},
$_destroyResizeEvent() {
window.removeEventListener('resize', this.$_resizeHandler)
},
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
$_initSidebarResizeEvent() {
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
$_destroySidebarResizeEvent() {
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
}
}
}

@ -1,298 +1,134 @@
<template>
<div>
<div class="title">最新上传</div>
<xy-table :height="300" :action="index" :req-opt="select1" :table-item="table"></xy-table>
<div class="statistics">
<panel-group :totaldata="list" />
</div>
<div class="title">热门文件</div>
<xy-table :height="300" :action="index" :req-opt="select2" :table-item="table"></xy-table>
</div>
</template>
<script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import {
getChartsHome
} from "../../api/dashboard.js"
import { index } from '@/api/system/baseForm'
export default {
components: {
PanelGroup
},
data() {
return {
col: '',
line: '',
business_data: [],
collect_data: [],
list: {},
customerArr: [],
orderArr: [],
chartData: {},
}
},
watch: {
chartData(val, newval) {
if (newval){
this.init();
}
}
},
methods: {
async loadData() {
await getChartsHome().then((res) => {
console.log(res);
this.list = res.list;
this.chartData = res;
let _business_data = [];
let _collect_data = [];
res.business_data.map(item => {
_business_data.push(item.server_money_total)
_collect_data.push(item.collect_money)
})
this.business_data = _business_data;
this.collect_data = _collect_data;
let _customerArr = [];
let _orderArr = [];
res.order_data.map(item => {
_customerArr.push(item.active_customer)
_orderArr.push(item.order_total)
})
this.customerArr = _customerArr;
this.orderArr = _orderArr;
}).catch()
},
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
select1: {
table_name: 'materials',
sort_name: 'created_at',
sort_type: 'desc'
},
select2: {
table_name: 'materials',
sort_name: 'dianjiliang',
sort_type: 'desc'
},
table: [
{
type: 'index',
width: 60
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position: 'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [{
name: '服务金额',
type: 'bar',
data: this.business_data,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: this.collect_data,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
{
label: '文件',
width: 180,
customFn: row => {
return (
<div>{row.nianfen}|{row.wenjian}|{row.bianhao}</div>
)
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
{
label: '标题',
prop: 'biaoti',
width: 140
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
{
label: '类型',
prop: 'leixing',
width: 140,
formatter: (data, row, val) => {
let map = new Map([
[1,'流程文件'],
[2,'表单文件'],
[3,'岗位工作及标准'],
[4,'部门工作职责'],
[5,'规章制度管理']
])
return map.get(val)
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
{
label: '审核部门',
prop: 'id_material_shenhebumen_depts_material_id_relation.name',
width: 140
},
yAxis: {
type: 'value',
{
label: '标签',
minWidht: 180,
align: 'left',
customFn:row => {
return (
<div>{
row.id_material_biaoqian_tags_material_id_relation.map(i => {
return (
<span style="padding-left: 10px;">{ i.mingcheng }</span>
)
})
}</div>
)
}
},
series: [{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: this.customerArr,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: this.orderArr,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
{
label: '文件',
minWidht: 200,
align: 'left',
customFn:row => {
return (
<div>{
row.id_material_fujian_uploads_material_id_relation.map(i => {
return (
<a href={i.url} download={i.name} class="uploaded-a" style="padding-left: 10px;">{ i.name }</a>
)
})
}</div>
)
}
]
})
}
]
}
},
methods: {
index,
},
created() {
//this.loadData();
},
mounted() {
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
margin-top: 20px;
&-title {
padding-left: 6px;
}
&-content {
text-align: center;
font-size: 13px;
&-top {
.title {
font-weight: 600;
font-size: 16px;
letter-spacing: 1px;
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-bottom {
display: flex;
justify-content: space-between;
&-left {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-right {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
}
}
&>div {
flex: 1;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
padding: 10px 4px;
}
.chart {
display: flex;
margin-top: 20px;
.chartItem {
width: 49%;
.chartItemTitle {
font-size: 16px;
margin-bottom: 20px;
}
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
margin-right: 20px;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
width: 100%;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
}
}
.uploaded-a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
.uploaded-a:hover {
color: red;
text-decoration: underline;
}
</style>

@ -2,7 +2,7 @@
<div>
<el-button size="small" type="primary" icon="el-icon-s-order" @click="$refs['formList'].show()"></el-button>
<el-button size="small" type="primary" icon="el-icon-plus">表单新增</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="$emit('formDialog')"></el-button>
<el-upload
class="upload"

@ -22,7 +22,7 @@
<template>
<div>
<div class="list">
<div class="list__item" v-for="i in departments">
<div class="list__item" v-for="i in departments" @click="toList(i)">
{{ i.name }}
<el-image class="list__item--icon" mode="coutain" :src="require('@/assets/reception/department-list-item-bkg.png')"></el-image>
</div>
@ -53,6 +53,12 @@ export default {
})
this.departments = res.department
this.loading = false
},
toList (i) {
this.$store.commit('reception/SET_SELECTED', { key: 'dept_id', value: i.id})
this.$router.push(`/index/list1?${this.$store.getters.select}`)
}
},
computed: {},

@ -74,7 +74,7 @@
<template>
<div>
<div class="department__list">
<div v-for="item in departments" class="department__list--item">
<div v-for="item in departments" class="department__list--item" @click="toList({ dept:item })">
<div>{{ item.name }}</div>
</div>
<div class="department__list--item">
@ -130,6 +130,7 @@
:class="
index % 2 ? 'single-item label-item' : 'complex-item label-item'
"
@click="toList({ tag:item })"
>
<p>{{ item.mingcheng }}</p>
</div>
@ -139,6 +140,7 @@
class="label-group__right label-item"
:style="{ background: labelColor(index + 3) }"
v-if="group.right"
@click="toList({ tag:item })"
>
<p>{{ group.right.mingcheng }}</p>
</div>
@ -197,6 +199,13 @@ export default {
}
console.log(this.labelGroup);
},
toList ({ tag, dept }) {
tag?.id ? this.$store.commit('reception/SET_SELECTED',{ key: 'tag_id', value: tag.id }) : ''
dept?.id ? this.$store.commit('reception/SET_SELECTED',{ key: 'dept_id', value: dept.id }) : ''
this.$router.push(`/index/list1?${this.$store.getters.select}`)
}
},
computed: {
labelColor() {

@ -10,7 +10,7 @@
enter-active-class="fade-in"
leave-to-class="fade-out"
>
<keep-alive include="home">
<keep-alive include="Home">
<component :is="Component" :key="$route.name"></component>
</keep-alive>
</transition>

@ -31,7 +31,7 @@
<template>
<div>
<div class="list">
<div class="list__item" v-for="i in tags">
<div class="list__item" v-for="i in tags" @click="toList(i)">
<div>
<svg viewBox="0 0 13 11"
preserveAspectRatio="xMinYMin meet">
@ -72,6 +72,11 @@ export default {
})
this.tags = res.tags
this.loading = false
},
toList (i) {
this.$store.commit('reception/SET_SELECTED', { key: 'tag_id', value: i.id })
this.$router.push(`/index/list1?${this.$store.getters.select}`)
}
},
computed: {},

@ -1,5 +1,8 @@
<template>
<div class="list1">
<el-page-header class="header" @back="$router.back()" :content="type+':共搜索到'+total+'条'">
</el-page-header>
<div class="container">
<el-skeleton animated :loading="loading">
<template #template>
@ -14,6 +17,7 @@
<div>
<div class="list" v-if="list.length > 0">
<div class="list__item" v-for="i in list" :key="i.id">
<div class="list__item--pre" v-if="$route.query.leixing == 2">{{i.wenjian}}{{i.nianfen}}{{i.bianhao}}</div>
<div class="list__item--name">{{i.biaoti}}</div>
<div class="list__item--date">{{ $moment(new Date(i.created_at)).format('YYYY-MM-DD') }}</div>
<el-dropdown trigger="click" placement="bottom-start" @command="open">
@ -98,7 +102,9 @@ export default {
page: 1,
leixing: '',
page_size: 10,
table_name: 'materials'
table_name: 'materials',
tag_id: '',
dept_id: ''
},
list: [],
total: 0,
@ -133,7 +139,26 @@ export default {
download (e.url, 'get', {}, e.name)
}
},
computed: {},
computed: {
type () {
if (this.select.leixing == 1) {
return '流程文件'
}
if (this.select.leixing == 2) {
return '表单文件'
}
if (this.select.leixing == 3) {
return '岗位工作及标准'
}
if (this.select.leixing == 4) {
return '部门工作职责'
}
if (this.select.leixing == 5) {
return '规章制度管理'
}
return '全部文件'
}
},
watch: {
"$route.query": {
handler (newVal) {
@ -147,19 +172,32 @@ export default {
},
created() {
this.select.page = 1;
this.select.leixing = this.$route.query.leixing;
this.select.keyword = this.$route.query.keyword;
let { leixing, keyword , tag_id, dept_id } = this.$route.query
this.select.leixing = leixing;
this.select.keyword = keyword;
this.select.tag_id = tag_id;
this.select.dept_id = dept_id;
this.getMaterial()
}
}
</script>
<style scoped lang="scss">
::v-deep .el-page-header__content {
font-size: 15px;
}
.list1 {
background: #f8f8f8;
padding: 31px 18.75%;
}
.header {
background: #fff;
box-shadow: 0 0 15px 0 rgba(130,127,126,0.1);
padding: 16px 23px 16px 22px;
margin-bottom: 20px;
}
.container {
background: #fff;
border-radius: 2px;
@ -178,6 +216,25 @@ export default {
padding: 11px 9px 11px 27px;
position: relative;
&--pre {
font-size: 13px;
font-weight: 500;
color: #398AC9;
padding-right: 10px;
position: relative;
&::after {
content:'';
width: 2px;
background: #398AC9;
position: absolute;
top: 2px;
bottom: 2px;
right: -1px;
}
}
&::before {
content: '';
height: 6px;
@ -195,6 +252,7 @@ export default {
color: #333;
flex: 1;
padding-left: 10px;
}
&--date {
font-size: 13px;

@ -1,5 +1,8 @@
<template>
<div class="list1">
<el-page-header class="header" @back="$router.back()" :content="type+':共搜索到'+total+'条'">
</el-page-header>
<div class="container">
<el-skeleton animated :loading="loading">
<template #template>
@ -134,7 +137,25 @@ export default {
download (e.url, 'get', {}, e.name)
}
},
computed: {},
computed: {
type () {
if (this.select.leixing == 1) {
return '流程文件'
}
if (this.select.leixing == 2) {
return '表单文件'
}
if (this.select.leixing == 3) {
return '岗位工作及标准'
}
if (this.select.leixing == 4) {
return '部门工作职责'
}
if (this.select.leixing == 5) {
return '规章制度管理'
}
}
},
watch: {
"$route.query": {
handler (newVal) {
@ -156,6 +177,9 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .el-page-header__content {
font-size: 15px;
}
.list1 {
background: #f8f8f8;
@ -169,6 +193,13 @@ export default {
padding: 24px 23px 44px 22px;
}
.header {
background: #fff;
box-shadow: 0 0 15px 0 rgba(130,127,126,0.1);
padding: 16px 23px 16px 22px;
margin-bottom: 20px;
}
.list {
&__item {

@ -38,7 +38,7 @@ export default {
return {
chart: '',
select: {
month: this.$moment(new Date()).format('YYYY-MM')
date: this.$moment(new Date()).format('YYYY-MM')
},
data: {}
}
@ -47,14 +47,24 @@ export default {
init () {
this.chart = echarts.init(document.getElementById('doughnut-chart'))
let colors = ['#00A82A', '#70e1f5', '#ffd194', '#FF6B6B', '#6E48AA', '#4B1248']
let data = []
let data = this.data.map((i, index) => {
return {
value:i.total,
name:i.leixing,
itemStyle: {
normal: {
color: colors[(index+1)%6]
},
},
}
})
this.chart.setOption(
{
tooltip: {
trigger: 'item'
},
legend: {
top: '3%',
top: '5%',
left: 'center'
},
series: [
@ -91,7 +101,7 @@ export default {
async getData () {
const res = await month(this.select)
console.log(res,111)
this.data = res
this.init()
}
},
@ -113,7 +123,7 @@ export default {
#doughnut-chart {
box-sizing: border-box;
min-height: 240px;
min-height: 260px;
}
}

Loading…
Cancel
Save