|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div class="pa-3">
|
|
|
- <div class="box d-flex flex-column pt-10">
|
|
|
- <v-file-input
|
|
|
- v-model="file"
|
|
|
- label="导入脚本"
|
|
|
- prepend-icon=""
|
|
|
+ <div class="box d-flex flex-column">
|
|
|
+ <v-textarea
|
|
|
+ v-model="code"
|
|
|
+ label="请输入执行代码"
|
|
|
outlined
|
|
|
+ rows="10"
|
|
|
dense
|
|
|
- ></v-file-input>
|
|
|
+ ></v-textarea>
|
|
|
<v-btn
|
|
|
class="buttons align-self-center"
|
|
|
rounded
|
|
@@ -18,60 +18,33 @@
|
|
|
<v-icon left>mdi-cloud-upload-outline</v-icon>
|
|
|
提交
|
|
|
</v-btn>
|
|
|
- <v-banner>脚本列表</v-banner>
|
|
|
- <v-list>
|
|
|
- <template v-for="(item, index) in items">
|
|
|
- <v-list-item :key="item.title">
|
|
|
- <template v-slot:default>
|
|
|
- <v-list-item-content>
|
|
|
- <v-list-item-title>{{item.title}}</v-list-item-title>
|
|
|
- <v-list-item-subtitle>{{ item.subtitle }}</v-list-item-subtitle>
|
|
|
- </v-list-item-content>
|
|
|
-
|
|
|
- <v-list-item-action>
|
|
|
- <v-btn text>查看明细</v-btn>
|
|
|
- </v-list-item-action>
|
|
|
- </template>
|
|
|
- </v-list-item>
|
|
|
-
|
|
|
- <v-divider
|
|
|
- v-if="index < items.length - 1"
|
|
|
- :key="index"
|
|
|
- ></v-divider>
|
|
|
- </template>
|
|
|
- </v-list>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
+import { api } from '@/api/dataGovernance'
|
|
|
export default {
|
|
|
name: 'execute-script',
|
|
|
data () {
|
|
|
return {
|
|
|
- file: null,
|
|
|
- loading: false,
|
|
|
- items: [
|
|
|
- // {
|
|
|
- // action: '15 min',
|
|
|
- // headline: 'Brunch this weekend?',
|
|
|
- // subtitle: '上传时间:2020-10-10 10:10:10',
|
|
|
- // title: 'Ali Connors'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // action: '2 hr',
|
|
|
- // headline: 'Summer BBQ',
|
|
|
- // subtitle: '上传时间:2020-10-10 10:10:10',
|
|
|
- // title: 'me, Scrott, Jennifer'
|
|
|
- // }
|
|
|
- ]
|
|
|
+ code: null,
|
|
|
+ loading: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleSubmit () {
|
|
|
+ async handleSubmit () {
|
|
|
this.loading = true
|
|
|
- this.$emit('submit', this.file)
|
|
|
+ try {
|
|
|
+ await api.savePythonCode({
|
|
|
+ code: this.code
|
|
|
+ })
|
|
|
+ this.$snackbar.success('保存成功')
|
|
|
+ } catch (error) {
|
|
|
+ this.$snackbar.error(error)
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -79,9 +52,4 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.box {
|
|
|
- width: 60%;
|
|
|
- min-width: 800px;
|
|
|
- margin: 0 auto;
|
|
|
-}
|
|
|
</style>
|