From 231437fae11435864987262c6f8f28daeda7b22d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com>
Date: Wed, 25 May 2022 15:25:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E6=A1=86=E6=9E=B6=E6=80=A7?=
=?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/components/importExcel/index.vue | 2 +-
web/src/install.js | 24 +++++++++++++++++++-----
web/src/plugin/d2admin/index.js | 2 --
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/web/src/components/importExcel/index.vue b/web/src/components/importExcel/index.vue
index c806624..6c4c646 100644
--- a/web/src/components/importExcel/index.vue
+++ b/web/src/components/importExcel/index.vue
@@ -59,7 +59,7 @@ export default {
// 设置上传的请求头部
headers: { Authorization: 'JWT ' + util.cookies.get('token') },
// 上传的地址
- url: process.env.VUE_APP_API + '/api/system/file/'
+ url: util.baseURL() + '/api/system/file/'
}
}
},
diff --git a/web/src/install.js b/web/src/install.js
index 9b48ce3..4219c02 100644
--- a/web/src/install.js
+++ b/web/src/install.js
@@ -18,8 +18,7 @@ import XEUtils from 'xe-utils'
import store from '@/store/index'
import { urlPrefix as deptPrefix } from '@/views/system/dept/api'
import types from '@/config/d2p-extends/types'
-import { checkPlugins } from '@/views/plugins'
-const uploadUrl = util.baseURL() + 'api/system/file/'
+import { checkPlugins, plugins } from '@/views/plugins'
/**
// vxe0
@@ -32,7 +31,8 @@ const uploadUrl = util.baseURL() + 'api/system/file/'
// 按如下重命名引入可与官方版共存,index.vue中标签用使用加强版
// 不传name,则d2CrudX的标签仍为,不可与官方版共存
Vue.use(d2CrudX, { name: 'd2-crud-x' })
-
+// 注册dvadmin插件
+Vue.use(plugins)
// // 官方版【此处为演示与官方版共存而引入,全新项目中可以用d2-crud-x完全替代官方版】
// Vue.use(d2Crud)
/**
@@ -167,7 +167,7 @@ Vue.use(D2pUploader, {
domain: 'http://d2p.file.veryreader.com'
},
form: {
- action: uploadUrl,
+ action: util.baseURL() + 'api/system/file/',
name: 'file',
data: {}, // 上传附加参数
headers () {
@@ -180,7 +180,7 @@ Vue.use(D2pUploader, {
if (ret.data === null || ret.data === '') {
throw new Error('上传失败')
}
- return { url: util.baseURL() + ret.data.url, key: option.data.key }
+ return { url: util.baseURL() + ret.data.url, key: option.data.key, id: ret.data.id }
},
withCredentials: false // 是否带cookie
}
@@ -368,6 +368,20 @@ Vue.prototype.commonEndColumns = function (param = {}) {
title: '创建时间',
key: 'create_datetime',
width: 160,
+ search: {
+ disabled: !showData.create_datetime.showForm,
+ width: 240,
+ component: { // 查询框组件配置,默认根据form配置生成
+ name: 'el-date-picker',
+ props: {
+ type: 'daterange',
+ 'range-separator': '至',
+ 'start-placeholder': '开始',
+ 'end-placeholder': '结束',
+ valueFormat: 'yyyy-MM-dd'
+ }
+ }
+ },
show: showData.create_datetime.showTable,
type: 'datetime',
sortable: true,
diff --git a/web/src/plugin/d2admin/index.js b/web/src/plugin/d2admin/index.js
index e2f20b5..311c347 100644
--- a/web/src/plugin/d2admin/index.js
+++ b/web/src/plugin/d2admin/index.js
@@ -16,7 +16,6 @@ import pluginError from '@/plugin/error'
import pluginLog from '@/plugin/log'
import pluginOpen from '@/plugin/open'
import tableSelector from '@/components/table-selector/index'
-import { plugins } from '@/views/plugins/index.js'
export default {
async install (Vue, options) {
// 设置为 false 以阻止 vue 在启动时生成生产提示
@@ -40,6 +39,5 @@ export default {
Vue.use(pluginLog)
Vue.use(pluginOpen)
Vue.use(tableSelector)
- Vue.use(plugins)
}
}