98 lines
2.2 KiB
Vue
98 lines
2.2 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<el-form ref="form" :model="form" size="mini" :rules="rules" label-width="100px">
|
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
|
<el-col :span="24">
|
|
<el-form-item label="上传打印组件" prop="downUrl">
|
|
<FileUpload :showTip="true" v-model="form.downUrl" :isNeedUpload="true" :fileType="['zip']" :limit="1"></FileUpload>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
</el-form>
|
|
<div style="text-align: center;margin-bottom: 10px;">
|
|
<el-button type="primary" @click="submitForm">Save </el-button>
|
|
<el-button @click="cancel">Cancel</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getConfigKey,updateConfigByKey } from "@/api/system/config";
|
|
|
|
export default {
|
|
name: "PrinterUpdater",
|
|
props:{
|
|
id:{
|
|
type:Number
|
|
}
|
|
},
|
|
components: { },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
downUrl: [
|
|
{ required: true, message: "下载地址不能为空", trigger:["blur",'change'] }
|
|
],
|
|
|
|
}
|
|
};
|
|
},
|
|
watch: {
|
|
"id": {
|
|
handler (newValue, oldValue) {
|
|
this.id = newValue;
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
|
|
methods: {
|
|
initData() {
|
|
this.reset();
|
|
/*
|
|
{ http://doc.xdadan.com/download/2024/06/10/d585b4c1ad5fc36b7e17320f5dfa603b.zip }
|
|
*/
|
|
getConfigKey("sys.printer.downurl").then(response => {
|
|
this.form.downUrl = response.msg;
|
|
});
|
|
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
downUrl: null,
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
updateConfigByKey("sys.printer.downurl",this.form.downUrl).then(response => {
|
|
this.$modal.msgSuccess("更新成功");
|
|
});
|
|
}
|
|
});
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|