master
xy 3 years ago
parent 4a0091d1b9
commit 83efc69818

@ -45,3 +45,12 @@ export function materials (params, isLoading = false) {
isLoading
})
}
export function detail (params, isLoading = false) {
return request({
url: '/api/user/detail',
method: 'get',
params,
isLoading
})
}

@ -3,7 +3,8 @@
<el-image
class="container__logo"
:src="require('@/assets/reception/container-logo.png')"
fit="contain"></el-image>
fit="contain"
@click="$router.push('/index')"></el-image>
<div class="container__title">内部质量保证体系资料汇编</div>

@ -5,21 +5,21 @@
<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">{{selectValue}}</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">{{selectLabel}}</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 ['制度文件','工作流程','岗位工作及标准','表单中心','部门工作职责']" @click="selectValue = i">
{{ i }}
<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">
{{ i.label }}
</div>
</div>
<div class="right">
<div class="search-bar">
<el-dropdown trigger="click" placement="bottom" @command="e => selectValue = e">
<el-dropdown trigger="click" placement="bottom" @command="">
<el-button type="primary" class="dropdown-search-button">
<div class="btn-slot">
<span>任意词</span><i style="padding-left: 10px;" class="el-icon-arrow-down el-icon--right"></i>
@ -27,28 +27,28 @@
</el-button>
<template #dropdown>
<el-dropdown-menu class="select-drop">
<el-dropdown-item command="规章制度">
<div style="text-align: center">规章制度</div>
</el-dropdown-item>
<el-dropdown-item command="工作流程">
<div style="text-align: center">工作流程</div>
</el-dropdown-item>
<el-dropdown-item command="岗位工作及标准">
<div style="text-align: center">岗位工作及标准</div>
</el-dropdown-item>
<el-dropdown-item command="表单中心">
<div style="text-align: center">表单中心</div>
</el-dropdown-item>
<el-dropdown-item command="部门工作职责">
<div style="text-align: center">部门工作职责</div>
<el-dropdown-item command="任意词">
<div style="text-align: center">任意词</div>
</el-dropdown-item>
<!-- <el-dropdown-item command="工作流程">-->
<!-- <div style="text-align: center">工作流程</div>-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item command="岗位工作及标准">-->
<!-- <div style="text-align: center">岗位工作及标准</div>-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item command="表单中心">-->
<!-- <div style="text-align: center">表单中心</div>-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item command="部门工作职责">-->
<!-- <div style="text-align: center">部门工作职责</div>-->
<!-- </el-dropdown-item>-->
</el-dropdown-menu>
</template>
</el-dropdown>
<div class="search__bottom--input">
<el-input placeholder="请输入内容" size="" v-model="inputValue">
<el-input placeholder="请输入内容" size="" v-model="inputValue" clearable>
<template #append>
<el-button style="background: #247EC3;color: #fff;border: none;border-bottom-left-radius: 0;border-top-left-radius: 0;"> </el-button>
<el-button style="background: #247EC3;color: #fff;border: none;border-bottom-left-radius: 0;border-top-left-radius: 0;" @click="search"> </el-button>
</template>
</el-input>
</div>
@ -61,7 +61,7 @@
<div class="history__word">
<div class="history__word--top">常用搜索</div>
<div class="history__word--bottom">
<span style="cursor: pointer;" v-for="(i, index) in ['奖学金', '集体户口', '助学金', '党建']">{{ i }}{{ index !== 3 ? '&nbsp|&nbsp' : '' }}</span>
<span style="cursor: pointer;" v-for="(i, index) in ['奖学金', '集体户口', '助学金', '党建']" @click="inputValue = i">{{ i }}{{ index !== 3 ? '&nbsp|&nbsp' : '' }}</span>
</div>
</div>
</div>
@ -81,11 +81,17 @@ export default {
data() {
return {
popoverShow: false,
selectValue: '搜索内部资料',
selectLabel: '搜索内部资料',
selectValue: '',
inputValue: '',
}
},
methods: {},
methods: {
search () {
this.$router.push(`/index/list${this.selectValue == 2 ? '2' : '1'}?leixing=${this.selectValue}&keyword=${this.inputValue}&t=${new Date().getTime()}`)
}
},
computed: {},
mounted() {
this.popoverShow = true

@ -21,7 +21,6 @@ const service = axios.create({
// request interceptor
service.interceptors.request.use(
config => {
console.log(config)
if(config.isLoading){
loading = Loading.service({
lock:true,

@ -20,7 +20,7 @@
infinite-scroll-disabled="disabled"
@change="change"
>
<el-checkbox border :label="item.id" v-for="item in tags">{{
<el-checkbox border :label="item.id" v-for="item in tags" :key="item.id">{{
item.mingcheng
}}</el-checkbox>
</el-checkbox-group>
@ -34,6 +34,7 @@
<script>
import { index } from "@/api/system/baseForm";
import { deepCopy } from "@/utils";
export default {
props: {
fieldInfo: Object,
@ -44,7 +45,6 @@ export default {
loading: false,
noMore: false,
originalValue: [],
value: [],
tags: [],
select: {
@ -93,14 +93,15 @@ export default {
},
change(e) {
let tagObjs = []
this.value.forEach(i => {
let tag = this.tags.find(tag => tag.id === i)
let tagObjs = [];
this.value.forEach((i) => {
let tag = deepCopy(this.tags.find((tag) => tag.id === i));
delete tag?.id;
tagObjs.push({
tag_id: tag.id,
tag
})
})
tag_id: i,
...tag,
});
});
this.$emit("update", tagObjs);
},
},
@ -110,9 +111,10 @@ export default {
},
},
watch: {
"form.biaoqian_tags_id_relation"(newVal) {
this.originalValue = newVal;
this.value = [];
"form.id_material_biaoqian_tags_material_id_relation": {
handler: function (newVal) {
this.value = newVal.map(i => i.tag_id);
}
},
},
created() {},

@ -390,28 +390,57 @@ export default {
configurable: true,
writable: true,
});
}
this.$refs["elForm"].validate((validate) => {
if (validate) {
let copyForm = deepCopy(this.form)
this.formInfo.forEach((info) => {
if (copyForm[info._relations?.link_with_name]) {
return
if (info.field === 'biaoqian') 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 => i?.response);
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 => info._params.find(param => param[info._relations?.foreign_key] === i))
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] = this.file[info.field]?.map(i => i?.response);
copyForm[info._relations.link_with_name] = [
{
upload_id: this.file[info.field]?.response?.id,
...this.file[info.field]
}
];
} else {
copyForm[info._relations.link_with_name] = info._params.find(param => param[info._relations?.foreign_key] === copyForm[info.field])
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,
}
]
}
delete copyForm[info.field]
@ -472,6 +501,9 @@ export default {
if (i.edit_input === "checkbox") {
this.form[i.field] = [];
}
if (i._relations) {
this.form[i._relations?.link_with_name] = []
}
}
});
},

@ -1,21 +0,0 @@
<template>
<div>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {},
computed: {},
render(h) {
retrun
}
}
</script>
<style scoped lang="scss">
</style>

@ -314,14 +314,14 @@
:field-info="fieldInfo"
:form="form"
:file="file"
@update="(val) => (form['fujian'] = val)"
@update="(val) => ($set(file, 'fujian', val))"
></flow>
</template>
<template #biaoqian="{ fieldInfo, form, file }">
<biaoqian
:field-info="fieldInfo"
:form="form"
@update="(val) => (form['biaoqian_tags_id_relation'] = val)"
@update="(val) => (form['id_material_biaoqian_tags_material_id_relation'] = val)"
></biaoqian>
</template>
</dialoger>
@ -360,7 +360,6 @@ import drawer from "@/views/component/drawer.vue";
import imports from "./imports.vue";
import flow from "@/views/flow/flow.vue";
import biaoqian from "./biaoqian.vue";
import fujian from "./fujian.vue";
import examine from "./examine.vue";
export default {
components: {
@ -373,7 +372,6 @@ export default {
flow,
biaoqian,
fujian,
},
mixins: [authMixin],
provide: {
@ -499,7 +497,7 @@ export default {
//
let baseTable = new Map([
[
"departments",
"material_shenhebumen_depts",
async () => {
const res = await listdept();
return res;
@ -527,7 +525,7 @@ export default {
throw new Error("fields或relation格式错误");
}
fieldRes?.data?.forEach((i, index) => {
i._relations = relation.find((j) => j.local_key === i.field);
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) => {
@ -625,7 +623,7 @@ export default {
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>
);

@ -9,13 +9,17 @@
ref="upload"
:action="action"
:file-list="fileList"
:auto-upload="false">
:auto-upload="false"
:before-upload="beforeUpload"
:on-success="onSuccess"
:on-remove="onRemove"
:on-error="onError">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="">上传到服务器</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="$refs['upload'].submit()"></el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<formList ref="formList" :value="selections" @selected="selectedHandler"></formList>
<formList ref="formList" @selected="selectedHandler"></formList>
</div>
</template>
@ -33,27 +37,50 @@ export default {
data() {
return {
action: process.env.VUE_APP_UPLOAD_API,
selections: [],
fileList: []
}
},
methods: {
selectedHandler (ids) {
this.selections = Array.from(new Set(ids))
selectedHandler (selections) {
this.fileList.push(...selections)
this.$emit('update', this.fileList)
},
this.$emit('update', this.selections)
}
beforeUpload (file) {
if (file.size / 1000 > 500) {
this.$message({
type: "warning",
message: "上传图片大小超过500kb",
});
return false;
}
},
onSuccess (response, file, fileList) {
this.fileList = fileList;
this.$emit('update', this.fileList)
},
onRemove (file, fileList) {
this.fileList = fileList;
},
onError (err, file, fileList) {
this.fileList = fileList;
this.$message({
type: "warning",
message: err,
});
},
},
computed: {
fileList () {
return (this.file && this.fieldInfo?.field) ? this.file[this.fieldInfo.field] : []
},
},
watch: {
form: {
handler(newVal) {
this.selections = newVal[this.fieldInfo.field]
'form.id_material_fujian_uploads_material_id_relation': {
handler (newVal) {
this.fileList = newVal
},
immediate: true
deep: true
}
}
}

@ -22,7 +22,7 @@
</template>
<template #footer>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</template>
</el-dialog>
</div>
@ -31,9 +31,6 @@
<script>
import { index } from "@/api/system/baseForm"
export default {
props: {
value: Array
},
data() {
return {
dialogVisible: false,
@ -61,6 +58,16 @@ export default {
title: '编号',
width: 120
},
{
key: 'files',
title: '附件',
minWidth: 220,
render: (h, {row}) => {
return h('div', row.id_material_fujian_uploads_material_id_relation.map(i => {
return h('p', i.name)
}))
}
},
{
key: 'biaoti',
title: '标题',
@ -97,7 +104,10 @@ export default {
value: 2
}
]
}
},
selected: []
}
},
methods: {
@ -108,13 +118,17 @@ export default {
this.dialogVisible = false
},
unique (arr) {
const res= new Map()
return arr.filter((a)=> !res.has(a.id) && res.set(a.id,1))
},
async getData() {
this.isLoading = true
const res = await index(this.select)
console.log(222,this.value)
this.data = res.data.map(i => {
return {
_checked: this.value?.indexOf(i.id) !== -1,
_checked: !!this.selected?.find(i2 => i2.id === i.id),
...i
}
})
@ -123,9 +137,26 @@ export default {
},
selectionChange(selection) {
this.$emit('selected', selection.map(i => i.id))
this.selected = selection
},
confirm () {
let res = []
this.selected.forEach(i => {
if (i.id_material_fujian_uploads_material_id_relation) {
res.push(...i.id_material_fujian_uploads_material_id_relation.map(i1 => {
return {
name: i1.name,
url: i1.url,
response: i1,
upload_id: i1.id
}
}))
}
})
this.$emit('selected', res)
this.hide()
}
},
computed: {},
watch: {

@ -5,30 +5,60 @@
<div class="title__text">所有部门</div>
<el-input placeholder="搜索部门" v-model="input" class="title__input">
<template #append>
<el-button class="title__input--btn" icon="el-icon-search"></el-button>
<el-button class="title__input--btn" icon="el-icon-search" @click="getDepts"></el-button>
</template>
</el-input>
</div>
<div class="list">
<div class="list__item" v-for="i in 15">
党委办公室 党委组织部合署)
<el-image class="list__item--icon" mode="coutain" :src="require('@/assets/reception/department-list-item-bkg.png')"></el-image>
</div>
</div>
<el-skeleton :loading="loading" animated>
<template #template>
<div>
<div class="list">
<el-skeleton-item variant="rect" class="list__item" v-for="i in 8">
</el-skeleton-item>
</div>
</div>
</template>
<template>
<div>
<div class="list">
<div class="list__item" v-for="i in departments">
{{ i.name }}
<el-image class="list__item--icon" mode="coutain" :src="require('@/assets/reception/department-list-item-bkg.png')"></el-image>
</div>
</div>
</div>
</template>
</el-skeleton>
</div>
</div>
</template>
<script>
import { departments } from '@/api/reception'
export default {
data() {
return {
loading: false,
departments: [],
input: ''
}
},
methods: {},
methods: {
async getDepts () {
this.loading = true
const res = await departments({
keyword: this.input,
table_name: 'departments'
})
this.departments = res.department
this.loading = false
}
},
computed: {},
mounted() {
this.getDepts()
}
}
</script>

@ -7,13 +7,22 @@
<div class="news__header--diamond">热点资料</div>
<div class="news__header--line"></div>
</div>
<el-skeleton animated :loading="loading">
<template #template>
<div class="news__list">
<el-skeleton-item v-for="i in 5" variant="text" style="width: 60%" :style="{ 'margin-top': i !== 1 ? '20px' : '' }"/>
</div>
</template>
<template>
<ul class="news__list">
<li class="news__list--item" v-for="i in details.hot">
<div>{{ i.biaoti }}</div>
<div>{{ $moment(new Date(i.created_at)).format("YYYY-MM-DD") }}</div>
</li>
</ul>
</template>
</el-skeleton>
<ul class="news__list">
<li class="news__list--item" v-for="i in details.hot">
<div>{{ i.biaoti }}</div>
<div>{{ $moment(new Date(i.created_at)).format("YYYY-MM-DD") }}</div>
</li>
</ul>
</el-col>
<el-col :span="12">
@ -22,12 +31,21 @@
<div class="news__header--line"></div>
</div>
<ul class="news__list">
<li class="news__list--item" v-for="i in details.last">
<div>{{ i.biaoti }}</div>
<div>{{ $moment(new Date(i.created_at)).format("YYYY-MM-DD") }}</div>
</li>
</ul>
<el-skeleton animated :loading="loading">
<template #template>
<div class="news__list">
<el-skeleton-item v-for="i in 5" variant="text" style="width: 60%" :style="{ 'margin-top': i !== 1 ? '20px' : '' }"/>
</div>
</template>
<template>
<ul class="news__list">
<li class="news__list--item" v-for="i in details.last">
<div>{{ i.biaoti }}</div>
<div>{{ $moment(new Date(i.created_at)).format("YYYY-MM-DD") }}</div>
</li>
</ul>
</template>
</el-skeleton>
</el-col>
</el-row>
</div>
@ -42,62 +60,104 @@
<div class="department__title--linear"></div>
</div>
<div class="department__list">
<div v-for="item in 14" class="department__list--item">
<div>{{ item }}</div>
</div>
<div class="department__list--item">
<div @click="$router.push('/index/department')">...</div>
</div>
</div>
<el-skeleton :loading="loading" animated>
<template #template>
<div class="department__list">
<el-skeleton-item v-for="i in 3" class="department__list--item" variant="rect"></el-skeleton-item>
<div class="department__list--item">
<div @click="$router.push('/index/department')">...</div>
</div>
</div>
<div>
</div>
</template>
<template>
<div>
<div class="department__list">
<div v-for="item in departments" class="department__list--item">
<div>{{ item.name }}</div>
</div>
<div class="department__list--item">
<div @click="$router.push('/index/department')">...</div>
</div>
</div>
</div>
</template>
</el-skeleton>
</div>
<div class="label">
<div class="label__first" @click="$router.push('/index/label')">
<el-image
style="width: 49px; height: 49px; margin-bottom: 29px"
:src="require('@/assets/reception/icon-light.png')"
></el-image>
<div>标签</div>
</div>
<div class="label-group" v-for="(group, index) in labelGroup">
<div
:class="
<el-skeleton animated :loading="loading">
<template #template>
<div>
<div class="label">
<div class="label__first" @click="$router.push('/index/label')">
<el-image
style="width: 49px; height: 49px; margin-bottom: 29px"
:src="require('@/assets/reception/icon-light.png')"
></el-image>
<div>标签</div>
</div>
<div class="label-group" style="margin-left: 20px;">
<el-skeleton-item variant="rect" style="height: 100%;"></el-skeleton-item>
<el-skeleton-item variant="rect" style="height: 100%;margin-left: 20px;"></el-skeleton-item>
</div>
</div>
</div>
</template>
<template>
<div>
<div class="label">
<div class="label__first" @click="$router.push('/index/label')">
<el-image
style="width: 49px; height: 49px; margin-bottom: 29px"
:src="require('@/assets/reception/icon-light.png')"
></el-image>
<div>标签</div>
</div>
<div class="label-group" v-for="(group, index) in labelGroup">
<div
:class="
index % 2
? 'label-group__left--single'
: 'label-group__left--complex'
"
>
<div
v-for="(item, index2) in group.left"
:style="{ background: labelColor(index2) }"
:class="
>
<div
v-for="(item, index2) in group.left"
:style="{ background: labelColor(index2) }"
:class="
index % 2 ? 'single-item label-item' : 'complex-item label-item'
"
>
<p>{{ item }}</p>
>
<p>{{ item.mingcheng }}</p>
</div>
</div>
<div
class="label-group__right label-item"
:style="{ background: labelColor(index + 3) }"
v-if="group.right"
>
<p>{{ group.right.mingcheng }}</p>
</div>
</div>
</div>
</div>
<div
class="label-group__right label-item"
:style="{ background: labelColor(index + 3) }"
v-if="group.right"
>
<p>{{ group.right }}</p>
</div>
</div>
</div>
</template>
</el-skeleton>
</div>
</template>
<script>
import {home} from '@/api/reception';
import { home, tags, departments } from '@/api/reception';
export default {
data() {
return {
loading: false,
departments: [],
labels: [
"学籍管理",
"人才",
@ -117,7 +177,13 @@ export default {
},
methods: {
async getInfo () {
this.details = await home()
this.loading = true;
this.details = await home();
const res1 = await tags({table_name: 'tags'})
this.labels = res1.tags.slice(0,10)
const res2 = await departments({table_name: 'departments'})
this.departments = res2.department.slice(0,14)
this.loading = false
},
labelsHandler() {
@ -141,8 +207,8 @@ export default {
};
},
},
created() {
this.getInfo();
async created() {
await this.getInfo();
this.labelsHandler();
},
};

@ -5,40 +5,79 @@
<div class="title__text">所有标签</div>
<el-input placeholder="搜索标签" v-model="input" class="title__input">
<template #append>
<el-button class="title__input--btn" icon="el-icon-search"></el-button>
<el-button class="title__input--btn" icon="el-icon-search" @click="getTags"></el-button>
</template>
</el-input>
</div>
<div class="list">
<div class="list__item" v-for="i in 15">
<el-skeleton :loading="loading" animated>
<template #template>
<div class="list">
<div class="list__item" v-for="i in 8">
<div>
<svg viewBox="0 0 13 11"
preserveAspectRatio="xMinYMin meet">
<path d="M 1 11 L 1 1 L 12 1 L 12 10 l -7 0 l 0 -5 l 4 0"
fill="none"
stroke="#4c84c5"
stroke-width="2"
pathLength="1"></path>
</svg>
<el-skeleton-item variant="text" style="width: 100px;margin-left: 13px;"></el-skeleton-item>
</div>
</div>
</div>
</template>
<template>
<div>
<svg viewBox="0 0 13 11"
preserveAspectRatio="xMinYMin meet">
<path d="M 1 11 L 1 1 L 12 1 L 12 10 l -7 0 l 0 -5 l 4 0"
fill="none"
stroke="#4c84c5"
stroke-width="2"
pathLength="1"></path>
</svg>
<div>{{ labels[i % labels.length] }}</div>
<div class="list">
<div class="list__item" v-for="i in tags">
<div>
<svg viewBox="0 0 13 11"
preserveAspectRatio="xMinYMin meet">
<path d="M 1 11 L 1 1 L 12 1 L 12 10 l -7 0 l 0 -5 l 4 0"
fill="none"
stroke="#4c84c5"
stroke-width="2"
pathLength="1"></path>
</svg>
<div>{{ i.mingcheng }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</el-skeleton>
</div>
</div>
</template>
<script>
import { tags } from '@/api/reception'
export default {
data() {
return {
loading: false,
tags: [],
input: '',
labels: ['学籍管理','人才','补助','培养方案','综合科技','党建工作创新奖','处置','党建工作创新奖','处置','党建工作创新奖','处置'],
labels: [],
}
},
methods: {
async getTags () {
this.loading = true
const res = await tags({
keyword: this.input,
table_name: 'tags'
})
this.tags = res.tags
this.loading = false
}
},
methods: {},
computed: {},
mounted() {
this.getTags()
}
}
</script>
@ -123,4 +162,5 @@ export default {
}
}
</style>

@ -1,34 +1,156 @@
<template>
<div class="list1">
<div class="container">
<div class="list">
<div class="list__item" v-for="i in 8">
<div class="list__item--name">教育部关于公布高等学校信息公开事项清单的通知</div>
<div class="list__item--date">{{ $moment(new Date()).format('YYYY-MM-DD') }}</div>
<div class="list__item--btn">预览</div>
<div class="list__item--download">
<i class="el-icon-download"></i>
<el-skeleton animated :loading="loading">
<template #template>
<div class="list">
<div class="list__item" v-for="i in 8" :key="i">
<el-skeleton-item class="list__item--name" variant="text" style="height: 36px;margin-right: 40px;"></el-skeleton-item>
<div class="list__item--btn">预览</div>
</div>
</div>
</div>
</div>
</template>
<template>
<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--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">
<div class="list__item--btn" @click="getDetail(i)"></div>
<template #dropdown>
<el-dropdown-menu v-if="load">
<div style="width: 100px;position: relative;height: 60px;">
<Spin fix></Spin>
</div>
</el-dropdown-menu>
<el-dropdown-menu v-else>
<template v-if="uploadsList.length > 0">
<el-dropdown-item :command="item" v-for="item in uploadsList">
{{ item.name }}
</el-dropdown-item>
</template>
<template v-else>
<el-dropdown-item disabled>
暂无内容
</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
<div class="list__item--download">
<el-dropdown trigger="click" placement="bottom-start" @command="down">
<i class="el-icon-download" @click="getDetail(i)"></i>
<template #dropdown>
<el-dropdown-menu v-if="load">
<div style="width: 100px;position: relative;height: 60px;">
<Spin fix></Spin>
</div>
</el-dropdown-menu>
<el-dropdown-menu v-else>
<template v-if="uploadsList.length > 0">
<el-dropdown-item :command="item" v-for="item in uploadsList">
{{ item.name }}
</el-dropdown-item>
</template>
<template v-else>
<el-dropdown-item disabled>
暂无内容
</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</div>
<el-empty v-else :image-size="200"></el-empty>
</div>
</template>
</el-skeleton>
<el-pagination
class="page"
background
layout="prev, pager, next"
:total="1000">
:page-size.sync="select.page_size"
:total="total"
:current-page.sync="select.page"
@current-change="e => {
select.page = e
getMaterial()
}">
</el-pagination>
</div>
</div>
</template>
<script>
import { download } from '@/utils/downloadRequest'
import { materials, detail } from "@/api/reception"
export default {
data() {
return {}
return {
loading: false,
select: {
keyword: '',
page: 1,
leixing: '',
page_size: 10,
table_name: 'materials'
},
list: [],
total: 0,
load: false,
uploadsList: [],
}
},
methods: {
async getMaterial () {
this.loading = true
const res = await materials(this.select)
this.total = res.tags.total
this.list = res.tags.data
this.loading = false
},
async getDetail (i) {
this.load = true
const res = await detail({
table_name: 'materials',
id: i.id
})
this.uploadsList = res.detail?.id_material_fujian_uploads_material_id_relation || []
this.load = false
},
open (e) {
window.open(e.url)
},
down (e) {
download (e.url, 'get', {}, e.name)
}
},
methods: {},
computed: {},
watch: {
"$route.query": {
handler (newVal) {
this.select.page = 1;
this.select.leixing = newVal.leixing;
this.select.keyword = newVal.keyword;
this.getMaterial()
},
deep: true
}
},
created() {
this.select.page = 1;
this.select.leixing = this.$route.query.leixing;
this.select.keyword = this.$route.query.keyword;
this.getMaterial()
}
}
</script>

@ -1,35 +1,157 @@
<template>
<div class="list1">
<div class="container">
<div class="list">
<div class="list__item" v-for="i in 8">
<div class="list__item--pre">苏卫20112</div>
<div class="list__item--name">教育部关于公布高等学校信息公开事项清单的通知</div>
<div class="list__item--date">{{ $moment(new Date()).format('YYYY-MM-DD') }}</div>
<div class="list__item--btn">预览</div>
<div class="list__item--download">
<i class="el-icon-download"></i>
<el-skeleton animated :loading="loading">
<template #template>
<div class="list">
<div class="list__item" v-for="i in 8" :key="i">
<el-skeleton-item class="list__item--name" variant="text" style="height: 36px;margin-right: 40px;"></el-skeleton-item>
<div class="list__item--btn">预览</div>
</div>
</div>
</div>
</div>
</template>
<template>
<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">{{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">
<div class="list__item--btn" @click="getDetail(i)"></div>
<template #dropdown>
<el-dropdown-menu v-if="load">
<div style="width: 100px;position: relative;height: 60px;">
<Spin fix></Spin>
</div>
</el-dropdown-menu>
<el-dropdown-menu v-else>
<template v-if="uploadsList.length > 0">
<el-dropdown-item :command="item" v-for="item in uploadsList">
{{ item.name }}
</el-dropdown-item>
</template>
<template v-else>
<el-dropdown-item disabled>
暂无内容
</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
<div class="list__item--download">
<el-dropdown trigger="click" placement="bottom-start" @command="down">
<i class="el-icon-download" @click="getDetail(i)"></i>
<template #dropdown>
<el-dropdown-menu v-if="load">
<div style="width: 100px;position: relative;height: 60px;">
<Spin fix></Spin>
</div>
</el-dropdown-menu>
<el-dropdown-menu v-else>
<template v-if="uploadsList.length > 0">
<el-dropdown-item :command="item" v-for="item in uploadsList">
{{ item.name }}
</el-dropdown-item>
</template>
<template v-else>
<el-dropdown-item disabled>
暂无内容
</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</div>
<el-empty v-else :image-size="200"></el-empty>
</div>
</template>
</el-skeleton>
<el-pagination
class="page"
background
layout="prev, pager, next"
:total="1000">
:page-size.sync="select.page_size"
:total="total"
:current-page.sync="select.page"
@current-change="e => {
select.page = e
getMaterial()
}">
</el-pagination>
</div>
</div>
</template>
<script>
import {detail, materials} from "@/api/reception"
import {download} from "@/utils/downloadRequest";
export default {
data() {
return {}
return {
loading: false,
select: {
keyword: '',
leixing: 2,
page: 1,
page_size: 10,
table_name: 'materials'
},
list: [],
total: 0,
load: false,
uploadsList: [],
}
},
methods: {
async getMaterial () {
this.loading = true
const res = await materials(this.select)
this.total = res.tags.total
this.list = res.tags.data
this.loading = false
},
async getDetail (i) {
this.load = true
const res = await detail({
table_name: 'materials',
id: i.id
})
this.uploadsList = res.detail?.id_material_fujian_uploads_material_id_relation || []
this.load = false
},
open (e) {
window.open(e.url)
},
down (e) {
download (e.url, 'get', {}, e.name)
}
},
methods: {},
computed: {},
watch: {
"$route.query": {
handler (newVal) {
this.select.page = 1;
this.select.leixing = newVal.leixing;
this.select.keyword = newVal.keyword;
this.getMaterial()
},
deep: true
}
},
created() {
this.select.page = 1;
this.select.leixing = this.$route.query.leixing;
this.select.keyword = this.$route.query.keyword;
this.getMaterial()
}
}
</script>

@ -58,7 +58,7 @@ export default {
}
}}>
{
this.localFields.map(i => {
[{field:'id',name:'id'},...this.localFields].map(i => {
return (
<el-option value={ i.field } label={ i.name }></el-option>
)

Loading…
Cancel
Save