Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
515f8ff43f
|
@ -1,11 +1,21 @@
|
|||
<template>
|
||||
<a-modal :class="'custom-modal' + (innerFullscreen ? ' fullscreen' : '')" v-bind="_attrs" v-model="visible" @cancel="handleCancel">
|
||||
<a-modal
|
||||
:class="'custom-modal' + (innerFullscreen ? ' fullscreen' : '')"
|
||||
v-bind="_attrs"
|
||||
v-model="visible"
|
||||
:maskClosable="false"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<img slot="closeIcon" src="@/assets/images/global/close.png" />
|
||||
<div slot="title">
|
||||
<div class="custom-modal-title">
|
||||
<span>{{ title }}</span>
|
||||
<template v-if="enableFullScreen">
|
||||
<img v-if="innerFullscreen" src="@/assets/images/global/quit-fullscreen.png" @click="innerFullscreen = false" />
|
||||
<img
|
||||
v-if="innerFullscreen"
|
||||
src="@/assets/images/global/quit-fullscreen.png"
|
||||
@click="innerFullscreen = false"
|
||||
/>
|
||||
<img v-else src="@/assets/images/global/fullscreen.png" @click="innerFullscreen = true" />
|
||||
</template>
|
||||
</div>
|
||||
|
@ -24,24 +34,24 @@
|
|||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean
|
||||
type: Boolean,
|
||||
},
|
||||
okHandler: {
|
||||
type: Function
|
||||
type: Function,
|
||||
},
|
||||
title: {
|
||||
type: String
|
||||
type: String,
|
||||
},
|
||||
enableFullScreen: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: this.value,
|
||||
confirmLoading: false,
|
||||
innerFullscreen: false
|
||||
innerFullscreen: false,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -56,7 +66,7 @@ export default {
|
|||
},
|
||||
innerFullscreen(val) {
|
||||
this.$emit('fullscreen', val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async onSave() {
|
||||
|
@ -80,8 +90,8 @@ export default {
|
|||
this.visible = false
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit("cancel")
|
||||
}
|
||||
this.$emit('cancel')
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
_attrs() {
|
||||
|
@ -96,8 +106,8 @@ export default {
|
|||
// 是否有自定义的footer
|
||||
hasCustomFooter() {
|
||||
return !!this.$slots['custom-footer']
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -18,3 +18,40 @@ export const transformPointListData = pointlist => {
|
|||
}
|
||||
return pointlist.map(({ x, y }) => [x, y])
|
||||
}
|
||||
|
||||
// 查找最近的峰(C++相关)
|
||||
export const findNearPeak = (channel, peakList) => {
|
||||
let t_bFind = false, // 是否在峰内
|
||||
i = 0,
|
||||
peakNum = peakList.length
|
||||
for (; i < peakNum; ++i) {
|
||||
const peak = peakList[i]
|
||||
if (channel >= peak.left && channel <= peak.right) {
|
||||
// 如果 channel 在峰的左右边界内
|
||||
if (peak.multiIndex > 0 && channel > peak.peakCentroid) {
|
||||
// 如果是重峰,且 channel 在重峰的第一个峰的中心道右侧
|
||||
let j = i
|
||||
let temp = channel - peak.peakCentroid
|
||||
while (++j < peakNum && peakList[j].multiIndex == peak.multiIndex) {
|
||||
if (Math.abs(peakList[j].peakCentroid - channel) < temp) {
|
||||
// 找出重峰中峰中心道离 channel 最近的峰
|
||||
temp = Math.abs(peakList[j].peakCentroid - channel)
|
||||
i = j
|
||||
}
|
||||
}
|
||||
}
|
||||
// channel 在索引(i)对应的峰内
|
||||
t_bFind = true
|
||||
break
|
||||
} else if (peak.left > channel) {
|
||||
// channel 不在任何峰内,找离它最近的峰
|
||||
if (i > 0 && channel - peakList[i - 1].peakCentroid < peak.peakCentroid - channel) i -= 1
|
||||
break
|
||||
}
|
||||
}
|
||||
if (i >= peakNum) i -= 1
|
||||
return {
|
||||
index: i,
|
||||
find: t_bFind
|
||||
}
|
||||
}
|
||||
|
|
16890
src/views/spectrumAnalysis/baseCtrlJson.json
Normal file
16890
src/views/spectrumAnalysis/baseCtrlJson.json
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -216,7 +216,7 @@ import Response from './Response.json'
|
|||
import { updateBaseLine } from '@/utils/WasmHelper'
|
||||
import RectList from './components/RectList.vue'
|
||||
import { isNullOrUndefined } from '@/utils/util'
|
||||
import { getLineData, transformPointListData } from '@/utils/sampleHelper'
|
||||
import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampleHelper'
|
||||
|
||||
// 初始配置
|
||||
const initialOption = {
|
||||
|
@ -433,6 +433,12 @@ export default {
|
|||
EditSlopeModal,
|
||||
RectList,
|
||||
},
|
||||
props: {
|
||||
colorConfig: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -450,7 +456,6 @@ export default {
|
|||
list: [],
|
||||
BaseCtrls: {},
|
||||
baseCtrls_Copy: {},
|
||||
FitBaseLine: '#fff',
|
||||
sampleId: -1,
|
||||
|
||||
peakCommentModalVisible: false, // Comment 弹窗是否显示
|
||||
|
@ -502,7 +507,7 @@ export default {
|
|||
|
||||
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
|
||||
const {
|
||||
data: { allData, shadowChannelChart, shapeChannelData, peak },
|
||||
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls },
|
||||
} = currSampleDetailInfo
|
||||
|
||||
const channelBaseLine = getLineData(allData, 'BaseLine', 'channel')
|
||||
|
@ -515,8 +520,7 @@ export default {
|
|||
this.channelCountChart = shadowChannelChart
|
||||
this.channelPeakChart = channelPeakGroup
|
||||
this.energy = allEnergy
|
||||
// this.BaseCtrls = BaseCtrls
|
||||
// this.FitBaseLine = FitBaseLine
|
||||
this.BaseCtrls = BaseCtrls
|
||||
this.barChart = shadowChannelChart
|
||||
|
||||
this.setChartOption(channelBaseLine, shadowChannelChart, channelPeakGroup, shapeChannelData, shadowChannelChart)
|
||||
|
@ -566,36 +570,15 @@ export default {
|
|||
const { offsetX, offsetY } = param
|
||||
const point = getXAxisAndYAxisByPosition(this.$refs.chartRef.getChartInstance(), offsetX, offsetY)
|
||||
if (point) {
|
||||
const xAxis = parseInt(point[0].toFixed())
|
||||
this.option.series[0].markLine.data[0].xAxis = xAxis
|
||||
const xAxis = Math.round(point[0])
|
||||
this.setMarkLineXAxis(xAxis)
|
||||
|
||||
this.currChannel = xAxis
|
||||
|
||||
// 获取每一段 Channel 中的最大值
|
||||
const maxXAxises = this.getPeakMaxValues()
|
||||
|
||||
let index = 0
|
||||
// 计算当前选中的xAxis跟哪条 peak的最大值 最近
|
||||
if (xAxis >= maxXAxises[maxXAxises.length - 1]) {
|
||||
index = maxXAxises.length - 1
|
||||
} else if (xAxis <= maxXAxises[0]) {
|
||||
index = 0
|
||||
} else {
|
||||
for (let i = 1; i < maxXAxises.length; i++) {
|
||||
const prev = maxXAxises[i - 1]
|
||||
const curr = maxXAxises[i]
|
||||
|
||||
if (xAxis >= prev && xAxis <= curr) {
|
||||
index = xAxis - prev < curr - xAxis ? i - 1 : i
|
||||
break
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
const { index } = findNearPeak(xAxis, this.list)
|
||||
|
||||
if (this.list.length) {
|
||||
const selectedRow = this.list[index]
|
||||
this.selectedKeys = [selectedRow.index]
|
||||
this.selectTableRow(selectedRow.index)
|
||||
this.getSelPosNuclide(selectedRow)
|
||||
this.selectedTableItem = selectedRow
|
||||
}
|
||||
|
@ -645,34 +628,43 @@ export default {
|
|||
|
||||
// 切换图表上的红色竖线及表格选中
|
||||
handleChangeMarkLine(direction) {
|
||||
const markLineOption = this.option.series[0].markLine.data[0]
|
||||
const prevAxis = markLineOption.xAxis
|
||||
|
||||
// 获取每一段 Channel 中的最大值
|
||||
const maxXAxises = this.getPeakMaxValues()
|
||||
const prevAxis = this.getMarkLineXAxis()
|
||||
let i,
|
||||
size = this.list.length
|
||||
if (direction == 'next') {
|
||||
// 找到第一个比prevAxis大的xAxis
|
||||
const find = maxXAxises.find((xAxis) => xAxis > prevAxis)
|
||||
if (find) {
|
||||
markLineOption.xAxis = find
|
||||
for (i = 0; i < size; i++) {
|
||||
const centroid = Math.round(this.list[i].peakCentroid)
|
||||
if (centroid > prevAxis) {
|
||||
this.setMarkLineXAxis(centroid)
|
||||
const selectedRow = this.list[i]
|
||||
this.selectedTableItem = selectedRow
|
||||
this.selectTableRow(selectedRow.index)
|
||||
this.getSelPosNuclide(selectedRow)
|
||||
return
|
||||
}
|
||||
}
|
||||
} else if (direction == 'prev') {
|
||||
// 找到第一个比prevAxis小的xAxis
|
||||
const find = cloneDeep(maxXAxises)
|
||||
.reverse()
|
||||
.find((xAxis) => xAxis < prevAxis)
|
||||
if (find) {
|
||||
markLineOption.xAxis = find
|
||||
for (i = size - 1; i >= 0; i--) {
|
||||
if (Math.round(this.list[i].peakCentroid) < prevAxis) {
|
||||
this.setMarkLineXAxis(Math.round(this.list[i].peakCentroid))
|
||||
const selectedRow = this.list[i]
|
||||
this.selectedTableItem = selectedRow
|
||||
this.selectTableRow(selectedRow.index)
|
||||
this.getSelPosNuclide(selectedRow)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
const xAxis = markLineOption.xAxis
|
||||
if (xAxis >= 0) {
|
||||
const index = maxXAxises.findIndex((item) => item == xAxis)
|
||||
if (index !== -1) {
|
||||
this.selectedKeys = [this.list[index].index]
|
||||
}
|
||||
}
|
||||
selectTableRow(key) {
|
||||
this.selectedKeys = [key]
|
||||
},
|
||||
|
||||
// 设置红色标记线的位置
|
||||
setMarkLineXAxis(xAxis) {
|
||||
const markLineOption = this.option.series[0].markLine.data[0]
|
||||
markLineOption.xAxis = xAxis
|
||||
|
||||
const { xAxis: chartXAxisOption } = this.option
|
||||
const { max, min } = chartXAxisOption
|
||||
|
@ -688,6 +680,11 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
getMarkLineXAxis() {
|
||||
const markLineOption = this.option.series[0].markLine.data[0]
|
||||
return markLineOption.xAxis
|
||||
},
|
||||
|
||||
// 获取右下角possible nuclide 和 identified nuclide
|
||||
async getSelPosNuclide(row) {
|
||||
this.model.possibleNuclide = ''
|
||||
|
@ -699,7 +696,7 @@ export default {
|
|||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
|
||||
sampleId,
|
||||
channel: parseInt(row.peakCentroid),
|
||||
channel: Math.round(row.peakCentroid),
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
|
@ -776,6 +773,7 @@ export default {
|
|||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData,
|
||||
peak: table,
|
||||
})
|
||||
|
||||
this.channelPeakChart = channelPeakChart
|
||||
|
@ -864,6 +862,7 @@ export default {
|
|||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData,
|
||||
peak: table,
|
||||
})
|
||||
|
||||
this.channelPeakChart = channelPeakChart
|
||||
|
@ -881,7 +880,10 @@ export default {
|
|||
series.push(this.buildCtrlPoint(this.channelBaseCPChart))
|
||||
|
||||
this.list = table
|
||||
|
||||
this.opts.notMerge = true
|
||||
this.option.series = series
|
||||
this.resetChartOpts()
|
||||
|
||||
this.selectedKeys = []
|
||||
} else {
|
||||
|
@ -917,7 +919,7 @@ export default {
|
|||
return
|
||||
}
|
||||
|
||||
const channel = row.peakCentroid
|
||||
const channel = Math.round(row.peakCentroid)
|
||||
this.currChannel = channel
|
||||
|
||||
this.option.series[0].markLine.data[0].xAxis = channel
|
||||
|
@ -1041,7 +1043,7 @@ export default {
|
|||
const baseLineEditSeries = buildLineSeries(
|
||||
'BaseLine_Edit',
|
||||
this.baseCtrls_Copy.baseline.map((val, index) => [index + 1, val]),
|
||||
this.FitBaseLine,
|
||||
this.colorConfig.Color_Fitbase || '#fff',
|
||||
{
|
||||
zlevel: 21,
|
||||
}
|
||||
|
|
|
@ -30,6 +30,13 @@ const columns = [
|
|||
title: 'Value',
|
||||
dataIndex: 'value',
|
||||
align: 'center',
|
||||
customRender: (text) => {
|
||||
if (text !== 'Match' && text !== 'UnMatch') {
|
||||
return parseFloat(Number(text).toPrecision(6))
|
||||
} else {
|
||||
return text
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Status',
|
||||
|
|
|
@ -24,53 +24,59 @@ const configList = [
|
|||
{
|
||||
title: 'Spectrum Line',
|
||||
key: 'Color_Spec',
|
||||
desc: 'Color of the original spectrum line'
|
||||
desc: 'Color of the original spectrum line',
|
||||
},
|
||||
{
|
||||
title: 'Baseline',
|
||||
key: 'Color_Base',
|
||||
desc: 'Color of baseline'
|
||||
desc: 'Color of baseline',
|
||||
},
|
||||
{
|
||||
title: 'Lc Line',
|
||||
key: 'Color_Lc',
|
||||
desc: 'Color of lc line'
|
||||
desc: 'Color of lc line',
|
||||
},
|
||||
{
|
||||
title: 'Scac Line',
|
||||
key: 'Color_Scac',
|
||||
desc: 'Color of scac line'
|
||||
desc: 'Color of scac line',
|
||||
},
|
||||
{
|
||||
title: 'Peak Line',
|
||||
key: 'Color_Peak',
|
||||
desc: "Color of all peaks' curve"
|
||||
desc: "Color of all peaks' curve",
|
||||
},
|
||||
{
|
||||
title: 'Compare Line',
|
||||
key: 'Color_Compare',
|
||||
desc: 'Color of another spectrum line which is used to compare with current spectrum'
|
||||
desc: 'Color of another spectrum line which is used to compare with current spectrum',
|
||||
},
|
||||
{
|
||||
title: 'Spec Sum Line',
|
||||
key: 'Color_Strip',
|
||||
desc: 'Color of the line which is the sum of current spectrum and other spectrum Multiplied by a ratio'
|
||||
desc: 'Color of the line which is the sum of current spectrum and other spectrum Multiplied by a ratio',
|
||||
},
|
||||
{
|
||||
title: 'Spec Cut Line',
|
||||
key: 'spectCutLine',
|
||||
desc: 'Color of the line which is the difference of current spectrum and other spectrum Multiplied by a ratio'
|
||||
desc: 'Color of the line which is the difference of current spectrum and other spectrum Multiplied by a ratio',
|
||||
},
|
||||
{
|
||||
title: 'FitBase Line',
|
||||
key: 'Color_Fitbase',
|
||||
desc: 'Color of the base line in edit state'
|
||||
}
|
||||
desc: 'Color of the base line in edit state',
|
||||
},
|
||||
]
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
components: {
|
||||
ColorPicker
|
||||
ColorPicker,
|
||||
},
|
||||
props: {
|
||||
colorConfig: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.configList = configList
|
||||
|
@ -84,8 +90,8 @@ export default {
|
|||
Color_Compare: 'green', // Sample -> Compare下的颜色
|
||||
Color_Strip: 'rgb(0, 0, 255)', // Sample -> Compare下的颜色
|
||||
spectCutLine: 'rgb(33, 90, 104)', // 无作用
|
||||
Color_Fitbase: 'white' // Interactive Tool 弹窗中,进入BaseLine编辑模式时的基线副本的颜色
|
||||
}
|
||||
Color_Fitbase: 'white', // Interactive Tool 弹窗中,进入BaseLine编辑模式时的基线副本的颜色
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -93,40 +99,16 @@ export default {
|
|||
return color
|
||||
},
|
||||
|
||||
async getData() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await getAction('/gamma/viewColorConfig')
|
||||
if (success) {
|
||||
Object.entries(result).forEach(([k, v]) => {
|
||||
beforeModalOpen() {
|
||||
Object.entries(this.colorConfig).forEach(([k, v]) => {
|
||||
this.config[k] = v
|
||||
})
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
this.getData()
|
||||
},
|
||||
|
||||
// 应用颜色
|
||||
async handleApply() {
|
||||
const {
|
||||
Color_Spec,
|
||||
Color_Peak,
|
||||
Color_Lc,
|
||||
Color_Base,
|
||||
Color_Scac,
|
||||
Color_Compare,
|
||||
Color_Strip,
|
||||
Color_Fitbase
|
||||
} = this.config
|
||||
const { Color_Spec, Color_Peak, Color_Lc, Color_Base, Color_Scac, Color_Compare, Color_Strip, Color_Fitbase } =
|
||||
this.config
|
||||
const { success, message } = await putAction('/gamma/updateColorConfig', {
|
||||
colorSpec: Color_Spec,
|
||||
colorPeak: Color_Peak,
|
||||
|
@ -135,22 +117,16 @@ export default {
|
|||
colorScac: Color_Scac,
|
||||
colorCompare: Color_Compare,
|
||||
colorFitbase: Color_Fitbase,
|
||||
colorStrip: Color_Strip
|
||||
colorStrip: Color_Strip,
|
||||
})
|
||||
if (success) {
|
||||
this.$bus.$emit(
|
||||
'colorChange',
|
||||
Object.entries(this.config).reduce((prev, [key, value]) => {
|
||||
prev[key] = value
|
||||
return prev
|
||||
}, {})
|
||||
)
|
||||
this.$emit('colorChange', this.config)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
throw new Error(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0
|
||||
}
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1
|
||||
}
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Energy">
|
||||
|
@ -54,13 +54,7 @@
|
|||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
accept=".ent"
|
||||
style="display: none;"
|
||||
@change="handleFileChange"
|
||||
/>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
|
@ -126,23 +120,23 @@ const columns = [
|
|||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Efficiency',
|
||||
dataIndex: 'efficiency',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
|
@ -150,99 +144,99 @@ const initialOption = {
|
|||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal'
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: params => {
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const energy = parseInt(x)
|
||||
const efficiency = y.toFixed(3)
|
||||
return `<div class="channel">Energy: ${energy}</div>
|
||||
<div class="energy">Efficiency: ${efficiency}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip'
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14
|
||||
}
|
||||
fontSize: 14,
|
||||
},
|
||||
series: []
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
const functions = [
|
||||
{
|
||||
label: 'Interpolation',
|
||||
value: 1
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: 'HT Efficiency',
|
||||
value: 5
|
||||
value: 5,
|
||||
},
|
||||
{
|
||||
label: 'Log Polynomial',
|
||||
value: 6
|
||||
value: 6,
|
||||
},
|
||||
{
|
||||
label: 'Invlog Polynomial',
|
||||
value: 8
|
||||
value: 8,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-3)',
|
||||
value: 93
|
||||
value: 93,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-2)',
|
||||
value: 94
|
||||
value: 94,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-2-3)',
|
||||
value: 95
|
||||
}
|
||||
value: 95,
|
||||
},
|
||||
]
|
||||
|
||||
export default {
|
||||
|
@ -266,11 +260,11 @@ export default {
|
|||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true
|
||||
notMerge: true,
|
||||
},
|
||||
ECutAnalysis_Low: -1,
|
||||
G_energy_span: -1,
|
||||
funcId: 1
|
||||
funcId: 1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -282,7 +276,7 @@ export default {
|
|||
sampleId,
|
||||
fileName,
|
||||
currentText,
|
||||
width: 922
|
||||
width: 922,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
@ -332,15 +326,15 @@ export default {
|
|||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0
|
||||
}
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
|
@ -390,7 +384,7 @@ export default {
|
|||
|
||||
this.list.splice(i, 0, {
|
||||
energy: energy,
|
||||
efficiency
|
||||
efficiency,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
@ -463,12 +457,12 @@ export default {
|
|||
const { success, result, message } = await postAction('/gamma/changeDataEfficiency', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurEffi: this.list.map(item => item.efficiency),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurEffi: this.list.map((item) => item.efficiency),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
funcId: this.funcId,
|
||||
width: 922
|
||||
width: 922,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
|
@ -487,10 +481,10 @@ export default {
|
|||
try {
|
||||
this.isSaving = true
|
||||
const res = await postAction('/gamma/saveDataEfficiency', {
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurEffi: this.list.map(item => item.efficiency),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurEffi: this.list.map((item) => item.efficiency),
|
||||
m_vCurUncert: this.uncert,
|
||||
funcId: this.funcId
|
||||
funcId: this.funcId,
|
||||
})
|
||||
if (typeof res == 'string') {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
|
@ -548,18 +542,18 @@ export default {
|
|||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataEfficiency', {
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurEffi: this.list.map(item => item.efficiency),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurEffi: this.list.map((item) => item.efficiency),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
|
@ -591,8 +585,8 @@ export default {
|
|||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0
|
||||
}
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1
|
||||
}
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Channel">
|
||||
|
@ -54,13 +54,7 @@
|
|||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
accept=".ent"
|
||||
style="display: none;"
|
||||
@change="handleFileChange"
|
||||
/>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
|
@ -121,23 +115,23 @@ const columns = [
|
|||
{
|
||||
title: 'Channel',
|
||||
dataIndex: 'channel',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
|
@ -145,68 +139,68 @@ const initialOption = {
|
|||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal'
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: params => {
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const channel = parseInt(x)
|
||||
const energy = y.toFixed(3)
|
||||
return `<div class="channel">Channel: ${channel}</div>
|
||||
<div class="energy">Energy: ${energy}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip'
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14
|
||||
}
|
||||
fontSize: 14,
|
||||
},
|
||||
series: []
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
export default {
|
||||
|
@ -228,11 +222,11 @@ export default {
|
|||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true
|
||||
notMerge: true,
|
||||
},
|
||||
|
||||
rg_high: -1,
|
||||
rg_low: -1
|
||||
rg_low: -1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -244,7 +238,7 @@ export default {
|
|||
sampleId,
|
||||
fileName,
|
||||
currentText,
|
||||
width: 922
|
||||
width: 922,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
@ -294,15 +288,15 @@ export default {
|
|||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0
|
||||
}
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
|
@ -351,7 +345,7 @@ export default {
|
|||
|
||||
this.list.splice(i, 0, {
|
||||
channel: centroid,
|
||||
energy
|
||||
energy,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
@ -424,11 +418,11 @@ export default {
|
|||
const { success, result, message } = await postAction('/gamma/changeDataEnergy', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurCentroid: this.list.map(item => item.channel),
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurCentroid: this.list.map((item) => item.channel),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
width: 922
|
||||
width: 922,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
|
@ -447,9 +441,9 @@ export default {
|
|||
try {
|
||||
this.isSaving = true
|
||||
const res = await postAction('/gamma/saveDataEnergy', {
|
||||
m_vCurCentroid: this.list.map(item => item.channel),
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurUncert: this.uncert
|
||||
m_vCurCentroid: this.list.map((item) => item.channel),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurUncert: this.uncert,
|
||||
})
|
||||
if (typeof res == 'string') {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
|
@ -507,18 +501,18 @@ export default {
|
|||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataEnergy', {
|
||||
m_vCurCentroid: this.list.map(item => item.channel),
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurCentroid: this.list.map((item) => item.channel),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
|
@ -550,8 +544,8 @@ export default {
|
|||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
</template>
|
||||
<!-- 底部按钮结束 -->
|
||||
</custom-modal>
|
||||
<a-modal v-model="visible_file" :width="1200" title="File List" @cancel="cancelFileModale">
|
||||
<a-modal v-model="visible_file" :width="1200" title="File List" :maskClosable="false" @cancel="cancelFileModale">
|
||||
<a-spin :spinning="loading_file">
|
||||
<div style="position: relative; padding-bottom: 40px; height: 460px; overflow: hidden">
|
||||
<a-row type="flex" style="margin-bottom: 15px">
|
||||
|
@ -445,7 +445,9 @@ export default {
|
|||
})
|
||||
|
||||
if (findFile) {
|
||||
const regExp = new RegExp(`(${otherFilePrefix}${fileType}_${qualify}_\\d{1,}\\.{0,}\\d{0,}).*?(\\.PHD)`)
|
||||
const regExp = new RegExp(
|
||||
`(${otherFilePrefix}${fileType}_${qualify}_\\d{1,}\\.{0,}\\d{0,}).*?(\\.PHD)`
|
||||
)
|
||||
record[nameKeys[index]] = {
|
||||
file: findFile,
|
||||
fileName: findFile.name.replace(regExp, '$1$2'),
|
||||
|
|
|
@ -64,53 +64,56 @@ const columns = [
|
|||
title: 'Energy (keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Yield (%)',
|
||||
dataIndex: 'yield',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Efficiency',
|
||||
dataIndex: 'efficiency',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Activity (Bq)',
|
||||
dataIndex: 'activity',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Act Err (%)',
|
||||
dataIndex: 'actErr',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'MDA (Bq)',
|
||||
dataIndex: 'mda',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Conc (uBq/m3)',
|
||||
dataIndex: 'conc',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(6) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'MDC (uBq/m3)',
|
||||
dataIndex: 'mdc',
|
||||
customRender: (text) => {
|
||||
return text && text !== 'null' ? Number(text).toPrecision(5) : text
|
||||
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -86,9 +86,7 @@
|
|||
</div>
|
||||
<div class="nuclide-library-settings-operation">
|
||||
<a-space :size="10">
|
||||
<span>
|
||||
Energy:
|
||||
</span>
|
||||
<span> Energy: </span>
|
||||
<a-input v-model="model.editEnergy"></a-input>
|
||||
<a-input-number
|
||||
v-model="model.err"
|
||||
|
@ -122,18 +120,18 @@ const daughterColumns = [
|
|||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'daughters',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Ratio',
|
||||
dataIndex: 'branchingratios',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Status',
|
||||
dataIndex: 'daughtersstable',
|
||||
align: 'center'
|
||||
}
|
||||
align: 'center',
|
||||
},
|
||||
]
|
||||
|
||||
// 主体表格配置
|
||||
|
@ -143,43 +141,35 @@ const mainColumns = [
|
|||
width: 80,
|
||||
customRender: (_, __, index) => {
|
||||
return index + 1
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Full Name',
|
||||
dataIndex: 'fullName'
|
||||
dataIndex: 'fullName',
|
||||
},
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
width: 100,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Energy Uncert(%)',
|
||||
dataIndex: 'energyUncert',
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text ? toFixed(text * 100, 6) : ''
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text * 100).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Yield',
|
||||
dataIndex: 'yield',
|
||||
width: 80,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Yield Uncert(%)',
|
||||
dataIndex: 'yieldUncert',
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'KeyLine',
|
||||
|
@ -187,15 +177,15 @@ const mainColumns = [
|
|||
width: 100,
|
||||
align: 'center',
|
||||
scopedSlots: {
|
||||
customRender: 'keyLine'
|
||||
}
|
||||
}
|
||||
customRender: 'keyLine',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
components: {
|
||||
TitleOverBorder
|
||||
TitleOverBorder,
|
||||
},
|
||||
data() {
|
||||
this.daughterColumns = daughterColumns
|
||||
|
@ -210,7 +200,7 @@ export default {
|
|||
model: {},
|
||||
|
||||
selectedNuclide: {}, // 当前选中的Nuclide
|
||||
selectedParent: {} // 当前选中的Parent
|
||||
selectedParent: {}, // 当前选中的Parent
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -224,19 +214,19 @@ export default {
|
|||
const { success, result, message } = await getAction('/gamma/NuclideLibrary', {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.model
|
||||
...this.model,
|
||||
})
|
||||
if (success) {
|
||||
const {
|
||||
daughter: { list_parent, table_daughter },
|
||||
nuclLinesLibs,
|
||||
nuclideInfo,
|
||||
nuclides
|
||||
nuclides,
|
||||
} = result
|
||||
|
||||
this.nuclideList = nuclides
|
||||
this.parentList = list_parent ? list_parent.filter(item => item) : []
|
||||
this.daughterList = table_daughter ? table_daughter.filter(item => item.daughters) : []
|
||||
this.parentList = list_parent ? list_parent.filter((item) => item) : []
|
||||
this.daughterList = table_daughter ? table_daughter.filter((item) => item.daughters) : []
|
||||
this.nuclideInfo = nuclideInfo
|
||||
this.nuclLinesLibs = nuclLinesLibs
|
||||
|
||||
|
@ -259,7 +249,7 @@ export default {
|
|||
libraryName: 'UserLibrary',
|
||||
err: 0.5,
|
||||
editEnergy: '',
|
||||
nuclideName: ''
|
||||
nuclideName: '',
|
||||
}
|
||||
this.getInfo(true)
|
||||
},
|
||||
|
@ -300,8 +290,8 @@ export default {
|
|||
handleParentDBClick(item) {
|
||||
this.model.nuclideName = item
|
||||
this.getInfo()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0
|
||||
}
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1
|
||||
}
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Energy">
|
||||
|
@ -54,13 +54,7 @@
|
|||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
accept=".ent"
|
||||
style="display: none;"
|
||||
@change="handleFileChange"
|
||||
/>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
|
@ -121,23 +115,23 @@ const columns = [
|
|||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'FWHM(keV)',
|
||||
dataIndex: 'fwhm',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
|
@ -145,68 +139,68 @@ const initialOption = {
|
|||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal'
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: params => {
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const energy = parseInt(x)
|
||||
const fwhm = y.toFixed(3)
|
||||
return `<div class="channel">Energy: ${energy}</div>
|
||||
<div class="energy">Fwhm: ${fwhm}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip'
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14
|
||||
}
|
||||
fontSize: 14,
|
||||
},
|
||||
series: []
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
export default {
|
||||
|
@ -228,10 +222,10 @@ export default {
|
|||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true
|
||||
notMerge: true,
|
||||
},
|
||||
ECutAnalysis_Low: -1,
|
||||
G_energy_span: -1
|
||||
G_energy_span: -1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -243,7 +237,7 @@ export default {
|
|||
sampleId,
|
||||
fileName,
|
||||
currentText,
|
||||
width: 922
|
||||
width: 922,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
@ -293,15 +287,15 @@ export default {
|
|||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0
|
||||
}
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
|
@ -350,7 +344,7 @@ export default {
|
|||
|
||||
this.list.splice(i, 0, {
|
||||
energy: energy,
|
||||
fwhm
|
||||
fwhm,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
@ -423,10 +417,10 @@ export default {
|
|||
const { success, result, message } = await postAction('/gamma/changeDataResolution', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurReso: this.list.map(item => item.fwhm),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param
|
||||
m_curParam: this.param,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
|
@ -445,9 +439,9 @@ export default {
|
|||
try {
|
||||
this.isSaving = true
|
||||
const res = await postAction('/gamma/saveDataResolution', {
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurReso: this.list.map(item => item.fwhm),
|
||||
m_vCurUncert: this.uncert
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||
m_vCurUncert: this.uncert,
|
||||
})
|
||||
if (typeof res == 'string') {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
|
@ -505,18 +499,18 @@ export default {
|
|||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter(item => item.includes('Input')).length + 1}`
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataResolution', {
|
||||
m_vCurEnergy: this.list.map(item => item.energy),
|
||||
m_vCurReso: this.list.map(item => item.fwhm),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
|
@ -548,8 +542,8 @@ export default {
|
|||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -47,10 +47,12 @@ const columns = [
|
|||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Centroid',
|
||||
dataIndex: 'centroid',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Multiplet',
|
||||
|
@ -59,22 +61,27 @@ const columns = [
|
|||
{
|
||||
title: 'Fwhm(keV)',
|
||||
dataIndex: 'fwhm',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'NetArea',
|
||||
dataIndex: 'netArea',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'AreaErr(%)',
|
||||
dataIndex: 'areaErr',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Significant',
|
||||
dataIndex: 'significant',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Sensitivity',
|
||||
dataIndex: 'sensitivity',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
},
|
||||
{
|
||||
title: 'Indentify',
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<!-- 二级交互栏结束 -->
|
||||
<!-- 主体部分 -->
|
||||
<div class="gamma-analysis-main">
|
||||
<div class="gamma-analysis-chart">
|
||||
<div class="gamma-analysis-chart" ref="chartContainerRef" tabindex="0" @keydown="handleKeyboardEvent">
|
||||
<CustomChart
|
||||
ref="chartRef"
|
||||
:option="option"
|
||||
|
@ -140,6 +140,8 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|||
import StripModal from './components/Modals/StripModal.vue'
|
||||
import { FilePicker } from '@/utils/FilePicker'
|
||||
import { zipFile } from '@/utils/file'
|
||||
import { findNearPeak } from '@/utils/sampleHelper'
|
||||
import baseCtrlJson from './baseCtrlJson.json'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
@ -232,20 +234,14 @@ export default {
|
|||
this.setChartBottomTitle(0, 0, 0)
|
||||
this.option.tooltip.formatter = this.tooltipFormatter
|
||||
|
||||
this.$bus.$on('colorChange', this.handleColorChange)
|
||||
this.$bus.$on('gammaRefresh', this.handleRefresh)
|
||||
this.$bus.$on('accept', this.handleAccept)
|
||||
|
||||
document.addEventListener('keydown', this.handleKeyboardEvent)
|
||||
},
|
||||
destroyed() {
|
||||
this.cancelLastRequest()
|
||||
|
||||
this.$bus.$off('colorChange', this.handleColorChange)
|
||||
this.$bus.$off('gammaRefresh', this.handleRefresh)
|
||||
this.$bus.$off('accept', this.handleAccept)
|
||||
|
||||
document.removeEventListener('keydown', this.handleKeyboardEvent)
|
||||
},
|
||||
mounted() {
|
||||
this.option.brush = { toolbox: [] }
|
||||
|
@ -534,7 +530,7 @@ export default {
|
|||
|
||||
this.$store.commit('ADD_SAMPLE_DATA', {
|
||||
inputFileName,
|
||||
data: result,
|
||||
data: Object.assign(result, { BaseCtrls: baseCtrlJson }),
|
||||
from: flag,
|
||||
})
|
||||
|
||||
|
@ -867,6 +863,7 @@ export default {
|
|||
|
||||
// 点击图表,设置红线
|
||||
handleChartClick(param) {
|
||||
this.$refs.chartContainerRef.focus()
|
||||
const { offsetX, offsetY } = param
|
||||
const point = getXAxisAndYAxisByPosition(this.getChart(), offsetX, offsetY)
|
||||
if (point) {
|
||||
|
@ -883,50 +880,13 @@ export default {
|
|||
|
||||
// 设置图表底部的标题
|
||||
setChartBottomTitle(channel, energy, counts) {
|
||||
const { index, find } = this.findNearPeak(channel)
|
||||
const { index, find } = findNearPeak(channel, this.peakList)
|
||||
|
||||
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${energy || '0.00'}} {a|Counts:${
|
||||
counts || '0.0'
|
||||
}} {a|Significance:${find ? this.peakList[index].significance.toFixed(2) : '0.00'}}`
|
||||
},
|
||||
|
||||
// 查找最近的峰(C++相关)
|
||||
findNearPeak(channel) {
|
||||
let t_bFind = false,
|
||||
i = 0,
|
||||
peakNum = this.peakList.length
|
||||
for (; i < peakNum; ++i) {
|
||||
const peak = this.peakList[i]
|
||||
if (channel >= peak.left && channel <= peak.right) {
|
||||
// 如果 channel 在峰的左右边界内
|
||||
if (peak.multiIndex > 0 && channel > peak.peakCentroid) {
|
||||
// 如果是重峰,且 channel 在重峰的第一个峰的中心道右侧
|
||||
let j = i
|
||||
let temp = channel - peak.peakCentroid
|
||||
while (++j < peakNum && this.peakList[j].multiIndex == peak.multiIndex) {
|
||||
if (Math.abs(this.peakList[j].peakCentroid - channel) < temp) {
|
||||
// 找出重峰中峰中心道离 channel 最近的峰
|
||||
temp = Math.abs(this.peakList[j].peakCentroid - channel)
|
||||
i = j
|
||||
}
|
||||
}
|
||||
}
|
||||
// channel 在索引(i)对应的峰内
|
||||
t_bFind = true
|
||||
break
|
||||
} else if (peak.left > channel) {
|
||||
// channel 不在任何峰内,找离它最近的峰
|
||||
if (i > 0 && channel - this.peakList[i - 1].peakCentroid < peak.peakCentroid - channel) i -= 1
|
||||
break
|
||||
}
|
||||
}
|
||||
if (i >= peakNum) i -= 1
|
||||
return {
|
||||
index: i,
|
||||
find: t_bFind,
|
||||
}
|
||||
},
|
||||
|
||||
// 根据xAixs值找channel、energy和counts
|
||||
getEnergyAndCountsByXAxis(xAxis) {
|
||||
let channel, energy, counts
|
||||
|
@ -1342,6 +1302,7 @@ export default {
|
|||
// 从分析工具刷新部分数据
|
||||
handleRefresh(data) {
|
||||
data.DetailedInformation = this.detailedInfomation
|
||||
data.QCFlag = this.qcFlags
|
||||
this.clearCompareLine()
|
||||
this.redrawPeakLine()
|
||||
this.dataProcess(data)
|
||||
|
@ -1349,36 +1310,29 @@ export default {
|
|||
|
||||
// 分析工具Accept时刷新部分数据
|
||||
handleAccept(data) {
|
||||
console.log('%c [ data ]-1166', 'font-size:13px; background:pink; color:#bf2c9f;', data)
|
||||
const {
|
||||
allData,
|
||||
barChart,
|
||||
channelBaseLineChart,
|
||||
peakSet,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeData,
|
||||
shapeEnergyData,
|
||||
} = data
|
||||
|
||||
const result = {
|
||||
DetailedInformation: this.detailedInfomation,
|
||||
QCFlag: this.qcFlags,
|
||||
allData,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
|
||||
shapeChannelData,
|
||||
shapeEnergyData,
|
||||
peak: peakSet,
|
||||
}
|
||||
this.clearCompareLine()
|
||||
this.channelData.peakGroup = this.getLineData(allData, 'Peak', 'channel', true)
|
||||
this.energyData.peakGroup = this.getLineData(allData, 'Peak', 'energy', true)
|
||||
this.redrawPeakLine()
|
||||
|
||||
this.channelData.baseLine = this.getLineData(allData, 'BaseLine', 'channel')
|
||||
this.energyData.baseLine = this.getLineData(allData, 'BaseLine', 'energy')
|
||||
this.redrawLineBySeriesName(
|
||||
'BaseLine',
|
||||
this.energyData.baseLine,
|
||||
this.channelData.baseLine,
|
||||
this.graphAssistance.Baseline
|
||||
)
|
||||
|
||||
this.channelData.baseLineCP = shapeChannelData
|
||||
this.energyData.baseLineCP = shapeEnergyData
|
||||
this.redrawCtrlPointBySeriesName()
|
||||
this.dataProcess(result)
|
||||
},
|
||||
|
||||
// 显示比较弹窗
|
||||
|
@ -1771,6 +1725,7 @@ export default {
|
|||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&-thumbnail {
|
||||
|
|
|
@ -91,7 +91,11 @@
|
|||
<!-- 分析-设置弹窗结束 -->
|
||||
|
||||
<!-- 分析工具弹窗开始 -->
|
||||
<analyze-interactive-tool-modal v-model="analyzeInteractiveToolModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<analyze-interactive-tool-modal
|
||||
v-model="analyzeInteractiveToolModalVisible"
|
||||
:sampleId="sampleData.sampleId"
|
||||
:colorConfig="colorConfig"
|
||||
/>
|
||||
<!-- 分析工具弹窗结束 -->
|
||||
|
||||
<!-- Korsum 弹窗开始 -->
|
||||
|
@ -119,7 +123,7 @@
|
|||
<!-- SpectrumComments 弹窗结束 -->
|
||||
|
||||
<!-- Color Config 弹窗开始 -->
|
||||
<color-config-modal v-model="colorConfigModalVisible" />
|
||||
<color-config-modal v-model="colorConfigModalVisible" :colorConfig="colorConfig" @colorChange="handleColorChange" />
|
||||
<!-- Color Config 弹窗结束 -->
|
||||
|
||||
<!-- Data Processing Log 弹窗开始 -->
|
||||
|
@ -397,6 +401,8 @@ export default {
|
|||
isReAnalyed_beta: false,
|
||||
|
||||
isSaving: false,
|
||||
|
||||
colorConfig: {}, // 颜色配置
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -407,6 +413,7 @@ export default {
|
|||
// dbName: 'auto',
|
||||
// inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
|
||||
// })
|
||||
this.getColorConfig()
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
|
@ -426,10 +433,10 @@ export default {
|
|||
},
|
||||
getStationName(arg, val, flag) {
|
||||
arg.forEach((item) => {
|
||||
item.conc = Number(item.conc).toFixed(6)
|
||||
item.concErr = Number(item.concErr).toFixed(6)
|
||||
item.lc = Number(item.lc).toFixed(6)
|
||||
item.mdc = Number(item.mdc).toFixed(6)
|
||||
item.conc = Number(item.conc).toPrecision(6)
|
||||
item.concErr = Number(item.concErr).toPrecision(6)
|
||||
item.lc = Number(item.lc).toPrecision(6)
|
||||
item.mdc = Number(item.mdc).toPrecision(6)
|
||||
})
|
||||
this.resultDisplayFlag = arg
|
||||
this.params_toDB.stationName = val
|
||||
|
@ -718,10 +725,10 @@ export default {
|
|||
this.analyseCurrentSpectrumData = res.result
|
||||
this.resultDisplayFlag = res.result.XeData
|
||||
this.resultDisplayFlag.forEach((item) => {
|
||||
item.conc = item.conc.toFixed(6)
|
||||
item.concErr = item.concErr.toFixed(6)
|
||||
item.lc = item.lc.toFixed(6)
|
||||
item.mdc = item.mdc.toFixed(6)
|
||||
item.conc = item.conc.toPrecision(6)
|
||||
item.concErr = item.concErr.toPrecision(6)
|
||||
item.lc = item.lc.toPrecision(6)
|
||||
item.mdc = item.mdc.toPrecision(6)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
|
@ -743,10 +750,10 @@ export default {
|
|||
this.analyseCurrentSpectrumData = res.result
|
||||
this.resultDisplayFlag = res.result.XeData
|
||||
this.resultDisplayFlag.forEach((item) => {
|
||||
item.conc = item.conc.toFixed(6)
|
||||
item.concErr = item.concErr.toFixed(6)
|
||||
item.lc = item.lc.toFixed(6)
|
||||
item.mdc = item.mdc.toFixed(6)
|
||||
item.conc = item.conc.toPrecision(6)
|
||||
item.concErr = item.concErr.toPrecision(6)
|
||||
item.lc = item.lc.toPrecision(6)
|
||||
item.mdc = item.mdc.toPrecision(6)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
|
@ -764,6 +771,26 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取颜色配置
|
||||
async getColorConfig() {
|
||||
try {
|
||||
const { success, result, message } = await getAction('/gamma/viewColorConfig')
|
||||
if (success) {
|
||||
this.colorConfig = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 颜色修改
|
||||
handleColorChange(colorConfig) {
|
||||
this.colorConfig = colorConfig
|
||||
this.$refs.gammaAnalysisRef.handleColorChange(colorConfig)
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
// 顶部菜单栏配置
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
|
@ -10,46 +11,26 @@
|
|||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="itemText"
|
||||
label="Name">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemText" label="Name">
|
||||
<a-input placeholder="Please Enter Name" v-model="model.itemText" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="itemValue"
|
||||
label="Item Value">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemValue" label="Item Value">
|
||||
<a-input placeholder="Please Enter Item Value" v-model="model.itemValue" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="Description">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Description">
|
||||
<a-input v-model="model.description" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="Sort">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Sort">
|
||||
<a-input-number :min="1" v-model="model.sortOrder" />
|
||||
The Smaller The Value, the More Advanced
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="Enable"
|
||||
hasFeedback>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Enable" hasFeedback>
|
||||
<a-switch checkedChildren="Enable" unCheckedChildren="Disable" @change="onChose" v-model="visibleCheck" />
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
|
@ -61,14 +42,14 @@
|
|||
import { getAction } from '@api/manage'
|
||||
|
||||
export default {
|
||||
name: "DictItemModal",
|
||||
name: 'DictItemModal',
|
||||
data() {
|
||||
return {
|
||||
title: "操作",
|
||||
title: '操作',
|
||||
visible: false,
|
||||
visibleCheck: true,
|
||||
model: {},
|
||||
dictId: "",
|
||||
dictId: '',
|
||||
status: 1,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
|
@ -85,75 +66,76 @@
|
|||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
add(dictId) {
|
||||
this.dictId = dictId;
|
||||
this.dictId = dictId
|
||||
//初始化默认值
|
||||
this.edit({sortOrder:1,status:1});
|
||||
this.edit({ sortOrder: 1, status: 1 })
|
||||
},
|
||||
edit(record) {
|
||||
if (record.id) {
|
||||
this.dictId = record.dictId;
|
||||
this.dictId = record.dictId
|
||||
}
|
||||
this.status = record.status;
|
||||
this.visibleCheck = (record.status == 1) ? true : false;
|
||||
this.model = Object.assign({}, record);
|
||||
this.model.dictId = this.dictId;
|
||||
this.model.status = this.status;
|
||||
this.visible = true;
|
||||
this.status = record.status
|
||||
this.visibleCheck = record.status == 1 ? true : false
|
||||
this.model = Object.assign({}, record)
|
||||
this.model.dictId = this.dictId
|
||||
this.model.status = this.status
|
||||
this.visible = true
|
||||
},
|
||||
onChose(checked) {
|
||||
if (checked) {
|
||||
this.status = 1;
|
||||
this.visibleCheck = true;
|
||||
this.status = 1
|
||||
this.visibleCheck = true
|
||||
} else {
|
||||
this.status = 0;
|
||||
this.visibleCheck = false;
|
||||
this.status = 0
|
||||
this.visibleCheck = false
|
||||
}
|
||||
},
|
||||
// 确定
|
||||
handleOk() {
|
||||
const that = this;
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.$refs.form.validate(valid => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
that.confirmLoading = true;
|
||||
that.confirmLoading = true
|
||||
this.model.itemText = (this.model.itemText || '').trim()
|
||||
this.model.itemValue = (this.model.itemValue || '').trim()
|
||||
this.model.description = (this.model.description || '').trim()
|
||||
this.model.status = this.status;
|
||||
let obj;
|
||||
this.model.status = this.status
|
||||
let obj
|
||||
if (!this.model.id) {
|
||||
obj = addDictItem(this.model);
|
||||
obj = addDictItem(this.model)
|
||||
} else {
|
||||
obj = editDictItem(this.model);
|
||||
obj = editDictItem(this.model)
|
||||
}
|
||||
obj.then((res) => {
|
||||
obj
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
.finally(() => {
|
||||
that.confirmLoading = false
|
||||
that.close()
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 关闭
|
||||
handleCancel() {
|
||||
this.close();
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
this.$refs.form.resetFields();
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
validateItemValue(rule, value, callback) {
|
||||
let param = {
|
||||
|
@ -166,22 +148,22 @@
|
|||
if (value) {
|
||||
let reg = new RegExp("[`~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
|
||||
if (reg.test(value)) {
|
||||
callback("Cannot Have Special Charactors")
|
||||
callback('Cannot Have Special Charactors')
|
||||
} else {
|
||||
//update--begin--autor:lvdandan-----date:20201203------for:JT-27【数据字典】字典 - 数据值可重复
|
||||
getAction("/sys/dictItem/dictItemCheck",param).then((res)=>{
|
||||
getAction('/sys/dictItem/dictItemCheck', param).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback(res.message);
|
||||
callback(res.message)
|
||||
}
|
||||
});
|
||||
})
|
||||
//update--end--autor:lvdandan-----date:20201203------for:JT-27【数据字典】字典 - 数据值可重复
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
:title="title"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
|
@ -10,32 +11,17 @@
|
|||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="dictName"
|
||||
required
|
||||
label="Dict Name">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dictName" required label="Dict Name">
|
||||
<a-input placeholder="Please Enter Dict Name" v-model="model.dictName" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="dictCode"
|
||||
required
|
||||
label="Dict Code">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dictCode" required label="Dict Code">
|
||||
<a-input placeholder="Please Enter Dict Code" v-model="model.dictCode" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="Description">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Description">
|
||||
<a-input v-model="model.description" />
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
|
@ -55,23 +41,20 @@
|
|||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules: {
|
||||
dictName: [{ required: true, message: 'Please Enter Dict Name' }],
|
||||
dictCode: [
|
||||
{ required: true, message: 'Please Enter Dict Code' },
|
||||
{ validator: this.validateDictCode }]
|
||||
}
|
||||
dictCode: [{ required: true, message: 'Please Enter Dict Code' }, { validator: this.validateDictCode }],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
validateDictCode(rule, value, callback) {
|
||||
// 重复校验
|
||||
|
@ -79,7 +62,7 @@
|
|||
tableName: 'sys_dict',
|
||||
fieldName: 'dict_code',
|
||||
fieldVal: value,
|
||||
dataId: this.model.id
|
||||
dataId: this.model.id,
|
||||
}
|
||||
duplicateCheck(params).then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -108,7 +91,7 @@
|
|||
handleOk() {
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.$refs.form.validate(valid => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
that.confirmLoading = true
|
||||
this.model.dictName = (this.model.dictName || '').trim()
|
||||
|
@ -120,19 +103,21 @@
|
|||
} else {
|
||||
obj = editDict(this.model)
|
||||
}
|
||||
obj.then((res) => {
|
||||
obj
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
that.confirmLoading = false
|
||||
that.close()
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -143,8 +128,8 @@
|
|||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
}
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
|
@ -3,20 +3,16 @@
|
|||
:title="title"
|
||||
:width="1000"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
:cancelButtonProps="{ props: { type: 'warn' } }"
|
||||
cancelText="Cancel">
|
||||
|
||||
cancelText="Cancel"
|
||||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="ruleName"
|
||||
label="Rule Name">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleName" label="Rule Name">
|
||||
<a-input placeholder="Please Enter Rule Name" v-model="model.ruleName" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item
|
||||
|
@ -24,34 +20,28 @@
|
|||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="ruleColumn"
|
||||
label="Rule Column">
|
||||
label="Rule Column"
|
||||
>
|
||||
<a-input placeholder="Please Enter Rule Column" v-model.trim="model.ruleColumn" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="ruleConditions"
|
||||
label="Rule Conditions">
|
||||
<j-dict-select-tag @input="handleChangeRuleCondition" v-model="model.ruleConditions" placeholder="Please Enter Rule Conditions" dictCode="rule_conditions"/>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleConditions" label="Rule Conditions">
|
||||
<j-dict-select-tag
|
||||
@input="handleChangeRuleCondition"
|
||||
v-model="model.ruleConditions"
|
||||
placeholder="Please Enter Rule Conditions"
|
||||
dictCode="rule_conditions"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="ruleValue"
|
||||
label="Rule Value">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleValue" label="Rule Value">
|
||||
<a-input placeholder="Please Enter Rule Value" v-model="model.ruleValue" />
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="Status">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Status">
|
||||
<a-radio-group buttonStyle="solid" v-model="model.status">
|
||||
<a-radio-button value="1">Valid</a-radio-button>
|
||||
<a-radio-button value="0">Invalid</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
|
@ -70,11 +60,11 @@
|
|||
ruleConditionList: [],
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: {span: 5}
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: {span: 16}
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
permissionId: '',
|
||||
|
@ -82,18 +72,17 @@
|
|||
ruleConditions: [{ required: true, message: '请选择条件!' }],
|
||||
ruleName: [{ required: true, message: '请输入规则名称!' }],
|
||||
ruleValue: [{ required: true, message: '请输入规则值!' }],
|
||||
ruleColumn: []
|
||||
ruleColumn: [],
|
||||
},
|
||||
url: {
|
||||
list: '/sys/dictItem/list',
|
||||
add: '/sys/permission/addPermissionRule',
|
||||
edit: '/sys/permission/editPermissionRule'
|
||||
edit: '/sys/permission/editPermissionRule',
|
||||
},
|
||||
showRuleColumn:true
|
||||
showRuleColumn: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
add(permId) {
|
||||
this.permissionId = permId
|
||||
|
@ -118,7 +107,7 @@
|
|||
handleOk() {
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.$refs.form.validate(valid => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
that.confirmLoading = true
|
||||
let httpurl = ''
|
||||
|
@ -130,19 +119,21 @@
|
|||
httpurl += this.url.edit
|
||||
method = 'put'
|
||||
}
|
||||
httpAction(httpurl, this.model, method).then((res) => {
|
||||
httpAction(httpurl, this.model, method)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
that.confirmLoading = false
|
||||
that.close()
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -163,11 +154,10 @@
|
|||
} else {
|
||||
this.showRuleColumn = true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -5,29 +5,27 @@
|
|||
:title="title"
|
||||
:width="1000"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
:cancelButtonProps="{ props: { type: 'warn' } }"
|
||||
cancelText="Cancel">
|
||||
|
||||
|
||||
cancelText="Cancel"
|
||||
>
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :span="10">
|
||||
<a-form-item label="User Name">
|
||||
<a-input v-model="queryParam.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">Search</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">Reset</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
@ -42,14 +40,17 @@
|
|||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:scroll="{ y: 240 }"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
:rowSelection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onSelectAll: onSelectAll,
|
||||
onSelect: onSelect,
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
@change="handleTableChange"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -59,10 +60,10 @@
|
|||
import { getAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: "SelectUserModal",
|
||||
name: 'SelectUserModal',
|
||||
data() {
|
||||
return {
|
||||
title: "Add From List",
|
||||
title: 'Add From List',
|
||||
names: [],
|
||||
visible: false,
|
||||
placement: 'right',
|
||||
|
@ -76,61 +77,60 @@
|
|||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 50,
|
||||
align: "center",
|
||||
align: 'center',
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1;
|
||||
}
|
||||
return parseInt(index) + 1
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'username'
|
||||
dataIndex: 'username',
|
||||
},
|
||||
{
|
||||
title: 'Real Name',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'realname'
|
||||
dataIndex: 'realname',
|
||||
},
|
||||
{
|
||||
title: 'Gender',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'sex_dictText'
|
||||
dataIndex: 'sex_dictText',
|
||||
},
|
||||
{
|
||||
title: 'Phone',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'phone'
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: 'Org',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: 'orgCode'
|
||||
}
|
||||
dataIndex: 'orgCode',
|
||||
},
|
||||
],
|
||||
columns2: [
|
||||
{
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: 'username',
|
||||
|
||||
},
|
||||
{
|
||||
title: 'Real Name',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: 'realname',
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
dataIndex: 'action',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
},
|
||||
],
|
||||
//数据集
|
||||
dataSource1: [],
|
||||
|
@ -146,7 +146,7 @@
|
|||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
total: 0,
|
||||
},
|
||||
isorter: {
|
||||
column: 'createTime',
|
||||
|
@ -156,52 +156,52 @@
|
|||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
url: {
|
||||
list: "/sys/user/list",
|
||||
}
|
||||
list: '/sys/user/list',
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadData();
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
searchQuery() {
|
||||
this.loadData(1);
|
||||
this.loadData(1)
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {};
|
||||
this.loadData(1);
|
||||
this.queryParam = {}
|
||||
this.loadData(1)
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
this.dataSource2 = this.selectedRowKeys;
|
||||
console.log("data:" + this.dataSource2);
|
||||
this.$emit("selectFinished", this.dataSource2);
|
||||
this.visible = false;
|
||||
this.dataSource2 = this.selectedRowKeys
|
||||
console.log('data:' + this.dataSource2)
|
||||
this.$emit('selectFinished', this.dataSource2)
|
||||
this.visible = false
|
||||
},
|
||||
add() {
|
||||
this.visible = true;
|
||||
this.visible = true
|
||||
},
|
||||
loadData(arg) {
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
var params = this.getQueryParams();//查询条件
|
||||
var params = this.getQueryParams() //查询条件
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource1 = res.result.records;
|
||||
this.ipagination.total = res.result.total;
|
||||
this.dataSource1 = res.result.records
|
||||
this.ipagination.total = res.result.total
|
||||
}
|
||||
})
|
||||
},
|
||||
getQueryParams() {
|
||||
var param = Object.assign({}, this.queryParam, this.isorter);
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
return filterObj(param);
|
||||
var param = Object.assign({}, this.queryParam, this.isorter)
|
||||
param.field = this.getQueryField()
|
||||
param.pageNo = this.ipagination.current
|
||||
param.pageSize = this.ipagination.pageSize
|
||||
return filterObj(param)
|
||||
},
|
||||
getQueryField() {
|
||||
//TODO 字段权限控制
|
||||
|
@ -209,50 +209,49 @@
|
|||
onSelectAll(selected, selectedRows, changeRows) {
|
||||
if (selected === true) {
|
||||
for (var a = 0; a < changeRows.length; a++) {
|
||||
this.dataSource2.push(changeRows[a]);
|
||||
this.dataSource2.push(changeRows[a])
|
||||
}
|
||||
} else {
|
||||
for (var b = 0; b < changeRows.length; b++) {
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1);
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1)
|
||||
}
|
||||
}
|
||||
// console.log(selected, selectedRows, changeRows);
|
||||
},
|
||||
onSelect(record, selected) {
|
||||
if (selected === true) {
|
||||
this.dataSource2.push(record);
|
||||
this.dataSource2.push(record)
|
||||
} else {
|
||||
var index = this.dataSource2.indexOf(record);
|
||||
var index = this.dataSource2.indexOf(record)
|
||||
//console.log();
|
||||
if (index >= 0) {
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onSelectChange(selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
this.selectionRows = selectedRows;
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
this.selectionRows = selectedRows
|
||||
},
|
||||
onClearSelected() {
|
||||
this.selectedRowKeys = [];
|
||||
this.selectionRows = [];
|
||||
this.selectedRowKeys = []
|
||||
this.selectionRows = []
|
||||
},
|
||||
handleDelete: function (record) {
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
|
||||
this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
|
||||
},
|
||||
handleTableChange(pagination, filters, sorter) {
|
||||
//分页、排序、筛选变化时触发
|
||||
console.log(sorter);
|
||||
console.log(sorter)
|
||||
//TODO 筛选
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||
}
|
||||
this.ipagination = pagination;
|
||||
this.loadData();
|
||||
}
|
||||
this.isorter.column = sorter.field
|
||||
this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
|
||||
}
|
||||
this.ipagination = pagination
|
||||
this.loadData()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
@ -266,24 +265,24 @@
|
|||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user