Commit 58557e15 by 莫晓莉

5555

parent 6e9f37ae
......@@ -133,8 +133,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="sqlForm.dateformat" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in formatTimeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -144,8 +145,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="sqlForm.encoding" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in myCodeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -163,9 +165,16 @@
</template>
<script>
import {
formatFunc,//获取已经创建的数据库列表
getAvailableCharsets,//获取编码
} from "@/api/kettle/file";
export default ({
data(){
return{
formatTimeList:[],
myCodeList:[],
stepName:{name:'SQL文件输出'},
sqlForm:{
connection: "",//连接名称
......@@ -270,13 +279,40 @@ export default ({
},
},
mounted(){
created(){
this.formatFunc();//获取时间日期格式
this.getAvailableCharsets();//获取编码
},
methods:{
handleClose(){
this.$emit("update:sqlVisible", false);
},
//获取编码
getAvailableCharsets(){
var formData = new FormData();
formData.append('query', '');
getAvailableCharsets(formData).then(res=>{
if (res) {
console.log('获取编码==',res);
this.myCodeList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//时间日期格式
formatFunc(){
var formData = new FormData();
formData.append('query', '');
formatFunc(formData).then(res=>{
if (res) {
console.log('时间日期格式==',res);
this.formatTimeList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
confirm(){
console.log('弹窗数据==',this.sqlForm);
......
......@@ -21,7 +21,7 @@
</el-col>
<el-col class="line" :span="3">
<el-button size="mini">浏览</el-button></el-col
<el-button size="mini" @click="chooseFile('file_name')">浏览</el-button></el-col
>
</el-row>
</el-form-item>
......@@ -117,8 +117,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.date_time_format" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in formatTimeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -190,8 +191,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.format" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in formatLineList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -200,8 +202,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.compression" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in compressList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -210,8 +213,9 @@
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.encoding" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
<el-option v-for="(item,index) in myCodeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-col>
</el-row>
......@@ -235,20 +239,22 @@
<el-form-item label="分拆...每一行:">
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.splitevery" style="width: 100%">
<!-- <el-select v-model="textFileForm.splitevery" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-select> -->
<el-input v-model="textFileForm.splitevery"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="添加文件结束行:">
<el-row :gutter="10">
<el-col :span="23">
<el-select v-model="textFileForm.endedLine" style="width: 100%">
<!-- <el-select v-model="textFileForm.endedLine" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-select> -->
<el-input v-model="textFileForm.endedLine"></el-input>
</el-col>
</el-row>
</el-form-item>
......@@ -271,13 +277,30 @@
<el-button type="primary" @click="confirm">确 定</el-button>
</span>
</el-dialog>
<!-- 浏览选择文件 -->
<file-tree :fileDialogVisible.sync="fileDialogVisible" :excelForm="textFileForm" :formName="formName"></file-tree>
</div>
</template>
<script>
import {
formatFunc,//获取已经创建的数据库列表
getFormatMapperLineTerminator,//获取格式
getCompressionProviderNames,//获取压缩
getAvailableCharsets,//获取编码
} from "@/api/kettle/file";
export default ({
data(){
return{
fileDialogVisible:false,//选择文件夹弹窗
formName:'',
formatTimeList:[],//时间日期格式
formatLineList:[],//获取格式
compressList:[],//获取压缩
myCodeList:[],//获取编码
textFileForm:{
file_name: "file",//文件名称
is_command: "N",//结果输送至命令行或脚本
......@@ -382,13 +405,88 @@ export default ({
// explorer:Function
},
mounted(){
created(){
this.formatFunc();//获取时间日期格式
this.getFormatMapperLineTerminator();//获取格式
this.getCompressionProviderNames();//获取压缩
this.getAvailableCharsets();//获取编码
},
methods:{
handleClose(){
this.$emit("update:fileVisible", false);
},
//获取文件名字段====xml文件的方法
getInputOutputFields(){
var formData = new FormData();
formData.append('query', '');
getFontoriention(formData).then(res=>{
if (res) {
console.log('获取文件名字段==',res);
this.InputOutputFields=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//时间日期格式
formatFunc(){
var formData = new FormData();
formData.append('query', '');
formatFunc(formData).then(res=>{
if (res) {
console.log('时间日期格式==',res);
this.formatTimeList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//获取格式
getFormatMapperLineTerminator(){
var formData = new FormData();
formData.append('query', '');
getFormatMapperLineTerminator(formData).then(res=>{
if (res) {
console.log('获取格式==',res);
this.formatLineList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//获取压缩
getCompressionProviderNames(){
var formData = new FormData();
formData.append('query', '');
getCompressionProviderNames(formData).then(res=>{
if (res) {
console.log('获取压缩==',res);
this.compressList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//获取编码
getAvailableCharsets(){
var formData = new FormData();
formData.append('query', '');
getAvailableCharsets(formData).then(res=>{
if (res) {
console.log('获取编码==',res);
this.myCodeList=res;
}else {
this.$message.error(res.errMsg)
}
})
},
//选择文件夹
chooseFile(name){
this.formName=name;//当前哪个属性需要选择文件夹
this.fileDialogVisible=true;
},
confirm(){
console.log('弹窗数据--',this.textFileForm);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment