parent
cd1b39e9d3
commit
5cb38b85bb
|
@ -21,23 +21,11 @@
|
||||||
将文件拖到此处,或
|
将文件拖到此处,或
|
||||||
<em>点击上传</em>
|
<em>点击上传</em>
|
||||||
</div>
|
</div>
|
||||||
<div slot="tip" class="el-upload__tip">
|
|
||||||
<el-checkbox size="medium" label="是否更新已经存在的数据" border v-model="upload.updateSupport"/>
|
|
||||||
<el-select v-if="upload.updateSupport" size="medium" v-model="upload.updateField" style="width: 130px"
|
|
||||||
placeholder="请选择更新字段依据">
|
|
||||||
<el-option
|
|
||||||
v-for="item in fieldOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
<div style="color: #b1b1b1;margin: 10px" v-if="upload.updateSupport">如果导入时需要更新数据,则请选择一个字段作为更新依据</div>
|
|
||||||
</div>
|
|
||||||
<div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
<div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="importTemplate">下载模板</el-button>
|
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="importTemplate">下载导入模板</el-button>
|
||||||
|
<el-button type="warning" style="font-size:14px;margin-top: 20px" @click="updateTemplate">批量更新模板</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
@ -74,13 +62,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importApi: { // 导入接口地址
|
api: { // 导入接口地址
|
||||||
type: String,
|
|
||||||
default () {
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
updateFieldApi: {
|
|
||||||
type: String,
|
type: String,
|
||||||
default () {
|
default () {
|
||||||
return undefined
|
return undefined
|
||||||
|
@ -101,7 +83,17 @@ export default {
|
||||||
/** 下载模板操作 */
|
/** 下载模板操作 */
|
||||||
importTemplate () {
|
importTemplate () {
|
||||||
downloadFile({
|
downloadFile({
|
||||||
url: util.baseURL() + this.importApi,
|
url: util.baseURL() + this.api + 'import_data/',
|
||||||
|
params: {},
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/***
|
||||||
|
* 批量更新模板
|
||||||
|
*/
|
||||||
|
updateTemplate () {
|
||||||
|
downloadFile({
|
||||||
|
url: util.baseURL() + this.api + 'update_template/',
|
||||||
params: {},
|
params: {},
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
@ -122,8 +114,7 @@ export default {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
url: response.data.url,
|
url: response.data.url,
|
||||||
updateSupport: that.upload.updateSupport,
|
updateSupport: that.upload.updateSupport
|
||||||
updateField: that.upload.updateField
|
|
||||||
}
|
}
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
// this.$alert("导入成功!", "导入结果", { dangerouslyUseHTMLString: true });
|
// this.$alert("导入成功!", "导入结果", { dangerouslyUseHTMLString: true });
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<el-divider content-position="left">消息中心</el-divider>
|
<el-divider content-position="left">消息中心</el-divider>
|
||||||
<div v-if="msgObj">
|
<div v-if="msgObj">
|
||||||
<h3>{{msgObj.title}}</h3>
|
<h3>{{msgObj.title}}</h3>
|
||||||
<div class="content-style">{{msgObj.content}}</div>
|
<div class="content-style" v-html="msgObj.content"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-empty :image-size="100"></el-empty>
|
<el-empty :image-size="100"></el-empty>
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
><i class="el-icon-plus" /> 新增</el-button
|
><i class="el-icon-plus" /> 新增</el-button
|
||||||
>
|
>
|
||||||
<importExcel
|
<importExcel
|
||||||
importApi="api/system/dept/import_data/"
|
api="api/system/dept/"
|
||||||
updateFieldApi = "api/system/dept/update_field/"
|
|
||||||
v-permission="'Import'"
|
v-permission="'Import'"
|
||||||
>导入
|
>导入
|
||||||
</importExcel>
|
</importExcel>
|
||||||
|
|
Loading…
Reference in New Issue