|
|
@@ -32,7 +32,6 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-edit"
|
|
|
size="small"
|
|
|
- @click="fileLoad"
|
|
|
>下载加密文件</el-button>
|
|
|
</div>
|
|
|
<div class="content-container">
|
|
|
@@ -72,7 +71,7 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- :title="textMap[dialogStatus]"
|
|
|
+ title="创建客户端凭证"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="dialogFormVisible"
|
|
|
>
|
|
|
@@ -139,41 +138,15 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
list: [],
|
|
|
- entity: {
|
|
|
- id: undefined,
|
|
|
- projectId: undefined,
|
|
|
- sectionId: undefined,
|
|
|
- sectionAreaId: undefined,
|
|
|
- deviceNo: '',
|
|
|
- deviceName: '',
|
|
|
- category: undefined,
|
|
|
- categoryName: '',
|
|
|
- spec: '',
|
|
|
- madeFactory: '',
|
|
|
- driverName: '',
|
|
|
- telephone: '',
|
|
|
- deviceType: undefined
|
|
|
- },
|
|
|
+ entity: {},
|
|
|
total: 0,
|
|
|
listLoading: false,
|
|
|
listQuery: {
|
|
|
- projectId: undefined,
|
|
|
- sectionId: undefined,
|
|
|
- sectionAreaId: undefined,
|
|
|
- deviceNo: '',
|
|
|
- deviceName: '',
|
|
|
- deviceType: undefined,
|
|
|
skipCount: 0,
|
|
|
maxResultCount: 20
|
|
|
},
|
|
|
dialogFormVisible: false,
|
|
|
- dialogStatus: '',
|
|
|
formLoading: false,
|
|
|
- textMap: {
|
|
|
- update: '修改',
|
|
|
- create: '创建'
|
|
|
- },
|
|
|
- sections: [],
|
|
|
rules: {
|
|
|
client_key: [
|
|
|
{ required: true, message: '请输入客户端Key', trigger: 'blur' },
|
|
|
@@ -186,230 +159,94 @@ export default {
|
|
|
expires_in: [
|
|
|
{ required: true, message: '请输入过期时间', trigger: 'blur' }
|
|
|
]
|
|
|
- },
|
|
|
- areas: [],
|
|
|
- jqjTypes: [],
|
|
|
- ylcTypes: []
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- },
|
|
|
mounted() {
|
|
|
this.getList()
|
|
|
- this.getJQJTypes()
|
|
|
- this.getYLCTypes()
|
|
|
},
|
|
|
methods: {
|
|
|
- // getJQJTypes() {
|
|
|
- // dictEntryApi.getJQJTypes().then(res => {
|
|
|
- // res.forEach(t => {
|
|
|
- // t.code = t.code - 0
|
|
|
- // })
|
|
|
- // this.jqjTypes = res
|
|
|
- // })
|
|
|
- // },
|
|
|
- // getYLCTypes() {
|
|
|
- // dictEntryApi.getYLCTypes().then(res => {
|
|
|
- // res.forEach(t => {
|
|
|
- // t.code = t.code - 0
|
|
|
- // })
|
|
|
- // this.ylcTypes = res
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 树形事件
|
|
|
- // handleTreeClick(data, node) {
|
|
|
- // this.listQuery.projectId = undefined
|
|
|
- // this.listQuery.sectionId = undefined
|
|
|
- // if (data.isProject) {
|
|
|
- // this.listQuery.projectId = data.id
|
|
|
- // this.listQuery.sectionId = undefined
|
|
|
- // }
|
|
|
- // if (data.isSection) {
|
|
|
- // this.listQuery.projectId = data.projectId
|
|
|
- // this.listQuery.sectionId = data.id
|
|
|
- // this.getArea()
|
|
|
- // }
|
|
|
- // this.getList()
|
|
|
- // },
|
|
|
- // getArea() {
|
|
|
- // this.areas = []
|
|
|
- // areaApi.lookupBySection(this.listQuery.sectionId).then(res => {
|
|
|
- // res.forEach(t => {
|
|
|
- // this.areas.push({
|
|
|
- // id: t.id,
|
|
|
- // name: t.name
|
|
|
- // })
|
|
|
- // })
|
|
|
- // })
|
|
|
- // },
|
|
|
- // getAreaName(areaId) {
|
|
|
- // const area = this.areas.find(t => t.id === areaId)
|
|
|
- // if (area) {
|
|
|
- // return area.name
|
|
|
- // } else {
|
|
|
- // return ''
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 清空下拉
|
|
|
- // delValue(parameter) {
|
|
|
- // this.listQuery[parameter] = undefined
|
|
|
- // },
|
|
|
- // // 获取数据列表
|
|
|
- // getList() {
|
|
|
- // if (!this.listQuery.projectId) {
|
|
|
- // this.list = []
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.listLoading = true
|
|
|
- // interfaceApi
|
|
|
- // .getList(this.listQuery)
|
|
|
- // .then(res => {
|
|
|
- // this.list = res.items
|
|
|
- // this.total = res.totalCount
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.listLoading = false
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 查询
|
|
|
- // handleFilter() {
|
|
|
- // this.listQuery.skipCount = 0
|
|
|
- // this.getList()
|
|
|
- // },
|
|
|
- // // 创建清空
|
|
|
- // resetStation() {
|
|
|
- // this.entity = {
|
|
|
- // id: undefined,
|
|
|
- // projectId: this.listQuery.projectId,
|
|
|
- // sectionId: this.listQuery.sectionId,
|
|
|
- // sectionAreaId: this.listQuery.sectionAreaId,
|
|
|
- // deviceNo: '',
|
|
|
- // deviceName: '',
|
|
|
- // category: undefined,
|
|
|
- // categoryName: '',
|
|
|
- // spec: '',
|
|
|
- // madeFactory: '',
|
|
|
- // driverName: '',
|
|
|
- // telephone: '',
|
|
|
- // deviceType: undefined
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 创建点击事件
|
|
|
- // handleCreate() {
|
|
|
- // if (!this.listQuery.sectionId) {
|
|
|
- // this.verificationTips('请选择标段')
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.resetStation()
|
|
|
- // this.dialogStatus = 'create'
|
|
|
- // this.dialogFormVisible = true
|
|
|
- // this.formLoading = false
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs['dataForm'].clearValidate()
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 提示
|
|
|
- // verificationTips(message) {
|
|
|
- // this.$notify({
|
|
|
- // title: '提示',
|
|
|
- // message: message,
|
|
|
- // type: 'error',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 创建
|
|
|
- // createData() {
|
|
|
- // this.$refs['dataForm'].validate(valid => {
|
|
|
- // if (valid) {
|
|
|
- // if (this.entity.deviceType === 1) {
|
|
|
- // this.entity.categoryName = this.jqjTypes.find(t => t.code === this.entity.category).name
|
|
|
- // }
|
|
|
- // if (this.entity.deviceType === 2) {
|
|
|
- // this.entity.categoryName = this.ylcTypes.find(t => t.code === this.entity.category).name
|
|
|
- // }
|
|
|
- // this.formLoading = true
|
|
|
- // interfaceApi
|
|
|
- // .create(this.entity)
|
|
|
- // .then(() => {
|
|
|
- // this.getList()
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // this.$notify({
|
|
|
- // title: '成功',
|
|
|
- // message: '创建成功',
|
|
|
- // type: 'success',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.formLoading = false
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 修改点击事件
|
|
|
- // handleUpdate(row) {
|
|
|
- // this.entity = Object.assign({}, row) // copy obj
|
|
|
- // this.dialogStatus = 'update'
|
|
|
- // this.dialogFormVisible = true
|
|
|
- // this.formLoading = false
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs['dataForm'].clearValidate()
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 修改
|
|
|
- // updateData() {
|
|
|
- // this.$refs['dataForm'].validate(valid => {
|
|
|
- // if (valid) {
|
|
|
- // if (this.entity.deviceType === 1) {
|
|
|
- // this.entity.categoryName = this.jqjTypes.find(t => t.code === this.entity.category).name
|
|
|
- // }
|
|
|
- // if (this.entity.deviceType === 2) {
|
|
|
- // this.entity.categoryName = this.ylcTypes.find(t => t.code === this.entity.category).name
|
|
|
- // }
|
|
|
- // const submitData = Object.assign({}, this.entity)
|
|
|
- // this.formLoading = true
|
|
|
- // interfaceApi
|
|
|
- // .update(submitData.id, submitData)
|
|
|
- // .then(() => {
|
|
|
- // this.getList()
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // this.$notify({
|
|
|
- // title: '成功',
|
|
|
- // message: '修改成功',
|
|
|
- // type: 'success',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.formLoading = false
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 删除
|
|
|
- // handleDelete(row) {
|
|
|
- // this.$confirm('此操作将删除该项, 是否继续?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // }).then(() => {
|
|
|
- // this.listLoading = true
|
|
|
- // interfaceApi
|
|
|
- // .remove(row.id)
|
|
|
- // .then(() => {
|
|
|
- // this.getList()
|
|
|
- // this.$notify({
|
|
|
- // title: '成功',
|
|
|
- // message: '删除成功',
|
|
|
- // type: 'success',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.listLoading = false
|
|
|
- // })
|
|
|
- // })
|
|
|
- // }
|
|
|
+ // 查询
|
|
|
+ handleFilter() {
|
|
|
+ this.listQuery.skipCount = 0
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ // // 创建清空
|
|
|
+ // resetStation() {
|
|
|
+ // this.entity = {
|
|
|
+ // id: undefined,
|
|
|
+ // projectId: this.listQuery.projectId,
|
|
|
+ // sectionId: this.listQuery.sectionId,
|
|
|
+ // sectionAreaId: this.listQuery.sectionAreaId,
|
|
|
+ // deviceNo: '',
|
|
|
+ // deviceName: '',
|
|
|
+ // category: undefined,
|
|
|
+ // categoryName: '',
|
|
|
+ // spec: '',
|
|
|
+ // madeFactory: '',
|
|
|
+ // driverName: '',
|
|
|
+ // telephone: '',
|
|
|
+ // deviceType: undefined
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 创建点击事件
|
|
|
+ handleCreate() {
|
|
|
+ this.resetStation()
|
|
|
+ this.dialogStatus = 'create'
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.formLoading = false
|
|
|
+ this.entity = {}
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 创建
|
|
|
+ createData() {
|
|
|
+ this.$refs['dataForm'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.formLoading = true
|
|
|
+ clientSettingApi
|
|
|
+ .create(this.entity)
|
|
|
+ .then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message: '创建成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.formLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ handleDelete(row) {
|
|
|
+ this.$confirm('此操作将删除该项, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.listLoading = true
|
|
|
+ clientSettingApi
|
|
|
+ .remove(row.id)
|
|
|
+ .then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|