master
xy 3 years ago
parent 2385d20455
commit 4a0091d1b9

@ -1,13 +1,47 @@
import request from "@/utils/request";
import {getToken} from "@/utils/auth";
export function login (params) {
export function login (params, isLoading = false) {
return request({
headers: {
['Authorization']: 'Bearer' + getToken('ReceptionTokenKey')
},
url: '/api/user/login',
method: 'get',
params
params,
isLoading
})
}
export function home (params, isLoading = false) {
return request({
url: '/api/user/home',
method: 'get',
params,
isLoading
})
}
export function departments (params, isLoading = false) {
return request({
url: '/api/user/departments',
method: 'get',
params,
isLoading
})
}
export function tags (params, isLoading = false) {
return request({
url: '/api/user/tags',
method: 'get',
params,
isLoading
})
}
export function materials (params, isLoading = false) {
return request({
url: '/api/user/materials',
method: 'get',
params,
isLoading
})
}

@ -19,19 +19,21 @@ router.beforeEach(async(to, from, next) => {
document.title = getPageTitle(to.meta.title)
if (/^\/index\/.*/.test(to.path)) {
if (getToken('RecptionTokenKey')) {
setToken('31|wFxoNgXTLwNke7CCjfCyFYd3x4s9WG74VKpYyi8S','ReceptionTokenKey')
if (getToken('ReceptionTokenKey')) {
next()
} else {
if (to.query.code) {
login({
code: to.query.code
}).then(res => {
setToken(res.access_token,'RecoveryTokenKey')
setToken(res.token,'ReceptionTokenKey')
next()
})
} else {
let redirectUri = encodeURIComponent(window.location.href)
window.location.href = `http://sso.szhct.edu.cn/oauth/authorize?client_id=d05e4c9d07f705ef&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
window.location.href = `https://sso.szhct.edu.cn/cas/oauth2.0/authorize?client_id=d05e4c9d07f705ef&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
}
}

@ -1,7 +1,7 @@
import Cookies from 'js-cookie'
const TokenKey = 'weiyuan_doc_token'
const RecptionTokenKey = 'weiyuan_doc_reception_token'
const ReceptionTokenKey = 'weiyuan_doc_reception_token'
export function getToken(key = TokenKey) {
return Cookies.get(key)
}

@ -14,13 +14,14 @@ let loading ;
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000, // request timeout
timeout: 10000, // request timeout
isLoading:true
})
// request interceptor
service.interceptors.request.use(
config => {
console.log(config)
if(config.isLoading){
loading = Loading.service({
lock:true,
@ -30,13 +31,17 @@ service.interceptors.request.use(
}
// do something before request is sent
if (store.getters.token && !config.headers['Authorization']) {
if (!config.headers['Authorization']) {
// let each request carry token
// ['X-Token'] is a custom headers key
// please modify it according to the actual situation
//config.headers['X-Token'] = getToken();
config.headers['Authorization'] = "Bearer " + getToken()
if (/^\/index\/.*/.test(window.location.href.split('#')[1])) {
config.headers['Authorization'] = "Bearer " + getToken("ReceptionTokenKey")
} else {
config.headers['Authorization'] = "Bearer " + getToken()
}
}
return config
},

@ -1,48 +1,136 @@
<template>
<div>
<el-select multiple collapse-tags value-key="id" style="width: 100%" v-model="value" @change="change">
<el-option v-for="item in tags" :value="item.mingcheng" :label="item.mingcheng"></el-option>
</el-select>
<Input
v-model="select.filter[0].value"
search
enter-button
placeholder="请输入名称搜索"
@on-search="search"
/>
<div class="tags-container" v-loading="loading">
<el-scrollbar wrap-class="scrollbar-wrapper-biaoqian">
<div style="max-height: 180px">
<el-checkbox-group
size="mini"
ref="content"
v-model="value"
v-infinite-scroll="getTags"
infinite-scroll-delay="200"
infinite-scroll-disabled="disabled"
@change="change"
>
<el-checkbox border :label="item.id" v-for="item in tags">{{
item.mingcheng
}}</el-checkbox>
</el-checkbox-group>
<Divider v-if="noMore"></Divider>
</div>
</el-scrollbar>
</div>
</div>
</template>
<script>
import { index } from "@/api/system/baseForm"
import { index } from "@/api/system/baseForm";
export default {
props: {
fieldInfo: Object,
form: Object
form: Object,
},
data() {
return {
value: '',
loading: false,
noMore: false,
originalValue: [],
value: [],
tags: [],
}
select: {
page: 1,
page_size: 20,
table_name: "tags",
filter: [
{
key: "mingcheng",
op: "like",
value: "",
},
],
},
};
},
methods: {
async getTags () {
const res = await index({
page: 1,
page_size: 9999,
table_name: 'tags',
async getTags() {
if (this.noMore) return;
this.loading = true;
const res = await index(this.select);
if (res.data.length < this.select.page_size) {
this.noMore = true;
} else {
this.select.page++;
}
this.tags.push(...res.data);
this.loading = false;
},
search() {
this.noMore = false;
this.select.page = 1;
this.tags = [];
this.loadHeight();
},
loadHeight() {
if (!this.noMore) {
this.$nextTick(() => {
if (this.$refs["content"].$el.getBoundingClientRect().height < 180) {
this.getTags().then((_) => {
this.loadHeight();
});
}
});
}
},
change(e) {
let tagObjs = []
this.value.forEach(i => {
let tag = this.tags.find(tag => tag.id === i)
tagObjs.push({
tag_id: tag.id,
tag
})
})
this.tags = res.data
this.$emit("update", tagObjs);
},
},
computed: {
disabled() {
return this.loading || this.noMore;
},
change (e) {
this.$emit('update', this.value.toString())
}
},
computed: {},
watch: {
'form.biaoqian' (newVal) {
this.value = newVal.split(',')
}
"form.biaoqian_tags_id_relation"(newVal) {
this.originalValue = newVal;
this.value = [];
},
},
created() {
this.getTags()
}
}
created() {},
};
</script>
<style scoped lang="scss">
.tags-container {
min-height: 80px;
border-radius: 6px;
border: 1px dotted $primaryColor;
margin: 20px 0;
padding: 10px 20px;
}
</style>
<style>
.scrollbar-wrapper-biaoqian {
overflow-x: hidden;
}
</style>

@ -395,6 +395,9 @@ export default {
if (validate) {
let copyForm = deepCopy(this.form)
this.formInfo.forEach((info) => {
if (copyForm[info._relations?.link_with_name]) {
return
}
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);

@ -24,6 +24,7 @@
</template>
</el-descriptions>
<div class="title">日志</div>
<Table style="margin: 0 10px;" stripe :loading="isLoading" :data="logs" :columns="logTable">
</Table>
</template>
@ -170,4 +171,10 @@ export default {
padding-bottom: 20px;
}
.title {
font-weight: 600;
padding: 10px 20px;
}
</style>

@ -5,10 +5,8 @@
:visible.sync="isShow"
size="80%"
direction="rtl"
title="审核"
>
<template #title>
<el-button>审核</el-button>
</template>
<template>
<el-descriptions
size="medium"
@ -26,15 +24,42 @@
</template>
</el-descriptions>
<div class="title">日志</div>
<Table style="margin: 0 10px;" stripe :loading="isLoading" :data="logs" :columns="logTable">
</Table>
<div class="title">审核</div>
<div class="form">
<div class="form__item">
<div class="form__item--label">
状态选择
</div>
<el-select size="mini" v-model="detail.zhuangtai">
<el-option :disabled="item.disabled" v-for="item in [{ value: 3,label: '驳回' },{ value: 0,label: '已保存',disabled: true },{ value: 1,label: '待审核',disabled: true },{ value: 2,label: '已审核' },{ value: 4,label: '审核并发布' }]" :value="item.value" :label="item.label"></el-option>
</el-select>
</div>
<div class="form__item">
<div class="form__item--label">
备注/驳回原因
</div>
<el-input v-model="detail.beizhu" type="textarea" :autosize="{ minRows: 2 }">
</el-input>
</div>
<div class="form__item">
<el-button type="primary" @click="submit"></el-button>
</div>
</div>
</template>
</el-drawer>
</div>
</template>
<script>
import { show, index } from "@/api/system/baseForm";
import { show, index, save } from "@/api/system/baseForm";
import descriptionItem from "@/views/component/descriptionItem.vue";
export default {
@ -115,6 +140,24 @@ export default {
})
this.logs = res.data
console.log(123,res)
},
submit () {
if (!this.detail.zhuangtai) {
this.$message({
type: 'warning',
message: '请选择状态'
})
return
}
save(Object.assign({ table_name: this.tableName },this.detail)).then(res => {
this.$message({
type: 'success',
message: '操作成功'
})
this.hidden()
this.$emit('refresh')
})
}
},
computed: {
@ -172,4 +215,23 @@ export default {
padding-bottom: 20px;
}
.title {
font-weight: 600;
padding: 10px 20px;
}
.form {
.form__item {
display: flex;
padding: 0 20px;
margin-bottom: 20px;
&--label {
min-width: 140px;
}
}
}
</style>

@ -63,9 +63,21 @@
<Option
v-for="item in getColumnParams(select.filter[1].key)"
:key="item.id"
:value="getColumnField(select.filter[1].key)._relations ? item[getColumnField(select.filter[1].key)._relations.foreign_key] : item.value"
:value="
getColumnField(select.filter[1].key)._relations
? item[
getColumnField(select.filter[1].key)._relations
.foreign_key
]
: item.value
"
>{{
item.key || item.value || item.name || item.no || item.mingcheng || item.id
item.key ||
item.value ||
item.name ||
item.no ||
item.mingcheng ||
item.id
}}</Option
>
</Select>
@ -161,9 +173,21 @@
<Option
v-for="item in getColumnParams(item.key)"
:key="item.id"
:value="getColumnField(item.key)._relations ? item[getColumnField(item.key)._relations.foreign_key] : item.value"
:value="
getColumnField(item.key)._relations
? item[
getColumnField(item.key)._relations
.foreign_key
]
: item.value
"
>{{
item.key || item.value || item.name || item.no || item.mingcheng || item.id
item.key ||
item.value ||
item.name ||
item.no ||
item.mingcheng ||
item.id
}}</Option
>
</Select>
@ -246,7 +270,7 @@
:border="true"
:action="index"
:req-opt="select"
:destroy-req-opt="{ 'table_name': customForm.tableName }"
:destroy-req-opt="{ table_name: customForm.tableName }"
:table-item="table"
@detail="
(row) => {
@ -264,14 +288,14 @@
>
<template #submit="scope">
<template v-if="scope.row.zhuangtai == 0">
<Button type="primary"
size="small"
@click="submit(scope, 1)">提交</Button>
<Button type="primary" size="small" @click="submit(scope, 1)"
>提交</Button
>
</template>
<template v-else>
<Button type="primary"
size="small"
@click="submit(scope, 0)">下架</Button>
<Button type="error" ghost size="small" @click="submit(scope, 0)"
>下架</Button
>
</template>
</template>
</xy-table>
@ -282,11 +306,23 @@
ref="dialog"
@refresh="$refs['xyTable'].getTableData()"
>
<template #fujian="{ fieldInfo, form, file }" v-if="$route.meta.params && $route.meta.params.type == 1">
<flow :field-info="fieldInfo" :form="form" :file="file" @update="val => form['fujian'] = val"></flow>
<template
#fujian="{ fieldInfo, form, file }"
v-if="$route.meta.params && $route.meta.params.type == 1"
>
<flow
:field-info="fieldInfo"
:form="form"
:file="file"
@update="(val) => (form['fujian'] = val)"
></flow>
</template>
<template #biaoqian="{ fieldInfo, form, file }">
<biaoqian :field-info="fieldInfo" :form="form" @update="val => form['biaoqian'] = val"></biaoqian>
<biaoqian
:field-info="fieldInfo"
:form="form"
@update="(val) => (form['biaoqian_tags_id_relation'] = val)"
></biaoqian>
</template>
</dialoger>
<drawer
@ -300,6 +336,7 @@
ref="imports"
@refresh="$refs['xyTable'].getTableData()"
></imports>
</div>
</template>
@ -324,6 +361,7 @@ 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: {
LxHeader,
@ -331,10 +369,11 @@ export default {
headerContent,
drawer,
imports,
examine,
flow,
biaoqian,
fujian
fujian,
},
mixins: [authMixin],
provide: {
@ -347,9 +386,9 @@ export default {
table_name: "",
filter: [
{
key: this.$route.meta.params?.type ? "leixing" : '',
op: this.$route.meta.params?.type ? "eq" : '',
value: this.$route.meta.params?.type || '',
key: this.$route.meta.params?.type ? "leixing" : "",
op: this.$route.meta.params?.type ? "eq" : "",
value: this.$route.meta.params?.type || "",
},
{
key: "",
@ -424,21 +463,23 @@ export default {
target.value = `${temp ? temp : ""},${e}`;
},
//
submit (scope, setType) {
save(Object.assign( deepCopy(scope.row), { 'zhuangtai': setType,'table_name': this.customForm.tableName })).then(res => {
this.$message({
type: 'success',
message: '操作成功'
submit(scope, setType) {
save(
Object.assign(deepCopy(scope.row), {
zhuangtai: setType,
table_name: this.customForm.tableName,
})
).then((res) => {
this.$message({
type: "success",
message: "操作成功",
});
this.$refs['xyTable'].getTableData()
})
this.$refs["xyTable"].getTableData();
});
},
async getFormDetail() {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
@ -457,20 +498,26 @@ export default {
//
//
let baseTable = new Map([
['departments', async () => {
const res = await listdept()
return res
}],
['admins',[]]
])
[
"departments",
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)
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 ||
@ -481,33 +528,37 @@ export default {
}
fieldRes?.data?.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 => {
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,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
}
}
});
@ -517,35 +568,37 @@ export default {
.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
@ -558,16 +611,16 @@ 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>
@ -595,7 +648,7 @@ export default {
label: "序号",
});
console.log(111,this.form)
console.log(111, this.form);
},
},
@ -603,7 +656,9 @@ export default {
columnArrTest() {
return function (field) {
return this.form?.find((i) => i.field === field)
? this.form.find((i) => i.field === field).search_input === "checkbox" || this.form.find((i) => i.field === field).search_input === "radio"
? this.form.find((i) => i.field === field).search_input ===
"checkbox" ||
this.form.find((i) => i.field === field).search_input === "radio"
: false;
};
},
@ -623,7 +678,6 @@ export default {
},
//TODO:
},
created() {
this.getFormDetail();
@ -666,5 +720,4 @@ a:hover {
color: red;
text-decoration: underline;
}
</style>

@ -14,7 +14,7 @@
<template #search>
<div style="display: flex">
<Select
v-model="select.filter[0].key"
v-model="select.filter[1].key"
style="width: 100px"
placeholder="搜索条目"
>
@ -26,7 +26,7 @@
>
</Select>
<Select
v-model="select.filter[0].op"
v-model="select.filter[1].op"
style="width: 100px; margin-left: 10px"
placeholder="搜索条件"
>
@ -39,31 +39,31 @@
</Select>
<template
v-if="
select.filter[0].op !== 'range' &&
!columnArrTest(select.filter[0].key)
select.filter[1].op !== 'range' &&
!columnArrTest(select.filter[1].key)
"
>
<Input
v-model="select.filter[0].value"
v-model="select.filter[1].value"
style="width: 150px; margin-left: 10px"
placeholder="请填写关键词"
/>
</template>
<template
v-else-if="
select.filter[0].op !== 'range' &&
columnArrTest(select.filter[0].key)
select.filter[1].op !== 'range' &&
columnArrTest(select.filter[1].key)
"
>
<Select
v-model="select.filter[0].value"
v-model="select.filter[1].value"
style="width: 150px; margin-left: 10px"
placeholder="请选择关键词"
>
<Option
v-for="item in getColumnParams(select.filter[0].key)"
v-for="item in getColumnParams(select.filter[1].key)"
:key="item.id"
:value="getColumnField(select.filter[0].key)._relations ? item[getColumnField(select.filter[0].key)._relations.foreign_key] : item.value"
:value="getColumnField(select.filter[1].key)._relations ? item[getColumnField(select.filter[1].key)._relations.foreign_key] : item.value"
>{{
item.key || item.value || item.name || item.no || item.mingcheng || item.id
}}</Option
@ -72,10 +72,10 @@
</template>
<template v-else>
<Input
:value="select.filter[0].value.split(',')[1]"
:value="select.filter[1].value.split(',')[1]"
style="width: 150px; margin-left: 10px"
placeholder="范围开始关键词"
@input="(e) => inputStartHandler(e, select.filter[0])"
@input="(e) => inputStartHandler(e, select.filter[1])"
/>
<span
style="
@ -89,7 +89,7 @@
:value="select.filter[1].value.split(',')[1]"
style="width: 150px; margin-left: 10px"
placeholder="范围结束关键词"
@input="(e) => inputEndHandler(e, select.filter[0])"
@input="(e) => inputEndHandler(e, select.filter[1])"
/>
</template>
<Button
@ -108,7 +108,7 @@
<div class="select">
<div
class="select__item"
v-for="(item, index) in select.filter"
v-for="(item, index) in select.filter.slice(1)"
:key="`${item.value}-${index}`"
>
<p>条件{{ index + 1 }}</p>
@ -261,30 +261,30 @@
}
"
>
<template #submit="scope">
<template v-if="scope.row.zhuangtai == 0">
<Button type="primary"
size="small"
@click="submit(scope, 1)">提交</Button>
<template #examine="scope">
<template v-if="scope.row.zhuangtai == 1">
<Button type="primary" size="small" @click="$refs['examine'].setId(scope.row.id),$refs['examine'].show()"
>审核</Button
>
</template>
<template v-if="scope.row.zhuangtai == 2">
<Button type="primary" ghost size="small" @click="submit(scope, 4)"
>发布</Button
>
</template>
<template v-else>
<Button type="primary"
size="small"
@click="submit(scope, 0)">下架</Button>
<template v-if="scope.row.zhuangtai == 4">
<Button style="margin-right: 6px;" type="primary" ghost size="small" @click="submit(scope, 2)"
>下架</Button
>
</template>
<template v-if="scope.row.zhuangtai == 4">
<Button type="error" ghost size="small" @click="submit(scope, 3)"
>驳回</Button
>
</template>
</template>
</xy-table>
<dialoger
:table-name="customForm.tableName"
:form-info="form"
ref="dialog"
@refresh="$refs['xyTable'].getTableData()"
>
<template #fujian="{ fieldInfo, form, file }" v-if="$route.meta.params && $route.meta.params.type == 1">
<flow :field-info="fieldInfo" :form="form" :file="file" @update="val => form['fujian'] = val"></flow>
</template>
</dialoger>
<drawer
:table-name="customForm.tableName"
:form-info="form"
@ -296,6 +296,13 @@
ref="imports"
@refresh="$refs['xyTable'].getTableData()"
></imports>
<examine
:table-name="customForm.tableName"
:form-info="form"
ref="examine"
@refresh="$refs['xyTable'].getTableData()"
></examine>
</div>
</template>
@ -312,21 +319,21 @@ import { saveAs } from "file-saver";
import { listdept } from "@/api/system/department";
import { deepCopy } from "@/utils";
import dialoger from "./dialog.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import headerContent from "@/components/LxHeader/XyContent.vue";
import drawer from "@/views/component/drawer.vue";
import imports from "./imports.vue";
import flow from "@/views/flow/flow.vue"
import examine from "@/views/component/examine.vue";
export default {
components: {
examine,
LxHeader,
dialoger,
headerContent,
drawer,
imports,
flow
flow,
},
mixins: [authMixin],
provide: {
@ -339,10 +346,15 @@ export default {
table_name: "",
filter: [
{
key: "",
op: "",
value: "",
key: "zhuangtai",
op: "range",
value: "1",
},
{
key: '',
op: '',
value: ''
}
],
},
form: [],
@ -360,7 +372,7 @@ export default {
reset() {
this.select.filter.splice(2);
this.select.filter[0] = {
key: "leixing",
key: "zhuangtai",
op: "eq",
value: this.$route.meta.params?.type,
};
@ -427,6 +439,11 @@ export default {
async getFormDetail() {
this.select.filter[0] = {
key: "zhuangtai",
op: "range",
value: this.$route.meta.params?.zhuangtai,
};
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
try {
@ -609,7 +626,6 @@ export default {
};
},
//TODO:
},
created() {

@ -9,9 +9,9 @@
</div>
<ul class="news__list">
<li class="news__list--item" v-for="i in 5">
<div>教育部关于公布高等学校信息公开事项清单的通知</div>
<div>{{ $moment(new Date()).format('YYYY-MM-DD') }}</div>
<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>
@ -23,9 +23,9 @@
</div>
<ul class="news__list">
<li class="news__list--item" v-for="i in 5">
<div>教育部关于公布高等学校信息公开事项清单的通知</div>
<div>{{ $moment(new Date()).format('YYYY-MM-DD') }}</div>
<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-col>
@ -44,7 +44,7 @@
<div class="department__list">
<div v-for="item in 14" class="department__list--item">
<div>{{item}}</div>
<div>{{ item }}</div>
</div>
<div class="department__list--item">
<div @click="$router.push('/index/department')">...</div>
@ -54,24 +54,37 @@
<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>
<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="index % 2 ? 'single-item label-item' : 'complex-item label-item'">
<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="
index % 2 ? 'single-item label-item' : 'complex-item label-item'
"
>
<p>{{ item }}</p>
</div>
</div>
<div class="label-group__right label-item"
:style="{ 'background': labelColor(index + 3) }"
v-if="group.right">
<div
class="label-group__right label-item"
:style="{ background: labelColor(index + 3) }"
v-if="group.right"
>
<p>{{ group.right }}</p>
</div>
</div>
@ -80,44 +93,63 @@
</template>
<script>
import {home} from '@/api/reception';
export default {
data() {
return {
labels: ['学籍管理','人才','补助','培养方案','综合科技','党建工作创新奖','处置','党建工作创新奖','处置','党建工作创新奖','处置'],
labelGroup: []
}
labels: [
"学籍管理",
"人才",
"补助",
"培养方案",
"综合科技",
"党建工作创新奖",
"处置",
"党建工作创新奖",
"处置",
"党建工作创新奖",
"处置",
],
labelGroup: [],
details: { hot: [], last: [] }
};
},
methods: {
async getInfo () {
this.details = await home()
},
labelsHandler() {
let groups = Math.ceil(this.labels.length / 4)
for(let i = 0; i < groups; i++) {
let group = this.labels.slice(i * 4,i * 4 + 4)
let groups = Math.ceil(this.labels.length / 4);
for (let i = 0; i < groups; i++) {
let group = this.labels.slice(i * 4, i * 4 + 4);
this.labelGroup.push({
left: group.slice(0, 3),
right: group[3] ? group[3] : false
})
right: group[3] ? group[3] : false,
});
}
console.log(this.labelGroup)
}
console.log(this.labelGroup);
},
},
computed: {
labelColor () {
let color = ["#85CBC8", "#67BCE6", "#5F97CA", "#7792C4"]
labelColor() {
let color = ["#85CBC8", "#67BCE6", "#5F97CA", "#7792C4"];
return function (index) {
return color[index % 4]
}
}
return color[index % 4];
};
},
},
created() {
this.labelsHandler()
}
}
this.getInfo();
this.labelsHandler();
},
};
</script>
<style scoped lang="scss">
.news {
padding: 33px 18.75% 38px 18.75%;
&__header {
@ -163,15 +195,13 @@ export default {
&--line {
flex: 1;
height: 1px;
background: #C7D9E5;
background: #c7d9e5;
margin-left: 10px;
}
}
&__list {
padding: 34px 0 0 26px;
&--item {
@ -180,7 +210,7 @@ export default {
align-items: center;
justify-content: space-between;
cursor: pointer;
transition: all .2ms;
transition: all 0.2ms;
position: relative;
@ -199,7 +229,7 @@ export default {
&:nth-child(2) {
color: #999999;
transition: all .2s;
transition: all 0.2s;
}
}
&::before {
@ -208,7 +238,7 @@ export default {
height: 6px;
border-radius: 6px;
background: #cad8e4;
transition: all .2s;
transition: all 0.2s;
position: absolute;
top: calc(50% - 3px);
@ -216,7 +246,6 @@ export default {
}
& + li {
margin-top: 20px;
}
}
@ -224,7 +253,8 @@ export default {
}
.department {
background: url("../../../assets/reception/department-bkg.png") no-repeat center;
background: url("../../../assets/reception/department-bkg.png") no-repeat
center;
background-size: cover;
margin-top: 37px;
@ -234,7 +264,6 @@ export default {
display: flex;
align-items: center;
&--linear {
background: #fff;
height: 2px;
@ -256,8 +285,7 @@ export default {
& > div:nth-child(2) {
font-size: 13px;
line-height: 13px;
color: #B6CEF0;
color: #b6cef0;
}
&::before {
@ -297,19 +325,20 @@ export default {
background: #fff;
width: 176px;
height: 80px;
color: #1A5CA3;
color: #1a5ca3;
font-size: 16px;
line-height: 80px;
text-align: center;
font-weight: 500;
cursor: pointer;
transition: all .2ms;
transition: all 0.2ms;
margin-bottom: 20px;
&:hover {
color: #fff;
background: url("../../../assets/reception/department-item1.png") no-repeat 0 0;
background: url("../../../assets/reception/department-item1.png")
no-repeat 0 0;
background-size: cover;
}
}
@ -325,7 +354,7 @@ export default {
& > div:nth-child(1) {
height: 161px;
width: 140px;
background: #F29D5B;
background: #f29d5b;
display: flex;
flex-direction: column;
align-items: center;
@ -336,7 +365,6 @@ export default {
color: #fff;
font-size: 16px;
font-weight: 500;
}
}
@ -353,7 +381,7 @@ export default {
align-items: center;
justify-content: center;
cursor: pointer;
transition: all .4s;
transition: all 0.4s;
&:hover {
transform: scale(1.1, 1.1);
@ -376,7 +404,6 @@ export default {
}
& > div:nth-last-child(1) {
flex-basis: 100%;
}
}
&__left--complex {
@ -396,13 +423,10 @@ export default {
}
& > div:nth-child(1) {
flex-basis: 100%;
}
}
&__right {
margin-left: 12px;
}
}

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/w-weishengxueyuan/app/weiyuan-document-service/public/admin',
outputDir: './dist',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save