Commit 5cf546d5 authored by 何虹's avatar 何虹 💬

本次提交的说明

parent 7d572a41
......@@ -17,7 +17,7 @@
"build-bundle": "vue-cli-service build --target lib --name hs-sky-ui ./src/packages/index.js"
},
"dependencies": {
"hs-util-js": "^1.0.2",
"hs-util-js": "^1.0.4",
"axios": "^0.19.2",
"babel-preset-es2015": "^6.24.1",
"core-js": "^3.6.4",
......
......@@ -206,7 +206,7 @@ export default {
this.tableDataLeft = this.removeUniq(this.tableDataLeft, isSelectedList)
},
async showDialog() {
const getClientWidth = hsUtil.System.getClientWidth()
const getClientWidth = hsUtil.SystemModule.getClientWidth()
this.tableWith = getClientWidth / 2 + 'px'
// 弹出之前做逻辑判断
const { value } = this.configData
......@@ -458,7 +458,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchUp(this.tableDataRight, selectIndexData)
hsUtil.TableHandleModule.batchUp(this.tableDataRight, selectIndexData)
},
/**
* 下移动
......@@ -470,7 +470,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchDown(this.tableDataRight, selectIndexData)
hsUtil.TableHandleModule.batchDown(this.tableDataRight, selectIndexData)
}
}
}
......
......@@ -383,7 +383,7 @@ export default {
initConfig() {
const { config } = this.allSourceData
const configData = Object.assign(this.configData_, _.cloneDeep(config))
const { appCode } = hsUtil.System.getSysParams()
const { appCode } = hsUtil.SystemModule.getSysParams()
configData.appCode = configData.appCode || appCode
return configData
},
......
......@@ -79,22 +79,6 @@
type="success"
@click='editTableColums'
>修改表头</el-button>
<el-button
v-if='false'
v-show="layout"
size='mini'
plain
type="danger"
@click='changControl(1)'
>上一个</el-button>
<el-button
v-if='false'
v-show="layout"
size='mini'
plain
type="warning"
@click='changControl(2)'
>下一个</el-button>
<el-button
v-if='false'
size='mini'
......@@ -275,7 +259,6 @@ export default {
dialogVisibleAsyncFormColumn: false,
asyncFormColumns: [],
isSubmitSuccessFlage: '',
errorEdit: 0,
tipAdminDialogVisible: false,
dialogVisibleHsTabsForm: false,
hsTabsColums: [],
......@@ -322,15 +305,22 @@ export default {
config.columnsConfig = columnsConfig
this.editor1.set(config)
const sql = this.textareaSql
const {
dbName,
appCode,
pageName,
controlName,
isMock
} = this.controlInfo
const data = {
dbName: this.controlInfo.dbName,
appCode: this.controlInfo.appCode,
pageName: this.controlInfo.pageName,
controlName: this.controlInfo.controlName,
config, // this.editor1.get(),
dbName,
appCode,
pageName,
controlName,
config,
data: this.editor2.get(),
querySql: sql,
mockData: this.controlInfo.isMock ? 1 : 0,
querySql: this.textareaSql,
mockData: isMock ? 1 : 0,
controlType: this.elInfo.el || ''
}
this.$listeners.webChartConfigSave(data).then(() => {
......@@ -392,35 +382,6 @@ export default {
getMockData(type) {
return mockData[type]
},
changControl(flage) {
if (this.layout) {
const list = this.layout.filter(item => item.isRequestControl)
const currIndex = list.findIndex(
item => item.control.position === this.elInfo.position
)
let nextIndex = 0
let target = null
if (flage === 1) {
// 上一个
if (currIndex === 0) {
this.$message('已经是第一个了')
return
}
nextIndex = currIndex - 1
target = list[nextIndex]
} else {
// 下一个
if (currIndex === list.length - 1) {
this.$message('已经是最后个了')
return
}
nextIndex = currIndex + 1
target = list[nextIndex]
}
this.elInfo = target.control
this.getPageInfo(target.control)
}
},
lookPageLogView() {
this.lookPageLogVisible = true
this.isrequest = !this.isrequest
......@@ -432,7 +393,7 @@ export default {
this.showView()
},
revertVersion_(parm) {
this.$listeners.webChartConfigRevert.then(res => {
this.$listeners.webChartConfigRevert(parm).then(res => {
this.getPageInfo()
this.isrequest = !this.isrequest
})
......@@ -446,15 +407,14 @@ export default {
this.editor2.set(res)
})
},
getPageInfo(info = this.elInfo) {
const { position, pageName, appCode } = info
getPageInfo(info = this.controlInfo) {
const { controlName, pageName, appCode } = info
const data = {
controlName: position,
appCode: appCode,
pageName: pageName
controlName,
appCode,
pageName
}
this.$listeners.webChartConfigQuery(data).then(
res => {
this.$listeners.webChartConfigQuery(data).then(res => {
const data = res.data
if (data && data.length) {
// 以后端返回的控件信息为准
......@@ -487,8 +447,7 @@ export default {
// 加载本地模拟数据
this.initImportOrLocalMockData()
}
}
)
})
},
// 把当页的全部存储到本地
saveAs() {
......@@ -504,19 +463,27 @@ export default {
this.jsoneditorCloseAfter()
this.$emit('dialogClose')
},
dialogOpen() {
this.revertVersion = false
handleControlInfo() {
// 初始化appCode pageName 等等
const { appCode, pageName } = hsUtil.System.getUrlParams()
this.controlInfo.appCode = appCode
this.controlInfo.pageName = pageName
this.controlInfo.controlName = this.elInfo.position
const { appCode, pageName } = hsUtil.SystemModule.getUrlParams()
const {
appCode: appCode_el,
pageName: pageName_elInfo,
position
} = this.elInfo
this.controlInfo.appCode = appCode_el || appCode
this.controlInfo.pageName = pageName_elInfo || pageName
this.controlInfo.controlName = position
if (!this.elInfo.appCode) {
this.elInfo.appCode = appCode
this.elInfo.appCode = this.controlInfo.appCode
}
if (!this.elInfo.pageName) {
this.elInfo.pageName = pageName
this.elInfo.pageName = this.controlInfo.pageName
}
},
dialogOpen() {
this.revertVersion = false
this.handleControlInfo()
this.getPageInfo()
this.jsoneditorOpenAfter()
},
......@@ -565,22 +532,19 @@ export default {
submitData() {
const editor1Config = this.editor1.get()
const editor2Config = this.editor2.get()
this.errorEdit = 2
console.log(this.elInfo, this.controlInfo)
// 简化数据获取
const appCode = this.controlInfo.appCode
const { dbName, appCode, pageName, controlName } = this.controlInfo
const sql = this.textareaSql
const controlName = this.controlInfo.controlName || this.elInfo.position
if (!controlName) {
this.$message.error('controlName不存在')
console.log(this.elInfo, this.controlInfo)
return
}
const data_ = {
dbName: this.controlInfo.dbName,
appCode: appCode,
pageName: this.controlInfo.pageName,
controlName: controlName,
dbName,
appCode,
pageName,
controlName,
config: editor1Config,
data: editor2Config,
querySql: sql,
......
......@@ -460,7 +460,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchUp(list, selectIndexData)
hsUtil.TableHandleModule.batchUp(list, selectIndexData)
},
/**
* 下移动
......@@ -473,7 +473,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchDown(list, selectIndexData)
hsUtil.TableHandleModule.batchDown(list, selectIndexData)
}
}
}
......
......@@ -365,7 +365,7 @@ export default {
},
async showDialog() {
console.log('showDialog')
const getClientWidth = hsUtil.System.getClientWidth()
const getClientWidth = hsUtil.SystemModule.getClientWidth()
this.tableWithLeft = getClientWidth / 2 + 'px'
this.tableWithRight = getClientWidth / 2 - 66 + 'px'
if (this.value) {
......@@ -581,7 +581,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchUp(this.rightTabeData, selectIndexData)
hsUtil.TableHandleModule.batchUp(this.rightTabeData, selectIndexData)
},
/**
* 下移动
......@@ -593,7 +593,7 @@ export default {
selectIndexData.push(index)
}
})
hsUtil.TableHandle.batchDown(this.rightTabeData, selectIndexData)
hsUtil.TableHandleModule.batchDown(this.rightTabeData, selectIndexData)
}
},
mounted() {}
......
......@@ -71,42 +71,6 @@ axios.interceptors.response.use(
}
}
)
function dyncInnerErrorDel(error) {
if (error.message === 'Network Error') {
Notification.error({
title: '错误信息!',
message: '网络连接错误!请检查您的网络是否正常!',
type: 'warning'
})
}
if (error.response && typeof error.response.data === 'string') {
Notification.error({
title: '错误信息!',
dangerouslyUseHTMLString: true,
type: 'warning',
duration: 100000,
message: `<div>
<textarea style="border:0;border-radius:5px;background-color:rgba(241,241,241,.98);width: 300px;height: 400px;padding: 10px;resize: none;position: relative;right: 36px;">
${error.response.data}
</textarea>
</div>`
})
}
if (error.response && typeof error.response.data === 'object') {
const { error_detail, error_title } = error.response.data
Notification.error({
title: '错误信息!',
dangerouslyUseHTMLString: true,
duration: 100000,
message: `<div>
<textarea style="border:0;border-radius:5px;background-color:rgba(241,241,241,.98);width: 300px;height: 400px;padding: 10px;resize: none;position: relative;right: 36px;">
${error_title}
${error_detail}
</textarea>
</div>`
})
}
}
function response_error_del(error) {
const { response, code } = error
const { status, statusText, data } = response || {}
......@@ -148,7 +112,7 @@ function response_error_del(error) {
if (sessionStorage['platform']) {
store.commit('set_error_info', { error_title, error_detail })
} else {
hsUtil.IframeMessage.sendErrorToWebframe({ error_title, error_detail })
hsUtil.IframeMessageModule.sendErrorToWebframe({ error_title, error_detail })
}
}
dealFileReader()
......@@ -164,7 +128,7 @@ function response_error_del(error) {
if (sessionStorage['platform'] || top === self) {
store.commit('set_error_info', { error_title, error_detail })
} else {
hsUtil.IframeMessage.sendErrorToWebframe({ error_title, error_detail })
hsUtil.IframeMessageModule.sendErrorToWebframe({ error_title, error_detail })
}
}
axios.interceptors.request.use(
......
import axios from 'axios'
// 增加一个response拦截器
axios.interceptors.response.use(
function(response) {
return response
},
async function(error) {
return Promise.reject(error)
}
)
axios.interceptors.request.use(
async config => {
return config
},
err => {
return Promise.reject(err)
}
)
import { WEB_QUERY, WEB_QUERY_QUERY, WEB_QUERY_QUERY_VALUE, WEB_QUERY_PAGE } from '../common/commonModule'
import hsUtil from 'hs-util-js'
const urlParam = hsUtil.System.getUrlParams()
const { user_id } = hsUtil.System.parseGlobalParams()
const urlParam = hsUtil.SystemModule.getUrlParams()
const { user_id } = hsUtil.SystemModule.parseGlobalParams()
class Control {
constructor(requestClient) {
this.requestClient = requestClient
......
......@@ -1920,6 +1920,13 @@ axios@^0.19.2:
dependencies:
follow-redirects "1.5.10"
axios@^0.21.0:
version "0.21.0"
resolved "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz#26df088803a2350dff2c27f96fef99fe49442aca"
integrity sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==
dependencies:
follow-redirects "^1.10.0"
babel-code-frame@^6.26.0:
version "6.26.0"
resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
......@@ -4686,6 +4693,11 @@ follow-redirects@^1.0.0:
dependencies:
debug "^3.0.0"
follow-redirects@^1.10.0:
version "1.13.1"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7"
integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==
for-in@^1.0.2:
version "1.0.2"
resolved "https://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
......@@ -5108,13 +5120,18 @@ hpack.js@^2.1.6:
readable-stream "^2.0.1"
wbuf "^1.1.0"
hs-util-js@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/hs-util-js/-/hs-util-js-1.0.2.tgz#9aebf0e813ad24030cdcbe2c560e071029c87520"
integrity sha512-O0UqnUy/s1PPjByjD2KF8zAN6we7UZIDft5yuAsPyvE768XQXEg3VY6JivY59CRae4Xp5Zpam30+EA6JrVf7PA==
hs-util-js@^1.0.4:
version "1.0.4"
resolved "https://registry.npmjs.org/hs-util-js/-/hs-util-js-1.0.4.tgz#4729cb678b78ea0b4549a5492cb9368ec506d985"
integrity sha512-9UUfV3NdlLDT7kKp8Y+pcpnCuQuiQhp2Qkeht7kKgEbsnivPLVjJJstyY97rzNoTePi36iKmvozzPXMDejzqgQ==
dependencies:
axios "^0.21.0"
file-saver "^2.0.5"
jwt-decode "^3.1.2"
script-loader "^0.7.2"
webpack "^5.10.1"
webpack-cli "^4.2.0"
xlsx "^0.16.9"
hsl-regex@^1.0.0:
version "1.0.0"
......@@ -5936,6 +5953,11 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
jwt-decode@^3.1.2:
version "3.1.2"
resolved "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59"
integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==
keycode@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04"
......
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