刘翔宇-旅管家 3 years ago
parent ff38d3a2fe
commit 57592216f9

@ -4,3 +4,4 @@ ENV = 'development'
# base api # base api
VUE_APP_BASE_API = 'http://safety.115.langye.net/' VUE_APP_BASE_API = 'http://safety.115.langye.net/'
#VUE_APP_BASE_API = http://192.168.60.99:9001/

@ -92,9 +92,9 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="file_list"> <el-form-item label="附件" prop="file_list">
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther" <el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther" :action="action"
action="/uploadApi/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove" :on-remove="handleRemove" :before-remove="beforeRemove" :on-exceed="handleExceed"
:on-exceed="handleExceed" :file-list="fileList"> :file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -124,7 +124,10 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="file_list"> <el-form-item label="附件" prop="file_list">
<el-link v-for="item in form.regulation_article_file" target="_blank" :href="item.files.url"
type="primary">
{{item.files.original_name}}
</el-link>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
@ -173,6 +176,7 @@
mounted() {}, mounted() {},
data() { data() {
return { return {
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
@ -303,13 +307,15 @@
let result = Object.assign(that.form, response); let result = Object.assign(that.form, response);
that.form = result; that.form = result;
let _files = []; let _files = [];
for (var mod of result.files) { for (var _mod of result.regulation_article_file) {
let m = Object.assign({}, mod); console.log(_mod.files)
let mod = _mod.files;
let m = Object.assign({}, mod.files);
m.name = mod.original_name; m.name = mod.original_name;
_files.push(m); _files.push(m);
} }
that.fileList = _files; that.fileList = _files;
this.$refs.tiny.setContent(result.content); that.$refs.tiny.setContent(result.content);
}).catch(error => { }).catch(error => {
//reject(error) //reject(error)
}) })
@ -318,14 +324,18 @@
var that = this; var that = this;
this.form = this.$options.data().form; this.form = this.$options.data().form;
this.fileList = []; this.fileList = [];
this.$nextTick(function() {
that.$refs.tiny.setContent('');
})
this.form.type = parseInt(this.$route.path.split("_")[1]); this.form.type = parseInt(this.$route.path.split("_")[1]);
this.clientHeight = document.documentElement.clientHeight - 84 - 110; this.clientHeight = document.documentElement.clientHeight - 84 - 110;
if (obj) { if (obj) {
that.info(obj); that.info(obj);
} else {} } else {
that.$nextTick(function(){
that.$refs.tiny.setContent("");
})
}
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
submitForm(formName) { submitForm(formName) {

@ -77,8 +77,8 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="file_list"> <el-form-item label="附件" prop="file_list">
<el-link v-for="item in form.file_list" target="_blank" :href="item.url" type="primary"> <el-link v-for="item in form.regulation_article_file" target="_blank" :href="item.files.url" type="primary">
{{item.original_name}} {{item.files.original_name}}
</el-link> </el-link>
</el-form-item> </el-form-item>

@ -44,20 +44,20 @@ module.exports = {
errors: true errors: true
}, },
//before: require('./mock/mock-server.js') //before: require('./mock/mock-server.js')
proxy: { proxy: {
'^/uploadApi': {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域
pathRewrite: {
['^/uploadApi']: process.env.VUE_APP_BASE_API
}
},
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target:process.env.VUE_APP_BASE_API, target:process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域 changeOrigin: true, //配置跨域
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API ['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API
} }
},
'^/uploadApi': {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域
pathRewrite: {
['^/uploadApi' ]: process.env.VUE_APP_BASE_API
}
} }
} }
}, },

Loading…
Cancel
Save