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

本次提交的说明

parent 7d572a41
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"build-bundle": "vue-cli-service build --target lib --name hs-sky-ui ./src/packages/index.js" "build-bundle": "vue-cli-service build --target lib --name hs-sky-ui ./src/packages/index.js"
}, },
"dependencies": { "dependencies": {
"hs-util-js": "^1.0.2", "hs-util-js": "^1.0.4",
"axios": "^0.19.2", "axios": "^0.19.2",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"core-js": "^3.6.4", "core-js": "^3.6.4",
......
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
this.tableDataLeft = this.removeUniq(this.tableDataLeft, isSelectedList) this.tableDataLeft = this.removeUniq(this.tableDataLeft, isSelectedList)
}, },
async showDialog() { async showDialog() {
const getClientWidth = hsUtil.System.getClientWidth() const getClientWidth = hsUtil.SystemModule.getClientWidth()
this.tableWith = getClientWidth / 2 + 'px' this.tableWith = getClientWidth / 2 + 'px'
// 弹出之前做逻辑判断 // 弹出之前做逻辑判断
const { value } = this.configData const { value } = this.configData
...@@ -458,7 +458,7 @@ export default { ...@@ -458,7 +458,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchUp(this.tableDataRight, selectIndexData) hsUtil.TableHandleModule.batchUp(this.tableDataRight, selectIndexData)
}, },
/** /**
* 下移动 * 下移动
...@@ -470,7 +470,7 @@ export default { ...@@ -470,7 +470,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchDown(this.tableDataRight, selectIndexData) hsUtil.TableHandleModule.batchDown(this.tableDataRight, selectIndexData)
} }
} }
} }
......
...@@ -383,7 +383,7 @@ export default { ...@@ -383,7 +383,7 @@ export default {
initConfig() { initConfig() {
const { config } = this.allSourceData const { config } = this.allSourceData
const configData = Object.assign(this.configData_, _.cloneDeep(config)) const configData = Object.assign(this.configData_, _.cloneDeep(config))
const { appCode } = hsUtil.System.getSysParams() const { appCode } = hsUtil.SystemModule.getSysParams()
configData.appCode = configData.appCode || appCode configData.appCode = configData.appCode || appCode
return configData return configData
}, },
......
...@@ -79,22 +79,6 @@ ...@@ -79,22 +79,6 @@
type="success" type="success"
@click='editTableColums' @click='editTableColums'
>修改表头</el-button> >修改表头</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 <el-button
v-if='false' v-if='false'
size='mini' size='mini'
...@@ -275,7 +259,6 @@ export default { ...@@ -275,7 +259,6 @@ export default {
dialogVisibleAsyncFormColumn: false, dialogVisibleAsyncFormColumn: false,
asyncFormColumns: [], asyncFormColumns: [],
isSubmitSuccessFlage: '', isSubmitSuccessFlage: '',
errorEdit: 0,
tipAdminDialogVisible: false, tipAdminDialogVisible: false,
dialogVisibleHsTabsForm: false, dialogVisibleHsTabsForm: false,
hsTabsColums: [], hsTabsColums: [],
...@@ -322,15 +305,22 @@ export default { ...@@ -322,15 +305,22 @@ export default {
config.columnsConfig = columnsConfig config.columnsConfig = columnsConfig
this.editor1.set(config) this.editor1.set(config)
const sql = this.textareaSql const sql = this.textareaSql
const {
dbName,
appCode,
pageName,
controlName,
isMock
} = this.controlInfo
const data = { const data = {
dbName: this.controlInfo.dbName, dbName,
appCode: this.controlInfo.appCode, appCode,
pageName: this.controlInfo.pageName, pageName,
controlName: this.controlInfo.controlName, controlName,
config, // this.editor1.get(), config,
data: this.editor2.get(), data: this.editor2.get(),
querySql: sql, querySql: this.textareaSql,
mockData: this.controlInfo.isMock ? 1 : 0, mockData: isMock ? 1 : 0,
controlType: this.elInfo.el || '' controlType: this.elInfo.el || ''
} }
this.$listeners.webChartConfigSave(data).then(() => { this.$listeners.webChartConfigSave(data).then(() => {
...@@ -392,35 +382,6 @@ export default { ...@@ -392,35 +382,6 @@ export default {
getMockData(type) { getMockData(type) {
return mockData[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() { lookPageLogView() {
this.lookPageLogVisible = true this.lookPageLogVisible = true
this.isrequest = !this.isrequest this.isrequest = !this.isrequest
...@@ -432,7 +393,7 @@ export default { ...@@ -432,7 +393,7 @@ export default {
this.showView() this.showView()
}, },
revertVersion_(parm) { revertVersion_(parm) {
this.$listeners.webChartConfigRevert.then(res => { this.$listeners.webChartConfigRevert(parm).then(res => {
this.getPageInfo() this.getPageInfo()
this.isrequest = !this.isrequest this.isrequest = !this.isrequest
}) })
...@@ -446,15 +407,14 @@ export default { ...@@ -446,15 +407,14 @@ export default {
this.editor2.set(res) this.editor2.set(res)
}) })
}, },
getPageInfo(info = this.elInfo) { getPageInfo(info = this.controlInfo) {
const { position, pageName, appCode } = info const { controlName, pageName, appCode } = info
const data = { const data = {
controlName: position, controlName,
appCode: appCode, appCode,
pageName: pageName pageName
} }
this.$listeners.webChartConfigQuery(data).then( this.$listeners.webChartConfigQuery(data).then(res => {
res => {
const data = res.data const data = res.data
if (data && data.length) { if (data && data.length) {
// 以后端返回的控件信息为准 // 以后端返回的控件信息为准
...@@ -487,8 +447,7 @@ export default { ...@@ -487,8 +447,7 @@ export default {
// 加载本地模拟数据 // 加载本地模拟数据
this.initImportOrLocalMockData() this.initImportOrLocalMockData()
} }
} })
)
}, },
// 把当页的全部存储到本地 // 把当页的全部存储到本地
saveAs() { saveAs() {
...@@ -504,19 +463,27 @@ export default { ...@@ -504,19 +463,27 @@ export default {
this.jsoneditorCloseAfter() this.jsoneditorCloseAfter()
this.$emit('dialogClose') this.$emit('dialogClose')
}, },
dialogOpen() { handleControlInfo() {
this.revertVersion = false
// 初始化appCode pageName 等等 // 初始化appCode pageName 等等
const { appCode, pageName } = hsUtil.System.getUrlParams() const { appCode, pageName } = hsUtil.SystemModule.getUrlParams()
this.controlInfo.appCode = appCode const {
this.controlInfo.pageName = pageName appCode: appCode_el,
this.controlInfo.controlName = this.elInfo.position 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) { if (!this.elInfo.appCode) {
this.elInfo.appCode = appCode this.elInfo.appCode = this.controlInfo.appCode
} }
if (!this.elInfo.pageName) { if (!this.elInfo.pageName) {
this.elInfo.pageName = pageName this.elInfo.pageName = this.controlInfo.pageName
} }
},
dialogOpen() {
this.revertVersion = false
this.handleControlInfo()
this.getPageInfo() this.getPageInfo()
this.jsoneditorOpenAfter() this.jsoneditorOpenAfter()
}, },
...@@ -565,22 +532,19 @@ export default { ...@@ -565,22 +532,19 @@ export default {
submitData() { submitData() {
const editor1Config = this.editor1.get() const editor1Config = this.editor1.get()
const editor2Config = this.editor2.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 sql = this.textareaSql
const controlName = this.controlInfo.controlName || this.elInfo.position
if (!controlName) { if (!controlName) {
this.$message.error('controlName不存在') this.$message.error('controlName不存在')
console.log(this.elInfo, this.controlInfo) console.log(this.elInfo, this.controlInfo)
return return
} }
const data_ = { const data_ = {
dbName: this.controlInfo.dbName, dbName,
appCode: appCode, appCode,
pageName: this.controlInfo.pageName, pageName,
controlName: controlName, controlName,
config: editor1Config, config: editor1Config,
data: editor2Config, data: editor2Config,
querySql: sql, querySql: sql,
......
...@@ -460,7 +460,7 @@ export default { ...@@ -460,7 +460,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchUp(list, selectIndexData) hsUtil.TableHandleModule.batchUp(list, selectIndexData)
}, },
/** /**
* 下移动 * 下移动
...@@ -473,7 +473,7 @@ export default { ...@@ -473,7 +473,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchDown(list, selectIndexData) hsUtil.TableHandleModule.batchDown(list, selectIndexData)
} }
} }
} }
......
...@@ -365,7 +365,7 @@ export default { ...@@ -365,7 +365,7 @@ export default {
}, },
async showDialog() { async showDialog() {
console.log('showDialog') console.log('showDialog')
const getClientWidth = hsUtil.System.getClientWidth() const getClientWidth = hsUtil.SystemModule.getClientWidth()
this.tableWithLeft = getClientWidth / 2 + 'px' this.tableWithLeft = getClientWidth / 2 + 'px'
this.tableWithRight = getClientWidth / 2 - 66 + 'px' this.tableWithRight = getClientWidth / 2 - 66 + 'px'
if (this.value) { if (this.value) {
...@@ -581,7 +581,7 @@ export default { ...@@ -581,7 +581,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchUp(this.rightTabeData, selectIndexData) hsUtil.TableHandleModule.batchUp(this.rightTabeData, selectIndexData)
}, },
/** /**
* 下移动 * 下移动
...@@ -593,7 +593,7 @@ export default { ...@@ -593,7 +593,7 @@ export default {
selectIndexData.push(index) selectIndexData.push(index)
} }
}) })
hsUtil.TableHandle.batchDown(this.rightTabeData, selectIndexData) hsUtil.TableHandleModule.batchDown(this.rightTabeData, selectIndexData)
} }
}, },
mounted() {} mounted() {}
......
...@@ -71,42 +71,6 @@ axios.interceptors.response.use( ...@@ -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) { function response_error_del(error) {
const { response, code } = error const { response, code } = error
const { status, statusText, data } = response || {} const { status, statusText, data } = response || {}
...@@ -148,7 +112,7 @@ function response_error_del(error) { ...@@ -148,7 +112,7 @@ function response_error_del(error) {
if (sessionStorage['platform']) { if (sessionStorage['platform']) {
store.commit('set_error_info', { error_title, error_detail }) store.commit('set_error_info', { error_title, error_detail })
} else { } else {
hsUtil.IframeMessage.sendErrorToWebframe({ error_title, error_detail }) hsUtil.IframeMessageModule.sendErrorToWebframe({ error_title, error_detail })
} }
} }
dealFileReader() dealFileReader()
...@@ -164,7 +128,7 @@ function response_error_del(error) { ...@@ -164,7 +128,7 @@ function response_error_del(error) {
if (sessionStorage['platform'] || top === self) { if (sessionStorage['platform'] || top === self) {
store.commit('set_error_info', { error_title, error_detail }) store.commit('set_error_info', { error_title, error_detail })
} else { } else {
hsUtil.IframeMessage.sendErrorToWebframe({ error_title, error_detail }) hsUtil.IframeMessageModule.sendErrorToWebframe({ error_title, error_detail })
} }
} }
axios.interceptors.request.use( 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 { WEB_QUERY, WEB_QUERY_QUERY, WEB_QUERY_QUERY_VALUE, WEB_QUERY_PAGE } from '../common/commonModule'
import hsUtil from 'hs-util-js' import hsUtil from 'hs-util-js'
const urlParam = hsUtil.System.getUrlParams() const urlParam = hsUtil.SystemModule.getUrlParams()
const { user_id } = hsUtil.System.parseGlobalParams() const { user_id } = hsUtil.SystemModule.parseGlobalParams()
class Control { class Control {
constructor(requestClient) { constructor(requestClient) {
this.requestClient = requestClient this.requestClient = requestClient
......
...@@ -1920,6 +1920,13 @@ axios@^0.19.2: ...@@ -1920,6 +1920,13 @@ axios@^0.19.2:
dependencies: dependencies:
follow-redirects "1.5.10" 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: babel-code-frame@^6.26.0:
version "6.26.0" version "6.26.0"
resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" 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: ...@@ -4686,6 +4693,11 @@ follow-redirects@^1.0.0:
dependencies: dependencies:
debug "^3.0.0" 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: for-in@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" 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: ...@@ -5108,13 +5120,18 @@ hpack.js@^2.1.6:
readable-stream "^2.0.1" readable-stream "^2.0.1"
wbuf "^1.1.0" wbuf "^1.1.0"
hs-util-js@^1.0.2: hs-util-js@^1.0.4:
version "1.0.2" version "1.0.4"
resolved "https://registry.npmjs.org/hs-util-js/-/hs-util-js-1.0.2.tgz#9aebf0e813ad24030cdcbe2c560e071029c87520" resolved "https://registry.npmjs.org/hs-util-js/-/hs-util-js-1.0.4.tgz#4729cb678b78ea0b4549a5492cb9368ec506d985"
integrity sha512-O0UqnUy/s1PPjByjD2KF8zAN6we7UZIDft5yuAsPyvE768XQXEg3VY6JivY59CRae4Xp5Zpam30+EA6JrVf7PA== integrity sha512-9UUfV3NdlLDT7kKp8Y+pcpnCuQuiQhp2Qkeht7kKgEbsnivPLVjJJstyY97rzNoTePi36iKmvozzPXMDejzqgQ==
dependencies: 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 "^5.10.1"
webpack-cli "^4.2.0" webpack-cli "^4.2.0"
xlsx "^0.16.9"
hsl-regex@^1.0.0: hsl-regex@^1.0.0:
version "1.0.0" version "1.0.0"
...@@ -5936,6 +5953,11 @@ jsprim@^1.2.2: ...@@ -5936,6 +5953,11 @@ jsprim@^1.2.2:
json-schema "0.2.3" json-schema "0.2.3"
verror "1.10.0" 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: keycode@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04" 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