Compare commits

...

10 Commits

@ -4,3 +4,5 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net
VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file
VUE_APP_AUTH_BASE_API = http://ids.szhct.edu.cn/authserver/oauth2.0/authorize
VUE_APP_VIEW_API=http://view.ali251.langye.net:8012/onlinePreview

@ -1,6 +1,13 @@
# just a flag
ENV = 'production'
ENV='production'
# base api
VUE_APP_BASE_API = http://192.168.105.242
VUE_APP_UPLOAD_API = http://192.168.105.242/api/admin/upload-file
VUE_APP_BASE_API=http://192.168.105.242
#VUE_APP_BASE_API = https://zlhb.szhct.edu.cn
VUE_APP_UPLOAD_API=http://192.168.105.242/api/admin/upload-file
#VUE_APP_UPLOAD_API = https://zlhb.szhct.edu.cn/api/admin/upload-file
#VUE_APP_AUTH_BASE_API=https://sso.szhct.edu.cn/cas/oauth2.0/authorize
VUE_APP_AUTH_BASE_API=http://ids.szhct.edu.cn/authserver/oauth2.0/authorize
#VUE_APP_AUTH_BASE_API = https://zlhb.szhct.edu.cn/cas/oauth2.0/authorize
VUE_APP_VIEW_API=https://zlhbview.szhct.edu.cn/onlinePreview
#VUE_APP_VIEW_API=http://192.168.105.242:8012/onlinePreview

@ -7,13 +7,13 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<script>
window._AMapSecurityConfig = {
securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec',
}
</script>
<script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=795a757114c371f42cee1f8efa527684&plugin=AMap.PlaceSearch'></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<!-- <script>-->
<!-- window._AMapSecurityConfig = {-->
<!-- securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec',-->
<!-- }-->
<!-- </script>-->
<!-- <script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=795a757114c371f42cee1f8efa527684&plugin=AMap.PlaceSearch'></script>-->
<!-- <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>-->
</head>
<body>
<noscript>

