Commit 35736952 by hank

eslint

parent dd5df6e2
......@@ -49,7 +49,7 @@
<em>点击上传</em>
</div>
</el-upload>
<img style="width: 200px;" :src="temp.equipmentUrl" alt />
<img style="width: 200px;" :src="temp.equipmentUrl" alt>
</el-form-item>
<el-form-item label="设备详情" prop="equipmentDetails">
<Tinymce v-model="temp.equipmentDetails" style="width: 600px" />
......@@ -63,12 +63,12 @@
</template>
<script>
import { addDevice, updateDevice, getDetail, uploadUrl } from "@/api/device";
import Tinymce from "@/components/Tinymce";
import waves from "@/directive/waves"; // waves directive
import { addDevice, updateDevice, getDetail, uploadUrl } from '@/api/device'
import Tinymce from '@/components/Tinymce'
import waves from '@/directive/waves' // waves directive
export default {
name: "ComplexTable",
name: 'ComplexTable',
directives: { waves },
components: {
Tinymce
......@@ -76,11 +76,11 @@ export default {
filters: {
statusFilter(status) {
const statusMap = {
published: "success",
draft: "info",
deleted: "danger"
};
return statusMap[status];
published: 'success',
draft: 'info',
deleted: 'danger'
}
return statusMap[status]
}
},
data() {
......@@ -98,30 +98,30 @@ export default {
page: 1,
limit: 20,
typeId: undefined,
title: "",
title: '',
tagId: undefined,
sort: "+id"
sort: '+id'
},
templateId: "",
templateId: '',
sortOptions: [
{ label: "ID Ascending", key: "+id" },
{ label: "ID Descending", key: "-id" }
{ label: 'ID Ascending', key: '+id' },
{ label: 'ID Descending', key: '-id' }
],
statusOptions: ["published", "draft", "deleted"],
statusOptions: ['published', 'draft', 'deleted'],
showReviewer: false,
temp: {
equipmentName: "",
equipmentIntro: "",
equipmentShopId: "",
equipmentUrl: "",
equipmentPrice: "",
equipmentDetails: ""
equipmentName: '',
equipmentIntro: '',
equipmentShopId: '',
equipmentUrl: '',
equipmentPrice: '',
equipmentDetails: ''
},
dialogFormVisible: true,
dialogStatus: "",
dialogStatus: '',
textMap: {
update: "Edit",
create: "Create"
update: 'Edit',
create: 'Create'
},
dialogPvVisible: false,
pvData: [],
......@@ -129,111 +129,111 @@ export default {
equipmentName: [
{
required: true,
message: "equipmentName is required",
trigger: "change"
message: 'equipmentName is required',
trigger: 'change'
}
],
equipmentIntro: [
{
required: true,
message: "equipmentIntro is required",
trigger: "change"
message: 'equipmentIntro is required',
trigger: 'change'
}
],
equipmentDetails: [
{
required: true,
message: "equipmentDetails is required",
trigger: "change"
message: 'equipmentDetails is required',
trigger: 'change'
}
],
equipmentPrice: [
{
required: true,
message: "equipmentPrice is required",
trigger: "change"
message: 'equipmentPrice is required',
trigger: 'change'
}
]
},
downloadLoading: false
};
}
},
created() {
this.equipmentShopId = this.$route.query.equipmentShopId;
this.getTempalteDetail();
this.equipmentShopId = this.$route.query.equipmentShopId
this.getTempalteDetail()
},
methods: {
getTempalteDetail() {
const id = this.$route.query.equipmentShopId;
const id = this.$route.query.equipmentShopId
if (id) {
getDetail(this.$route.query.equipmentShopId).then(response => {
const tempData = JSON.parse(JSON.stringify(response));
this.temp = Object.assign(this.temp, tempData);
console.log(response);
});
const tempData = JSON.parse(JSON.stringify(response))
this.temp = Object.assign(this.temp, tempData)
console.log(response)
})
}
},
uploadZipSuccess(e) {
if (e.code && e.code !== "0") {
this.$message.error(e.msg);
if (e.code && e.code !== '0') {
this.$message.error(e.msg)
} else {
this.$message("上传成功");
this.temp.equipmentUrl = e.data;
console.log(this.temp);
this.$message('上传成功')
this.temp.equipmentUrl = e.data
console.log(this.temp)
}
console.log(e);
console.log(e)
},
resetTemp() {
this.temp = {
id: undefined,
importance: 1,
remark: "",
remark: '',
timestamp: new Date(),
title: "",
status: "published",
type: ""
};
title: '',
status: 'published',
type: ''
}
},
handleCreate() {
this.resetTemp();
this.dialogStatus = "create";
this.dialogFormVisible = true;
this.resetTemp()
this.dialogStatus = 'create'
this.dialogFormVisible = true
this.$nextTick(() => {
this.$refs["dataForm"].clearValidate();
});
this.$refs['dataForm'].clearValidate()
})
},
createData() {
this.$refs["dataForm"].validate(valid => {
this.$refs['dataForm'].validate(valid => {
if (valid) {
const uploadTemp = Object.assign({}, this.temp);
const uploadTemp = Object.assign({}, this.temp)
if (this.equipmentShopId) {
updateDevice(uploadTemp).then(res => {
this.$notify({
title: "Success",
message: "Update Successfully",
type: "success",
title: 'Success',
message: 'Update Successfully',
type: 'success',
duration: 2000
});
this.getTempalteDetail();
this.$router.back();
});
})
this.getTempalteDetail()
this.$router.back()
})
} else {
addDevice(uploadTemp).then(() => {
this.$notify({
title: "Success",
message: "Created Successfully",
type: "success",
title: 'Success',
message: 'Created Successfully',
type: 'success',
duration: 2000
});
this.$router.back();
});
})
this.$router.back()
})
}
}
});
})
}
}
};
}
</script>
<style lang="scss" scoped>
</style>
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 sign in to comment