1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* 系统常量定义编辑
* $Id: system_const_edit_input.inc,v 1.1 2020/01/12 11:18:53 lixq Exp $
* @author lixq
* @access public
* @package manager.templates
**/
global $id;
global $action_type;
global $system_const_dat;
global $error_message;
?>
<div id="change">
<p class="edit_title">系统常量定义添加</p>
<form id="form" method="post" action="system_const_edit_result.php" enctype="multipart/form-data">
<input type="hidden" name="action_type" value="<?=$action_type ?>"/>
<input type="hidden" name="id" value="<?=$id ?>"/>
<div class="edit_content">
<p><b>常量定义名:</b><el-input v-model="name" name="name" class="input_200"></el-input> <span style="color:#FF0000">(大写英文字母、下划线)</span><br /></p>
<p><b>文字描述:</b><el-input v-model="title" name="title" class="input_200"></el-input><br /></p>
<p><b>值:</b><textarea v-model="constant_value" name="constant_value" rows="10"></textarea><br /></p>
<el-button type="primary" @click="edit()" class="edit_btn" style="margin-left: 100px;">编辑</el-button>
<el-button type="primary" class="edit_btn" @Click="window.location='./system_const_list.php'" />返回</el-button>
</div>
</form>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
data:{
name:'<?=htmlspecialchars($system_const_dat->name) ?>',
title:'<?=htmlspecialchars($system_const_dat->title) ?>',
constant_value:'<?=htmlspecialchars($system_const_dat->constant_value) ?>'
},
methods:{
edit:function(){
if(!this.name){
this.$message({
type: 'error',
message: '请输入常量定义名!'
});
return;
}
if(!this.name.match(/^[A-Z_]{1,}$/)){
this.$message({
type: 'error',
message: '常量定义名格式不正确!'
});
return;
}
if(!this.title){
this.$message({
type: 'error',
message: '请输入文字描述!'
});
return;
}
if(!this.name){
this.$message({
type: 'error',
message: '请输入值!'
});
return;
}
$('#form').submit();
}
}
})
$(document).ready(function () {
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>