@ -3,7 +3,8 @@ import {getToken} from "@/utils/auth";
export function login (params, isLoading = false) {
return request({
url: '/api/user/login',
url: '/api/user/login_v2',
//url: '/api/user/login',
method: 'get',
params,
isLoading

@ -1,141 +1,141 @@
<template>
<div class="tinymce">
<Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
</div>
</template>
<script>
import {
uploads
} from '@/api/uploads.js'
import tinymce from "tinymce/tinymce";
import Editor from "@tinymce/tinymce-vue";
import "/public/tinymce/skins/skin.css";
import "/public/tinymce/langs/zh_CN";
import "tinymce/themes/silver/theme";
import "tinymce/plugins/media";
import "tinymce/plugins/lists";
import "tinymce/plugins/table";
import "tinymce/plugins/hr";
import "tinymce/plugins/autolink";
import "tinymce/plugins/help";
import "tinymce/plugins/visualblocks";
import "tinymce/plugins/fullscreen";
import "tinymce/plugins/textpattern";
import "tinymce/plugins/contextmenu";
import "tinymce/plugins/wordcount";
import "tinymce/plugins/colorpicker";
import "tinymce/plugins/textcolor";
import "tinymce/icons/default"
import 'tinymce/plugins/code'
import "tinymce/plugins/image"
<template>
<div class="tinymce">
<Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
</div>
</template>
<script>
import {
uploads
} from '@/api/uploads.js'
import tinymce from "tinymce/tinymce";
import Editor from "@tinymce/tinymce-vue";
import "/public/tinymce/skins/skin.css";
import "/public/tinymce/langs/zh_CN";
import "tinymce/themes/silver/theme";
import "tinymce/plugins/media";
import "tinymce/plugins/lists";
import "tinymce/plugins/table";
import "tinymce/plugins/hr";
import "tinymce/plugins/autolink";
import "tinymce/plugins/help";
import "tinymce/plugins/visualblocks";
import "tinymce/plugins/fullscreen";
import "tinymce/plugins/textpattern";
import "tinymce/plugins/contextmenu";
import "tinymce/plugins/wordcount";
import "tinymce/plugins/colorpicker";
import "tinymce/plugins/textcolor";
import "tinymce/icons/default"
import 'tinymce/plugins/code'
import "tinymce/plugins/image"
import "tinymce/plugins/imagetools"
import "/public/tinymce/plugins/axupimgs/plugin.js"
export default {
components: {
Editor
},
props: {
height: {
type: Number,
default: 300,
},
value: {
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
plugins: {
type: [String, Array],
default: "code image axupimgs paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
},
toolbar: {
type: [String, Array],
default: ` undo redo restoredraft | code | image | axupimgs | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
},
menubar: {
type: String,
default: "edit insert view format table CardBtn",
},
},
data() {
return {
myValue: this.value,
showImg: false,
imgUploadUrl: `${process.env.VUE_APP_UPLOAD_API}`,
init: {
language_url: "/public/tinymce/langs/zh_CN.js", //
language: "zh_CN",
height: this.height,
plugins: this.plugins,
fontsize_formats: "8px 10px 12px 14px 16px 18px 24px 28px 36px",
toolbar: this.toolbar,
branding: false,
menubar: this.menubar,
//
images_upload_url: this.imgUploadUrl,
images_upload_handler: (blobInfo, success, failure) => {
this.handleImgUpload(blobInfo, success, failure);
},
},
};
},
methods: {
handleImgUpload(blobInfo, success, failure) {
console.log("我要上传", blobInfo);
let self = this;
let file = blobInfo.blob();
const isLt2M = file.size / 1024 < 2048;
if (!isLt2M) {
failure("上传失败图片不可超过2M!");
return false;
}
let formdate = new FormData();
formdate.append("file", blobInfo.blob()); //imageFile
uploads(formdate).then(res => {
if (res) {
let url = res.url;
success(url); //url
} else {
failure(res.errmsg);
this.$message.error(res.errmsg);
}
})
}
},
computed: {},
mounted() {
tinymce.init({});
},
watch: {
value(newValue) {
this.myValue = newValue;
},
myValue(newValue) {
this.$emit("input", newValue);
},
},
};
</script>
<style scoped lang="scss">
.tinymce {
position: relative;
&__upload {
z-index: 2;
position: absolute;
right: 4px;
top: 0px;
}
::v-deep .tox.tox-tinymce.tox-fullscreen {
z-index: 0
}
}
import "/public/tinymce/plugins/axupimgs/plugin.js"
export default {
components: {
Editor
},
props: {
height: {
type: Number,
default: 300,
},
value: {
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
plugins: {
type: [String, Array],
default: "code image axupimgs paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
},
toolbar: {
type: [String, Array],
default: ` undo redo restoredraft | code | image | axupimgs | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
},
menubar: {
type: String,
default: "edit insert view format table CardBtn",
},
},
data() {
return {
myValue: this.value,
showImg: false,
imgUploadUrl: `${process.env.VUE_APP_UPLOAD_API}`,
init: {
language_url: "/public/tinymce/langs/zh_CN.js", //
language: "zh_CN",
height: this.height,
plugins: this.plugins,
fontsize_formats: "8px 10px 12px 14px 16px 18px 24px 28px 36px",
toolbar: this.toolbar,
branding: false,
menubar: this.menubar,
//
images_upload_url: this.imgUploadUrl,
images_upload_handler: (blobInfo, success, failure) => {
this.handleImgUpload(blobInfo, success, failure);
},
},
};
},
methods: {
handleImgUpload(blobInfo, success, failure) {
let self = this;
let file = blobInfo.blob();
const isLt2M = file.size / 1024 < 2048;
if (!isLt2M) {
failure("上传失败图片不可超过2M!");
return false;
}
let formdate = new FormData();
formdate.append("file", blobInfo.blob()); //imageFile
uploads(formdate).then(res => {
if (res) {
let url = res.url;
console.log(url,333)
success(url); //url
} else {
failure(res.errmsg);
this.$message.error(res.errmsg);
}
})
}
},
computed: {},
mounted() {
tinymce.init({});
},
watch: {
value(newValue) {
this.myValue = newValue;
},
myValue(newValue) {
this.$emit("input", newValue);
},
},
};
</script>
<style scoped lang="scss">
.tinymce {
position: relative;
&__upload {
z-index: 2;
position: absolute;
right: 4px;
top: 0px;
}
::v-deep .tox.tox-tinymce.tox-fullscreen {
z-index: 0
}
}
</style>

@ -5,12 +5,16 @@ import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import {getToken, setToken} from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title'
import { login } from "@/api/reception/index"
import { login } from "@/api/reception/index";
import axios from "axios";
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login'] // no redirect whitelist
const verifyToken = (token) => {
return !(!token || token === "undefined" || token === "null" || token === "false");
}
router.beforeEach(async(to, from, next) => {
// start progress bar
NProgress.start()
@ -21,19 +25,28 @@ router.beforeEach(async(to, from, next) => {
if (/^\/index\/.*/.test(to.path)) {
//setToken('31|wFxoNgXTLwNke7CCjfCyFYd3x4s9WG74VKpYyi8S','ReceptionTokenKey')
if (getToken('ReceptionTokenKey')) {
if (verifyToken(getToken('ReceptionTokenKey'))) {
next()
} else {
if (to.query.code) {
login({
code: to.query.code
}).then(res => {
setToken(res.token,'ReceptionTokenKey')
next()
if (res.token) {
setToken(res.token,'ReceptionTokenKey')
next()
} else {
Message.error("登录失败")
}
}).catch(err => {
Message.error("登录失败")
})
} else {
let redirectUri = encodeURIComponent(window.location.href)
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`
let client_id = '1172128036016324608' // new
//let client_id = 'db85478e4dd36937'
//let client_id = 'd05e4c9d07f705ef' dev
window.location.href = `${process.env.VUE_APP_AUTH_BASE_API}?client_id=${client_id}&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
}
}
@ -42,7 +55,7 @@ router.beforeEach(async(to, from, next) => {
// determine whether the user has logged in
const hasToken = getToken()
if (hasToken) {
if (verifyToken(hasToken)) {
if (to.path === '/login') {
// if is logged in, redirect to the home page
next({ path: '/' })

@ -1,7 +1,7 @@
<template>
<div>
<Input
v-model="select.filter[0].value"
v-model="select.filter[1].value"
search
enter-button
placeholder="请输入名称搜索"

@ -16,7 +16,7 @@ export default {
return (
<el-scrollbar>
<div
style={{ "max-height": "50px" }}
style={{ "max-height": "400px","min-height": "50px" }}
domPropsInnerHTML={this.detail[field]}
></div>
</el-scrollbar>

@ -309,7 +309,11 @@ export default {
class: "el-upload__tip",
slot: "tip",
},
"文件不超过500kb"
[
h('span','支持文件格式:.docx.xlsx.pdf.png.jpg'),
h('br'),
h('span','单个文件不能超过50M')
]
),
];
}
@ -319,11 +323,12 @@ export default {
let props = {};
if (info.edit_input === "file" || info.edit_input === "files") {
props.fileList = this.file[info.field];
props.accept = ".doc,.docx,.pdf,.jpg,.png,.xls,.xlsx"
props.beforeUpload = (file) => {
if (file.size / 1000 > 500) {
if (file.size / 1000 > 50 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过500kb",
message: "上传文件大小超过50Mb",
});
return false;
}
@ -357,6 +362,7 @@ export default {
}
}
this.form["faburiqi"] = this.$moment(new Date()).format("YYYY-MM-DD");
this.form["shenhebumen"] = this.$store.state.user.department?.id;
this.$refs["elForm"].clearValidate();
},
show() {
@ -392,7 +398,7 @@ export default {
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
name: i?.original_name,
url: i?.url,
response: i,
};
@ -425,6 +431,7 @@ export default {
//TODO:
if (/^\/manage/.test(this.$route.path)) {
this.form["zhuangtai"] = 0;
this.form["dianjiliang"] = 0;
}
if (this.tableName === "materials") {
this.form["leixing"] = Number(this.$route.meta.params.type);
@ -601,8 +608,8 @@ export default {
}
//
if (i.field === 'shenhebumen') {
this.form[i.field] = this.$store.state.user.department?.id
if (i.field === "shenhebumen") {
this.form[i.field] = this.$store.state.user.department?.id;
}
if (i.field === "faburiqi") {
this.form[i.field] = this.$moment(new Date()).format(
@ -614,7 +621,17 @@ export default {
/^\/manage\/form/.test(this.$route.fullPath)
) {
this.rules[i.field] = [
{ required: true, message: `请选择${i.name}` },
{
required: true,
message: `请选择${i.name}`,
validator: (rule, value, callback) => {
if (this.file[i.field] && this.file[i.field].length > 0) {
callback();
} else {
callback(new Error("请选择附件"));
}
},
},
];
}
}
@ -633,6 +650,9 @@ export default {
this.init();
this.$refs["elForm"].clearValidate();
delete this.form.id;
for (let key in this.file) {
this.file[key] = [];
}
}
},
},

@ -54,110 +54,118 @@ export default {
(() => {
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,
if (
!/\/manage\/rule/.test(this.$route.fullPath) &&
!!["nianfen", "bianhao", "wenjian"].find(
(j) => j === i.field
)
) {
} else {
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);
}
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%",
},
},
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,
},
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: {
"uploaded-a":
"el-icon-circle-check":
file.status === "success",
"el-icon-loading":
file.status === "uploading",
},
style: {
'padding': '0 4px'
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
),
},
file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
}
});
return dom;
})()

@ -434,6 +434,7 @@ export default {
value1: false,
op,
select: {
is_auth: 1,
table_name: "",
filter: [
{
@ -648,12 +649,10 @@ export default {
if (i.edit_input === "richtext") {
linkOb.customFn = (row) => {
return (
<el-scrollbar>
<div
style={{ "max-height": "50px" }}
domPropsInnerHTML={row[i.field]}
></div>
</el-scrollbar>
<div
style={{ "max-height": "55px","overflow": "scroll" }}
domPropsInnerHTML={row[i.field]}
></div>
);
};
}
@ -699,19 +698,31 @@ export default {
if (link_relation === "hasMany" || link_relation === "newHasMany") {
linkOb.customFn = (row) => {
return (
<div>
{row[link_with_name]?.map((o) => (
<p>
{o?.name ||
o?.no ||
o?.value ||
o?.biaoti ||
o?.mingcheng}
</p>
))}
</div>
);
if (i.edit_input === "files") {
return (
<div style="display: flex;flex-direction: column;">
{row[link_with_name]?.map((o) => (
<a>
{ o?.original_name || o?.name }
</a>
))}
</div>
)
} else {
return (
<div>
{row[link_with_name]?.map((o) => (
<p>
{o?.name ||
o?.no ||
o?.value ||
o?.biaoti ||
o?.mingcheng}
</p>
))}
</div>
);
}
};
}
}
@ -727,6 +738,7 @@ export default {
label: i.name,
width: i.width,
fixed: i.is_fixed,
align: i.field === 'biaoti' ? 'left' : 'center'
},
linkOb
)

@ -343,6 +343,7 @@ export default {
return {
op,
select: {
is_auth: 1,
table_name: "",
filter: [
{
@ -587,13 +588,31 @@ export default {
if (link_relation === "hasMany" || link_relation === "newHasMany") {
linkOb.customFn = (row) => {
return (
<div>
{row[link_with_name]?.map((o) => (
<p>{ o?.name || o?.no || o?.value || o?.biaoti || o?.mingcheng }</p>
))}
</div>
);
if (i.edit_input === "files") {
return (
<div style="display: flex;flex-direction: column;">
{row[link_with_name]?.map((o) => (
<a>
{ o?.original_name || o?.name }
</a>
))}
</div>
)
} else {
return (
<div>
{row[link_with_name]?.map((o) => (
<p>
{o?.name ||
o?.no ||
o?.value ||
o?.biaoti ||
o?.mingcheng}
</p>
))}
</div>
);
}
};
}
}
@ -602,7 +621,7 @@ export default {
prop: i.field,
label: i.name,
width: i.width,
fixed: i.is_fixed,
align: i.field === 'biaoti' ? 'left' : 'center',
},
linkOb
);

@ -15,11 +15,13 @@ import { index } from '@/api/system/baseForm'
data() {
return {
select1: {
is_auth: 1,
table_name: 'materials',
sort_name: 'created_at',
sort_type: 'desc'
},
select2: {
is_auth: 1,
table_name: 'materials',
sort_name: 'dianjiliang',
sort_type: 'desc'
@ -88,7 +90,7 @@ import { index } from '@/api/system/baseForm'
<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>
<a href={i.url} download={i.original_name || i.name} class="uploaded-a" style="padding-left: 10px;">{ i.original_name || i.name }</a>
)
})
}</div>

@ -10,13 +10,19 @@
:action="action"
:file-list="fileList"
:auto-upload="false"
accept=".doc,.docx,.pdf,.jpg,.png,.xls,.xlsx"
:before-upload="beforeUpload"
:on-success="onSuccess"
:on-remove="onRemove"
multiple
:on-error="onError">
<el-button slot="trigger" size="small" type="primary">选取文件</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>
<div slot="tip" class="el-upload__tip">
<span>支持文件格式.docx.xlsx.pdf.png.jpg</span>
<br>
<span>单个文件不能超过50M</span>
</div>
</el-upload>
<formList ref="formList" @selected="selectedHandler"></formList>
@ -47,10 +53,10 @@ export default {
},
beforeUpload (file) {
if (file.size / 1000 > 500) {
if (file.size / 1000 > 50 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过500kb",
message: "上传文件大小超过500Mb",
});
return false;
}
@ -78,7 +84,13 @@ export default {
watch: {
'form.id_material_fujian_uploads_material_id_relation': {
handler (newVal) {
this.fileList = newVal
this.fileList = newVal.map(i => {
return {
name: i?.original_name,
url: i?.url,
response: i,
}
})
},
deep: true
}

@ -43,21 +43,6 @@ export default {
width: 54,
type: 'selection'
},
{
key: 'nianfen',
title: '年份',
width: 100
},
{
key: 'wenjian',
title: '文件',
width: 120
},
{
key: 'bianhao',
title: '编号',
width: 120
},
{
key: 'files',
title: '附件',

@ -41,7 +41,7 @@
<div class="file" v-if="info.id_material_fujian_uploads_material_id_relation && info.id_material_fujian_uploads_material_id_relation.length > 0">
<p class="file__text">附件</p>
<div class="file__item" v-for="item in info.id_material_fujian_uploads_material_id_relation">
<a>{{ item.name }}</a>
<a>{{ item.original_name || item.name }}</a>
<div class="file__item--btn" @click="open(item)"></div>
<i class="el-icon-download file__item--down" @click="down(item)"></i>
</div>
@ -73,7 +73,7 @@
<script>
import formType from "@/const/formType"
import { detail } from "@/api/reception"
import {download} from "@/utils/downloadRequest";
import { download } from "@/utils/downloadRequest";
export default {
data() {
return {
@ -97,7 +97,7 @@ export default {
}).catch(err => this.loading = false)
},
open(e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(
this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(
new Buffer(e.url).toString("base64")
)}`;
@ -166,6 +166,9 @@ export default {
position: relative;
left: 50%;
}
.content {
overflow: scroll;
}
.file {
margin-top: 10px;
@ -210,4 +213,14 @@ export default {
}
}
a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
a:hover {
color: red;
text-decoration: underline;
}
</style>

@ -250,7 +250,7 @@ export default {
},
methods: {
open (e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(new Buffer(e.url).toString('base64'))}`
this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(new Buffer(e.url).toString('base64'))}`
this.showModal = true
//window.open(`http://view.ali251.langye.net:8012/onlinePreview?url=${codeUri}`)

@ -57,7 +57,7 @@
:command="item"
v-for="item in uploadsList"
>
{{ item.name }}
{{ item.original_name }}
</el-dropdown-item>
</template>
<template v-else>
@ -72,7 +72,7 @@
placement="bottom-start"
@command="down"
>
<i class="el-icon-download" @click="getDetail(i)"></i>
<i class="el-icon-download" @click="getDetail(i,false)"></i>
<template #dropdown>
<el-dropdown-menu v-if="load">
<div
@ -221,7 +221,7 @@ export default {
this.loading = false;
},
async getDetail(i) {
async getDetail(i,isOpen=true) {
this.load = true;
const res = await detail({
table_name: "materials",
@ -229,14 +229,14 @@ export default {
});
this.uploadsList =
res.detail?.id_material_fujian_uploads_material_id_relation || [];
if (this.uploadsList.length === 1) {
if (this.uploadsList.length === 1 && isOpen) {
this.open(this.uploadsList[0])
}
this.load = false;
},
open(e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(
this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(
new Buffer(e.url).toString("base64")
)}`;

@ -85,10 +85,16 @@ export default {
this.chart = echarts.init(document.getElementById('line-chart'))
let xAxis = [];
for (let key in this.data) {
xAxis.push(this.data[key][0]?.leixing)
xAxis.push(this.data[key][0]?.date)
break
}
this.chart.setOption(
{
tooltip: {
axisPointer: {
type: 'cross'
}
},
xAxis: {
type: 'category',
data: xAxis
@ -100,9 +106,9 @@ export default {
let data = []
for (let key in this.data) {
data.push({
name: this.data[key][0]?.leixing,
data: this.data[key].map(i => i.total),
type: 'line',
smooth: true,
type: 'bar',
})
}

Loading…
Cancel
Save