|
@@ -43,6 +43,14 @@
|
|
|
v-hasPermi="['zcustom:platPublicCarRankPerson:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-upload"
|
|
|
+ size="mini"
|
|
|
+ @click="handleUpload"
|
|
|
+ >导入</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -106,17 +114,32 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="导入json" :visible.sync="op" :close-on-click-modal="false" width="600px" append-to-body>
|
|
|
+ <el-form ref="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="json数据">
|
|
|
+ <el-input v-model="json" type="textarea" placeholder="请输入json数据" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="sure">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listPlatPublicCarRankPerson, getPlatPublicCarRankPerson, delPlatPublicCarRankPerson, addPlatPublicCarRankPerson, updatePlatPublicCarRankPerson } from "@/api/zcustom/carRank";
|
|
|
import { getListTree } from '@/api/zcustom/platAppOrg'
|
|
|
+import { uploadJson } from '@/api/zcustom/carRank'
|
|
|
|
|
|
export default {
|
|
|
name: "PlatPublicCarRankPerson",
|
|
|
data() {
|
|
|
return {
|
|
|
+ json: undefined,
|
|
|
+ op:false,
|
|
|
treeList:[],
|
|
|
props:{
|
|
|
value: 'appEncode',
|
|
@@ -180,6 +203,17 @@ export default {
|
|
|
this.getListTree()
|
|
|
},
|
|
|
methods: {
|
|
|
+ sure(){
|
|
|
+ const jsonString = JSON.parse(this.json)
|
|
|
+ uploadJson(jsonString).then(res => {
|
|
|
+ if (res.code === 200){
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$message.error('导入失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getListTree(){
|
|
|
getListTree().then(res => {
|
|
|
this.treeList.push(res.data)
|
|
@@ -197,6 +231,8 @@ export default {
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
+ this.json = undefined
|
|
|
+ this.op = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
// 表单重置
|
|
@@ -271,6 +307,10 @@ export default {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导入操作 */
|
|
|
+ handleUpload(){
|
|
|
+ this.op = true
|
|
|
}
|
|
|
}
|
|
|
};
|